/* All V1 overrides are opt-in and desktop-only; legacy/mobile styles remain intact. */
@media (min-width: 901px) {
    body.crm-v1-shell {
        --v1-canvas: #fafbfc;
        --v1-surface: #fff;
        --v1-soft: #f5f7f8;
        --v1-text: #17191b;
        --v1-secondary: #3d454b;
        --v1-muted: #63717b;
        --v1-primary: #0d7049;
        --v1-border: #e4e8eb;
        --v1-selected: #eaf5ef;
        --v1-unread: #0d7049;
        --v1-attention: #f4cf54;
        --v1-space-1: 4px;
        --v1-space-2: 8px;
        --v1-space-3: 12px;
        --v1-space-4: 16px;
        --v1-space-6: 24px;
        --v1-control-radius: 6px;
        --v1-bubble-radius: 6px;
        --v1-dialog-radius: 8px;
        --canvas: var(--v1-canvas);
        --surface: var(--v1-surface);
        --surface-soft: var(--v1-soft);
        --ink: var(--v1-text);
        --ink-soft: var(--v1-secondary);
        --muted: var(--v1-muted);
        --line: var(--v1-border);
        --green: var(--v1-primary);
        --green-soft: var(--v1-selected);
        font-family: Arial, Helvetica, sans-serif;
        grid-template-rows: 64px minmax(0, 1fr);
    }
    .crm-v1-shell .staff-topbar { height: 64px; min-height: 64px; padding: 8px 24px; box-shadow: none; }
    .crm-v1-shell .staff-brand { gap: 16px; }
    .crm-v1-shell .staff-brand img { width: 88px; height: 40px; object-fit: contain; }
    .crm-v1-shell .staff-brand > span { border-left: 1px solid var(--line); padding-left: 16px; }
    .crm-v1-shell .staff-brand strong { font-size: 15px; }
    .crm-v1-shell #crmApp { display: block; }
    .crm-v1-shell .crm-v1-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); height: 100%; min-height: 0; }
    .crm-v1-sidebar { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); background: var(--surface); }
    .crm-v1-shell .crm-nav { flex: 0 0 auto; border: 0; padding: 12px 12px 16px; }
    .crm-v1-shell .crm-nav__primary { display: block; }
    .crm-v1-shell .crm-nav__primary > :not(.crm-v1-role-menu):not(#crmManagementNav) { display: none; }
    .crm-v1-shell .crm-nav__footer { display: none; }
    .crm-v1-section-label { color: var(--muted); font-size: 11px; text-transform: uppercase; height: 24px; padding: 0 8px; }
    .crm-v1-shell .crm-nav__item { height: 40px; min-height: 40px; padding: 8px 10px; gap: 10px; border: 0; border-radius: var(--v1-control-radius); font-size: 14px; font-weight: 400; }
    .crm-v1-shell .crm-v1-role-menu .crm-nav__item { width: 100%; text-align: left; background: transparent; }
    .crm-v1-shell .crm-v1-role-menu .crm-nav__item:hover:not(:disabled) { background: var(--surface-soft); }
    .crm-v1-shell .crm-nav__item[aria-current="page"], .crm-v1-shell .crm-nav__item.is-current { background: var(--green-soft); color: var(--green); font-weight: 600; }
    .crm-v1-shell .crm-nav__item:disabled { opacity: 1; color: #84919a; cursor: not-allowed; }
    .crm-v1-shell .crm-nav__count { background: transparent; color: var(--muted); font-weight: 400; }
    .crm-v1-shell #crmInbox { flex: 1; min-height: 0; display: flex; flex-direction: column; border-top: 1px solid var(--line); }
    .crm-v1-shell .crm-inbox__header { flex: 0 0 auto; display: flex; align-items: center; padding: 12px 16px 8px; gap: 8px; }
    .crm-v1-shell .crm-inbox__header h2 { flex: 1; font-size: 16px; }
    .crm-v1-shell #crmInboxNewGroup { display: grid; place-content: center; flex: 0 0 32px; width: 32px; height: 32px; min-height: 32px; padding: 4px; }
    .crm-v1-shell #crmInboxNewGroup span { display: none; }
    .crm-v1-directory-controls { display: flex; gap: 8px; padding: 0 16px 8px; }
    .crm-v1-directory-controls .crm-nav__item { display: flex; gap: 6px; height: 28px; min-height: 28px; padding: 4px 8px; font-size: 12px; }
    .crm-v1-directory-controls .icon { width: 14px; height: 14px; }
    .crm-v1-directory-controls .crm-nav__count { min-width: 16px; height: 16px; font-size: 11px; }
    .crm-v1-directory-search { display: flex; align-items: center; gap: 8px; height: 38px; flex: 0 0 38px; margin: 0 16px 10px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--v1-control-radius); background: var(--surface-soft); }
    .crm-v1-directory-search .icon { width: 16px; height: 16px; flex: 0 0 auto; color: var(--muted); }
    .crm-v1-directory-search input { width: 100%; min-width: 0; background: transparent; border: 0; padding: 0; height: 34px; font-size: 12px; }
    .crm-v1-shell .crm-inbox__list { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; }
    .crm-v1-shell .crm-inbox__list li { border-bottom: 0; }
    .crm-v1-shell .crm-inbox-row { height: 72px; min-height: 72px; padding: 10px 16px; grid-template-columns: 40px minmax(0, 1fr) 42px; gap: 10px; }
    .crm-v1-shell .crm-inbox-row[aria-current="true"] { background: var(--green-soft); box-shadow: inset 3px 0 var(--green); }
    .crm-v1-shell .crm-inbox-row__avatar { width: 40px; height: 40px; font-size: 13px; }
    .crm-v1-shell .crm-inbox-row__copy { gap: 4px; }
    .crm-v1-shell .crm-inbox-row__copy strong { font-size: 14px; }
    .crm-v1-shell .crm-inbox-row__copy > span { font-size: 12px; }
    .crm-v1-shell .crm-inbox-row__badge { background: var(--v1-unread); min-width: 18px; height: 18px; font-size: 11px; }
    .crm-v1-work { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
    .crm-v1-main { flex: 1; min-height: 0; min-width: 0; display: grid; grid-template-rows: minmax(0, 1fr); }
    .crm-v1-shell #crmContent { height: 100%; min-height: 0; grid-area: 1 / 1; }
    .crm-v1-shell #crmDayView { padding: 0; }
    .crm-v1-shell #crmDayView > .crm-day-grid, .crm-v1-shell #crmDayView > .crm-view-header, .crm-v1-shell #crmHomeTasks { display: none; }
    .crm-v1-shell #crmDayView::after { content: 'Выберите чат'; display: grid; place-items: center; height: 100%; color: var(--muted); font-size: 14px; }
    .crm-v1-layout.has-conversation #crmContent { visibility: hidden; }
    .crm-v1-shell .crm-v1-work > .crm-panel--calendar { flex: 0 0 auto; padding: 0; margin: 0; border-bottom: 1px solid var(--line); }
    .crm-v1-shell .staff-calendar { background: var(--surface); }
    .crm-v1-shell .crm-v1-work > .crm-panel--calendar > .crm-panel__heading, .crm-v1-shell #crmDateTasks { display: none; }
    .crm-v1-shell .staff-calendar__toolbar { height: 36px; min-height: 36px; margin: 0; gap: 16px; border-bottom: 1px solid var(--line); }
    .crm-v1-shell .staff-calendar__toolbar > .icon-button { width: 30px; height: 30px; min-height: 30px; }
    .crm-v1-shell .staff-calendar__full-date { padding: 0 12px; height: 32px; font-size: 14px; font-weight: 600; border: 0; border-radius: 6px; background: transparent; }
    .crm-v1-shell .staff-calendar__week { height: 68px; grid-template-columns: repeat(7, minmax(0, 1fr)); padding: 0 24px; }
    .crm-v1-shell .staff-calendar__column { border-right: 1px solid var(--line); }
    .crm-v1-shell .staff-calendar__column:first-child { border-left: 1px solid var(--line); }
    .crm-v1-shell .staff-calendar__column.is-selected { background: var(--v1-selected); box-shadow: inset 0 -2px var(--green); }
    .crm-v1-shell .staff-calendar__day { height: 68px; padding: 8px 12px; display: flex; gap: 4px; align-items: stretch; justify-content: center; text-align: left; }
    .crm-v1-shell .staff-calendar__day-title { display: flex; align-items: center; gap: 6px; }
    .crm-v1-shell .staff-calendar__day strong { font-size: 16px; color: var(--ink); }
    .crm-v1-shell .staff-calendar__day[aria-current="date"]::after { display: none; }
    .crm-v1-shell .staff-calendar__today { margin-left: auto; color: #255c85; font-size: 10px; }
    .crm-v1-shell .staff-calendar__counts { display: flex; align-items: center; height: 20px; gap: 12px; }
    .crm-v1-shell .staff-calendar__count { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); }
    .crm-v1-shell .staff-calendar__count .icon { width: 14px; height: 14px; }
    .crm-v1-shell .staff-calendar__count > span { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: #edf0f2; color: var(--ink-soft); font-size: 11px; }
    .crm-v1-shell .staff-calendar__choices { display: flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding-top: 2px; }
    .crm-v1-shell .staff-calendar__choices button { height: 30px; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); font-size: 12px; }
    .crm-v1-shell .staff-calendar__choices button[aria-expanded="true"] { background: var(--surface-soft); border-color: #9eabb4; }
    .crm-v1-shell .staff-calendar__detail { max-height: 144px; overflow-y: auto; padding: 0 24px 8px; border-top: 1px solid var(--line); }
    .crm-v1-shell .staff-calendar__detail-heading { min-height: 32px; margin: 0; }
    .crm-v1-shell .staff-calendar__detail-heading h3 { font-size: 12px; }
    .crm-v1-shell .staff-calendar__detail-controls .icon-button { width: 28px; height: 28px; min-height: 28px; }
    .crm-v1-shell .staff-calendar__agenda-row { min-height: 28px; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; padding: 5px 0; font-size: 12px; border-color: #edf0f2; }
    .crm-v1-shell .staff-calendar__agenda-copy { grid-column: 1; grid-row: 1; min-width: 0; }
    .crm-v1-shell .staff-calendar__agenda-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .crm-v1-shell .staff-calendar__agenda-type, .crm-v1-shell .staff-calendar__agenda-people, .crm-v1-shell .staff-calendar__overdue { display: none; }
    .crm-v1-shell .staff-calendar__agenda-time { grid-column: 2; grid-row: 1; font-size: 11px; align-self: center; white-space: nowrap; }
    .crm-v1-shell .staff-calendar__agenda-time small { display: inline; margin: 0 0 0 4px; }
    .crm-v1-shell .staff-calendar__agenda-status { grid-column: 3; color: #255c85; font-size: 11px; }
    .crm-v1-shell .staff-calendar__agenda-status.is-overdue { color: #a13f38; }
    .crm-v1-shell .staff-calendar__agenda-status.is-completed { color: var(--muted); }
    .crm-v1-shell .staff-calendar__agenda-row.is-overdue { border-left: 0; }
    .crm-v1-shell .staff-calendar__picker { top: 36px; border-radius: 8px; }
    .crm-v1-shell #crmConversationDialog { position: static; inset: auto; grid-area: 1 / 1; width: 100%; height: 100%; margin: 0; padding: 0; border: 0; border-radius: 0; max-height: none; max-width: none; box-shadow: none; }
    .crm-v1-shell #crmConversationDialog[open] { display: grid; grid-template-rows: 72px minmax(0, 1fr); }
    .crm-v1-shell #crmConversationNotice { display: none; }
    .crm-v1-shell .crm-conversation-dialog__bar { height: 72px; padding: 12px 24px; }
    .crm-v1-shell #crmMessagesView { height: 100%; min-height: 0; }
    .crm-v1-shell .crm-team-stream, .crm-v1-shell .message-stream { padding: 16px 32px; background: var(--canvas); }
    .crm-v1-shell .crm-team-message { max-width: min(680px, 88%); gap: 8px; margin-bottom: 12px; }
    .crm-v1-shell .crm-team-message__avatar { width: 28px; height: 28px; font-size: 11px; background: #e8edf1; color: #526774; }
    .crm-v1-shell .crm-team-message__content, .crm-v1-shell .message-bubble { border-radius: var(--v1-bubble-radius); border: 1px solid var(--line); background: var(--surface); box-shadow: none; }
    .crm-v1-shell .crm-team-message.is-own .crm-team-message__content, .crm-v1-shell .message-row--outgoing .message-bubble { background: var(--v1-selected); border-color: #d8e9df; }
    .crm-v1-shell .message-row--note .message-bubble { background: var(--yellow-soft); }
    .crm-v1-shell .file-message { background: var(--surface); border-color: var(--line); border-radius: var(--v1-control-radius); box-shadow: none; }
    .crm-v1-shell .crm-team-message__content p { font-size: 14px; line-height: 1.5; }
    .crm-v1-shell .crm-team-message__quote { border-left: 2px solid #80af99; background: #f5f8f6; }
    .crm-v1-shell .crm-team-composer, .crm-v1-shell .composer { padding: 16px 24px; background: var(--surface); border-top: 1px solid var(--line); }
    .crm-v1-shell .crm-team-composer { grid-template-columns: 32px minmax(0, 1fr) 42px; gap: 12px; }
    .crm-v1-shell .crm-team-composer textarea, .crm-v1-shell .composer textarea { background: var(--surface-soft); border-color: var(--line); border-radius: var(--v1-control-radius); font-size: 14px; }
    .crm-v1-shell .primary-action, .crm-v1-shell .secondary-action { border-radius: var(--v1-control-radius); }
    .crm-v1-shell .crm-attachment-menu { border-radius: var(--v1-dialog-radius); }
}
