/* InfoThreat — фирменный стиль (тёмная тема по умолчанию + светлая).
   Палитра/типографика по бренд-примеру: акцент #FF6A1A, Unbounded (заголовки),
   Manrope (текст), JetBrains Mono (метки/код). Имена классов и переменных
   сохранены — их читают stats.js/checker.js через itCssVar(). */

/* ---------- Шрифты (self-hosted, /assets/fonts) ---------- */
@font-face { font-family: 'Unbounded'; font-weight: 700; font-style: normal; font-display: swap;
  src: url('/assets/fonts/unbounded-latin-700.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Unbounded'; font-weight: 700; font-style: normal; font-display: swap;
  src: url('/assets/fonts/unbounded-cyr-700.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }

@font-face { font-family: 'Manrope'; font-weight: 400; font-style: normal; font-display: swap;
  src: url('/assets/fonts/manrope-latin-400.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Manrope'; font-weight: 400; font-style: normal; font-display: swap;
  src: url('/assets/fonts/manrope-cyr-400.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Manrope'; font-weight: 500; font-style: normal; font-display: swap;
  src: url('/assets/fonts/manrope-latin-500.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Manrope'; font-weight: 500; font-style: normal; font-display: swap;
  src: url('/assets/fonts/manrope-cyr-500.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Manrope'; font-weight: 600; font-style: normal; font-display: swap;
  src: url('/assets/fonts/manrope-latin-600.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Manrope'; font-weight: 600; font-style: normal; font-display: swap;
  src: url('/assets/fonts/manrope-cyr-600.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Manrope'; font-weight: 700; font-style: normal; font-display: swap;
  src: url('/assets/fonts/manrope-latin-700.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Manrope'; font-weight: 700; font-style: normal; font-display: swap;
  src: url('/assets/fonts/manrope-cyr-700.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Manrope'; font-weight: 800; font-style: normal; font-display: swap;
  src: url('/assets/fonts/manrope-latin-800.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Manrope'; font-weight: 800; font-style: normal; font-display: swap;
  src: url('/assets/fonts/manrope-cyr-800.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }

@font-face { font-family: 'JetBrains Mono'; font-weight: 600; font-style: normal; font-display: swap;
  src: url('/assets/fonts/jbmono-latin-600.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'JetBrains Mono'; font-weight: 600; font-style: normal; font-display: swap;
  src: url('/assets/fonts/jbmono-cyr-600.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }

/* ---------- Токены. Тёмная тема — по умолчанию ---------- */
:root {
    --bg: #0E0E11;
    --bg-2: #0b0b0e;
    --surface: #15151A;
    --surface-2: #101014;
    --card: #16161B;
    --text: #F4F3F1;
    --muted: #A6A6AF;
    --muted-2: #9A9AA3;
    --faint: #86868F;
    --border: rgba(255,255,255,.09);
    --hair: rgba(255,255,255,.06);
    --chip: rgba(255,255,255,.04);
    --chip-hover: rgba(255,255,255,.08);
    --header-bg: rgba(14,14,17,.72);
    --accent: #FF6A1A;
    --accent-2: #FF8A45;
    --accent-deep: #C2470A;
    --accent-soft: rgba(255,106,26,.13);
    --accent-contrast: #0b0b0d;
    --neg: #FF5A49;
    --neg-soft: rgba(255,90,73,.13);
    --neu: #3FCF8E;
    --neu-soft: rgba(63,207,142,.13);
    --warn: #FFB224;
    --warn-soft: rgba(255,178,36,.13);
    --shadow: 0 1px 2px rgba(0,0,0,.35), 0 14px 40px -24px rgba(0,0,0,.7);
    --radius: 12px;
    --radius-s: 9px;
    --scroll-thumb: rgba(255,255,255,.16);
    --scroll-thumb-hover: rgba(255,255,255,.30);
    --font-body: 'Manrope', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-display: 'Unbounded', 'Manrope', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}
[data-theme="light"] {
    --bg: #F3F3F1;
    --bg-2: #EAEAE6;
    --surface: #FFFFFF;
    --surface-2: #F6F6F3;
    --card: #FFFFFF;
    --text: #19191C;
    --muted: #55555E;
    --muted-2: #5E5E68;
    --faint: #74747d;
    --border: rgba(0,0,0,.11);
    --hair: rgba(0,0,0,.07);
    --chip: rgba(0,0,0,.045);
    --chip-hover: rgba(0,0,0,.08);
    --header-bg: rgba(243,243,241,.78);
    --accent: #E85D0F;
    --accent-2: #C2470A;
    --accent-deep: #C2470A;
    --accent-soft: rgba(232,93,15,.11);
    --accent-contrast: #ffffff;
    --neg: #D7331F;
    --neg-soft: rgba(215,51,31,.10);
    --neu: #1F9D62;
    --neu-soft: rgba(31,157,98,.11);
    --warn: #B07515;
    --warn-soft: rgba(176,117,21,.12);
    --shadow: 0 1px 2px rgba(25,25,28,.05), 0 10px 30px -22px rgba(25,25,28,.25);
    --scroll-thumb: rgba(0,0,0,.22);
    --scroll-thumb-hover: rgba(0,0,0,.38);
}

/* ---------- Нативные виджеты и прокрутка под тему ---------- */
:root { color-scheme: dark; }
[data-theme="light"] { color-scheme: light; }

/* Firefox */
* { scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) transparent; }
/* WebKit (Chrome/Edge/Safari): окно и ВСЕ внутренние прокрутки — textarea, pre, таблицы, сайдбар */
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
    background: var(--scroll-thumb);
    border-radius: 8px;
    border: 2px solid transparent;
    background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover { background: var(--scroll-thumb-hover); background-clip: padding-box; border: 2px solid transparent; }
*::-webkit-scrollbar-corner { background: transparent; }
/* Код-блоки в светлой теме остаются тёмными — бегунок для них светлый */
[data-theme="light"] pre { scrollbar-color: rgba(255,255,255,.28) transparent; }
[data-theme="light"] pre::-webkit-scrollbar-thumb { background: rgba(255,255,255,.28); background-clip: padding-box; border: 2px solid transparent; }
[data-theme="light"] pre::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.45); }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    font-size: 14.5px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
::selection { background: rgba(255,106,26,.32); color: #fff; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); text-decoration: underline; }

h2 { font-family: var(--font-display); font-weight: 700; font-size: 21px; letter-spacing: -.01em; line-height: 1.25; }
h3 { font-weight: 700; letter-spacing: -.005em; }

/* ---------- Каркас ---------- */
.layout { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar {
    background: var(--surface-2);
    border-right: 1px solid var(--hair);
    padding: 18px 14px;
    position: sticky; top: 0;
    height: 100vh;
    overflow-y: auto;
    display: flex; flex-direction: column;
}
/* Бренд-блок */
.sidebar h1 { margin: 0 6px 20px; }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none !important; color: var(--text); }
.brand-tile {
    display: grid; place-items: center; flex: 0 0 auto;
    width: 40px; height: 40px;
}
.brand-name { display: flex; flex-direction: column; line-height: 1; }
.brand-name .n1 { font-family: var(--font-display); font-weight: 700; font-size: 14px; letter-spacing: -.01em; }
.brand-name .n2 { font-family: var(--font-mono); font-weight: 600; font-size: 8.5px; letter-spacing: .40em; color: var(--accent); margin-top: 4px; }

.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar nav a {
    display: flex; align-items: center; gap: 11px;
    padding: 9px 12px;
    border-radius: var(--radius-s);
    color: var(--muted);
    font-weight: 500;
    font-size: 14px;
    transition: background .15s ease, color .15s ease;
}
.sidebar nav a svg { flex: 0 0 auto; opacity: .8; }
.sidebar nav a:hover { background: var(--chip-hover); color: var(--text); text-decoration: none; }
.sidebar nav a.active {
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 700;
    position: relative;
}
.sidebar nav a.active::before {
    content: ""; position: absolute; left: 0; top: 9px; bottom: 9px; width: 3px;
    border-radius: 3px; background: var(--accent);
}
.nav-sep {
    margin: 16px 4px 6px; font-family: var(--font-mono); font-size: 9.5px; font-weight: 600;
    text-transform: uppercase; letter-spacing: .22em; color: var(--faint);
}

.content { padding: 0 32px 40px; max-width: 1240px; width: 100%; min-width: 0; }
.content h2 { margin-top: 26px; }

/* ---------- Топбар ---------- */
.topbar {
    display: flex; justify-content: space-between; align-items: center;
    gap: 16px; padding: 13px 0;
    position: sticky; top: 0; z-index: 40;
    background: var(--header-bg);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--hair);
    margin: 0 -32px 8px; padding-left: 32px; padding-right: 32px;
}
.topbar .user { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.topbar .project-context { margin-right: auto; display: flex; align-items: center; gap: 8px; }
.topbar .project-context select {
    width: auto; background: var(--chip); border: 1px solid var(--border);
    border-radius: var(--radius-s); font-size: 13px; padding: 6px 10px;
}
.menu-btn {
    display: none; width: 38px; height: 38px; border-radius: var(--radius-s);
    background: var(--chip); border: 1px solid var(--border); color: var(--text);
    cursor: pointer; align-items: center; justify-content: center; flex: 0 0 auto;
}
.nav-backdrop { display: none; }

/* ---------- Кнопки ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    padding: 8px 15px;
    border: 1px solid var(--border);
    background: var(--chip);
    color: var(--text);
    border-radius: var(--radius-s);
    cursor: pointer;
    font-size: 13.5px;
    font-weight: 600;
    font-family: var(--font-body);
    text-decoration: none;
    transition: background .15s ease, border-color .15s ease, transform .1s ease;
}
.btn:hover { background: var(--chip-hover); text-decoration: none; color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn-primary {
    background: var(--accent); color: var(--accent-contrast); border-color: transparent;
    font-weight: 800;
    box-shadow: 0 6px 20px -8px rgba(255,106,26,.55);
}
.btn-primary:hover { background: var(--accent-2); color: var(--accent-contrast); }
[data-theme="light"] .btn-primary:hover { background: var(--accent-deep); }
.btn-danger { color: var(--neg); border-color: var(--neg); background: transparent; }
.btn-danger:hover { background: var(--neg); color: #fff; }

/* ---------- Формы ---------- */
input[type="text"], input[type="password"], input[type="number"], input[type="url"], input[type="search"], select, textarea {
    width: 100%;
    padding: 9px 13px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    border-radius: var(--radius-s);
    font-size: 14px;
    font-family: inherit;
    transition: border-color .15s ease, box-shadow .15s ease;
}
input[type="search"] { -webkit-appearance: none; appearance: none; }
textarea { font-family: var(--font-mono); font-weight: 600; font-size: 12.5px; line-height: 1.6; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
input[type="checkbox"] { accent-color: var(--accent); width: 15px; height: 15px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

label { display: block; margin-bottom: 5px; font-weight: 600; color: var(--text); font-size: 13.5px; }
.field { margin-bottom: 16px; }
.field .hint { color: var(--muted); font-size: 12px; margin-top: 4px; font-weight: 400; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ---------- Карточки ---------- */
.card {
    background: linear-gradient(180deg, var(--card), var(--surface-2));
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 22px;
    box-shadow: var(--shadow);
    margin-bottom: 16px;
}
.card > h3:first-child, .card h3[style*="margin-top:0"] { font-size: 15.5px; }

/* ---------- Бейджи (семантика: не акцент) ---------- */
.badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 10px; border-radius: 999px;
    font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: .02em;
}
.badge-neg  { background: var(--neg-soft);  color: var(--neg);  border: 1px solid var(--neg); }
.badge-neu  { background: var(--neu-soft);  color: var(--neu);  border: 1px solid var(--neu); }
.badge-strong { background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent); }
.badge-medium { background: var(--warn-soft); color: var(--warn); border: 1px solid var(--warn); }
.badge-weak { background: var(--chip); color: var(--muted); border: 1px solid var(--border); }
.badge-ok   { background: var(--neu-soft);  color: var(--neu);  border: 1px solid var(--neu); }
.badge-bad  { background: var(--neg-soft);  color: var(--neg);  border: 1px solid var(--neg); }

/* ---------- Уведомления ---------- */
.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; font-size: 14px; }
.alert-error   { background: var(--neg-soft);  color: var(--neg);  border: 1px solid var(--neg); }
.alert-success { background: var(--neu-soft);  color: var(--neu);  border: 1px solid var(--neu); }
.alert-info    { background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent); }

/* ---------- Таблицы ---------- */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--hair); }
th {
    font-family: var(--font-mono); font-weight: 600; color: var(--faint);
    font-size: 10.5px; text-transform: uppercase; letter-spacing: .14em;
}
td { font-size: 13.5px; }
tr:hover td { background: var(--chip); }
td .muted, td.muted { font-variant-numeric: tabular-nums; }

code, kbd {
    font-family: var(--font-mono); font-weight: 600; background: var(--chip);
    border: 1px solid var(--hair);
    padding: 2px 7px; border-radius: 6px; font-size: 12px;
}

/* ---------- Переключатель темы ---------- */
.theme-toggle {
    cursor: pointer;
    background: var(--chip);
    border: 1px solid var(--border);
    border-radius: var(--radius-s);
    width: 38px; height: 38px;
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--text);
    transition: background .15s ease;
    flex: 0 0 auto;
}
.theme-toggle:hover { background: var(--chip-hover); }

/* ---------- Вход ---------- */
.login-page {
    display: flex; min-height: 100vh; align-items: center; justify-content: center;
    padding: 20px;
    background:
        radial-gradient(52% 42% at 50% -6%, var(--accent-soft), transparent 70%),
        var(--bg);
}
.login-card { max-width: 392px; width: 100%; padding: 30px 28px; }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }

/* ---------- Метрики ---------- */
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 24px; }
.metric {
    background: linear-gradient(180deg, var(--card), var(--surface-2));
    border: 1px solid var(--border); border-radius: 14px; padding: 16px 17px;
}
.metric .label {
    font-family: var(--font-mono); color: var(--faint); font-size: 10px; font-weight: 600;
    text-transform: uppercase; letter-spacing: .14em;
}
.metric .value {
    font-family: var(--font-display); font-size: 26px; font-weight: 700; margin-top: 7px;
    letter-spacing: -.02em; font-variant-numeric: tabular-nums;
}

/* ---------- Графики ---------- */
.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 900px) { .chart-grid { grid-template-columns: 1fr; } }
.chart-wrap { position: relative; height: 280px; }

/* ---------- Ручная проверка ---------- */
.vote-pill {
    display: inline-block; padding: 3px 10px; border-radius: 999px;
    font-family: var(--font-mono); font-size: 11px; font-weight: 600; margin: 0 4px 4px 0;
}
.vote-pill.neg { background: var(--neg); color: #fff; }
.vote-pill.neu { background: var(--neu); color: #0b0b0d; }

.result-display { text-align: center; padding: 34px 16px; border-radius: 16px; margin-bottom: 16px; border: 1px solid var(--hair); }
.result-display.negative { background: var(--neg-soft); border-color: var(--neg); }
.result-display.neutral  { background: var(--neu-soft); border-color: var(--neu); }
.result-display .label { font-family: var(--font-display); font-size: 32px; font-weight: 700; letter-spacing: .02em; }
.result-display.negative .label { color: var(--neg); }
.result-display.neutral .label { color: var(--neu); }

pre {
    background: var(--bg-2);
    border: 1px solid var(--hair);
    border-radius: var(--radius);
    padding: 14px 16px;
    overflow-x: auto;
    font-family: var(--font-mono); font-weight: 600;
    font-size: 12.5px;
    line-height: 1.6;
}
[data-theme="light"] pre { background: #17171A; color: #E8E8E4; border-color: transparent; }
pre code { background: transparent; border: none; padding: 0; font-size: inherit; }

/* ---------- Вкладки ---------- */
.docs-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin: 16px 0 0; border-bottom: 1px solid var(--hair); }
.docs-tabs button {
    background: transparent; border: none; padding: 9px 14px;
    color: var(--muted); cursor: pointer; font-size: 13.5px; font-weight: 600;
    font-family: var(--font-body);
    border-bottom: 2px solid transparent; margin-bottom: -1px;
    transition: color .15s ease;
}
.docs-tabs button:hover { color: var(--text); }
.docs-tabs button.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 700; }
.docs-pane { display: none; margin-top: 0; }
.docs-pane.active { display: block; }
.docs-pane pre { border-top-left-radius: 0; border-top-right-radius: 0; }

.muted { color: var(--muted); }
.spinner { display: inline-block; width: 15px; height: 15px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Справочники ---------- */
.ref-filter { max-width: 380px; }
.docs-pane[data-pane] table { margin-top: 4px; }
.docs-pane td { vertical-align: top; }
.dict-syn { color: var(--muted); word-break: break-word; font-size: 13px; }
mark.hl { background: var(--warn-soft); color: var(--warn); border-radius: 3px; padding: 0 1px; }

/* Чипы категорий (раздел «Ручная проверка») */
.cat-chip {
    display: inline-block; padding: 4px 12px; margin: 0 6px 6px 0; border-radius: 999px;
    font-size: 13px; font-weight: 600; border: 1px solid var(--border); background: var(--chip);
}
.cat-chip-on { background: var(--accent); color: var(--accent-contrast); border-color: transparent; font-weight: 700; }
.cat-chip-cand { background: transparent; color: var(--muted); border-style: dashed; cursor: help; }
.cat-chip-empty { background: transparent; color: var(--muted); border-style: dashed; }

/* Синонимы гео-тегов — редактируемые чипы */
.geo-aliases { line-height: 2.1; }
.geo-aliases.busy { opacity: .55; pointer-events: none; }
.alias-chip {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 5px 3px 11px; margin: 0 6px 5px 0; border-radius: 999px;
    font-size: 12.5px; font-weight: 600; border: 1px solid var(--border); background: var(--chip);
}
.alias-chip .chip-x { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 15px; line-height: 1; padding: 0 4px; border-radius: 8px; }
.alias-chip .chip-x:hover { color: #fff; background: var(--neg); }
.alias-input {
    width: 140px; padding: 4px 11px; border: 1px dashed var(--border); border-radius: 999px;
    background: transparent; color: inherit; font-size: 12.5px;
}
.alias-input:focus { border-style: solid; border-color: var(--accent); outline: none; box-shadow: none; }
.alias-empty { color: var(--muted); }
.alias-chip.shared { border-style: dashed; opacity: .85; }
.alias-chip.shared::before { content: "∗"; margin-right: 2px; color: var(--accent); }
.custom-list { line-height: 2.3; margin: 4px 0; }
.custom-item .ci-toggle { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.custom-item.off { opacity: .5; }
.custom-item .ci-syn { font-size: 12px; }
#kw-table td:first-child, #geo-table td:first-child { text-align: center; }
.base-toggle, .custom-toggle { cursor: pointer; }

.topbar .project-context { margin-right: auto; }
.settings-scope-note { font-size: 12px; color: var(--muted); margin: -6px 0 10px; }

/* Статус синхронизации — инлайновый бейдж */
#sync-status, #sync-test-status { display: inline-flex; align-items: center; gap: 6px; }
#sync-status.alert-success, #sync-status.alert-error,
#sync-test-status.alert-success, #sync-test-status.alert-error { margin: 0; padding: 4px 10px; }

/* ---------- Модальное окно ---------- */
.modal-backdrop {
    position: fixed; inset: 0; z-index: 90;
    background: rgba(0,0,0,.55);
    backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
    display: none; align-items: flex-start; justify-content: center;
    padding: 6vh 16px 16px; overflow-y: auto;
}
.modal-backdrop.open { display: flex; }
.modal {
    width: 100%; max-width: 640px;
    background: linear-gradient(180deg, var(--card), var(--surface-2));
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: 0 40px 100px -30px rgba(0,0,0,.8);
    animation: modalIn .18s ease;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(.99); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .modal { animation: none; } }
.modal-head {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 18px 22px; border-bottom: 1px solid var(--hair);
}
.modal-head h3 { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 16px; letter-spacing: -.01em; }
.modal-close {
    width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--border);
    background: var(--chip); color: var(--muted); cursor: pointer; font-size: 17px; line-height: 1;
    display: grid; place-items: center; flex: 0 0 auto;
}
.modal-close:hover { background: var(--chip-hover); color: var(--text); }
.modal-body { padding: 20px 22px; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 16px 22px; border-top: 1px solid var(--hair); }
.perm-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.perm-chips .cat-chip { cursor: pointer; display: inline-flex; align-items: center; gap: 7px; margin: 0; }

/* ---------- Мобильная навигация ---------- */
@media (max-width: 920px) {
    .layout { grid-template-columns: 1fr; }
    .sidebar {
        position: fixed; z-index: 80; left: 0; top: 0; bottom: 0;
        width: 264px; height: 100vh;
        transform: translateX(-105%);
        transition: transform .22s ease;
        box-shadow: 0 0 60px rgba(0,0,0,.5);
    }
    body.nav-open .sidebar { transform: translateX(0); }
    .nav-backdrop {
        display: block; position: fixed; inset: 0; z-index: 70;
        background: rgba(0,0,0,.5); backdrop-filter: blur(2px);
        opacity: 0; pointer-events: none; transition: opacity .22s ease;
    }
    body.nav-open .nav-backdrop { opacity: 1; pointer-events: auto; }
    .menu-btn { display: inline-flex; }
    .content { padding: 0 16px 32px; }
    .topbar { margin: 0 -16px 8px; padding-left: 16px; padding-right: 16px; flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
    .sidebar, .nav-backdrop, .btn { transition: none; }
}
