/* Унифицирующий слой базовых примитивов Apple Workspace (подключается последним) */
.lh-page-head { display: flex; flex-direction: column; gap: 2px; padding: 2px 2px 0; flex-shrink: 0; }
.lh-page-title { font-size: 21px; line-height: 26px; font-weight: 600; letter-spacing: -0.02em; color: var(--text); }
.lh-page-subtitle { font-size: 13px; line-height: 18px; color: var(--secondary-text); }

/* Спокойные однотонные пилюли статусов без цветных точек */
.lh-badge { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: var(--radius-pill); font-size: 12px; line-height: 16px; font-weight: 500; background: var(--field) !important; color: var(--secondary-text) !important; }
.lh-badge::before { display: none !important; content: none !important; }
.lh-badge-ok { background: var(--semantic-ok-bg) !important; color: var(--semantic-ok) !important; }
.lh-badge-warn, .lh-badge-ostrovok { background: var(--semantic-warn-bg) !important; color: var(--semantic-warn) !important; }
.lh-badge-err, .lh-badge-sutochno { background: var(--semantic-err-bg) !important; color: var(--semantic-err) !important; }
.lh-badge-avito { background: var(--semantic-info-bg) !important; color: var(--semantic-info) !important; }
.lh-badge-neutral { background: var(--field) !important; color: var(--secondary-text) !important; }

/* Единый современный контейнер таблиц (Apple Workspace — без угловатости 2010 года и без капслока) */
.lh-table-wrap { width: 100%; background: var(--surface); border-radius: 14px; overflow-x: auto; overflow-y: hidden; }
.lh-section .lh-table-wrap, .lh-mac-settings-body .lh-table-wrap { background: var(--canvas); padding: 2px; }
.lh-tahoe-body .lh-table-wrap { background: var(--surface); }
.lh-table-wrap .lh-table:not(.lh-fixed-table) { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; line-height: 19px; background: var(--surface); border-radius: 12px; overflow: hidden; }
.lh-table-wrap .lh-table:not(.lh-fixed-table) th { position: static; padding: 10px 16px; text-align: left; font-size: 12px; font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--secondary-text); background: #f8f8fa; border-bottom: 1px solid var(--divider); white-space: nowrap; }
.lh-table-wrap .lh-table:not(.lh-fixed-table) td { padding: 12px 16px; border-bottom: 1px solid #ededf2; vertical-align: middle; transition: background-color 80ms ease; }
.lh-table-wrap .lh-table:not(.lh-fixed-table) tbody tr:last-child td { border-bottom: 0; }
.lh-table-wrap .lh-table:not(.lh-fixed-table) tbody tr:hover td { background: rgba(29, 29, 31, 0.03); }

/* Единый видимый тональный фон полей ввода (и на белой странице, и внутри Tahoe-окон) */
.lh-input, .lh-select, .lh-textarea-shell, .lh-dropdown-trigger, .lh-dp-trigger,
.lh-file-picker, .lh-stepper-btn, .lh-tahoe-row-ctrl .lh-input, .lh-tahoe-row-ctrl .lh-select,
.lh-tahoe-row-ctrl .lh-textarea-shell, .lh-tahoe-row-ctrl .lh-dropdown-trigger, .lh-tahoe-row-ctrl .lh-dp-trigger {
  background: var(--field); color: var(--text); border: 0; box-shadow: none;
}
.lh-tahoe-shell .lh-tahoe-row-ctrl .lh-input, .lh-tahoe-shell .lh-tahoe-row-ctrl .lh-textarea-shell,
.lh-tahoe-shell .lh-tahoe-row-ctrl .lh-dropdown-trigger, .lh-tahoe-shell .lh-tahoe-row-ctrl .lh-dp-trigger,
.lh-tahoe-shell .lh-tahoe-row-ctrl .lh-stepper-btn { background: var(--field-on-canvas); }
.lh-textarea-shell .lh-textarea { background: transparent; outline: 0; }
.lh-input:focus, .lh-input:focus-visible, .lh-textarea-shell:focus-within,
.lh-dropdown.is-open .lh-dropdown-trigger, .lh-dropdown-trigger:focus-visible,
.lh-dp-trigger:focus-visible, .lh-search-pill:focus-within {
  background: var(--hover); outline: 2px solid var(--focus-ring); outline-offset: -2px;
}

/* Тихие ghost-иконки, обычное начертание логинов в таблицах и стабильный hover без двойных скачков */
.lh-btn-ghost, .lh-btn-quiet { background: transparent; color: var(--secondary-text); }
.lh-btn-ghost:hover, .lh-btn-quiet:hover { background: var(--field); color: var(--text); }
.lh-btn:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 1px; }
.lh-tahoe-tab-btn.is-active:hover { background: #1d1d1f; color: #ffffff; }
.lh-table td code { font-family: inherit; font-size: inherit; background: transparent; padding: 0; color: var(--text); }
.lh-figma-studio { height: 100%; flex: 1; min-height: 0; }
.lh-toolbar-dd { width: auto !important; min-width: 158px; max-width: 224px; flex-shrink: 0; }
.lh-toolbar-dd .lh-dropdown-trigger { height: 34px; font-size: 13px; border-radius: 9px; }

/* Плоские поверхности без лишних теней (единственная мягкая тень — только при необходимости у островка) */
.lh-sidebar, .lh-tahoe-sidebar, .lh-dropdown-popup, .lh-ctx-menu, .lh-ctx-submenu,
.lh-modal-card, .lh-agent-layout, .lh-agent-composer-box, .lh-cms-drawer,
.lh-prem-detail-popover, .lh-cp-popover, .lh-dp-card, .lh-tooltip, .lh-toast,
.lh-rc-error-toast, .lh-selection-dock, .lh-map-pill-bar, .lh-map-event-popover,
.lh-ymap-price-pin, .lh-lm-map-pin, .lh-agent-thread-item.is-active { box-shadow: none !important; }
.lh-tahoe-sidebar, .lh-dropdown-popup, .lh-ctx-menu, .lh-ctx-submenu, .lh-modal-card,
.lh-agent-composer-box, .lh-cms-drawer, .lh-prem-detail-popover, .lh-cp-popover,
.lh-dp-card, .lh-map-pill-bar, .lh-map-event-popover, .lh-ymap-price-pin, .lh-lm-map-pin { border: 1px solid var(--divider) !important; }

/* Clean Tabs — плоские вкладки с ровной базовой линией и чётким нижним индикатором */
.lh-subtabs { display: inline-flex; align-items: center; gap: 2px; padding: 0; background: transparent; border-radius: 0; border-bottom: 1px solid var(--divider); flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.lh-subtabs::-webkit-scrollbar { display: none; }
.lh-subtab-btn { position: relative; height: 34px; padding: 0 12px; border: 0; border-radius: 8px 8px 0 0; background: transparent; color: var(--secondary-text); font-size: 13px; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; white-space: nowrap; transition: color 90ms ease, background-color 90ms ease; }
.lh-subtab-btn::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: 0; height: 2px; border-radius: 2px 2px 0 0; background: transparent; }
.lh-subtab-btn:hover { background: var(--field); color: var(--text); }
.lh-subtab-btn.is-active { background: transparent; color: var(--text); font-weight: 500; }
.lh-subtab-btn.is-active::after { background: var(--text); }
.lh-subtab-btn:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: -2px; }
.lh-subtab-count { font-size: 11px; font-weight: 500; padding: 1px 6px; border-radius: var(--radius-pill); background: var(--field); color: var(--secondary-text); font-variant-numeric: tabular-nums; }
.lh-subtab-btn.is-active .lh-subtab-count { background: var(--text); color: var(--surface); }
.lh-figma-bottom-bar .lh-subtabs { background: var(--surface); border: 1px solid var(--divider); border-radius: 10px; padding: 2px; }

/* Fluid Icon-to-Label Pill Bar */
.lh-fluid-bar { display: inline-flex; align-items: center; gap: 2px; padding: 3px; background: var(--canvas); border: 1px solid var(--divider); border-radius: var(--radius-pill); flex-wrap: nowrap; max-width: 100%; }
.lh-fluid-btn { height: 32px; padding: 0 8px; border: 0; border-radius: var(--radius-pill); background: transparent; color: var(--text); font-size: 12.5px; font-weight: 500; font-family: inherit; display: inline-flex; align-items: center; cursor: pointer; transition: background-color 110ms ease, padding 200ms var(--ease-apple); }
.lh-fluid-btn:hover, .lh-fluid-btn:focus-visible, .lh-fluid-btn.is-expanded { background: var(--surface); padding: 0 12px 0 10px; }
.lh-fluid-btn:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: -2px; }
.lh-fluid-btn.is-active { color: var(--primary); }
.lh-fluid-lbl-wrap { display: grid; grid-template-columns: 0fr; transition: grid-template-columns 200ms var(--ease-apple); }
.lh-fluid-lbl { overflow: hidden; white-space: nowrap; opacity: 0; padding-left: 0; transition: opacity 140ms ease, padding-left 200ms var(--ease-apple); }
.lh-fluid-btn:hover .lh-fluid-lbl-wrap, .lh-fluid-btn:focus-visible .lh-fluid-lbl-wrap, .lh-fluid-btn.is-expanded .lh-fluid-lbl-wrap { grid-template-columns: 1fr; }
.lh-fluid-btn:hover .lh-fluid-lbl, .lh-fluid-btn:focus-visible .lh-fluid-lbl, .lh-fluid-btn.is-expanded .lh-fluid-lbl { opacity: 1; padding-left: 6px; }

/* Единая полоска метрик (Sleek Metric Strip) и спокойное состояние Inbox */
.lh-metric-strip { display: flex; align-items: stretch; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--divider); border-radius: var(--radius-surface); overflow: hidden; flex-shrink: 0; width: 100%; }
.lh-modal-body .lh-metric-strip, .lh-tahoe-body .lh-metric-strip { border: 0; background: var(--surface); border-radius: 14px; }
.lh-metric-item { flex: 1 1 140px; padding: 12px 16px; display: flex; flex-direction: column; gap: 3px; border-right: 1px solid var(--divider); min-width: 0; }
.lh-metric-item:last-child { border-right: 0; }
.lh-metric-lbl { font-size: 12px; line-height: 16px; color: var(--secondary-text); display: inline-flex; align-items: center; gap: 5px; }
.lh-metric-val { font-size: 19px; line-height: 24px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; color: var(--text); }
.lh-metric-val.is-danger { color: var(--semantic-err); }
.lh-inbox-calm { background: var(--canvas); border-radius: 14px; padding: 18px 20px; display: flex; align-items: center; gap: 14px; }
.lh-inbox-calm-ico { width: 40px; height: 40px; border-radius: 12px; background: var(--semantic-ok-bg); color: var(--semantic-ok); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* Google Search Pill (фиксированная высота 34px в любом flex-column / flex-row контейнере) и Apple Switch */
.lh-search-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.lh-search-pill { display: inline-flex; align-items: center; gap: 8px; height: 34px; min-height: 34px; max-height: 34px; width: 100%; min-width: 210px; max-width: 460px; flex: 0 0 auto; padding: 0 8px 0 13px; border-radius: var(--radius-pill); background: var(--field); transition: background-color 100ms ease; }
.lh-search-toolbar > .lh-search-pill { flex: 1 1 240px; width: auto; }
.lh-search-pill:hover { background: var(--hover); }
.lh-search-pill-ico { color: var(--secondary-text); display: inline-flex; align-items: center; pointer-events: none; flex-shrink: 0; }
.lh-search-pill-input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 13.5px; font-family: inherit; }
.lh-search-pill-input::placeholder { color: var(--muted-text); }
.lh-search-pill-input::-webkit-search-cancel-button { display: none; }
.lh-search-pill-clear { width: 24px; height: 24px; border: 0; border-radius: 50%; background: transparent; color: var(--secondary-text); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }
.lh-search-pill-clear:hover { background: var(--surface); color: var(--text); }
.lh-apple-switch { position: relative; display: inline-flex; width: 38px; height: 22px; flex-shrink: 0; }
.lh-apple-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 2; }
.lh-apple-switch input:disabled { cursor: default; }
.lh-apple-switch-slider { position: absolute; inset: 0; border-radius: var(--radius-pill); background: #d4d4dc; transition: background-color 160ms var(--ease-apple); }
.lh-apple-switch-slider::before { content: ""; position: absolute; left: 2px; top: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--surface); transition: transform 160ms var(--ease-apple); }
.lh-apple-switch input:checked + .lh-apple-switch-slider { background: var(--accent-primary); }
.lh-apple-switch input:checked + .lh-apple-switch-slider::before { transform: translateX(16px); }
