/* Shared shell, CRM components and responsive layouts. Values live in tokens.css.
 * Remaining repeated selectors preserve order against intervening component rules. */
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--background); }
a { color: inherit; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; color: var(--color-on-primary); }
.back-link { margin-bottom: 24px; font-weight: 700; text-decoration: none; }
.flash { color: var(--color-flash-ink); background: var(--color-flash-surface); border: 1px solid var(--color-flash-border); }
.column-empty { padding: 28px 8px; color: var(--color-column-empty-ink); text-align: center; font-size: var(--fs-13); }
.status-pill { padding: 5px 8px; color: var(--color-status-pill-ink); background: var(--color-legacy-blue-soft); border-radius: var(--radius-action); font-size: var(--fs-12); font-weight: 700; }
.timeline { padding: 22px; }
.timeline article { position: relative; padding: 0 0 25px 25px; border-left: 2px solid var(--color-timeline-border); }
.timeline article:last-child { padding-bottom: 0; border-color: transparent; }
.timeline time { color: var(--muted); font-size: var(--fs-12); }
.timeline h3 { margin: 4px 0; font-size: var(--fs-14); }
.timeline p { margin: 5px 0; color: var(--color-timeline-ink); font-size: var(--fs-12); font-weight: 700; }
.timeline small { color: var(--muted); line-height: 1.4; }
.auth-page { min-height: 100vh; color: var(--crm-text); background: var(--color-background); }
.auth-shell { min-height: 100vh; padding: 32px 20px; display: grid; place-items: center; }
.auth-panel { width: min(380px, calc(100vw - 40px)); padding: 28px; background: var(--color-surface); border: 1px solid var(--crm-border); border-radius: var(--radius-lg); }
.auth-header { padding-bottom: 20px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--crm-border); }
.auth-mark { width: 30px; height: 30px; display: grid; place-items: center; color: var(--color-on-primary); background: var(--crm-purple); border-radius: var(--radius-md); font-size: var(--fs-12); font-weight: 700; }
.auth-header div { display: grid; gap: 2px; }
.auth-header strong { font-size: var(--fs-14); }
.auth-header span:last-child { color: var(--crm-muted); font-size: var(--fs-12); }
.auth-copy { padding: 24px 0 20px; }
.auth-copy h1 { margin: 0; font-size: var(--fs-23); letter-spacing: -.025em; }
.auth-copy p { margin: 7px 0 0; color: var(--crm-muted); font-size: var(--fs-12); line-height: 1.5; }
.auth-form { display: grid; gap: 15px; }
.auth-form label { display: grid; gap: 6px; }
.auth-form label span { color: var(--color-auth-form-ink); font-size: var(--fs-12); font-weight: 700; }
.auth-form input { width: 100%; height: 42px; padding: 0 11px; color: var(--crm-text); background: var(--color-surface); border: 1px solid var(--color-auth-form-border); border-radius: var(--radius-control); font: inherit; font-size: var(--fs-14); }
.auth-form input:focus { outline: 2px solid var(--crm-purple); outline-offset: 2px; border-color: var(--crm-purple); }
.auth-form .auth-code { font-size: var(--fs-18); font-variant-numeric: tabular-nums; letter-spacing: .18em; }
.auth-form button { min-height: 42px; margin-top: 2px; color: var(--color-on-primary); background: var(--crm-purple); border: 0; border-radius: var(--radius-control); cursor: pointer; font: inherit; font-size: var(--fs-12); font-weight: 700; }
.auth-form button:hover { background: var(--color-auth-form-hover-surface); }
.auth-form button:focus-visible, .auth-back:focus-visible, .sidebar-logout button:focus-visible { outline: 2px solid var(--crm-purple); outline-offset: 2px; }
.auth-form button:disabled { cursor: not-allowed; opacity: .5; }
.auth-message { margin: 0 0 16px; padding: 10px 0; border-block: 1px solid; font-size: var(--fs-12); line-height: 1.45; }
.auth-message.error { color: var(--color-auth-message-error-ink); border-color: var(--color-auth-message-error-border); }
.auth-message.success { color: var(--color-success); border-color: var(--color-auth-message-success-border); }
.auth-back { margin-top: 17px; display: inline-block; color: var(--color-auth-back-ink); font-size: var(--fs-12); font-weight: 700; text-decoration: none; }
.auth-back:hover { text-decoration: underline; }
.auth-footer { margin-top: 24px; padding-top: 14px; color: var(--color-auth-footer-ink); border-top: 1px solid var(--crm-border); font-size: var(--fs-12); line-height: 1.5; }
.sidebar-logout { margin-left: auto; }
.sidebar-logout button { padding: 5px 2px; color: var(--crm-muted); background: transparent; border: 0; cursor: pointer; font: inherit; font-size: var(--fs-12); font-weight: 700; }
.sidebar-logout button:hover { color: var(--crm-text); }
@media (max-width: 620px) {
    .auth-shell { padding: 18px 12px; }
    .auth-panel { width: calc(100vw - 24px); padding: 22px 18px; }
    .auth-form input, .auth-form button { min-height: 44px; font-size: var(--fs-16); }
}
.crm-app { color: var(--crm-text); background: var(--crm-bg); min-width: 0; font-size: var(--fs-14); }
.crm-app button, .crm-app input, .crm-app select, .crm-app textarea { font: inherit; }
.sidebar-brand { display: flex; align-items: center; color: var(--crm-text); font-weight: 700; text-decoration: none; padding: 0 10px 20px; gap: 9px; font-size: var(--fs-16); }
.sidebar-brand .brand-mark { width: 30px; height: 30px; font-size: var(--fs-13); border-radius: var(--radius-md); background: var(--crm-purple); box-shadow: none; }
.sidebar-nav { display: grid; gap: 2px; }
.sidebar-nav a { display: flex; align-items: center; text-decoration: none; }
.nav-icon { display: inline-grid; place-items: center; font-size: var(--fs-17); width: 18px; height: 18px; }
.sidebar-profile { margin-top: auto; display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--crm-border); padding: 14px 9px 0; }
.profile-avatar { display: inline-grid; place-items: center; flex: 0 0 auto; color: var(--color-profile-avatar-ink); background: var(--color-profile-avatar-surface); border-radius: var(--radius-circle); font-weight: 700; width: 32px; height: 32px; font-size: var(--fs-12); }
.lead-avatar { display: inline-grid; place-items: center; flex: 0 0 auto; border-radius: var(--radius-circle); font-weight: 700; width: 30px; height: 30px; color: var(--color-lead-avatar-ink); background: var(--color-lead-avatar-surface); font-size: var(--fs-12); }
.sidebar-profile div { display: grid; gap: 2px; }
.sidebar-profile small { color: var(--crm-muted); font-size: var(--fs-12); }
.app-main { min-height: 100vh; margin-left: 208px; }
.app-header { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--crm-border); height: 64px; padding: 0 24px; gap: 18px; background: var(--color-surface); backdrop-filter: none; }
.app-header h1 { margin: 0; font-size: var(--fs-22); letter-spacing: -.015em; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.avito-balance { display: flex; align-items: stretch; background: transparent; border: 0; border-radius: var(--radius-none); }
.avito-balance[hidden] { display: none; }
.avito-balance-part { display: grid; gap: 1px; min-width: 86px; padding: 3px 10px; }
.avito-balance-part + .avito-balance-part { border-left: 1px solid var(--crm-border); }
.avito-balance-part[hidden] { display: none; }
.avito-balance span { color: var(--color-avito-balance-ink); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.avito-balance strong { color: var(--color-avito-balance-ink-detail); white-space: nowrap; font-size: var(--fs-14); font-variant-numeric: tabular-nums; }
.avito-balance small { color: var(--color-avito-balance-ink-detail-2); white-space: nowrap; font-size: var(--fs-12); }
.avito-balance.unavailable { background: var(--color-surface-disabled); border-color: var(--color-avito-balance-unavailable-border); }
.avito-balance.unavailable strong, .avito-balance-part.unavailable strong { color: var(--color-text-disabled); font-size: var(--fs-12); }
.global-search { padding: 0 12px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--crm-border); width: 240px; height: 36px; border-radius: var(--radius-md); background: var(--color-surface-disabled); }
.global-search span { color: var(--crm-muted); }
.global-search input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--crm-text); }
.button { display: inline-flex; align-items: center; justify-content: center; border: 1px solid transparent; cursor: pointer; font-weight: 700; text-decoration: none; min-height: 36px; padding: 0 12px; gap: 7px; border-radius: var(--radius-md); font-size: var(--fs-13); }
.button.primary { color: var(--color-on-primary); background: var(--crm-purple); }
.button.secondary { color: var(--color-button-secondary-ink); background: var(--color-surface); border-color: var(--crm-border); }
.button.success { color: var(--color-on-primary); background: var(--color-button-success-surface); }
.button.danger { color: var(--color-on-primary); background: var(--color-button-danger-surface); }
.button.muted { color: var(--color-button-muted-ink); background: var(--color-surface-muted); }
.flash { max-width: 900px; margin: 0 0 18px; }
.flash.success { color: var(--color-flash-success-ink); background: var(--color-flash-success-surface); border: 1px solid var(--color-flash-success-border); }
.flash.info { color: var(--color-flash-info-ink); background: var(--color-flash-info-surface); border: 1px solid var(--color-flash-info-border); }
.flash.error { color: var(--color-flash-error-ink); background: var(--color-flash-error-surface); border: 1px solid var(--color-flash-error-border); }
.today-grid { display: grid; margin-top: 16px; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; align-items: stretch; background: var(--color-surface); border-block: 1px solid var(--crm-border); }
.work-panel > header { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--crm-border); }
.work-panel > header div { display: flex; align-items: center; gap: 8px; }
.work-panel h2 { margin: 0; font-size: var(--fs-12); }
.work-panel header span { padding: 0 6px; display: grid; place-items: center; color: var(--color-work-panel-ink); background: var(--color-flash-info-surface); font-weight: 700; }
.work-panel header a { font-weight: 700; text-decoration: none; color: var(--color-primary-ink); font-size: var(--fs-12); }
.work-list { display: grid; }
.work-item { display: flex; align-items: center; color: inherit; border-bottom: 1px solid var(--color-work-item-border); text-decoration: none; min-height: 64px; padding: 10px 12px; gap: 9px; }
.work-item:last-child { border-bottom: 0; }
.work-copy { min-width: 0; flex: 1; display: grid; gap: 3px; }
.work-copy p { margin: 0; overflow: hidden; color: var(--color-work-copy-ink); text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-12); }
.work-copy small { color: var(--crm-muted); font-size: var(--fs-12); }
.attention-tag { flex: 0 0 auto; color: var(--color-attention-tag-ink); font-weight: 700; padding: 3px 5px; background: transparent; border-radius: var(--radius-badge); font-size: var(--fs-12); }
.attention-tag.neutral { color: var(--color-attention-tag-neutral-ink); background: transparent; }
.attention-tag.danger { color: var(--color-attention-tag-danger-ink); background: var(--color-attention-tag-danger-surface); }
.trial-item > time { width: 38px; color: var(--color-trial-item-ink); font-size: var(--fs-12); font-weight: 700; }
.compact-empty { color: var(--crm-muted); padding: 22px 13px; text-align: left; font-size: var(--fs-12); }
.queue-filters { min-height: 38px; margin: -2px 28px 12px 0; display: flex; align-items: flex-end; gap: 22px; border-bottom: 1px solid var(--crm-border); }
.queue-filters a { min-height: 38px; padding: 10px 1px 8px; color: var(--crm-muted); border-bottom: 2px solid transparent; font-size: var(--fs-12); font-weight: 700; text-decoration: none; }
.queue-filters a:hover { color: var(--crm-text); }
.queue-filters a.active { color: var(--color-primary-ink); border-bottom-color: var(--crm-purple); }
.queue-filters span { margin-left: 4px; color: inherit; font-variant-numeric: tabular-nums; }
.funnel-board { display: grid; overflow-x: auto; padding: 0 24px 18px 0; grid-template-columns: repeat(6, minmax(205px, 1fr)); gap: 8px; }
.funnel-column { border-top: 3px solid var(--color-funnel-column-border); min-height: calc(100vh - 140px); padding: 8px; background: var(--color-funnel-column-surface); border-radius: var(--radius-control); border-top-width: 2px; }
.funnel-column.stage-new { border-top-color: var(--color-funnel-column-stage-new-border); }
.funnel-column.stage-waiting { border-top-color: var(--color-funnel-column-stage-waiting-border); }
.funnel-column.stage-communication { border-top-color: var(--color-funnel-column-stage-communication-border); }
.funnel-column.stage-trial { border-top-color: var(--color-funnel-column-stage-trial-border); }
.funnel-column.stage-decision { border-top-color: var(--color-funnel-column-stage-decision-border); }
.funnel-column.stage-enrolled { border-top-color: var(--color-funnel-column-stage-enrolled-border); }
.funnel-column.drop-target { background: var(--color-funnel-column-drop-target-surface); outline: 2px solid var(--color-funnel-column-drop-target-outline); outline-offset: -2px; }
.funnel-column > header { display: flex; align-items: center; justify-content: space-between; }
.funnel-column h3 { margin: 0; text-transform: uppercase; letter-spacing: .025em; }
.funnel-stage-copy { min-width: 0; }
.funnel-stage-copy small { margin-top: 4px; display: block; color: var(--crm-muted); font-weight: 700; font-size: var(--fs-12); }
.funnel-column header span { display: grid; place-items: center; color: var(--crm-muted); font-weight: 700; }
.funnel-cards { display: grid; gap: 6px; }
.funnel-card { display: block; color: inherit; background: var(--color-surface); border: 1px solid var(--color-funnel-card-border); text-decoration: none; padding: 11px; border-radius: var(--radius-control); box-shadow: none; }
.funnel-card[draggable="true"] { cursor: grab; }
.funnel-card.dragging { cursor: grabbing; opacity: .42; box-shadow: none; }
.funnel-card > div { display: flex; align-items: center; gap: 7px; }
.funnel-card .lead-avatar { font-size: var(--fs-12); width: 26px; height: 26px; }
.funnel-card strong { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-12); }
.funnel-card time { color: var(--crm-muted); font-size: var(--fs-12); }
.funnel-card p { margin: 9px 0 7px; display: -webkit-box; overflow: hidden; color: var(--color-funnel-card-ink); line-height: 1.4; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: var(--fs-12); }
.funnel-card-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.funnel-card-meta small { min-width: 0; overflow: hidden; color: var(--color-funnel-card-meta-ink); font-weight: 700; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-12); }
.card-qualification { flex: 0 0 auto; font-weight: 700; font-size: var(--fs-12); }
.card-qualification.confirmed { color: var(--color-card-qualification-confirmed-ink); }
.card-qualification.pending { color: var(--color-card-qualification-pending-ink); }
.stage-transition-dialog { position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; }
.stage-transition-dialog[hidden] { display: none; }
.stage-transition-backdrop { position: absolute; inset: 0; width: 100%; border: 0; background: var(--color-stage-transition-backdrop-surface); }
.stage-transition-dialog form { display: grid; }
.stage-transition-dialog header { min-height: 64px; padding: 13px 16px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--crm-border); }
.stage-transition-dialog header small { display: block; color: var(--crm-muted); font-size: var(--fs-12); font-weight: 700; }
.stage-transition-dialog h3 { margin: 3px 0 0; font-size: var(--fs-15); }
.stage-transition-dialog header button { width: 34px; height: 34px; display: grid; place-items: center; color: var(--crm-muted); background: transparent; border: 0; border-radius: var(--radius-sm); cursor: pointer; flex-shrink: 0; }
.stage-transition-dialog header button:hover { background: var(--color-surface-muted); }
.transition-description { margin: 0; padding: 13px 16px 4px; color: var(--crm-muted); font-size: var(--fs-12); line-height: 1.45; }
.stage-transition-dialog label { padding: 10px 16px 4px; display: grid; gap: 6px; }
.stage-transition-dialog label[hidden], .stage-transition-dialog button[hidden] { display: none; }
.stage-transition-dialog label span { color: var(--color-stage-transition-dialog-ink); font-size: var(--fs-12); font-weight: 700; }
.stage-transition-dialog input { min-height: 38px; padding: 0 10px; color: var(--crm-text); background: var(--color-surface); border: 1px solid var(--crm-border); border-radius: var(--radius-sm); font: inherit; font-size: var(--fs-12); }
.stage-transition-dialog input:focus { outline: 2px solid var(--color-stage-transition-dialog-focus-outline); outline-offset: 1px; border-color: var(--color-stage-transition-dialog-focus-border); }
.transition-error { margin: 8px 16px 10px; color: var(--color-transition-error-ink); font-size: var(--fs-12); line-height: 1.4; }
.stage-transition-dialog footer { padding: 14px 16px; display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--crm-border); }
.stage-transition-dialog footer .button { min-height: 36px; border-radius: var(--radius-sm); }
.transition-open { overflow: hidden; }
.list-toolbar { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 10px; align-items: flex-end; }
.filter-pills { display: flex; gap: 18px; border-bottom: 1px solid var(--crm-border); }
.filter-pills a { color: var(--crm-muted); font-weight: 700; text-decoration: none; margin-bottom: -1px; padding: 8px 1px; border-bottom: 2px solid transparent; border-radius: var(--radius-none); font-size: var(--fs-12); }
.filter-pills span { margin-left: 4px; opacity: .7; }
.data-table-wrap { overflow: hidden; background: var(--color-surface); border: 1px solid var(--crm-border); border-radius: var(--radius-md); }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { color: var(--crm-muted); background: var(--color-surface-subtle); border-bottom: 1px solid var(--crm-border); text-align: left; padding: 10px 12px; font-size: var(--fs-12); text-transform: none; letter-spacing: 0; font-weight: 600; }
.data-table td { color: var(--color-data-table-ink); border-bottom: 1px solid var(--color-data-table-border); vertical-align: middle; padding: 11px 12px; font-size: var(--fs-14); }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: var(--color-data-table-hover-surface); }
.data-table td strong, .data-table td small { display: block; }
.data-table td small { margin-top: 3px; color: var(--crm-muted); }
.person-cell { display: flex; align-items: center; gap: 9px; color: var(--crm-text); text-decoration: none; }
.person-cell .lead-avatar { width: 30px; height: 30px; }
.stage-badge { padding: 5px 7px; display: inline-flex; color: var(--color-stage-badge-ink); background: var(--color-stage-badge-surface); font-weight: 700; border-radius: var(--radius-badge); font-size: var(--fs-12); }
.stage-badge.stage-communication { color: var(--color-stage-badge-stage-communication-ink); background: var(--color-stage-badge-stage-communication-surface); }
.stage-badge.stage-waiting { color: var(--color-stage-badge-stage-waiting-ink); background: var(--color-line-muted); }
.stage-badge.stage-trial { color: var(--color-stage-badge-stage-trial-ink); background: var(--color-stage-badge-stage-trial-surface); }
.stage-badge.stage-decision { color: var(--color-stage-badge-stage-decision-ink); background: var(--color-stage-badge-stage-decision-surface); }
.stage-badge.stage-enrolled { color: var(--color-stage-badge-stage-enrolled-ink); background: var(--color-stage-badge-stage-enrolled-surface); }
.stage-badge.closed { color: var(--color-stage-badge-closed-ink); background: var(--color-stage-badge-closed-surface); }
.stage-badge.archived { color: var(--color-stage-badge-archived-ink); background: var(--color-line-muted); }
.large-empty { text-align: center; padding: 54px 20px; }
.large-empty span { font-size: var(--fs-28); color: var(--crm-muted); }
.large-empty p { margin: 0; color: var(--crm-muted); }
.lead-drawer { position: fixed; inset: 0; z-index: 100; visibility: hidden; opacity: 0; pointer-events: none; transition: opacity var(--motion-panel) var(--motion-ease), visibility 0s var(--motion-panel); }
.lead-drawer.open { visibility: visible; opacity: 1; pointer-events: auto; transition-delay: 0s; }
.drawer-backdrop { position: absolute; inset: 0; width: 100%; border: 0; cursor: default; background: var(--color-drawer-backdrop-surface); backdrop-filter: none; }
.drawer-panel { height: 100%; position: absolute; inset: 0 0 0 auto; overflow-y: auto; background: var(--color-surface); transform: translateX(12px); transition: transform var(--motion-panel) var(--motion-ease); width: min(720px, calc(100vw - 208px)); box-shadow: -12px 0 36px var(--color-drawer-panel-shadow); }
.drawer-loading, .drawer-error { min-height: 100%; display: grid; place-items: center; color: var(--crm-muted); }
.drawer-error > div { max-width: 320px; text-align: center; }
.drawer-error p { margin: 7px 0 14px; }
.drawer-content { min-height: 100%; background: var(--color-surface); }
.drawer-header { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--crm-border); min-height: 76px; padding: 14px 20px; }
.lead-identity { display: flex; align-items: center; gap: 12px; }
.drawer-title-row { display: flex; align-items: center; gap: 9px; }
.drawer-title-row h2 { margin: 0; font-size: var(--fs-17); }
.drawer-header-actions { display: flex; align-items: center; gap: 3px; }
.drawer-refresh { display: grid; place-items: center; color: var(--color-primary-ink); background: transparent; border: 0; cursor: pointer; width: 34px; height: 34px; border-radius: var(--radius-sm); font-size: inherit; }
.drawer-refresh:disabled { cursor: wait; opacity: .65; }
.drawer-panel.is-refreshing .drawer-refresh svg { animation: drawer-refresh-spin .8s linear infinite; }
.drawer-refresh-notice { min-height: 38px; padding: 8px 22px; display: flex; align-items: center; justify-content: space-between; gap: 14px; color: var(--crm-danger); background: var(--color-drawer-refresh-notice-surface); border-bottom: 1px solid var(--color-drawer-refresh-notice-border); font-size: var(--fs-12); }
.drawer-refresh-notice button { padding: 0; flex: none; color: var(--crm-danger); background: transparent; border: 0; font: inherit; font-weight: 700; cursor: pointer; }
@keyframes drawer-refresh-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
    .drawer-panel.is-refreshing .drawer-refresh svg { animation: none; }
}
.lead-identity p { margin: 4px 0 0; color: var(--crm-muted); font-size: var(--fs-12); }
.drawer-close { display: grid; place-items: center; color: var(--color-drawer-close-ink); background: transparent; border: 0; cursor: pointer; width: 34px; height: 34px; border-radius: var(--radius-sm); font-size: inherit; }
.lead-facts { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border-bottom: 1px solid var(--crm-border); padding: 12px 20px; gap: 12px; background: var(--color-surface-hover); }
.lead-facts div { min-width: 0; }
.lead-facts small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-bottom: 4px; color: var(--crm-muted); text-transform: uppercase; font-size: var(--fs-12); }
.lead-facts strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-12); }
.classification-review { border-bottom: 1px solid var(--crm-border); }
.classification-review > header { min-height: 54px; padding: 10px 22px 10px 19px; border-left: 3px solid var(--crm-warning); }
.classification-review.pending > header { background: var(--color-classification-review-pending-surface); }
.classification-review.automated > header { background: var(--color-classification-review-automated-surface); border-left-color: var(--crm-purple); }
.classification-review.reviewed > header { background: var(--color-classification-review-reviewed-surface); border-left-color: var(--crm-success); }
.classification-review > header strong { display: block; font-size: var(--fs-12); }
.classification-review > header small { display: block; margin-top: 3px; color: var(--crm-muted); font-size: var(--fs-12); }
.classification-review form { border-top: 1px solid var(--color-funnel-column-surface); }
.classification-row { min-height: 52px; padding: 8px 22px; display: grid; grid-template-columns: 86px 128px minmax(0, 1fr) auto; align-items: center; gap: 10px; border-bottom: 1px solid var(--color-classification-row-border); }
.classification-row > label { color: var(--color-stage-transition-dialog-ink); font-size: var(--fs-12); font-weight: 700; }
.classification-row select { height: 31px; padding: 0 8px; color: var(--crm-text); background: var(--color-surface); border: 1px solid var(--crm-border); border-radius: var(--radius-sm); font: inherit; font-size: var(--fs-12); }
.classification-evidence { min-width: 0; display: grid; gap: 2px; color: var(--crm-muted); font-size: var(--fs-12); line-height: 1.35; }
.copy-question { padding: 5px 0; color: var(--color-copy-question-ink); background: transparent; border: 0; cursor: pointer; font: inherit; font-size: var(--fs-12); font-weight: 700; white-space: nowrap; }
.classification-review footer { min-height: 43px; padding: 7px 22px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.classification-review footer small { color: var(--crm-muted); font-size: var(--fs-12); }
.classification-review footer button { height: 30px; padding: 0 10px; color: var(--color-on-primary); background: var(--crm-purple); border: 0; border-radius: var(--radius-sm); cursor: pointer; font: inherit; font-size: var(--fs-12); font-weight: 700; white-space: nowrap; }
.telegram-link { color: var(--color-primary-ink); font-weight: 700; text-decoration: none; font-size: var(--fs-12); }
.telegram-link:hover { text-decoration: underline; }
.telegram-value { display: flex; align-items: center; gap: 3px; }
.telegram-copy { width: 22px; height: 22px; padding: 0; display: grid; place-items: center; flex: none; color: var(--color-telegram-copy-ink); background: transparent; border: 0; border-radius: var(--radius-badge); cursor: pointer; }
.telegram-copy:hover, .telegram-copy:focus-visible { color: var(--color-primary-ink); background: var(--color-flash-info-surface); outline: 0; }
.telegram-copy.copied { color: var(--crm-success); background: var(--color-telegram-copy-copied-surface); }
.telegram-copy .ui-icon { width: 13px; height: 13px; }
.form-sync-action { display: flex; align-items: center; justify-content: space-between; gap: 14px; color: var(--color-form-sync-action-ink); border-bottom: 1px solid var(--color-form-sync-action-border); padding: 9px 20px; background: var(--color-form-sync-action-surface); }
.form-sync-action strong { display: block; font-size: var(--fs-12); }
.form-sync-action small { display: block; margin-top: 2px; color: var(--crm-muted); font-size: var(--fs-12); }
.form-sync-action form { margin: 0; }
.form-sync-action button { color: var(--color-form-sync-action-ink-detail); background: var(--color-surface); border: 1px solid var(--color-form-sync-action-border-detail); cursor: pointer; font: inherit; font-weight: 700; white-space: nowrap; min-height: 32px; padding: 0 9px; display: inline-flex; align-items: center; gap: 6px; border-radius: var(--radius-control); font-size: var(--fs-12); }
.quick-actions { display: flex; gap: 8px; border-bottom: 1px solid var(--crm-border); padding: 11px 20px; }
.archive-notice { padding: 12px 22px; display: flex; align-items: center; justify-content: space-between; gap: 14px; color: var(--color-form-sync-action-ink); background: var(--color-surface-muted); border-bottom: 1px solid var(--color-archive-notice-border); }
.archive-notice[hidden] { display: none; }
.archive-notice strong { display: block; font-size: var(--fs-12); }
.archive-notice p { margin: 3px 0 0; color: var(--crm-muted); font-size: var(--fs-12); }
.archive-notice form { margin: 0; }
.archive-notice button { padding: 7px 10px; color: var(--color-archive-notice-ink); background: var(--color-surface); border: 1px solid var(--color-archive-notice-border-detail); border-radius: var(--radius-action); cursor: pointer; font-size: var(--fs-12); font-weight: 700; }
.action-menu { position: relative; }
.action-menu > summary { padding: 0 13px; display: flex; align-items: center; list-style: none; color: var(--color-action-menu-ink); background: var(--color-surface); border: 1px solid var(--crm-border); cursor: pointer; }
.action-menu > summary::-webkit-details-marker { display: none; }
.action-menu[open] > form, .action-menu[open] > .action-stack { width: 300px; padding: 13px; position: absolute; top: 45px; left: 0; z-index: 20; display: grid; gap: 9px; background: var(--color-surface); border: 1px solid var(--crm-border); box-shadow: var(--crm-shadow); border-radius: var(--radius-md); }
.action-menu > form label { display: grid; gap: 5px; color: var(--crm-muted); font-weight: 700; font-size: var(--fs-12); }
.action-menu input, .action-menu select, .action-menu textarea, .action-stack select, .action-stack textarea { width: 100%; padding: 9px; color: var(--crm-text); background: var(--color-surface); border: 1px solid var(--crm-border); border-radius: var(--radius-action); }
.action-menu form p { margin: 0; color: var(--crm-muted); font-size: var(--fs-12); }
.action-stack { display: grid; gap: 3px; }
.action-stack form, .action-stack details form { display: grid; gap: 7px; }
.action-stack details { border-top: 1px solid var(--color-classification-row-border); }
.text-action { width: 100%; padding: 9px 6px; display: block; list-style: none; color: var(--color-action-menu-ink); background: transparent; border: 0; cursor: pointer; font-weight: 700; text-align: left; font-size: var(--fs-12); }
.text-action.danger { color: var(--color-attention-tag-danger-ink); }
.text-action.success { color: var(--color-text-action-success-ink); }
.review-actions { display: flex; align-items: center; gap: 8px; background: var(--color-review-actions-surface); border-bottom: 1px solid var(--color-review-actions-border); padding: 10px 20px; }
.review-actions a, .review-actions button { padding: 7px 9px; color: var(--color-review-actions-ink); background: var(--color-surface); border: 1px solid var(--color-review-actions-border-detail); cursor: pointer; font: inherit; font-weight: 700; text-decoration: none; border-radius: var(--radius-sm); font-size: var(--fs-12); }
.review-actions form { margin: 0; }
.trial-summary { display: flex; align-items: center; justify-content: space-between; margin: 0; padding: 12px 20px; border: 0; border-bottom: 1px solid var(--crm-border); border-left: 3px solid var(--color-trial-summary-border); border-radius: var(--radius-none); background: var(--color-trial-summary-surface); }
.trial-summary > div { display: flex; align-items: center; gap: 10px; }
.trial-summary small { display: block; margin-bottom: 3px; color: var(--crm-muted); text-transform: uppercase; font-size: var(--fs-12); }
.trial-summary strong { display: block; font-size: var(--fs-12); }
.trial-state { padding: 5px 7px; color: var(--color-trial-state-ink); background: var(--color-trial-state-surface); font-weight: 700; border-radius: var(--radius-badge); font-size: var(--fs-12); }
.trial-state.state-completed { color: var(--color-trial-state-state-completed-ink); background: var(--color-trial-state-state-completed-surface); }
.trial-state.state-cancelled, .trial-state.state-no_show { color: var(--color-trial-state-state-cancelled-ink); background: var(--color-trial-state-state-cancelled-surface); }
.trial-links { justify-content: flex-end; }
.trial-links a { color: var(--color-primary-ink); font-weight: 700; text-decoration: none; font-size: var(--fs-12); }
.trial-links form { margin: 0; }
.inline-retry { padding: 5px 7px; color: var(--color-inline-retry-ink); background: var(--color-surface); border: 1px solid var(--color-flash-info-border); border-radius: var(--radius-md); cursor: pointer; font-size: var(--fs-12); font-weight: 700; }
.drawer-tabs { display: flex; border-bottom: 1px solid var(--crm-border); margin-top: 0; padding: 0 20px; gap: 20px; }
.drawer-tabs button { color: var(--crm-muted); background: transparent; border: 0; border-bottom: 2px solid transparent; cursor: pointer; font-weight: 700; padding: 11px 1px 9px; font-size: var(--fs-12); }
.drawer-tabs button.active { color: var(--color-primary-ink); border-bottom-color: var(--crm-purple); }
.drawer-tabs button.needs-review:not(.active) { color: var(--color-stage-badge-stage-trial-ink); }
.drawer-tab { display: none; }
.drawer-tab.active { display: block; }
.drawer-messages { max-height: 490px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; min-height: 260px; padding: 16px 20px; background: var(--color-background); }
.drawer-message { display: flex; justify-content: flex-start; }
.drawer-message.outgoing { justify-content: flex-end; }
.drawer-message > div { max-width: 75%; padding: 9px 11px 7px; background: var(--color-surface); border: 1px solid var(--color-drawer-message-border); }
.drawer-message.outgoing > div { color: var(--color-drawer-message-outgoing-ink); background: var(--color-focus-soft); border-color: var(--color-drawer-message-outgoing-border); border-radius: var(--radius-bubble) var(--radius-badge) var(--radius-bubble) var(--radius-bubble); }
.drawer-message p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.drawer-message time { margin-top: 5px; display: block; color: var(--crm-muted); text-align: right; }
.open-avito-link { margin: 0; display: block; color: var(--color-primary-ink); border-top: 1px solid var(--crm-border); font-weight: 700; text-decoration: none; padding: 12px 20px; font-size: var(--fs-12); }
.ai-reply-composer { padding: 10px 20px; flex: 0 0 auto; border-top: 1px solid var(--crm-border); background: var(--color-surface); }
.ai-reply-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: end; gap: 7px; }
.ai-generate { min-height: 38px; padding: 0 11px; border-radius: var(--radius-sm); cursor: pointer; font: inherit; white-space: nowrap; color: var(--color-copy-question-ink); background: var(--color-surface); border: 1px solid var(--color-ai-generate-border); font-size: var(--fs-13); font-weight: 600; }
.ai-send { min-height: 38px; padding: 0 11px; border-radius: var(--radius-sm); cursor: pointer; font: inherit; white-space: nowrap; color: var(--color-on-primary); background: var(--crm-purple); border: 1px solid var(--crm-purple); font-size: var(--fs-13); font-weight: 600; }
.ai-generate:hover { background: var(--color-ai-generate-hover-surface); }
.ai-generate:disabled { color: var(--color-ai-generate-disabled-ink); background: var(--color-ai-generate-disabled-surface); border-color: var(--color-ai-generate-disabled-border); cursor: default; }
.ai-reply-text { width: 100%; min-height: 38px; max-height: 132px; padding: 9px 10px; resize: none; overflow-y: auto; color: var(--crm-text); background: var(--color-ai-reply-text-surface); border: 1px solid var(--color-ai-reply-text-border); border-radius: var(--radius-sm); outline: 0; font: inherit; font-size: var(--fs-14); line-height: 1.5; }
.ai-reply-text::placeholder { color: var(--color-ai-reply-text-ink); }
.ai-reply-text:focus { background: var(--color-surface); border-color: var(--color-ai-reply-text-focus-border); box-shadow: 0 0 0 2px var(--color-focus-soft); }
.ai-send:hover { background: var(--color-ai-send-hover-surface); }
.ai-reply-status { min-height: 14px; margin: 6px 0 0; color: var(--crm-muted); font-size: var(--fs-12); }
.ai-reply-status:empty { min-height: 0; margin-top: 0; }
.ai-reply-status[data-state="error"] { color: var(--crm-danger); }
.ai-reply-status[data-state="success"] { color: var(--crm-success); }
.ai-reply-composer.is-busy { cursor: progress; }
.drawer-message.pending-sync time { color: var(--color-drawer-message-pending-sync-ink); }
.drawer-timeline article { padding: 0 0 20px 18px; position: relative; border-left: 1px solid var(--color-drawer-timeline-border); }
.drawer-timeline article:last-child { border-left-color: transparent; }
.drawer-timeline article > span { width: 9px; height: 9px; position: absolute; top: 1px; left: -5px; background: var(--crm-purple); border: 2px solid var(--color-drawer-timeline-border-detail); border-radius: var(--radius-circle); box-sizing: content-box; }
.drawer-timeline time { display: block; color: var(--crm-muted); font-size: var(--fs-12); }
.drawer-timeline strong { display: block; margin-top: 4px; font-size: var(--fs-12); }
.drawer-timeline p { display: block; margin: 4px 0 0; color: var(--crm-muted); font-size: var(--fs-12); }
.drawer-timeline em { display: block; margin-top: 5px; color: var(--color-primary-ink); font-style: normal; font-weight: 700; font-size: var(--fs-12); }
.drawer-form { display: grid; grid-template-columns: 1fr 1fr; padding: 18px 20px; gap: 12px; }
.drawer-form label { display: grid; gap: 5px; }
.drawer-form label span { color: var(--crm-muted); font-weight: 700; font-size: var(--fs-12); }
.drawer-form input, .drawer-form select, .drawer-form textarea { width: 100%; padding: 9px 10px; color: var(--crm-text); background: var(--color-input-surface); border: 1px solid var(--crm-border); outline: 0; min-height: 36px; border-radius: var(--radius-control); font-size: var(--fs-12); }
.drawer-form input:focus, .drawer-form select:focus, .drawer-form textarea:focus { border-color: var(--color-focus-border); box-shadow: 0 0 0 3px var(--color-focus-soft); }
.drawer-form .wide { grid-column: 1 / -1; }
.form-section-title { margin: 8px 0 0; padding-top: 12px; grid-column: 1 / -1; color: var(--color-form-section-title-ink); border-top: 1px solid var(--color-form-section-title-border); font-size: var(--fs-12); }
.form-section-title:first-of-type { margin-top: 0; padding-top: 0; border-top: 0; }
.source-card small { color: var(--crm-muted); text-transform: uppercase; font-size: var(--fs-12); }
.source-card p { margin: 6px 0; line-height: 1.45; font-size: var(--fs-12); }
.source-card a { color: var(--color-primary-ink); font-size: var(--fs-12); }
.source-links { display: flex; flex-wrap: wrap; gap: 10px 14px; }
.drawer-open { overflow: hidden; }
.work-panel { min-width: 0; min-height: 240px; background: transparent; border: 0; border-radius: var(--radius-none); overflow: visible; }
.stage-transition-surface { width: min(420px, calc(100vw - 28px)); position: relative; z-index: 1; color: var(--crm-text); background: var(--color-surface); border: 1px solid var(--crm-border); border-radius: var(--radius-md); box-shadow: 0 18px 48px var(--color-stage-transition-surface-shadow); max-height: calc(100dvh - 32px); overflow-y: auto; }
.lead-drawer .drawer-panel { overflow: hidden; }
.lead-drawer .drawer-content { height: 100%; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.lead-drawer .drawer-header, .lead-drawer .lead-facts, .lead-drawer .form-sync-action, .lead-drawer .archive-notice, .lead-drawer .quick-actions, .lead-drawer .review-actions, .lead-drawer .trial-summary, .lead-drawer .drawer-tabs { flex: 0 0 auto; }
.lead-drawer .drawer-tab.active { min-height: 0; flex: 1 1 auto; overflow-y: auto; }
.lead-drawer [data-drawer-panel="dialog"].active { display: flex; flex-direction: column; overflow: hidden; }
.lead-drawer .drawer-messages { min-height: 0; max-height: none; flex: 1 1 auto; }
.lead-drawer .ai-reply-composer, .lead-drawer .open-avito-link { flex: 0 0 auto; }
.detail-content { max-width: 950px; margin: 0 auto; }
.standalone-drawer { background: var(--color-surface); border: 1px solid var(--crm-border); overflow: hidden; border-radius: var(--radius-control); }
.standalone-drawer .drawer-close { display: none; }
.analytics-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 0; padding: 4px 0; background: transparent; border: 0; border-block: 1px solid var(--crm-border); border-radius: var(--radius-none); }
.period-tabs { display: flex; gap: 18px; }
.period-tabs a { color: var(--crm-muted); font-weight: 700; text-decoration: none; min-height: 38px; padding: 11px 1px 8px; border-bottom: 2px solid transparent; border-radius: var(--radius-none); font-size: var(--fs-12); }
.custom-period { display: flex; align-items: center; gap: 7px; min-width: 395px; padding: 10px; position: absolute; top: calc(100% + 8px); right: 0; z-index: 20; background: var(--color-surface); border: 1px solid var(--crm-border); border-radius: var(--radius-md); box-shadow: var(--crm-shadow); }
.custom-period label { display: flex; align-items: center; gap: 5px; color: var(--crm-muted); font-weight: 700; font-size: var(--fs-12); }
.custom-period input { padding: 7px 8px; color: var(--crm-text); background: var(--color-input-surface); border: 1px solid var(--crm-border); font: inherit; min-height: 32px; border-radius: var(--radius-sm); }
.custom-period button { padding: 8px 11px; color: var(--color-on-primary); background: var(--crm-purple); border: 0; cursor: pointer; font-weight: 700; min-height: 32px; border-radius: var(--radius-sm); font-size: var(--fs-12); }
.conversion-card { margin-top: 16px; padding: 22px; background: var(--color-surface); border: 1px solid var(--crm-border); border-radius: var(--radius-conversion); }
.conversion-card-header { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; }
.funnel-stage-controls { display: flex; align-items: center; scrollbar-width: thin; min-width: 460px; margin: 0; padding: 8px 10px; position: absolute; top: calc(100% + 5px); right: 0; z-index: 15; gap: 13px; overflow: visible; background: var(--color-surface); border: 1px solid var(--crm-border); border-radius: var(--radius-md); box-shadow: var(--crm-shadow); }
.funnel-stage-controls > span { padding: 0 8px 0 0; flex: 0 0 auto; color: var(--crm-muted); font-size: var(--fs-12); font-weight: 700; }
.funnel-stage-controls button { flex: 0 0 auto; color: var(--color-funnel-stage-controls-ink); background: transparent; border: 0; cursor: pointer; font: inherit; font-weight: 700; white-space: nowrap; min-height: 30px; padding: 0 1px; border-bottom: 2px solid transparent; border-radius: var(--radius-none); font-size: var(--fs-12); }
.funnel-stage-controls button:disabled { color: var(--color-funnel-stage-controls-disabled-ink); background: transparent; cursor: not-allowed; opacity: .5; }
.funnel-stage-controls .funnel-reset { color: var(--color-funnel-stage-controls-funnel-reset-ink); margin-left: auto; }
.funnel-stage-controls .funnel-reset[hidden] { display: none; }
.conversion-flow { margin-top: 25px; display: grid; grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr; align-items: center; gap: 13px; }
.conversion-flow.customizable-funnel { display: flex !important; flex-flow: row nowrap; align-items: stretch; gap: 0; overflow-x: auto; scrollbar-width: thin; margin-top: 12px; padding: 0; background: var(--color-surface); border-block: 1px solid var(--crm-border); }
.conversion-flow.customizable-funnel .funnel-node { display: grid; place-content: center; flex: 1 1 104px; min-width: 112px; min-height: 76px; padding: 12px 10px; background: transparent; border: 0; border-radius: var(--radius-none); }
.conversion-flow.customizable-funnel .funnel-node[hidden], .conversion-flow.customizable-funnel .funnel-arrow[hidden] { display: none !important; }
.conversion-flow.customizable-funnel.empty::after { content: 'Выбери хотя бы один этап в настройках'; width: 100%; padding: 20px; color: var(--crm-muted); background: var(--color-conversion-flow-customizable-funnel-surface); border-radius: var(--radius-bubble); text-align: center; font-size: var(--fs-12); }
.conversion-flow div { padding: 20px; text-align: center; background: var(--color-conversion-flow-customizable-funnel-surface); border-radius: var(--radius-bubble); }
.conversion-flow strong { display: block; font-size: var(--fs-21); }
.conversion-flow span { display: block; margin-top: 4px; color: var(--crm-muted); font-size: var(--fs-12); }
.conversion-flow i { display: grid; gap: 2px; color: var(--color-conversion-flow-ink); font-style: normal; text-align: center; }
.conversion-flow i b { color: var(--color-conversion-flow-ink-detail); font-size: var(--fs-12); }
.conversion-flow .funnel-arrow { display: grid; place-content: center; flex: 0 0 36px; align-self: center; min-width: 68px; flex-basis: 68px; }
.conversion-flow .funnel-arrow span { color: var(--color-conversion-flow-ink); font-size: var(--fs-12); white-space: nowrap; }
.ad-table-wrap { border: 1px solid var(--crm-border); margin-top: 10px; overflow: hidden; border-radius: var(--radius-sm); }
.ad-analytics-table { width: 100%; border-collapse: collapse; }
.ad-analytics-table th { padding: 10px; color: var(--crm-muted); background: var(--color-surface-subtle); border-bottom: 1px solid var(--crm-border); text-align: left; text-transform: uppercase; font-size: var(--fs-12); }
.ad-analytics-table td { padding: 11px 10px; border-bottom: 1px solid var(--color-funnel-column-surface); vertical-align: middle; font-size: var(--fs-12); }
.ad-analytics-table tr:last-child td { border-bottom: 0; }
.ad-analytics-table td:first-child { max-width: 260px; }
.ad-analytics-table a { display: block; overflow: hidden; color: var(--crm-text); font-weight: 700; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
.ad-analytics-table strong { display: block; }
.ad-analytics-table small { display: block; margin-top: 3px; color: var(--crm-muted); font-size: var(--fs-12); }
.settings-list { display: grid; gap: 0; background: var(--color-surface); border-block: 1px solid var(--crm-border); }
.settings-list article { display: flex; align-items: center; min-height: 86px; padding: 15px 16px; background: transparent; border: 0; border-bottom: 1px solid var(--crm-border); border-radius: var(--radius-none); gap: 24px; }
.settings-list article > div { flex: 1; min-width: 0; }
.settings-list h3 { margin: 0; font-size: var(--fs-16); }
.settings-list p { margin: 4px 0; color: var(--color-settings-list-ink); }
.settings-list small { color: var(--crm-muted); font-size: var(--fs-13); line-height: 1.5; }
.connection-state { padding: 6px 9px; color: var(--color-connection-state-ink); background: var(--color-surface-muted); font-weight: 700; border-radius: var(--radius-badge); font-size: var(--fs-12); }
.connection-state.connected { color: var(--color-success); background: var(--color-connection-state-connected-surface); }
.integration-actions { margin-top: 9px; display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.integration-actions form { margin: 0; }
.mini-button { padding: 7px 9px; display: inline-flex; align-items: center; color: var(--color-mini-button-ink); background: var(--color-surface); border: 1px solid var(--crm-border); cursor: pointer; font: inherit; font-weight: 700; text-decoration: none; min-height: 30px; border-radius: var(--radius-control); font-size: var(--fs-12); }
.mini-button.primary { color: var(--color-on-primary); background: var(--crm-purple); border-color: var(--crm-purple); }
.settings-note h3 { margin: 0 0 8px; font-size: var(--fs-13); }
.settings-note p, .settings-note li { color: var(--color-settings-note-ink); line-height: 1.55; font-size: var(--fs-12); }
.settings-note ol { margin: 10px 0; padding-left: 20px; }
.settings-note li + li { margin-top: 5px; }
@media (max-width: 900px) {
    .sidebar-brand > span:last-child, .sidebar-nav a > span:last-child, .sidebar-profile > div { display: none; }
    .sidebar-nav a, .sidebar-profile { justify-content: center; }
    .global-search { display: none; }
    .analytics-toolbar { flex-direction: column; align-items: flex-start; }
    .custom-period { flex-wrap: wrap; }
    .conversion-card-header { flex-direction: column; }
    .ad-analytics-table { min-width: 760px; }
}
@media (max-width: 620px) {
    .app-sidebar { padding-inline: 8px; }
}
.app-sidebar { height: 100vh; position: fixed; inset: 0 auto 0 0; z-index: 50; display: flex; flex-direction: column; background: var(--crm-sidebar); border-right: 1px solid var(--crm-border); width: 208px; padding: 18px 12px 16px; }
@media (max-width: 620px) {
    .header-actions { justify-content: space-between; width: auto; margin-left: auto; }
    .custom-period label { width: 100%; justify-content: space-between; flex: 1 1 145px; }
    .custom-period input { flex: 1; min-width: 0; width: 100%; }
}
.ui-icon { width: 16px; height: 16px; display: block; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.crm-app :focus-visible { outline: 2px solid var(--crm-purple); outline-offset: 2px; }
.brand-mark { border-radius: var(--radius-md); background: var(--crm-purple); box-shadow: none; }
.sidebar-nav a { height: 40px; padding: 0 11px; gap: 10px; border-radius: var(--radius-control); color: var(--color-text-secondary); font-size: var(--fs-13); font-weight: 600; }
.sidebar-nav a:hover { color: var(--crm-text); background: var(--color-sidebar-nav-hover-surface); }
.sidebar-nav a.active { color: var(--color-primary-ink); background: var(--crm-purple-soft); box-shadow: inset 3px 0 var(--color-primary); }
.sidebar-profile strong, .avito-balance span { font-size: var(--fs-12); }
.avito-balance small[hidden] { display: none; }
.global-search span { font-size: inherit; }
.global-search input { font-size: var(--fs-12); }
.button:hover { filter: none; transform: none; }
.button.secondary:hover { color: var(--color-primary-ink); border-color: var(--color-button-secondary-hover-border); background: var(--color-conversion-flow-customizable-funnel-surface); }
.app-content { padding: 20px 24px 48px; }
.flash { padding: 10px 13px; border-radius: var(--radius-control); font-size: var(--fs-12); }
.section-heading { min-height: 42px; margin-bottom: 14px; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.section-heading h2 { margin: 0; font-size: var(--fs-18); letter-spacing: -.015em; }
.section-heading p { margin: 4px 0 0; color: var(--crm-muted); font-size: var(--fs-12); }
.section-heading > strong { min-width: 26px; padding: 3px 7px; color: var(--color-trial-item-ink); background: var(--color-line-muted); border-radius: var(--radius-sm); font-size: var(--fs-12); text-align: center; }
.section-heading .period-label { padding: 0; color: var(--crm-muted); background: transparent; font-weight: 600; }
.metric-strip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); background: var(--color-surface); border-block: 1px solid var(--crm-border); }
.metric-strip article { min-width: 0; padding: 14px 16px; display: grid; grid-template-columns: 1fr auto; align-items: baseline; column-gap: 10px; }
.metric-strip article + article { border-left: 1px solid var(--crm-border); }
.metric-strip span { color: var(--color-metric-strip-ink); font-size: var(--fs-12); font-weight: 600; }
.metric-strip strong { grid-column: 2; grid-row: 1 / span 2; font-size: var(--fs-24); line-height: 1; font-variant-numeric: tabular-nums; }
.metric-strip small { margin-top: 4px; color: var(--crm-muted); font-size: var(--fs-12); }
.metric-strip .metric-alert strong { color: var(--color-metric-strip-metric-alert-ink); }
.work-panel + .work-panel { border-left: 1px solid var(--crm-border); }
.work-panel > header { height: 46px; padding: 0 13px; }
.work-panel header span { min-width: 18px; height: 18px; border-radius: var(--radius-sm); font-size: var(--fs-12); }
.work-item:hover { background: var(--color-work-item-hover-surface); }
.work-copy strong { font-size: var(--fs-12); }
.funnel-column > header { min-height: 42px; padding: 0 2px 6px; }
.funnel-column h3 { font-size: var(--fs-12); }
.funnel-column header span { width: auto; height: auto; padding: 0; background: transparent; border-radius: var(--radius-none); font-size: var(--fs-12); }
.funnel-card:hover { border-color: var(--color-funnel-card-hover-border); box-shadow: none; }
.filter-pills a.active { color: var(--color-primary-ink); background: transparent; border-bottom-color: var(--crm-purple); }
.large-empty h3 { margin: 0 0 5px; font-size: var(--fs-15); }
.lead-drawer.open .drawer-panel { transform: none; }
.lead-identity > .lead-avatar { width: 38px; height: 38px; font-size: var(--fs-14); }
.drawer-refresh:hover, .drawer-close:hover { background: var(--color-surface-muted); }
.action-menu > summary { height: 36px; gap: 6px; border-radius: var(--radius-control); }
.trial-summary.trial-completed { background: var(--color-trial-summary-trial-completed-surface); border-color: var(--crm-border); border-left-color: var(--color-trial-summary-trial-completed-border); }
.trial-summary.trial-cancelled, .trial-summary.trial-no_show { background: var(--color-drawer-refresh-notice-surface); border-color: var(--crm-border); border-left-color: var(--color-trial-summary-trial-cancelled-border); }
.drawer-message > div { border-radius: var(--radius-badge) var(--radius-bubble) var(--radius-bubble) var(--radius-bubble); }
.drawer-timeline { padding: 18px 22px; }
.source-card { margin: 0 20px 20px; padding: 14px 0 0; background: transparent; border-top: 1px solid var(--crm-border); border-radius: var(--radius-none); }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--color-primary-ink); }
.analytics-content { padding-top: 0; }
.analytics-section-nav { height: 47px; margin-bottom: 18px; display: flex; align-items: flex-end; gap: 24px; border-bottom: 1px solid var(--crm-border); }
.analytics-section-nav a { height: 47px; padding-top: 17px; color: var(--crm-muted); border-bottom: 2px solid transparent; font-size: var(--fs-12); font-weight: 700; text-decoration: none; }
.analytics-section-nav a:hover { color: var(--crm-text); }
.analytics-section-nav a.active { color: var(--color-primary-ink); border-bottom-color: var(--crm-purple); }
.period-tabs a:hover { color: var(--color-primary-ink); background: transparent; }
.period-tabs a.active { color: var(--color-primary-ink); background: transparent; border-bottom-color: var(--crm-purple); }
.custom-period-disclosure { position: relative; }
.custom-period-disclosure > summary { color: var(--color-trial-item-ink); cursor: pointer; font-size: var(--fs-12); font-weight: 700; list-style: none; white-space: nowrap; }
.funnel-settings > summary { color: var(--color-trial-item-ink); cursor: pointer; font-size: var(--fs-12); font-weight: 700; list-style: none; white-space: nowrap; min-height: 30px; padding: 7px 0; }
.custom-period-disclosure > summary::-webkit-details-marker, .funnel-settings > summary::-webkit-details-marker { display: none; }
.custom-period-disclosure > summary::after { margin-left: 6px; content: '↓'; color: var(--color-custom-period-disclosure-ink); }
.custom-period-disclosure[open] > summary, .funnel-settings[open] > summary { color: var(--color-primary-ink); }
.analytics-context-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--color-surface); border-bottom: 1px solid var(--crm-border); }
.analytics-context-strip article { min-width: 0; padding: 13px 14px; display: grid; grid-template-columns: 1fr auto; gap: 3px 10px; align-items: baseline; }
.analytics-context-strip article + article { border-left: 1px solid var(--crm-border); }
.analytics-context-strip span { color: var(--crm-muted); font-weight: 600; font-size: var(--fs-14); }
.analytics-context-strip strong { font-size: var(--fs-19); line-height: 1; }
.analytics-context-strip small { grid-column: 1 / -1; color: var(--crm-muted); font-size: var(--fs-12); line-height: 1.5; }
.analytics-section { margin: 0; padding: 18px 0; background: transparent; border: 0; border-bottom: 1px solid var(--crm-border); border-radius: var(--radius-none); }
.qualification-analytics > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.qualification-analytics h3 { margin: 0; font-size: var(--fs-14); }
.qualification-analytics h4 { margin: 0; }
.qualification-analytics > header p { margin: 4px 0 0; color: var(--crm-muted); font-size: var(--fs-12); }
.qualification-analytics > header > strong { color: var(--color-primary-ink); font-size: var(--fs-12); font-weight: 700; max-width: 280px; text-align: right; line-height: 1.5; }
.qualification-analytics-grid { margin-top: 14px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-block: 1px solid var(--crm-border); }
.analytics-breakdown { padding: 13px 14px; }
.analytics-breakdown + .analytics-breakdown { border-left: 1px solid var(--crm-border); }
.analytics-breakdown h4 { margin-bottom: 10px; color: var(--crm-muted); font-size: var(--fs-12); font-weight: 700; letter-spacing: .035em; text-transform: uppercase; }
.analytics-breakdown-row { display: grid; grid-template-columns: minmax(0, 1fr) auto 52px; gap: 8px; align-items: baseline; }
.analytics-breakdown-row + .analytics-breakdown-row { margin-top: 10px; }
.analytics-breakdown-row span { min-width: 0; font-size: var(--fs-14); }
.analytics-breakdown-row small { color: var(--crm-muted); font-size: var(--fs-12); text-align: right; font-variant-numeric: tabular-nums; }
.analytics-bar { display: block; width: 100%; height: 3px; grid-column: 1 / -1; overflow: hidden; border-radius: var(--radius-indicator); }
.analytics-bar-track { fill: var(--color-line-muted); }
.analytics-bar-fill { fill: var(--crm-purple); }
.analytics-breakdown-row.muted .analytics-bar-fill { fill: var(--color-analytics-breakdown-row-muted-fill); }
.analytics-breakdown-row.warning .analytics-bar-fill { fill: var(--crm-warning); }
.conversion-card h3 { margin: 0; font-size: var(--fs-14); }
.conversion-card p { margin: 4px 0 0; color: var(--crm-muted); font-size: var(--fs-12); }
.funnel-settings { position: relative; }
.funnel-stage-controls button:hover { color: var(--color-funnel-stage-controls-hover-ink); background: transparent; }
.funnel-stage-controls button[aria-pressed="true"] { color: var(--color-funnel-stage-controls-hover-ink); background: transparent; border-bottom-color: var(--crm-purple); }
.funnel-stage-controls button[aria-pressed="false"] { color: var(--color-funnel-stage-controls-ink-detail); background: transparent; text-decoration: none; opacity: .55; }
.conversion-card-header > div:first-child { flex: 1; min-width: 0; }
.funnel-outcome { display: grid; gap: 3px; flex: 0 0 auto; }
.funnel-outcome strong { font-size: var(--fs-20); line-height: 1.2; }
.funnel-outcome span { color: var(--crm-muted); font-size: var(--fs-12); }
.funnel-exception { margin-top: 6px; color: var(--crm-muted); font-size: var(--fs-12); text-decoration: underline; }
@media (max-width: 760px) {
    .funnel-settings > summary, .funnel-stage-controls button { min-height: 44px; }
    .conversion-flow.customizable-funnel { flex-direction: column; overflow: visible; }
    .conversion-flow.customizable-funnel .funnel-node { min-width: 0; min-height: 62px; padding: 10px 12px; flex: none; grid-template-columns: 44px minmax(0, 1fr); align-items: center; justify-content: start; text-align: left; column-gap: 12px; }
    .funnel-node > .metric-drilldown { min-width: 44px; min-height: 44px; display: grid; align-items: center; grid-column: 1; grid-row: 1 / span 2; }
    .funnel-node > span { grid-column: 2; margin-top: 0; }
    .funnel-node > .funnel-exception { grid-column: 2; margin-top: 0; min-height: 44px; display: flex; align-items: center; }
    .conversion-flow .funnel-arrow { min-width: 0; min-height: 28px; padding-left: 68px; flex: none; align-self: stretch; grid-auto-flow: column; justify-content: start; align-items: center; gap: 8px; }
    .conversion-flow .funnel-direction { transform: rotate(90deg); }
    .funnel-outcome { grid-auto-flow: column; align-items: baseline; gap: 8px; }
}
.avito-report-status { min-height: 55px; padding: 10px 0; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--crm-border); }
.avito-report-status > div { min-width: 0; display: grid; gap: 2px; }
.avito-report-status strong { font-size: var(--fs-12); }
.avito-report-status span { color: var(--crm-muted); font-size: var(--fs-12); }
.avito-report-status form { margin: 0; }
.avito-report-status button { min-height: 32px; padding: 0 10px; color: var(--color-auth-back-ink); background: var(--color-surface); border: 1px solid var(--color-avito-report-status-border); border-radius: var(--radius-sm); cursor: pointer; font: inherit; font-size: var(--fs-12); font-weight: 700; white-space: nowrap; }
.avito-report-status button:hover { background: var(--color-avito-report-status-hover-surface); }
.avito-report-status button:disabled { color: var(--color-text-disabled); background: var(--color-background); border-color: var(--color-avito-report-status-disabled-border); cursor: not-allowed; }
.analytics-refresh-dialog { position: fixed; inset: 0; z-index: 125; display: grid; place-items: center; padding: 16px; }
.analytics-refresh-dialog[hidden] { display: none; }
.analytics-refresh-backdrop { position: absolute; inset: 0; background: var(--color-analytics-refresh-backdrop-surface); border: 0; }
.analytics-refresh-dialog > section { width: min(420px, 100%); position: relative; background: var(--color-surface); border: 1px solid var(--crm-border); border-radius: var(--radius-md); box-shadow: var(--crm-shadow); }
.analytics-refresh-dialog header { min-height: 52px; padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--crm-border); }
.analytics-refresh-dialog h3 { margin: 0; font-size: var(--fs-14); }
.analytics-refresh-dialog header button { width: 32px; height: 32px; display: grid; place-items: center; color: var(--crm-muted); background: transparent; border: 0; border-radius: var(--radius-sm); cursor: pointer; }
.analytics-refresh-dialog header button:hover { background: var(--color-surface-muted); }
.analytics-refresh-dialog header svg { width: 16px; height: 16px; }
.analytics-refresh-dialog p { margin: 0; padding: 14px; color: var(--color-stage-transition-dialog-ink); font-size: var(--fs-12); line-height: 1.5; }
.analytics-refresh-dialog footer { padding: 11px 14px; display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--crm-border); }
.analytics-refresh-dialog .button { min-height: 36px; border-radius: var(--radius-sm); }
.analytics-api-feedback { margin-top: 10px; padding: 9px 0; color: var(--color-success); background: transparent; border: 0; border-bottom: 1px solid var(--color-analytics-api-feedback-border); border-radius: var(--radius-none); font-size: var(--fs-12); }
.avito-conversion-strip { display: flex; align-items: stretch; overflow-x: auto; background: var(--color-surface); border-bottom: 1px solid var(--crm-border); scrollbar-width: thin; }
.avito-conversion-strip article { min-width: 120px; min-height: 79px; padding: 13px 12px; display: grid; align-content: center; flex: 1 1 120px; }
.avito-conversion-strip article span { color: var(--crm-muted); font-size: var(--fs-12); }
.avito-conversion-strip article strong { margin-top: 4px; font-size: var(--fs-21); }
.avito-conversion-strip i { min-width: 38px; display: grid; place-content: center; flex: 0 0 38px; color: var(--color-conversion-flow-ink); font-style: normal; text-align: center; }
.avito-conversion-strip i b { color: var(--color-primary-ink); font-size: var(--fs-12); }
.avito-conversion-strip i span { margin-top: 2px; font-size: var(--fs-14); }
.avito-conversion-strip .funnel-source-boundary { min-width: 46px; display: grid; place-content: center; border-left: 1px solid var(--crm-border); color: var(--crm-muted); font-size: var(--fs-12); font-weight: 700; letter-spacing: .08em; }
.analytics-source-note { margin: 0; padding: 8px 12px; border-bottom: 1px solid var(--crm-border); color: var(--crm-muted); font-size: var(--fs-12); line-height: 1.4; }
.ad-context-strip { border-top: 0; }
.ad-performance-table-section { padding-top: 18px; }
.ad-performance-table-section > header { display: flex; align-items: center; justify-content: space-between; }
.ad-performance-table-section h3 { margin: 0; font-size: var(--fs-14); }
.ad-performance-table-section header span { color: var(--crm-muted); font-size: var(--fs-12); }
.ad-table-filters { min-height: 54px; margin-top: 10px; display: flex; align-items: end; gap: 8px; border-block: 1px solid var(--crm-border); }
.ad-table-filters label { display: grid; gap: 4px; color: var(--crm-muted); font-size: var(--fs-12); font-weight: 700; text-transform: uppercase; }
.ad-table-filters input { height: 32px; padding: 0 9px; color: var(--crm-text); background: var(--color-surface); border: 1px solid var(--crm-border); border-radius: var(--radius-sm); font: inherit; font-size: var(--fs-12); text-transform: none; min-width: 250px; }
.ad-table-filters select { height: 32px; min-width: 172px; padding: 0 9px; color: var(--crm-text); background: var(--color-surface); border: 1px solid var(--crm-border); border-radius: var(--radius-sm); font: inherit; font-size: var(--fs-12); text-transform: none; }
.ad-table-filters input:focus, .ad-table-filters select:focus { outline: 2px solid var(--color-ad-table-filters-focus-outline); outline-offset: 1px; border-color: var(--color-ad-table-filters-focus-border); }
.ad-table-filters button { height: 32px; margin-bottom: 0; padding: 0 5px; color: var(--color-primary-ink); background: transparent; border: 0; cursor: pointer; font: inherit; font-size: var(--fs-12); font-weight: 700; }
.ad-table-filters button[hidden], .ad-analytics-table tr[hidden] { display: none; }
@media (max-width: 620px) {
    .ad-table-filters { height: auto; padding-block: 9px; align-items: stretch; flex-direction: column; }
    .ad-table-filters label { width: 100%; }
    .ad-table-filters input, .ad-table-filters select { width: 100%; min-width: 0; }
    .ad-table-filters button { align-self: flex-start; }
}
.analytics-note { margin: 14px 0 0; color: var(--crm-muted); font-size: var(--fs-12); line-height: 1.45; }
.settings-content { max-width: 940px; }
.settings-list article:last-child { border-bottom: 0; }
.settings-note { margin-top: 20px; padding: 16px 0 0; background: transparent; border: 0; border-top: 1px solid var(--crm-border); border-radius: var(--radius-none); }
@media (max-width: 1180px) {
    .today-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .work-panel:nth-child(3) { border-left: 0; border-top: 1px solid var(--crm-border); }
    .work-panel:nth-child(4) { border-top: 1px solid var(--crm-border); }
}
@media (max-width: 900px) {
    .app-sidebar { width: 68px; padding: 16px 9px; }
    .sidebar-brand { padding-inline: 10px; }
    .app-main { margin-left: 68px; }
    .app-header { padding: 0 16px; }
}
@media (max-width: 620px) {
    .app-header { flex-wrap: wrap; height: auto; min-height: 58px; padding: 8px 12px; align-items: center; }
}
@media (max-width: 900px) {
    .app-content { padding: 18px 16px 44px; }
    .analytics-context-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .analytics-context-strip article:nth-child(3) { border-left: 0; }
    .analytics-context-strip article:nth-child(n+3) { border-top: 1px solid var(--crm-border); }
    .drawer-panel { width: min(720px, calc(100vw - 68px)); }
}
@media (max-width: 620px) {
    .app-sidebar { width: 100%; padding: 0; inset: auto 0 0; border-top: 1px solid var(--crm-border); border-right: 0; }
    .sidebar-brand, .sidebar-profile { display: none; }
    .sidebar-nav { width: 100%; height: 100%; display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; }
    .sidebar-nav a { height: 64px; padding: 7px 2px 5px; flex-direction: column; justify-content: center; gap: 4px; border-radius: var(--radius-none); font-size: var(--fs-12); }
    .sidebar-nav a.active { box-shadow: inset 0 2px var(--crm-purple); }
    .nav-icon { width: 18px; height: 18px; }
    .sidebar-nav a > span:last-child { display: block; }
    .app-main { margin-left: 0; }
    .app-header > div:first-child { padding-top: 0; }
    .app-header h1 { font-size: var(--fs-16); }
    .avito-balance-part { min-width: 64px; padding-inline: 6px; }
    .avito-balance small { display: none; }
    .sync-control { padding: 0; min-height: 44px; width: 44px; }
    .sync-control span { display: none; }
    .app-content { padding: 14px 12px 28px; }
    .analytics-content { padding-top: 0; }
    .analytics-section-nav { height: 45px; margin: 0 -12px 14px; padding: 0 12px; gap: 20px; overflow-x: auto; }
    .analytics-section-nav a { height: 45px; padding-top: 16px; white-space: nowrap; }
    .section-heading { min-height: 0; margin-bottom: 10px; }
    .section-heading h2 { font-size: var(--fs-16); }
    .analytics-intro { flex-direction: column; gap: 4px; }
    .analytics-intro .period-label { align-self: flex-start; white-space: nowrap; }
    .metric-strip { grid-template-columns: repeat(5, minmax(118px, 1fr)); overflow-x: auto; }
    .metric-strip article { padding: 11px 12px; }
    .metric-strip strong { font-size: var(--fs-20); }
    .today-grid { grid-template-columns: 1fr; }
    .work-panel { min-height: 0; }
    .work-panel + .work-panel, .work-panel:nth-child(3) { border-left: 0; border-top: 1px solid var(--crm-border); }
    .queue-filters { margin-right: 0; gap: 16px; overflow-x: auto; }
    .queue-filters a { min-height: 44px; padding-top: 13px; white-space: nowrap; }
    .funnel-board { grid-template-columns: repeat(6, 82vw); padding-right: 12px; }
    .funnel-column { min-height: calc(100vh - 164px); }
    .list-toolbar { align-items: stretch; flex-direction: column; gap: 8px; }
    .filter-pills { width: 100%; gap: 15px; overflow-x: auto; }
    .data-table-wrap { overflow-x: auto; }
    .data-table { min-width: 800px; }
    .drawer-panel { width: 100vw; }
    .drawer-close { width: 44px; height: 44px; }
    .ai-reply-composer { padding-inline: 12px; padding: 10px 12px; }
    .ai-reply-text, .ai-generate, .ai-send { min-height: 44px; }
    .stage-transition-dialog header button { height: 44px; width: 44px; }
    .stage-transition-dialog input, .stage-transition-dialog footer .button { min-height: 44px; }
    .lead-facts div:nth-child(n+4) { margin-top: 6px; }
    .classification-row { grid-template-columns: 1fr 1.2fr; gap: 7px 10px; }
    .classification-row select { height: 44px; }
    .classification-evidence { grid-column: 1 / -1; }
    .copy-question { min-height: 44px; grid-column: 1 / -1; justify-self: start; }
    .classification-review footer { align-items: flex-start; flex-direction: column; gap: 7px; }
    .classification-review footer button { min-height: 44px; }
    .trial-summary { align-items: flex-start; flex-direction: column; gap: 8px; }
    .drawer-form { grid-template-columns: 1fr; }
    .drawer-form .wide, .form-section-title { grid-column: auto; }
    .analytics-toolbar { gap: 4px; align-items: stretch; }
    .qualification-analytics > header { flex-direction: column; gap: 5px; }
    .qualification-analytics-grid { grid-template-columns: 1fr; }
    .analytics-breakdown + .analytics-breakdown { border-top: 1px solid var(--crm-border); border-left: 0; }
    .period-tabs { width: 100%; gap: 14px; overflow-x: auto; }
    .custom-period-disclosure { width: 100%; padding: 7px 0; }
    .custom-period { min-width: 0; width: 100%; margin-top: 8px; padding: 9px 0 3px; position: static; flex-wrap: wrap; background: transparent; border: 0; border-top: 1px solid var(--crm-border); border-radius: var(--radius-none); box-shadow: none; }
    .conversion-card-header { gap: 10px; }
    .funnel-settings { width: 100%; }
    .funnel-stage-controls { min-width: 0; width: 100%; margin-top: 4px; padding: 6px 0; position: static; flex-wrap: wrap; gap: 7px 13px; background: transparent; border: 0; border-block: 1px solid var(--crm-border); border-radius: var(--radius-none); box-shadow: none; }
    .avito-report-status { align-items: flex-start; flex-direction: column; gap: 8px; }
    .analytics-refresh-dialog { align-items: end; padding: 0; }
    .analytics-refresh-dialog > section { width: 100%; border-width: 1px 0 0; border-radius: var(--radius-none); }
    .analytics-refresh-dialog .button { min-height: 44px; }
    .avito-conversion-strip { margin-right: -12px; padding-right: 12px; }
    .settings-list article { align-items: flex-start; flex-wrap: wrap; gap: 12px; }
    .connection-state { flex: 0 0 auto; }
}
.pipeline-nav .mobile-contact-label, .mobile-nav-more { display: none; }
.desktop-secondary-nav { margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--crm-border); }
.sidebar-secondary { display: grid; gap: 2px; }
.sidebar-secondary a { min-height: 40px; padding: 0 11px; display: flex; align-items: center; gap: 10px; color: var(--color-text-secondary); border-radius: var(--radius-control); font-size: var(--fs-13); font-weight: 600; text-decoration: none; }
.sidebar-secondary a:hover { color: var(--crm-text); background: var(--color-sidebar-nav-hover-surface); }
.sidebar-secondary a.active { color: var(--color-primary-ink); background: var(--crm-purple-soft); box-shadow: inset 3px 0 var(--crm-purple); }
.sidebar-secondary .secondary-leads { margin-top: 14px; }
.pipeline-heading { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin: 0; }
.pipeline-heading .button { flex-shrink: 0; }
.pipeline-controls { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 12px 24px; margin-bottom: 18px; }
.pipeline-controls .queue-filters { flex: 1; margin: 0; gap: 22px; }
.pipeline-controls .queue-filters a { font-size: var(--fs-12); white-space: nowrap; }
.pipeline-search { display: flex; gap: 6px; margin: 0; }
.pipeline-search input { width: 190px; min-width: 0; height: 36px; padding: 0 10px; background: var(--crm-card); color: var(--crm-text); border: 1px solid var(--crm-border); border-radius: var(--radius-control); font: inherit; }
.pipeline-table-wrap { border-block: 1px solid var(--crm-border); background: var(--crm-card); }
.pipeline-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.pipeline-table th { padding: 12px; color: var(--color-text-secondary); text-align: left; font-size: var(--fs-12); font-weight: 600; border-bottom: 1px solid var(--crm-border); }
.pipeline-table th:first-child { width: 24%; }
.pipeline-table th:nth-child(2) { width: 18%; }
.pipeline-table th:nth-child(3) { width: 20%; }
.pipeline-table th:last-child { width: 13%; }
.pipeline-table td { padding: 16px 12px; border-bottom: 1px solid var(--color-line-muted); vertical-align: middle; overflow-wrap: anywhere; font-size: var(--fs-14); }
.pipeline-table tr:last-child td { border-bottom: 0; }
.pipeline-table tbody tr:hover { background: var(--color-pipeline-table-hover-surface); }
.pipeline-table .person-cell { gap: 10px; font-size: var(--fs-13); }
.pipeline-table .person-cell > span:last-child { min-width: 0; }
.pipeline-table .lead-avatar { flex-shrink: 0; width: 32px; height: 32px; font-size: var(--fs-12); }
.pipeline-table small { display: block; margin-top: 4px; color: var(--crm-muted); font-size: var(--fs-12); }
.pipeline-attention { display: inline-block; color: var(--color-pipeline-attention-ink); font-size: var(--fs-12); line-height: 1.45; }
.pipeline-attention.needs-reply { color: var(--color-pipeline-attention-needs-reply-ink); font-weight: 700; }
.pipeline-contact { display: flex; align-items: center; gap: 5px; min-width: 0; }
.pipeline-contact > a { min-width: 0; color: var(--color-primary-ink); text-decoration: none; overflow-wrap: anywhere; }
.pipeline-phone > a { color: var(--crm-text); font-variant-numeric: tabular-nums; }
.button.telegram-add { color: var(--color-button-telegram-add-ink); background: var(--color-button-telegram-add-surface); border-color: var(--color-button-telegram-add-border); font-weight: 500; font-size: var(--fs-13); line-height: 1.3; padding: 6px 8px; }
.button.telegram-add:hover { color: var(--color-button-telegram-add-hover-ink); background: var(--color-button-telegram-add-hover-surface); border-color: var(--color-button-telegram-add-hover-border); }
.button.telegram-add:focus-visible { outline: 2px solid var(--crm-purple); outline-offset: 2px; }
.telegram-contact-form { margin: 0; position: relative; }
.telegram-contact-check { display: inline-flex; align-items: center; gap: 8px; min-height: 34px; min-width: 116px; padding: 0 9px; margin: 0; border: 1px solid var(--crm-border); border-radius: var(--radius-control); background: var(--color-surface); color: var(--color-telegram-contact-check-ink); font-size: var(--fs-12); font-weight: 500; cursor: pointer; }
.telegram-contact-check:hover { border-color: var(--color-telegram-contact-check-hover-border); background: var(--color-telegram-contact-check-hover-surface); }
.telegram-contact-check:has(input:checked) { color: var(--crm-success); border-color: var(--color-telegram-contact-check-checked-border); background: var(--color-telegram-contact-check-checked-surface); }
.telegram-contact-check input { appearance: none; position: relative; flex: 0 0 14px; width: 14px; height: 14px; min-height: 0; padding: 0; margin: 0; border: 1px solid var(--color-telegram-contact-check-border); border-radius: var(--radius-badge); background: var(--color-surface); cursor: pointer; }
.telegram-contact-check input:checked { background: var(--crm-success); border-color: var(--crm-success); }
.telegram-contact-check input:checked::after { content: ''; position: absolute; left: 3px; top: 1px; width: 4px; height: 7px; border: solid var(--color-surface); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }
.telegram-contact-form[aria-busy="true"] .telegram-contact-check { cursor: progress; }
.telegram-contact-form[aria-busy="true"] input { opacity: .6; cursor: progress; }
.telegram-contact-status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); margin: 0; color: var(--crm-muted); font-size: var(--fs-12); line-height: 1.4; }
.telegram-contact-status[hidden] { display: none; }
.telegram-contact-status[data-state="error"] { position: static; width: auto; height: auto; clip-path: none; margin-top: 6px; color: var(--crm-danger); }
@media (max-width: 620px) {
    .telegram-contact-check { min-height: 44px; font-size: var(--fs-13); }
}
.pipeline-copy { width: 30px; height: 32px; flex-shrink: 0; padding: 0; display: grid; place-items: center; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--color-text-muted); cursor: pointer; }
.pipeline-copy:hover, .pipeline-copy.copied { background: var(--crm-purple-soft); color: var(--color-primary-ink); }
.pipeline-muted, .pipeline-time { color: var(--crm-muted); }
.pipeline-zone { display: inline-block; white-space: nowrap; margin-left: 6px; font-size: var(--fs-12); }
.pipeline-zone::before { content: '· '; }
.stage-transition-dialog label small { color: var(--crm-muted); font-size: var(--fs-12); line-height: 1.4; }
.pipeline-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; align-items: center; }
.pipeline-actions .button { padding: 7px 10px; min-height: 36px; font-size: var(--fs-12); white-space: normal; text-align: center; }
.stage-transition-dialog select, .stage-transition-dialog textarea { min-width: 0; width: 100%; min-height: 40px; padding: 8px 10px; border: 1px solid var(--crm-border); border-radius: var(--radius-sm); font: inherit; color: var(--crm-text); background: var(--color-surface); }
.calendar-content { max-width: 1700px; }
.calendar-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.calendar-navigation { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.calendar-modes { display: flex; align-items: center; gap: 0; padding: 3px; border: 1px solid var(--crm-border); border-radius: var(--radius-md); }
.calendar-heading { display: flex; align-items: center; margin-top: 20px; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.calendar-footer { display: flex; align-items: center; gap: 8px; color: var(--crm-muted); font-size: var(--fs-12); justify-content: space-between; flex-wrap: wrap; margin-top: 12px; }
.calendar-arrow { width: 36px; min-height: 36px; border: 1px solid var(--crm-border); border-radius: var(--radius-sm); background: var(--color-surface); color: var(--crm-text); font-size: var(--fs-18); cursor: pointer; }
.calendar-date-label input { min-height: 36px; border: 1px solid var(--crm-border); border-radius: var(--radius-sm); padding: 6px 8px; font: inherit; color: var(--crm-text); background: var(--color-surface); }
.calendar-date-label .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.calendar-modes button { min-height: 30px; padding: 5px 12px; border: 0; border-radius: var(--radius-badge); background: transparent; color: var(--color-calendar-modes-ink); font: inherit; font-size: var(--fs-13); cursor: pointer; }
.calendar-modes button[aria-pressed="true"] { color: var(--color-primary-ink); background: var(--color-calendar-modes-surface); font-weight: 600; }
.calendar-refresh { margin-left: auto; }
.calendar-heading h2 { margin: 0; font-size: var(--fs-20); font-weight: 700; text-transform: capitalize; }
.calendar-heading > span { color: var(--crm-muted); font-size: var(--fs-12); }
.calendar-message { min-height: 32px; padding: 8px 0; color: var(--crm-muted); font-size: var(--fs-13); }
.calendar-recovery { display: flex; gap: 16px; align-items: center; margin: 4px 0 16px; }
.calendar-recovery[hidden], .calendar-weekdays[hidden] { display: none; }
.calendar-layout { display: grid; grid-template-columns: minmax(0, 1fr) 240px; border: 1px solid var(--crm-border); border-radius: var(--radius-md); overflow: hidden; background: var(--color-surface); }
.calendar-sheet { min-width: 0; }
.calendar-weekdays { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); color: var(--color-telegram-contact-check-ink); border-bottom: 1px solid var(--crm-border); }
.calendar-weekdays span { padding: 12px 10px; font-size: var(--fs-12); font-weight: 600; }
.calendar-grid { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); gap: 1px; background: var(--crm-border); }
.calendar-cell { min-width: 0; min-height: 116px; padding: 5px; background: var(--color-surface); }
.calendar-cell.is-other-month { background: var(--color-calendar-cell-is-other-month-surface); }
.calendar-cell.is-selected { box-shadow: inset 0 0 0 2px var(--crm-purple); }
.calendar-day { min-height: 28px; min-width: 28px; padding: 5px; border: 0; background: transparent; color: var(--color-calendar-day-ink); font: inherit; font-size: var(--fs-12); text-align: left; border-radius: var(--radius-sm); cursor: pointer; }
.calendar-cell.is-today .calendar-day { background: var(--crm-purple); color: var(--color-on-primary); }
.calendar-event { display: block; margin-top: 3px; width: 100%; padding: 4px 5px; border: 0; border-left: 2px solid var(--crm-purple); border-radius: var(--radius-indicator); background: var(--color-calendar-event-surface); color: var(--color-calendar-event-ink); text-align: left; font: inherit; font-size: var(--fs-12); line-height: 1.4; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; cursor: pointer; }
.calendar-more { padding: 4px; color: var(--color-calendar-modes-ink); border: 0; background: transparent; font: inherit; font-size: var(--fs-12); cursor: pointer; }
.calendar-agenda { min-width: 0; padding: 16px; border-left: 1px solid var(--crm-border); }
.calendar-agenda h3 { margin: 0 0 16px; font-size: var(--fs-15); }
.calendar-agenda-event { padding: 14px 0; border-top: 1px solid var(--crm-border); overflow-wrap: anywhere; }
.calendar-agenda-event time { color: var(--crm-muted); font-size: var(--fs-12); }
.calendar-agenda-event h4 { font-size: var(--fs-14); margin: 6px 0 8px; line-height: 1.45; }
.calendar-agenda-event a { font-size: var(--fs-12); }
.calendar-empty { font-size: var(--fs-13); line-height: 1.5; color: var(--crm-muted); }
.calendar-footer > span { overflow-wrap: anywhere; }
.calendar-mobile-count { display: none; }
[data-mode="week"] .calendar-cell { min-height: 400px; }
[data-mode="day"] .calendar-grid { grid-template-columns: minmax(0,1fr); }
[data-mode="day"] .calendar-cell { min-height: 400px; padding: 16px; }
[data-mode="day"] .calendar-event { padding: 12px; font-size: var(--fs-14); margin-top: 8px; white-space: normal; }
@media(max-width: 1100px) {
    .calendar-layout { grid-template-columns: minmax(0,1fr); }
    .calendar-agenda { border-left: 0; border-top: 1px solid var(--crm-border); }
    [data-calendar-agenda] { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 20px; }
}
@media(max-width: 620px) {
    .calendar-toolbar { gap: 10px; }
    .calendar-navigation { width: 100%; gap: 6px; }
    .calendar-navigation .button { padding: 8px 12px; }
    .calendar-date-label { flex: 1; min-width: 0; }
    .calendar-date-label input { width: 100%; min-width: 0; font-size: var(--fs-14); }
    .calendar-arrow { flex: 0 0 44px; }
    .calendar-heading h2 { font-size: var(--fs-18); }
    .calendar-layout { border-radius: var(--radius-sm); }
    .calendar-cell { min-height: 80px; padding: 2px; }
    .calendar-day { width: 100%; font-size: var(--fs-14); text-align: center; }
    .calendar-weekdays span { padding: 10px 2px; text-align: center; }
    [data-mode="month"] .calendar-event, [data-mode="month"] .calendar-more { display: none; }
    [data-mode="month"] .calendar-mobile-count { display: block; width: 20px; margin: 3px auto; background: var(--color-calendar-modes-surface); color: var(--color-calendar-event-ink); border-radius: var(--radius-badge); font-size: var(--fs-12); text-align: center; }
    [data-mode="week"] .calendar-grid { grid-template-columns: minmax(0,1fr); }
    [data-mode="week"] .calendar-cell, [data-mode="day"] .calendar-cell { min-height: 90px; padding: 10px; }
    [data-mode="week"] .calendar-weekdays { display: none; }
    [data-mode="week"] .calendar-day { text-align: left; }
    [data-mode="week"] .calendar-event, [data-mode="day"] .calendar-event { white-space: normal; font-size: var(--fs-14); }
    [data-calendar-agenda] { grid-template-columns: minmax(0,1fr); }
    .calendar-agenda-event h4 { font-size: var(--fs-16); }
    .calendar-agenda-event a { align-items: center; font-size: var(--fs-14); }
    .calendar-content button, .calendar-content input { min-height: 44px; }
    .pipeline-actions .button { min-height: 44px; font-size: var(--fs-14); }
    .stage-transition-dialog select { min-height: 44px; }
    .calendar-recovery a, .calendar-footer a { display: inline-flex; min-height: 44px; align-items: center; }
    .pipeline-table .pipeline-next { grid-column: 1 / -1; }
}
.contacts-workspace .pipeline-heading { margin: 0; }
.contacts-workspace .pipeline-controls { align-items: center; padding-bottom: 14px; margin-bottom: 0; gap: 12px 20px; }
.contacts-workspace .queue-filters { border: 0; align-items: center; gap: 20px; min-height: 36px; }
.contacts-workspace .queue-filters a { padding: 8px 0; min-height: 36px; font-weight: 600; }
.contacts-workspace .queue-filters span { margin-left: 6px; color: var(--crm-muted); font-size: var(--fs-12); }
.contacts-workspace .pipeline-table-wrap { border: 1px solid var(--crm-border); border-radius: var(--radius-md); overflow: hidden; }
.contacts-workspace .pipeline-table th { padding: 11px 16px; background: var(--color-surface-subtle); color: var(--color-text-muted); font-size: var(--fs-12); font-weight: 500; }
.contacts-workspace .pipeline-table th:first-child, .contacts-workspace .pipeline-table th:nth-child(2) { width: 25%; }
.contacts-workspace .pipeline-table th:nth-child(3) { width: 17%; }
.contacts-workspace .pipeline-table th:nth-child(4) { width: 21%; }
.contacts-workspace .pipeline-table th:last-child { width: 12%; text-align: right; }
.contacts-workspace .pipeline-table td { padding: 16px; height: 80px; }
.contacts-workspace .pipeline-table .lead-avatar { background: var(--color-work-item-border); color: var(--color-telegram-contact-check-ink); }
.contacts-workspace .person-cell strong { font-weight: 600; }
.pipeline-table .person-cell strong { white-space: normal; font-size: var(--fs-14); }
.contacts-workspace .pipeline-contact { gap: 4px; }
.contacts-workspace .pipeline-contact a { color: var(--color-primary-ink); font-size: var(--fs-14); }
.contacts-workspace .pipeline-phone > a { color: var(--crm-text); }
.contacts-workspace .pipeline-contact a:hover { text-decoration: underline; text-underline-offset: 3px; }
.contacts-workspace .pipeline-copy { width: 28px; height: 30px; }
.contacts-workspace .contact-avito-attention { margin-top: 2px; color: var(--color-pipeline-attention-needs-reply-ink); font-size: var(--fs-12); }
.contacts-workspace .pipeline-actions { margin: 0; }
.contacts-workspace .pipeline-next small { margin: 0 0 6px; }
.contacts-workspace .pipeline-actions .button { gap: 6px; min-height: 34px; padding: 7px 11px; font-weight: 500; color: var(--color-contacts-workspace-pipeline-actions-ink); }
.contacts-workspace .pipeline-actions .button:hover { color: var(--color-primary-ink); }
.contacts-workspace .pipeline-time { text-align: right; font-size: var(--fs-12); font-variant-numeric: tabular-nums; }
@media (min-width: 621px) and (max-width: 1150px) {
    .contacts-workspace .pipeline-table th, .contacts-workspace .pipeline-table td { padding-left: 10px; padding-right: 10px; }
    .contacts-workspace .pipeline-table th:first-child, .contacts-workspace .pipeline-table th:nth-child(2) { width: 24%; }
    .contacts-workspace .pipeline-table th:nth-child(3) { width: 18%; }
    .contacts-workspace .pipeline-table th:nth-child(4) { width: 22%; }
    .contacts-workspace .telegram-contact-check { min-width: 104px; gap: 6px; padding: 0 7px; }
}
.trials-workspace .pipeline-table th:first-child { width: 26%; }
.trials-workspace .pipeline-table th:nth-child(2) { width: 24%; }
.trials-workspace .pipeline-table th:nth-child(3) { width: 20%; }
.trials-workspace .pipeline-table th:last-child { width: 30%; text-align: left; }
.trials-workspace .trial-date { display: block; font-size: var(--fs-13); font-weight: 600; font-variant-numeric: tabular-nums; }
.trials-workspace .trial-reschedule { margin-top: 3px; }
.trials-workspace .trial-reschedule .button { padding: 0; min-height: 28px; color: var(--color-primary-ink); background: transparent; border-color: transparent; }
.trials-workspace .trial-reschedule .button:hover { text-decoration: underline; text-underline-offset: 3px; }
.trials-workspace .pipeline-actions .button.muted { background: var(--color-background); }
.trials-workspace .trial-completion { flex-basis: 100%; }
.trials-workspace .trial-completion .button { color: var(--color-primary-ink); border-color: var(--color-trials-workspace-trial-completion-border); }
.trials-workspace .trial-calendar-warning { color: var(--crm-warning); font-size: var(--fs-12); }
.decisions-workspace .pipeline-table th:first-child { width: 29%; }
.decisions-workspace .pipeline-table th:nth-child(2) { width: 24%; }
.decisions-workspace .pipeline-table th:nth-child(3) { width: 27%; }
.decisions-workspace .pipeline-table th:last-child { width: 20%; text-align: right; }
.decisions-workspace .pipeline-next { text-align: right; }
.decisions-workspace .pipeline-table .decision-group th { text-align: left; background: var(--color-decisions-workspace-pipeline-table-surface); color: var(--crm-text); font-size: var(--fs-13); font-weight: 600; padding-block: 10px; }
.decision-group-count { margin-left: 10px; font-size: var(--fs-12); color: var(--color-connection-state-ink); font-weight: 500; }
.decisions-workspace .decision-contact-date strong { display: block; font-weight: 600; font-variant-numeric: tabular-nums; }
.decisions-workspace .decision-due { color: var(--color-decisions-workspace-decision-due-ink); }
.decision-date-action { display: block; background: none; color: var(--color-primary-ink); border: 0; padding: 5px 0; min-height: 28px; font: inherit; cursor: pointer; text-align: left; }
.decision-date-action:hover { text-decoration: underline; text-underline-offset: 3px; }
.decisions-workspace .decision-filters { flex-wrap: wrap; gap: 4px 20px; }
.decisions-workspace .decision-filters a > span:first-child { margin: 0; color: inherit; font-size: inherit; }
.google-connection-warning { margin: 16px 24px 0; padding: 12px 16px; display: flex; align-items: center; gap: 16px; justify-content: space-between; border-left: 3px solid var(--color-decisions-workspace-decision-due-ink); background: var(--color-google-connection-warning-surface); color: var(--color-google-connection-warning-ink); }
.google-connection-warning strong { display: block; }
.google-connection-warning span { display: block; margin-top: 4px; font-size: var(--fs-13); }
.google-auth-help { margin: 12px 0; max-width: 680px; }
.google-auth-help summary { cursor: pointer; min-height: 32px; color: var(--color-primary-ink); }
.google-auth-help p { line-height: 1.6; }
.pipeline-empty { padding: 56px 0; border-top: 1px solid var(--crm-border); }
.pipeline-empty h2 { margin: 0 0 8px; font-size: var(--fs-17); }
.pipeline-empty p { margin: 0 0 18px; color: var(--crm-muted); }
.pipeline-board { padding: 0; grid-template-columns: repeat(4, minmax(0, 1fr)); overflow: visible; gap: 12px; }
.pipeline-board .funnel-column { min-width: 0; min-height: 280px; }
.pipeline-board .funnel-column > header { gap: 8px; padding: 4px 3px 12px; align-items: baseline; }
.pipeline-board .funnel-column h3 { font-size: var(--fs-13); text-transform: none; letter-spacing: 0; }
.pipeline-board .funnel-column h3 a { color: inherit; text-decoration: none; }
.pipeline-board .funnel-column h3 a:hover { color: var(--color-primary-ink); text-decoration: underline; }
.pipeline-board .funnel-column header > span { font-size: var(--fs-12); }
.pipeline-board .funnel-cards { min-width: 0; grid-template-columns: minmax(0, 1fr); }
.pipeline-board .funnel-card { min-width: 0; padding: 12px; }
.pipeline-board .funnel-card strong { font-size: var(--fs-13); }
.pipeline-board .funnel-card time { font-size: var(--fs-12); }
.pipeline-board .funnel-card p { font-size: var(--fs-13); }
.pipeline-board .funnel-card-meta small, .pipeline-board .card-qualification { font-size: var(--fs-12); }
.pipeline-board .pipeline-attention { margin-top: 10px; }
.pipeline-trial-date { display: block; color: var(--crm-muted); margin-top: 6px; font-size: var(--fs-12); }
@media (max-width: 1100px) {
    .pipeline-board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pipeline-controls .queue-filters { flex-basis: 100%; }
}
@media (min-width: 621px) and (max-width: 900px) {
    .pipeline-nav a > span, .sidebar-secondary a > span { display: none; }
    .sidebar-secondary a { padding: 0; justify-content: center; }
}
@media (max-width: 620px) {
    .crm-app { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
    .app-sidebar { height: calc(68px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); }
    .desktop-secondary-nav { display: none; }
    .pipeline-nav { height: 68px; }
    .pipeline-nav > a { height: 68px; padding: 8px 2px; gap: 5px; font-size: var(--fs-12); }
    .mobile-nav-more > summary { height: 68px; padding: 8px 2px; gap: 5px; font-size: var(--fs-12); display: flex; flex-direction: column; align-items: center; justify-content: center; list-style: none; color: var(--color-text-secondary); font-weight: 600; cursor: pointer; }
    .pipeline-nav > a > span { display: block; }
    .pipeline-nav > a > .desktop-contact-label { display: none; }
    .pipeline-nav > a > .mobile-contact-label, .mobile-nav-more { display: block; }
    .mobile-nav-more > summary::-webkit-details-marker { display: none; }
    .mobile-nav-more > summary.active, .mobile-nav-more[open] > summary { color: var(--color-primary-ink); background: var(--crm-purple-soft); box-shadow: inset 0 2px var(--crm-purple); }
    .mobile-nav-menu { width: min(270px, calc(100vw - 24px)); position: absolute; right: 12px; bottom: calc(100% + 8px); padding: 8px; background: var(--crm-card); border: 1px solid var(--crm-border); border-radius: var(--radius-md); box-shadow: var(--crm-shadow); }
    .mobile-nav-menu .sidebar-secondary a { height: auto; min-height: 44px; padding: 8px 12px; flex-direction: row; justify-content: flex-start; gap: 10px; font-size: var(--fs-14); }
    .mobile-nav-menu .sidebar-secondary a > span { display: block; }
    .mobile-nav-menu .sidebar-secondary .secondary-leads { margin-top: 8px; }
    .mobile-nav-menu .sidebar-secondary a.active { box-shadow: inset 3px 0 var(--crm-purple); }
    .pipeline-heading { gap: 12px; align-items: flex-start; margin-bottom: 14px; justify-content: flex-end; }
    .pipeline-heading p { font-size: var(--fs-14); display: none; }
    .pipeline-content .button { min-height: 44px; }
    .pipeline-controls { gap: 12px; }
    .pipeline-controls .queue-filters a { padding: 12px 0 10px; min-height: 44px; font-size: var(--fs-13); }
    .pipeline-search { width: 100%; }
    .pipeline-search input { width: 100%; flex: 1; height: 44px; font-size: var(--fs-16); }
    .pipeline-search .button { width: 44px; }
    .pipeline-table { display: block; }
    .pipeline-table thead { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); }
    .pipeline-table tbody { display: block; }
    .pipeline-table tr { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; padding: 16px 0; border-bottom: 1px solid var(--crm-border); }
    .pipeline-table tr:last-child { border-bottom: 0; }
    .pipeline-table td { padding: 0; border: 0; display: block; }
    .pipeline-table td::before { content: attr(data-label); display: block; color: var(--crm-muted); font-size: var(--fs-12); margin-bottom: 4px; }
    .pipeline-table .pipeline-person { grid-column: 1 / -1; }
    .pipeline-table .pipeline-person::before { display: none; }
    .pipeline-table .person-cell { min-height: 44px; }
    .pipeline-table small, .pipeline-attention { font-size: var(--fs-13); }
    .pipeline-contact { margin-top: -9px; }
    .pipeline-contact > a { padding-block: 12px; }
    .pipeline-copy { width: 44px; height: 44px; }
    .pipeline-table-wrap { background: transparent; }
    .pipeline-board { grid-template-columns: minmax(0, 1fr); padding: 0; }
    .pipeline-board .funnel-column { min-height: 120px; }
    .pipeline-board .funnel-column h3 { font-size: var(--fs-16); }
    .pipeline-board .funnel-column h3 a { display: block; padding-block: 8px; }
    .pipeline-board .funnel-card strong, .pipeline-board .funnel-card p { font-size: var(--fs-16); }
    .pipeline-board .funnel-card time, .pipeline-board .funnel-card-meta small, .pipeline-board .card-qualification { font-size: var(--fs-12); }
    .pipeline-empty { padding: 36px 0; }
    .contacts-workspace .pipeline-heading { align-items: center; margin: 0; }
    .contacts-workspace .pipeline-heading p { font-size: var(--fs-13); line-height: 1.5; }
    .contacts-workspace .pipeline-controls { flex-direction: column-reverse; align-items: stretch; gap: 8px; padding-bottom: 8px; }
    .contacts-workspace .queue-filters { display: flex; flex-wrap: wrap; gap: 0 18px; flex-basis: auto; }
    .contacts-workspace .queue-filters a { min-height: 44px; }
    .contacts-workspace .pipeline-table-wrap { border-inline: 0; border-radius: var(--radius-none); background: var(--color-surface); }
    .contacts-workspace .pipeline-table tr { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: 'person time' 'telegram telegram' 'outreach next'; gap: 8px 10px; padding: 16px 12px; }
    .contacts-workspace .pipeline-table td { height: auto; padding: 0; min-width: 0; }
    .contacts-workspace .pipeline-table td::before { display: none; }
    .contacts-workspace .pipeline-person { grid-area: person; }
    .contacts-workspace .pipeline-telegram { grid-area: telegram; }
    .contacts-workspace .pipeline-outreach { grid-area: outreach; align-self: center; }
    .contacts-workspace .pipeline-next { grid-area: next; align-self: center; }
    .contacts-workspace .pipeline-time { grid-area: time; white-space: nowrap; }
    .contacts-workspace .pipeline-contact { margin: 0; }
    .contacts-workspace .pipeline-contact a { display: inline-flex; align-items: center; min-height: 44px; padding-block: 10px; }
    .contacts-workspace .pipeline-copy { width: 44px; height: 44px; }
    .contacts-workspace .telegram-contact-check { min-height: 44px; font-size: var(--fs-13); min-width: 98px; padding-inline: 7px; }
    .contacts-workspace .telegram-add { min-height: 44px; font-size: var(--fs-14); padding-inline: 10px; }
    .contacts-workspace .telegram-contact-status[data-state="error"] { max-width: 170px; }
    .contacts-workspace .pipeline-actions .button { min-height: 44px; padding-inline: 10px; font-size: var(--fs-13); }
    .pipeline-zone { font-size: var(--fs-12); }
    .trials-workspace .pipeline-table tr { grid-template-columns: minmax(0,1fr); grid-template-areas: 'person' 'telegram' 'scheduled' 'next'; gap: 6px; }
    .trials-workspace .pipeline-scheduled { grid-area: scheduled; display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: 0 12px; }
    .trials-workspace .pipeline-table .pipeline-scheduled::before { display: block; content: 'Пробное · МСК'; width: 100%; margin: 0; }
    .trials-workspace .trial-date { font-size: var(--fs-15); }
    .trials-workspace .trial-reschedule { margin: 0; }
    .trials-workspace .trial-reschedule .button { padding-inline: 8px; }
    .trials-workspace .pipeline-next { margin-top: 4px; }
    .trials-workspace .pipeline-next .pipeline-actions { gap: 6px; }
    .trials-workspace .trial-calendar-warning { width: 100%; }
    .stage-transition-dialog .transition-description { font-size: var(--fs-14); line-height: 1.5; }
    .stage-transition-dialog label span { font-size: var(--fs-13); }
    .stage-transition-dialog form input, .stage-transition-dialog form select, .stage-transition-dialog form textarea { font-size: var(--fs-16); min-height: 44px; }
    .stage-transition-dialog button { min-height: 44px; }
    .decisions-workspace .pipeline-table .decision-group { display: block; padding: 0; }
    .decisions-workspace .pipeline-table .decision-group th { display: block; width: 100%; padding: 10px 12px; text-align: left; }
    .decisions-workspace .pipeline-table .decision-row { grid-template-columns: minmax(0,1fr) auto; grid-template-areas: 'person person' 'telegram telegram' 'contact next'; gap: 6px 12px; }
    .decisions-workspace .decision-contact-date { grid-area: contact; padding-block: 8px; }
    .decisions-workspace .pipeline-table .decision-contact-date::before { display: block; margin-bottom: 4px; }
    .decisions-workspace .pipeline-table .pipeline-next { grid-column: auto; text-align: right; align-self: center; }
    .decisions-workspace .decision-date-action { min-height: 44px; }
    .decisions-workspace .pipeline-table .decision-contact-date strong { font-size: var(--fs-15); }
    .google-connection-warning { margin: 12px 12px 0; flex-direction: row; align-items: center; padding: 6px 10px; gap: 8px; }
    .google-connection-warning .button, .google-auth-help summary { min-height: 44px; }
}
.crm-app [hidden] { display: none !important; }
.contacts-workspace:not(.trials-workspace):not(.decisions-workspace) .pipeline-table th:nth-child(2) { width: 22%; }
.contacts-workspace:not(.trials-workspace):not(.decisions-workspace) .pipeline-table th:nth-child(3) { width: 15%; }
.contacts-workspace:not(.trials-workspace):not(.decisions-workspace) .pipeline-table th:nth-child(4) { width: 28%; }
.contacts-workspace:not(.trials-workspace):not(.decisions-workspace) .pipeline-table th:last-child { width: 10%; }
.drawer-message p { font-size: var(--fs-14); line-height: 1.5; }
.google-warning-details { flex: 1; min-width: 0; }
.google-warning-details summary { min-height: 36px; display: flex; align-items: center; cursor: pointer; font-size: var(--fs-13); font-weight: 600; list-style: none; }
.google-warning-details summary::-webkit-details-marker { display: none; }
.google-warning-details summary::after { content: '⌄'; margin-left: 8px; }
.google-warning-details[open] summary::after { content: '⌃'; }
.google-warning-details p { margin: 4px 0 0; font-size: var(--fs-13); line-height: 1.5; }
.google-connection-warning > .button { flex: 0 0 auto; }
.drawer-message time, .drawer-title-row .stage-badge { font-size: var(--fs-12); }
.quick-actions .button, .action-menu > summary { font-size: var(--fs-13); font-weight: 600; }
.latest-message { align-self: center; flex: 0 0 auto; min-height: 36px; padding: 6px 14px; border: 0; background: var(--color-surface); color: var(--color-primary-ink); font: inherit; font-size: var(--fs-13); cursor: pointer; }
.latest-message[hidden], .board-stage-tabs { display: none; }
.analytics-breakdown-row strong, .data-table .person-cell strong, .data-table .telegram-link { font-size: var(--fs-14); }
.data-table td small { font-size: var(--fs-12); }
.data-table .person-cell { min-height: 36px; }
.directory-filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin-bottom: 16px; }
.directory-filters label { display: grid; gap: 6px; font-size: var(--fs-12); color: var(--crm-muted); }
.directory-filters .directory-query { flex: 1; min-width: 220px; }
.directory-filters input, .directory-filters select, .queue-refinements select { min-height: 38px; min-width: 0; padding: 6px 10px; border: 1px solid var(--crm-border); border-radius: var(--radius-sm); background: var(--color-surface); color: var(--crm-text); font: inherit; font-size: var(--fs-14); }
.directory-summary { margin: 12px 0; display: flex; justify-content: space-between; gap: 16px; font-size: var(--fs-13); color: var(--crm-muted); }
.directory-summary a, .list-pagination a { text-decoration: none; }
.directory-table td:first-child { width: 29%; }
.directory-table td:nth-child(2) { width: 19%; }
.directory-table td:last-child { width: 14%; white-space: nowrap; }
.directory-table .person-cell strong { white-space: normal; overflow-wrap: anywhere; }
.directory-table td small.decision-due, .decision-due { color: var(--crm-warning); }
.list-pagination { display: flex; align-items: center; justify-content: flex-end; gap: 16px; margin-top: 16px; font-size: var(--fs-13); }
.queue-refinements { display: flex; align-items: end; gap: 12px; margin-bottom: 16px; }
.queue-refinements label { display: grid; gap: 4px; font-size: var(--fs-12); color: var(--crm-muted); }
.metric-drilldown { color: inherit; text-decoration: none; display: inline-block; }
.metric-drilldown:hover { color: var(--color-primary-ink); text-decoration: underline; text-underline-offset: 4px; }
.analytics-context-strip .metric-drilldown { min-height: 44px; }
.calendar-sync-label { display: block; color: var(--crm-muted); font-size: var(--fs-12); line-height: 1.5; }
.calendar-agenda-event a { display: block; min-height: 32px; padding-block: 6px; }
.calendar-event-meta { margin: 4px 0; font-size: var(--fs-13); }
.calendar-event[data-source="google"] { border-left: 2px solid var(--crm-muted); background: var(--color-calendar-event-surface-detail); color: var(--crm-text); }
.settings-content .settings-list { border-radius: var(--radius-none); }
.settings-list p { font-size: var(--fs-14); line-height: 1.5; }
.settings-list details { font-size: var(--fs-13); line-height: 1.5; margin-top: 12px; }
.settings-list summary { cursor: pointer; color: var(--color-primary-ink); min-height: 32px; }
.settings-list .mini-button { font-size: var(--fs-13); min-height: 36px; }
.touch-message-preview { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.5; }
@media (max-width: 620px) {
    .crm-app input:not([type="checkbox"]):not([type="radio"]), .crm-app select, .crm-app textarea { font-size: var(--fs-16); }
    .directory-filters { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
    .directory-filters .directory-query { grid-column: 1 / -1; min-width: 0; }
    .directory-filters label { min-width: 0; }
    .directory-filters input, .directory-filters select, .queue-refinements select { width: 100%; min-height: 44px; }
    .directory-filters .button, .directory-summary a, .list-pagination .button { min-height: 44px; display: inline-flex; align-items: center; }
    .directory-table, .directory-table tbody { display: block; }
    .directory-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    .directory-table tr { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; padding: 12px; border-bottom: 1px solid var(--crm-border); }
    .directory-table td, .directory-table td:first-child, .directory-table td:last-child { width: auto; padding: 0; border: 0; }
    .directory-table .directory-task { grid-column: 1 / -1; grid-row: 2; }
    .directory-table .directory-stage { grid-column: 1; grid-row: 3; }
    .directory-table .directory-time { grid-column: 2; grid-row: 1; font-size: var(--fs-12); }
    .directory-table .person-cell { align-items: start; min-height: 44px; }
    .directory-table .person-cell strong { font-size: var(--fs-16); }
    .queue-refinements { flex-wrap: wrap; gap: 8px; }
    .queue-refinements label { flex: 1; min-width: 120px; }
    .queue-refinements .button { min-height: 44px; }
    .touches-workspace .pipeline-heading, .pipeline-content:has(.board-stage-tabs) .pipeline-heading { display: none; }
    .touches-workspace .pipeline-controls { padding-bottom: 12px; gap: 8px; }
    .touches-workspace .queue-filters { gap: 0 12px; }
    .pipeline-controls .queue-filters { grid-template-columns: 1fr 1fr; overflow: visible; display: flex; flex-wrap: wrap; gap: 0 16px; }
    .touches-workspace .pipeline-table tr { grid-template-columns: minmax(0,1fr) auto; grid-template-areas: 'person time' 'preview preview' 'state state'; gap: 6px 8px; padding: 12px 0; }
    .touches-workspace .pipeline-person { grid-area: person; }
    .touches-workspace .pipeline-person small, .touches-workspace .pipeline-telegram, .touches-workspace td::before, .touches-workspace .pipeline-next small { display: none; }
    .touches-workspace .pipeline-next { grid-area: preview; }
    .touches-workspace .pipeline-state { grid-area: state; }
    .touches-workspace .pipeline-time { grid-area: time; align-self: center; font-size: var(--fs-12); }
    .touches-workspace .pipeline-attention { font-size: var(--fs-12); }
    .touches-workspace .pipeline-table .person-cell { min-height: 36px; }
    .touches-workspace .touch-message-preview { font-size: var(--fs-15); }
    .pipeline-board.has-mobile-stages .funnel-column > header { display: none; }
    .calendar-agenda-event a, .settings-list summary, .settings-list .mini-button { min-height: 44px; }
    .compact-read-table, .compact-read-table tbody { display: block; }
    .compact-read-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    .compact-read-table tr { display: grid; gap: 8px; padding: 12px; border-bottom: 1px solid var(--crm-border); }
    .compact-read-table td { padding: 0; border: 0; overflow-wrap: anywhere; }
    .compact-read-table td:last-child { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
    .compact-read-table a { min-height: 44px; display: inline-flex; align-items: center; }
}
@media (prefers-reduced-motion: reduce) {
    .lead-drawer, .drawer-panel { transition: none; }
}
@media (max-width: 620px) {
    .google-warning-details summary { min-height: 44px; }
    .google-connection-warning > .button { font-size: var(--fs-12); padding-inline: 8px; }
    .board-stage-tabs { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 4px; position: sticky; top: 0; z-index: 5; background: var(--crm-bg); padding: 8px 0; border-bottom: 1px solid var(--crm-border); }
    .board-stage-tabs button { min-width: 0; min-height: 52px; padding: 5px 2px; display: grid; gap: 4px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--crm-muted); font: inherit; font-size: var(--fs-12); cursor: pointer; }
    .board-stage-tabs button[aria-selected="true"] { color: var(--color-primary-ink); border-color: var(--crm-purple); font-weight: 600; }
    .pipeline-board.has-mobile-stages .funnel-column:not(.mobile-lane-active) { display: none; }
    .pipeline-content { padding-top: 12px; }
    .contacts-workspace:not(.trials-workspace):not(.decisions-workspace) .pipeline-table tr { grid-template-columns: minmax(0,1fr) auto auto; grid-template-areas: 'person person time' 'telegram telegram telegram' 'outreach next next'; }
    .contacts-workspace:not(.trials-workspace):not(.decisions-workspace) .pipeline-table tr:has(.telegram-add) { grid-template-areas: 'person person time' 'telegram telegram telegram' 'outreach outreach outreach' 'next next next'; }
    .contacts-workspace:not(.trials-workspace):not(.decisions-workspace) .pipeline-actions { gap: 2px; flex-wrap: nowrap; }
    .contacts-workspace:not(.trials-workspace):not(.decisions-workspace) .pipeline-actions .button { padding-inline: 7px; font-size: var(--fs-14); }
    .contacts-workspace .pipeline-time { align-self: center; padding-top: 0; font-size: var(--fs-12); }
    .contacts-workspace .pipeline-table .person-cell strong { font-size: var(--fs-16); }
    .contacts-workspace .pipeline-table small { font-size: var(--fs-13); }
    .ai-reply-row { grid-template-columns: minmax(0,1fr) auto; gap: 8px; }
    .ai-reply-row .ai-reply-text { grid-column: 1 / -1; font-size: var(--fs-16); min-height: 68px; }
    .ai-reply-row .ai-generate { justify-self: start; min-height: 44px; font-size: var(--fs-14); }
    .ai-reply-row .ai-send { min-height: 44px; font-size: var(--fs-14); }
    .drawer-message p { font-size: var(--fs-16); }
    .drawer-message > div { max-width: 90%; }
    .drawer-header { min-height: 68px; padding: 12px; }
    .drawer-header-actions button { width: 44px; height: 44px; }
    .quick-actions .button, .quick-actions summary { min-height: 44px; }
    .lead-facts { padding: 8px 12px; gap: 8px; grid-template-columns: 1fr 1fr; }
    .lead-facts > div:first-child, .lead-facts > div:nth-child(4), .lead-facts > div:nth-child(5), .form-sync-action small { display: none; }
    .drawer-tabs { padding-inline: 12px; gap: 14px; }
    .drawer-tabs button { min-height: 44px; }
    .lead-drawer .open-avito-link { padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); font-size: var(--fs-12); }
    .qualification-analytics > header > strong { text-align: left; max-width: none; }
}
.auto-reply-state { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 12px 20px; padding: 10px 0; border-bottom: 1px solid var(--crm-border); color: var(--color-text-secondary); font-size: var(--fs-13); }
.auto-reply-state.handoff { color: var(--crm-warning); }
.auto-reply-state form { flex-shrink: 0; margin: 0; }
.auto-reply-error { color: var(--crm-danger); }
.bot-row-state { display: block; max-width: 260px; color: var(--crm-warning); margin-top: 4px; overflow-wrap: anywhere; }
.drawer-message.outgoing time { color: var(--color-text-secondary); }
@media(max-width:700px) {
    .auto-reply-state { margin: 12px 16px; flex-wrap: wrap; }
    .auto-reply-state .mini-button, .auto-reply-settings .mini-button { min-height: 44px; }
}
.sidebar-nav a { position: relative; }
.nav-attention { margin-left: auto; min-width: 20px; padding: 1px 5px; border-radius: var(--radius-sm); font-size: var(--fs-12); text-align: center; }
.nav-attention.urgent { background: var(--color-danger-fill); color: var(--color-on-primary); }
@media(max-width:700px) {
    .pipeline-nav .nav-attention { position: absolute; right: 5px; top: 3px; margin: 0; font-size: var(--fs-11); min-width: 16px; padding: 0 3px; }
}

/* Shared interaction motion. Only paint changes on controls; hit areas stay put.
 * Native overlays animate on entry only, so closing immediately releases their
 * top-layer, focus and pointer behavior without a JavaScript animation wait. */
@media (prefers-reduced-motion: no-preference) {
    .crm-app :where(button, .button, .mini-button, summary,
        .sidebar-nav a, .sidebar-secondary a, .queue-filters a, .filter-pills a,
        .team-period-presets a, .workspace-option, .team-cabinet-nav a,
        .inbox-row, .work-item, .notification-mode label > span, .theme-options span,
        .trial-time-menu [role="option"]) {
        transition: color var(--motion-control) var(--motion-ease),
            background-color var(--motion-control) var(--motion-ease),
            border-color var(--motion-control) var(--motion-ease),
            box-shadow var(--motion-control) var(--motion-ease),
            opacity var(--motion-control) var(--motion-ease);
    }
    .crm-app :where(input:not([type="checkbox"]):not([type="radio"]), select, textarea) {
        transition: border-color var(--motion-control) var(--motion-ease),
            background-color var(--motion-control) var(--motion-ease);
    }
    .crm-app :where(.button, .mini-button, .workspace-trigger, .record-more,
        .drawer-close, .group-dialog-close, .team-dialog-close, .offering-close,
        .inbox-back):not(:disabled):not([aria-disabled="true"]):active { opacity: .92; }

    .stage-transition-dialog:not([hidden]) > .stage-transition-surface,
    .analytics-refresh-dialog:not([hidden]) > section {
        animation: crm-surface-enter var(--motion-panel) var(--motion-ease);
    }
    .stage-transition-dialog:not([hidden]) > .stage-transition-backdrop,
    .analytics-refresh-dialog:not([hidden]) > .analytics-refresh-backdrop {
        animation: crm-surface-enter var(--motion-panel) var(--motion-ease);
    }
    .action-menu[open] > form, .action-menu[open] > .action-stack,
    .mobile-nav-more[open] > .mobile-nav-menu, .inbox-actions-menu[open] > div {
        animation: crm-surface-enter var(--motion-menu) var(--motion-ease);
    }

    /* Opacity-only dialogs keep nested time-picker anchors in their final place. */
    .crm-app :is(.team-dialog, .group-trial-dialog, .offering-dialog, .integration-dialog)[open],
    .crm-app :is(.team-dialog, .group-trial-dialog, .offering-dialog, .integration-dialog)[open]::backdrop {
        opacity: 1;
        transition: opacity var(--motion-panel) var(--motion-ease);
    }
    .crm-app :is(.workspace-picker, .team-action-menu, .record-menu, .outcome-menu):popover-open {
        opacity: 1;
        transform: none;
        transition: opacity var(--motion-menu) var(--motion-ease), transform var(--motion-menu) var(--motion-ease);
    }
    .crm-app .trial-time-menu:popover-open {
        opacity: 1;
        transition: opacity var(--motion-menu) var(--motion-ease);
    }
    @starting-style {
        .crm-app :is(.team-dialog, .group-trial-dialog, .offering-dialog, .integration-dialog)[open],
        .crm-app :is(.team-dialog, .group-trial-dialog, .offering-dialog, .integration-dialog)[open]::backdrop,
        .crm-app .trial-time-menu:popover-open { opacity: 0; }
        .crm-app :is(.workspace-picker, .team-action-menu, .record-menu, .outcome-menu):popover-open {
            opacity: 0;
            transform: translateY(4px);
        }
    }
}
@keyframes crm-surface-enter { from { opacity: 0; } to { opacity: 1; } }

/* Potok: one work sheet, workspace-coloured chrome and shared semantic accents. */
.crm-app {
    --accent: var(--ws-current-fill, var(--color-text));
    --accent-ink: var(--ws-current, var(--color-text));
    --accent-soft: var(--ws-current-tint, var(--color-surface-muted));
    --on-accent: var(--color-on-primary);
    --chrome: var(--ws-current-chrome, var(--color-background));
    --crm-purple: var(--accent);
    --crm-purple-soft: var(--accent-soft);
    font-family: Onest, "Segoe UI", Arial, sans-serif;
    background: var(--color-background);
    line-height: 1.45;
}
.crm-app:not([data-workspace-color]) { --on-accent: var(--color-surface); }
.auth-page { font-family: Onest, "Segoe UI", Arial, sans-serif; }
@media (max-width: 620px) {
    .auth-page .auth-form input { min-height: 44px; font-size: var(--fs-16); }
    .auth-page .auth-form button { min-height: 44px; font-size: var(--fs-14); }
}
.crm-app .app-main { margin: 10px 10px 10px 302px; min-height: calc(100vh - 20px); background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-sheet); }
.crm-app .app-header { height: 60px; min-height: 60px; padding: 8px 20px; gap: 12px; border-radius: var(--radius-sheet) var(--radius-sheet) 0 0; }
.crm-app .app-header h1, .crm-app .drawer-title-row h2, .crm-app .group-trial-dialog h2, .crm-app .team-dialog h2, .auth-copy h1 { font-family: var(--font-display); font-size: var(--fs-20); font-weight: 700; letter-spacing: -.025em; line-height: 1.3; }
.crm-app .app-content { padding: 20px 20px 40px; }
.crm-app .global-search { height: 34px; width: 260px; background: var(--color-surface-subtle); }
.crm-app .global-search input { font-size: var(--fs-14); }
.crm-app .avito-balance span { text-transform: none; letter-spacing: 0; font-weight: 400; }
.crm-app .avito-balance-part { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.crm-app .button, .crm-app .mini-button { min-height: 34px; font-weight: 600; border-radius: var(--radius-pill); background: var(--color-surface-subtle); border-color: transparent; }
.crm-app .button.primary, .crm-app .mini-button.primary { color: var(--on-accent); background: var(--accent); border-color: transparent; }
.crm-app .button.secondary:hover, .crm-app .mini-button:hover { color: var(--color-text); background: var(--color-surface-hover); border-color: transparent; }
.crm-app :is(input,select,textarea):focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.crm-app :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.crm-app .queue-filters { min-height: 42px; gap: 18px; }
.crm-app .queue-filters a { font-size: var(--fs-14); font-weight: 500; }
.crm-app .queue-filters a.active, .crm-app .drawer-tabs button.active { color: var(--color-text); border-bottom-color: var(--accent); }
.crm-app .pipeline-table, .crm-app .directory-table, .crm-app .data-table { border: 0; border-radius: var(--radius-none); box-shadow: none; }
.crm-app :is(.pipeline-table,.directory-table,.data-table) :is(th,td) { border-bottom-color: var(--color-line-soft); }
.crm-app :is(.pipeline-table,.directory-table,.data-table) th { color: var(--color-text-muted); background: var(--color-surface); font-weight: 500; }
.crm-app :is(.pipeline-table,.directory-table,.data-table) tbody tr:hover { background: var(--color-surface-subtle); }
.crm-app .person-cell { gap: 0; }
.crm-app .person-cell strong { font-weight: 600; }
.crm-app :is(.person-cell,.lead-identity,.funnel-card) > .lead-avatar { display: none; }
.crm-app .pipeline-attention, .crm-app .stage-badge, .crm-app .attention-tag { padding: 0; background: transparent; border: 0; font-weight: 500; }
.crm-app .pipeline-attention.needs-reply { color: var(--color-danger); }
.crm-app .telegram-link, .crm-app .drawer-refresh { color: var(--accent-ink); }
.crm-app .telegram-contact-check { border-radius: var(--radius-control); font-weight: 500; }
.attention-glyph { display: inline-block; flex: 0 0 8px; width: 8px; height: 8px; margin-top: 6px; border-radius: var(--radius-circle); background: var(--color-text-muted); }
.attention-glyph.needs-reply { background: var(--color-danger); }
.attention-glyph.waiting { background: transparent; border: 1px solid var(--color-text-muted); }
.crm-app .metric-strip strong, .crm-app .team-metric-strip strong, .crm-app .calendar-day-number { font-family: var(--font-display); font-size: var(--fs-22); font-weight: 700; font-variant-numeric: proportional-nums; letter-spacing: -.02em; }
.crm-app .drawer-panel { width: min(500px, 100vw); box-shadow: var(--shadow-overlay); }
.crm-app .drawer-title-row { flex-wrap: wrap; gap: 6px 12px; }
.crm-app .drawer-title-row h2 { font-size: var(--fs-20); }
.crm-app .drawer-messages { background: var(--color-surface); }
.crm-app .drawer-message > div { background: var(--color-bubble); border: 0; border-radius: var(--radius-bubble) var(--radius-bubble) var(--radius-bubble) var(--radius-sm); }
.crm-app .drawer-message.outgoing > div { color: var(--on-accent); background: var(--accent); border-color: transparent; border-radius: var(--radius-bubble) var(--radius-bubble) var(--radius-sm) var(--radius-bubble); }
.crm-app .drawer-message p { font-weight: 400; }
.crm-app .ai-reply-text { border-radius: var(--radius-sheet); background: var(--color-surface-subtle); border-color: transparent; }
.crm-app .drawer-tabs button { font-weight: 500; }
.crm-app .funnel-column { background: transparent; border: 0; border-left: 1px solid var(--color-border); border-radius: var(--radius-none); padding: 8px 12px; }
.crm-app .funnel-column:first-child { border-left: 0; }
.crm-app .funnel-column h3 { text-transform: none; letter-spacing: 0; font-weight: 600; }
.crm-app .funnel-column.drop-target { background: var(--accent-soft); outline: 1px dashed var(--accent); }
.crm-app .funnel-card { border-color: transparent; background: transparent; box-shadow: none; }
.crm-app .funnel-card:hover { background: var(--color-surface-subtle); border-color: transparent; }
.crm-app .funnel-card > div > strong { font-weight: 600; }
.crm-app .calendar-cell.is-today { background: var(--accent-soft); }
.crm-app .calendar-event, .crm-app .calendar-agenda-event { border-left: 0; border-radius: var(--radius-control); background: var(--accent-soft); }
.crm-app .calendar-agenda-event { padding: 14px 12px; }
@media (max-width: 620px) {
    .crm-app .calendar-date-label { min-width: 144px; }
}
.crm-app .conversion-flow { background: transparent; }
@media (min-width: 861px) and (max-width: 1150px) {
    .crm-app .header-actions .global-search { display: none; }
    .crm-app .header-search-link { display: grid; }
    .crm-app .avito-balance { display: none; }
}
@media (min-width: 621px) and (max-width: 860px) {
    .crm-app .app-main { margin: 0; min-height: calc(100vh - 112px); }
}
@media (max-width: 620px) {
    .crm-app .app-main { margin: 0; border: 0; border-radius: var(--radius-none); min-height: calc(100dvh - 68px - env(safe-area-inset-bottom)); }
    .crm-app .app-header { height: auto; min-height: 58px; padding: 8px 12px; border-radius: var(--radius-none); }
    .crm-app .app-content { padding: 14px 12px 28px; }
    .crm-app .button, .crm-app .mini-button { min-height: 44px; }
    .crm-app .drawer-panel { width: 100%; }
    .crm-app .drawer-message p, .crm-app .ai-reply-text { font-size: var(--fs-16); }
    .crm-app .queue-filters { gap: 16px; }
}

.crm-app {
    --color-status-pill-ink: var(--accent-ink);
    --color-auth-back-ink: var(--accent-ink);
    --color-profile-avatar-ink: var(--accent-ink);
    --color-profile-avatar-surface: var(--accent-soft);
    --color-lead-avatar-ink: var(--accent-ink);
    --color-lead-avatar-surface: var(--accent-soft);
    --color-flash-info-ink: var(--accent-ink);
    --color-flash-info-surface: var(--accent-soft);
    --color-work-panel-ink: var(--accent-ink);
    --color-attention-tag-ink: var(--accent-ink);
    --color-stage-badge-ink: var(--accent-ink);
    --color-stage-badge-surface: var(--accent-soft);
    --color-stage-badge-stage-decision-ink: var(--accent-ink);
    --color-stage-badge-stage-decision-surface: var(--accent-soft);
    --color-copy-question-ink: var(--accent-ink);
    --color-form-sync-action-ink: var(--accent-ink);
    --color-form-sync-action-surface: var(--accent-soft);
    --color-form-sync-action-ink-detail: var(--accent-ink);
    --color-archive-notice-ink: var(--accent-ink);
    --color-inline-retry-ink: var(--accent-ink);
    --color-drawer-message-outgoing-ink: var(--on-accent);
    --color-ai-generate-hover-surface: var(--accent-soft);
    --color-ai-generate-disabled-surface: var(--accent-soft);
    --color-drawer-message-pending-sync-ink: var(--accent-ink);
    --color-funnel-stage-controls-funnel-reset-ink: var(--accent-ink);
    --color-conversion-flow-ink-detail: var(--accent-ink);
    --color-funnel-stage-controls-hover-ink: var(--accent-ink);
    --color-calendar-modes-ink: var(--accent-ink);
    --color-calendar-modes-surface: var(--accent-soft);
    --color-calendar-event-surface: var(--accent-soft);
    --color-calendar-event-ink: var(--accent-ink);
    --color-calendar-event-surface-detail: var(--accent-soft);
    --color-avatar-placeholder-surface: var(--accent);
    --color-conversation-message-outgoing-surface: var(--accent-soft);
    --color-trial-time-menu-surface: var(--accent-soft);
}

.crm-app .pipeline-table-wrap, .crm-app .data-table-wrap, .crm-app .ad-table-wrap { border: 0; border-radius: var(--radius-none); }
.crm-app .contacts-workspace .person-cell { gap: 0; }
.crm-app .contacts-workspace .telegram-value { min-width: 0; }
.crm-app .telegram-link { overflow-wrap: anywhere; }
.crm-app .pipeline-table th { background: var(--color-surface); }
.crm-app .stage-badge { display: inline-flex; align-items: center; gap: 8px; color: var(--color-text-secondary); }
.stage-meter { display: inline-flex; gap: 2px; flex-shrink: 0; }
.stage-meter i { display: block; width: 11px; height: 4px; background: var(--color-border); border-radius: var(--radius-indicator); }
.stage-meter:not(.archived):not(.closed):not(.stage-enrolled) i:first-child { background: var(--accent); }
.stage-meter:is(.stage-communication,.stage-trial,.stage-decision) i:nth-child(2), .stage-meter:is(.stage-trial,.stage-decision) i:nth-child(3), .stage-meter.stage-decision i:nth-child(4) { background: var(--accent); }
.stage-meter.stage-enrolled:not(.archived) i { background: var(--color-success); }
.crm-app .directory-stage { vertical-align: middle; }
.crm-app .directory-stage .stage-meter { margin: 0 8px 4px 0; vertical-align: middle; }
.crm-app .calendar-day { font-family: var(--font-display); font-size: var(--fs-15); font-weight: 500; font-variant-numeric: tabular-nums; }
.crm-app .calendar-cell.is-today .calendar-day { background: var(--accent); color: var(--on-accent); }
.crm-app .conversion-flow.customizable-funnel { flex-direction: column; overflow: visible; border: 0; }
.crm-app .conversion-flow.customizable-funnel .funnel-node { display: grid; grid-template-columns: 200px minmax(100px,1fr) 60px; align-items: center; gap: 12px; min-height: 44px; padding: 8px 0; min-width: 0; flex: none; text-align: left; }
.crm-app .funnel-node > span { grid-column: 1; grid-row: 1; margin: 0; font-size: var(--fs-14); }
.crm-app .funnel-node > .metric-drilldown { grid-column: 3; grid-row: 1; text-align: right; }
.crm-app .funnel-node > .metric-drilldown strong { font-family: var(--font-display); font-size: var(--fs-16); font-weight: 500; }
.funnel-proportion { grid-column: 2; grid-row: 1; height: 22px; width: 100%; border-radius: var(--radius-sm); }
.funnel-proportion .funnel-track { fill: var(--color-surface-subtle); }
.funnel-proportion .funnel-fill { fill: var(--accent); }
.crm-app .conversion-flow .funnel-arrow { display: flex; flex-direction: row; justify-content: flex-end; align-items: center; align-self: stretch; gap: 8px; padding: 0; min-height: 24px; flex: none; }
.crm-app .conversion-flow .funnel-direction { transform: rotate(90deg); }
.crm-app .funnel-node .funnel-exception { grid-column: 1 / -1; }
@media (max-width: 620px) {
    .crm-app .conversion-flow.customizable-funnel .funnel-node { grid-template-columns: minmax(0,1fr) 52px; gap: 6px 12px; }
    .crm-app .funnel-node > .metric-drilldown { grid-column: 2; }
    .crm-app .funnel-proportion { grid-column: 1 / -1; grid-row: 2; height: 18px; }
    .crm-app .directory-stage { display: block; }
}
.crm-app { --color-primary: var(--accent); --color-primary-ink: var(--accent-ink); --color-primary-soft: var(--accent-soft); --color-focus-border: var(--accent); --color-focus-soft: var(--accent-soft); --color-primary-border: var(--color-border); }
.crm-app .pipeline-table :is(th,td) { padding: 10px 12px; }
.crm-app .pipeline-table :is(th,td):first-child { padding-left: 16px; }
.crm-app .pipeline-table :is(th,td):last-child { padding-right: 16px; }
.crm-app .ai-send, .crm-app .ai-generate { font-weight: 500; }
.crm-app .ai-send:hover { background: var(--accent-ink); }
@media (max-width: 620px) {
    .crm-app .pipeline-table td, .crm-app .pipeline-table td:first-child, .crm-app .pipeline-table td:last-child { padding: 0; }
}

/* Workflows: daily navigation first, secondary tools on demand. */
.sidebar-cabinet-name { font-family: var(--font-display); font-size: var(--fs-18); font-weight: 500; line-height: 1.4; }
.crm-app .sidebar-section-more { margin-top: 8px; }
.crm-app .sidebar-section-more > summary { min-height: 44px; padding: 8px 11px; display: flex; align-items: center; gap: 10px; list-style: none; cursor: pointer; color: var(--color-text-secondary); font-size: var(--fs-14); font-weight: 500; border-radius: var(--radius-control); }
.sidebar-section-more > summary::-webkit-details-marker, .header-tools > summary::-webkit-details-marker { display: none; }
.crm-app .sidebar-section-more > summary:hover { background: var(--color-surface-subtle); color: var(--color-text); }
.crm-app .sidebar-more-links { padding-top: 4px; }
.crm-app .sidebar-more-links a { font-weight: 400; }
.crm-app .sidebar-more-links .secondary-leads { margin-top: 0; }
.workspace-label { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-14); }
.workspace-heading > .workspace-label { display: none; }
.crm-app .workspace-mobile-trigger { display: none; }
.header-tools { position: relative; }
.header-tools > summary { display: grid; place-items: center; list-style: none; min-width: 36px; min-height: 36px; border-radius: var(--radius-control); cursor: pointer; }
.header-tools > summary:hover, .header-tools[open] > summary { background: var(--color-surface-subtle); }
.header-tools-menu { position: absolute; right: 0; top: calc(100% + 8px); width: 280px; max-width: calc(100vw - 24px); padding: 12px; border: 1px solid var(--color-border); border-radius: var(--radius-lg); background: var(--color-surface); box-shadow: var(--shadow-overlay); z-index: 160; }
.crm-app .header-tools-menu .avito-balance { display: grid; padding: 0 0 12px; margin: 0 0 12px; gap: 8px; border-bottom: 1px solid var(--color-border); }
.crm-app .header-tools-menu .avito-balance[hidden] { display: none; }
.crm-app .header-tools-menu .avito-balance-part { justify-content: space-between; border: 0; padding: 0; font-size: var(--fs-14); }
.crm-app .header-tools-menu .sync-control { width: 100%; justify-content: flex-start; min-height: 44px; border: 0; }
.crm-app .header-tools-menu .sync-control span { display: inline; }
.crm-app .sidebar-column :is(.pipeline-nav,.sidebar-secondary) a { font-size: var(--fs-14); }
@media (max-width: 860px) {
    .crm-app .mobile-nav-menu .sidebar-section-more { display: contents; }
    .crm-app .mobile-nav-menu .sidebar-section-more > summary { display: none; }
    .crm-app .mobile-nav-menu .sidebar-more-links { display: grid; }
}
@media (max-width: 620px) {
    .crm-app .workspace-mobile-trigger { display: inline-flex; }
    .crm-app .workspace-label { display: none; }
    .header-tools > summary { min-width: 44px; min-height: 44px; }
}

.crm-app .pipeline-table .person-cell strong { font-size: var(--fs-16); font-weight: 600; }
.crm-app .pipeline-table :is(th,small,.pipeline-time,.telegram-contact-check), .crm-app .pipeline-actions .button { font-size: var(--fs-14); }

/* Read the result first; comparisons and definitions stay on demand. */
.crm-app .analytics-content { max-width: 1440px; }
.crm-app .analytics-section-nav { gap: 24px; padding-top: 0; margin-bottom: 8px; }
.crm-app .analytics-section-nav a, .crm-app .period-tabs a { font-size: var(--fs-14); font-weight: 500; }
.crm-app .analytics-toolbar { padding: 8px 0 16px; margin: 0; border-top: 0; }
.crm-app .period-tabs { flex-wrap: wrap; gap: 4px 16px; }
.crm-app .period-tabs a { min-height: 40px; padding: 10px 0; }
.crm-app .custom-period-disclosure > summary { min-height: 40px; padding: 10px 0; font-size: var(--fs-14); }
.crm-app .conversion-card { padding: 24px 0; margin: 0; border: 0; }
.crm-app .conversion-card-header { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin: 0 0 20px; }
.conversion-card-header h2 { margin: 0 0 8px; font-size: var(--fs-18); font-weight: 600; }
.analytics-period-label { color: var(--color-text-secondary); font-size: var(--fs-14); }
.crm-app .funnel-outcome { margin-left: auto; gap: 4px; align-items: flex-end; }
.crm-app .funnel-outcome strong { font-size: var(--fs-24); }
.crm-app .funnel-outcome span { font-size: var(--fs-14); font-weight: 400; color: var(--color-text-secondary); }
.crm-app .funnel-settings > summary { font-size: var(--fs-14); font-weight: 400; min-height: 40px; padding: 10px 4px; }
.crm-app .funnel-settings[open] .funnel-stage-controls { z-index: 3; }
.crm-app .funnel-stage-controls { min-width: 0; width: min(620px,calc(100vw - 40px)); flex-wrap: wrap; }
.crm-app .funnel-stage-controls button { min-height: 44px; font-size: var(--fs-14); font-weight: 500; }
.crm-app .conversion-flow.customizable-funnel { padding: 0; gap: 0; }
.crm-app .conversion-flow.customizable-funnel .funnel-node { grid-template-columns: 180px minmax(60px,1fr) 64px; min-height: 40px; padding: 6px 0; gap: 16px; }
.crm-app .funnel-node > span { color: var(--color-text); font-size: var(--fs-16); }
.crm-app .funnel-proportion { height: 14px; border-radius: var(--radius-pill); }
.crm-app .conversion-flow .funnel-arrow { min-height: 20px; font-size: var(--fs-14); }
.crm-app .conversion-flow .funnel-arrow b { font-size: var(--fs-14); font-weight: 500; }
.crm-app .funnel-node .funnel-exception { font-size: var(--fs-14); padding-top: 4px; color: var(--color-text-secondary); }
.analytics-detail-sections { margin-top: 16px; }
.analytics-detail { border-top: 1px solid var(--color-border); }
.analytics-detail > summary { min-height: 54px; display: flex; align-items: center; gap: 12px; list-style: none; font-size: var(--fs-16); font-weight: 500; cursor: pointer; }
.analytics-detail > summary::-webkit-details-marker { display: none; }
.analytics-detail > summary::after { content: '+'; margin-left: auto; color: var(--color-text-secondary); font-size: var(--fs-20); font-weight: 400; }
.analytics-detail[open] > summary::after { content: '−'; }
.analytics-detail > summary > span { color: var(--color-text-secondary); font-size: var(--fs-14); font-weight: 400; }
.analytics-detail > :not(summary) { margin-bottom: 20px; }
.crm-app .analytics-detail .analytics-section { padding: 0; margin: 0 0 20px; border: 0; }
.crm-app .analytics-detail .analytics-context-strip { border-top: 0; }
.crm-app .analytics-detail :is(small,p,.analytics-source-note) { font-size: var(--fs-14); line-height: 1.5; }
.crm-app .analytics-breakdown h4 { text-transform: none; letter-spacing: 0; font-size: var(--fs-14); }
.crm-app .analytics-breakdown-row { font-size: var(--fs-16); }
.analytics-method p { max-width: 800px; color: var(--color-text-secondary); font-size: var(--fs-14); line-height: 1.6; }
.crm-app .avito-report-status { padding: 12px 0; font-size: var(--fs-14); }
.crm-app .avito-report-status span, .crm-app .ad-source small { font-size: var(--fs-14); }
@media (max-width: 1050px) {
    .crm-app .conversion-flow.customizable-funnel .funnel-node { grid-template-columns: 160px minmax(40px,1fr) 48px; gap: 10px; }
    .crm-app .analytics-context-strip { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 620px) {
    .crm-app .analytics-section-nav { gap: 20px; }
    .crm-app .analytics-section-nav a { padding: 12px 0; }
    .crm-app .analytics-toolbar { gap: 8px; }
    .crm-app .period-tabs { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; gap: 4px 16px; }
    .crm-app .period-tabs a { flex-shrink: 0; }
    .crm-app .period-tabs a, .crm-app .custom-period-disclosure > summary { min-height: 44px; }
    .crm-app .conversion-card { padding: 14px 0 20px; }
    .crm-app .conversion-card-header { display: grid; grid-template-columns: 1fr auto; gap: 12px; margin-bottom: 8px; }
    .crm-app .conversion-card-header > div:first-child { grid-column: 1 / -1; }
    .crm-app .funnel-outcome { margin: 0; align-items: flex-start; }
    .crm-app .funnel-settings { justify-self: end; }
    .crm-app .funnel-settings[open] { grid-column: 1 / -1; width: 100%; }
    .crm-app .funnel-settings[open] > summary { text-align: right; }
    .crm-app .funnel-stage-controls { width: 100%; }
    .crm-app .conversion-flow.customizable-funnel .funnel-node { grid-template-columns: minmax(0,1fr) 52px; gap: 4px 12px; padding: 2px 0; }
    .crm-app .funnel-proportion { grid-column: 1 / -1; grid-row: 2; height: 8px; }
    .crm-app .funnel-node > .metric-drilldown { grid-column: 2; }
    .crm-app .funnel-node > span { font-size: var(--fs-16); }
    .analytics-detail > summary { min-height: 56px; font-size: var(--fs-16); }
    .analytics-detail > summary > span { max-width: 110px; }
    .crm-app .analytics-context-strip { grid-template-columns: 1fr; }
}

/* Potok Soft: static materials, no page entrance work or viewport-wide blur. */
.crm-app[data-workspace-color] { background-image: radial-gradient(900px 620px at 0 0, var(--chrome), transparent 62%), radial-gradient(760px 520px at 18% 100%, color-mix(in srgb, var(--chrome) 65%, transparent), transparent 62%); background-attachment: fixed; }
.crm-app .app-header h1 { font-size: var(--fs-22); }
.crm-app .drawer-message.outgoing :is(small,time,a), .crm-app .drawer-message.outgoing p { color: var(--on-accent); }
.crm-app .button.primary:hover, .crm-app .mini-button.primary:hover { color: var(--on-accent); background: var(--accent); filter: brightness(.94); }
.crm-app :is(.pipeline-search input,.global-search,.group-trial-dialog input,.group-trial-dialog select,.team-dialog input,.offering-dialog input,.integration-dialog input) { background: var(--color-surface-subtle); border-color: transparent; border-radius: var(--radius-control); }
.crm-app :is(.record-menu,.team-action-menu,.workspace-picker,.header-tools-menu,.mobile-nav-menu,.inbox-actions-menu > div) { background: var(--color-surface); border-color: var(--color-hairline); border-radius: var(--radius-lg); box-shadow: var(--shadow-overlay); }
.crm-app :is(.team-dialog,.offering-dialog,.integration-dialog) { border-radius: var(--radius-dialog); box-shadow: var(--shadow-overlay); }
.crm-app :is(.team-dialog,.offering-dialog,.integration-dialog,.group-trial-dialog)::backdrop { background: var(--color-scrim); }
.crm-app :is(.record-menu,.team-action-menu) :is(a,button):is(:hover,:focus-visible) { background: var(--accent); color: var(--on-accent); }
.auth-form button { border-radius: var(--radius-pill); }
@supports (backdrop-filter: blur(1px)) {
    @media (min-width: 861px) {
        .crm-app :is(.record-menu,.team-action-menu,.workspace-picker,.header-tools-menu) { background: var(--color-glass); backdrop-filter: blur(18px); }
    }
}
@media (prefers-reduced-motion: no-preference) and (hover: hover) {
    .crm-app .button, .crm-app .mini-button { transition: transform 120ms var(--motion-spring), background-color 120ms; }
    .crm-app :is(.button,.mini-button):active { transform: scale(.97); }
}
@media (min-width: 861px) {
    .crm-app .drawer-panel { inset: 10px 10px 10px auto; height: auto; border: 1px solid var(--color-border); border-radius: var(--radius-dock); overflow: hidden; }
}
@media (max-width: 860px) {
    .crm-app .app-main { margin: 0; }
    .crm-app[data-workspace-color] { background-image: none; }
}
@media (prefers-reduced-transparency: reduce) {
    .crm-app :is(.record-menu,.team-action-menu,.workspace-picker,.header-tools-menu) { background: var(--color-surface); backdrop-filter: none; }
}

.crm-app :is(.ai-send,.ai-generate,.drawer-refresh,.telegram-contact-check) { border-radius: var(--radius-pill); }
