/* ═══════════════════════════════════════════════════════════════
   Shelby Stream — Design System
   Тёмная тема, liquid glass, Inter. Подключается на каждой странице
   до page-specific стилей.
   ═══════════════════════════════════════════════════════════════ */

@property --beam-angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

:root {
    color-scheme: dark;

    --bg: #121212;
    --bg-2: #181818;
    --bg-3: #1e1e1e;
    --bg-4: #262626;
    --bg-inset: #0e0e0e;

    --text: #ffffff;
    --text-2: rgba(255, 255, 255, 0.64);
    --text-3: rgba(255, 255, 255, 0.40);
    --text-4: rgba(255, 255, 255, 0.24);

    --line: rgba(255, 255, 255, 0.07);
    --line-2: rgba(255, 255, 255, 0.12);
    --line-3: rgba(255, 255, 255, 0.20);

    --accent: #ececef;
    --accent-hi: #ffffff;
    --accent-lo: #a1a1aa;
    --accent-ink: #121212;
    --accent-a10: rgba(255, 255, 255, 0.085);
    --accent-a18: rgba(255, 255, 255, 0.153);
    --accent-a32: rgba(255, 255, 255, 0.272);

    /* Системные цвета Apple (dark) */
    --green: #30d158;
    --green-a: rgba(48, 209, 88, 0.14);
    --red: #ff453a;
    --red-a: rgba(255, 69, 58, 0.14);
    --orange: #ff9f0a;
    --orange-a: rgba(255, 159, 10, 0.14);
    --yellow: #ffd60a;
    --blue: #0a84ff;
    --blue-soft: #64aaff;
    --blue-a: rgba(10, 132, 255, 0.14);
    --purple: #bf5af2;
    --purple-a: rgba(191, 90, 242, 0.14);

    --glass-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.085) 0%, rgba(255, 255, 255, 0.035) 100%);
    --glass-bg-strong: linear-gradient(180deg, rgba(44, 44, 44, 0.78) 0%, rgba(28, 28, 28, 0.72) 100%);
    --glass-blur: blur(24px) saturate(180%);
    --glass-border: rgba(255, 255, 255, 0.10);
    --glass-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.16),
        inset 0 -1px 0 rgba(255, 255, 255, 0.03),
        0 10px 30px -8px rgba(0, 0, 0, 0.55),
        0 2px 6px rgba(0, 0, 0, 0.25);

    --r-xs: 8px;
    --r-sm: 12px;
    --r: 16px;
    --r-lg: 22px;
    --r-xl: 28px;
    --r-pill: 999px;

    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-spring: cubic-bezier(0.32, 0.72, 0, 1);
    --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);

    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, sans-serif;
    --mono: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;

    --nav-w: 64px;
    --nav-gap: 16px;
    --content-left: calc(var(--nav-w) + var(--nav-gap) * 2);
}

html.nav-expanded { --nav-w: 228px; }

/* ─── Base ─────────────────────────────────────────────────────── */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    -webkit-tap-highlight-color: transparent;
    -webkit-text-size-adjust: 100%;
    scrollbar-color: rgba(255, 255, 255, 0.14) transparent;
}

body {
    font-family: var(--font);
    font-feature-settings: 'cv11', 'ss01', 'ss03';
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.45;
    letter-spacing: -0.006em;
    min-height: 100vh;
    min-height: 100dvh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Мягкий фоновый свет: стеклу нужно что-то за собой, иначе оно плоское */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(60vw 50vh at 85% -10%, rgba(255, 255, 255, 0.06), transparent 70%),
        radial-gradient(50vw 50vh at -10% 110%, rgba(255, 255, 255, 0.035), transparent 70%);
}

::selection {
    background: var(--accent-a32);
    color: var(--text);
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.10);
    border-radius: 10px;
    border: 3px solid transparent;
    background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background-color: rgba(255, 255, 255, 0.20); }

a { color: var(--accent); text-decoration: none; transition: color .2s var(--ease); }
a:hover { color: var(--accent-hi); }

button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }

:focus-visible {
    outline: 2px solid var(--accent-a32);
    outline-offset: 2px;
}

/* ─── Icons ────────────────────────────────────────────────────── */

.i {
    display: inline-block;
    width: 1em;
    height: 1em;
    flex-shrink: 0;
    vertical-align: -0.125em;
}

[data-icon] { display: inline-flex; align-items: center; justify-content: center; font-style: normal; }

/* Флаг страны (Flag() в icons.js) */
.flag {
    display: inline-flex;
    flex-shrink: 0;
    width: 18px;
    height: 13px;
    border-radius: 3px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1);
    vertical-align: -2px;
}

.flag img { display: block; width: 100%; height: 100%; object-fit: cover; }

.flag.flag-fallback {
    width: auto;
    height: 16px;
    padding: 0 4px;
    align-items: center;
    box-shadow: none;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--text-2);
}

.flag.flag-fallback::after { content: attr(data-cc); }

/* ─── Layout ───────────────────────────────────────────────────── */

body.has-nav { padding-left: var(--content-left); transition: padding-left .5s var(--ease-spring); }

.main {
    flex: 1;
    min-width: 0;
    padding: 36px 40px 64px 0;
}

/* ─── Шапка страницы — одна на все страницы ───
   <header class="page-head">
     <div class="page-head-text">
       [<nav class="page-crumbs">…</nav>]
       <h1 class="page-title"><span>Название</span>[<span class="count-pill">…</span>]</h1>
       <p class="page-sub">Одна строка описания</p>
     </div>
     [<div class="page-actions">кнопки</div>]
   </header>
   [<div class="toolbar">поиск · фильтры · <div class="toolbar-end">списки</div></div>] — всё подряд слева */

.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px 24px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.page-head-text { min-width: 0; }

.page-title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 14px;
    font-size: 30px;
    line-height: 1.15;
    font-weight: 700;
    letter-spacing: -0.028em;
    color: var(--text);
}

.page-title .count-pill { letter-spacing: -0.005em; line-height: 1; }

.page-sub {
    margin-top: 8px;
    max-width: 680px;
    font-size: 14px;
    line-height: 1.45;
    color: var(--text-3);
    letter-spacing: -0.005em;
}

.page-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* Хлебные крошки над названием — для вложенных страниц */
.page-crumbs {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
    font-size: 13px;
    color: var(--text-3);
}

.page-crumbs a { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); }
.page-crumbs a:hover { color: var(--text); }
.page-crumbs .i { width: 14px; height: 14px; color: var(--text-4); }

/* Панель инструментов под шапкой: все элементы одной высоты — 40px */
.toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.toolbar > .search { flex: 0 1 340px; min-width: 220px; }
.toolbar > .segmented { padding: 3px; flex-shrink: 1; }
.toolbar .toolbar-end { display: flex; align-items: center; gap: 10px; }
.toolbar > .btn { --btn-h: 40px; }
.toolbar .select,
.toolbar .dd-trigger { width: auto; height: 40px; border-radius: 12px; font-size: 13px; color: var(--text-2); }

.muted { color: var(--text-3); }
.mono { font-family: var(--mono); font-size: 0.92em; letter-spacing: 0; }
.accent { color: var(--accent); }

/* ─── Liquid glass ─────────────────────────────────────────────── */

.glass {
    position: relative;
    background: var(--glass-bg);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
}

/* Блик по контуру: градиентная обводка, ярче сверху-слева */
.glass::after,
.btn::after,
.nav-pill::after {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.38) 0%, rgba(255, 255, 255, 0.04) 32%, rgba(255, 255, 255, 0) 60%, rgba(255, 255, 255, 0.10) 100%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
    pointer-events: none;
}

.surface {
    background: var(--bg-2);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
}

.card {
    background: var(--bg-2);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: 20px;
    transition: border-color .3s var(--ease), transform .4s var(--ease-spring), box-shadow .4s var(--ease), background .3s var(--ease);
}

.card.interactive:hover,
.card.hoverable:hover {
    border-color: var(--line-2);
    transform: translateY(-2px);
    box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.7);
}

/* ─── Border beam (libraries.dev) ──────────────────────────────── */

.beam { position: relative; isolation: isolate; }

.beam::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    padding: 1px;
    background: conic-gradient(from var(--beam-angle),
            transparent 0deg,
            transparent 250deg,
            rgba(255, 255, 255, 0) 270deg,
            var(--accent) 320deg,
            var(--accent-hi) 340deg,
            transparent 360deg);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
    animation: beam-spin 6s linear infinite;
    pointer-events: none;
    z-index: 1;
}

.beam.beam-red::before {
    background: conic-gradient(from var(--beam-angle), transparent 0deg, transparent 260deg, var(--red) 330deg, #ff8a80 345deg, transparent 360deg);
}

.beam.beam-green::before {
    background: conic-gradient(from var(--beam-angle), transparent 0deg, transparent 260deg, var(--green) 330deg, #a7f3c0 345deg, transparent 360deg);
}

@keyframes beam-spin { to { --beam-angle: 360deg; } }

/* ─── Buttons — liquid glass pills ─────────────────────────────── */

.btn {
    --btn-h: 38px;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: var(--btn-h);
    padding: 0 18px;
    border-radius: calc(var(--btn-h) * 0.3);
    border: 1px solid rgba(255, 255, 255, 0.09);
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(20px) saturate(170%);
    backdrop-filter: blur(20px) saturate(170%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.14),
        0 1px 2px rgba(0, 0, 0, 0.3),
        0 6px 16px -8px rgba(0, 0, 0, 0.6);
    color: var(--text);
    font-size: 13px;
    font-weight: 550;
    letter-spacing: -0.005em;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
    text-decoration: none;
    transition:
        transform .35s var(--ease-spring),
        background .25s var(--ease),
        border-color .25s var(--ease),
        box-shadow .25s var(--ease),
        color .2s var(--ease),
        opacity .2s;
}

/* Подсветка, следующая за курсором (--mx/--my ставит icons.js) */
.btn::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(120px circle at var(--mx, 50%) var(--my, -40%), rgba(255, 255, 255, 0.16), transparent 60%);
    opacity: 0;
    transition: opacity .3s var(--ease);
    pointer-events: none;
}

.btn:hover {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.13) 0%, rgba(255, 255, 255, 0.055) 100%);
    border-color: rgba(255, 255, 255, 0.14);
    color: var(--text);
}

.btn:hover::before { opacity: 1; }
.btn:active { transform: scale(0.965); transition-duration: .12s; }

.btn:disabled,
.btn.disabled {
    opacity: 0.38;
    pointer-events: none;
}

.btn .i { width: 16px; height: 16px; }

.btn-sm { --btn-h: 30px; padding: 0 13px; font-size: 12px; gap: 6px; }
.btn-sm .i { width: 14px; height: 14px; }
.btn-lg { --btn-h: 46px; padding: 0 24px; font-size: 15px; }
.btn-block { width: 100%; }

.btn-icon { width: var(--btn-h); padding: 0; }

/* Основная — бледное золото, с «жидким металлом» по ховеру */
.btn-primary {
    color: var(--accent-ink);
    border-color: rgba(255, 255, 255, 0.55);
    background:
        linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, 0.45) 45%, transparent 60%) -200% 0 / 250% 100% no-repeat,
        linear-gradient(180deg, #ffffff 0%, #ececef 55%, #d4d4d8 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.65),
        inset 0 -1px 0 rgba(0, 0, 0, 0.16),
        0 1px 2px rgba(0, 0, 0, 0.3),
        0 8px 22px -10px rgba(255, 255, 255, 0.468);
}

.btn-primary:hover {
    color: var(--accent-ink);
    border-color: rgba(255, 255, 255, 0.75);
    background:
        linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, 0.45) 45%, transparent 60%) 200% 0 / 250% 100% no-repeat,
        linear-gradient(180deg, #ffffff 0%, #f0f0f2 55%, #dcdce0 100%);
    transition: background-position .9s var(--ease), transform .35s var(--ease-spring), box-shadow .25s;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.7),
        inset 0 -1px 0 rgba(0, 0, 0, 0.16),
        0 1px 2px rgba(0, 0, 0, 0.3),
        0 10px 28px -10px rgba(255, 255, 255, 0.595);
}

.btn-primary::after { display: none; }

.btn-accent {
    color: var(--accent-hi);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.153), rgba(255, 255, 255, 0.068));
    border-color: rgba(255, 255, 255, 0.238);
}
.btn-accent:hover { color: #ffffff; background: linear-gradient(180deg, rgba(255, 255, 255, 0.221), rgba(255, 255, 255, 0.102)); border-color: rgba(255, 255, 255, 0.357); }

.btn-success {
    color: #7ee59b;
    background: linear-gradient(180deg, rgba(48, 209, 88, 0.17), rgba(48, 209, 88, 0.07));
    border-color: rgba(48, 209, 88, 0.26);
}
.btn-success:hover { color: #a8f0bb; background: linear-gradient(180deg, rgba(48, 209, 88, 0.25), rgba(48, 209, 88, 0.11)); border-color: rgba(48, 209, 88, 0.4); }

.btn-danger {
    color: #ff8a80;
    background: linear-gradient(180deg, rgba(255, 69, 58, 0.17), rgba(255, 69, 58, 0.07));
    border-color: rgba(255, 69, 58, 0.26);
}
.btn-danger:hover { color: #ffb3ad; background: linear-gradient(180deg, rgba(255, 69, 58, 0.25), rgba(255, 69, 58, 0.11)); border-color: rgba(255, 69, 58, 0.42); }

.btn-warning {
    color: #ffc266;
    background: linear-gradient(180deg, rgba(255, 159, 10, 0.17), rgba(255, 159, 10, 0.07));
    border-color: rgba(255, 159, 10, 0.26);
}
.btn-warning:hover { color: #ffd699; background: linear-gradient(180deg, rgba(255, 159, 10, 0.25), rgba(255, 159, 10, 0.11)); border-color: rgba(255, 159, 10, 0.42); }

.btn-info {
    color: var(--blue-soft);
    background: linear-gradient(180deg, rgba(10, 132, 255, 0.17), rgba(10, 132, 255, 0.07));
    border-color: rgba(10, 132, 255, 0.26);
}
.btn-info:hover { color: #9cc8ff; background: linear-gradient(180deg, rgba(10, 132, 255, 0.25), rgba(10, 132, 255, 0.11)); border-color: rgba(10, 132, 255, 0.42); }

.btn-purple {
    color: #d79cf7;
    background: linear-gradient(180deg, rgba(191, 90, 242, 0.17), rgba(191, 90, 242, 0.07));
    border-color: rgba(191, 90, 242, 0.26);
}
.btn-purple:hover { color: #e6c1fa; background: linear-gradient(180deg, rgba(191, 90, 242, 0.25), rgba(191, 90, 242, 0.11)); border-color: rgba(191, 90, 242, 0.42); }

.btn-ghost {
    background: transparent;
    border-color: transparent;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    color: var(--text-2);
}
.btn-ghost::after { display: none; }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.07); border-color: transparent; color: var(--text); }

.btn.is-on,
.btn.active {
    color: var(--accent-hi);
    border-color: rgba(255, 255, 255, 0.297);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.17), rgba(255, 255, 255, 0.068));
}

/* ─── Segmented control (фильтры) ──────────────────────────────── */

.segmented {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 4px;
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--line);
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
}
.segmented::-webkit-scrollbar { display: none; }

.seg-item {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 32px;
    padding: 0 14px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--text-3);
    font-size: 13px;
    font-weight: 550;
    white-space: nowrap;
    cursor: pointer;
    transition: color .25s var(--ease), background .3s var(--ease), box-shadow .3s var(--ease), transform .3s var(--ease-spring);
}

.seg-item .i { width: 15px; height: 15px; }
.seg-item:hover { color: var(--text-2); }
.seg-item:active { transform: scale(0.96); }

.seg-item.active {
    color: var(--text);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.07));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 2px 8px rgba(0, 0, 0, 0.35);
}

/* ─── Inputs ───────────────────────────────────────────────────── */

.input,
.select,
.textarea {
    width: 100%;
    height: 40px;
    padding: 0 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--line-2);
    border-radius: var(--r-sm);
    color: var(--text);
    font-size: 14px;
    outline: none;
    transition: border-color .2s var(--ease), box-shadow .25s var(--ease), background .2s var(--ease);
}

.textarea { height: auto; min-height: 96px; padding: 12px 14px; resize: vertical; line-height: 1.5; }

.input::placeholder,
.textarea::placeholder { color: var(--text-4); }

.input:hover,
.select:hover,
.textarea:hover { border-color: var(--line-3); }

.input:focus,
.select:focus,
.textarea:focus {
    border-color: rgba(255, 255, 255, 0.468);
    background: rgba(255, 255, 255, 0.055);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.102);
}

.select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 36px;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.5)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 14px;
}

.select.pill,
.input.pill { border-radius: 10px; }

select option { background: #1e1e1e; color: var(--text); }

/* Поле ответа с кнопкой отправки внутри (тикеты) — в одном стиле с полем Open ticket */
.compose-field {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    padding: 0 6px 6px 0;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--line-2);
    transition: border-color .2s var(--ease), box-shadow .25s var(--ease), background .2s var(--ease);
}

.compose-field:focus-within {
    border-color: rgba(255, 255, 255, 0.425);
    background: rgba(255, 255, 255, 0.055);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.085);
}

.compose-field textarea {
    flex: 1;
    min-width: 0;
    min-height: 64px;
    max-height: 220px;
    field-sizing: content;
    padding: 11px 4px 11px 14px;
    border: 0;
    outline: 0;
    background: transparent;
    box-shadow: none;
    color: var(--text);
    font: inherit;
    font-size: 13.5px;
    line-height: 1.45;
    resize: none;
}

.compose-field textarea::placeholder { color: var(--text-4); }
.compose-send.btn { --btn-h: 32px; flex-shrink: 0; padding: 0 12px; font-size: 12.5px; }
.compose-send .i { width: 14px; height: 14px; }

/* Дропдаун (icons.js заменяет им нативные <select>) */
.dd { position: relative; display: inline-flex; max-width: 100%; vertical-align: middle; }
.dd > .dd-native {
    position: absolute !important;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.dd-trigger {
    display: inline-flex;
    align-items: center;
    text-align: left;
    white-space: nowrap;
    cursor: pointer;
}

.dd-trigger:disabled { opacity: .45; cursor: default; }
.dd-label { overflow: hidden; text-overflow: ellipsis; }
.dd.open .dd-trigger {
    border-color: rgba(255, 255, 255, 0.425);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.085);
    background-color: rgba(255, 255, 255, 0.06);
}

.dd-menu {
    position: fixed;
    z-index: 2000002;
    max-height: 320px;
    overflow-y: auto;
    padding: 5px;
    border-radius: 16px;
    background: var(--glass-bg-strong);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    backdrop-filter: blur(30px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 24px 48px -16px rgba(0, 0, 0, 0.8);
    opacity: 0;
    transform: translateY(-4px) scale(0.97);
    transform-origin: top center;
    transition: opacity .16s var(--ease), transform .3s var(--ease-spring);
    scrollbar-width: thin;
}

.dd-menu.up { transform-origin: bottom center; transform: translateY(4px) scale(0.97); }
.dd-menu.show { opacity: 1; transform: none; }

.dd-opt {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 34px;
    padding: 0 14px 0 10px;
    border-radius: 10px;
    font-size: 13.5px;
    color: var(--text-2);
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
    transition: background .12s, color .12s;
}

.dd-opt .dd-check { width: 14px; height: 14px; color: var(--accent); opacity: 0; flex-shrink: 0; }
.dd-opt.selected { color: var(--text); font-weight: 550; }
.dd-opt.selected .dd-check { opacity: 1; }
.dd-opt.active { background: rgba(255, 255, 255, 0.08); color: var(--text); }
.dd-opt.disabled { opacity: .35; pointer-events: none; }

.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.field-label,
.label {
    font-size: 12px;
    font-weight: 550;
    color: var(--text-2);
    letter-spacing: -0.003em;
}

.search {
    position: relative;
    display: flex;
    align-items: center;
    min-width: 200px;
}

.search > .i,
.search > [data-icon] {
    position: absolute;
    left: 14px;
    width: 16px;
    height: 16px;
    color: var(--text-3);
    pointer-events: none;
    transition: color .2s;
}

.search input {
    width: 100%;
    height: 40px;
    padding: 0 16px 0 40px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.045);
    border: 1px solid var(--line-2);
    color: var(--text);
    font-size: 14px;
    outline: none;
    transition: border-color .2s var(--ease), box-shadow .25s var(--ease), background .2s;
}

.search input::placeholder { color: var(--text-4); }
.search input:focus {
    border-color: rgba(255, 255, 255, 0.425);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.093);
}
.search:focus-within > .i,
.search:focus-within > [data-icon] { color: var(--accent); }

input[type="search"] { -webkit-appearance: textfield; appearance: textfield; }
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; appearance: none; display: none; }

/* Switch в стиле iOS */
.switch {
    position: relative;
    width: 44px;
    height: 26px;
    flex-shrink: 0;
    display: inline-block;
}
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch .track,
.switch .slider {
    position: absolute;
    inset: 0;
    border-radius: var(--r-pill);
    background: rgba(255, 255, 255, 0.14);
    cursor: pointer;
    transition: background .3s var(--ease);
}
.switch .track::before,
.switch .slider::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
    transition: transform .35s var(--ease-spring);
}
.switch input:checked + .track,
.switch input:checked + .slider { background: var(--green); }
.switch input:checked + .track::before,
.switch input:checked + .slider::before { transform: translateX(18px); }

/* ─── Badges / status ──────────────────────────────────────────── */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 22px;
    padding: 0 9px;
    border-radius: var(--r-pill);
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.005em;
    white-space: nowrap;
    background: rgba(255, 255, 255, 0.07);
    color: var(--text-2);
}

.badge .i { width: 12px; height: 12px; }

.badge-green { background: var(--green-a); color: var(--green); }
.badge-red { background: var(--red-a); color: #ff6961; }
.badge-orange { background: var(--orange-a); color: var(--orange); }
.badge-blue { background: var(--blue-a); color: var(--blue-soft); }
.badge-purple { background: var(--purple-a); color: #d79cf7; }
.badge-gold { background: var(--accent-a10); color: var(--accent); }
.badge-muted { background: rgba(255, 255, 255, 0.05); color: var(--text-3); }

.dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--text-4);
    flex-shrink: 0;
}

.dot-live,
.dot-green { background: var(--green); }
.dot-red { background: var(--red); }
.dot-orange { background: var(--orange); }
.dot-blue { background: var(--blue); }
.dot-gold { background: var(--accent); }

.dot-live { position: relative; }
.dot-live::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: inherit;
    animation: ping 2s var(--ease) infinite;
}

@keyframes ping {
    0% { transform: scale(1); opacity: .7; }
    80%, 100% { transform: scale(2.8); opacity: 0; }
}

.count-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 28px;
    padding: 0 12px;
    border-radius: var(--r-pill);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--line);
    font-size: 12.5px;
    font-weight: 550;
    color: var(--text-2);
}

/* ─── Tables ───────────────────────────────────────────────────── */

.table-wrap {
    background: var(--bg-2);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    overflow: hidden;
}

.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.table th {
    padding: 14px 18px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-3);
    background: rgba(255, 255, 255, 0.015);
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}

.table td {
    padding: 14px 18px;
    font-size: 13.5px;
    color: var(--text-2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.045);
    vertical-align: middle;
    transition: background .2s var(--ease);
}

.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: rgba(255, 255, 255, 0.022); }
.table td.strong,
.table .td-name { color: var(--text); font-weight: 550; }

/* ─── Empty / loading ──────────────────────────────────────────── */

.empty-state,
.empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 72px 24px;
    text-align: center;
    color: var(--text-3);
    font-size: 14px;
}

.empty-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    margin-bottom: 6px;
    border-radius: 18px;
    color: var(--text-2);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.025));
    border: 1px solid var(--line);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.empty-icon .i { width: 24px; height: 24px; }

/* Thinking orb (libraries.dev) — индикатор загрузки */
.orb {
    position: relative;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, var(--accent-lo), var(--accent-hi), #ffffff, var(--accent), var(--accent-lo));
    filter: blur(0.4px);
    animation: orb-spin 2.4s linear infinite, orb-breathe 2.4s var(--ease) infinite;
    box-shadow: 0 0 24px rgba(255, 255, 255, 0.297);
}

.orb::after {
    content: '';
    position: absolute;
    inset: 3px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.55), rgba(18, 18, 18, 0.0) 45%), radial-gradient(circle, #1a1a1a 55%, transparent 56%);
}

.orb-sm { width: 16px; height: 16px; }
.orb-sm::after { inset: 2px; }

@keyframes orb-spin { to { transform: rotate(360deg); } }
@keyframes orb-breathe { 0%, 100% { scale: 1; } 50% { scale: 0.88; } }

.skeleton {
    position: relative;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.045);
    border-radius: 8px;
}

.skeleton::after {
    content: '';
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.06), transparent);
    animation: shimmer-x 1.6s var(--ease) infinite;
}

@keyframes shimmer-x { to { transform: translateX(100%); } }

/* ─── Toasts ───────────────────────────────────────────────────── */

.toast-container {
    position: fixed;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000020; /* над модалками, диалогами и их затемнением */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    pointer-events: none;
}

.toast {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    max-width: min(440px, calc(100vw - 32px));
    padding: 10px 18px 10px 12px;
    border-radius: var(--r-pill);
    background: var(--glass-bg-strong);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    backdrop-filter: blur(30px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 16px 40px -12px rgba(0, 0, 0, 0.7);
    color: var(--text);
    font-size: 13.5px;
    font-weight: 500;
    pointer-events: auto;
    animation: toast-in .55s var(--ease-spring) both, toast-out .35s var(--ease) 2.7s forwards;
}

.toast::before {
    content: '';
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    border-radius: 50%;
    background-color: var(--blue);
    background-repeat: no-repeat;
    background-position: center;
    background-size: 13px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 16v-4M12 8h.01'/%3E%3C/svg%3E");
}

.toast.success::before {
    background-color: var(--green);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
}

.toast.error::before {
    background-color: var(--red);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 6 6 18M6 6l12 12'/%3E%3C/svg%3E");
}

.toast.warning::before {
    background-color: var(--orange);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 8v4M12 16h.01'/%3E%3C/svg%3E");
}

@keyframes toast-in {
    from { opacity: 0; transform: translateY(-16px) scale(0.92); filter: blur(6px); }
    to { opacity: 1; transform: none; filter: none; }
}

@keyframes toast-out {
    to { opacity: 0; transform: translateY(-10px) scale(0.96); filter: blur(4px); }
}

/* ─── Modals / sheets ──────────────────────────────────────────── */

.overlay,
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.5);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    backdrop-filter: blur(14px) saturate(140%);
    opacity: 0;
    pointer-events: none;
    transition: opacity .35s var(--ease);
}

.overlay.active,
.overlay.show,
.overlay.open,
.overlay.visible,
.modal-overlay.active,
.modal-overlay.show,
.modal-overlay.open { opacity: 1; pointer-events: auto; }

.modal,
.sheet {
    position: relative;
    width: 100%;
    max-width: 440px;
    max-height: calc(100dvh - 40px);
    overflow: auto;
    padding: 26px;
    border-radius: var(--r-xl);
    background: var(--glass-bg-strong);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    backdrop-filter: blur(40px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 40px 80px -20px rgba(0, 0, 0, 0.8);
    transform: translateY(12px) scale(0.965);
    opacity: 0;
    transition: transform .5s var(--ease-spring), opacity .3s var(--ease);
}

.overlay.active .modal,
.overlay.show .modal,
.overlay.open .modal,
.overlay.visible .modal,
.modal-overlay.active .modal,
.modal-overlay.show .modal,
.modal-overlay.open .modal,
.overlay.active .sheet,
.modal-overlay.active .sheet { transform: none; opacity: 1; }

.modal-title,
.modal h2 {
    font-size: 19px;
    font-weight: 650;
    letter-spacing: -0.02em;
    margin-bottom: 18px;
    color: var(--text);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 22px;
}

/* Отложенная подсказка [data-tooltip] (icons.js) */
.ss-tip {
    position: fixed;
    z-index: 2000010;
    max-width: 260px;
    padding: 7px 11px;
    border-radius: 10px;
    background: var(--glass-bg-strong);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 12px 28px -10px rgba(0, 0, 0, 0.75);
    color: var(--text);
    font-size: 12.5px;
    font-weight: 500;
    line-height: 1.4;
    pointer-events: none;
    opacity: 0;
    transform: translateY(4px) scale(0.97);
    transition: opacity .18s var(--ease), transform .3s var(--ease-spring);
}

.ss-tip.below { transform: translateY(-4px) scale(0.97); }
.ss-tip.show { opacity: 1; transform: none; }

/* Диалоги Dialog.confirm / Dialog.form (icons.js) — поверх всего, включая окна чата */
.overlay.ss-dialog { z-index: 2000005; }
.ss-dialog-box { max-width: 420px; }
.ss-dialog-box h2 { margin-bottom: 8px; }
.ss-dialog-box .field:first-of-type { margin-top: 18px; }
.ss-dialog-text { font-size: 14px; line-height: 1.5; color: var(--text-2); }

.ss-dialog-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin-bottom: 16px;
    border-radius: 14px;
    color: var(--accent);
    background: var(--accent-a10);
    border: 1px solid rgba(255, 255, 255, 0.17);
}

.ss-dialog-icon.danger { color: #ff6961; background: var(--red-a); border-color: rgba(255, 69, 58, 0.22); }
.ss-dialog-err { min-height: 18px; margin-top: 2px; font-size: 12.5px; color: #ff6961; }
.ss-dialog-box .field + .ss-dialog-err { margin-top: -8px; }
.ss-dialog-box .ss-dialog-text + .ss-dialog-err { min-height: 0; }

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
}

/* Окно новости, всплывает по центру на любой вкладке (navbar.js) */
.news-modal { max-width: 480px; }
.news-modal .ss-dialog-icon { margin-bottom: 14px; }
.news-modal .news-popup-meta {
    margin-bottom: 8px;
    font-size: 12.5px;
    color: var(--text-3);
    font-variant-numeric: tabular-nums;
}
.news-modal .news-popup-title {
    margin: 0 36px 14px 0;
    font-size: 20px;
    line-height: 1.3;
    overflow-wrap: anywhere;
}
.news-modal .news-popup-img {
    display: block;
    width: 100%;
    max-height: 40vh;
    margin: 0 0 14px;
    object-fit: contain;
    background: var(--bg-inset);
    border: 1px solid var(--line);
    border-radius: var(--r);
}
.news-modal .news-popup-body {
    margin: 0;
    max-height: 40vh;
    overflow-y: auto;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-2);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
.news-modal .news-popup-check {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 18px;
    font-size: 13px;
    color: var(--text-2);
    cursor: pointer;
    user-select: none;
}
.news-modal .news-popup-check input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); cursor: pointer; }

/* ─── Motion ───────────────────────────────────────────────────── */

@keyframes rise {
    from { opacity: 0; transform: translateY(10px); filter: blur(4px); }
    to { opacity: 1; transform: none; filter: none; }
}

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.rise { animation: rise .6s var(--ease) both; }

.page-head { animation: rise .6s var(--ease) both; }
.toolbar { animation: rise .6s var(--ease) .05s both; }

.stagger > * { animation: rise .55s var(--ease) both; }
.stagger > *:nth-child(1) { animation-delay: .02s; }
.stagger > *:nth-child(2) { animation-delay: .05s; }
.stagger > *:nth-child(3) { animation-delay: .08s; }
.stagger > *:nth-child(4) { animation-delay: .11s; }
.stagger > *:nth-child(5) { animation-delay: .14s; }
.stagger > *:nth-child(6) { animation-delay: .17s; }
.stagger > *:nth-child(7) { animation-delay: .20s; }
.stagger > *:nth-child(8) { animation-delay: .23s; }
.stagger > *:nth-child(n+9) { animation-delay: .26s; }

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
    }
}

/* ═══ Navigation — floating glass pill ═══════════════════════════ */

.nav-pill {
    position: fixed;
    z-index: 100;
    left: var(--nav-gap);
    top: var(--nav-gap);
    bottom: var(--nav-gap);
    width: var(--nav-w);
    border-radius: 32px;
    background: linear-gradient(180deg, rgba(26, 26, 26, 0.74) 0%, rgba(18, 18, 18, 0.72) 100%);
    -webkit-backdrop-filter: blur(28px) saturate(160%);
    backdrop-filter: blur(28px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.07),
        0 24px 60px -18px rgba(0, 0, 0, 0.75),
        0 4px 14px rgba(0, 0, 0, 0.3);
    animation: nav-in .8s var(--ease-spring) both;
    transition: width .5s var(--ease-spring);
}

/* Первый кадр после загрузки — без анимации ширины, меню сразу в сохранённом виде */
html.nav-static body.has-nav,
html.nav-static .nav-pill,
html.nav-static .nav-btn,
html.nav-static .nav-label,
html.nav-static .nav-badge,
html.nav-static .nav-indicator,
html.nav-static .nav-toggle .chev,
html.nav-static .nav-grip { transition: none; }

/* Блик по контуру у навигации приглушён — она не должна спорить с контентом */
.nav-pill::after { opacity: .45; }

/* При переходе между страницами меню остаётся на месте, без повторного появления */
.nav-pill.no-enter { animation: none; }

@keyframes nav-in {
    from { opacity: 0; transform: translateX(-24px) scale(0.98); filter: blur(6px); }
    to { opacity: 1; transform: none; filter: none; }
}

@keyframes nav-in-m {
    from { opacity: 0; transform: translate(-50%, 24px) scale(0.96); filter: blur(6px); }
    to { opacity: 1; transform: translate(-50%, 0); filter: none; }
}

.nav-track {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    height: 100%;
    padding: 9px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
}

.nav-track::-webkit-scrollbar { display: none; }


/* Liquid metal (libraries.dev): редкий блик по металлической поверхности */
@keyframes metal-sheen {
    0%, 70% { background-position: 150% 0, 0 0; }
    100% { background-position: -50% 0, 0 0; }
}

.nav-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

/* Логотип над пунктами: в свёрнутом меню — знак, при развороте он сменяется широким логотипом */
.nav-brand {
    position: relative;
    z-index: 1;
    flex-shrink: 0;
    width: 46px;
    height: 46px;
    margin-bottom: 4px;
    text-decoration: none;
    user-select: none;
    transition: width .5s var(--ease-spring);
}

.nav-brand:hover { opacity: .85; }

.nav-brand-img {
    position: absolute;
    top: 50%;
    transition: opacity .3s var(--ease);
}

.nav-brand-mark {
    left: 50%;
    width: 44px;
    height: 44px;
    margin: -22px 0 0 -22px;
}

.nav-brand-wide {
    left: 13px;
    height: 40px;
    width: auto;
    margin-top: -20px;
    opacity: 0;
}

html.nav-expanded .nav-brand-mark { opacity: 0; }
html.nav-expanded .nav-brand-wide { opacity: 1; }

html.nav-static .nav-brand,
html.nav-static .nav-brand-img { transition: none; }

/* Основные пункты сверху, служебные (пароль, выход) прижаты к низу */
.nav-group.sidebar-nav { flex: 1; }

.nav-sep { display: none; }

.nav-btn {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border: 0;
    border-radius: 22px;
    background: transparent;
    color: rgba(255, 255, 255, 0.46);
    cursor: pointer;
    transition: color .25s var(--ease), background .25s var(--ease), width .5s var(--ease-spring), padding .5s var(--ease-spring);
}

.nav-btn > .i,
.nav-btn > .nav-lang-code { flex-shrink: 0; }

/* Подпись пункта: видна только в развёрнутом меню */
.nav-label {
    max-width: 0;
    overflow: hidden;
    opacity: 0;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 13.5px;
    font-weight: 550;
    letter-spacing: -0.01em;
    transition: opacity .2s var(--ease), max-width .5s var(--ease-spring), margin .5s var(--ease-spring);
}

.nav-btn .i { width: 20px; height: 20px; transition: transform .35s var(--ease-spring), color .25s var(--ease); }
.nav-btn:hover { color: rgba(255, 255, 255, 0.92); }
.nav-btn:not(.active):hover { background: rgba(255, 255, 255, 0.06); }
.nav-btn:active .i { transform: scale(0.86); }
.nav-btn.active { color: var(--text); cursor: default; }
.nav-btn.active.is-parent { cursor: pointer; }

/* Кнопка языка в навигации: код текущего языка вместо иконки */
.nav-lang-code { font-size: 12px; font-weight: 700; letter-spacing: 0.04em; line-height: 1; }
.nav-btn.active .i { color: var(--accent-hi); }

/* Капля-индикатор: стекло, которое «перетекает» между пунктами */
.nav-indicator {
    position: absolute;
    z-index: 0;
    top: 0;
    left: 0;
    width: 44px;
    height: 44px;
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.11) 0%, rgba(255, 255, 255, 0.04) 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.18),
        inset 0 -1px 1px rgba(255, 255, 255, 0.05),
        0 4px 14px rgba(0, 0, 0, 0.35);
    opacity: 0;
    pointer-events: none;
    transition: transform .6s var(--ease-spring), opacity .3s var(--ease), width .5s var(--ease-spring);
}

.nav-indicator.ready { opacity: 1; }
.nav-indicator.instant { transition: opacity .3s var(--ease); }

.nav-indicator::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(circle at 50% 120%, rgba(255, 255, 255, 0.255), transparent 65%);
    transition: opacity .3s var(--ease);
}


.nav-badge {
    position: absolute;
    top: 4px;
    right: 2px;
    display: none;
    align-items: center;
    justify-content: center;
    min-width: 17px;
    height: 17px;
    padding: 0 5px;
    border-radius: var(--r-pill);
    background: var(--red);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    box-shadow: 0 0 0 2px #1e1e1e;
    transition: top .5s var(--ease-spring), right .5s var(--ease-spring);
}

/* Подпрыгивает только при изменении числа (класс ставит navbar.js) */
.nav-badge.pop { animation: badge-pop .5s var(--ease-bounce) both; }

.nav-badge.gold { background: var(--accent); color: var(--accent-ink); }

@keyframes badge-pop { from { transform: scale(0); } to { transform: scale(1); } }

/* «Язычок» на правой кромке меню: в покое его нет, при наведении выезжает мягкой волной со стрелкой.
   Сама кнопка — невидимая зона наведения, её левый край совпадает с кромкой пилюли. */
.nav-toggle {
    position: absolute;
    z-index: 2;
    top: 50%;
    left: 100%;
    width: 22px;
    height: 120px;
    margin-top: -60px;
    padding: 0;
    border: 0;
    background: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.nav-wave,
.nav-toggle .chev {
    transform-origin: left center;
    transition: opacity .2s var(--ease), transform .4s var(--ease-spring);
}

.nav-wave,
.nav-toggle .chev { opacity: 0; transform: scaleX(0); }

.nav-wave { position: absolute; top: 24px; left: 0; width: 14px; height: 72px; overflow: visible; }
.nav-wave .fill { fill: #151515; }
.nav-wave .edge { fill: none; stroke: rgba(255, 255, 255, 0.14); stroke-width: 1; transition: stroke .25s var(--ease); }

.nav-toggle .chev {
    position: absolute;
    top: 50%;
    left: 1px;
    width: 10px;
    height: 10px;
    margin-top: -5px;
}

/* Ручка-подсказка внутри пилюли у кромки: показывает, где выезжает волна, сама наружу не выходит */
.nav-grip {
    position: absolute;
    top: 50%;
    left: -6px;
    width: 3px;
    height: 28px;
    margin-top: -14px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.14);
    transition: opacity .2s var(--ease), background .25s var(--ease), transform .35s var(--ease-spring);
}

.nav-pill:hover .nav-grip { background: rgba(255, 255, 255, 0.26); }
.nav-toggle:hover .nav-grip,
.nav-toggle:focus-visible .nav-grip { opacity: 0; transform: scaleY(0.6); }

.nav-toggle:hover .nav-wave,
.nav-toggle:focus-visible .nav-wave { opacity: 1; transform: none; }
.nav-toggle:hover .chev,
.nav-toggle:focus-visible .chev { opacity: 1; transform: none; transition-delay: .06s; }
.nav-toggle:hover { color: rgba(255, 255, 255, 0.8); }
.nav-toggle:focus-visible { outline: none; color: var(--text); }
html.nav-expanded .nav-toggle:hover .chev,
html.nav-expanded .nav-toggle:focus-visible .chev { transform: rotate(180deg); }

@media (min-width: 601px) {
    html.nav-expanded .nav-group { align-self: stretch; align-items: stretch; }
    html.nav-expanded .nav-brand { width: 100%; align-self: stretch; }
    html.nav-expanded .nav-btn { width: 100%; justify-content: flex-start; padding: 0 12px; }
    html.nav-expanded .nav-btn > .nav-lang-code { width: 20px; text-align: center; }
    html.nav-expanded .nav-label { max-width: 160px; margin-left: 12px; opacity: 1; transition-delay: 0s, 0s, 0s; }
    html.nav-expanded .nav-indicator { width: calc(100% - 18px); }
    html.nav-expanded .nav-badge { top: 13px; right: 12px; }
}

/* Тултип справа от пилюли */
.nav-tip {
    position: fixed;
    z-index: 200;
    left: 0;
    top: 0;
    height: 30px;
    padding: 0 12px;
    display: flex;
    align-items: center;
    border-radius: var(--r-pill);
    background: var(--glass-bg-strong);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 8px 24px -8px rgba(0, 0, 0, 0.7);
    color: var(--text);
    font-size: 12.5px;
    font-weight: 550;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transform: translateX(-6px) scale(0.96);
    transform-origin: left center;
    transition: opacity .2s var(--ease), transform .35s var(--ease-spring);
}

.nav-tip.show { opacity: 1; transform: none; }

/* Тост о запросе спикера */
.spk-toast {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 9998;
    width: 340px;
    max-width: calc(100vw - 32px);
    padding: 16px 18px;
    border-radius: var(--r-lg);
    background: var(--glass-bg-strong);
    -webkit-backdrop-filter: blur(36px) saturate(180%);
    backdrop-filter: blur(36px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 30px 60px -20px rgba(0, 0, 0, 0.8);
    display: none;
}

.spk-toast.show { display: block; animation: spk-in .6s var(--ease-spring) both; }

@keyframes spk-in {
    from { opacity: 0; transform: translateY(20px) scale(0.95); filter: blur(6px); }
    to { opacity: 1; transform: none; filter: none; }
}

.spk-title { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 650; margin-bottom: 6px; }
.spk-title .i { color: var(--accent); width: 18px; height: 18px; }
.spk-text { font-size: 13px; line-height: 1.5; color: var(--text-2); margin-bottom: 14px; }
.spk-text b { color: var(--text); font-weight: 600; }
.spk-count { color: var(--accent); font-weight: 600; }
.spk-actions { display: flex; justify-content: flex-end; gap: 8px; }

.navpw-err { color: #ff6961; font-size: 12.5px; min-height: 18px; margin-top: 2px; }

/* ─── Responsive ───────────────────────────────────────────────── */

@media (max-width: 900px) {
    .main { padding: 28px 20px 48px 0; }
}

@media (max-width: 600px) {
    body.has-nav {
        padding-left: 0;
        padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
    }

    .main { padding: 20px 16px 24px; }
    .page-title { font-size: 26px; }
    .page-head { margin-bottom: 18px; }
    .page-actions { width: 100%; }
    .toolbar > .search { flex-basis: 100%; }
    .toolbar > .segmented { width: 100%; }

    .toast-container { top: max(12px, env(safe-area-inset-top)); }

    .modal,
    .sheet { padding: 22px; border-radius: 26px; }

    .nav-pill {
        top: auto;
        left: 50%;
        bottom: calc(12px + env(safe-area-inset-bottom, 0px));
        transform: translateX(-50%);
        width: auto;
        max-width: calc(100vw - 24px);
        border-radius: 30px;
        animation-name: nav-in-m;
    }

    .nav-track {
        flex-direction: row;
        height: auto;
        padding: 7px;
        overflow-x: auto;
        overflow-y: hidden;
    }

    .nav-group { flex-direction: row; }
    .nav-group.sidebar-nav { flex: none; }
    .nav-sep { display: block; flex-shrink: 0; width: 1px; height: 22px; margin: 0 4px; background: rgba(255, 255, 255, 0.1); }
    .nav-tip { display: none; }
    .nav-toggle { display: none; }
    .nav-brand { display: none; }

    .spk-toast {
        right: 16px;
        left: 16px;
        width: auto;
        bottom: calc(92px + env(safe-area-inset-bottom, 0px));
    }
}
