/* ═══════════════════════════════════════════
   SALES CALL ANALYZER — Liquid Glass 2026
   iPhone-first, Python 3.11 compatible
   ═══════════════════════════════════════════ */

/* Involve variable (SIL OFL) — см. static/fonts/OFL.txt */
@font-face {
    font-family: "Involve";
    src: url("/m/static/fonts/Involve-VF.ttf") format("truetype");
    font-weight: 300 700;
    font-style: normal;
    font-display: swap;
}

*, *::before, *::after {
    box-sizing: border-box;
}

/* margin/padding:0 только вне нативных контролов — иначе в iOS/WebKit и при статическом
   Tailwind поля/кнопки остаются «плоскими» (revert к UA тоже часто даёт 0). */
*:not(button):not(input):not(select):not(textarea):not(option):not(optgroup),
*::before,
*::after {
    margin: 0;
    padding: 0;
}

:root {
    --font: 'Involve', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    /* Liquid Glass palette */
    --glass-bg: rgba(255, 255, 255, 0.72);
    --glass-border: rgba(255, 255, 255, 0.45);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    --glass-blur: 20px;
    --glass-hover: rgba(255, 255, 255, 0.85);

    /* Colors */
    --bg: #f2f2f7;
    --bg-secondary: #e5e5ea;
    --text-primary: #1c1c1e;
    --text-secondary: #8e8e93;
    --text-tertiary: #aeaeb2;
    --accent: #007aff;
    --accent-light: rgba(0, 122, 255, 0.12);
    --green: #34c759;
    --green-light: rgba(52, 199, 89, 0.12);
    --yellow: #ff9f0a;
    --yellow-light: rgba(255, 159, 10, 0.12);
    --skeleton-shimmer-mid: rgba(255, 255, 255, 0.85);
    --red: #ff3b30;
    --red-light: rgba(255, 59, 48, 0.12);
    --orange: #ff9500;
    --purple: #af52de;
    --teal: #5ac8fa;
    --pink: #ff2d55;

    /* Spacing */
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 22px;
    --radius-xl: 28px;

    /* Safe areas */
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
    --safe-right: env(safe-area-inset-right, 0px);

    /* Visily shell — единая палитра (светлая); тёмная — переопределение в html.dark */
    --visily-page: #f9f9fb;
    --visily-surface: #ffffff;
    --visily-surface-2: #fafafb;
    --visily-surface-deep: #f7f6f8;
    --visily-sidebar: #e8e4f2;
    --visily-sidebar-border: #d8d2e8;
    --visily-border: #f4f3f6;
    --visily-border-strong: #e8e7ec;
    --visily-border-input: #e0dfe7;
    --visily-text: #191821;
    --visily-text-heading: #191821;
    --visily-text-muted: #5b5770;
    --visily-text-dim: #a8a3b8;
    --visily-text-label: #9ca3af;
    --visily-accent: #5d45ff;
    --visily-accent-ghost: rgba(93, 69, 255, 0.15);
    --visily-icon: #5d45ff;
    --visily-icon-on-dark: #9CC6FF;
    --visily-shadow: 0 1px 3px rgba(24, 24, 27, 0.06);
    --visily-shadow-elevated: 0 1px 3px rgba(0, 0, 0, 0.35);
    --visily-input-bg: #ffffff;
    --visily-input-fg: #191821;
    --visily-hover-row: rgba(255, 255, 255, 0.85);
    --visily-nav-active-bg: #ffffff;
    --visily-mobile-sheet: #ffffff;
    --visily-mobile-sheet-border: #f4f3f6;
    --visily-invert-surface: #2a2838;
    --visily-invert-hover: #2e2c3d;
    --visily-focus-ring: #9CC6FF;
    --visily-theme-bar: #5d45ff;
    --visily-theme-bar-dark: #0f0e18;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    padding-bottom: calc(80px + var(--safe-bottom));
    min-height: 100vh;
    min-height: 100dvh;
    -webkit-tap-highlight-color: transparent;
    -webkit-text-size-adjust: 100%;
}

/* ═══ GLASS CARD — основной компонент ═══ */
.glass {
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(var(--glass-blur));
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--glass-shadow);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.glass:active {
    transform: scale(0.98);
    background: var(--glass-hover);
}

.glass-static {
    background:
        linear-gradient(var(--glass-bg), var(--glass-bg)) padding-box,
        linear-gradient(135deg, rgba(15, 63, 184, 0.22), rgba(52, 199, 89, 0.16)) border-box;
    -webkit-backdrop-filter: blur(var(--glass-blur));
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid transparent;
    border-radius: var(--radius-lg);
    box-shadow: var(--glass-shadow), inset 0 0 0 1px rgba(255, 255, 255, 0.4);
}

/* Глобально делаем информационные блоки читаемыми на любом фоне */
.glass-static,
.metric-card,
.list-item,
.score-hero,
.script-stage,
.code-block,
.recommendations-card,
.point-card,
.chip,
.script-meta-card,
.empty-state {
    border-width: 1px;
    border-style: solid;
}

/* ═══ НАВИГАЦИЯ — Liquid Glass Tab Bar ═══ */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(249, 249, 249, 0.78);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    border-top: 0.5px solid rgba(0, 0, 0, 0.12);
    display: flex;
    justify-content: space-around;
    padding: 6px 0 calc(6px + var(--safe-bottom));
    z-index: 1000;
}

.desktop-nav {
    display: none;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-tertiary);
    font-size: 0.65rem;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
    min-width: 52px;
}

.nav-item.active {
    color: var(--accent);
}

.nav-icon {
    font-size: 1.5rem;
    margin-bottom: 1px;
    line-height: 1;
}

/* Premium UX cleanup (P3-2): mono line-icons в bottom-nav под
   `.bottom-nav--premium`. SVG наследует currentColor → активное
   состояние окрашивается через `.nav-item.active { color: var(--accent) }`. */
.bottom-nav--premium .nav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0;
    line-height: 1;
    margin-bottom: 2px;
}
.bottom-nav--premium .nav-icon svg {
    width: 22px;
    height: 22px;
    display: block;
    stroke: currentColor;
    color: inherit;
}
@media (max-width: 600px) {
    .bottom-nav--premium .nav-icon svg {
        width: 20px;
        height: 20px;
    }
}
.bottom-nav--premium .nav-item {
    color: var(--text-secondary);
}
.bottom-nav--premium .nav-item.active {
    color: var(--accent);
}
.bottom-nav--premium .nav-item.active .nav-icon svg {
    stroke-width: 2;
}

.nav-label {
    letter-spacing: -0.01em;
}

.nav-label-wrap,
.desktop-nav-label-wrap {
    position: relative;
    display: inline-flex;
}

/* ═══ СТРАНИЦЫ ═══ */
.page {
    padding: 0 16px 20px;
    max-width: 600px;
    margin: 0 auto;
    padding-top: calc(16px + var(--safe-top));
}

@media (display-mode: standalone) {
    .page {
        padding-top: calc(56px + var(--safe-top));
    }
}

/* Десктоп/планшет: верхнее меню; 900px — чтобы не ловить узкое окно на ноутбуке */
@media (min-width: 900px) {
    body {
        padding-bottom: 0;
    }
    /* Visily: верхний desktop-nav скрыт, отступ под фикс-меню не нужен — иначе на планшетах ~1024px полоса 52px и съехавший main. */
    body.app-logged-in {
        padding-top: calc(52px + env(safe-area-inset-top, 0px));
    }
    body.app-logged-in:has(#app .page.visily-shell) {
        padding-top: env(safe-area-inset-top, 0px) !important;
    }
    body.app-logged-in:has(#app .page.visily-shell) .desktop-nav {
        display: none !important;
    }
    /* Без нулевых горизонтальных отступов: padding .page (20px) + margin-left колонки (260px) даёт
       щель между fixed-сайдбаром (0–260px) и контентом — заметно на 1024×600 (Nest Hub) и iPad. */
    /* Дублируем min-height после Tailwind CDN: fixed-сайдбар не даёт высоту flex-ряду — колонка и фон обрывались (Safari ~1024). */
    body.app-logged-in #app:has(> .page.visily-shell) {
        min-height: 100vh;
        min-height: 100dvh;
    }
    #app .page.visily-shell {
        max-width: none !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
        min-height: 100vh !important;
        min-height: 100dvh !important;
    }
    #app .visily-shell .visily-root {
        min-height: 100vh !important;
        min-height: 100dvh !important;
    }
    #app .visily-shell .visily-root > .visily-main-column {
        min-height: 100vh !important;
        min-height: 100dvh !important;
    }
    .bottom-nav {
        display: none !important;
    }
    .desktop-nav {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1001;
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
        gap: 6px 12px;
        row-gap: 8px;
        width: 100%;
        box-sizing: border-box;
        padding: 10px 20px;
        padding-top: calc(10px + env(safe-area-inset-top, 0px));
        background: rgba(249, 249, 249, 0.96);
        -webkit-backdrop-filter: saturate(180%) blur(20px);
        backdrop-filter: saturate(180%) blur(20px);
        border-bottom: 0.5px solid rgba(0, 0, 0, 0.12);
        max-width: none;
        margin: 0;
    }
    .desktop-nav-logo {
        display: flex;
        align-items: center;
        margin-right: 8px;
        text-decoration: none;
        flex-shrink: 0;
    }
    .desktop-nav-logo img {
        height: 2rem;
        width: auto;
    }
    .desktop-nav-item {
        text-decoration: none;
        color: var(--text-secondary);
        font-weight: 600;
        font-size: 0.88rem;
        padding: 8px 14px;
        border-radius: 10px;
        white-space: nowrap;
    }
    .desktop-nav-item.active {
        color: var(--accent);
        background: var(--accent-light);
    }

.desktop-nav-item--inbox .desktop-nav-label-wrap {
    position: relative;
    display: inline-flex;
    padding-top: 8px;
}
    .page {
        max-width: 1100px;
        padding: 12px 20px 24px;
    }
}

.page-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.page-header h1 {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    flex: 1;
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-top: -12px;
    margin-bottom: 16px;
}

.back-btn {
    color: var(--accent);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
    flex-basis: 100%;
    width: fit-content;
    margin-bottom: 2px;
}

.page-breadcrumb {
    color: var(--text-tertiary);
    font-size: 0.78rem;
    line-height: 1.35;
    margin-top: -12px;
    margin-bottom: 14px;
    word-break: break-word;
    overflow-wrap: anywhere;
}

@media (max-width: 380px) {
    .page-breadcrumb {
        font-size: 0.72rem;
        line-height: 1.3;
        margin-top: -10px;
        margin-bottom: 12px;
    }
    .page-breadcrumb[data-mobile-hide="1"] {
        display: none;
    }
    .badge {
        font-size: 0.7rem;
        padding: 3px 8px;
        border-radius: 16px;
    }
    .user-badge {
        font-size: 0.72rem;
        padding: 4px 10px;
        border-radius: 16px;
    }
    .page-header {
        gap: 8px;
        margin-bottom: 16px;
    }
    .page-header h1 {
        font-size: 1.7rem;
        line-height: 1.1;
    }
}

/* «Ещё»: заметный переход на главную */
a.more-home-cta {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    margin-bottom: 20px;
    text-decoration: none;
    color: inherit;
    border-radius: var(--radius-lg);
    transition: background 0.2s, transform 0.15s;
}
a.more-home-cta:active {
    transform: scale(0.99);
}
.more-home-cta-icon {
    font-size: 1.75rem;
    line-height: 1;
}
.more-home-cta-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.more-home-cta-title {
    font-weight: 700;
    font-size: 1rem;
    color: var(--accent);
}
.more-home-cta-desc {
    font-size: 0.82rem;
    color: var(--text-secondary);
}
.more-home-cta-chevron {
    color: var(--text-tertiary);
    font-size: 1.25rem;
    font-weight: 300;
}

.section-title {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 24px 0 12px;
    color: var(--text-primary);
}

.section-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: -8px;
    margin-bottom: 12px;
}

/* ═══ МЕТРИКИ — Glass Cards ═══ */
.metrics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.metrics-grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
}

.metric-card {
    background:
        linear-gradient(var(--glass-bg), var(--glass-bg)) padding-box,
        linear-gradient(145deg, rgba(37, 99, 235, 0.22), rgba(175, 82, 222, 0.18)) border-box;
    -webkit-backdrop-filter: blur(var(--glass-blur));
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid transparent;
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: var(--glass-shadow), inset 0 0 0 1px rgba(255, 255, 255, 0.38);
}

/* Цветные плашки для числовых/процентных метрик во всех сетках */
.metrics-grid .metric-card:nth-child(4n+1),
.metrics-grid-3 .metric-card:nth-child(4n+1) {
    background-color: rgba(99, 102, 241, 0.1);
    background-image: linear-gradient(145deg, rgba(99, 102, 241, 0.14), rgba(79, 70, 229, 0.06));
    border-color: rgba(79, 70, 229, 0.34);
}

.metrics-grid .metric-card:nth-child(4n+2),
.metrics-grid-3 .metric-card:nth-child(4n+2) {
    background-color: rgba(14, 165, 233, 0.1);
    background-image: linear-gradient(145deg, rgba(14, 165, 233, 0.14), rgba(6, 182, 212, 0.06));
    border-color: rgba(14, 165, 233, 0.34);
}

.metrics-grid .metric-card:nth-child(4n+3),
.metrics-grid-3 .metric-card:nth-child(4n+3) {
    background-color: rgba(245, 158, 11, 0.1);
    background-image: linear-gradient(145deg, rgba(245, 158, 11, 0.14), rgba(249, 115, 22, 0.06));
    border-color: rgba(245, 158, 11, 0.36);
}

.metrics-grid .metric-card:nth-child(4n+4),
.metrics-grid-3 .metric-card:nth-child(4n+4) {
    background-color: rgba(52, 199, 89, 0.1);
    background-image: linear-gradient(145deg, rgba(52, 199, 89, 0.14), rgba(16, 185, 129, 0.06));
    border-color: rgba(52, 199, 89, 0.34);
}

.metric-card.accent {
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.08), rgba(0, 122, 255, 0.02));
    border-color: rgba(0, 122, 255, 0.2);
}

.metric-label {
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.metric-value {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-top: 2px;
    line-height: 1.1;
}

.metric-delta {
    font-size: 0.78rem;
    font-weight: 600;
    margin-top: 2px;
}

.good { color: var(--green); }
.warn { color: var(--yellow); }
.bad { color: var(--red); }
.good-bg { background: var(--green-light); color: var(--green); }
.warn-bg { background: var(--yellow-light); color: var(--yellow); }
.bad-bg { background: var(--red-light); color: var(--red); }

/* ═══ SCORE RING — круговой индикатор ═══ */
.score-ring {
    position: relative;
    width: 140px;
    height: 140px;
    margin: 0 auto 16px;
}

.score-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.score-ring-bg {
    fill: none;
    stroke: var(--bg-secondary);
    stroke-width: 8;
}

.score-ring-fill {
    fill: none;
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Текст по центру круга: число + подпись одной колонкой (без сдвигов top/% ) */
.score-ring-metric {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.18rem;
    pointer-events: none;
    text-align: center;
    line-height: 1;
    padding: 0 6px;
}

.score-ring-metric .score-ring-value {
    position: static;
    transform: none;
    margin: 0;
    font-size: 2.4rem;
    font-weight: 900;
    letter-spacing: -0.03em;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.score-ring-metric .score-ring-label {
    position: static;
    transform: none;
    margin: 0;
    font-size: 0.72rem;
    color: var(--text-secondary);
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

/* Fallback: только число без обёртки */
.score-ring-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.4rem;
    font-weight: 900;
    letter-spacing: -0.04em;
}

.score-ring-label {
    position: absolute;
    top: 62%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.dashboard-score-caption {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.88rem;
    margin-top: 10px;
    line-height: 1.35;
    text-align: center !important;
}

/* ═══ Дашборд: две ключевые метрики (балл + конверсия) ═══ */
.dashboard-hero-card {
    padding: 22px 0 20px;
    margin-bottom: 16px;
    background: transparent;
    border: 0;
    box-shadow: none;
}

.dashboard-hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 12px;
    align-items: start;
}

.dashboard-hero-col {
    text-align: center;
    padding: 8px 4px 4px;
    border-radius: var(--radius-lg);
    min-width: 0;
}

.dashboard-hero-col--metric {
    background: linear-gradient(160deg, rgba(175, 82, 222, 0.08), rgba(0, 122, 255, 0.05));
    border: 1px solid rgba(175, 82, 222, 0.12);
}

.dashboard-hero-col--accent {
    background: linear-gradient(160deg, rgba(52, 199, 89, 0.12), rgba(0, 122, 255, 0.06));
    border: 1px solid rgba(52, 199, 89, 0.18);
}

.dashboard-hero-col .score-ring {
    margin-bottom: 8px;
}

.dashboard-hero-hint {
    font-size: 0.72rem;
    color: var(--text-tertiary);
    line-height: 1.3;
    margin-top: 4px;
    padding: 0 4px;
    text-align: center !important;
}

.metric-card--calls {
    background-color: rgba(99, 102, 241, 0.1);
    background-image: linear-gradient(145deg, rgba(99, 102, 241, 0.14), rgba(79, 70, 229, 0.06));
    border-color: rgba(79, 70, 229, 0.34);
}

.metric-card--managers {
    background-color: rgba(14, 165, 233, 0.1);
    background-image: linear-gradient(145deg, rgba(14, 165, 233, 0.14), rgba(6, 182, 212, 0.06));
    border-color: rgba(14, 165, 233, 0.34);
}

.metric-card--script {
    background-color: rgba(245, 158, 11, 0.1);
    background-image: linear-gradient(145deg, rgba(245, 158, 11, 0.14), rgba(249, 115, 22, 0.06));
    border-color: rgba(245, 158, 11, 0.36);
}

.dashboard-team-cta {
    display: block;
    margin: 14px 0 4px;
    text-align: center;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
}

.dashboard-team-cta:active {
    opacity: 0.85;
}

@media (max-width: 360px) {
    .dashboard-hero-grid {
        gap: 8px;
    }
}

/* ═══ SKILL BARS — навыки ═══ */
.skill-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
}

.skill-name {
    flex: 1;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-primary);
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.skill-track {
    width: 100px;
    height: 6px;
    background: var(--bg-secondary);
    border-radius: 3px;
    overflow: hidden;
}

.skill-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.skill-fill.good { background: var(--green); }
.skill-fill.warn { background: var(--yellow); }
.skill-fill.bad { background: var(--red); }

.skill-score {
    font-weight: 700;
    font-size: 0.88rem;
    min-width: 32px;
    text-align: right;
}

/* Шкалы эмоций на разборе: как воронка — заголовок и балл в ряд, полоса на всю ширину. */
.emotion-scales-card.funnel-v2-skill-layout .skill-bar {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: 6px 12px;
    align-items: center;
    padding: 12px 0;
}

.emotion-scales-card.funnel-v2-skill-layout .skill-name {
    grid-column: 1;
    grid-row: 1;
    flex: unset;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    font-weight: 600;
}

.emotion-scales-card.funnel-v2-skill-layout .skill-score {
    grid-column: 2;
    grid-row: 1;
}

.emotion-scales-card.funnel-v2-skill-layout .skill-track {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    height: 8px;
    border-radius: 999px;
}

.emotion-scales-card.funnel-v2-skill-layout .skill-fill {
    border-radius: 999px;
}

/* ═══ СПИСКИ — Glass List ═══ */
.glass-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.glass-list-grouped {
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(var(--glass-blur));
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--glass-shadow);
    overflow: hidden;
}

.glass-list-grouped .list-item {
    border-radius: 0;
    border: none;
    box-shadow: none;
    background: transparent;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}

.glass-list-grouped .list-item + .list-item {
    border-top: 0.5px solid rgba(0, 0, 0, 0.08);
}

/* In "Раскрывающаяся инструкция" на мобильной странице интеграций
   строки не должны обрезаться (у .list-subtitle по умолчанию nowrap/ellipsis). */
details > div.list-subtitle {
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.list-item {
    background:
        linear-gradient(var(--glass-bg), var(--glass-bg)) padding-box,
        linear-gradient(145deg, rgba(37, 99, 235, 0.2), rgba(16, 185, 129, 0.14)) border-box;
    -webkit-backdrop-filter: blur(var(--glass-blur));
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid transparent;
    border-radius: var(--radius-lg);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--glass-shadow);
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
}

a.list-item:active {
    transform: scale(0.98);
    background: var(--glass-hover);
}

.list-icon {
    font-size: 1.4rem;
    min-width: 32px;
    text-align: center;
}

.list-content {
    flex: 1;
    min-width: 0;
}

.list-title {
    font-weight: 600;
    font-size: 0.95rem;
}

.list-subtitle {
    color: var(--text-secondary);
    font-size: 0.8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
}

.list-right {
    text-align: right;
    min-width: 44px;
}

.list-value {
    font-weight: 800;
    font-size: 1.05rem;
}

.list-meta {
    color: var(--text-tertiary);
    font-size: 0.72rem;
    font-weight: 500;
}

/* ═══ BADGE / CHIP ═══ */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    max-width: 100%;
    white-space: normal;
    line-height: 1.2;
    overflow-wrap: anywhere;
    word-break: break-word;
    text-align: center;
}

.badge-accent { background: var(--accent-light); color: var(--accent); }
.badge-green { background: var(--green-light); color: var(--green); }
.badge-yellow { background: var(--yellow-light); color: var(--yellow); }
.badge-red { background: var(--red-light); color: var(--red); }

.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 8px 0;
}

.chip {
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    cursor: pointer;
    transition: all 0.2s;
}

.chip.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

/* ═══ CALL DETAIL — Score Hero ═══ */
/* Знакомство с маскотом на странице звонка (под кольцом балла, до прозрачности оценки) */
.call-mascot-intro {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 14px;
    padding: 12px 14px;
    margin: 0 0 18px;
    max-width: 100%;
    box-sizing: border-box;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(49, 93, 255, 0.14);
    background: linear-gradient(
        145deg,
        rgba(250, 248, 255, 0.98) 0%,
        rgba(248, 246, 252, 0.96) 45%,
        rgba(252, 252, 254, 0.99) 100%
    );
    box-shadow: 0 1px 3px rgba(24, 24, 33, 0.05);
}

.call-mascot-intro__img {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

.call-mascot-intro__img img {
    width: 100%;
    height: 100%;
    max-width: 56px;
    max-height: 56px;
    object-fit: contain;
    pointer-events: none;
    user-select: none;
    filter: drop-shadow(0 3px 10px rgba(24, 24, 33, 0.1));
}

.call-mascot-intro__text {
    min-width: 0;
    flex: 1;
}

.call-mascot-intro__title {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 6px;
    line-height: 1.35;
    letter-spacing: -0.01em;
}

.call-mascot-intro__lead {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin: 0 0 6px;
    line-height: 1.45;
}

.call-mascot-intro__sub {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin: 0;
    line-height: 1.45;
}

html.dark .call-mascot-intro {
    border-color: rgba(255, 255, 255, 0.1);
    background: linear-gradient(
        145deg,
        rgba(34, 31, 48, 0.95) 0%,
        rgba(26, 24, 36, 0.97) 55%,
        rgba(20, 18, 28, 0.99) 100%
    );
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

html.dark .call-mascot-intro__img img {
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.4));
}

/* ═══ Маскот: «живой» цикл (парение + масштаб + ореол) — подменяемым на APNG/WebP/Lottie тем же URL ═══ */
.gs-mascot-stage {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
}

.gs-mascot-stage__glow {
    position: absolute;
    inset: -12%;
    border-radius: 50%;
    background: radial-gradient(
        circle at 50% 55%,
        rgba(49, 93, 255, 0.22) 0%,
        rgba(124, 92, 232, 0.08) 42%,
        transparent 72%
    );
    opacity: 0.55;
    animation: gs-mascot-glow-pulse 2.85s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

html.dark .gs-mascot-stage__glow {
    background: radial-gradient(
        circle at 50% 55%,
        rgba(147, 120, 255, 0.28) 0%,
        rgba(49, 93, 255, 0.1) 45%,
        transparent 72%
    );
    opacity: 0.45;
}

.gs-mascot-stage__motion {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    transform-origin: 50% 88%;
    animation: gs-mascot-motion-neutral 3.45s ease-in-out infinite;
    will-change: transform;
}

.gs-mascot-stage__motion img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    pointer-events: none;
    user-select: none;
}

.gs-mascot-picture {
    margin: 0;
    padding: 0;
    line-height: 0;
}

.gs-mascot-picture img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    pointer-events: none;
    user-select: none;
}

/* Нативный луп WebP/APNG — не дублируем движением CSS */
.gs-mascot-stage--prefer-native-loop .gs-mascot-stage__motion {
    animation: none !important;
}

.gs-mascot-stage--prefer-native-loop .gs-mascot-stage__glow {
    animation: none !important;
    opacity: 0.42;
}

@keyframes gs-mascot-glow-pulse {
    0%,
    100% {
        opacity: 0.35;
        transform: scale(0.96);
    }
    50% {
        opacity: 0.65;
        transform: scale(1.04);
    }
}

@keyframes gs-mascot-motion-neutral {
    0%,
    100% {
        transform: translateY(0) rotate(0deg) scale(1);
    }
    50% {
        transform: translateY(-6px) rotate(1.4deg) scale(1.04);
    }
}

@keyframes gs-mascot-motion-calm {
    0%,
    100% {
        transform: translateY(0) rotate(0deg) scale(1);
    }
    50% {
        transform: translateY(-4px) rotate(0.6deg) scale(1.025);
    }
}

@keyframes gs-mascot-motion-coach {
    0%,
    100% {
        transform: translateY(0) rotate(-0.5deg) scale(1);
    }
    35% {
        transform: translateY(-7px) rotate(1.8deg) scale(1.045);
    }
    70% {
        transform: translateY(-3px) rotate(-0.8deg) scale(1.02);
    }
}

@keyframes gs-mascot-motion-celebrate {
    0%,
    100% {
        transform: translateY(0) rotate(-1.5deg) scale(1);
    }
    20% {
        transform: translateY(-10px) rotate(2deg) scale(1.07);
    }
    40% {
        transform: translateY(-5px) rotate(-1deg) scale(1.05);
    }
    60% {
        transform: translateY(-12px) rotate(1.5deg) scale(1.08);
    }
    80% {
        transform: translateY(-4px) rotate(0deg) scale(1.03);
    }
}

@keyframes gs-mascot-motion-focused {
    0%,
    100% {
        transform: translateY(0) rotate(0deg) scale(1);
    }
    50% {
        transform: translateY(-2px) rotate(0.35deg) scale(1.012);
    }
}

.gs-mascot-stage[data-mascot-mood='calm'] .gs-mascot-stage__motion {
    animation-name: gs-mascot-motion-calm;
    animation-duration: 4.8s;
}

.gs-mascot-stage[data-mascot-mood='coach'] .gs-mascot-stage__motion {
    animation-name: gs-mascot-motion-coach;
    animation-duration: 3.1s;
}

.gs-mascot-stage[data-mascot-mood='celebrate'] .gs-mascot-stage__motion {
    animation-name: gs-mascot-motion-celebrate;
    animation-duration: 1.35s;
}

.gs-mascot-stage[data-mascot-mood='focused'] .gs-mascot-stage__motion {
    animation-name: gs-mascot-motion-focused;
    animation-duration: 3.8s;
}

.gs-mascot-stage[data-mascot-mood='celebrate'] .gs-mascot-stage__glow {
    animation-duration: 1.6s;
    opacity: 0.75;
}

@media (prefers-reduced-motion: reduce) {
    .gs-mascot-stage__glow,
    .gs-mascot-stage__motion {
        animation: none !important;
    }

    .gs-mascot-stage__glow {
        opacity: 0.25;
        transform: none;
    }

    .gs-mascot-stage--prefer-native-loop .gs-mascot-stage__glow {
        opacity: 0.22;
    }
}

.score-hero {
    background:
        linear-gradient(var(--glass-bg), var(--glass-bg)) padding-box,
        linear-gradient(145deg, rgba(37, 99, 235, 0.24), rgba(175, 82, 222, 0.16)) border-box;
    -webkit-backdrop-filter: blur(var(--glass-blur));
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid transparent;
    border-radius: var(--radius-xl);
    padding: 28px 20px;
    text-align: center;
    box-shadow: var(--glass-shadow);
    margin-bottom: 20px;
}

/* Сова на блоке оценки (как на главной у дуги KPI; чуть крупнее) */
.score-hero--with-mascot {
    position: relative;
    overflow: visible;
}

.call-score-mascot-rail {
    position: absolute;
    z-index: 2;
    right: 1rem;
    left: auto;
    top: 0;
    transform: translateY(-46%);
    width: 68px;
    height: 68px;
    pointer-events: none;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.call-score-mascot-rail--bare .gs-mascot-stage__glow {
    display: none;
}

@media (min-width: 640px) {
    .call-score-mascot-rail {
        right: 1.25rem;
        width: 72px;
        height: 72px;
    }
}

.score-hero__body {
    position: relative;
    z-index: 1;
    width: 100%;
    text-align: center;
}

/* Рекомендации: карточки вместо «простыни» */
.rec-cards {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 8px;
}

.rec-card {
    border-radius: 14px;
    border: 1px solid rgba(224, 223, 231, 0.95);
    background: linear-gradient(165deg, rgba(255, 255, 255, 0.98) 0%, rgba(249, 248, 255, 0.92) 100%);
    padding: 16px 18px;
    box-shadow: 0 1px 0 rgba(49, 93, 255, 0.04);
}

html.dark .rec-card {
    border-color: #3d3a52;
    background: linear-gradient(165deg, #1e1c28 0%, #1a1824 100%);
    box-shadow: none;
}

.rec-card__head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 10px;
}

.rec-card__num {
    flex: 0 0 auto;
    display: inline-flex;
    min-width: 2rem;
    height: 2rem;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(49, 93, 255, 0.1);
    color: #4f26e3;
    font-size: 0.8125rem;
    font-weight: 800;
}

html.dark .rec-card__num {
    background: rgba(93, 69, 255, 0.2);
    color: #9CC6FF;
}

.rec-card__head-text {
    flex: 1 1 auto;
    min-width: 0;
    text-align: left;
}

.rec-card__title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.35;
    margin: 0 0 4px;
}

.rec-card__stage {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.4;
    margin: 0;
}

.rec-card__stage-k {
    font-weight: 600;
    color: var(--text-tertiary);
    margin-right: 4px;
}

.rec-card__fields {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.rec-field {
    padding: 12px 0 14px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    background: transparent;
    border-radius: 0;
    border-left: 0;
}

.rec-field:first-child {
    padding-top: 4px;
}

.rec-field:last-child {
    border-bottom: 0;
    padding-bottom: 2px;
}

html.dark .rec-field {
    border-bottom-color: rgba(255, 255, 255, 0.08);
    background: transparent;
}

.rec-field__head {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 8px;
}

.rec-field__ico {
    flex: 0 0 auto;
    margin-top: 1px;
    color: #4f26e3;
    opacity: 0.92;
}

html.dark .rec-field__ico {
    color: #9CC6FF;
}

.rec-field__label {
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    text-transform: none;
    color: var(--text-primary);
    line-height: 1.35;
    margin: 0;
    flex: 1 1 auto;
    min-width: 0;
}

.rec-field__value {
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--text-primary);
    white-space: pre-wrap;
    word-break: break-word;
}

.emotion-viz-stack {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.emotion-timeline__title {
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.emotion-timeline--animated {
    animation: emotion-block-in 0.55s ease-out both;
}

.emotion-graph--animated {
    animation: emotion-block-in 0.65s ease-out both;
}

.emotion-graph--animated svg path[stroke] {
    stroke-linecap: round;
}

@keyframes emotion-block-in {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes gs-score-ready-pop {
    0% {
        transform: scale(0.97);
        opacity: 0.88;
    }
    55% {
        transform: scale(1.015);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.score-hero.gs-ready-pop {
    animation: gs-score-ready-pop 0.65s ease-out both;
}

.gs-habit-toast {
    position: fixed;
    top: max(16px, env(safe-area-inset-top, 0px));
    left: 50%;
    transform: translateX(-50%) translateY(-12px);
    z-index: 120;
    max-width: min(92vw, 360px);
    padding: 10px 16px;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 600;
    color: #1e1b2e;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(49, 93, 255, 0.2);
    box-shadow: 0 8px 28px rgba(24, 24, 27, 0.12);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.gs-habit-toast.gs-habit-toast--visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

html.dark .gs-habit-toast {
    color: #eceaf2;
    background: rgba(30, 28, 40, 0.95);
    border-color: rgba(125, 110, 200, 0.35);
}

.score-hero-name {
    font-size: 1.15rem;
    font-weight: 700;
    margin-top: 8px;
}

.score-hero-meta {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 2px;
}

.score-hero-summary {
    color: var(--text-secondary);
    font-size: 0.88rem;
    margin-top: 10px;
    line-height: 1.4;
}

/* ═══ Редкие техники / бейджи разбора (hidden_achievements) ═══ */
.gs-ach-badges-wrap {
    width: 100%;
    margin: 0 0 20px;
    text-align: left;
}

.gs-ach-badges-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.gs-ach-badges-head__label {
    font-size: 0.6875rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    /* Видимый текст, если градиент по клипу недоступен или даёт пустой слой (часть Safari без -webkit-text-fill) */
    color: #6d28d9;
}

/* Градиентный текст: Safari стабильнее с -webkit-text-fill-color + background-clip */
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
    .gs-ach-badges-head__label {
        background: linear-gradient(90deg, #2148D8, #315DFF, #d97706);
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
        color: transparent;
    }
}

html.dark .gs-ach-badges-head__label {
    color: #d8b4fe;
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
    html.dark .gs-ach-badges-head__label {
        background: linear-gradient(90deg, #9CC6FF, #e879f9, #fbbf24);
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
        color: transparent;
    }
}

.gs-ach-badges-head__link {
    font-size: 0.75rem;
    font-weight: 600;
    color: #4f26e3;
    text-decoration: none;
    white-space: nowrap;
}

.gs-ach-badges-head__link:hover {
    text-decoration: underline;
}

html.dark .gs-ach-badges-head__link {
    color: #9CC6FF;
}

.gs-ach-badges-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

@media (min-width: 640px) {
    .gs-ach-badges-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.gs-ach-badge {
    --ach-grad: linear-gradient(135deg, rgba(124, 58, 237, 0.95), rgba(217, 119, 6, 0.85));
    position: relative;
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 14px 16px 14px 14px;
    border-radius: 16px;
    overflow: hidden;
    isolation: isolate;
    border: 1px solid transparent;
    background:
        linear-gradient(rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.94)) padding-box,
        var(--ach-grad) border-box;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.45) inset,
        0 12px 40px rgba(49, 93, 255, 0.12),
        0 4px 14px rgba(192, 38, 211, 0.08);
    animation: gs-ach-enter 0.65s cubic-bezier(0.22, 1, 0.36, 1) both;
}

html.dark .gs-ach-badge {
    background:
        linear-gradient(rgba(26, 24, 36, 0.96), rgba(20, 18, 28, 0.98)) padding-box,
        var(--ach-grad) border-box;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.06) inset,
        0 16px 48px rgba(0, 0, 0, 0.45),
        0 0 32px rgba(124, 58, 237, 0.15);
}

.gs-ach-badge__shine {
    position: absolute;
    inset: -40% -30%;
    background: linear-gradient(
        105deg,
        transparent 35%,
        rgba(255, 255, 255, 0.55) 48%,
        rgba(255, 255, 255, 0.08) 52%,
        transparent 65%
    );
    transform: translateX(-60%) rotate(12deg);
    animation: gs-ach-shimmer 4.5s ease-in-out infinite;
    pointer-events: none;
    opacity: 0.85;
}

html.dark .gs-ach-badge__shine {
    opacity: 0.35;
}

.gs-ach-badge__glow {
    position: absolute;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    right: -30px;
    bottom: -40px;
    background: radial-gradient(circle, rgba(192, 38, 211, 0.35) 0%, transparent 70%);
    filter: blur(2px);
    animation: gs-ach-glow 3.2s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

.gs-ach-badge__icon {
    position: relative;
    z-index: 2;
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    color: #faf5ff;
    background: var(--ach-grad);
    box-shadow:
        0 4px 16px rgba(124, 58, 237, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.gs-ach-badge__svg {
    width: 24px;
    height: 24px;
}

.gs-ach-badge__body {
    position: relative;
    z-index: 2;
    min-width: 0;
}

.gs-ach-badge__kicker {
    font-size: 0.625rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #2148D8;
    margin-bottom: 4px;
}

html.dark .gs-ach-badge__kicker {
    color: #9CC6FF;
}

.gs-ach-badge__title {
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.25;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.gs-ach-badge__desc {
    margin: 6px 0 0;
    font-size: 0.8125rem;
    line-height: 1.45;
    color: var(--text-secondary);
}

.gs-ach-badge--empathy_master {
    --ach-grad: linear-gradient(135deg, #db2777, #f59e0b);
}

.gs-ach-badge--insight_ninja {
    --ach-grad: linear-gradient(135deg, #0891b2, #6366f1);
}

.gs-ach-badge--co_creator {
    --ach-grad: linear-gradient(135deg, #315DFF, #2148D8);
}

.gs-ach-badge--combo_breaker {
    --ach-grad: linear-gradient(135deg, #ca8a04, #315DFF, #2148D8);
}

/* Админка / аналитика: тот же визуал, компактно (иконка + градиент) */
.gs-ach-badge--admin-chip {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    align-self: flex-start;
    padding: 8px 10px;
    margin: 0;
    min-height: 0;
}

.gs-ach-badge--admin-chip .gs-ach-badge__icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
}

.gs-ach-badge--admin-chip .gs-ach-badge__svg {
    width: 22px;
    height: 22px;
}

@keyframes gs-ach-enter {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes gs-ach-shimmer {
    0%,
    100% {
        transform: translateX(-55%) rotate(12deg);
    }

    50% {
        transform: translateX(45%) rotate(12deg);
    }
}

@keyframes gs-ach-glow {
    0%,
    100% {
        opacity: 0.55;
        transform: scale(1);
    }

    50% {
        opacity: 0.95;
        transform: scale(1.08);
    }
}

@media (prefers-reduced-motion: reduce) {
    .gs-ach-badge {
        animation: none;
        opacity: 1;
        transform: none;
    }

    .gs-ach-badge__shine,
    .gs-ach-badge__glow {
        animation: none;
    }

    .gs-ach-badge__shine {
        opacity: 0;
    }
}

/* ═══ POINTS (хорошо/плохо) ═══ */
.point-card {
    padding: 12px 14px;
    border-radius: var(--radius-md);
    margin: 6px 0;
    font-size: 0.88rem;
    line-height: 1.4;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.point-good {
    background: var(--green-light);
    color: #1b7a34;
}

.point-bad {
    background: var(--yellow-light);
    color: #8a5a00;
}

.point-tip {
    background: var(--accent-light);
    color: #0055b3;
}

.recommendations-card {
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.06), rgba(175, 82, 222, 0.06));
    border: 1px solid rgba(0, 122, 255, 0.15);
    border-radius: var(--radius-lg);
    padding: 16px;
    font-size: 0.88rem;
    line-height: 1.5;
    color: var(--text-primary);
}

/* ═══ ФОРМЫ — Glass Input ═══ */
.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    font-weight: 600;
    font-size: 0.88rem;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-family: var(--font);
    background:
        linear-gradient(var(--glass-bg), var(--glass-bg)) padding-box,
        linear-gradient(145deg, rgba(37, 99, 235, 0.24), rgba(16, 185, 129, 0.2)) border-box;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    color: var(--text-primary);
    -webkit-appearance: none;
    appearance: none;
    transition: all 0.2s;
}

input.form-input,
textarea.form-input,
select.form-input {
    border-width: 1px;
    border-style: solid;
}

.form-input:focus {
    outline: none;
    box-shadow:
        0 0 0 4px var(--accent-light),
        inset 0 0 0 1px rgba(37, 99, 235, 0.22);
}

.form-input::placeholder {
    color: var(--text-tertiary);
}

textarea.form-input {
    resize: vertical;
    min-height: 100px;
    line-height: 1.5;
}

select.form-input {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M6 8L1 3h10z' fill='%238e8e93'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

.form-hint {
    color: var(--text-tertiary);
    font-size: 0.78rem;
    margin-top: 4px;
}

/* ═══ КНОПКИ ═══ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.2s;
    -webkit-appearance: none;
    appearance: none;
}

.btn:active {
    transform: scale(0.97);
}

.btn:disabled {
    opacity: 0.5;
    pointer-events: none;
}

.btn-primary {
    width: 100%;
    background: var(--accent);
    color: white;
    padding: 16px;
    font-size: 1.05rem;
}

.btn-primary:active {
    background: #0066d6;
}

.btn-secondary {
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    color: var(--accent);
}

.btn-danger {
    background: var(--red-light);
    color: var(--red);
}

.btn-success {
    background: var(--green-light);
    color: var(--green);
}

.btn-group {
    display: flex;
    gap: 8px;
}

.btn-group .btn {
    flex: 1;
}

/* ═══ TOGGLE ═══ */
.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
}

.toggle-row + .toggle-row {
    border-top: 0.5px solid rgba(0, 0, 0, 0.08);
}

.toggle-label {
    font-weight: 500;
    font-size: 0.95rem;
}

.toggle-desc {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.toggle {
    position: relative;
    width: 51px;
    height: 31px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--bg-secondary);
    border-radius: 16px;
    cursor: pointer;
    transition: background 0.3s;
    flex-shrink: 0;
}

.toggle:checked {
    background: var(--green);
}

.toggle::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 27px;
    height: 27px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
    transition: transform 0.3s;
}

.toggle:checked::after {
    transform: translateX(20px);
}

/* ═══ TABS ═══ */
.tabs {
    display: flex;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    padding: 2px;
    margin-bottom: 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tab {
    flex: 1;
    padding: 8px 12px;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    font-family: var(--font);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    min-width: fit-content;
}

.tab.active {
    background: white;
    color: var(--text-primary);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* Админка: фильтры списка клиентов — заметная панель (не сливается с фоном) */
.admin-filter-panel {
    padding: 14px 14px 12px;
    margin-bottom: 16px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.96) 0%, rgba(242, 246, 255, 0.92) 100%);
    border: 1px solid rgba(0, 122, 255, 0.18);
    border-left: 4px solid var(--accent);
    border-radius: var(--radius-md);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.07);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
}
.admin-filter-panel .admin-filter-head {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
    letter-spacing: -0.02em;
}
.admin-filter-panel .admin-filter-label {
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    margin-bottom: 6px;
}
.admin-filter-panel .admin-filter-tabs {
    margin-bottom: 12px;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(0, 0, 0, 0.06);
    flex-wrap: wrap;
    gap: 4px;
    row-gap: 4px;
}
.admin-filter-panel .admin-filter-tabs .tab {
    flex: 1 1 auto;
    min-width: max(28%, 72px);
}
.admin-filter-panel .admin-filter-tabs:last-child {
    margin-bottom: 0;
}

.admin-client-card {
    margin-bottom: 10px;
    border-radius: var(--radius-lg);
    background:
        linear-gradient(var(--glass-bg), var(--glass-bg)) padding-box,
        linear-gradient(135deg, rgba(37, 99, 235, 0.22), rgba(16, 185, 129, 0.16)) border-box;
    border: 1px solid transparent;
    overflow: hidden;
}

.admin-client-summary {
    list-style: none;
    cursor: pointer;
    padding: 12px 14px;
    display: block;
}

.admin-client-summary::-webkit-details-marker {
    display: none;
}

.admin-client-head {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.admin-client-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-client-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex: 0 0 10px;
}

.admin-client-dot.active { background: var(--green); }
.admin-client-dot.inactive { background: var(--red); }

.admin-client-title {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.admin-plan-badge-trial {
    flex: 0 0 auto;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    padding: 3px 8px;
    border-radius: 6px;
    background: #ede9fe;
    color: #5d45ff;
    line-height: 1.2;
}

html.dark .admin-plan-badge-trial {
    background: rgba(93, 69, 255, 0.22);
    color: #9CC6FF;
}

.admin-client-chevron {
    margin-left: auto;
    font-size: 1.1rem;
    color: var(--text-tertiary);
    transition: transform 0.2s ease;
}

.admin-client-card[open] .admin-client-chevron {
    transform: rotate(180deg);
}

.admin-client-actions {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    justify-content: flex-end;
}

.admin-client-actions .btn {
    width: auto;
    min-height: 34px;
    padding: 8px 12px;
    font-size: 0.82rem;
}

.admin-license-track {
    margin-top: 0;
    width: 100%;
    height: 7px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.22);
    overflow: hidden;
}

.admin-license-fill {
    height: 100%;
    border-radius: 999px;
}

.admin-license-fill.active {
    background: linear-gradient(90deg, rgba(52, 199, 89, 0.9), rgba(16, 185, 129, 0.9));
}

.admin-license-fill.inactive {
    background: linear-gradient(90deg, rgba(244, 63, 94, 0.9), rgba(239, 68, 68, 0.9));
}

.admin-client-body {
    border-top: 1px solid rgba(0, 0, 0, 0.07);
    padding: 12px 14px 14px;
}

/* ═══ EMPTY / LOADING / STATUS ═══ */
.loading {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.loading::before {
    content: '';
    display: block;
    width: 32px;
    height: 32px;
    margin: 0 auto 12px;
    border: 3px solid var(--bg-secondary);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 12px;
}

.empty-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.empty-desc {
    font-size: 0.88rem;
    line-height: 1.4;
}

.alert {
    padding: 14px 16px;
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    margin: 12px 0;
    line-height: 1.4;
}

.alert-error { background: var(--red-light); color: #c0392b; }
.alert-success { background: var(--green-light); color: #1b7a34; }
.alert-info { background: var(--accent-light); color: #0055b3; }
.alert-warning { background: var(--yellow-light); color: #8a5a00; }

/* ═══ LOGIN ═══ */
.login-page {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 20px;
    padding-top: calc(20px + var(--safe-top));
    padding-left: max(20px, env(safe-area-inset-left, 0px));
    padding-right: max(20px, env(safe-area-inset-right, 0px));
    padding-bottom: max(12px, env(safe-area-inset-bottom, 0px));
    background: linear-gradient(180deg, #EEF4FF 0%, #F9F9FB 45%, var(--bg) 100%);
}

.login-page-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 0;
}

.login-page-main .login-card {
    min-width: 0;
}

.login-legal-footer {
    flex-shrink: 0;
    width: 100%;
    max-width: 380px;
    margin: 0 auto;
    padding: 16px 8px 8px;
    text-align: center;
    min-width: 0;
    box-sizing: border-box;
}

.login-legal-links {
    margin: 0;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: var(--text-secondary);
    overflow-wrap: break-word;
}

.login-legal-links a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

.login-legal-links a:hover {
    text-decoration: underline;
}

.login-legal-sep {
    margin: 0 0.35em;
    color: var(--text-muted, #B2ADBF);
}

html.dark .login-legal-links {
    color: var(--text-secondary);
}

html.dark .login-legal-sep {
    color: #6b657c;
}

.login-card {
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(var(--glass-blur));
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: 36px 24px 32px;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.login-logo {
    display: block;
    width: 80px;
    height: 80px;
    margin: 0 auto 12px;
    object-fit: contain;
    max-width: min(80px, 28vw);
    max-height: min(80px, 28vw);
    flex-shrink: 0;
}

.login-card h1 {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 8px;
    line-height: 1.15;
    color: #315DFF;
    overflow-wrap: anywhere;
}

.login-subtitle {
    color: var(--text-secondary);
    margin: 0 auto 24px;
    font-size: 0.96rem;
    line-height: 1.35;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: break-word;
}

.login-card .form-group {
    margin-bottom: 14px;
    text-align: left;
}

.login-card #loginBtn {
    margin-top: 6px;
}

.login-password-wrap {
    display: flex;
    align-items: stretch;
    gap: 8px;
    width: 100%;
}

.login-password-wrap .login-password-input {
    flex: 1;
    min-width: 0;
    width: auto;
}

.login-password-toggle {
    flex-shrink: 0;
    align-self: center;
    padding: 10px 12px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--accent);
    background:
        linear-gradient(var(--glass-bg), var(--glass-bg)) padding-box,
        linear-gradient(145deg, rgba(37, 99, 235, 0.22), rgba(16, 185, 129, 0.12)) border-box;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    white-space: nowrap;
    line-height: 1.2;
}

.login-password-toggle:active {
    opacity: 0.88;
}

/* ═══ USER BADGE ═══ */
.user-badge {
    background: var(--accent-light);
    color: var(--accent);
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    max-width: 100%;
    white-space: normal;
    line-height: 1.2;
    overflow-wrap: anywhere;
    word-break: break-word;
    text-align: center;
}

/* ═══ SCRIPT VIEWER ═══ */
.script-stage {
    background:
        linear-gradient(var(--glass-bg), var(--glass-bg)) padding-box,
        linear-gradient(145deg, rgba(37, 99, 235, 0.2), rgba(175, 82, 222, 0.14)) border-box;
    -webkit-backdrop-filter: blur(var(--glass-blur));
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid transparent;
    border-radius: var(--radius-lg);
    margin-bottom: 12px;
    overflow: hidden;
}

.script-stage-header {
    padding: 14px 16px;
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.script-stage-header::after {
    content: '›';
    margin-left: auto;
    font-size: 1.2rem;
    color: var(--text-tertiary);
    transition: transform 0.3s;
}

.script-stage.open .script-stage-header::after {
    transform: rotate(90deg);
}

.script-stage-body {
    padding: 0 16px 14px;
    display: none;
}

.script-stage.open .script-stage-body {
    display: block;
}

.script-stage--static .script-stage-header {
    cursor: default;
}

.script-stage--static .script-stage-header::after {
    content: '';
    display: none;
}

.script-stage-goal {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 8px;
    line-height: 1.4;
}

.script-meta-card {
    padding: 16px;
    margin-bottom: 16px;
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, rgba(246, 249, 255, 0.95), rgba(250, 252, 255, 0.92));
    border: 1px solid rgba(15, 63, 184, 0.2);
    box-shadow: 0 8px 24px rgba(15, 63, 184, 0.08);
    overflow: hidden;
}

.script-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.script-version-label {
    font-weight: 700;
    font-size: 0.98rem;
    color: var(--text-primary);
}

.script-version-date {
    color: var(--text-secondary);
    font-size: 0.82rem;
    margin-top: 2px;
}

.script-update-note {
    margin-top: 10px;
    font-size: 0.74rem;
    color: var(--text-tertiary);
    line-height: 1.3;
    overflow-wrap: anywhere;
    word-break: break-word;
}

@media (max-width: 430px) {
    .script-meta-card {
        padding: 12px;
        margin-bottom: 12px;
    }
    .script-version-label {
        font-size: 0.92rem;
    }
    .script-version-date {
        font-size: 0.76rem;
    }
    .script-update-note {
        font-size: 0.7rem;
        margin-top: 8px;
    }
    .script-stage {
        margin-bottom: 10px;
    }
    .script-stage-header {
        padding: 12px 12px;
        font-size: 0.9rem;
        gap: 6px;
    }
    .script-stage-body {
        padding: 0 12px 12px;
    }
    .script-stage-goal {
        font-size: 0.8rem;
        margin-bottom: 6px;
    }
    .script-phrase {
        font-size: 0.84rem;
        padding: 9px 10px;
        margin: 5px 0;
    }
    .script-rule {
        font-size: 0.8rem;
        line-height: 1.35;
    }
}

@media (max-width: 360px) {
    .metrics-grid-3 {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .metric-card {
        padding: 12px;
    }
    .metric-value {
        font-size: 1.5rem;
    }
}

.script-phrase {
    background: var(--accent-light);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    margin: 6px 0;
    font-size: 0.88rem;
    line-height: 1.4;
    color: #0055b3;
    font-style: italic;
}

/* Блок «Возврат клиента»: читаемый текст на янтарном фоне */
.call-recovery-panel .recovery-field-label {
    font-weight: 700;
    font-size: 0.82rem;
    color: #92400e;
    margin-bottom: 4px;
    letter-spacing: 0.01em;
}

html.dark .call-recovery-panel .recovery-field-label {
    color: #fde68a;
}

.call-recovery-panel .recovery-field-body {
    font-size: 0.92rem;
    line-height: 1.45;
    color: #1c1917;
}

html.dark .call-recovery-panel .recovery-field-body {
    color: #eceaf2;
}

.call-recovery-panel .recovery-script-label {
    font-weight: 700;
    font-size: 0.82rem;
    color: #78350f;
    margin-bottom: 8px;
    letter-spacing: 0.01em;
}

html.dark .call-recovery-panel .recovery-script-label {
    color: #fef3c7;
}

.call-recovery-panel .script-phrase--recovery {
    color: #0f172a;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(180, 83, 9, 0.35);
    border-radius: var(--radius-md);
    font-style: normal;
    font-weight: 500;
    margin: 0;
}

html.dark .call-recovery-panel .script-phrase--recovery {
    color: #f4f4f5;
    background: rgba(28, 26, 38, 0.95);
    border-color: rgba(251, 191, 36, 0.4);
}

.script-rule {
    padding: 6px 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    gap: 6px;
}

.script-rule::before {
    content: '•';
    color: var(--accent);
    font-weight: 700;
}

/* ═══ CODE / LINK BLOCK ═══ */
.code-block {
    background:
        linear-gradient(180deg, rgba(242, 246, 255, 0.95), rgba(250, 251, 255, 0.95)) padding-box,
        linear-gradient(135deg, rgba(37, 99, 235, 0.28), rgba(52, 199, 89, 0.18)) border-box;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    padding: 12px 14px;
    font-size: 0.9rem;
    line-height: 1.45;
    color: var(--text-primary);
    word-break: break-word;
    margin-bottom: 8px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.65);
}

.integration-card {
    text-align: left;
}

.integration-copy-btn {
    justify-content: flex-start;
    text-align: left;
    width: auto;
    min-height: 38px;
    padding: 10px 14px;
    margin-top: 2px;
}

/* ═══ INSTRUCTION PAGE ═══ */
.instruction-step {
    display: flex;
    gap: 14px;
    padding: 16px 0;
}

.instruction-step + .instruction-step {
    border-top: 0.5px solid rgba(0, 0, 0, 0.06);
}

.step-number {
    width: 32px;
    height: 32px;
    background: var(--accent);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.step-content {
    flex: 1;
}

.step-title {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 2px;
}

.step-desc {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.4;
}

/* FAQ на странице «Инструкция»: перенос на узких экранах (не ellipsis/nowrap) */
.instruction-faq .list-title,
.instruction-faq .list-subtitle {
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    word-break: break-word;
    overflow-wrap: anywhere;
    line-height: 1.38;
}

.instruction-faq .list-title {
    margin-bottom: 4px;
}

/* ═══ FEEDBACK BUTTONS ═══ */
.feedback-row {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.feedback-btn {
    flex: 1;
    padding: 12px;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    background: var(--glass-bg);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.feedback-btn:active {
    transform: scale(0.95);
}

.feedback-btn.selected-good {
    background: var(--green-light);
    border-color: var(--green);
}

.feedback-btn.selected-bad {
    background: var(--red-light);
    border-color: var(--red);
}

/* ═══ CHART CONTAINER ═══ */
.chart-container {
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(var(--glass-blur));
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: var(--glass-shadow);
    margin: 12px 0;
    overflow: hidden;
}

.mini-bar {
    display: flex;
    align-items: end;
    gap: 3px;
    height: 40px;
}

.mini-bar-item {
    flex: 1;
    border-radius: 3px 3px 0 0;
    min-width: 4px;
    transition: height 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ═══ RESPONSIVE ═══ */
@media (max-width: 375px) {
    .metrics-grid { gap: 8px; }
    .metric-value { font-size: 1.5rem; }
    .page-header h1 { font-size: 1.6rem; }
    .score-ring { width: 120px; height: 120px; }
    .score-ring-value { font-size: 2rem; }
    .nav-item { min-width: 44px; font-size: 0.6rem; }
    .nav-icon { font-size: 1.3rem; }
}

@media (min-width: 601px) {
    .page { padding-left: 24px; padding-right: 24px; }
    .metrics-grid-3 { grid-template-columns: 1fr 1fr 1fr; }
}
/* ═══ EMOTION MAP — эмоциональная карта звонка ═══ */
.emotion-timeline {
    position: relative;
    min-height: auto;
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(var(--glass-blur));
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 16px;
    margin: 12px 0;
    overflow: visible;
}

.emotion-timeline--phone {
    padding-bottom: 14px;
}

.emotion-call-screen {
    margin-top: 6px;
    border-radius: 14px;
    border: 1px solid rgba(142, 142, 147, 0.22);
    background: linear-gradient(180deg, rgba(49, 93, 255, 0.04), rgba(34, 197, 94, 0.03));
    overflow: hidden;
}

.emotion-call-screen__head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    font-size: 0.78rem;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(142, 142, 147, 0.18);
    background: rgba(0, 0, 0, 0.03);
}

.emotion-call-screen__ico {
    flex-shrink: 0;
    color: var(--accent);
    opacity: 0.95;
}

.emotion-call-screen__head-title {
    flex: 1;
    font-weight: 600;
    color: var(--text-primary);
}

.emotion-call-screen__head-dur {
    font-variant-numeric: tabular-nums;
    color: var(--text-tertiary);
    font-size: 0.72rem;
}

.emotion-call-screen__body {
    padding: 10px 10px 6px;
}

.emotion-call-wave-wrap {
    border-radius: 10px;
    padding: 10px 8px;
    background: rgba(255, 255, 255, 0.35);
}

html.dark .emotion-call-wave-wrap {
    background: rgba(0, 0, 0, 0.2);
}

.emotion-call-wave {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 3px;
    height: 52px;
}

.emotion-call-wave__bar {
    flex: 1;
    min-width: 2px;
    max-width: 6px;
    border-radius: 3px;
    background: linear-gradient(180deg, rgba(49, 93, 255, 0.45), rgba(34, 197, 94, 0.35));
    opacity: 0.88;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2) inset;
}

.emotion-call-markers {
    position: relative;
    min-height: 44px;
    margin-top: 8px;
    padding: 0 4px;
}

.emotion-call-markers__line {
    position: absolute;
    left: 8px;
    right: 8px;
    top: 10px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(142, 142, 147, 0.45) 8%, rgba(142, 142, 147, 0.45) 92%, transparent);
    pointer-events: none;
}

.emotion-call-pins {
    position: relative;
    height: 42px;
}

.emotion-call-pin {
    position: absolute;
    left: 50%;
    top: 0;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 52px;
    margin-left: 0;
    cursor: pointer;
    z-index: 2;
    transition: transform 0.15s ease;
}

.emotion-call-pin:active {
    transform: translateX(-50%) scale(1.06);
}

.emotion-call-pin__dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    margin-top: 3px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
    border: 2px solid rgba(255, 255, 255, 0.85);
    flex-shrink: 0;
}

.emotion-call-pin--interest .emotion-call-pin__dot {
    background: var(--green);
}

.emotion-call-pin--tension .emotion-call-pin__dot {
    background: var(--red);
}

.emotion-call-pin--neutral .emotion-call-pin__dot {
    background: var(--yellow);
}

.emotion-call-pin__time {
    margin-top: 6px;
    font-size: 0.65rem;
    line-height: 1.1;
    color: var(--text-tertiary);
    font-variant-numeric: tabular-nums;
}

.emotion-time-ruler {
    position: relative;
    margin-top: 10px;
    padding-top: 10px;
    min-height: 28px;
}

.emotion-time-ruler__track {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 1px;
    background: rgba(142, 142, 147, 0.35);
}

.emotion-time-ruler__tick {
    position: absolute;
    top: 0;
    transform: translateX(-50%);
    text-align: center;
    min-width: 36px;
}

.emotion-time-ruler__tick-line {
    display: block;
    width: 1px;
    height: 8px;
    margin: 0 auto 2px;
    background: rgba(142, 142, 147, 0.55);
}

.emotion-time-ruler__tick-label {
    font-size: 0.65rem;
    color: var(--text-tertiary);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* legacy: старые точки на линии (если где-то остались) */
.emotion-dot {
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    top: 50%;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 2;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.emotion-dot:active {
    transform: translate(-50%, -50%) scale(1.4);
}

.emotion-dot.interest {
    background: var(--green);
}

.emotion-dot.tension {
    background: var(--red);
}

.emotion-dot.neutral {
    background: var(--yellow);
}

.emotion-dot.positive {
    background: var(--teal);
}

/* Линия графика */
.emotion-graph {
    position: relative;
    min-height: 186px;
    height: auto;
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(var(--glass-blur));
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 12px 16px;
    margin: 12px 0;
    overflow: hidden;
}

.emotion-graph svg {
    width: 100%;
    height: auto;
    aspect-ratio: 520 / 140;
    display: block;
    min-height: 120px;
}

/* Боковая колонка разбора звонка: подсказка «i» не обрезается */
.call-detail-aside,
.call-share-panel,
.call-share-help {
    overflow: visible;
}

/* «Ссылка коллеге»: фирменный синий + вспышка слева направо */
.call-share-btn {
    position: relative;
    overflow: hidden;
    background: #4f26e3;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 2px 10px rgba(49, 93, 255, 0.38);
    transition: background 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.call-share-btn:hover {
    background: #5b32f0;
    box-shadow: 0 4px 14px rgba(49, 93, 255, 0.45);
}

.call-share-btn:active {
    filter: brightness(0.94);
}

.call-share-btn::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        100deg,
        transparent 0%,
        transparent 38%,
        rgba(255, 255, 255, 0.28) 50%,
        transparent 62%,
        transparent 100%
    );
    width: 55%;
    transform: translateX(-140%);
    animation: call-share-shine 2.6s ease-in-out infinite;
    pointer-events: none;
}

.call-share-btn > * {
    position: relative;
    z-index: 1;
}

@keyframes call-share-shine {
    0% {
        transform: translateX(-140%);
    }
    55%,
    100% {
        transform: translateX(260%);
    }
}

@media (prefers-reduced-motion: reduce) {
    .call-share-btn::after {
        animation: none;
    }
}

html.dark .call-share-btn {
    background: #4f26e3;
    border-color: rgba(255, 255, 255, 0.22);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

html.dark .call-share-btn:hover {
    background: #5d45ff;
}

.emotion-graph-line {
    fill: none;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.emotion-graph-area {
    opacity: 0.1;
}

.emotion-graph-legend {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-top: 8px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.emotion-graph-legend span::before {
    content: '';
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 4px;
    vertical-align: middle;
}

.legend-client::before { background: var(--accent); }
.legend-manager::before { background: var(--green); }

/* Tooltip для точек */
.emotion-tooltip {
    position: fixed;
    background: rgba(28, 28, 30, 0.95);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    color: white;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    line-height: 1.4;
    max-width: 280px;
    z-index: 9999;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    display: none;
}

.emotion-tooltip.visible {
    display: block;
    animation: tooltipIn 0.2s ease;
}

@keyframes tooltipIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.emotion-tooltip-title {
    font-weight: 700;
    margin-bottom: 4px;
}

.emotion-tooltip-time {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 6px;
}

/* Момент-карточки */
.emotion-moment {
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(var(--glass-blur));
    backdrop-filter: blur(var(--glass-blur));
    border-radius: var(--radius-md);
    padding: 14px;
    margin: 8px 0;
    display: flex;
    gap: 12px;
    border: 1px solid var(--glass-border);
}

.emotion-moment-icon {
    min-width: 32px;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.emotion-moment-content {
    flex: 1;
    min-width: 0;
}

.emotion-moment-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 2px;
}

.emotion-moment-text {
    font-size: 0.88rem;
    line-height: 1.4;
}

.emotion-moment-quote {
    font-size: 0.82rem;
    color: var(--text-secondary);
    font-style: italic;
    margin-top: 4px;
}

.emotion-moment.interest {
    border-left: 3px solid var(--green);
}

.emotion-moment.interest .emotion-moment-label {
    color: var(--green);
}

.emotion-moment.tension {
    border-left: 3px solid var(--red);
}

.emotion-moment.tension .emotion-moment-label {
    color: var(--red);
}

/* Gauge для общих эмоций */
.emotion-gauges {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 12px 0;
}

.emotion-gauge {
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(var(--glass-blur));
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 14px;
    text-align: center;
}

.emotion-gauge-emoji,
.emotion-gauge-ico {
    margin-bottom: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.emotion-gauge-label {
    font-size: 0.72rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.emotion-gauge-value {
    font-size: 0.88rem;
    font-weight: 700;
    margin-top: 2px;
}

/* ═══ CALL DETAIL — табы, скелетон, AI-чипы, view transitions ═══ */

.call-skeleton {
    padding: 8px 4px 24px;
}

.sk-mascot-banner {
    height: 72px;
    border-radius: 16px;
    background: var(--bg-secondary);
    margin-bottom: 20px;
    max-width: 100%;
}

.sk-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    margin-bottom: 28px;
}

.sk-ring {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    background: var(--bg-secondary);
}

.sk-block {
    margin-bottom: 22px;
}

.sk-line {
    height: 14px;
    border-radius: 8px;
    background: var(--bg-secondary);
    margin-bottom: 10px;
}

.sk-line--lg { width: 55%; height: 18px; margin: 0 auto; }
.sk-line--md { width: 88%; }
.sk-line--sm { width: 40%; height: 12px; margin: 0 auto; }
.sk-line--short { width: 45%; }
.sk-line--title { width: 35%; height: 16px; margin-bottom: 14px; }

@media (prefers-reduced-motion: no-preference) {
    .shimmer {
        background: linear-gradient(
            90deg,
            var(--bg-secondary) 0%,
            var(--skeleton-shimmer-mid) 50%,
            var(--bg-secondary) 100%
        );
        background-size: 200% 100%;
        animation: sk-shimmer 1.2s ease-in-out infinite;
    }
}

@keyframes sk-shimmer {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

@media (prefers-reduced-motion: reduce) {
    .shimmer { animation: none; }
}

.call-tabs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin: 0 0 16px;
    padding: 4px 2px 10px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    position: sticky;
    top: 0;
    z-index: 5;
    background: linear-gradient(180deg, var(--bg) 70%, transparent);
}

.call-tabs::-webkit-scrollbar { display: none; }

/* Разбор звонка: больше воздуха под вкладками — сова (rail translateY) не уходит под sticky-полосу */
.page-call-detail #call-tabs.call-tabs {
    margin-bottom: 40px;
}

.page-call-detail .call-score-mascot-rail {
    transform: translateY(-38%);
}

@media (min-width: 640px) {
    .page-call-detail .call-score-mascot-rail {
        transform: translateY(-36%);
    }
}

.call-tab {
    flex: 0 0 auto;
    border: none;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-family: var(--font);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 10px 14px;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, transform 0.15s;
    white-space: nowrap;
}

.call-tab:active {
    transform: scale(0.97);
}

.call-tab.is-active {
    background: var(--accent);
    color: #fff;
}

.call-tab-panel[hidden],
.call-tab-panel:not(.is-active) {
    display: none;
}

.call-tab-panel.is-active {
    display: block;
    min-width: 0;
    width: 100%;
    overflow-x: clip;
    overflow-y: visible;
}

/* Обзор звонка: фиксированный каркас (без «пляски» от Tailwind CDN и flex skill-bar) */
.call-overview-block {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    overflow-x: clip;
}

.call-overview-panel {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    overflow-x: clip;
}

.call-overview-panel .score-hero,
.call-overview-panel .glass-static,
.call-overview-panel .score-transparency,
.call-overview-panel .call-overview-block,
.call-overview-panel .feedback-row {
    max-width: 100%;
    box-sizing: border-box;
}

.call-overview-panel .score-hero-summary {
    overflow-wrap: anywhere;
    word-break: break-word;
    text-align: left;
}

.call-overview-panel .score-ring {
    max-width: 100%;
}

.call-overview-panel audio {
    display: block;
    width: 100%;
    max-width: 520px;
    box-sizing: border-box;
}

.call-overview-panel .score-kpi-grid {
    min-width: 0;
}

.call-overview-panel .score-breakdown-item {
    min-width: 0;
}

.call-overview-stages-shell {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    padding: 14px 16px;
    box-sizing: border-box;
}

/* Этапы: тот же язык, что и воронка v2 (карточка + скруглённый трек на всю ширину). */
.call-overview-stages-shell .call-overview-stage-card.funnel-v2-stage {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    border: 1px solid #edeaf4;
    border-radius: 12px;
    padding: 11px 14px;
    background: #f9f9fb;
    overflow-x: clip;
}

.call-overview-stage-heading {
    width: 100%;
    box-sizing: border-box;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
    word-break: normal;
    overflow-wrap: break-word;
    hyphens: manual;
    margin-bottom: 8px;
}

.call-overview-stage-metrics {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 10px;
    row-gap: 0;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.call-overview-stage-metrics .funnel-v2-bar-track {
    grid-column: 1;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    height: 8px;
    border-radius: 999px;
    background: #e8e4f0;
    overflow: hidden;
    box-sizing: border-box;
}

.call-overview-stage-metrics .funnel-v2-bar-fill {
    height: 100%;
    min-width: 0;
    border-radius: 999px;
    max-width: 100%;
    transition: width 0.35s ease;
    background: linear-gradient(90deg, #9d8aff 0%, #4f26e3 100%);
}

.call-overview-stage-metrics .stage-bar-fill--good {
    background: linear-gradient(90deg, #4ade80 0%, #16a34a 100%);
}

.call-overview-stage-metrics .stage-bar-fill--warn {
    background: linear-gradient(90deg, #fbbf24 0%, #d97706 100%);
}

.call-overview-stage-metrics .stage-bar-fill--bad {
    background: linear-gradient(90deg, #f87171 0%, #b91c1c 100%);
}

.call-overview-stages-shell .call-stage-tier-good {
    border-color: rgba(34, 197, 94, 0.35);
}

.call-overview-stages-shell .call-stage-tier-warn {
    border-color: rgba(234, 179, 8, 0.45);
}

.call-overview-stages-shell .call-stage-tier-bad {
    border-color: #fca5a5;
    box-shadow:
        0 0 0 1px rgba(248, 113, 113, 0.35),
        0 6px 16px rgba(185, 28, 28, 0.1);
}

.call-overview-stage-metrics .funnel-v2-stage-score {
    grid-column: 2;
    justify-self: end;
    margin: 0;
    padding: 0;
    font-size: 13px;
    font-weight: 800;
    min-width: 0;
    max-width: 100%;
    text-align: right;
    font-variant-numeric: tabular-nums;
    color: #4f26e3;
}

.call-overview-stage-metrics .stage-score--good {
    color: #15803d;
}

.call-overview-stage-metrics .stage-score--warn {
    color: #b45309;
}

.call-overview-stage-metrics .stage-score--bad {
    color: #b91c1c;
}

.call-overview-stage-comment {
    margin-top: 8px;
    font-size: 12px;
    line-height: 1.5;
    color: #5b5770;
    word-break: normal;
    overflow-wrap: break-word;
}

.score-transparency {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, rgba(49, 93, 255, 0.04) 0%, rgba(49, 93, 255, 0.01) 60%, rgba(255, 255, 255, 0.95) 100%);
    padding: 14px 16px;
    box-shadow: 0 8px 20px rgba(20, 16, 43, 0.08);
}

.score-transparency-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.score-transparency-formula {
    font-size: 12px;
    color: var(--text-secondary);
}

.score-kpi-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 12px;
    width: 100%;
    min-width: 0;
}

.score-kpi {
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.9);
    padding: 10px 10px;
    min-width: 0;
}

.score-kpi-label {
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.score-kpi-value {
    font-size: 18px;
    font-weight: 800;
    line-height: 1;
}

.score-breakdown-list {
    display: grid;
    gap: 8px;
}

.score-breakdown-item {
    border: 1px solid rgba(49, 93, 255, 0.12);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.85);
    padding: 8px 10px;
}

.score-breakdown-item--funnel {
    border-radius: 12px;
    padding: 10px 12px;
    background: #f9f9fb;
    border: 1px solid #edeaf4;
}

.score-breakdown-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
    font-size: 13px;
    min-width: 0;
}

.score-breakdown-name {
    font-weight: 600;
    color: var(--text-primary);
    min-width: 0;
    flex: 1 1 auto;
    overflow-wrap: anywhere;
}
.score-breakdown-val {
    font-weight: 800;
    flex-shrink: 0;
}

.score-breakdown-track {
    height: 7px;
    border-radius: 999px;
    background: #eceaf4;
    overflow: hidden;
}

.score-breakdown-item--funnel .score-breakdown-track.funnel-v2-bar-track {
    height: 8px;
    background: #e8e4f0;
}

.score-breakdown-fill {
    height: 100%;
    border-radius: 999px;
}

.score-breakdown-fill.pos {
    background: linear-gradient(90deg, #7B5BFF 0%, #315DFF 100%);
}

.score-breakdown-fill.neg {
    background: linear-gradient(90deg, #F59E0B 0%, #DC2626 100%);
}

@media (max-width: 720px) {
    .score-kpi-grid { grid-template-columns: 1fr; }
}

.ai-tab-hint {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.4;
    margin: 0 0 12px;
}

.ai-chips-carousel {
    margin: 0 -12px 16px;
    padding: 0 12px;
    overflow: hidden;
}

.ai-chips-track {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    padding-bottom: 6px;
    scrollbar-width: thin;
}

.ai-chip {
    flex: 0 0 auto;
    scroll-snap-align: start;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.78rem;
    font-weight: 600;
    padding: 10px 14px;
    border-radius: 999px;
    cursor: pointer;
    transition: transform 0.15s, border-color 0.2s, background 0.2s;
}

.ai-chip:active {
    transform: scale(0.96);
}

.ai-chip:hover {
    border-color: var(--accent);
}

.ai-ask-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
    margin-bottom: 14px;
    min-width: 0;
    width: 100%;
}

.ai-question-input {
    flex: 1;
    min-width: 0;
    width: 100%;
}

.ai-ask-row .btn {
    flex: 0 0 auto;
    white-space: nowrap;
    width: auto !important; /* .btn-primary задаёт width:100% и ломает flex-строку */
    padding: 12px 18px !important;
    font-size: 0.98rem !important;
}

.ai-answer {
    min-height: 48px;
}

.ai-answer-loading {
    color: var(--text-secondary);
    font-size: 0.9rem;
    padding: 12px 0;
}

.ai-answer-bubble {
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(var(--glass-blur));
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    font-size: 0.9rem;
    line-height: 1.5;
    overflow-wrap: anywhere;
    word-break: break-word;
    max-width: 100%;
}

@media (max-width: 640px) {
    .ai-ask-row {
        flex-direction: column;
    }
    .ai-ask-row .btn {
        width: 100% !important;
    }
    .ai-chips-carousel {
        margin: 0 0 14px;
        padding: 0;
    }
}

body.pull-refresh-hint::before {
    content: 'Отпустите для обновления';
    display: block;
    text-align: center;
    font-size: 0.75rem;
    color: var(--accent);
    padding: 6px 0 0;
    font-weight: 600;
}

@supports (view-transition-name: none) {
    ::view-transition-old(root),
    ::view-transition-new(root) {
        animation-duration: 0.22s;
        animation-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }
}

.calls-skeleton {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 4px 0 20px;
}

.calls-sk-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    min-height: 72px;
}

.calls-sk-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--bg-secondary);
    flex-shrink: 0;
}

.calls-sk-body {
    flex: 1;
    min-width: 0;
}

.calls-sk-line {
    height: 12px;
    border-radius: 6px;
    background: var(--bg-secondary);
    margin-bottom: 8px;
}

.calls-sk-line--title {
    width: 45%;
    height: 14px;
}

.calls-sk-body .calls-sk-line:last-child {
    width: 88%;
    margin-bottom: 0;
}

.calls-sk-right {
    flex-shrink: 0;
    width: 44px;
    text-align: right;
}

.calls-sk-badge {
    height: 22px;
    border-radius: 8px;
    background: var(--bg-secondary);
    margin-bottom: 6px;
}

.calls-sk-meta {
    height: 10px;
    border-radius: 5px;
    background: var(--bg-secondary);
    margin-left: auto;
    width: 70%;
}

/* Inbox nav badge + лента */
body.has-inbox-nav .bottom-nav .nav-item {
    min-width: 44px;
    padding: 4px 4px;
    font-size: 0.58rem;
}

.nav-item--inbox .nav-icon-wrap {
    position: relative;
    display: inline-block;
    margin-bottom: 1px;
}

.nav-item--inbox .nav-icon {
    margin-bottom: 0;
}

.nav-badge {
    position: absolute;
    top: -6px;
    right: -10px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 9px;
    background: var(--red);
    color: #fff;
    font-size: 0.62rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    box-sizing: border-box;
}

.nav-badge--top {
    top: -10px;
    right: -18px;
}

.nav-item--inbox .nav-label-wrap {
    padding-top: 8px;
}

.nav-badge[hidden] {
    display: none !important;
}

.page-inbox-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.page-inbox-header h1 {
    margin: 0;
}

.inbox-list {
    flex-direction: column;
    gap: 12px;
    padding-bottom: 24px;
}

.inbox-bubble {
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(var(--glass-blur));
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 14px 16px;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.inbox-bubble--unread {
    border-color: rgba(0, 122, 255, 0.45);
    box-shadow: 0 0 0 1px var(--accent-light);
}

.inbox-bubble-meta {
    font-size: 0.72rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.inbox-bubble-title {
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 6px;
}

.inbox-bubble-body {
    font-size: 0.88rem;
    line-height: 1.45;
    color: var(--text-primary);
    margin-bottom: 10px;
    white-space: pre-wrap;
}

.inbox-bubble-link {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
}

.inbox-bubble-link:hover {
    text-decoration: underline;
}

/* Глобальный мини-футер: оферта и политика (base.html) */
.app-legal-mini {
    /* footer должен выглядеть одинаково на обычных и legal-страницах.
       margin-top:auto в не-flex раскладке даёт непредсказуемые прыжки отступов. */
    margin: 16px auto 0;
    max-width: 1440px;
    width: 100%;
    box-sizing: border-box;
    padding: 12px 16px 10px;
    text-align: center;
}

.app-legal-mini p {
    margin: 0;
    font-size: 10px;
    line-height: 1.5;
    color: #9a95a8;
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.app-legal-mini a {
    color: #8b8799;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.app-legal-mini a:hover {
    color: #5b5770;
}

.app-legal-mini-sep {
    color: #d1ced9;
    margin: 0 0.35em;
}

@media (min-width: 1024px) {
    body.app-logged-in .app-legal-mini {
        padding-bottom: calc(10px + var(--safe-bottom));
    }
}

/* Офлайн-баннер PWA */
.app-offline-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
    text-align: center;
    color: #1c1c1e;
    background: linear-gradient(180deg, #fff3cd 0%, #ffe69c 100%);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.app-offline-banner[hidden] {
    display: none !important;
}

body.has-offline-banner {
    padding-top: calc(44px + env(safe-area-inset-top, 0px));
}

@media (min-width: 900px) {
    body.app-logged-in.has-offline-banner {
        padding-top: calc(96px + env(safe-area-inset-top, 0px));
    }

    body.app-logged-in.has-offline-banner .desktop-nav {
        top: 44px;
    }

    /* Visily + офлайн-баннер: нет desktop-nav — только высота баннера + safe-area */
    body.app-logged-in.has-offline-banner:has(#app .page.visily-shell) {
        padding-top: calc(44px + env(safe-area-inset-top, 0px)) !important;
    }
}

/* Светлая схема по умолчанию — нативные date/scrollbars (см. meta color-scheme + MDN) */
html:not(.dark) {
    color-scheme: light;
}

/* ── Тёмная тема: класс `dark` на html (см. visily-theme.js / base.html) ── */
html.dark {
    color-scheme: dark;
    --bg: #0c0b12;
    --bg-secondary: #16141f;
    --text-primary: #f4f2fc;
    --text-secondary: #c9c4d8;
    --text-tertiary: #9c96ae;
    --glass-bg: rgba(30, 28, 42, 0.92);
    --glass-border: rgba(255, 255, 255, 0.14);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.55);
    --glass-hover: rgba(40, 38, 54, 0.95);
    --accent-light: rgba(124, 99, 255, 0.22);
    --skeleton-shimmer-mid: rgba(255, 255, 255, 0.12);

    --visily-page: #070E1D;
    --visily-surface: #101A33;
    --visily-surface-2: #0D1B36;
    --visily-surface-deep: #0A1326;
    --visily-sidebar: #0b1224;
    --visily-sidebar-border: #1c3060;
    --visily-border: #1F3562;
    --visily-border-strong: #25406D;
    --visily-border-input: #25406D;
    --visily-text: #e8e6ef;
    --visily-text-heading: #f0eef8;
    --visily-text-muted: #a8a3b8;
    --visily-text-dim: #a8a3b8;
    --visily-text-label: #7c778f;
    --visily-accent-ghost: rgba(49, 93, 255, 0.18);
    --visily-icon: #9CC6FF;
    --visily-icon-on-dark: #9CC6FF;
    --visily-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
    --visily-shadow-elevated: 0 1px 3px rgba(0, 0, 0, 0.35);
    --visily-input-bg: #0A1326;
    --visily-input-fg: #eceaf2;
    --visily-hover-row: #0D1B36;
    --visily-nav-active-bg: #152447;
    --visily-mobile-sheet: #0D1B36;
    --visily-mobile-sheet-border: #1F3562;
    --visily-invert-surface: #101A33;
    --visily-invert-hover: #152447;
    --visily-focus-ring: #9CC6FF;

    --yellow: #fde047;
    --yellow-light: rgba(253, 224, 71, 0.13);
    --orange: #fb923c;
}

html.dark .point-bad { color: #fde68a; }
html.dark .point-tip { color: #93c5fd; }
html.dark .alert-warning { color: #fde68a; }

html.dark .bottom-nav {
    background: rgba(22, 20, 31, 0.92);
    border-top-color: rgba(255, 255, 255, 0.1);
}

html.dark .nav-item.active {
    color: var(--visily-icon-on-dark);
}

@media (min-width: 900px) {
    html.dark .desktop-nav {
        background: rgba(22, 20, 31, 0.96);
        border-bottom-color: rgba(255, 255, 255, 0.1);
    }

    html.dark .desktop-nav-item.active {
        color: #ddd6fe;
        background: var(--visily-accent-ghost);
    }
}

html.dark .app-offline-banner {
    color: #1c1c1e;
    background: linear-gradient(180deg, #3d3520 0%, #2a2618 100%);
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

html.dark .tab.active {
    background: var(--visily-nav-active-bg);
    color: var(--visily-text-heading);
    box-shadow: var(--visily-shadow-elevated);
}

html.dark .admin-filter-panel {
    background: linear-gradient(145deg, rgba(28, 26, 38, 0.98) 0%, rgba(20, 18, 30, 0.96) 100%);
    border-color: rgba(124, 99, 255, 0.28);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
}

html.dark .admin-filter-panel .admin-filter-tabs {
    background: rgba(14, 12, 20, 0.92);
    border-color: rgba(255, 255, 255, 0.08);
}

html.dark .admin-client-body {
    border-top-color: rgba(255, 255, 255, 0.08);
}

/* Разбор звонка — «Прозрачность оценки» и этапы (жёсткие светлые фоны в базовых правилах) */
html.dark .score-transparency {
    background: linear-gradient(
        180deg,
        rgba(93, 69, 255, 0.14) 0%,
        rgba(30, 28, 42, 0.55) 55%,
        rgba(22, 20, 34, 0.98) 100%
    );
    border-color: var(--glass-border);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

html.dark .score-transparency-formula {
    color: var(--text-secondary);
}

html.dark .score-kpi {
    background: rgba(30, 28, 42, 0.95);
    border-color: var(--glass-border);
}

html.dark .score-kpi-label {
    color: var(--text-secondary);
}

html.dark .score-kpi-value {
    color: var(--text-primary);
}

html.dark .score-breakdown-item {
    background: rgba(26, 24, 36, 0.92);
    border-color: rgba(124, 99, 255, 0.28);
}

html.dark .score-breakdown-name {
    color: var(--text-primary);
}

html.dark .score-breakdown-track {
    background: #2a2838;
}

html.dark .call-overview-stages-shell .call-overview-stage-card.funnel-v2-stage {
    background: #14121a;
    border-color: #3d3a52;
}

html.dark .call-overview-stage-metrics .funnel-v2-bar-track {
    background: #2a2638;
}

html.dark .call-overview-stage-metrics .stage-score--good {
    color: #86efac;
}

html.dark .call-overview-stage-metrics .stage-score--warn {
    color: #fde047;
}

html.dark .call-overview-stage-metrics .stage-score--bad {
    color: #fca5a5;
}

html.dark .call-overview-stage-metrics .funnel-v2-stage-score:not(.stage-score--good):not(.stage-score--warn):not(.stage-score--bad) {
    color: #9CC6FF;
}

html.dark .score-breakdown-item--funnel {
    background: #14121a;
    border-color: #3d3a52;
}

html.dark .score-breakdown-item--funnel .score-breakdown-track.funnel-v2-bar-track {
    background: #2a2638;
}

html.dark .call-overview-stage-comment {
    color: #a8a3b8;
}

/* ── ≤768px: планшет / крупный телефон (дополняет mobile-first и lg/md в шаблонах) ── */
@media (max-width: 768px) {
    body {
        padding-bottom: calc(72px + var(--safe-bottom));
    }

    .page-header h1 {
        font-size: 1.2rem;
        line-height: 1.25;
    }

    .glass-static,
    .metric-card {
        border-radius: var(--radius-md);
    }
}

/* ────────────────────────────────────────────
   Hero subtitle: выделенные числа в подзаголовке.
   Задача — чтобы цифры (25, 6 и т.п.) читались как
   отдельные единицы и не сливались с соседним текстом
   или точками в предложении.
   ──────────────────────────────────────────── */
.hero-metric-num {
    display: inline-block;
    padding: 1px 8px;
    margin: 0 1px;
    border-radius: 8px;
    background: rgba(49, 93, 255, 0.08);
    color: #3B2AB8;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    font-feature-settings: 'tnum' 1;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

html.dark .hero-metric-num {
    background: rgba(123, 97, 255, 0.18);
    color: #c7b8ff;
}

.hero-metric-unit {
    color: inherit;
    opacity: 0.72;
    font-weight: 500;
    white-space: nowrap;
}

/* ────────────────────────────────────────────
   Predictive risk cards: крупнее типографика на десктопе.
   На мобилке остаётся компактная (12/11px), на ≥1024px
   читается комфортно (14/12px) без скачков лэйаута.
   ──────────────────────────────────────────── */
.predictive-card {
    padding: 12px 14px;
}

.predictive-card__title {
    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;
    color: #191821;
}

html.dark .predictive-card__title {
    color: #f4f2fc;
}

.predictive-card__body {
    font-size: 12px;
    line-height: 1.45;
    color: #5B5770;
    margin-top: 6px;
}

html.dark .predictive-card__body {
    color: #a8a3b8;
}

.predictive-card__chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    background: #F3F4F6;
    color: #374151;
}

html.dark .predictive-card__chip {
    background: #3d3a52;
    color: #c4c0d4;
}

.predictive-card__action {
    font-size: 14px;
    font-weight: 700;
    margin-top: 6px;
    color: #191821;
}

html.dark .predictive-card__action {
    color: #f4f2fc;
}

.predictive-card__empty {
    font-size: 12px;
    color: #8B8799;
}

html.dark .predictive-card__empty {
    color: #9a96a8;
}

@media (min-width: 1024px) {
    .predictive-card {
        padding: 18px 20px;
    }

    .predictive-card__title {
        font-size: 15px;
    }

    .predictive-card__body {
        font-size: 14px;
        line-height: 1.5;
        margin-top: 8px;
    }

    .predictive-card__chip {
        font-size: 12px;
        padding: 5px 12px;
    }

    .predictive-card__action {
        font-size: 16px;
        margin-top: 8px;
    }

    .predictive-card__empty {
        font-size: 13px;
    }
}

/* ────────────────────────────────────────────
   Статусные кнопки рекомендаций ("Прочитано / Применил
   / Пропустить"): контрастный outlined-стиль, чтобы не
   сливались с текстом карточки. Цветовая кодировка по
   действию помогает быстро найти нужную.
   ──────────────────────────────────────────── */
.call-rec-status-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 12px;
}

.call-rec-status-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 999px;
    border: 1.5px solid #CFCADF;
    background: #FFFFFF;
    color: #3B3649;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
    line-height: 1;
}

.call-rec-status-btn:hover:not(:disabled) {
    background: #F4F2FC;
    border-color: #B5A8F0;
    color: #3F2BA8;
}

.call-rec-status-btn:active:not(:disabled) {
    transform: translateY(1px);
}

.call-rec-status-btn:focus-visible {
    outline: 2px solid #315DFF;
    outline-offset: 2px;
}

.call-rec-status-btn[data-rec-status="applied"]:hover:not(:disabled) {
    background: #E8F8EE;
    border-color: #34C759;
    color: #1F7A3D;
}

.call-rec-status-btn[data-rec-status="skipped"] {
    border-color: #D1D0DB;
    color: #6B6580;
}

.call-rec-status-btn[data-rec-status="skipped"]:hover:not(:disabled) {
    background: #F4F3F6;
    border-color: #B7B3C4;
    color: #3B3649;
}

.call-rec-status-btn.is-active[data-rec-status="viewed"] {
    background: #315DFF;
    border-color: #315DFF;
    color: #FFFFFF;
}

.call-rec-status-btn.is-active[data-rec-status="applied"] {
    background: #34C759;
    border-color: #34C759;
    color: #FFFFFF;
}

.call-rec-status-btn.is-active[data-rec-status="skipped"] {
    background: #6B6580;
    border-color: #6B6580;
    color: #FFFFFF;
}

.call-rec-status-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.call-rec-status-msg {
    font-size: 12px;
    color: #5B5770;
    margin-left: 4px;
}

html.dark .call-rec-status-btn {
    background: #2a2838;
    border-color: #4a4658;
    color: #e6e2f0;
}

html.dark .call-rec-status-btn:hover:not(:disabled) {
    background: #3a3550;
    border-color: #7b61ff;
    color: #c7b8ff;
}

html.dark .call-rec-status-btn[data-rec-status="applied"]:hover:not(:disabled) {
    background: rgba(74, 222, 128, 0.12);
    border-color: #4ade80;
    color: #bbf7d0;
}

html.dark .call-rec-status-btn[data-rec-status="skipped"] {
    border-color: #4a4658;
    color: #a8a3b8;
}

html.dark .call-rec-status-btn[data-rec-status="skipped"]:hover:not(:disabled) {
    background: #3a3550;
    color: #d8d4e8;
}

html.dark .call-rec-status-btn.is-active[data-rec-status="viewed"] {
    background: #7b61ff;
    border-color: #7b61ff;
    color: #ffffff;
}

html.dark .call-rec-status-btn.is-active[data-rec-status="applied"] {
    background: #4ade80;
    border-color: #4ade80;
    color: #0b1b0e;
}

html.dark .call-rec-status-btn.is-active[data-rec-status="skipped"] {
    background: #6B6580;
    border-color: #6B6580;
    color: #ffffff;
}

html.dark .call-rec-status-msg {
    color: #a8a3b8;
}

/* === СейлсПро design system === */

/* Dark mode radial bg — только под .dark, не ломает light */
html.dark body {
    background: radial-gradient(circle at top, #0f172a, #020617) fixed;
}

/* Infinity hero blob */
.infinity-bg {
    position: absolute;
    right: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 70% 50%, rgba(59,130,246,0.3), transparent 60%),
        radial-gradient(circle at 80% 40%, rgba(168,85,247,0.3), transparent 60%);
    filter: blur(40px);
    opacity: 0.8;
}

/* Glass card utility */
.glass-card {
    background: rgba(255,255,255,0.02);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
}

/* === СейлсПро brand animations === */
@keyframes infinity-draw {
    0%   { stroke-dasharray: 0 100; opacity: .3; }
    50%  { stroke-dasharray: 50 50; opacity: 1; }
    100% { stroke-dasharray: 100 0; opacity: .3; }
}
.infinity-anim {
    stroke-dasharray: 100;
    animation: infinity-draw 2s ease-in-out infinite;
}

.skeleton {
    background: linear-gradient(
        90deg,
        rgba(255,255,255,0.05) 25%,
        rgba(255,255,255,0.1)  50%,
        rgba(255,255,255,0.05) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}
@keyframes shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* === Scroll-to-top button === */
.scroll-top-btn {
    position: fixed;
    right: 16px;
    bottom: calc(76px + var(--safe-bottom));
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(249, 249, 249, 0.85);
    -webkit-backdrop-filter: saturate(180%) blur(16px);
    backdrop-filter: saturate(180%) blur(16px);
    border: 0.5px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1100;
    opacity: 0;
    transform: translateY(8px) scale(0.9);
    pointer-events: none;
    transition: opacity 0.22s ease, transform 0.22s ease;
}
.scroll-top-btn.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}
.scroll-top-btn svg {
    width: 18px;
    height: 18px;
    color: #315DFF;
}
html.dark .scroll-top-btn {
    background: rgba(30, 27, 45, 0.88);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}
html.dark .scroll-top-btn svg {
    color: #7b93ff;
}
@media (min-width: 768px) {
    .scroll-top-btn {
        bottom: calc(24px + var(--safe-bottom));
        right: 24px;
    }
}
