/* ═══════════════════════════════════════════════════════════════════════════
   Представитель бренда. Дизайн-система.
   Один шрифт, токены в :root, три уровня поверхностей, одна система кнопок.
   Вид: мягкий объём. Поверхности приподняты тенью и бликом сверху, поля и дорожки
   вдавлены, кнопки с нижней гранью, которая при нажатии проседает.
   Анимации: только transform и opacity (плюс цвет), сильные ease-out кривые, до 250 мс.
   ═══════════════════════════════════════════════════════════════════════════ */

@font-face {
  font-family: "Inter";
  src: url("/static/fonts/InterVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root, [data-theme="light"] {
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* Палитра владельца: сафран #F8C662 ведёт светлую тему, тёмно-фиолетовый #2C263F это чернила */
  --bg: #eae3d4;
  --surface: var(--look-light-surface, #f8f5ee);
  --surface-2: var(--look-light-surface-2, #efe9dc);
  --surface-3: var(--look-light-surface-3, #e2dac8);
  --border: #ddd5c3;
  --border-strong: #c6bba6;
  --text: #2c263f;
  --text-2: #5b547a;
  --text-3: #8b86a0;
  --accent: #f8c662;
  --accent-hover: #fbd27a;
  --accent-ink: #2c263f;
  --accent-text: #7f4f04;
  --accent-soft: #f8e9ca;
  --accent-soft-2: #f8e0af;
  --success: #2f6b3c;
  --success-soft: #dcebdd;
  --warn: #a4560a;
  --warn-soft: #f6e3c8;
  --danger: #b8322b;
  --danger-soft: #f3dbd8;
  --info: #595082;
  --info-soft: #e4e0ec;
  --overlay: rgba(44, 38, 63, 0.42);

  /* Объём: уровни тени, блик сверху, вдавленность, грани кнопок */
  --shadow-1: 0 1px 2px rgba(44, 38, 63, 0.06), 0 3px 10px rgba(44, 38, 63, 0.09);
  --shadow-2: 0 2px 4px rgba(44, 38, 63, 0.08), 0 10px 24px rgba(44, 38, 63, 0.14);
  --shadow-3: 0 4px 8px rgba(44, 38, 63, 0.10), 0 24px 56px rgba(44, 38, 63, 0.24);
  --shadow-pop: var(--shadow-2);
  --shadow-modal: var(--shadow-3);
  --hl: inset 0 1px 0 rgba(255, 255, 255, 0.85);
  --inset: inset 0 2px 4px rgba(44, 38, 63, 0.10), inset 0 1px 1px rgba(44, 38, 63, 0.06);
  /* Дорожка переключателя (строка периода, сегменты): темнее фона, тень сверху, тонкий контур по
     всему периметру и светлая кромка снизу, чтобы край не сливался с фоном (владелец 03.10.2026) */
  --sunk-bg: #ddd4bf;
  --sunk: inset 0 2px 4px rgba(44, 38, 63, 0.16), inset 0 1px 1px rgba(44, 38, 63, 0.10), inset 0 0 0 1px rgba(44, 38, 63, 0.12), 0 1px 0 rgba(255, 255, 255, 0.85);
  --shadow-rgb: 44, 38, 63;
  --hover-mix: 70%;
  /* Стекло: блик в верхней половине и затенение к низу дают выпуклость, как под линзой */
  --gloss: linear-gradient(180deg, rgba(255, 255, 255, 0.62) 0%, rgba(255, 255, 255, 0.18) 46%, rgba(255, 255, 255, 0) 54%, rgba(44, 38, 63, 0.05) 100%);
  --lens: inset 0 1px 0 rgba(255, 255, 255, 0.95), inset 0 -3px 6px rgba(44, 38, 63, 0.10), inset 0 0 0 1px rgba(255, 255, 255, 0.35);
  --glass-bg: 84%;
  --edge: #c6bba6;
  --edge-ghost: #d9d0bd;
  --edge-primary: #c48e22;
  --edge-danger: #d6aeaa;
  /* Кнопки: мягкая выпуклая плитка (образцы «Set of colorful/minimalist web buttons», 04.10.2026): светлая тень
     сверху слева, тёплая снизу справа; нажатая плитка вдавливается. Цветная иконка только у главного действия. */
  --btn-bg: linear-gradient(145deg, #fffefb 0%, #f1ebdf 100%);
  --btn-bg-hover: linear-gradient(145deg, #ffffff 0%, #f6f1e7 100%);
  --btn-shadow: -3px -3px 7px rgba(255, 255, 255, 0.95), 3px 4px 9px rgba(44, 38, 63, 0.17), inset 0 0 0 1px rgba(255, 255, 255, 0.6);
  --btn-shadow-hover: -4px -4px 9px #ffffff, 4px 6px 13px rgba(44, 38, 63, 0.20), inset 0 0 0 1px rgba(255, 255, 255, 0.7);
  --btn-shadow-quiet: -2px -2px 5px rgba(255, 255, 255, 0.9), 2px 3px 6px rgba(44, 38, 63, 0.14), inset 0 0 0 1px rgba(255, 255, 255, 0.5);
  --btn-press: inset 2px 2px 5px rgba(44, 38, 63, 0.22), inset -2px -2px 5px rgba(255, 255, 255, 0.85);
  --btn-icon-fx: none;
  /* переходы цвета для иконок главных действий: оба набора на :root (в тёмной не переопределяются), какой брать,
     решает --icon-grad по теме ближайшего предка, поэтому превью другой темы показывает свой */
  --icon-light-1: #e48a00;
  --icon-light-2: #d4452c;
  --icon-dark-1: #ffd166;
  --icon-dark-2: #ff7d52;
  --icon-grad: url(#g-accent-light) var(--accent-text);
  --ring: 0 0 0 3px var(--accent-soft-2);

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --d-press: 90ms;
  --d-fast: 160ms;
  --d-pop: 180ms;
  --d-drop: 220ms;  /* выпадание и сворачивание: меню, списки, раскрывающиеся блоки (одно движение везде) */
  --d-modal: 220ms;

  /* Радиусы (владелец 02.10.2026: вдвое меньше прежних). Только через эти токены, литералов нет. */
  --r-xs: 2px;
  --r-sm: 4px;
  --r-md: 6px;
  --r-lg: 8px;
  --r-xl: 10px;
  --r-ctl: var(--r-lg);     /* кнопки, поля, списки, пункты меню, сегменты, тосты */
  --r-ctl-sm: var(--r-md);  /* малые кнопки, поля и списки */
  --r-ctl-lg: var(--r-xl);  /* большие кнопки */
  --sidebar: 248px;
  --topbar: 56px;
  --z-sheet: 60;
  --z-modal: 80;
  --z-dropdown: 90;  /* меню и подсказки открываются и из боковой панели, и из модалки */
  --z-toast: 100;
}

[data-theme="dark"] {
  /* Палитра владельца: тёмно-зелёный #213722 ведёт тёмную тему, сафран остаётся акцентом */
  --bg: #213722;
  --surface: var(--look-dark-surface, #2b452e);
  --surface-2: var(--look-dark-surface-2, #253c27);
  --surface-3: var(--look-dark-surface-3, #365a3b);
  --border: #3c5c42;
  --border-strong: #587c5e;
  --text: #f2eee3;
  --text-2: #bfc8b6;
  --text-3: #8da08e;
  --accent: #f8c662;
  --accent-hover: #fbd27a;
  --accent-ink: #213722;
  --accent-text: #f8c662;
  --accent-soft: #45512f;
  --accent-soft-2: #63653a;
  --success: #8fd39a;
  --success-soft: #2e5236;
  --warn: #f0a75c;
  --warn-soft: #4b3b22;
  --danger: #f28b82;
  --danger-soft: #512c2a;
  --info: #bcb3ea;
  --info-soft: #3b3656;
  --overlay: rgba(8, 18, 9, 0.62);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.35), 0 3px 10px rgba(0, 0, 0, 0.30);
  --shadow-2: 0 2px 4px rgba(0, 0, 0, 0.35), 0 10px 24px rgba(0, 0, 0, 0.40);
  --shadow-3: 0 4px 8px rgba(0, 0, 0, 0.40), 0 24px 56px rgba(0, 0, 0, 0.55);
  --hl: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  --inset: inset 0 2px 5px rgba(0, 0, 0, 0.45), inset 0 1px 1px rgba(0, 0, 0, 0.30);
  --sunk-bg: #1a2d1c;
  --sunk: inset 0 2px 5px rgba(0, 0, 0, 0.50), inset 0 1px 1px rgba(0, 0, 0, 0.35), inset 0 0 0 1px rgba(0, 0, 0, 0.40), 0 1px 0 rgba(255, 255, 255, 0.08);
  --shadow-rgb: 0, 0, 0;
  --hover-mix: 82%;
  --gloss: linear-gradient(180deg, rgba(255, 255, 255, 0.20) 0%, rgba(255, 255, 255, 0.06) 46%, rgba(255, 255, 255, 0) 54%, rgba(0, 0, 0, 0.14) 100%);
  --lens: inset 0 1px 0 rgba(255, 255, 255, 0.16), inset 0 -3px 6px rgba(0, 0, 0, 0.32), inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  --glass-bg: 86%;
  --edge: #142315;
  --edge-ghost: #1a2d1b;
  --edge-primary: #9c7524;
  --edge-danger: #5a2f2c;
  /* Тёмная выпуклая плитка с длинной тенью по диагонали и выдавленной иконкой (образец «Dark circle icon», 04.10.2026) */
  --btn-bg: linear-gradient(145deg, #3e6142 0%, #28422b 100%);
  --btn-bg-hover: linear-gradient(145deg, #466c4a 0%, #2c4930 100%);
  --btn-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.11), inset -1px -1px 1px rgba(0, 0, 0, 0.30), 3px 4px 7px rgba(0, 0, 0, 0.42), 9px 12px 20px rgba(0, 0, 0, 0.24);
  --btn-shadow-hover: inset 1px 1px 0 rgba(255, 255, 255, 0.14), inset -1px -1px 1px rgba(0, 0, 0, 0.30), 4px 6px 9px rgba(0, 0, 0, 0.45), 12px 16px 26px rgba(0, 0, 0, 0.26);
  --btn-shadow-quiet: inset 1px 1px 0 rgba(255, 255, 255, 0.08), inset -1px -1px 1px rgba(0, 0, 0, 0.26), 2px 3px 5px rgba(0, 0, 0, 0.38), 6px 8px 14px rgba(0, 0, 0, 0.18);
  --btn-press: inset 2px 3px 6px rgba(0, 0, 0, 0.52), inset -1px -1px 0 rgba(255, 255, 255, 0.06);
  --btn-icon-fx: drop-shadow(1px 1.5px 1px rgba(0, 0, 0, 0.6)) drop-shadow(-0.5px -0.5px 0 rgba(255, 255, 255, 0.14));
  --icon-grad: url(#g-accent-dark) var(--accent-text);
  --ring: 0 0 0 3px var(--accent-soft-2);
}

/* ── База ─────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
* { font-family: var(--font) !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 22px; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
p { margin: 0; }
svg { display: block; }
::selection { background: var(--accent-soft-2); }
:focus-visible { outline: none; box-shadow: var(--ring); }
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: var(--r-sm); border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 1ms !important; animation-duration: 1ms !important; }
}

.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small { font-size: 12px; }
.strong { font-weight: 600; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.grid-fit { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(var(--card-basis, 160px), 100%), 1fr)); gap: 14px; }
@media (max-width: 860px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.mono-num { font-variant-numeric: tabular-nums; }

/* ── Каркас ──────────────────────────────────────────────────────────────── */
/* Фон страниц выбирается во вкладке «Оформление» (владелец 05.10.2026): сервер присылает блок стилей
   <style id="appearance"> с картинкой, вуалью и размытием каждой темы (--bg-light-*, --bg-dark-*). Картинки
   вертикальные повёрнуты для широкого экрана; узкий экран в портретной ориентации берёт вертикальный вариант.
   Вуаль: светлая умножает картинку на тёплый тон («блоки сливались»), тёмная притемняет. Слой стоит на месте
   при прокрутке (fixed-подложка вместо background-attachment, который телефоны не держат); размытие с запасом
   за краем экрана, иначе края светлеют. */
body::before {
  content: ""; position: fixed; inset: calc(var(--bg-blur, 0px) * -3); z-index: -1; pointer-events: none;
  background: linear-gradient(var(--bg-veil), var(--bg-veil)), var(--bg-img, none) center / cover no-repeat, var(--bg);
  background-blend-mode: var(--bg-blend), normal, normal;
  filter: blur(var(--bg-blur, 0px));
}
:root, [data-theme="light"] { --bg-img: var(--bg-light-wide, none); --bg-veil: var(--bg-light-veil, transparent); --bg-blur: var(--bg-light-blur, 0px); --bg-blend: multiply; --panel-alpha: var(--look-light-alpha, 0%); --panel-glass: var(--look-light-glass, none); }
[data-theme="dark"] { --bg-img: var(--bg-dark-wide, none); --bg-veil: var(--bg-dark-veil, transparent); --bg-blur: var(--bg-dark-blur, 0px); --bg-blend: normal; --panel-alpha: var(--look-dark-alpha, 0%); --panel-glass: var(--look-dark-glass, none); }
@media (orientation: portrait) and (max-width: 860px) {
  :root, [data-theme="light"] { --bg-img: var(--bg-light-tall, none); }
  [data-theme="dark"] { --bg-img: var(--bg-dark-tall, none); }
}
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow: auto; z-index: 31;
  background: var(--surface); box-shadow: 4px 0 18px rgba(44, 38, 63, 0.07), var(--hl);
  display: flex; flex-direction: column; padding: 12px;
}
[data-theme="dark"] .sidebar { box-shadow: 4px 0 18px rgba(0, 0, 0, 0.35), var(--hl); }
/* выбор бренда один, в левой колонке над меню (владелец 02.10.2026), на телефоне там же в выезжающем меню */
.sidebar .brandbox { padding: 8px 8px 20px; margin-bottom: 8px; }
/* В шапке проекта только логотип и название; нажатие открывает выбор бренда. */
.brand-select { display: block; width: 100%; }
.dd-menu.project-launcher-menu { min-width: 0; padding: 8px; margin: 0; border-radius: var(--r-menu); background-color: var(--sidebar-fill, var(--surface)); background-image: var(--panel-sheen); backdrop-filter: var(--panel-glass, none); box-shadow: var(--panel-shadow); }
:root[data-menu="glass"] .dd-menu.project-launcher-menu { background-color: color-mix(in srgb, var(--sidebar-fill) 82%, transparent); backdrop-filter: blur(12px); }
.serm-placeholder { min-height: 220px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 12px; text-align: center; }
.serm-placeholder h1 { font-size: 24px; }
.serm-placeholder p { color: var(--text-2); }
.brand-pick {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 4px; border: none; cursor: pointer; text-align: left; color: var(--text);
  background: transparent; box-shadow: none;
}
.brand-pick:hover, .brand-pick:active, .dd.open .brand-pick { background: transparent; box-shadow: none; transform: none; }
.brand-pick-name { min-width: 0; font-weight: 700; font-size: 14px; line-height: 1.25; }
.brand-pick .brand-tile { box-shadow: none; }
.brand-pick .brand-tile.has-logo { background: transparent; }
.brand-tile { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; overflow: hidden; border-radius: var(--r-md); background: var(--accent); color: var(--accent-ink); font-weight: 700; letter-spacing: 0.02em; box-shadow: var(--hl), var(--shadow-1); }
.brand-tile.has-logo { background: var(--surface); }
.brand-tile img { width: 100%; height: 100%; object-fit: contain; }
.brand-item { gap: 10px; }
/* Оформление бренда: образцы цвета и поле #rrggbb */
/* Оформление бренда одним рядом высотой с логотип (64): каждая колонка в два этажа по 28 с зазором 8 */
.brand-look { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.look-col { height: 64px; display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; }
/* готовые цвета, свой цвет и сброс одной сеткой в два ряда: последний столбец «свой цвет» над «сбросить» */
.swatches { height: 64px; display: grid; grid-template-rows: repeat(2, 28px); grid-auto-flow: column; grid-auto-columns: 28px; gap: 8px; }
.swatches > .btn-sm { width: 28px; padding: 0; }
.swatch-any { background: conic-gradient(from 180deg, #e53935, #fdd835, #43a047, #00acc1, #3949ab, #8e24aa, #e53935); }
/* выбор своего цвета: квадрат насыщенность × яркость и полоска оттенка, точка идёт за указателем */
.dd-menu.color-menu { padding: 10px; min-width: 0; max-height: none; overflow: visible; display: flex; flex-direction: column; gap: 10px; }
.cp-sv { position: relative; width: 232px; height: 152px; border-radius: var(--r-sm); background-image: linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, transparent); cursor: crosshair; touch-action: none; }
.cp-sv .dot { position: absolute; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; box-shadow: 0 0 0 2px #fff, 0 1px 4px rgba(0, 0, 0, 0.45); pointer-events: none; }
.cp-hue { position: relative; width: 232px; height: 14px; border-radius: var(--r-sm); background: linear-gradient(to right, #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%); cursor: pointer; touch-action: none; }
.cp-knob { position: absolute; top: -3px; bottom: -3px; width: 8px; margin-left: -4px; border-radius: var(--r-xs); background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45); pointer-events: none; }
.swatch { width: 28px; height: 28px; border: none; padding: 0; cursor: pointer; border-radius: var(--r-sm); box-shadow: var(--hl), var(--shadow-1); transition: transform var(--d-press) var(--ease-out); }
.swatch:active { transform: scale(0.92); }
.swatch.on { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--text); }
.input.hex { width: 7.5em; font-variant-numeric: tabular-nums; }
.nav { display: flex; flex-direction: column; gap: 3px; margin-top: 4px; }
.nav-gap { height: 10px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: var(--r-ctl);
  color: var(--text-2); font-weight: 500; font-size: 13.5px; text-decoration: none;
  transition: background-color var(--d-fast) ease, color var(--d-fast) ease, transform var(--d-press) var(--ease-out), box-shadow var(--d-fast) ease;
}
.nav a svg { width: 17px; height: 17px; flex-shrink: 0; opacity: 0.85; }
.nav-logo { width: 18px; height: 18px; border-radius: var(--r-xs); object-fit: contain; flex-shrink: 0; }
.crumb-logo { width: 22px; height: 22px; border-radius: var(--r-xs); object-fit: contain; flex-shrink: 0; margin-right: 2px; }
.crumb-label { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.logo-preview { width: 44px; height: 44px; border-radius: var(--r-sm); object-fit: contain; background: var(--surface-2); box-shadow: var(--inset); padding: 4px; }
.nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav a:active { transform: scale(0.985); }
.nav a.active { background: var(--accent-soft); color: var(--accent-text); box-shadow: var(--inset); }
/* Счётчик в меню заметен сразу (владелец 02.10.2026: «сливается, плохо видно»): сплошная плашка
   акцентом, красная, когда есть просрочка или непрочитанное */
.nav a .count { margin-left: auto; min-width: 22px; height: 20px; padding: 0 7px; display: inline-flex; align-items: center; justify-content: center; font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--accent-ink); background: var(--accent); border-radius: var(--r-sm); box-shadow: 0 2px 0 var(--edge-primary), var(--hl); }
.nav a .count.tone-danger { color: var(--surface); background: var(--danger); box-shadow: 0 2px 0 color-mix(in srgb, var(--danger) 62%, #000); }
.sidebar .spacer { flex: 1; }
.sidebar .userbox { position: relative; border-top: 1px solid var(--border); padding-top: 10px; margin-top: 10px; }
.nav-user { width: 100%; padding: 8px 10px; border: none; background: none; border-radius: var(--r-ctl); cursor: pointer; text-align: left; color: var(--text); transition: background-color var(--d-fast) ease, transform var(--d-press) var(--ease-out); }
.nav-user:hover, .nav-user.open { background: var(--surface-2); }
.nav-user:active { transform: scale(0.985); }
.nav-user .chev { color: var(--text-3); transition: transform var(--d-fast) var(--ease-out); }
.nav-user.open .chev { transform: rotate(180deg); }
.usermenu { position: absolute; left: 0; right: 0; bottom: calc(100% + 6px); z-index: 5; background: var(--surface); border-radius: var(--r-md); box-shadow: var(--shadow-2), var(--hl); padding: 6px; transform-origin: bottom left; }
.usermenu .sep { height: 1px; background: var(--border); margin: 4px 0; }
.usermenu .dd-item { text-decoration: none; }
.usermenu button.dd-item { width: 100%; border: none; background: none; font: inherit; text-align: left; }
/* меню пользователя открывается над кнопкой: та же шторка, что у выпадающих меню, снизу вверх */
.usermenu { clip-path: inset(-40px -28px -16px -28px); }
.drop-up-enter-active, .drop-up-leave-active { transition: clip-path var(--d-drop) var(--ease-out), transform var(--d-drop) var(--ease-out), opacity var(--d-drop) ease; }
.drop-up-enter-from, .drop-up-leave-to { opacity: 0; transform: translateY(6px); clip-path: inset(100% 0 0 0); }

/* Своей подложки у верхней полосы нет (владелец 05.10.2026: «у календаря сверху не должно быть своей подкладки,
   чтобы оставалась только строка»): в покое на фоне страницы лежит одна строка периода. Полоса липкая, поэтому при
   прокрутке подложка появляется только под текстом (название площадки или бренда, заголовок на телефоне), иначе он
   наезжает на список; голая строка периода непрозрачна сама и при прокрутке только приподнимается тенью. */
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--topbar);
  display: flex; align-items: center; gap: 12px; padding: 0 24px;
  background: transparent;
  transition: background-color var(--d-fast) ease, box-shadow var(--d-fast) ease;
}
.topbar.stuck:not(.strip-only) {
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px);
  box-shadow: 0 6px 16px rgba(var(--shadow-rgb), 0.10);
}
.topbar.stuck .period-strip { box-shadow: var(--sunk), var(--shadow-2); }
.topbar .crumbs { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--text-2); min-width: 0; flex-shrink: 1; }
.topbar .crumbs:empty { display: none; }
.topbar .crumbs a { color: var(--text-2); }
.topbar .crumbs .sep { color: var(--text-3); }
.topbar .crumbs .cur { color: var(--text); font-weight: 600; }
@media (min-width: 1001px) { .topbar .crumbs .dup { display: none; } .topbar.topbar-empty { display: none; } }
/* Середина верхней полосы: сюда страница кладёт строку периода, и она занимает всю ширину;
   кнопок страницы в верхней полосе нет, они в строке фильтров или вкладок */
.topbar-main { flex: 1; min-width: 0; display: flex; align-items: center; }
/* Строка периода: год стрелками, месяцы, «Всё», свой период; вдавленная дорожка, выбранное сафраном */
.period-strip { display: flex; align-items: center; gap: 4px; width: 100%; min-width: 0; padding: 3px; background: var(--sunk-bg); border-radius: var(--r-ctl); box-shadow: var(--sunk); }
.ps-year { display: flex; align-items: center; gap: 2px; flex-shrink: 0; padding-right: 6px; margin-right: 2px; border-right: 1px solid var(--border); }
.ps-year-num { min-width: 40px; text-align: center; font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; }
.ps-arrow, .ps-cal { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border: none; background: none; border-radius: var(--r-ctl-sm); color: var(--text-2); cursor: pointer; transition: background-color var(--d-fast) ease, color var(--d-fast) ease; }
.ps-arrow:hover:not(:disabled), .ps-cal:hover { background: var(--surface); color: var(--text); }
.ps-arrow:disabled { opacity: 0.3; cursor: default; }
.profile-slider { display: inline-grid; grid-template-columns: 28px minmax(0, 1fr) 28px; align-items: center; width: 136px; flex: 0 0 136px; white-space: nowrap; }
.profile-slider-label { grid-column: 2; overflow: hidden; min-width: 0; text-align: center; font-size: 11px; font-weight: 400; color: var(--text-2); }
.profile-slider-text { display: block; width: max-content; min-width: 100%; white-space: nowrap; }
.profile-slider-text.scrolling { animation: profile-label-scroll var(--profile-duration) linear infinite alternate; }
@keyframes profile-label-scroll { 0%, 15% { transform: translateX(0); } 85%, 100% { transform: translateX(var(--profile-overflow)); } }
@media (prefers-reduced-motion: reduce) {
  .profile-slider-text.scrolling { animation: none; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
}
/* прокрутка вбок срезает всё за краем строки: запас сверху и снизу, чтобы грань и тень выбранной кнопки помещались */
.ps-months { flex: 1; min-width: 0; display: flex; gap: 3px; padding: 2px 2px 5px; margin-bottom: -3px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.ps-month { flex: 1 0 auto; min-width: 38px; height: 28px; padding: 0 8px; border: none; background: none; border-radius: var(--r-ctl-sm); font: inherit; font-size: 12.5px; font-weight: 500; color: var(--text-2); cursor: pointer; transition: background-color var(--d-fast) ease, color var(--d-fast) ease, transform var(--d-press) var(--ease-out); }
.ps-month:hover:not(:disabled):not(.on) { background: var(--surface); color: var(--text); }
.ps-month:active:not(:disabled) { transform: translateY(1px); }
/* выбранное: та же объёмная кнопка, что главные кнопки (блик, ободок, нижняя грань) */
.ps-month.on, .ps-cal.on { background-color: var(--accent); background-image: var(--gloss); color: var(--accent-ink); font-weight: 700; box-shadow: 0 2px 0 var(--edge-primary), 0 3px 8px rgba(var(--shadow-rgb), 0.18), var(--lens); }
.ps-month.on:active, .ps-cal.on:active { transform: translateY(2px); box-shadow: 0 0 0 var(--edge-primary), inset 0 2px 4px rgba(var(--shadow-rgb), 0.18); }
.ps-month:disabled { opacity: 0.32; cursor: default; }
.ps-all { flex: 0 0 auto; }
@media (max-width: 1000px) { .ps-month { min-width: 34px; padding: 0 6px; } }
.main { min-width: 0; }
.page { padding: 22px 24px 120px; }  /* без предела ширины: на широком экране справа не остаётся пустоты */
.platform-heading { margin-bottom: 12px; font-size: 14px; }
.platform-site-link { color: inherit; }
.sync-inline { gap: 8px; flex: 0 0 auto; }
.mail-message { max-height: 42vh; overflow: auto; overflow-wrap: anywhere; }

.btn.burger { display: none; }
.sidebar-backdrop { display: none; }
@media (max-width: 1000px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 70; width: var(--sidebar); transform: translateX(-100%); transition: transform var(--d-modal) var(--ease-out); box-shadow: none; }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-modal); }
  .sidebar-backdrop { display: block; position: fixed; inset: 0; z-index: 65; background: var(--overlay); opacity: 0; pointer-events: none; transition: opacity var(--d-modal) ease; }
  .sidebar-backdrop.show { opacity: 1; pointer-events: auto; }
  .btn.burger { display: inline-flex; }
  .page { padding: 16px 16px 120px; }
  .topbar { padding: 0 12px; gap: 8px; }
  .topbar.stuck { background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); box-shadow: 0 6px 16px rgba(var(--shadow-rgb), 0.10); }
  /* на телефоне строка периода вторым рядом во всю ширину: рядом с названием она не помещалась и вылезала за экран */
  .topbar:has(.period-strip) { flex-wrap: wrap; height: auto; min-height: var(--topbar); padding-top: 8px; padding-bottom: 8px; row-gap: 6px; }
  .topbar:has(.period-strip) .topbar-main { flex: 1 0 100%; order: 5; }
  .mobile-hide { display: none !important; }
}

/* ── Поверхности: приподнятые карточки ───────────────────────────────────── */
/* блок: цвет и прозрачность из вкладки «Оформление» (владелец 05.10.2026: «настраивать сами блоки»); при прозрачности
   фон под блоком размыт, иначе узор лезет в текст. Размытие только при прозрачности: любое значение кроме none
   делает блок опорой для fixed-потомков (меню и окна и так уходят в body) */
.panel { background: color-mix(in srgb, var(--surface) calc(100% - var(--panel-alpha, 0%)), transparent); backdrop-filter: var(--panel-glass, none); border-radius: var(--r-lg); box-shadow: var(--shadow-1), var(--hl); }
a.panel { transition: transform var(--d-fast) var(--ease-out), box-shadow var(--d-fast) var(--ease-out); }
a.panel:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-2), var(--hl); }
a.panel:active { transform: translateY(0); box-shadow: var(--shadow-1), var(--hl); }
.panel-head { display: flex; align-items: center; gap: 10px; padding: 13px 18px; background: color-mix(in srgb, var(--surface-2) calc(100% - var(--panel-alpha, 0%)), transparent); border-radius: var(--r-lg) var(--r-lg) 0 0; box-shadow: var(--hl); }
.panel-head h2, .panel-head h3 { flex: 1; min-width: 0; }
/* переключатель с подписью: что он включает, написано рядом */
.switch-label { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 500; color: var(--text-2); cursor: pointer; white-space: nowrap; }
.panel-body { padding: 18px; }
.panel-body.tight { padding: 0; }
.well { background: var(--surface-2); border-radius: var(--r-md); padding: 12px 14px; box-shadow: var(--inset); }
.stat { background: var(--surface); border-radius: var(--r-lg); padding: 16px 18px; box-shadow: var(--shadow-1), var(--hl); }
.stat .value { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat .label { font-size: 12.5px; color: var(--text-2); margin-top: 6px; }
.stat .delta { font-size: 12px; margin-top: 4px; color: var(--text-2); }
.stat .delta.up { color: var(--success); }
.stat .delta.down { color: var(--danger); }
.stat.danger .value { color: var(--danger); }
.empty { padding: 40px 20px; text-align: center; color: var(--text-2); }
.empty .title { font-weight: 600; color: var(--text); margin-bottom: 4px; }

/* ── Кнопки: одна система, выпуклая плитка, с нажатием ──────────────────── */
/* Плитка приподнимается при наведении и уходит вниз на --edge-h при нажатии, тени меняются на внутренние */
.btn {
  --edge-h: 2px; --edge-c: var(--edge);
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 34px; padding: 0 15px; border-radius: var(--r-ctl); border: none;
  font-size: 13px; font-weight: 600; line-height: 1; cursor: pointer; white-space: nowrap; user-select: none;
  color: var(--text-2);
  background: var(--btn-bg);
  box-shadow: var(--btn-shadow);
  transform: translateY(0);
  transition: transform var(--d-press) var(--ease-out), box-shadow var(--d-press) var(--ease-out), color var(--d-fast) ease, opacity var(--d-fast) ease;
}
.btn svg { width: 15px; height: 15px; filter: var(--btn-icon-fx); }
.btn:hover { background: var(--btn-bg-hover); color: var(--text); text-decoration: none; transform: translateY(-1px); box-shadow: var(--btn-shadow-hover); }
.btn:active, .btn.pressed { transform: translateY(var(--edge-h)) scale(0.985); background: var(--btn-bg); box-shadow: var(--btn-press); transition-duration: 60ms; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.5; cursor: default; transform: none; box-shadow: var(--btn-shadow-quiet); }
/* главное действие: иконка с цветным переходом (сафран в коралл) на той же плитке; с текстом (шаг жалобы, вход)
   плитка залита сафраном */
.btn-primary { --edge-c: var(--edge-primary); color: var(--accent-text); }
.btn-primary.btn-icon svg { stroke: var(--icon-grad); }
.btn-primary:not(.btn-icon) { background: linear-gradient(145deg, color-mix(in srgb, var(--accent) 82%, white), var(--accent)); color: var(--accent-ink); }
.btn-primary:not(.btn-icon):hover { background: linear-gradient(145deg, color-mix(in srgb, var(--accent-hover) 78%, white), var(--accent-hover)); color: var(--accent-ink); }
.btn-primary:not(.btn-icon):active { background: var(--accent); }
.btn-ghost { --edge-c: var(--edge-ghost); box-shadow: var(--btn-shadow-quiet); }
.btn-danger { --edge-c: var(--edge-danger); }
.btn-danger, .btn-danger:hover { color: var(--danger); }
.btn-sm { --edge-h: 2px; height: 28px; padding: 0 11px; font-size: 12.5px; border-radius: var(--r-ctl-sm); }
.btn-lg { --edge-h: 3px; height: 40px; padding: 0 20px; font-size: 14px; border-radius: var(--r-ctl-lg); }
.btn-icon { width: 34px; padding: 0; }
.btn-icon.btn-sm { width: 28px; }
.btn.active { background: var(--accent-soft); color: var(--accent-text); box-shadow: var(--btn-press); }
/* Material tokens and all selectable kits are defined in appearance-controls.css. */
.btn.is-loading { pointer-events: none; }
.btn.is-loading > *:not(.spinner) { opacity: 0; }
.spinner { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 600ms linear infinite; position: absolute; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn.is-loading { position: relative; }
.linklike { background: none; border: none; padding: 0; color: var(--accent-text); cursor: pointer; font-size: inherit; }
.linklike:hover { text-decoration: underline; }

/* ── Поля: вдавленные ────────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-size: 12px; font-weight: 500; color: var(--text-2); }
.field .help { font-size: 12px; color: var(--text-3); }
.input, .textarea {
  width: 100%; min-height: 34px; padding: 6px 14px; font-size: 13.5px; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-ctl); box-shadow: var(--inset);
  transition: border-color var(--d-fast) ease, box-shadow var(--d-fast) ease, background-color var(--d-fast) ease;
}
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--inset), var(--ring); }
.input[readonly] { color: var(--text-2); }
.password-input { display: block; position: relative; width: 100%; min-width: 0; }
.password-input > .input { padding-right: 46px; }
/* Центр без transform: .btn:hover поднимает кнопку своим transform и иначе ронял глаз вниз (владелец 14.10.2026). */
.password-input > .btn { position: absolute; right: 7px; top: 0; bottom: 0; margin: auto 0; }
.row > .password-input { flex: 1 1 auto; }
.icon-link { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 28px; width: 28px; height: 28px; color: var(--text-2); border: none; background: none; }
.icon-link:hover { color: var(--text); text-decoration: none; }
.mail-actions { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.mail-server-line { display: grid; grid-template-columns: minmax(0, 1fr) 100px minmax(0, 1fr) minmax(100px, .6fr); gap: 12px; align-items: end; }
@media (max-width: 900px) { .mail-server-line { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .mail-server-line { grid-template-columns: minmax(0, 1fr); } }
.row > .input, .row > .textarea { min-width: 0; flex: 1 1 auto; }  /* поле в строке сжимается, а не выталкивает соседей за край */
.textarea { min-height: 96px; resize: vertical; line-height: 1.5; border-radius: var(--r-md); padding: 10px 14px; }
.input.sm { min-height: 28px; padding: 3px 10px; font-size: 12.5px; border-radius: var(--r-ctl-sm); }
.inline-edit { border-color: transparent; background: transparent; box-shadow: none; }
.inline-edit:hover { border-color: var(--border); background: var(--surface-2); }
.inline-edit:focus { background: var(--surface-2); }
.input.cell-text { min-width: 160px; font-weight: 500; }
/* списки и плашки в ячейках не раздвигают таблицу: длинное значение уходит в многоточие */
.table td .dd-trigger { max-width: 180px; }
.savestate { display: inline-flex; align-items: center; gap: 5px; height: 16px; font-size: 12px; font-weight: 500; color: var(--text-3); white-space: nowrap; }
.savestate.saved { color: var(--success); }
.savestate.err { color: var(--danger); }
.savestate .spinner { position: static; width: 12px; height: 12px; }
.search { position: relative; }
.search .input { padding-left: 34px; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--text-3); pointer-events: none; }

/* ── Выпадающие списки ───────────────────────────────────────────────────── */
.dd { position: relative; display: inline-block; max-width: 100%; }
.dd-trigger {
  --edge-h: 2px;
  display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px 0 14px; max-width: 100%;
  background: var(--btn-bg); border: none; border-radius: var(--r-ctl);
  font-size: 13px; font-weight: 500; color: var(--text); cursor: pointer; white-space: nowrap;
  box-shadow: var(--btn-shadow-quiet);
  transition: box-shadow var(--d-press) var(--ease-out), background-color var(--d-fast) ease, transform var(--d-press) var(--ease-out), color var(--d-fast) ease;
}
.dd-trigger.sm { --edge-h: 2px; height: 28px; padding: 0 9px 0 11px; font-size: 12.5px; border-radius: var(--r-ctl-sm); }
.dd-trigger.block { width: 100%; justify-content: space-between; }
.dd-trigger:hover { background: var(--btn-bg-hover); }
.dd-trigger:active, .dd.open .dd-trigger { transform: translateY(var(--edge-h)); background: var(--btn-bg); box-shadow: var(--btn-press); }
.dd-trigger.active { color: var(--accent-text); background: var(--accent-soft); }
.dd-trigger .chev { width: 14px; height: 14px; color: var(--text-3); flex-shrink: 0; transition: transform var(--d-fast) var(--ease-out); }
.dd.open .dd-trigger .chev { transform: rotate(180deg); }
.dd-trigger .val { overflow: hidden; text-overflow: ellipsis; }
.dd-trigger .plus { font-size: 11px; color: var(--accent-text); font-weight: 600; }
/* Плашка-список: статус и исполнитель меняются кликом там, где показаны (таблицы, шапка жалобы) */
.dd-trigger.pill { --edge-h: 0px; height: 24px; padding: 0 6px 0 10px; gap: 4px; font-size: 12px; font-weight: 600; border-radius: var(--r-md); background: var(--surface-2); background-image: none; backdrop-filter: none; color: var(--text-2); box-shadow: var(--hl); }
.dd-trigger.pill:hover { filter: brightness(0.96); background: var(--surface-2); }
.dd-trigger.pill.accent { background: var(--accent-soft); color: var(--accent-text); }
.dd-trigger.pill.info { background: var(--info-soft); color: var(--info); }
.dd-trigger.pill.success { background: var(--success-soft); color: var(--success); }
.dd-trigger.pill.warn { background: var(--warn-soft); color: var(--warn); }
.dd-trigger.pill.danger { background: var(--danger-soft); color: var(--danger); }
.dd-trigger.pill .chev { color: currentColor; opacity: 0.6; }
.dd.open .dd-trigger.pill { transform: none; box-shadow: var(--ring); }
.chip-lg .dd-trigger.pill { height: 34px; padding: 0 10px 0 14px; font-size: 13px; border-radius: var(--r-ctl); }
/* Меню выпадает из-под кнопки: открывается шторкой сверху вниз и так же убирается (владелец 03.10.2026);
   открытое над кнопкой разворачивается снизу вверх. Открытая шторка шире самого меню, чтобы не резать тень. */
.dd-menu {
  position: fixed; z-index: var(--z-dropdown); min-width: 180px; max-width: min(360px, 92vw); max-height: 320px; overflow: auto;
  background: var(--surface); border-radius: var(--r-md); box-shadow: var(--shadow-2), var(--hl); padding: 6px;
  opacity: 0; transform: translateY(-6px); clip-path: inset(0 0 100% 0); pointer-events: none;
  transition: clip-path var(--d-drop) var(--ease-out), transform var(--d-drop) var(--ease-out), opacity var(--d-drop) ease;
}
.dd-menu.up { transform: translateY(6px); clip-path: inset(100% 0 0 0); }
.dd-menu.show { opacity: 1; transform: none; clip-path: inset(-16px -28px -40px -28px); pointer-events: auto; }
.dd-item {
  display: flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: var(--r-sm); font-size: 13px; cursor: pointer; color: var(--text);
  transition: background-color 90ms ease;
}
.dd-item:hover, .dd-item.focus { background: var(--surface-2); }
.dd-item.active { color: var(--accent-text); font-weight: 500; }
.dd-item .check { width: 15px; height: 15px; border: 1px solid var(--border-strong); border-radius: var(--r-xs); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; box-shadow: var(--inset); transition: background-color var(--d-fast) ease, border-color var(--d-fast) ease; }
.dd-item .check svg { width: 10px; height: 10px; color: var(--accent-ink); opacity: 0; transform: scale(0.6); transition: opacity var(--d-fast) ease, transform var(--d-fast) var(--ease-out); }
.dd-item.active .check { background: var(--accent); border-color: var(--accent); box-shadow: none; }
.dd-item.active .check svg { opacity: 1; transform: scale(1); }
.dd-item .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dd-search { padding: 4px; margin-bottom: 4px; }
.dd-empty { padding: 10px; font-size: 12.5px; color: var(--text-3); }

/* ── Сегментный контрол (вдавленная дорожка, приподнятая пилюля), вкладки, переключатель ── */
.seg { position: relative; display: inline-flex; align-items: center; gap: 2px; padding: 3px; background: var(--sunk-bg); border-radius: var(--r-ctl); box-shadow: var(--sunk); max-width: 100%; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg .ind { position: absolute; top: 3px; bottom: 3px; left: 0; width: 0; background-color: var(--surface); background-image: var(--gloss); border-radius: calc(var(--r-ctl) - 3px); box-shadow: 0 2px 0 var(--edge-ghost), 0 3px 6px rgba(var(--shadow-rgb), 0.16), var(--lens); transition: transform var(--d-pop) var(--ease-out), width var(--d-pop) var(--ease-out); }
.seg button, .seg a { position: relative; z-index: 1; height: 28px; padding: 0 13px; border: none; background: transparent; border-radius: calc(var(--r-ctl) - 3px); font-size: 13px; font-weight: 500; color: var(--text-2); cursor: pointer; white-space: nowrap; transition: color var(--d-fast) ease, transform var(--d-press) var(--ease-out); text-decoration: none; display: inline-flex; align-items: center; }
.seg button:active, .seg a:active { transform: scale(0.95); }
.seg button.active, .seg a.active { color: var(--text); }
.seg.sm button, .seg.sm a { height: 24px; padding: 0 10px; font-size: 12px; }
.seg button.icon { padding: 0 9px; }
.seg.sm button.icon { padding: 0 8px; }
.seg.block { display: flex; width: 100%; }
.seg.block button, .seg.block a { flex: 1; justify-content: center; padding: 0 6px; }
.seg-scroll { max-width: 100%; overflow-x: auto; overflow-y: hidden; padding: 2px; }

/* Прокрутка только вбок на узком экране; вертикальной быть не может: подчёркивание выходит на 1 px вниз,
   и без overflow-y: hidden браузер рисовал пустую вертикальную полосу (владелец 02.10.2026) */
.tabs-bar { display: flex; align-items: stretch; margin-bottom: 18px; }
.tabs { position: relative; flex: 1 1 auto; min-width: 0; display: flex; gap: 4px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
/* действия страницы справа от вкладок; линия под вкладками продолжается под ними */
.tabs-end { display: flex; align-items: center; gap: 8px; flex-shrink: 0; padding: 0 0 6px 12px; }
.tabs-end:empty { display: none; }
.tabs a, .tabs button { position: relative; padding: 10px 12px; font-size: 13.5px; font-weight: 500; color: var(--text-2); border: none; background: none; cursor: pointer; white-space: nowrap; text-decoration: none; transition: color var(--d-fast) ease; }
.tabs a:hover, .tabs button:hover { color: var(--text); text-decoration: none; }
.tabs a.active, .tabs button.active { color: var(--text); }
.tabs .ind { position: absolute; bottom: -1px; left: 0; width: 0; height: 3px; background: var(--accent-text); border-radius: var(--r-xs) var(--r-xs) 0 0; transition: transform var(--d-pop) var(--ease-out), width var(--d-pop) var(--ease-out); }
.tabs .count { margin-left: 6px; font-size: 11px; color: var(--text-3); }

.switch { position: relative; width: 38px; height: 22px; border-radius: var(--r-md); background: var(--surface-3); box-shadow: var(--inset); border: none; cursor: pointer; padding: 0; transition: background-color var(--d-fast) ease; flex-shrink: 0; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: calc(var(--r-md) - 2px); background-color: var(--surface); background-image: var(--gloss); box-shadow: 0 1px 0 var(--edge-ghost), 0 2px 4px rgba(0, 0, 0, 0.22), var(--lens); transition: transform var(--d-fast) var(--ease-out); }
.switch.on { background: var(--accent); }
.switch.on::after { transform: translateX(16px); }
.switch:active::after { transform: scale(0.92) translateX(0); }
.switch.on:active::after { transform: scale(0.92) translateX(17px); }
.switch:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Бейджи и чипы ───────────────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; justify-content: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: var(--r-md); font-size: 12px; font-weight: 500; white-space: nowrap; background: var(--surface-2); color: var(--text-2); box-shadow: var(--hl); }
.badge.sm { height: 19px; font-size: 11px; padding: 0 7px; border-radius: var(--r-sm); }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.accent { background: var(--accent-soft); color: var(--accent-text); }
.badge.success { background: var(--success-soft); color: var(--success); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.outline { background: transparent; border: 1px solid var(--border-strong); color: var(--text-2); box-shadow: none; }
.badge.clickable { cursor: pointer; transition: transform var(--d-press) var(--ease-out), filter var(--d-fast) ease; }
.badge.clickable:hover { filter: brightness(0.96); }
.badge.clickable:active { transform: scale(0.96); }
[data-theme="dark"] .badge.clickable:hover { filter: brightness(1.15); }
.avatar { width: 24px; height: 24px; border-radius: var(--r-md); background: var(--accent-soft); color: var(--accent-text); font-size: 11px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; box-shadow: var(--hl); }
.flag { width: 18px; height: 13px; border-radius: calc(var(--r-xs) / 2); vertical-align: -2px; }

/* ── Таблицы ─────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; overflow-y: hidden; border-radius: var(--r-lg); }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.table th { position: sticky; top: 0; z-index: 2; background: var(--surface-3); text-align: left; font-size: 12.5px; font-weight: 600; color: var(--text); padding: 11px 12px; box-shadow: var(--hl); white-space: nowrap; }
.table th.sortable { cursor: pointer; user-select: none; }
.table th.sortable:hover { color: var(--text); }
.table th .sort { display: inline-block; width: 12px; height: 12px; margin-left: 4px; vertical-align: -2px; opacity: 0.35; transition: opacity var(--d-fast) ease, transform var(--d-fast) var(--ease-out); }
.table th.asc .sort, .table th.desc .sort { opacity: 1; color: var(--accent-text); }
.table th.desc .sort { transform: rotate(180deg); }
.table td { padding: 10px 12px; vertical-align: middle; }
/* строки различаются лёгким чередованием фона: линий между строками нет (владелец 05.10.2026) */
.table tbody tr:nth-child(even):not(.detail) td { background: color-mix(in srgb, var(--surface-2) 70%, transparent); }
.table tbody tr { transition: background-color 90ms ease; }
.table tbody tr.hover:hover, .table.clickable tbody tr:hover { background: var(--surface-2); }
.table tbody tr.selected { background: var(--accent-soft); }
.table th.center, .table td.center { text-align: center; }
.table th.num, .table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.table td.actions { white-space: nowrap; }
.table .cell-title { font-weight: 500; color: var(--text); }
.table tr.detail td { background: var(--surface-2); padding: 0; box-shadow: var(--inset); }
/* Раскрывающийся блок (строки таблиц, история жалобы, «ещё поля», жалобы в карточке площадки): высота
   растёт от нуля до содержимого, содержимое проявляется и чуть съезжает вниз; сворачивание обратным ходом */
.expand { display: grid; grid-template-rows: 0fr; transition: grid-template-rows var(--d-drop) var(--ease-out); }
.expand.open { grid-template-rows: 1fr; }
.expand > div { overflow: hidden; min-height: 0; opacity: 0; transform: translateY(-8px); transition: opacity var(--d-drop) ease, transform var(--d-drop) var(--ease-out); }
.expand.open > div { opacity: 1; transform: none; }
.expand .inner { padding: 14px 16px; }
.chev-btn { width: 26px; height: 26px; border-radius: var(--r-md); border: none; background: var(--btn-bg); color: var(--text-2); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; box-shadow: var(--btn-shadow-quiet); transition: transform var(--d-press) var(--ease-out), box-shadow var(--d-press) var(--ease-out), color var(--d-fast) ease; }
.chev-btn svg { width: 14px; height: 14px; filter: var(--btn-icon-fx); transition: transform var(--d-fast) var(--ease-out); }
.chev-btn.open svg { transform: rotate(180deg); }
.chev-btn:hover { color: var(--text); }
.chev-btn:hover { background: var(--btn-bg-hover); }
.chev-btn:active { transform: translateY(2px); background: var(--btn-bg); box-shadow: var(--btn-press); }
.link-cell { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; min-width: 0; }
.link-cell .ellipsis { max-width: 240px; }
.copy-btn { width: 22px; height: 22px; border-radius: var(--r-md); border: none; background: transparent; color: var(--text-3); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; flex-shrink: 0; transition: color var(--d-fast) ease, background-color var(--d-fast) ease, transform var(--d-press) var(--ease-out); }
.copy-btn svg { width: 13px; height: 13px; }
.copy-btn:hover { color: var(--text); background: var(--surface-2); }
.copy-btn:active { transform: scale(0.9); }
.copy-btn.done { color: var(--success); }

/* ── Фильтры ─────────────────────────────────────────────────────────────── */
.filters { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
/* Поиск сужается раньше, чем кнопка справа уйдёт на вторую строку (владелец 14.10.2026, экран 125%). */
.filters .search { flex: 1 1 140px; min-width: 140px; max-width: 260px; }
/* Очередь: на узком окне «Добавить кейс» остаётся в строке значком с подсказкой. */
@media (min-width: 901px) and (max-width: 1480px) { .queue-filters > .btn-primary:last-child > span { display: none; } }
.filters .count { font-size: 12.5px; color: var(--text-3); margin-left: auto; }
.form-line.four { grid-template-columns: repeat(4, minmax(0, 1fr)) auto; }
@media (max-width: 900px) { .form-line.four { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* команда привязки группы Telegram: видно целиком, копируется кнопкой рядом */
.tg-cmd { display: block; padding: 7px 10px; border-radius: var(--r-ctl-sm); background: var(--sunk-bg); box-shadow: var(--sunk); font-size: 13px; font-variant-numeric: tabular-nums; user-select: all; }
/* значение вместо поля, когда выбирать нечего (администратору открыты все бренды): той же высоты, что поле */
.field-note { display: flex; align-items: center; min-height: 38px; color: var(--text-2); font-size: 13.5px; }
/* Короткая форма одной строкой: поля и кнопка действия справа, по нижнему краю полей */
.form-line { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: 12px; align-items: end; }
@media (max-width: 700px) { .form-line { grid-template-columns: minmax(0, 1fr); justify-items: stretch; } .form-line > .btn { justify-self: start; } }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }

/* ── Лента уведомлений ───────────────────────────────────────────────────── */
.feed-item { display: flex; align-items: flex-start; gap: 12px; width: 100%; text-align: left; padding: 12px 16px; border: none; background: none; cursor: pointer; color: var(--text); transition: background-color 90ms ease; }
.feed-item:hover { background: var(--surface-2); }
.feed-item.read { opacity: 0.6; }
.feed-item .grow { display: flex; flex-direction: column; gap: 2px; }
.feed-ico { flex-shrink: 0; width: 30px; height: 30px; border-radius: var(--r-md); background: var(--accent-soft); color: var(--accent-text); display: inline-flex; align-items: center; justify-content: center; }
.feed-title { font-weight: 600; font-size: 13.5px; }
.feed-body { color: var(--text-2); font-size: 13px; }
.feed-when { color: var(--text-3); font-size: 12px; }
.feed-item .dot { flex-shrink: 0; width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: var(--accent); }
.feed-sep { padding: 14px 16px 6px; font-size: 12px; color: var(--text-3); }

/* ── Календарь: один на весь инструмент (период, дата, дата со временем) ── */
.dd-menu.cal-menu { padding: 10px; max-height: none; max-width: none; min-width: 0; }
.cal-presets { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; margin-bottom: 8px; }
.cal-presets .btn { padding: 0 4px; font-size: 12px; min-width: 0; }
.cal-month { width: 238px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.cal-title { font-weight: 600; text-transform: capitalize; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 32px); gap: 2px; font-size: 12px; }
.cal-wd { text-align: center; padding: 2px 0; color: var(--text-3); }
.btn.cal-day { width: 100%; min-width: 0; padding: 0; font-variant-numeric: tabular-nums; }
.btn.cal-day.today { color: var(--accent-text); font-weight: 700; }
.btn.cal-day.in { background: var(--accent-soft); color: var(--accent-text); }
.btn.cal-day.sel { background: var(--accent); color: var(--accent-ink); }
.cal-foot { display: flex; justify-content: flex-end; margin-top: 8px; }
.dd.block { width: 100%; }
.cal-menu .cal-presets { max-width: 238px; }
/* Дата одной строкой: поле ввода и иконка календаря рядом */
.dt { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; }
.dt.block { display: flex; width: 100%; }
.dt .input { width: 8.6em; font-variant-numeric: tabular-nums; }
.dt.time .input { width: 10.6em; }
.dt.block .input { width: auto; flex: 1 1 auto; min-width: 0; }
.input.bad, .input.bad:focus { border-color: var(--danger); }

/* ── Обзор: одна главная цифра с акцентом, рядом меньшие; карточки площадок с той же шапкой, что все панели ── */
.ov-top { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); gap: 16px; margin-bottom: 18px; }
/* Главная цифра: сафрановая плитка тем же языком, что главные кнопки (блик, ободок, нижняя грань),
   и проседает при нажатии, потому что ведёт в очередь (владелец 02.10.2026 выбрал вариант B; полоска
   сбоку убрана как шаблонная). На сафране чип просрочки сплошной красный в обеих темах. */
.hero {
  display: flex; flex-direction: column; justify-content: center; gap: 8px; padding: 18px 22px;
  color: var(--accent-ink); background-color: var(--accent); background-image: var(--gloss);
  box-shadow: 0 4px 0 var(--edge-primary), 0 8px 18px rgba(var(--shadow-rgb), 0.18), var(--lens);
  transition: transform var(--d-press) var(--ease-out), box-shadow var(--d-press) var(--ease-out);
}
.panel.hero.clickable { cursor: pointer; }
.panel.hero.clickable:hover { transform: translateY(-1px); box-shadow: 0 5px 0 var(--edge-primary), 0 10px 22px rgba(var(--shadow-rgb), 0.20), var(--lens); }
.panel.hero.clickable:active:not(:has(.sdot:active)) { transform: translateY(4px); box-shadow: 0 0 0 var(--edge-primary), inset 0 3px 6px rgba(var(--shadow-rgb), 0.18); transition-duration: 60ms; }
.hero-label { font-size: 13px; font-weight: 600; color: var(--accent-ink); opacity: 0.72; }
/* Сводное число точкой: цвет говорит что, рядом число, слово выезжает из точки вправо при наведении */
.sdot { display: inline-flex; align-items: center; height: 26px; padding: 0 9px 0 8px; border-radius: var(--r-ctl-sm); background: var(--surface-2); box-shadow: var(--hl), 0 1px 2px rgba(var(--shadow-rgb), 0.10); font-size: 12.5px; color: var(--text); cursor: default; outline: none; white-space: nowrap; }
.sdot:focus-visible { box-shadow: var(--ring); }
.sdot .dot { width: 10px; height: 10px; flex-shrink: 0; border-radius: 50%; background: var(--text-3); box-shadow: 0 0 0 1.5px rgba(var(--shadow-rgb), 0.28); }
.sdot.danger .dot { background: var(--danger); }
.sdot.warn .dot { background: var(--warn); }
.sdot.accent .dot { background: var(--accent); }
.sdot.success .dot { background: var(--success); }
.sdot-n { margin-left: 6px; font-weight: 700; font-variant-numeric: tabular-nums; }
.sdot-label { max-width: 0; margin-left: 0; opacity: 0; overflow: hidden; transition: max-width var(--d-drop) var(--ease-out), margin-left var(--d-drop) var(--ease-out), opacity var(--d-drop) ease; }
.sdot:hover .sdot-label, .sdot:focus-visible .sdot-label { max-width: 16em; margin-left: 6px; opacity: 1; }
.sdot.zero { opacity: 0.55; }
a.sdot { text-decoration: none; cursor: pointer; transition: transform var(--d-press) var(--ease-out); }
a.sdot:hover { text-decoration: none; }
a.sdot:active { transform: translateY(1px); }
.sdot.on .sdot-label { max-width: 16em; margin-left: 6px; opacity: 1; }
.sdot-x { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; margin-left: 6px; padding: 0; border: none; background: none; color: var(--text-3); border-radius: var(--r-xs); cursor: pointer; }
.sdot-x:hover { color: var(--text); background: var(--surface-3); }
.hero .sdot { background: rgba(255, 255, 255, 0.45); color: var(--accent-ink); }
.hero-value { font-size: 56px; font-weight: 700; line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.hero-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.ov-top .stat { display: flex; flex-direction: column; justify-content: center; }
a.panel.plat-card { text-decoration: none; color: var(--text); }
.panel.hero { color: var(--accent-ink); }
.plat-card .panel-head h3 { flex: 1; }
.plat-row { display: flex; align-items: center; gap: 10px; padding: 10px 18px; font-size: 13.5px; }
.plat-rating { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.plat-rating .faint { font-size: 12px; font-weight: 500; }
.plat-foot { display: flex; justify-content: space-between; gap: 10px; padding: 10px 18px; font-size: 12.5px; color: var(--text-2); }
.plat-foot b { color: var(--text); margin-left: 4px; }
.plat-foot .tone-danger b { color: var(--danger); }
/* Карусель площадок: карточки от верхнего ряда до низа первого экрана, листаются по кругу */
.ov-page { display: flex; flex-direction: column; min-height: calc(100vh - var(--topbar)); padding-bottom: 24px; }
.ov-carousel { position: relative; flex: 1; min-height: 420px; display: flex; }
.ov-track { flex: 1; min-width: 0; display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 32px) / 3); gap: 16px; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; padding: 2px 2px 10px; margin: -2px -2px -10px; }
.ov-track::-webkit-scrollbar { display: none; }
.ov-card { scroll-snap-align: start; display: flex; flex-direction: column; min-height: 0; }
.ov-card > a.panel-head { color: var(--text); text-decoration: none; }
.ov-card > .panel-head > a { color: var(--text); text-decoration: none; }
.ov-card > a.panel-head:hover { background: var(--surface-3); }
/* шапка раздела жалоб в карточке: «Ждут ответа N», просрочка, иконка очереди с фильтром по площадке */
.ov-cases-head { display: flex; align-items: center; gap: 8px; padding: 8px 12px 8px 18px; min-height: 44px; background: var(--surface-2); font-size: 13px; font-weight: 600; color: var(--text-2); }
.ov-cases-head b { color: var(--text); margin-left: 4px; font-variant-numeric: tabular-nums; }
.ov-cases-head.toggle { cursor: pointer; user-select: none; transition: background-color var(--d-fast) ease; }
.ov-cases-head.toggle:hover { background: var(--surface-3); }
.ov-chev { width: 16px; height: 16px; flex-shrink: 0; color: var(--text-3); transition: transform var(--d-drop) var(--ease-out); }
.ov-cases-head.open .ov-chev { transform: rotate(180deg); }
.ov-collapse { flex: 1 1 auto; min-height: 0; }
/* страница «Площадки»: все карточки сеткой, длинный список жалоб прокручивается внутри */
.plat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 16px; align-items: start; }
.plat-grid .ov-card { max-height: 620px; }
.ov-cases { height: 100%; overflow-y: auto; scrollbar-width: thin; }
.ov-case { display: flex; align-items: center; gap: 12px; padding: 9px 18px; color: var(--text); text-decoration: none; }
.ov-case:hover { background: var(--surface-2); text-decoration: none; }
.ov-empty { padding: 18px; color: var(--text-3); font-size: 13px; }
.ov-nav { position: absolute; top: 50%; z-index: 2; transform: translateY(-50%); }
.ov-nav.prev { left: -14px; }
.ov-nav.next { right: -14px; }
@media (max-width: 1400px) { .ov-track { grid-auto-columns: calc((100% - 16px) / 2); } }
@media (max-width: 760px) { .ov-track { grid-auto-columns: 100%; } .ov-carousel { min-height: 460px; } .ov-nav.prev { left: -10px; } .ov-nav.next { right: -10px; } }
@media (max-width: 900px) { .ov-top { grid-template-columns: 1fr 1fr; } .hero { grid-column: 1 / -1; } }

/* ── Настройки уведомлений: таблица «событие × канал» и карточки каналов одной высоты ── */
.notify-grid { display: grid; grid-template-columns: minmax(0, 1fr) 440px; gap: 16px; align-items: stretch; }
.channel-stack { display: flex; flex-direction: column; gap: 16px; }
.channel-stack > .panel { flex: 1; display: flex; flex-direction: column; }
.channel-card .panel-body { flex: 1; display: flex; align-items: center; }
.channel-line { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 34px; }
.channel-line .input { flex: 1 1 auto; min-width: 0; }
.table.matrix td:first-child { font-weight: 500; }
@media (max-width: 1200px) { .notify-grid { grid-template-columns: 1fr; } }

/* ── Карточка жалобы: шаг, срок, ответ, саппорт, история ─────────────────── */
.case { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.case-head { display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.case-title-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; }
.case-head .btn-step.case-open { height: 34px; }
@media (max-width: 700px) { .case-head .case-open { order: 5; width: 100%; } }
/* Окно жалобы поверх списка: шапка с крестиком не уезжает при прокрутке; на телефоне весь экран */
.modal.case-modal { width: min(1040px, 100%); }
.modal-bare { padding: 0 22px 24px; }
.case-modal .case-head { position: sticky; top: 0; z-index: 2; margin: 0 -22px; padding: 18px 22px 12px; background: var(--surface); box-shadow: 0 8px 12px -10px rgba(var(--shadow-rgb), 0.35); }
@media (max-width: 700px) {
  .overlay:has(> .case-modal) { padding: 0; }
  .modal.case-modal { width: 100%; height: 100%; max-height: 100%; border-radius: 0; }
  .modal-bare { padding: 0 14px 20px; }
  .case-modal .case-head { margin: 0 -14px; padding: 14px 14px 10px; }
}
.case-plat { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--text); }
.case-title { font-size: 17px; line-height: 1.3; overflow-wrap: anywhere; }
.case-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 4px; font-size: 12.5px; color: var(--text-2); }
.step { padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.btn.btn-step { height: 38px; padding: 0 16px; font-size: 13.5px; }
a.btn:hover { text-decoration: none; }
.deadline-line { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 13px; min-height: 28px; }
.deadline-line > svg { width: 15px; height: 15px; color: var(--text-3); flex-shrink: 0; }
.record { display: flex; flex-direction: column; gap: 8px; }
.record .textarea { min-height: 0; }
.answer { padding: 10px 12px; border-radius: var(--r-md); background: var(--surface-2); box-shadow: var(--inset); }
.answer .meta { font-size: 12px; color: var(--text-3); margin-bottom: 4px; }
.answer .body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; }
.files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.file-thumb img { display: block; height: 84px; max-width: 168px; object-fit: cover; border-radius: var(--r-sm); border: 1px solid var(--border); cursor: zoom-in; }
.file-link { display: inline-flex; align-items: center; gap: 6px; max-width: 240px; font-size: 12.5px; }
.panel-head.hist-toggle { width: 100%; border: 0; font: inherit; color: var(--text); cursor: pointer; text-align: left; }
.panel-head.hist-toggle:not(.open) { border-radius: var(--r-lg); }
.hist-toggle .hist-title { flex: 1; min-width: 0; font-size: 15px; font-weight: 600; }
.hist-toggle svg { width: 15px; height: 15px; color: var(--text-3); transition: transform var(--d-fast) var(--ease-out); }
.hist-toggle.open svg { transform: rotate(180deg); }
.more-toggle { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; }
.more-toggle svg { width: 14px; height: 14px; transition: transform var(--d-fast) var(--ease-out); }
.more-toggle svg.flip { transform: rotate(180deg); }
button.dd-item { width: 100%; border: none; background: none; font: inherit; text-align: left; }
.dd-item.tone-danger { color: var(--danger); }

/* ── Разбивка отзывов по оценкам: одна шкала, один цвет ─────────────────── */
.bars { display: flex; flex-direction: column; gap: 9px; }
.bar-row { display: grid; grid-template-columns: 32px 1fr 56px; align-items: center; gap: 10px; font-size: 13px; }
.bar-k { color: var(--text-2); text-align: right; font-variant-numeric: tabular-nums; }
.bar-n { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.bar-track { height: 10px; background: var(--surface-2); border-radius: var(--r-xs); box-shadow: var(--inset); overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--accent); border-radius: var(--r-xs); }
.pw-mask { font-variant-numeric: tabular-nums; letter-spacing: 2px; }
button.badge { border: none; font: inherit; font-size: 11px; }

/* ── Всплывающие слои ────────────────────────────────────────────────────── */
.overlay { position: fixed; inset: 0; z-index: var(--z-modal); background: var(--overlay); display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal { width: min(640px, 100%); max-height: calc(100vh - 40px); overflow: auto; background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--shadow-3), var(--hl); }
.modal.wide { width: min(820px, 100%); }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px; background: var(--surface-2); border-radius: var(--r-xl) var(--r-xl) 0 0; }
.modal-head h2 { flex: 1; }
.modal-body { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px 18px; }
.fade-enter-active, .fade-leave-active { transition: opacity var(--d-modal) var(--ease-out); }
.fade-enter-active .modal, .fade-leave-active .modal { transition: transform var(--d-modal) var(--ease-out), opacity var(--d-modal) var(--ease-out); }
.fade-enter-from, .fade-leave-to { opacity: 0; }
.fade-enter-from .modal, .fade-leave-to .modal { transform: scale(0.96) translateY(6px); opacity: 0; }

.sheet-layer { position: fixed; inset: 0; z-index: var(--z-sheet); display: flex; justify-content: flex-end; }
.sheet-layer .backdrop { position: absolute; inset: 0; background: var(--overlay); }
.sheet { position: relative; width: min(760px, 100%); height: 100%; background: var(--surface); box-shadow: var(--shadow-3); display: flex; flex-direction: column; overflow: hidden; }
.sheet-head { display: flex; align-items: center; gap: 10px; padding: 14px 20px; background: var(--surface-2); }
.sheet-body { flex: 1; overflow: auto; padding: 20px; }
.slide-enter-active, .slide-leave-active { transition: opacity var(--d-modal) var(--ease-out); }
.slide-enter-active .sheet, .slide-leave-active .sheet { transition: transform var(--d-modal) var(--ease-out); }
.slide-enter-from, .slide-leave-to { opacity: 0; }
.slide-enter-from .sheet, .slide-leave-to .sheet { transform: translateX(24px); }

.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: var(--z-toast); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px 10px 14px; border-radius: var(--r-ctl); background: var(--success-soft); color: var(--success); font-size: 13px; font-weight: 600; box-shadow: 0 3px 0 color-mix(in srgb, var(--success) 35%, var(--success-soft)), var(--shadow-2), var(--hl); max-width: 90vw; }
.toast svg { width: 15px; height: 15px; flex-shrink: 0; }
.toast.err { background: var(--danger-soft); color: var(--danger); box-shadow: 0 3px 0 color-mix(in srgb, var(--danger) 35%, var(--danger-soft)), var(--shadow-2), var(--hl); }
.toast-enter-active, .toast-leave-active { transition: opacity var(--d-pop) var(--ease-out), transform var(--d-pop) var(--ease-out); }
.toast-enter-from, .toast-leave-to { opacity: 0; transform: translateY(8px); }

.view-enter-active { transition: opacity var(--d-fast) var(--ease-out), transform var(--d-fast) var(--ease-out); }
.view-enter-from { opacity: 0; transform: translateY(4px); }
.view-leave-active { transition: none; }

/* ── Скелетон ────────────────────────────────────────────────────────────── */
.skel { background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%); background-size: 400% 100%; animation: shimmer 1.2s ease infinite; border-radius: var(--r-sm); height: 14px; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

/* ── Очередь и кейс ──────────────────────────────────────────────────────── */
.split { display: grid; grid-template-columns: minmax(0, 1fr) 460px; gap: 16px; align-items: start; }
.split.aside-sm { grid-template-columns: minmax(0, 1fr) 360px; }
.split.aside-md { grid-template-columns: minmax(0, 1fr) 420px; }
.split.aside-lg { grid-template-columns: minmax(0, 1fr) minmax(460px, 42%); }
.split .sticky-aside { position: sticky; top: calc(var(--topbar) + 16px); max-height: calc(100vh - var(--topbar) - 32px); overflow: auto; }
@media (max-width: 1200px) { .split, .split.aside-sm, .split.aside-md, .split.aside-lg { grid-template-columns: 1fr; } .split .sticky-aside { position: static; max-height: none; } }
/* Плашка срока одной ширины везде (владелец 02.10.2026: строки списка начинались с разных мест):
   текст по центру, длинный срок не раздвигает строку */
.badge.deadline { font-variant-numeric: tabular-nums; width: 146px; justify-content: center; flex-shrink: 0; overflow: hidden; text-overflow: ellipsis; }
.badge.deadline.sm { width: 132px; }  /* самый длинный: «просрочено 23ч 59м» */
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 14px; font-size: 13px; align-items: center; }
.kv dt { color: var(--text-2); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 120px 1fr; gap: 10px; padding: 10px 0; font-size: 13px; }
.timeline .when { color: var(--text-3); font-size: 12px; padding-top: 2px; }
.timeline .what .kind { font-weight: 500; }
.timeline .what .body { color: var(--text-2); white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 2px; }
.comment { padding: 10px 12px; border-radius: var(--r-md); background: var(--surface-2); box-shadow: var(--inset); margin-bottom: 8px; }
.comment .meta { font-size: 12px; color: var(--text-3); margin-bottom: 4px; display: flex; gap: 8px; align-items: center; }
.comment .body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; }
.comment .att { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.comment .att img { max-height: 120px; border-radius: var(--r-sm); border: 1px solid var(--border); cursor: zoom-in; }
.kb-card { padding: 12px 14px; border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow-1), var(--hl); }
.kb-card + .kb-card { margin-top: 8px; }
.kb-card .quote { border-left: 2px solid var(--border-strong); padding-left: 10px; color: var(--text-2); font-size: 12.5px; margin: 6px 0; white-space: pre-wrap; }

/* ── График ──────────────────────────────────────────────────────────────── */
.chart { width: 100%; height: 220px; display: block; }
.chart .grid { stroke: var(--border); stroke-width: 1; }
.chart .axis { fill: var(--text-3); font-size: 11px; }
.chart .line { fill: none; stroke: var(--accent-text); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .dot { fill: var(--surface); stroke: var(--accent-text); stroke-width: 2; }
.chart .target { stroke: var(--text-3); stroke-width: 1; }
.chart .mark { fill: var(--warn); }
.chart .cross { stroke: var(--text-3); stroke-width: 1; opacity: 0.6; }
.chart .hit { fill: transparent; }
.chart-tip { position: fixed; z-index: var(--z-dropdown); background: var(--text); color: var(--bg); padding: 6px 10px; border-radius: var(--r-sm); font-size: 12px; pointer-events: none; white-space: nowrap; box-shadow: var(--shadow-pop); }

/* ── Цветные точки статусов ──────────────────────────────────────────────── */
.tone-neutral { color: var(--text-2); }
.tone-accent { color: var(--accent-text); }
.tone-success { color: var(--success); }
.tone-warn { color: var(--warn); }
.tone-danger { color: var(--danger); }
.tone-info { color: var(--info); }

/* ── Оформление: фон тем и вид кнопок (владелец 05.10.2026) ───────────────── */
.look-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); gap: 16px; align-items: start; }
/* превью: маленькая страница с фоном, вуалью, панелью и кнопками своей темы, даже если включена другая */
.look-preview { position: relative; overflow: hidden; aspect-ratio: 16 / 7; border-radius: var(--r-md); isolation: isolate; color: var(--text); box-shadow: var(--sunk); }
.look-preview::before { content: ""; position: absolute; inset: calc(var(--bg-blur, 0px) * -1); z-index: -1;
  background: linear-gradient(var(--bg-veil), var(--bg-veil)), var(--bg-img, none) center / cover no-repeat, var(--bg);
  background-blend-mode: var(--bg-blend), normal, normal; filter: blur(calc(var(--bg-blur, 0px) * 0.35)); }
.look-preview .lp-panel { position: absolute; left: 6%; top: 16%; width: 52%; padding: 10px 12px; border-radius: var(--r-md); background: color-mix(in srgb, var(--surface) calc(100% - var(--panel-alpha, 0%)), transparent); backdrop-filter: var(--panel-glass, none); box-shadow: var(--shadow-1); display: flex; flex-direction: column; gap: 6px; }
.look-preview .lp-line { height: 7px; border-radius: var(--r-sm); background: var(--surface-3); }
.look-preview .lp-line.short { width: 55%; }
.look-preview .lp-btns { position: absolute; right: 6%; top: 16%; display: flex; flex-direction: column; gap: 10px; }
.bg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
.bg-tile { position: relative; aspect-ratio: 16 / 9; border: none; padding: 0; border-radius: var(--r-md); background: var(--surface-2) center / cover no-repeat; cursor: pointer; box-shadow: var(--btn-shadow-quiet); display: flex; align-items: center; justify-content: center; color: var(--text-2); transition: transform var(--d-press) var(--ease-out), box-shadow var(--d-press) var(--ease-out); }
.bg-tile:hover { transform: translateY(-1px); box-shadow: var(--btn-shadow); }
.bg-tile:active { transform: translateY(2px); box-shadow: var(--btn-press); }
.bg-tile.on { box-shadow: 0 0 0 2px var(--accent), var(--btn-shadow); }
.bg-tile .on-mark { width: 22px; height: 22px; border-radius: var(--r-md); display: inline-flex; align-items: center; justify-content: center; background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow-1); }
.bg-tile .on-mark svg { width: 13px; height: 13px; }
.bg-tile .bg-del { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border: none; border-radius: var(--r-sm); display: inline-flex; align-items: center; justify-content: center; background: var(--surface); color: var(--danger); cursor: pointer; opacity: 0; box-shadow: var(--shadow-1); transition: opacity var(--d-fast) ease; }
.bg-tile:hover .bg-del, .bg-tile .bg-del:focus-visible { opacity: 1; }
@media (hover: none) { .bg-tile .bg-del { opacity: 1; } }
.bg-tile.add { background: var(--btn-bg); }
.bg-tile.add.busy { pointer-events: none; opacity: 0.6; }
.look-sliders { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .look-sliders { grid-template-columns: 1fr; } }
/* ползунок: вдавленная дорожка, ручка той же плиткой, что кнопки */
.range { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: transparent; cursor: pointer; }
.range::-webkit-slider-runnable-track { height: 8px; border-radius: var(--r-sm); background: var(--sunk-bg); box-shadow: var(--sunk); }
.range::-moz-range-track { height: 8px; border-radius: var(--r-sm); background: var(--sunk-bg); box-shadow: var(--sunk); }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; margin-top: -6px; border: none; border-radius: var(--r-sm); background: var(--btn-bg); box-shadow: var(--btn-shadow); }
.range::-moz-range-thumb { width: 20px; height: 20px; border: none; border-radius: var(--r-sm); background: var(--btn-bg); box-shadow: var(--btn-shadow); }
.range:focus-visible { box-shadow: none; }
.range:focus-visible::-webkit-slider-thumb { box-shadow: var(--btn-shadow), var(--ring); }
.btn-preview { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 14px; border-radius: var(--r-md); }
/* загрузка в галерею темы: плитка «+» первой, файлы можно перетащить на галерею (подсветка кольцом акцента) */
.bg-tile.add svg { stroke: var(--icon-grad); }
.bg-grid.drop { border-radius: var(--r-md); box-shadow: 0 0 0 2px var(--accent); }
.look-group-title { font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: -4px; }
.look-panel-row { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: end; }
@media (max-width: 560px) { .look-panel-row { grid-template-columns: 1fr; } }

/* Daily-work improvements: readable actions, bounded tables and visible focus. */
.table-pager { display:flex; align-items:center; justify-content:center; gap:16px; padding:14px;  font-size:13px; }
.table-sort { display:inline-flex; align-items:center; gap:6px; background:none; border:0; color:inherit; font:inherit; cursor:pointer; padding:4px 0; }
.dd-menu button.dd-item { width:100%; border:0; text-align:left; font:inherit; color:inherit; background:transparent; cursor:pointer; }
.dd-menu button.dd-item:hover,.dd-menu button.dd-item:focus-visible { background:var(--surface-2); }
:focus-visible { outline:2px solid var(--accent); outline-offset:3px; }
.instance-banner { position:fixed; bottom:0; right:12px; z-index:40; padding:4px 10px; border-radius:var(--r-md) var(--r-md) 0 0; background:var(--surface-2); color:var(--text-2); font-size:11px; pointer-events:none; }
.waiting-line { display:flex; flex-wrap:wrap; align-items:center; gap:10px; padding:12px 0; }
.metric-freshness { font-size:12px; color:var(--text-3); margin-top:6px; }
.savestate.conflict { color:var(--danger); }
@media(max-width:700px) { .table-pager { gap:8px; font-size:12px; } .instance-banner { max-width:85vw; } }
