
@layer tokens, base, ui;
/* Стили кита и оформление его документации. Оба — в слое ui, документация ниже: так её правила
   при равной специфичности побеждают */
/* Пульт VV Lab — матовое стекло.
   Идея: стекло как материал, а не свечение. Светлая кромка сверху, тень снизу, блюр за панелью.
   Один акцент — коралл знака (#FF5C7A) — только для состояний: активный пункт, тумблер, фокус.
   Шрифты бренда: Unbounded для часов и заголовков страниц, Golos Text для всего остального.

   Слои: значения тем, сброс с базовыми классами, компоненты. Стили плагинов (*.module.css) лежат
   вне слоёв и поэтому сильнее любого правила кита.
   Внутри слоя ui побеждает правило, которое стоит ниже, поэтому порядок файлов менять нельзя:
   это порядок, в котором правила были отлажены. Новый файл добавляй перед responsive.css. */
/* cyrillic */
@font-face {
  font-family: 'Golos Text';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url(/assets/golostext-400-900-cyrillic-mKek_fSS.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* latin */
@font-face {
  font-family: 'Golos Text';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url(/assets/golostext-400-900-latin-BS5oQT7X.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* cyrillic */
@font-face {
  font-family: 'Unbounded';
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url(/assets/unbounded-300-900-cyrillic-C627f1f8.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* latin */
@font-face {
  font-family: 'Unbounded';
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url(/assets/unbounded-300-900-latin-D5afBTBx.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@layer tokens{

:root {
  color-scheme: light;

  --bg: #E4E8F0;
  --bg-light-1: #B3C6F0;
  --bg-light-2: #F6CFB0;
  --bg-light-3: #F3BFCE;
  --bg-light-4: #B2DCCD;
  --hex-fill-1: rgba(143, 170, 232, 0.42);
  --hex-fill-2: rgba(239, 168, 190, 0.4);
  --line: rgba(15, 21, 43, 0.22);
  --mesh: rgba(15, 21, 43, 0.17);

  --glass: rgba(255, 255, 255, 0.34);
  --glass-strong: rgba(255, 255, 255, 0.7);
  --glass-soft: rgba(255, 255, 255, 0.3);
  --glass-edge: rgba(255, 255, 255, 0.85);
  --glass-highlight: rgba(255, 255, 255, 0.95);
  --glass-sheen: rgba(255, 255, 255, 0.18);
  --glass-spec: rgba(255, 255, 255, 0.5);
  --glass-shadow: 0 1px 2px rgba(15, 21, 43, 0.04), 0 14px 36px -14px rgba(15, 21, 43, 0.16);

  --hair: rgba(15, 21, 43, 0.09);
  --hair-strong: rgba(15, 21, 43, 0.18);

  --ink: #0F152B;
  --ink-2: #3D4661;
  --ink-3: #4F597A;

  --accent: #FF5C7A;
  --accent-text: #C9264B;
  --accent-soft: rgba(255, 92, 122, 0.14);
  --on-accent: #0F152B;

  --good: #0CA30C;
  --good-text: #0E7A33;
  --good-soft: rgba(12, 163, 12, 0.12);
  --warn: #FAB219;
  --warn-text: #8A5A00;
  --warn-soft: rgba(250, 178, 25, 0.18);
  --crit: #D03B3B;
  --crit-text: #B42828;
  --crit-soft: rgba(208, 59, 59, 0.12);
  --info: #2F5FD3;
  --info-text: #2851B8;
  --info-soft: rgba(47, 95, 211, 0.12);
  --scrim: rgba(15, 21, 43, 0.32);
  --overlay-bg: rgba(255, 255, 255, 0.74);
  --toast-good: #4CC96B;
  --toast-warn: #F2B544;
  --toast-crit: #F07878;
  --toast-info: #8FB0FF;
  --toast-btn: rgba(255, 255, 255, 0.14);

  --s1: #2F5FD3;
  --s2: #E0792F;
  --s3: #1A9E78;
  --s-mute: #A3AABB;
  --grid: rgba(15, 21, 43, 0.08);
  --axis: rgba(15, 21, 43, 0.2);
  --surface: #F4F6F9;

  --control: rgba(255, 255, 255, 0.55);
  --control-hover: rgba(255, 255, 255, 0.85);
  --seg-bg: rgba(15, 21, 43, 0.06);
  --input-bg: rgba(255, 255, 255, 0.5);
  --code-bg: rgba(15, 21, 43, 0.05);
  --tip-bg: rgba(255, 255, 255, 0.95);
  --btn: #0F152B;
  --btn-hover: #1B2342;
  --btn-text: #FFFFFF;
  --avatar-bg: #0F152B;
  --avatar-text: #FFFFFF;

  --font-display: 'Unbounded', system-ui, sans-serif;
  --font-text: 'Golos Text', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: ui-monospace, 'Cascadia Mono', Consolas, 'JetBrains Mono', monospace;

  --r-xl: 28px;
  --r-lg: 22px;
  --r-md: 14px;
  --r-sm: 10px;
  --blur: 16px;
  --pad: 20px 22px;
  --rail-w: 236px;
  --gap: 16px;

  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-spring: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-soft: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* Пружины для CSS-переходов: затухающие колебания, посчитанные по формуле пружины */
@supports (animation-timing-function: linear(0, 1)) {
  :root {
    --ease-spring: linear(0, 0.0606, 0.2067, 0.3923, 0.5826, 0.7546, 0.895, 0.9989, 1.0671, 1.1041, 1.1166, 1.1116, 1.0956, 1.0744, 1.052, 1.0315, 1.0145, 1.0017, 0.9931, 0.9883, 0.9864, 0.9868, 0.9885, 0.9909, 0.9935, 0.996, 1);
    --ease-soft: linear(0, 0.0487, 0.1614, 0.3009, 0.4433, 0.5748, 0.6882, 0.7812, 0.8541, 0.909, 0.9487, 0.9761, 0.9939, 1.0047, 1.0105, 1.0129, 1.0131, 1.0121, 1.0104, 1.0085, 1.0067, 1.005, 1.0036, 1.0025, 1.0016, 1.001, 1);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #171A21;
  --bg-light-1: #223656;
  --bg-light-2: #44321F;
  --bg-light-3: #452535;
  --bg-light-4: #1B3835;
  --hex-fill-1: rgba(79, 123, 224, 0.16);
  --hex-fill-2: rgba(255, 110, 138, 0.12);
  --line: rgba(255, 255, 255, 0.16);
  --mesh: rgba(255, 255, 255, 0.11);
  --glass: rgba(255, 255, 255, 0.055);
  --glass-strong: rgba(255, 255, 255, 0.12);
  --glass-soft: rgba(255, 255, 255, 0.045);
  --glass-edge: rgba(255, 255, 255, 0.13);
  --glass-highlight: rgba(255, 255, 255, 0.22);
  --glass-sheen: rgba(255, 255, 255, 0.05);
  --glass-spec: rgba(255, 255, 255, 0.1);
  --glass-shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 18px 40px -12px rgba(0, 0, 0, 0.55);
  --hair: rgba(255, 255, 255, 0.09);
  --hair-strong: rgba(255, 255, 255, 0.18);
  --ink: #EEF0F6;
  --ink-2: #B5BCCF;
  --ink-3: #A6B1C7;
  --accent: #FF6E8A;
  --accent-text: #FF8AA1;
  --accent-soft: rgba(255, 110, 138, 0.18);
  --good-text: #4CC96B;
  --good-soft: rgba(76, 201, 107, 0.14);
  --warn-text: #F2B544;
  --warn-soft: rgba(242, 181, 68, 0.16);
  --crit-text: #F07878;
  --crit-soft: rgba(240, 120, 120, 0.14);
    --info: #4F7BE0; --info-text: #8FB0FF; --info-soft: rgba(79, 123, 224, 0.18);
    --scrim: rgba(0, 0, 0, 0.5); --overlay-bg: rgba(34, 38, 48, 0.86);
    --toast-good: #0E7A33; --toast-warn: #8A5A00; --toast-crit: #B42828; --toast-info: #2851B8; --toast-btn: rgba(0, 0, 0, 0.08);
  --s1: #4F7BE0;
  --s2: #D95926;
  --s3: #199E70;
  --s-mute: #5B6478;
  --grid: rgba(255, 255, 255, 0.08);
  --axis: rgba(255, 255, 255, 0.2);
  --surface: #2A2E36;
  --control: rgba(255, 255, 255, 0.07);
  --control-hover: rgba(255, 255, 255, 0.14);
  --seg-bg: rgba(0, 0, 0, 0.28);
  --input-bg: rgba(0, 0, 0, 0.22);
  --code-bg: rgba(0, 0, 0, 0.25);
  --tip-bg: rgba(38, 42, 50, 0.97);
  --btn: #EEF0F6;
  --btn-hover: #FFFFFF;
  --btn-text: #171A21;
  --avatar-bg: #EEF0F6;
  --avatar-text: #171A21;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #171A21;
    --bg-light-1: #223656;
    --bg-light-2: #44321F;
    --bg-light-3: #452535;
    --bg-light-4: #1B3835;
    --hex-fill-1: rgba(79, 123, 224, 0.16);
    --hex-fill-2: rgba(255, 110, 138, 0.12);
    --line: rgba(255, 255, 255, 0.16);
    --mesh: rgba(255, 255, 255, 0.11);
    --glass: rgba(255, 255, 255, 0.055);
    --glass-strong: rgba(255, 255, 255, 0.12);
    --glass-soft: rgba(255, 255, 255, 0.045);
    --glass-edge: rgba(255, 255, 255, 0.13);
    --glass-highlight: rgba(255, 255, 255, 0.22);
    --glass-sheen: rgba(255, 255, 255, 0.05);
  --glass-spec: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 18px 40px -12px rgba(0, 0, 0, 0.55);
    --hair: rgba(255, 255, 255, 0.09);
    --hair-strong: rgba(255, 255, 255, 0.18);
    --ink: #EEF0F6;
    --ink-2: #B5BCCF;
    --ink-3: #A6B1C7;
    --accent: #FF6E8A;
    --accent-text: #FF8AA1;
    --accent-soft: rgba(255, 110, 138, 0.18);
    --good-text: #4CC96B;
    --good-soft: rgba(76, 201, 107, 0.14);
    --warn-text: #F2B544;
    --warn-soft: rgba(242, 181, 68, 0.16);
    --crit-text: #F07878;
    --crit-soft: rgba(240, 120, 120, 0.14);
    --info: #4F7BE0; --info-text: #8FB0FF; --info-soft: rgba(79, 123, 224, 0.18);
    --scrim: rgba(0, 0, 0, 0.5); --overlay-bg: rgba(34, 38, 48, 0.86);
    --toast-good: #0E7A33; --toast-warn: #8A5A00; --toast-crit: #B42828; --toast-info: #2851B8; --toast-btn: rgba(0, 0, 0, 0.08);
    --s1: #4F7BE0;
    --s2: #D95926;
    --s3: #199E70;
    --s-mute: #5B6478;
    --grid: rgba(255, 255, 255, 0.08);
    --axis: rgba(255, 255, 255, 0.2);
    --surface: #2A2E36;
    --control: rgba(255, 255, 255, 0.07);
    --control-hover: rgba(255, 255, 255, 0.14);
    --seg-bg: rgba(0, 0, 0, 0.28);
    --input-bg: rgba(0, 0, 0, 0.22);
    --code-bg: rgba(0, 0, 0, 0.25);
    --tip-bg: rgba(38, 42, 50, 0.97);
    --btn: #EEF0F6;
    --btn-hover: #FFFFFF;
    --btn-text: #171A21;
    --avatar-bg: #EEF0F6;
    --avatar-text: #171A21;
  }
}
}
@layer base{

/* ---------- База ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  /* Тонкая полоса прокрутки с едва заметным ползунком: при переходе наверх светлый ползунок не выскакивает.
     Фон на html не задавать: тогда фон body перестаёт уходить на холст и ложится поверх слоя .backdrop (z-index: -1) */
  scrollbar-width: thin; scrollbar-color: var(--hair-strong) transparent;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 15px;
  line-height: 1.5;
  font-feature-settings: 'kern' 1, 'liga' 1;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, p, ul, ol, dl, figure, pre { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
b { font-weight: 600; }
small { font-size: 13px; }
kbd { font-family: var(--font-text); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip {
  position: absolute; left: 16px; top: -100px; z-index: 100;
  padding: 10px 14px; border-radius: 10px;
  background: var(--btn); color: var(--btn-text); font-weight: 500;
}
.skip:focus { top: 16px; }

.ic {
  width: 20px; height: 20px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.75;
  stroke-linecap: round; stroke-linejoin: round;
}
.ic-sm { width: 16px; height: 16px; }
}
@layer ui{

/* ---------- Фон: свет за стеклом ---------- */

.backdrop {
  position: fixed; inset: 0; z-index: -1; overflow: hidden;
  background: var(--bg);
}
.lights, .shapes { position: absolute; inset: 0; will-change: transform; }
.light {
  position: absolute; display: block; border-radius: 50%;
  will-change: transform;
}
/* Контуры знака: тонкие линии резкие в зазорах между панелями и расплываются под стеклом */
.hex {
  position: absolute; display: block; overflow: visible;
  fill: none; stroke: var(--line); stroke-width: 3px; stroke-linejoin: round;
  will-change: transform;
}
.hex-1 { width: 46vw; height: 46vw; left: -9vw; top: -12vw; animation: hex-1 150s ease-in-out infinite alternate; }
.hex-2 { width: 30vw; height: 30vw; right: 3vw; top: 20vh; animation: hex-2 130s ease-in-out infinite alternate; }
.hex-3 { width: 38vw; height: 38vw; left: 28vw; bottom: -16vw; animation: hex-3 170s ease-in-out infinite alternate; }
.hex-4 { width: 16vw; height: 16vw; right: 30vw; bottom: 8vh; animation: hex-4 110s ease-in-out infinite alternate; }
@keyframes hex-1 { to { transform: translate(5vw, 4vw) rotate(24deg); } }
@keyframes hex-2 { to { transform: translate(-6vw, 7vw) rotate(-30deg); } }
@keyframes hex-3 { to { transform: translate(7vw, -4vw) rotate(18deg); } }
@keyframes hex-4 { to { transform: translate(-9vw, -10vw) rotate(-40deg); } }
/* Заливки знака: под стеклом читаются как мягкие цветные шестиугольники, в зазорах края резкие */
.hex-fill {
  position: absolute; display: block;
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  will-change: transform;
}
.hex-fill-1 { width: 24vw; height: 28vw; left: 38vw; top: 8vh; background: var(--hex-fill-1); animation: hexf-1 140s ease-in-out infinite alternate; }
.hex-fill-2 { width: 17vw; height: 20vw; left: 63vw; top: 54vh; background: var(--hex-fill-2); animation: hexf-2 120s ease-in-out infinite alternate; }
@keyframes hexf-1 { to { transform: translate(-7vw, 9vh) rotate(16deg); } }
@keyframes hexf-2 { to { transform: translate(5vw, -10vh) rotate(-22deg); } }
/* Точечная сетка: видна между панелями, под стеклом сливается в ровный тон */
.mesh {
  position: absolute; inset: 0; display: block;
  background-image: radial-gradient(circle, var(--mesh) 1px, transparent 1.6px);
  background-size: 24px 24px; background-position: 12px 12px;
}
.light-1 {
  width: 80vw; height: 80vw; left: -22vw; top: -34vw;
  background: radial-gradient(closest-side, var(--bg-light-1) 0%, var(--bg-light-1) 30%, transparent 100%);
  animation: drift-1 90s ease-in-out infinite alternate;
}
.light-2 {
  width: 70vw; height: 70vw; right: -24vw; top: -8vw;
  background: radial-gradient(closest-side, var(--bg-light-2) 0%, var(--bg-light-2) 30%, transparent 100%);
  animation: drift-2 110s ease-in-out infinite alternate;
}
.light-3 {
  width: 66vw; height: 66vw; left: 10vw; bottom: -34vw;
  background: radial-gradient(closest-side, var(--bg-light-3) 0%, var(--bg-light-3) 30%, transparent 100%);
  animation: drift-3 100s ease-in-out infinite alternate;
}
.light-4 {
  width: 56vw; height: 56vw; right: -4vw; bottom: -22vw;
  background: radial-gradient(closest-side, var(--bg-light-4) 0%, var(--bg-light-4) 30%, transparent 100%);
  animation: drift-4 120s ease-in-out infinite alternate;
}
@keyframes drift-1 { to { transform: translate(8vw, 6vw); } }
@keyframes drift-2 { to { transform: translate(-7vw, 9vw); } }
@keyframes drift-3 { to { transform: translate(9vw, -5vw); } }
@keyframes drift-4 { to { transform: translate(-6vw, -7vw); } }

.backdrop::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.7 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
:root[data-theme="dark"] .backdrop::after { opacity: 0.09; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.7 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .backdrop::after { opacity: 0.09; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.7 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
}

body.no-motion .light, body.no-motion .hex, body.no-motion .hex-fill { animation: none; }
}
@layer ui{

/* ---------- Стекло ---------- */

.pane {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  padding: var(--pad);
  background: var(--glass);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(140%);
  backdrop-filter: blur(var(--blur)) saturate(140%);
  border: 1px solid var(--glass-edge);
  border-radius: var(--r-lg);
  box-shadow: inset 0 1px 0 var(--glass-highlight), var(--glass-shadow);
}
.pane::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--glass-sheen) 0%, transparent 42%);
}
/* Блик под курсором: координаты --mx/--my ставит motion/fx.ts */
.pane::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  border-radius: inherit; opacity: 0;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), var(--glass-spec), transparent 62%);
  transition: opacity 0.35s;
}
@media (hover: hover) and (pointer: fine) {
  .pane.is-lit::after { opacity: 1; }
}

.pane-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 32px;
}
.pane-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 15px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.3;
}
.pane-icon { width: 18px; height: 18px; color: var(--ink-2); }
.pane-tools { display: flex; align-items: center; gap: 10px; flex: none; }
.pane-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.meta { font-size: 13px; color: var(--ink-3); display: inline-flex; align-items: center; gap: 6px; }
.link { font-size: 13px; font-weight: 500; color: var(--accent-text); border-radius: 4px; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }
/* Ссылка в новую вкладку: по target="_blank" справа от текста рисуется «стрелка из квадрата» (та же форма, что у i-external) */
a[target="_blank"]:not(.icon-btn, .site-preview, [data-no-ext]):not(:has(> img))::after {
  content: ""; display: inline-block; flex: none; width: 0.9em; height: 0.9em; margin-left: 0.3em; vertical-align: -0.08em;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 4h6v6M20 4l-9 9M19 13v6H5V5h6'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 4h6v6M20 4l-9 9M19 13v6H5V5h6'/%3E%3C/svg%3E") center / contain no-repeat;
}
.btn[target="_blank"]::after { margin-left: 0; width: 1em; height: 1em; }
.text-warn { color: var(--warn-text); }
}
@layer ui{

/* ---------- Каркас ---------- */

.shell {
  display: grid;
  grid-template-columns: var(--rail-w) minmax(0, 1fr);
  min-height: 100vh;
}

.rail {
  position: sticky; top: 16px; align-self: start;
  height: calc(100vh - 32px);
  margin: 16px 0 16px 16px;
  padding: 18px 14px;
  gap: 18px;
  border-radius: var(--r-xl);
  z-index: 20;
}

.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 8px; border-radius: 12px;
}
.brand-mark { width: 30px; height: 30px; flex: none; fill: none; stroke: var(--ink); stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
/* Правило без контекста: путь живёт внутри <symbol>, и селектор с .brand-mark до клона в <use> не достаёт */
.hex-accent { stroke: var(--accent); }
.brand-name { font-family: var(--font-display); font-weight: 500; font-size: 15px; letter-spacing: 0.02em; white-space: nowrap; }

.nav {
  position: relative; isolation: isolate; display: flex; flex-direction: column; gap: 4px;
  flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; margin: 0 -14px; padding: 0 14px;
  scrollbar-width: none; overscroll-behavior: contain; scroll-padding-block: 8px 36px;
  -webkit-mask-image: linear-gradient(transparent, #000 var(--nav-fade), #000 calc(100% - 28px), transparent);
  mask-image: linear-gradient(transparent, #000 var(--nav-fade), #000 calc(100% - 28px), transparent);
}
.nav::-webkit-scrollbar { display: none; }
/* Верхнее затухание появляется только после прокрутки списка (класс ставит рейка по событию scroll):
   иначе первый пункт был бы бледным. Анимация по scroll-timeline здесь лишняя: это работа на каждом кадре */
@property --nav-fade { syntax: "<length>"; inherits: false; initial-value: 0px; }
.nav { transition: --nav-fade 0.25s; }
.nav.is-scrolled { --nav-fade: 28px; }
.nav-link {
  position: relative; z-index: 1;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 12px;
  color: var(--ink-2); font-weight: 500; font-size: 15px; white-space: nowrap;
  transition: background 0.18s, color 0.18s;
}
.nav-link:hover { background: var(--control); color: var(--ink); }
.nav-link[aria-current="page"] { color: var(--ink); }
.nav-link[aria-current="page"]:hover { background: transparent; }
/* Бегунок активного раздела: один элемент, который переезжает пружиной (motion/fx.ts) */
.nav-pill {
  position: absolute; left: 0; top: 0; z-index: 0; width: 0; height: 0; opacity: 0;
  border-radius: 12px; pointer-events: none;
  background: var(--glass-strong);
  box-shadow: inset 0 1px 0 var(--glass-highlight), 0 1px 2px rgba(15, 21, 43, 0.06);
}
.nav-pill::before, .nav:not(.has-pill) .nav-link[aria-current="page"]::before {
  content: ""; position: absolute; left: -14px; top: 50%; translate: 0 -50%;
  width: 3px; height: 22px; border-radius: 3px; background: var(--accent);
}
.nav:not(.has-pill) .nav-link[aria-current="page"] {
  background: var(--glass-strong);
  box-shadow: inset 0 1px 0 var(--glass-highlight), 0 1px 2px rgba(15, 21, 43, 0.06);
}

.rail-foot { margin-top: auto; }
.me { display: flex; align-items: center; gap: 10px; padding: 6px 8px; }
.me-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.me-text b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-text small { color: var(--ink-3); font-size: 12.5px; }
/* Настройки живут не в меню, а кнопкой справа от имени; на странице настроек кнопка подсвечена как активный пункт */
.me-settings { width: 36px; height: 36px; margin-left: auto; border-radius: 11px; }
.me-settings .ic { width: 18px; height: 18px; }
.me-settings[aria-current="page"] { background: var(--glass-strong); color: var(--ink); }

.content { min-width: 0; padding: 16px 24px 32px; }

.topbar {
  display: flex; align-items: center; justify-content: flex-end; gap: 16px;
  min-height: 44px; margin-bottom: 20px;
}
.topbar-right { display: flex; align-items: center; gap: 10px; }

.search {
  position: relative; display: flex; align-items: center; gap: 10px;
  flex: 0 1 460px; height: 42px; padding: 0 12px 0 14px;
  background: var(--input-bg); border: 1px solid var(--glass-edge); border-radius: 14px;
  box-shadow: inset 0 1px 0 var(--glass-highlight);
  color: var(--ink-3);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  transition: background 0.18s, border-color 0.18s;
}
.search:focus-within { background: var(--control-hover); border-color: var(--hair-strong); color: var(--ink-2); }
.search input {
  flex: 1; min-width: 0; height: 100%; background: none; border: 0; outline: 0;
  color: var(--ink); font-size: 15px;
}
.search input::placeholder { color: var(--ink-3); }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.search kbd {
  font-size: 12px; color: var(--ink-3); padding: 2px 7px;
  border: 1px solid var(--hair-strong); border-radius: 6px; line-height: 1.4; white-space: nowrap;
}

.main { outline: none; }
}
@layer ui{

/* ---------- Сетка ---------- */

.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap); }
/* Ячейка шириной в N колонок; с какой колонки она начинается, решает порядок ячеек */
.c3 { grid-column-end: span 3; }
.c4 { grid-column-end: span 4; }
.c5 { grid-column-end: span 5; }
.c6 { grid-column-end: span 6; }
.c7 { grid-column-end: span 7; }
.c8 { grid-column-end: span 8; }
.c9 { grid-column-end: span 9; }
.c10 { grid-column-end: span 10; }
.c11 { grid-column-end: span 11; }
.c12 { grid-column-end: span 12; }

.page-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin: 4px 4px 20px;
}
.page-title { font-family: var(--font-display); font-weight: 500; font-size: 24px; line-height: 1.2; letter-spacing: -0.01em; }
.page-sub { color: var(--ink-3); font-size: 14px; margin-top: 4px; }
.page-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.section-title { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; margin: 0 0 12px 4px; }
}
@layer ui{

/* ---------- Приборная панель: время, погода, курсы ---------- */

.cluster {
  display: grid;
  grid-template-columns: 1.1fr 1.25fr 1.15fr;
  gap: 0;
  padding: 24px 28px;
  border-radius: var(--r-xl);
}
.cluster-cell { min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 8px; }
.cluster-cell + .cluster-cell { border-left: 1px solid var(--hair); padding-left: 28px; margin-left: 28px; }

.clock {
  display: block;
  font-family: var(--font-display); font-weight: 300;
  font-size: clamp(46px, 4.4vw, 72px); line-height: 1; letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.date { font-size: 17px; color: var(--ink-2); text-transform: lowercase; }
.date::first-letter { text-transform: uppercase; }

.weather-now { display: flex; align-items: center; gap: 16px; }
.weather-icon { width: 52px; height: 52px; flex: none; fill: none; stroke: var(--ink); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.temp { font-size: 38px; font-weight: 500; line-height: 1; letter-spacing: -0.02em; }
.weather-desc { color: var(--ink-2); font-size: 14px; margin-top: 4px; }
.forecast { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; }
.forecast li { display: grid; grid-template-columns: 64px 20px 44px 44px; align-items: center; gap: 8px; font-size: 14px; }
.fc-day { color: var(--ink-3); }
.fc-hi { font-weight: 600; font-variant-numeric: tabular-nums; }
.fc-lo { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.forecast .ic { color: var(--ink-2); }

.cluster-fx { gap: 10px; }
.fx-list { display: flex; flex-direction: column; gap: 6px; max-width: 420px; }
.fx { display: grid; grid-template-columns: 30px 72px 60px minmax(60px, 1fr); align-items: center; gap: 10px; }
.fx-sym {
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--control); border: 1px solid var(--glass-edge);
  font-weight: 600; font-size: 14px; color: var(--ink-2);
}
.fx-val { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.spark { display: block; height: 28px; min-width: 0; }
.spark svg { display: block; width: 100%; height: 100%; overflow: visible; }
.spark .area { opacity: 0.12; }
.spark .marker { stroke: var(--surface); stroke-width: 2; }
.spark-sm { height: 20px; width: 64px; }
.spark-tile { height: 36px; margin-top: 4px; }
}
@layer ui{

/* ---------- Элементы управления ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 16px; border-radius: 12px;
  font-size: 14px; font-weight: 500; line-height: 1; white-space: nowrap;
  border: 1px solid transparent;
  transition: background 0.18s, color 0.18s, box-shadow 0.18s, border-color 0.18s;
}
.btn .ic { width: 18px; height: 18px; }
.btn-primary { background: var(--btn); color: var(--btn-text); }
.btn-primary:hover { background: var(--btn-hover); }
.btn-ghost {
  background: var(--control); color: var(--ink); border-color: var(--glass-edge);
  box-shadow: inset 0 1px 0 var(--glass-highlight);
}
.btn-ghost:hover { background: var(--control-hover); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn-sm .ic { width: 16px; height: 16px; }

.icon-btn {
  position: relative;
  display: inline-grid; place-items: center;
  width: 40px; height: 40px; border-radius: 12px; flex: none;
  background: var(--control); border: 1px solid var(--glass-edge);
  box-shadow: inset 0 1px 0 var(--glass-highlight);
  color: var(--ink-2);
  transition: background 0.18s, color 0.18s;
}
.icon-btn:hover { background: var(--control-hover); color: var(--ink); }
.icon-btn[aria-pressed="true"] { background: var(--btn); color: var(--btn-text); border-color: transparent; }
:root[data-mode="dark"] .ic-sun, :root:not([data-mode="dark"]) .ic-moon { display: none; }
.icon-btn-sm { width: 30px; height: 30px; border-radius: 9px; }
.icon-btn-sm .ic { width: 17px; height: 17px; }
/* Счётчик поверх кнопки: цифра по центру сетки, чернильный текст на коралле читается в обеих темах, без обводки */
.badge {
  position: absolute; top: -6px; right: -6px;
  display: inline-grid; place-items: center;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--accent); color: var(--on-accent);
  font-size: 11px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums;
  box-shadow: 0 1px 2px rgba(15, 21, 43, 0.18);
}

.avatar {
  display: inline-grid; place-items: center; flex: none;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--avatar-bg); color: var(--avatar-text);
  font-weight: 600; font-size: 15px;
}
.avatar-sm { width: 34px; height: 34px; font-size: 14px; }
.avatar-lg { width: 64px; height: 64px; font-size: 24px; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 11px 0 8px; border-radius: 999px;
  font-size: 13px; font-weight: 500; white-space: nowrap;
}
.chip .ic { width: 16px; height: 16px; }
.chip-good { background: var(--good-soft); color: var(--good-text); }
.chip-warn { background: var(--warn-soft); color: var(--warn-text); }

.seg {
  position: relative; isolation: isolate;
  display: inline-flex; gap: 2px; padding: 3px;
  background: var(--seg-bg); border-radius: 10px;
}
.seg button {
  position: relative; z-index: 1;
  display: inline-flex; align-items: center; gap: 6px;
  height: 26px; padding: 0 10px; border-radius: 8px;
  font-size: 13px; font-weight: 500; color: var(--ink-2); white-space: nowrap;
  transition: color 0.18s;
}
.seg button .ic { width: 16px; height: 16px; }
.seg button:hover { color: var(--ink); }
.seg button[aria-selected="true"] { color: var(--ink); }
.seg-pill, .seg:not(.has-pill) button[aria-selected="true"] {
  background: var(--glass-strong);
  box-shadow: inset 0 1px 0 var(--glass-highlight), 0 1px 2px rgba(15, 21, 43, 0.08);
}
.seg-pill { position: absolute; left: 0; top: 0; z-index: 0; width: 0; height: 0; opacity: 0; border-radius: 8px; pointer-events: none; }

.select-wrap { position: relative; display: inline-flex; align-items: center; }
.select-wrap .ic { position: absolute; right: 9px; width: 16px; height: 16px; pointer-events: none; color: var(--ink-3); }
.select {
  appearance: none; -webkit-appearance: none;
  height: 32px; padding: 0 30px 0 12px; border-radius: 10px;
  background: var(--control); border: 1px solid var(--glass-edge);
  box-shadow: inset 0 1px 0 var(--glass-highlight);
  font-size: 13px; font-weight: 500; color: var(--ink); cursor: pointer;
  width: 100%;
}
.select:hover { background: var(--control-hover); }
.select option { background: var(--surface); color: var(--ink); }
/* Chromium со стилизуемым select: список рисуется как стекло и раскрывается с движением.
   В других браузерах остаётся системный список в цветах темы (правило выше). */
@supports (appearance: base-select) {
  .select, .select::picker(select) { appearance: base-select; }
  /* Кнопка стилизуемого select — флекс-контейнер: без выравнивания текст прижимается к верху */
  .select { align-items: center; }
  .select::picker-icon { display: none; }
  .select::picker(select) {
    margin: 6px 0 0; padding: 6px; min-width: anchor-size(width);
    border: 1px solid var(--glass-edge); border-radius: 12px;
    background: var(--tip-bg);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    box-shadow: 0 12px 32px -10px rgba(15, 21, 43, 0.35);
    color: var(--ink); font-family: var(--font-text); font-size: 13px;
    opacity: 0; translate: 0 -6px;
    transition: opacity 0.16s, translate 0.28s var(--ease-out), display 0.28s allow-discrete, overlay 0.28s allow-discrete;
  }
  .select::picker(select):popover-open { opacity: 1; translate: 0 0; }
  @starting-style { .select::picker(select):popover-open { opacity: 0; translate: 0 -6px; } }
  .select option {
    display: flex; align-items: center; gap: 8px;
    padding: 7px 10px; border-radius: 8px;
    background: none; color: var(--ink-2); font-weight: 500; cursor: pointer; white-space: nowrap;
  }
  .select option:hover, .select option:focus-visible { background: var(--control-hover); color: var(--ink); outline: none; }
  .select option:checked { background: var(--seg-bg); color: var(--ink); }
  .select option::checkmark { order: 1; margin-left: auto; padding-left: 12px; font-size: 12px; color: var(--accent-text); }
}
.grow { flex: 1; }

.input {
  height: 38px; padding: 0 12px; border-radius: 10px;
  background: var(--input-bg); border: 1px solid var(--glass-edge);
  box-shadow: inset 0 1px 0 var(--glass-highlight);
  font-size: 14px; color: var(--ink); min-width: 0; width: 100%;
  transition: background 0.18s, border-color 0.18s;
}
.input::placeholder { color: var(--ink-3); }
.input:focus { outline: none; border-color: var(--hair-strong); background: var(--control-hover); box-shadow: 0 0 0 3px var(--accent-soft); }

.switch {
  position: relative; flex: none;
  width: 40px; height: 24px; border-radius: 12px;
  background: var(--hair-strong);
  transition: background 0.25s;
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px; border-radius: 9px;
  background: #fff; box-shadow: 0 1px 3px rgba(15, 21, 43, 0.3);
  transition: translate 0.5s var(--ease-spring), width 0.15s var(--ease-out);
}
.switch:active::after { width: 24px; }
.switch[aria-checked="true"] { background: var(--accent); }
.switch[aria-checked="true"]::after { translate: 16px 0; }
.switch[aria-checked="true"]:active::after { translate: 10px 0; }

.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; padding: 5px 0; }
.check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check-box {
  flex: none; width: 20px; height: 20px; margin-top: 1px; border-radius: 6px;
  border: 1.5px solid var(--hair-strong); background: var(--control);
  display: grid; place-items: center; color: var(--btn-text);
  transition: background 0.18s, border-color 0.18s;
}
.check-box .ic { width: 14px; height: 14px; stroke-width: 2.4; opacity: 0; stroke-dasharray: 1 2; stroke-dashoffset: 1.02; }
.check input:checked + .check-box { background: var(--btn); border-color: var(--btn); }
.check input:checked:focus + .check-box { animation: check-pop 0.45s var(--ease-out); }
.check input:checked + .check-box .ic { opacity: 1; stroke-dashoffset: 0; transition: stroke-dashoffset 0.3s var(--ease-out) 0.05s; }
@keyframes check-pop { 0% { scale: 0.85; } 45% { scale: 1.12; } 100% { scale: 1; } }
.check input:focus-visible + .check-box { outline: 2px solid var(--accent); outline-offset: 2px; }
.check-text { line-height: 1.45; transition: color 0.18s; }
.todo .check input:checked ~ .check-text { color: var(--ink-3); text-decoration: line-through; text-decoration-color: var(--hair-strong); }

.tag {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 30px; padding: 0 12px; border-radius: 999px;
  background: var(--control); border: 1px solid var(--glass-edge);
  box-shadow: inset 0 1px 0 var(--glass-highlight);
  font-size: 13px; font-weight: 500; color: var(--ink-2);
  transition: background 0.18s, color 0.18s;
}
.tag:hover { background: var(--control-hover); color: var(--ink); }
.tag-add { width: 30px; padding: 0; display: inline-grid; place-items: center; }
.tag-add .ic { width: 16px; height: 16px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }

.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: none; vertical-align: middle; }
.dot-good { background: var(--good); }
.dot-warn { background: var(--warn); }
.dot-crit { background: var(--crit); }
.dot-info { background: var(--ink-3); }

.delta { display: inline-flex; align-items: center; gap: 3px; font-size: 13px; font-weight: 500; white-space: nowrap; }
.delta .ic { width: 12px; height: 12px; }
.delta-up, .delta-good { color: var(--good-text); }
.delta-down, .delta-bad { color: var(--crit-text); }
.delta-flat { color: var(--ink-2); }

.state { display: inline-grid; place-items: center; width: 24px; height: 24px; flex: none; }
.state .ic { width: 20px; height: 20px; }
.state-good { color: var(--good-text); }
.state-warn { color: var(--warn-text); }
.state-info { color: var(--ink-2); }
.state-off { color: var(--ink-3); }
.state-lg { width: 48px; height: 48px; border-radius: 14px; background: var(--control); border: 1px solid var(--glass-edge); }
.state-lg .ic { width: 24px; height: 24px; }
.state-lg.state-good { background: var(--good-soft); border-color: transparent; }
.state-lg.state-warn { background: var(--warn-soft); border-color: transparent; }
}
@layer ui{

/* ---------- Списки ---------- */

.rows { display: flex; flex-direction: column; }
.row {
  display: grid; grid-template-columns: 8px minmax(0, 1fr) auto 64px; align-items: center; gap: 12px;
  padding: 9px 0; border-bottom: 1px solid var(--hair); min-height: 40px;
}
.row:last-child { border-bottom: 0; }
.row-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-meta { font-size: 13px; color: var(--ink-3); white-space: nowrap; font-variant-numeric: tabular-nums; }

.task { grid-template-columns: 40px 20px minmax(0, 1fr) auto; }
.task-icon { color: var(--ink-2); }
.task-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.task-text b { font-weight: 500; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-text small { color: var(--ink-3); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tasks-page .task { padding: 12px 0; }

.todo { display: flex; flex-direction: column; }
.todo li { border-bottom: 1px solid var(--hair); }
.todo li:last-child { border-bottom: 0; }

.quick-note { display: flex; gap: 8px; }

.timeline { display: flex; flex-direction: column; }
.timeline li {
  position: relative; display: grid; grid-template-columns: 40px 8px minmax(0, 1fr); align-items: start; gap: 10px;
  padding: 7px 0; font-size: 14px; line-height: 1.4;
}
.timeline time { color: var(--ink-3); font-size: 13px; font-variant-numeric: tabular-nums; }
.timeline .dot { margin-top: 6px; }
.timeline li::before {
  content: ""; position: absolute; left: 53px; top: 22px; bottom: -8px; width: 1px; background: var(--hair);
}
.timeline li:last-child::before { display: none; }

.minis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.minis li { display: grid; grid-template-columns: 18px minmax(0, 1fr); column-gap: 8px; align-items: center; line-height: 1.25; }
.minis .ic { width: 18px; height: 18px; color: var(--ink-3); grid-row: span 2; }
.minis b { font-size: 15px; white-space: nowrap; }
.minis span { font-size: 12.5px; color: var(--ink-3); }
.minis-stack { grid-template-columns: 1fr; gap: 10px; }
.minis-stack li { grid-template-columns: minmax(0, 1fr); }
.minis-stack b { font-size: 22px; font-weight: 600; }

.kv { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.kv div { display: flex; justify-content: space-between; gap: 12px; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; font-weight: 500; text-align: right; font-variant-numeric: tabular-nums; }
}
@layer ui{

/* ---------- Цифры ---------- */

.stat-row { display: grid; grid-template-columns: minmax(130px, auto) minmax(0, 1fr); gap: 20px; align-items: end; }
.stat-hero { display: flex; flex-direction: column; gap: 2px; }
.stat-value { font-size: 36px; font-weight: 600; line-height: 1.05; letter-spacing: -0.02em; white-space: nowrap; }
.stat-label { color: var(--ink-3); font-size: 14px; }
.stat-inline { flex-direction: row; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.stat-inline .stat-value { font-size: 30px; }

.tile { gap: 6px; padding: 18px 20px; }
.tile-head { display: flex; align-items: center; gap: 8px; color: var(--ink-3); font-size: 13.5px; font-weight: 500; }
.tile-head .ic { width: 18px; height: 18px; }
.tile-value { font-size: 32px; font-weight: 600; line-height: 1.05; letter-spacing: -0.02em; }
.tile-value small { font-size: 14px; font-weight: 500; color: var(--ink-3); margin-left: 4px; letter-spacing: 0; }
.tile-label { color: var(--ink-3); font-size: 14px; }
.tile-status { flex-direction: row; align-items: center; gap: 16px; padding: 18px 22px; }
}
@layer ui{

/* ---------- Измерители ---------- */

.meters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.meter { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.meter svg { width: 92px; height: 92px; display: block; }
.meter figcaption { display: flex; flex-direction: column; line-height: 1.25; }
.meter b { font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.meter span { font-size: 12.5px; color: var(--ink-3); }
.meter-track { fill: none; stroke: var(--grid); stroke-width: 7; stroke-linecap: round; }
.meter-fill { fill: none; stroke-width: 7; stroke-linecap: round; }
.no-fx .meter-fill { transition: stroke-dashoffset 0.8s var(--ease-out); }
}
@layer ui{

/* ---------- Быстрые действия ---------- */

.keys { display: flex; flex-direction: column; min-width: 0; }
.key-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; flex: 1; }
.key {
  gap: 10px; padding: 14px 8px; align-items: center; justify-content: center;
  border-radius: var(--r-md);
  font-size: 12.5px; font-weight: 500; line-height: 1.25; color: var(--ink-2); text-align: center;
  transition: background 0.18s, color 0.18s;
}
.key .ic { width: 22px; height: 22px; color: var(--ink); }
.key:hover { background: var(--glass-strong); color: var(--ink); }
.key:active { background: var(--control-hover); }
}
@layer ui{

/* ---------- Сайт ---------- */

.site-preview {
  display: block; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--glass-edge); background: var(--ink);
  aspect-ratio: 16 / 10;
}
.site-preview img { width: 100%; height: 100%; object-fit: cover; transition: opacity 0.2s; }
.site-preview:hover img { opacity: 0.9; }
.site-preview.is-missing img { display: none; }
}
@layer ui{

/* ---------- Графики ---------- */

.chart { position: relative; width: 100%; min-width: 0; outline: none; border-radius: 10px; }
.chart:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart text { font-family: var(--font-text); font-size: 11.5px; fill: var(--ink-3); font-variant-numeric: tabular-nums; }
.chart .end-label { font-size: 12px; font-weight: 600; fill: var(--ink-2); }
.chart .cap-label { font-size: 12px; font-weight: 600; fill: var(--ink-2); }
.chart .grid-line { stroke: var(--grid); stroke-width: 1; }
.chart .axis-line { stroke: var(--axis); stroke-width: 1; }
.chart .series { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { opacity: 0.1; }
.chart .marker { stroke: var(--surface); stroke-width: 2; }
.chart .crosshair { stroke: var(--axis); stroke-width: 1; }
.chart .hit { fill: transparent; cursor: crosshair; }
.chart .bar { transition: opacity 0.15s; }
.chart .bar.is-hot { opacity: 0.75; }
.chart .bar-hit { fill: transparent; cursor: pointer; }
.chart-line { min-height: 220px; }
.chart-bars { min-height: 96px; }
.chart-tall { min-height: 240px; }

.chart-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12.5px; color: var(--ink-2); margin-bottom: 4px; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-key { width: 14px; height: 2px; border-radius: 1px; background: var(--k); }
.legend-key.is-rect { width: 10px; height: 10px; border-radius: 2px; }

.tip {
  position: absolute; z-index: 5; pointer-events: none;
  min-width: 128px; padding: 8px 10px; border-radius: 10px;
  background: var(--tip-bg); border: 1px solid var(--glass-edge);
  box-shadow: 0 8px 24px -8px rgba(15, 21, 43, 0.3);
  font-size: 12.5px; color: var(--ink); line-height: 1.4;
  opacity: 0; transition: opacity 0.12s;
}
.tip.is-on { opacity: 1; }
.tip-title { color: var(--ink-3); margin-bottom: 4px; white-space: nowrap; }
.tip-row { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.tip-key { width: 12px; height: 2px; border-radius: 1px; background: var(--k); flex: none; }
.tip-key.is-rect { width: 8px; height: 8px; border-radius: 2px; }
.tip-name { color: var(--ink-2); }
.tip-val { margin-left: auto; font-weight: 600; font-variant-numeric: tabular-nums; }

.chart-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.chart-table th, .chart-table td { padding: 6px 8px; text-align: right; border-bottom: 1px solid var(--hair); font-variant-numeric: tabular-nums; }
.chart-table th:first-child, .chart-table td:first-child { text-align: left; }
.chart-table th { font-weight: 500; color: var(--ink-3); font-size: 12.5px; }
.chart-table tr:last-child td { border-bottom: 0; }
.chart-table-wrap { max-height: 260px; overflow: auto; }
.chart.is-table > svg, .chart.is-table > .chart-legend, .chart.is-table > .tip { display: none; }
.chart:not(.is-table) > .chart-table-wrap { display: none; }
}
@layer ui{

/* ---------- Таблицы и логи ---------- */

.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left; font-weight: 500; color: var(--ink-3); font-size: 12.5px;
  padding: 4px 8px 8px; border-bottom: 1px solid var(--hair); white-space: nowrap;
}
.table td { padding: 10px 8px; border-bottom: 1px solid var(--hair); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table td:first-child, .table th:first-child { padding-left: 0; }
.table td:last-child, .table th:last-child { padding-right: 0; }
.table .dot { margin-right: 10px; }
.table-num td:last-child, .table-num th:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.containers td:nth-child(2) { color: var(--ink-3); font-size: 13px; }
.containers td:nth-child(3) { font-variant-numeric: tabular-nums; white-space: nowrap; }
.containers td:last-child { text-align: right; }

.log {
  font-family: var(--font-mono); font-size: 12.5px; line-height: 1.65;
  background: var(--code-bg); border-radius: 12px; padding: 12px 14px;
  overflow: auto; max-height: 280px; color: var(--ink-2); white-space: pre;
}
.log-line { display: block; }
.log time { color: var(--ink-3); }
.lvl { font-weight: 600; }
.lvl-info { color: var(--ink-2); }
.lvl-warn { color: var(--warn-text); }
.lvl-err { color: var(--crit-text); }

.code {
  width: 100%; resize: vertical; min-height: 120px;
  font-family: var(--font-mono); font-size: 13px; line-height: 1.6;
  background: var(--code-bg); border: 1px solid transparent; border-radius: 12px; padding: 12px 14px;
  color: var(--ink);
}
.code:focus { outline: none; border-color: var(--hair-strong); box-shadow: 0 0 0 3px var(--accent-soft); }

.deploy-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.deploy-repo { display: flex; flex-direction: column; flex: 1; min-width: 180px; line-height: 1.3; }
.deploy-repo small { color: var(--ink-3); font-size: 12.5px; }
.status-line { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink-2); }
.form-row { display: flex; gap: 10px; align-items: center; }
}
@layer ui{

/* ---------- Заметки ---------- */

.notes-layout { display: grid; grid-template-columns: 272px minmax(0, 1fr) 272px; gap: var(--gap); align-items: start; }
.note-list { padding: 8px; gap: 2px; }
.note-item {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 10px minmax(0, 1fr); gap: 12px; align-items: center;
  width: 100%; padding: 11px 12px; border-radius: 12px; text-align: left;
  transition: background 0.18s;
}
.note-item:hover { background: var(--control); }
.note-item[aria-selected="true"]:hover { background: transparent; }
.note-pill, .note-list:not(.has-pill) .note-item[aria-selected="true"] { background: var(--glass-strong); box-shadow: inset 0 1px 0 var(--glass-highlight), 0 1px 2px rgba(15, 21, 43, 0.06); }
.note-pill { position: absolute; left: 0; top: 0; z-index: 0; width: 0; height: 0; opacity: 0; border-radius: 12px; pointer-events: none; }
.swatch { width: 10px; height: 10px; border-radius: 50%; }
.sw-1 { background: var(--s1); }
.sw-2 { background: var(--s3); }
.sw-3 { background: var(--s2); }
.sw-4 { background: var(--accent); }
.sw-5 { background: var(--ink-3); }
.note-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.note-text b { font-weight: 500; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.note-text small { color: var(--ink-3); font-size: 12.5px; }

.editor { gap: 12px; min-height: 520px; }
.toolbar { display: flex; align-items: center; gap: 2px; padding: 4px; background: var(--seg-bg); border-radius: 12px; }
.tb {
  display: inline-grid; place-items: center; width: 32px; height: 30px; border-radius: 8px;
  color: var(--ink-2); font-size: 14px; transition: background 0.15s, color 0.15s;
}
.tb:hover { background: var(--glass-strong); color: var(--ink); }
.tb .ic { width: 17px; height: 17px; }
.tb-sep { width: 1px; height: 18px; background: var(--hair-strong); margin: 0 6px; }
.tb-spacer { flex: 1; }
.editor-title {
  width: 100%; background: none; border: 0; outline: none; padding: 4px 0;
  font-size: 24px; font-weight: 600; letter-spacing: -0.02em; color: var(--ink);
}
.editor-body {
  width: 100%; flex: 1; resize: none; background: none; border: 0; outline: none; padding: 0;
  font-size: 15px; line-height: 1.6; color: var(--ink-2);
}
.editor-foot { margin-top: auto; padding-top: 8px; border-top: 1px solid var(--hair); }
.notes-side { display: flex; flex-direction: column; gap: var(--gap); }

.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }
.cal-head { font-size: 11.5px; color: var(--ink-3); text-align: center; padding: 4px 0 6px; font-weight: 500; }
.cal-day {
  display: grid; place-items: center; height: 32px; border-radius: 9px;
  font-size: 13px; font-variant-numeric: tabular-nums; color: var(--ink);
  transition: background 0.15s;
}
.cal-day:hover { background: var(--control-hover); }
.cal-day.is-muted { color: var(--ink-3); opacity: 0.6; }
.cal-day.is-today { background: var(--btn); color: var(--btn-text); font-weight: 600; }
.cal-day.is-marked { position: relative; }
.cal-day.is-marked::after { content: ""; position: absolute; bottom: 4px; width: 4px; height: 4px; border-radius: 50%; background: var(--accent); }
}
@layer ui{

/* ---------- Автоматизации ---------- */

.flow { display: flex; flex-direction: column; }
.flow-step {
  display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 12px; align-items: center;
  padding: 12px 14px; border-radius: 12px;
  background: var(--control); border: 1px solid var(--glass-edge);
  box-shadow: inset 0 1px 0 var(--glass-highlight);
}
.flow-step .ic { color: var(--ink-2); }
.flow-step + .flow-step { margin-top: 22px; position: relative; }
.flow-step + .flow-step::before {
  content: ""; position: absolute; left: 26px; top: -22px; width: 1px; height: 22px; background: var(--hair-strong);
}
.flow-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.flow-text b { font-size: 14px; font-weight: 500; }
.flow-text small { color: var(--ink-3); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
@layer ui{

/* ---------- Настройки ---------- */

.settings { display: flex; flex-direction: column; gap: var(--gap); max-width: 720px; }
.profile { display: flex; gap: 20px; align-items: flex-start; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; flex: 1; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--ink-3); }
.field .select-wrap { width: 100%; }
.field .select { height: 38px; font-size: 14px; }
.radios { display: flex; gap: 8px; border: 0; padding: 0; margin: 0; flex-wrap: wrap; }
.radio-pill { position: relative; }
.radio-pill input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.radio-pill span {
  display: inline-flex; align-items: center; height: 36px; padding: 0 14px; border-radius: 10px;
  background: var(--control); border: 1px solid var(--glass-edge); font-size: 14px; font-weight: 500; color: var(--ink-2);
  cursor: pointer; transition: background 0.18s, color 0.18s;
}
.radio-pill input:checked + span { background: var(--btn); color: var(--btn-text); border-color: transparent; }
.radio-pill input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 0; border-top: 1px solid var(--hair); }
.setting-row .task-text b { white-space: normal; }
}
@layer ui{

/* ---------- Уведомления ---------- */

.toast-host { position: fixed; right: 20px; bottom: 20px; z-index: 50; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-radius: 14px;
  background: var(--btn); color: var(--btn-text); font-size: 14px; font-weight: 500;
  box-shadow: 0 12px 30px -10px rgba(15, 21, 43, 0.4);
}
.toast .ic { width: 18px; height: 18px; flex: none; }
.no-fx .toast { animation: toast-in 0.3s var(--ease-out) both; }
@keyframes toast-in { from { opacity: 0; translate: 0 8px; } }
}
@layer ui{

/* ---------- Страницы и движение ---------- */

.page[hidden] { display: none; }
/* Атрибут hidden сильнее любого display у класса: иначе .combo-opt, .sk-demo и другие flex-элементы не прячутся */
[hidden]:not([hidden="until-found"]) { display: none !important; }
.clock span { display: inline-block; }

/* Смена темы: новая тема раскрывается кругом от кнопки (View Transitions, координаты ставит motion/fx.ts) */
.vt-theme::view-transition-image-pair(root) { isolation: auto; }
.vt-theme::view-transition-old(root), .vt-theme::view-transition-new(root) { animation: none; mix-blend-mode: normal; display: block; }
.vt-theme::view-transition-new(root) { animation: vt-reveal 0.55s var(--ease-out); }
@keyframes vt-reveal {
  from { clip-path: circle(0px at var(--vt-x, 50%) var(--vt-y, 50%)); }
  to { clip-path: circle(var(--vt-r, 150vmax) at var(--vt-x, 50%) var(--vt-y, 50%)); }
}

@media (prefers-reduced-motion: reduce) {
  .light, .hex, .hex-fill { animation: none !important; }
  .toast, .check input:checked:focus + .check-box { animation: none !important; }
  .meter-fill, .switch::after, .check-box .ic, .pane::after { transition: none !important; }
  .vt-theme::view-transition-new(root) { animation: none; }
  .dialog, .dialog::backdrop, .menu, .popover, .tooltip, .combo-list, .nav-chev, .acc-chev, .progress-bar, .ring-fill, .radio-mark::after { transition: none !important; }
  .spinner, .dots i, .sk, .dot-pulse::after, .progress.is-indeterminate .progress-bar { animation: none !important; }
}
}
@layer ui{
/* Раскладка и утилиты */
.hstack { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; min-width: 0; }
.vstack { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.between { justify-content: space-between; }
.center { justify-content: center; }
.gap-sm { gap: 6px; }
.gap-lg { gap: 18px; }
.w-full { width: 100%; }
.w-sm { width: 220px; max-width: 100%; }
.w-md { width: 320px; max-width: 100%; }
.w-lg { width: 480px; max-width: 100%; }
.flex-1 { flex: 1; min-width: 0; }
.divider { height: 1px; background: var(--hair); border: 0; margin: 0; }
.divider-text { display: flex; align-items: center; gap: 12px; color: var(--ink-3); font-size: 12.5px; }
.divider-text::before, .divider-text::after { content: ""; flex: 1; height: 1px; background: var(--hair); }
.divider-v { width: 1px; align-self: stretch; background: var(--hair); }
.ic-xs { width: 14px; height: 14px; }
.ic-lg { width: 24px; height: 24px; }
.ic-xl { width: 32px; height: 32px; stroke-width: 1.5; }
}
@layer ui{
/* Типографика */
.display { font-family: var(--font-display); font-weight: 300; font-size: 56px; line-height: 1; letter-spacing: -0.03em; }
.h1 { font-family: var(--font-display); font-weight: 500; font-size: 24px; line-height: 1.2; letter-spacing: -0.01em; }
.h2 { font-size: 20px; font-weight: 600; line-height: 1.25; letter-spacing: -0.01em; }
.h3 { font-size: 17px; font-weight: 600; line-height: 1.3; }
.h4 { font-size: 15px; font-weight: 600; line-height: 1.35; }
.lead { font-size: 17px; line-height: 1.55; color: var(--ink-2); }
.text { font-size: 15px; line-height: 1.5; }
.text-sm { font-size: 13px; line-height: 1.45; }
.text-xs { font-size: 12px; line-height: 1.4; }
.muted { color: var(--ink-3); }
.ink-2 { color: var(--ink-2); }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.num { font-variant-numeric: tabular-nums; }
.prose { max-width: 64ch; font-size: 15px; line-height: 1.6; color: var(--ink-2); }
.prose > * + * { margin-top: 0.8em; }
.prose h2, .prose h3, .prose h4 { color: var(--ink); }
.prose > h2, .prose > h3, .prose > h4 { margin-top: 1.4em; }
.prose h2 { font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }
.prose h3 { font-size: 17px; font-weight: 600; }
.prose h4 { font-size: 15px; font-weight: 600; }
.prose ul { list-style: disc; padding-left: 22px; }
.prose ol { list-style: decimal; padding-left: 22px; }
.prose li + li { margin-top: 0.25em; }
.prose li::marker { color: var(--ink-3); }
.prose blockquote { padding: 4px 0 4px 16px; border-left: 3px solid var(--accent); color: var(--ink-2); }
.prose a { color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--accent-soft); }
.prose a:hover { text-decoration-color: currentColor; }
.prose strong, .prose b { color: var(--ink); font-weight: 600; }
.prose hr { border: 0; height: 1px; background: var(--hair); margin: 1.2em 0; }
.code-inline, .prose code { font-family: var(--font-mono); font-size: 0.9em; padding: 1px 6px; border-radius: 6px; background: var(--code-bg); color: var(--ink); }
.kbd, .prose kbd {
  display: inline-block; font-family: var(--font-text); font-size: 12px; line-height: 1.4; padding: 2px 7px;
  border: 1px solid var(--hair-strong); border-bottom-width: 2px; border-radius: 6px; color: var(--ink-2); white-space: nowrap;
}
mark, .mark { background: var(--warn-soft); color: var(--ink); border-radius: 3px; padding: 0 3px; }
.code-block {
  margin: 0; font-family: var(--font-mono); font-size: 13px; line-height: 1.6;
  background: var(--code-bg); border-radius: 12px; padding: 12px 14px; color: var(--ink-2); overflow: auto; white-space: pre;
}
.code-block code { font: inherit; }
}
@layer ui{
/* Кнопки: виды, размеры, состояния, группы */
.btn:disabled, .btn[aria-disabled="true"], .icon-btn:disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }
.btn-danger { background: var(--crit); color: #fff; }
.btn-danger:hover { background: var(--crit-text); }
.btn-soft { background: var(--accent-soft); color: var(--accent-text); }
.btn-soft:hover { background: var(--accent); color: #fff; }
.btn-text { background: transparent; color: var(--ink-2); }
.btn-text:hover { background: var(--control); color: var(--ink); }
.btn-link { background: transparent; color: var(--accent-text); padding: 0; height: auto; border-radius: 4px; }
.btn-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.btn-xs { height: 26px; padding: 0 9px; font-size: 12.5px; border-radius: 8px; gap: 5px; }
.btn-xs .ic { width: 14px; height: 14px; }
.btn-lg { height: 46px; padding: 0 22px; font-size: 15px; border-radius: 14px; }
.btn-lg .ic { width: 20px; height: 20px; }
.btn-pill { border-radius: 999px; }
.btn-block { display: flex; width: 100%; }
.btn-icon { width: 38px; padding: 0; }
.btn-icon.btn-xs { width: 26px; }
.btn-icon.btn-sm { width: 32px; }
.btn-icon.btn-lg { width: 46px; }
.btn.is-loading { pointer-events: none; }
.btn.is-loading > :not(.spinner) { opacity: 0.55; }
.btn .spinner { width: 16px; height: 16px; border-width: 2px; }
.btn-primary .spinner, .btn-danger .spinner { border-color: rgba(255, 255, 255, 0.3); border-top-color: currentColor; }
.btn[aria-pressed="true"] { background: var(--btn); color: var(--btn-text); border-color: transparent; }
.btn-group { display: inline-flex; isolation: isolate; }
.btn-group > .btn { border-radius: 0; }
.btn-group > .btn:first-child { border-radius: 12px 0 0 12px; }
.btn-group > .btn:last-child { border-radius: 0 12px 12px 0; }
.btn-group > .btn-sm:first-child { border-radius: 10px 0 0 10px; }
.btn-group > .btn-sm:last-child { border-radius: 0 10px 10px 0; }
.btn-group > .btn + .btn { margin-left: -1px; }
.btn-group > .btn:hover, .btn-group > .btn:focus-visible, .btn-group > .btn[aria-pressed="true"] { z-index: 1; }
.fab { width: 52px; height: 52px; border-radius: 18px; padding: 0; box-shadow: 0 10px 24px -8px rgba(15, 21, 43, 0.45); }
.fab .ic { width: 22px; height: 22px; }
}
@layer ui{
/* Ожидание */
.spinner {
  display: inline-block; width: 20px; height: 20px; flex: none; border-radius: 50%;
  border: 2.5px solid var(--hair-strong); border-top-color: var(--ink); animation: spin 0.8s linear infinite;
}
.spinner-sm { width: 14px; height: 14px; border-width: 2px; }
.spinner-lg { width: 32px; height: 32px; border-width: 3px; }
@keyframes spin { to { rotate: 360deg; } }
.dots { display: inline-flex; gap: 4px; align-items: center; height: 20px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: dots 1.2s ease-in-out infinite; }
.dots i:nth-child(2) { animation-delay: 0.15s; }
.dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes dots { 0%, 80%, 100% { opacity: 0.25; translate: 0 0; } 40% { opacity: 1; translate: 0 -3px; } }
}
@layer ui{
/* Поля ввода */
.input-sm { height: 32px; padding: 0 10px; font-size: 13px; border-radius: 9px; }
.input-lg { height: 46px; padding: 0 14px; font-size: 15px; border-radius: 13px; }
.input:disabled { opacity: 0.55; cursor: not-allowed; background: var(--seg-bg); }
.input[readonly] { background: transparent; border-style: dashed; }
.input.is-invalid, .field.is-invalid .input, .field.is-invalid .select, .field.is-invalid .tag-input, .field.is-invalid .stepper { border-color: var(--crit); box-shadow: 0 0 0 3px var(--crit-soft); }
.input.is-valid, .field.is-valid .input { border-color: var(--good); box-shadow: 0 0 0 3px var(--good-soft); }
.textarea { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.input-wrap { position: relative; display: flex; align-items: center; min-width: 0; }
.input-wrap > .ic { position: absolute; left: 12px; width: 18px; height: 18px; color: var(--ink-3); pointer-events: none; }
.input-wrap > .ic ~ .input { padding-left: 38px; }
.input-wrap .input:has(+ .input-btn) { padding-right: 38px; }
.input-wrap .input:has(+ .input-suffix) { padding-right: 46px; }
.input-wrap .input-btn {
  position: absolute; right: 5px; width: 28px; height: 28px; border-radius: 8px;
  display: inline-grid; place-items: center; color: var(--ink-3); transition: background 0.15s, color 0.15s;
}
.input-wrap .input-btn:hover { background: var(--control-hover); color: var(--ink); }
.input-wrap .input-btn .ic { width: 16px; height: 16px; }
.input-wrap .input-suffix { position: absolute; right: 12px; font-size: 13px; color: var(--ink-3); pointer-events: none; }
/* Присоединённые части: одна рамка и одна подложка на всю группу, части разделены дорожкой,
   поэтому подпись, поле и кнопка всегда одной высоты */
.input-addon {
  display: flex; align-items: stretch; min-width: 0; height: 38px;
  border: 1px solid var(--glass-edge); border-radius: 10px; background: var(--input-bg);
  box-shadow: inset 0 1px 0 var(--glass-highlight); overflow: hidden;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.input-addon:focus-within { border-color: var(--hair-strong); box-shadow: 0 0 0 3px var(--accent-soft); }
.input-addon > * { height: auto; min-height: 0; border: 0; border-radius: 0; box-shadow: none; }
.input-addon > * + * { border-left: 1px solid var(--hair); }
.input-addon .addon { display: inline-flex; align-items: center; padding: 0 12px; font-size: 13px; color: var(--ink-3); background: var(--seg-bg); white-space: nowrap; }
.input-addon .input { flex: 1; background: transparent; }
.input-addon .input:focus { background: transparent; box-shadow: none; }
.input-addon .btn { background: var(--control); color: var(--ink); padding: 0 14px; }
.input-addon .btn:hover { background: var(--control-hover); }
.input-addon .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
.input[type="number"]::-webkit-inner-spin-button, .input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.stepper {
  display: inline-flex; align-items: center; height: 38px; border: 1px solid var(--glass-edge); border-radius: 10px;
  background: var(--input-bg); box-shadow: inset 0 1px 0 var(--glass-highlight); transition: border-color 0.18s, box-shadow 0.18s;
}
.stepper .input { width: 64px; height: 100%; border: 0; background: none; box-shadow: none; text-align: center; padding: 0; font-variant-numeric: tabular-nums; }
.stepper .input:focus { box-shadow: none; background: none; }
.stepper:focus-within { border-color: var(--hair-strong); box-shadow: 0 0 0 3px var(--accent-soft); }
.stepper button { width: 34px; height: 100%; display: inline-grid; place-items: center; color: var(--ink-2); border-radius: 9px; }
.stepper button:hover { background: var(--control-hover); color: var(--ink); }
.stepper button .ic { width: 16px; height: 16px; }
.input[type="date"]::-webkit-calendar-picker-indicator, .input[type="time"]::-webkit-calendar-picker-indicator { opacity: 0.55; cursor: pointer; }
.input[type="color"] { width: 46px; padding: 4px; cursor: pointer; }
.input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 6px; }
.field-label { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-3); }
/* Подпись со ссылкой справа (Field aside): части подписи встают в ту же строку, что и ссылка */
.field-label > label { display: contents; }
.field-req { color: var(--accent-text); }
.field-opt { color: var(--ink-3); font-weight: 400; }
.field-help { font-size: 12.5px; color: var(--ink-3); line-height: 1.4; }
.field-error { display: flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--crit-text); line-height: 1.4; }
.field-error .ic { width: 14px; height: 14px; }
.field-error[hidden] { display: none; }
.field .counter { margin-left: auto; font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.field.is-disabled { opacity: 0.55; }
.field-row { display: flex; align-items: center; gap: 10px; }
}
@layer ui{
/* Списки выбора */
.select-sm { height: 28px; font-size: 12.5px; padding: 0 26px 0 10px; border-radius: 8px; }
.select-lg { height: 46px; font-size: 15px; border-radius: 13px; padding: 0 36px 0 14px; }
.select:disabled { opacity: 0.55; cursor: not-allowed; background: var(--seg-bg); }
.select-wrap.w-full { display: flex; }
.select-wrap.has-icon > .ic:first-child { left: 10px; right: auto; color: var(--ink-2); }
.select-wrap.has-icon .select { padding-left: 34px; }
select.select[multiple] { height: auto; padding: 6px; }
select.select[multiple] option { padding: 7px 10px; border-radius: 8px; }
select.select[multiple] option:checked { background: var(--btn); color: var(--btn-text); }
}
@layer ui{
/* Комбобокс: поле с поиском, варианты в плавающем списке (компонент Combobox) */
.combo { position: relative; min-width: 0; }
.combo-list {
  position: fixed; inset: auto; margin: 0; min-width: 200px; max-height: 280px; overflow: auto; padding: 6px;
  border: 1px solid var(--glass-edge); border-radius: 12px; background: var(--tip-bg); color: var(--ink);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  box-shadow: inset 0 1px 0 var(--glass-highlight), 0 12px 32px -10px rgba(15, 21, 43, 0.35); font-size: 13.5px;
  opacity: 0; translate: 0 -4px;
  transition: opacity 0.14s, translate 0.3s var(--ease-out), display 0.3s allow-discrete, overlay 0.3s allow-discrete;
}
.combo-list:popover-open { opacity: 1; translate: 0 0; }
@starting-style { .combo-list:popover-open { opacity: 0; translate: 0 -4px; } }
.combo-opt { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 10px; border-radius: 8px; text-align: left; color: var(--ink-2); font-weight: 500; cursor: pointer; }
.combo-opt:hover, .combo-opt.is-hot { background: var(--control-hover); color: var(--ink); }
.combo-opt[aria-selected="true"] { color: var(--ink); }
.combo-opt[aria-selected="true"]::after { content: ""; margin-left: auto; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.combo-opt small { color: var(--ink-3); font-weight: 400; }
.combo-opt[aria-selected="true"] small { margin-right: 6px; }
.combo-empty { padding: 10px; font-size: 13px; color: var(--ink-3); text-align: center; }
}
@layer ui{
/* Флажки, радио, тумблеры, рейтинг */
.check-box { position: relative; }
.check input:indeterminate + .check-box { background: var(--btn); border-color: var(--btn); }
.check input:indeterminate + .check-box .ic { opacity: 0; }
.check input:indeterminate + .check-box::after { content: ""; position: absolute; width: 10px; height: 2px; border-radius: 1px; background: var(--btn-text); }
.check input:disabled ~ .check-box, .check input:disabled ~ .check-text { opacity: 0.5; cursor: not-allowed; }
.check-text small { display: block; color: var(--ink-3); font-size: 12.5px; }
.check-lg .check-box { width: 24px; height: 24px; border-radius: 7px; margin-top: 0; }
.check-lg .check-box .ic { width: 16px; height: 16px; }
.check-sm .check-box { width: 16px; height: 16px; border-radius: 5px; margin-top: 2px; }
.check-sm .check-box .ic { width: 11px; height: 11px; }
.check-card, .radio-card { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--hair); background: var(--control); transition: background 0.18s, border-color 0.18s; }
.check-card:hover, .radio-card:hover { background: var(--control-hover); }
.check-card:has(input:checked), .radio-card:has(input:checked) { border-color: var(--accent); }
.check-list, .radio-list { display: flex; flex-direction: column; gap: 2px; border: 0; padding: 0; margin: 0; min-width: 0; }
.check-list.is-row, .radio-list.is-row { flex-direction: row; flex-wrap: wrap; gap: 4px 20px; }
.check-list.is-cards, .radio-list.is-cards { gap: 8px; }

.radio { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; padding: 5px 0; position: relative; }
.radio input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.radio-mark {
  flex: none; width: 20px; height: 20px; margin-top: 1px; border-radius: 50%;
  border: 1.5px solid var(--hair-strong); background: var(--control); display: grid; place-items: center;
  transition: background 0.18s, border-color 0.18s;
}
.radio-mark::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--btn-text); scale: 0; transition: scale 0.4s var(--ease-spring); }
.radio input:checked + .radio-mark { background: var(--btn); border-color: var(--btn); }
.radio input:checked + .radio-mark::after { scale: 1; }
.radio input:focus-visible + .radio-mark { outline: 2px solid var(--accent); outline-offset: 2px; }
.radio input:disabled ~ * { opacity: 0.5; cursor: not-allowed; }
.radio-text { line-height: 1.45; }
.radio-text small { display: block; color: var(--ink-3); font-size: 12.5px; }

.switch-sm { width: 32px; height: 20px; border-radius: 10px; }
.switch-sm::after { width: 14px; height: 14px; border-radius: 7px; }
.switch-sm:active::after { width: 18px; }
.switch-sm[aria-checked="true"]::after { translate: 12px 0; }
.switch-sm[aria-checked="true"]:active::after { translate: 8px 0; }
.switch-lg { width: 52px; height: 30px; border-radius: 15px; }
.switch-lg::after { width: 24px; height: 24px; border-radius: 12px; }
.switch-lg:active::after { width: 30px; }
.switch-lg[aria-checked="true"]::after { translate: 22px 0; }
.switch-lg[aria-checked="true"]:active::after { translate: 16px 0; }
.switch:disabled { opacity: 0.5; cursor: not-allowed; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 0; }
.switch-row + .switch-row { border-top: 1px solid var(--hair); }
.switch-label { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; }

.rating { display: inline-flex; flex-direction: row-reverse; gap: 2px; border: 0; padding: 0; margin: 0; }
.rating input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.rating label {
  cursor: pointer; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px;
  color: var(--hair-strong); transition: color 0.15s, scale 0.3s var(--ease-spring);
}
.rating label .ic { width: 22px; height: 22px; }
.rating input:checked ~ label, .rating label:hover, .rating label:hover ~ label { color: var(--warn); }
.rating input:checked ~ label .ic, .rating label:hover .ic, .rating label:hover ~ label .ic { fill: var(--warn); }
.rating label:hover { scale: 1.12; }
.rating input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 1px; }
.rating-static { display: inline-flex; gap: 2px; color: var(--hair-strong); }
.rating-static .ic { width: 18px; height: 18px; }
.rating-static .is-on { color: var(--warn); }
.rating-static .is-on .ic { fill: var(--warn); }
}
@layer ui{
/* Ползунки */
.range { -webkit-appearance: none; appearance: none; width: 100%; height: 24px; margin: 0; background: none; cursor: pointer; --p: 0%; }
.range:focus { outline: none; }
.range::-webkit-slider-runnable-track {
  height: 6px; border-radius: 3px;
  background: linear-gradient(var(--accent), var(--accent)) 0 0 / var(--p) 100% no-repeat, var(--hair-strong);
}
.range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 20px; height: 20px; margin-top: -7px; border-radius: 50%;
  background: #fff; border: 1px solid rgba(15, 21, 43, 0.14); box-shadow: 0 1px 3px rgba(15, 21, 43, 0.3);
  transition: scale 0.3s var(--ease-spring);
}
.range:hover::-webkit-slider-thumb, .range:active::-webkit-slider-thumb { scale: 1.15; }
.range:focus-visible::-webkit-slider-thumb { outline: 2px solid var(--accent); outline-offset: 2px; }
.range::-moz-range-track { height: 6px; border-radius: 3px; background: var(--hair-strong); }
.range::-moz-range-progress { height: 6px; border-radius: 3px; background: var(--accent); }
.range::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 1px solid rgba(15, 21, 43, 0.14); box-shadow: 0 1px 3px rgba(15, 21, 43, 0.3); }
.range:disabled { opacity: 0.5; cursor: not-allowed; }
.range-ink::-webkit-slider-runnable-track { background-image: linear-gradient(var(--btn), var(--btn)); }
.range-ink::-moz-range-progress { background: var(--btn); }
.range-wrap { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.range-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; color: var(--ink-2); }
.range-head output, .range-out { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.range-marks { display: flex; justify-content: space-between; padding: 0 10px; font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.range-ticks { display: flex; justify-content: space-between; padding: 0 10px; margin-top: -6px; }
.range-ticks i { width: 1px; height: 6px; background: var(--hair-strong); }
.range-dual { position: relative; height: 24px; }
.range-dual .range { position: absolute; inset: 0; pointer-events: none; }
.range-dual .range::-webkit-slider-runnable-track { background: none; }
.range-dual .range::-moz-range-track { background: none; }
.range-dual .range::-moz-range-progress { background: none; }
.range-dual .range::-webkit-slider-thumb { pointer-events: auto; }
.range-dual .range::-moz-range-thumb { pointer-events: auto; }
.range-dual .range-track { position: absolute; left: 0; right: 0; top: 9px; height: 6px; border-radius: 3px; background: var(--hair-strong); }
.range-dual .range-fill { position: absolute; top: 9px; height: 6px; border-radius: 3px; background: var(--accent); left: var(--a, 0%); right: calc(100% - var(--b, 100%)); }
}
@layer ui{
/* Формы */
.form { display: flex; flex-direction: column; gap: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.span-2 { grid-column: span 2; }
.form-inline { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.form-inline .field { flex: 1; min-width: 160px; }
.fieldset { border: 1px solid var(--hair); border-radius: 14px; padding: 12px 16px 16px; margin: 0; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.fieldset > legend { padding: 0 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.form-actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; padding-top: 4px; flex-wrap: wrap; }
.form-actions .meta { margin-right: auto; }
.form-section { display: flex; flex-direction: column; gap: 2px; }
.form-section-title { font-size: 15px; font-weight: 600; }
.form-section-note { font-size: 13px; color: var(--ink-3); }
.dropzone {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 140px; padding: 20px; border: 1.5px dashed var(--hair-strong); border-radius: 14px;
  background: var(--glass-soft); text-align: center; color: var(--ink-2); font-size: 14px; cursor: pointer;
  transition: background 0.18s, border-color 0.18s;
}
.dropzone .ic { width: 28px; height: 28px; stroke-width: 1.5; color: var(--ink-2); margin-bottom: 6px; }
.dropzone b { font-weight: 500; color: var(--ink); }
.dropzone small { color: var(--ink-3); }
.dropzone:hover, .dropzone.is-over { background: var(--accent-soft); border-color: var(--accent); }
.dropzone:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.dropzone input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.file-list { display: flex; flex-direction: column; }
.file-row { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 9px 0; border-top: 1px solid var(--hair); font-size: 14px; }
.file-row .ic { color: var(--ink-2); }
.file-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; line-height: 1.3; }
.file-text b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-text small { color: var(--ink-3); font-size: 12.5px; }
.file-del { width: 28px; height: 28px; display: inline-grid; place-items: center; border-radius: 8px; color: var(--ink-3); }
.file-del:hover { background: var(--control-hover); color: var(--ink); }
.file-del .ic { width: 16px; height: 16px; color: inherit; }
}
@layer ui{
/* Табы */
.tabs { position: relative; isolation: isolate; display: flex; gap: 2px; max-width: 100%; border-bottom: 1px solid var(--hair); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none;
  position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 12px; border-radius: 10px 10px 0 0;
  font-size: 14px; font-weight: 500; color: var(--ink-2); white-space: nowrap; transition: color 0.18s, background 0.18s;
}
.tab:hover { color: var(--ink); background: var(--control); }
.tab[aria-selected="true"] { color: var(--ink); }
.tab .ic { width: 18px; height: 18px; }
.tab:disabled { opacity: 0.45; pointer-events: none; }
.tabs-pill { position: absolute; left: 0; top: 0; z-index: 0; width: 0; height: 0; opacity: 0; pointer-events: none; border-bottom: 2px solid var(--ink); }
.tabs:not(.has-pill) .tab[aria-selected="true"] { box-shadow: inset 0 -2px 0 var(--ink); }
.tabs-vertical { flex-direction: column; border-bottom: 0; border-right: 1px solid var(--hair); gap: 2px; overflow: visible; }
.tabs-vertical .tab { height: 38px; border-radius: 10px 0 0 10px; justify-content: flex-start; }
.tabs-vertical .tabs-pill { border-bottom: 0; border-right: 2px solid var(--ink); }
.tabs-vertical:not(.has-pill) .tab[aria-selected="true"] { box-shadow: inset -2px 0 0 var(--ink); }
.tabs-box { gap: 4px; padding: 4px; border: 0; background: var(--seg-bg); border-radius: 12px; }
.tabs-box .tab { height: 34px; border-radius: 9px; }
.tabs-box .tabs-pill { border: 0; background: var(--glass-strong); border-radius: 9px; box-shadow: inset 0 1px 0 var(--glass-highlight), 0 1px 2px rgba(15, 21, 43, 0.08); }
.tabs-box:not(.has-pill) .tab[aria-selected="true"] { box-shadow: none; background: var(--glass-strong); }
.tab-panels { padding-top: 14px; }
.tab-panel { font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.tab-panel[hidden] { display: none; }
.tabs-layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 16px; }
.tabs-layout .tab-panels { padding-top: 4px; }
}
@layer ui{
/* Пагинация */
.pager { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.pager-btn, .pager-page {
  min-width: 36px; height: 36px; padding: 0 10px; border-radius: 10px; display: inline-grid; place-items: center;
  font-size: 14px; font-weight: 500; color: var(--ink-2); font-variant-numeric: tabular-nums; transition: background 0.15s, color 0.15s;
}
.pager-btn:hover, .pager-page:hover { background: var(--control-hover); color: var(--ink); }
.pager-page[aria-current="page"] { background: var(--btn); color: var(--btn-text); }
.pager-gap { min-width: 24px; text-align: center; color: var(--ink-3); }
.pager-btn:disabled { opacity: 0.4; pointer-events: none; }
.pager-btn .ic { width: 18px; height: 18px; }
.pager-sm .pager-btn, .pager-sm .pager-page { min-width: 30px; height: 30px; font-size: 13px; border-radius: 8px; }
.pager-glass { padding: 4px; background: var(--seg-bg); border-radius: 14px; }
.pager-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.pager-info { font-size: 13px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
}
@layer ui{
/* Хлебные крошки */
.crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; font-size: 14px; }
.crumbs li { display: inline-flex; align-items: center; gap: 2px; }
.crumb { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 8px; color: var(--ink-2); transition: background 0.15s, color 0.15s; }
.crumb .ic { width: 16px; height: 16px; }
a.crumb:hover, button.crumb:hover { background: var(--control); color: var(--ink); }
.crumb[aria-current="page"] { color: var(--ink); font-weight: 500; }
.crumb-sep { width: 14px; height: 14px; color: var(--ink-3); flex: none; }
.crumbs-glass { padding: 4px 6px; background: var(--seg-bg); border-radius: 12px; }
.crumbs-sm { font-size: 13px; }
.crumbs-sm .crumb { padding: 3px 6px; }
}
@layer ui{
/* Шаги */
.steps { display: flex; counter-reset: step; }
.step {
  position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px;
  text-align: center; font-size: 13px; color: var(--ink-3); line-height: 1.3; min-width: 0;
}
.step-dot {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--control); border: 1.5px solid var(--hair-strong); font-weight: 600; font-size: 13px; color: var(--ink-2);
  counter-increment: step; transition: background 0.25s, border-color 0.25s, box-shadow 0.25s;
}
.step-dot:empty::before { content: counter(step); }
.step-dot .ic { width: 16px; height: 16px; stroke-width: 2.2; }
.step-text b { display: block; font-weight: 500; color: var(--ink-2); }
.step.is-done .step-dot { background: var(--btn); border-color: var(--btn); color: var(--btn-text); }
.step.is-current .step-dot { border-color: var(--accent); color: var(--ink); background: var(--control-hover); box-shadow: 0 0 0 4px var(--accent-soft); }
.step.is-current, .step.is-current .step-text b { color: var(--ink); }
.step.is-done .step-text b { color: var(--ink); }
.step::before { content: ""; position: absolute; top: 15px; left: calc(-50% + 16px); right: calc(50% + 16px); height: 1.5px; background: var(--hair-strong); }
.step:first-child::before { display: none; }
.step.is-done::before, .step.is-current::before { background: var(--btn); }
.steps-vertical { flex-direction: column; }
.steps-vertical .step { flex-direction: row; text-align: left; align-items: flex-start; gap: 12px; padding-bottom: 22px; }
.steps-vertical .step:last-child { padding-bottom: 0; }
.steps-vertical .step::before { top: 32px; bottom: 2px; left: 14px; right: auto; width: 1.5px; height: auto; display: block; }
.steps-vertical .step:last-child::before { display: none; }
.steps-vertical .step.is-current::before, .steps-vertical .step:not(.is-done)::before { background: var(--hair-strong); }
.steps-vertical .step.is-done::before { background: var(--btn); }
.steps-vertical .step-text { padding-top: 5px; }
.steps-sm .step-dot { width: 24px; height: 24px; font-size: 12px; }
.steps-sm .step::before { top: 12px; }
}
@layer ui{
/* Панели навигации: нижняя панель и палитра команд */
.tabbar { display: flex; flex-direction: row; justify-content: space-around; padding: 8px; border-radius: 20px; }
.tabbar .nav-link { flex-direction: column; gap: 3px; font-size: 11px; padding: 8px 0; flex: 1; }
.tabbar .nav-link[aria-current="page"] { background: var(--glass-strong); box-shadow: inset 0 1px 0 var(--glass-highlight), 0 1px 2px rgba(15, 21, 43, 0.06); }
.cmdk { width: min(560px, calc(100% - 32px)); }
.cmdk-input { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--hair); color: var(--ink-3); }
.cmdk-input input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; font-size: 16px; color: var(--ink); }
.cmdk-input input::placeholder { color: var(--ink-3); }
.cmdk-list { padding: 8px; max-height: 380px; overflow: auto; }
.cmdk-group { padding: 8px 10px 4px; font-size: 12px; font-weight: 600; color: var(--ink-3); }
.cmdk-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 10px; text-align: left; font-size: 14px; font-weight: 500; color: var(--ink-2); }
.cmdk-item:hover, .cmdk-item.is-hot { background: var(--control-hover); color: var(--ink); }
.cmdk-item .ic { width: 18px; height: 18px; }
.cmdk-item kbd { margin-left: auto; font-size: 11.5px; color: var(--ink-3); font-family: var(--font-text); }
.cmdk-item[hidden] { display: none; }
.cmdk-empty { padding: 24px; text-align: center; font-size: 14px; color: var(--ink-3); }
.cmdk-foot { display: flex; gap: 14px; padding: 10px 18px; border-top: 1px solid var(--hair); font-size: 12px; color: var(--ink-3); }
}
@layer ui{
/* Списки */
.list { display: flex; flex-direction: column; }
.list-item {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px;
  width: 100%; padding: 10px 12px; border-radius: 12px; text-align: left; color: inherit; transition: background 0.15s;
}
a.list-item:hover, button.list-item:hover { background: var(--control); }
.list-item > .ic { color: var(--ink-2); }
.list-item.is-active, .list-item[aria-current="true"] { background: var(--glass-strong); box-shadow: inset 0 1px 0 var(--glass-highlight), 0 1px 2px rgba(15, 21, 43, 0.06); }
.list-divided .list-item { border-radius: 0; border-bottom: 1px solid var(--hair); padding: 10px 4px; }
.list-divided .list-item:last-child { border-bottom: 0; }
.list-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--control); border: 1px solid var(--glass-edge); color: var(--ink-2); flex: none; }
.list-icon .ic { width: 18px; height: 18px; }
.list-icon-good { background: var(--good-soft); color: var(--good-text); border-color: transparent; }
.list-icon-warn { background: var(--warn-soft); color: var(--warn-text); border-color: transparent; }
.list-icon-info { background: var(--info-soft); color: var(--info-text); border-color: transparent; }
.list-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.list-text b { font-weight: 500; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-text small { color: var(--ink-3); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-meta { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.list-meta .chev { width: 16px; height: 16px; }
.list-sm .list-item { padding: 7px 10px; gap: 10px; }
.list-sm .list-icon { width: 30px; height: 30px; border-radius: 8px; }
}
@layer ui{
/* Карточки и панели */
.pane-soft { background: var(--glass-soft); }
.pane-strong { background: var(--glass-strong); }
.pane-flat { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--control); box-shadow: inset 0 1px 0 var(--glass-highlight); }
.pane-sm { padding: 14px 16px; border-radius: var(--r-md); gap: 10px; }
.pane-xs { padding: 10px 12px; border-radius: 12px; gap: 8px; }
.pane-link { cursor: pointer; color: inherit; text-align: left; transition: translate 0.3s var(--ease-out), background 0.2s, box-shadow 0.3s; }
.pane-link:hover { translate: 0 -2px; background: var(--glass-strong); }
.pane-link:active { translate: 0 0; }
.pane-row { flex-direction: row; align-items: center; gap: 16px; }
.pane-media { margin: -20px -22px 0; border-radius: var(--r-lg) var(--r-lg) 0 0; overflow: hidden; aspect-ratio: 16 / 9; background: var(--seg-bg); }
.pane-media img { width: 100%; height: 100%; object-fit: cover; }
.pane-sm .pane-media { margin: -14px -16px 0; border-radius: var(--r-md) var(--r-md) 0 0; }
.pane-thumb { width: 72px; height: 72px; border-radius: 12px; overflow: hidden; flex: none; background: var(--seg-bg); }
.pane-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pane-text { font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.pane-accent { border-top: 3px solid var(--accent); }
.pane-good { box-shadow: inset 3px 0 0 var(--good), inset 0 1px 0 var(--glass-highlight), var(--glass-shadow); }
.pane-warn { box-shadow: inset 3px 0 0 var(--warn), inset 0 1px 0 var(--glass-highlight), var(--glass-shadow); }
.pane-crit { box-shadow: inset 3px 0 0 var(--crit), inset 0 1px 0 var(--glass-highlight), var(--glass-shadow); }
.pane-selected { outline: 2px solid var(--accent); outline-offset: -1px; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
}
@layer ui{
/* Статистика */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.stat-display { font-family: var(--font-display); font-weight: 300; font-size: 44px; line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.stat-sm .stat-value { font-size: 24px; }
.stat-unit { font-size: 0.5em; font-weight: 500; color: var(--ink-3); margin-left: 4px; letter-spacing: 0; }
.stat-foot { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-3); }
.kpi-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.kpi-row .spark { width: 96px; height: 32px; }
.tile-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--control); border: 1px solid var(--glass-edge); color: var(--ink-2); }
.tile-icon .ic { width: 18px; height: 18px; }
}
@layer ui{
/* Бейджи, счётчики, чипы, теги */
.chip-crit { background: var(--crit-soft); color: var(--crit-text); }
.chip-info { background: var(--info-soft); color: var(--info-text); }
.chip-accent { background: var(--accent-soft); color: var(--accent-text); }
.chip-neutral { background: var(--seg-bg); color: var(--ink-2); }
.chip-glass { background: var(--control); border: 1px solid var(--glass-edge); color: var(--ink-2); }
.chip-sm { height: 24px; padding: 0 9px 0 7px; font-size: 12px; gap: 5px; }
.chip-sm .ic { width: 14px; height: 14px; }
.chip-lg { height: 36px; padding: 0 14px 0 10px; font-size: 14px; }
.chip .dot { margin: 0 2px; }
.chip-x { padding-right: 5px; }
.count {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
  font-size: 11.5px; font-weight: 600; background: var(--seg-bg); color: var(--ink-2); font-variant-numeric: tabular-nums; line-height: 1;
}
.count-accent { background: var(--accent); color: #fff; }
.count-ink { background: var(--btn); color: var(--btn-text); }
.count-good { background: var(--good-soft); color: var(--good-text); }
.count-warn { background: var(--warn-soft); color: var(--warn-text); }
.count-crit { background: var(--crit-soft); color: var(--crit-text); }
.count-sm { min-width: 16px; height: 16px; font-size: 10.5px; padding: 0 4px; }
.badge-dot { position: absolute; top: 7px; right: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.dot-lg { width: 10px; height: 10px; }
.dot-sm { width: 6px; height: 6px; }
.dot-info { background: var(--info); }
.dot-muted { background: var(--ink-3); }
.dot-pulse { position: relative; }
.dot-pulse::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: inherit; animation: pulse 1.8s ease-out infinite; }
@keyframes pulse { 0% { scale: 1; opacity: 0.6; } 100% { scale: 2.6; opacity: 0; } }
.status { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; color: var(--ink-2); }
.tag.is-on, .tag[aria-pressed="true"] { background: var(--btn); color: var(--btn-text); border-color: transparent; }
.tag-x { display: inline-flex; align-items: center; gap: 6px; padding-right: 6px; }
.tag-del { width: 18px; height: 18px; border-radius: 50%; display: inline-grid; place-items: center; color: inherit; opacity: 0.6; }
.tag-del:hover { background: var(--hair-strong); opacity: 1; }
.tag-del .ic { width: 12px; height: 12px; stroke-width: 2.2; }
.tag-sm { height: 24px; padding: 0 9px; font-size: 12px; }
.tag-lg { height: 36px; padding: 0 14px; font-size: 14px; gap: 7px; }
.tag-lg .ic { width: 16px; height: 16px; }
.tag .ic { width: 14px; height: 14px; }
.tag-dot { padding-left: 9px; }
.tag-input {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 44px; padding: 5px 8px;
  background: var(--input-bg); border: 1px solid var(--glass-edge); border-radius: 12px;
  box-shadow: inset 0 1px 0 var(--glass-highlight); cursor: text; transition: background 0.18s, border-color 0.18s, box-shadow 0.18s;
}
.tag-input .tag { height: 28px; font-size: 13px; }
.tag-input input { flex: 1; min-width: 120px; border: 0; background: none; outline: none; height: 28px; font-size: 14px; color: var(--ink); padding: 0 4px; }
.tag-input input::placeholder { color: var(--ink-3); }
.tag-input:focus-within { border-color: var(--hair-strong); background: var(--control-hover); box-shadow: 0 0 0 3px var(--accent-soft); }
}
@layer ui{
/* Аватары */
.avatar-xs { width: 24px; height: 24px; font-size: 11px; }
.avatar-xl { width: 88px; height: 88px; font-size: 32px; }
.avatar img { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }
.avatar-soft { background: var(--control); color: var(--ink-2); border: 1px solid var(--glass-edge); }
.avatar-accent { background: var(--accent-soft); color: var(--accent-text); }
.avatar-square { border-radius: 12px; }
.avatar-xs.avatar-square { border-radius: 7px; }
.avatar .ic { width: 50%; height: 50%; }
.avatar-wrap { position: relative; display: inline-flex; flex: none; }
.avatar-status { position: absolute; right: 0; bottom: 0; width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--bg); background: var(--good); box-sizing: content-box; }
.avatar-status.is-off { background: var(--ink-3); }
.avatar-status.is-busy { background: var(--crit); }
.avatar-status.is-away { background: var(--warn); }
.avatars { display: flex; }
.avatars .avatar { border: 2px solid var(--bg); margin-left: -8px; box-sizing: content-box; }
.avatars .avatar:first-child { margin-left: 0; }
.avatars .avatar-more { background: var(--control); color: var(--ink-2); font-size: 12px; }
.user { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.user-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.user-text b { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-text small { color: var(--ink-3); font-size: 12.5px; }
}
@layer ui{
/* Алерты, баннеры, заметки на полях */
.alert {
  display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: 12px; align-items: start;
  padding: 12px 14px; border-radius: 14px; background: var(--control); border: 1px solid var(--glass-edge);
  font-size: 14px; line-height: 1.45; color: var(--ink-2);
}
.alert > .ic { color: var(--ink-2); margin-top: 1px; }
.alert-text { min-width: 0; }
.alert-text b { display: block; font-weight: 600; color: var(--ink); }
.alert-text p { margin: 0; }
.alert-text .btn-link { font-size: 13px; margin-top: 4px; }
.alert-actions { display: flex; gap: 6px; align-items: center; }
.alert-good { background: var(--good-soft); border-color: transparent; }
.alert-good > .ic { color: var(--good-text); }
.alert-warn { background: var(--warn-soft); border-color: transparent; }
.alert-warn > .ic { color: var(--warn-text); }
.alert-crit { background: var(--crit-soft); border-color: transparent; }
.alert-crit > .ic { color: var(--crit-text); }
.alert-info { background: var(--info-soft); border-color: transparent; }
.alert-info > .ic { color: var(--info-text); }
.alert-ink { background: var(--btn); color: var(--btn-text); border-color: transparent; }
.alert-ink > .ic, .alert-ink .alert-text b { color: inherit; }
.alert-sm { padding: 9px 12px; font-size: 13.5px; border-radius: 12px; gap: 10px; }
.alert-sm > .ic { width: 18px; height: 18px; }
.dismiss { width: 28px; height: 28px; border-radius: 8px; display: inline-grid; place-items: center; color: inherit; opacity: 0.65; margin: -4px -4px -4px 0; transition: opacity 0.15s, background 0.15s; }
.dismiss:hover { opacity: 1; background: rgba(15, 21, 43, 0.07); }
.dismiss .ic { width: 16px; height: 16px; color: inherit; }
.banner { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 10px 16px; border-radius: 12px; background: var(--btn); color: var(--btn-text); font-size: 14px; font-weight: 500; }
.banner .btn { height: 30px; padding: 0 12px; font-size: 13px; background: var(--toast-btn); color: inherit; }
.banner .dismiss { margin: -4px 0 -4px 4px; }
.callout { padding: 12px 14px; border-left: 3px solid var(--accent); border-radius: 0 12px 12px 0; background: var(--control); font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.callout b { color: var(--ink); }
.callout-info { border-color: var(--info); }
.callout-warn { border-color: var(--warn); }
.callout-good { border-color: var(--good); }
}
@layer ui{
/* Уведомления: виды, действие, закрытие */
.toast { pointer-events: auto; max-width: min(440px, calc(100vw - 32px)); }
.toast > .ic { color: var(--toast-ic, inherit); }
.toast-good { --toast-ic: var(--toast-good); }
.toast-warn { --toast-ic: var(--toast-warn); }
.toast-crit { --toast-ic: var(--toast-crit); }
.toast-info { --toast-ic: var(--toast-info); }
.toast-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.toast-text small { opacity: 0.72; font-weight: 400; font-size: 12.5px; }
.toast-action { margin-left: 4px; padding: 5px 10px; border-radius: 8px; background: var(--toast-btn); color: inherit; font-weight: 600; font-size: 13px; white-space: nowrap; }
.toast-action:hover { filter: brightness(1.2); }
.toast .dismiss { margin: -4px -6px -4px 0; width: 26px; height: 26px; }
.toast .dismiss:hover { background: var(--toast-btn); }
.toast .spinner { border-color: var(--toast-btn); border-top-color: currentColor; width: 16px; height: 16px; border-width: 2px; }
}
@layer ui{
/* Прогресс и кольца */
.progress { position: relative; height: 8px; border-radius: 4px; background: var(--hair-strong); overflow: hidden; }
.progress-bar { height: 100%; width: calc(var(--p, 0) * 1%); border-radius: inherit; background: var(--btn); transition: width 0.6s var(--ease-out); }
.progress-sm { height: 4px; }
.progress-lg { height: 12px; }
.progress-accent .progress-bar { background: var(--accent); }
.progress-good .progress-bar { background: var(--good); }
.progress-warn .progress-bar { background: var(--warn); }
.progress-crit .progress-bar { background: var(--crit); }
.progress-info .progress-bar { background: var(--info); }
.progress.is-indeterminate .progress-bar { width: 40%; animation: indet 1.4s ease-in-out infinite; }
@keyframes indet { 0% { translate: -110% 0; } 100% { translate: 260% 0; } }
.progress-label { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 13px; color: var(--ink-2); margin-bottom: 6px; }
.progress-label b { color: var(--ink); font-variant-numeric: tabular-nums; }
.progress-wrap { display: flex; flex-direction: column; min-width: 0; }
.progress-stack { display: flex; gap: 2px; background: none; overflow: visible; }
.progress-stack .progress-bar { width: auto; flex: 0 0 calc(var(--p, 0) * 1%); border-radius: 2px; transition: flex-basis 0.6s var(--ease-out); }
/* Первая часть составной полосы красится как её точка в легенде */
.progress-bar-s1 { background: var(--s1); }
.progress-bar-s2 { background: var(--s2); }
.progress-bar-s3 { background: var(--s3); }
.dot-s1 { background: var(--s1); }
.dot-s2 { background: var(--s2); }
.dot-s3 { background: var(--s3); }
.progress-steps { display: flex; gap: 4px; background: none; height: 6px; overflow: visible; }
.progress-steps i { flex: 1; border-radius: 3px; background: var(--hair-strong); transition: background 0.25s; }
.progress-steps i.is-on { background: var(--btn); }
.progress-legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12.5px; color: var(--ink-2); margin-top: 8px; }
.progress-legend span { display: inline-flex; align-items: center; gap: 6px; }
.ring { width: 56px; height: 56px; flex: none; }
.ring-track { fill: none; stroke: var(--hair-strong); stroke-width: 3.5; }
.ring-fill { fill: none; stroke: var(--btn); stroke-width: 3.5; stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: calc(100 - var(--p, 0)); rotate: -90deg; transform-origin: 50% 50%; transition: stroke-dashoffset 0.7s var(--ease-out); }
.ring-accent .ring-fill { stroke: var(--accent); }
.ring-good .ring-fill { stroke: var(--good); }
.ring-warn .ring-fill { stroke: var(--warn); }
.ring-crit .ring-fill { stroke: var(--crit); }
.ring-sm { width: 36px; height: 36px; }
.ring-sm .ring-track, .ring-sm .ring-fill { stroke-width: 4.5; }
.ring-lg { width: 96px; height: 96px; }
.ring-lg .ring-track, .ring-lg .ring-fill { stroke-width: 2.5; }
.ring-wrap { position: relative; display: inline-grid; place-items: center; }
.ring-wrap > b { position: absolute; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ring-wrap.ring-wrap-lg > b { font-size: 20px; }
/* Иконка стоит в центре кольца, как число */
.ring-wrap > .ic { position: absolute; }
.ring-wrap .ring-label { position: absolute; top: 100%; margin-top: 4px; font-size: 12.5px; color: var(--ink-3); white-space: nowrap; }
}
@layer ui{
/* Скелетоны */
.sk {
  display: block; border-radius: 6px;
  background: linear-gradient(90deg, var(--hair) 25%, var(--hair-strong) 50%, var(--hair) 75%);
  background-size: 200% 100%; animation: shimmer 1.4s linear infinite;
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.sk-line { height: 12px; width: 100%; }
.sk-title { height: 18px; width: 45%; border-radius: 7px; }
.sk-text { height: 12px; }
.sk-circle { width: 40px; height: 40px; border-radius: 50%; flex: none; }
.sk-rect { height: 120px; border-radius: 12px; }
.sk-btn { height: 38px; width: 120px; border-radius: 12px; }
.sk-chip { height: 24px; width: 80px; border-radius: 12px; }
.sk-row { display: flex; align-items: center; gap: 12px; }
.sk-stack { display: flex; flex-direction: column; gap: 10px; min-width: 0; flex: 1; }
.w-80 { width: 80%; } .w-70 { width: 70%; } .w-60 { width: 60%; } .w-50 { width: 50%; } .w-40 { width: 40%; } .w-30 { width: 30%; }
}
@layer ui{
/* Пустые состояния */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 28px 20px; color: var(--ink-2); }
.empty-icon { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--control); border: 1px solid var(--glass-edge); color: var(--ink-2); margin-bottom: 8px; }
.empty-icon .ic { width: 28px; height: 28px; stroke-width: 1.5; }
.empty-icon.is-hex { border-radius: 0; border: 0; background: none; width: 72px; height: 72px; }
.empty-icon.is-hex .ic { width: 72px; height: 72px; stroke-width: 1; color: var(--hair-strong); }
.empty b { font-size: 16px; font-weight: 600; color: var(--ink); }
.empty p { font-size: 14px; max-width: 38ch; color: var(--ink-3); line-height: 1.5; }
.empty-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; justify-content: center; }
.empty-crit .empty-icon { background: var(--crit-soft); color: var(--crit-text); border-color: transparent; }
.empty-sm { padding: 18px 14px; gap: 4px; }
.empty-sm .empty-icon { width: 44px; height: 44px; margin-bottom: 4px; }
.empty-sm .empty-icon .ic { width: 20px; height: 20px; }
.empty-sm b { font-size: 14px; }
.empty-sm p { font-size: 13px; }
}
@layer ui{
/* Меню и поповеры (координаты ставит компонент, поведение — атрибут popover) */
.menu, .popover {
  position: fixed; inset: auto; margin: 0; padding: 6px; min-width: 200px; max-width: min(320px, calc(100vw - 24px));
  border: 1px solid var(--glass-edge); border-radius: 14px; background: var(--tip-bg); color: var(--ink);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  box-shadow: inset 0 1px 0 var(--glass-highlight), 0 12px 32px -10px rgba(15, 21, 43, 0.35);
  font-size: 14px; opacity: 0; scale: 0.96; transform-origin: var(--ox, 50%) var(--oy, 0);
  transition: opacity 0.15s, scale 0.4s var(--ease-spring), display 0.4s allow-discrete, overlay 0.4s allow-discrete;
}
.menu:popover-open, .popover:popover-open { opacity: 1; scale: 1; }
@starting-style { .menu:popover-open, .popover:popover-open { opacity: 0; scale: 0.96; } }
.popover { padding: 14px 16px; font-size: 13.5px; line-height: 1.5; color: var(--ink-2); }
.popover-title { display: block; color: var(--ink); font-weight: 600; margin-bottom: 4px; }
.popover p { margin: 0; }
.popover .hstack { margin-top: 10px; }
.menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 9px;
  text-align: left; color: var(--ink-2); font-weight: 500; white-space: nowrap; transition: background 0.12s, color 0.12s;
}
.menu-item:hover, .menu-item:focus-visible, .menu-item.is-hot { background: var(--control-hover); color: var(--ink); outline: none; }
.menu-item .ic { width: 18px; height: 18px; }
.menu-item kbd, .menu-hint { margin-left: auto; padding-left: 16px; font-size: 12px; color: var(--ink-3); font-family: var(--font-text); }
.menu-item-danger { color: var(--crit-text); }
.menu-item-danger:hover, .menu-item-danger:focus-visible { background: var(--crit-soft); color: var(--crit-text); }
.menu-item:disabled, .menu-item[aria-disabled="true"] { opacity: 0.45; pointer-events: none; }
.menu-check { width: 16px; height: 16px; opacity: 0; color: var(--accent-text); stroke-width: 2.2; }
.menu-item[aria-checked="true"] .menu-check { opacity: 1; }
.menu-sep { height: 1px; background: var(--hair); margin: 6px 4px; }
.menu-head { padding: 6px 10px 4px; font-size: 12px; font-weight: 600; color: var(--ink-3); }
.menu-lg { min-width: 260px; }
.menu-user { display: flex; align-items: center; gap: 10px; padding: 8px 10px 10px; }
.menu-user .avatar { width: 34px; height: 34px; font-size: 13px; }
}
@layer ui{
/* Подсказка (одна на страницу, tips.ts) */
.tooltip {
  position: fixed; inset: auto; margin: 0; padding: 6px 10px; max-width: 260px; border: 0; border-radius: 8px;
  background: var(--btn); color: var(--btn-text); font-size: 12.5px; font-weight: 500; line-height: 1.4;
  pointer-events: none; opacity: 0; translate: 0 4px;
  transition: opacity 0.15s, translate 0.3s var(--ease-out), display 0.3s allow-discrete, overlay 0.3s allow-discrete;
}
.tooltip:popover-open { opacity: 1; translate: 0 0; }
@starting-style { .tooltip:popover-open { opacity: 0; translate: 0 4px; } }
.tooltip kbd { font-family: inherit; opacity: 0.7; margin-left: 6px; }
}
@layer ui{
/* Аккордеон */
.acc { display: flex; flex-direction: column; }
.acc-item { border-bottom: 1px solid var(--hair); }
.acc-item:last-child { border-bottom: 0; }
.acc-head { display: flex; align-items: center; gap: 10px; padding: 12px 4px; font-size: 14.5px; font-weight: 500; color: var(--ink); cursor: pointer; list-style: none; border-radius: 8px; }
.acc-head::-webkit-details-marker { display: none; }
.acc-head:hover { color: var(--ink); }
.acc-head .ic { width: 18px; height: 18px; color: var(--ink-2); }
.acc-chev { margin-left: auto; width: 16px; height: 16px; color: var(--ink-3); transition: rotate 0.3s var(--ease-out); }
.acc-item[open] > .acc-head .acc-chev { rotate: 180deg; }
.acc-body { padding: 0 4px 14px; font-size: 14px; color: var(--ink-2); line-height: 1.55; }
.acc-body > * + * { margin-top: 8px; }
.acc-glass .acc-item { border: 1px solid var(--glass-edge); background: var(--control); border-radius: 12px; margin-bottom: 8px; padding: 0 12px; }
.acc-glass .acc-item:last-child { margin-bottom: 0; }
.acc-glass .acc-head { padding: 12px 0; }
.acc-glass .acc-body { padding: 0 0 14px; }
.acc-head .count { margin-left: 2px; }
}
@layer ui{
/* Таблицы: обёртка, полосы, наведение, сортировка, выбор строк */
.table-wrap { position: relative; overflow: auto; border-radius: 12px; max-width: 100%; } /* position: иначе .sr-only из ячеек позиционируется от панели и раздвигает страницу */
.table-wrap .table { min-width: 560px; }
.table-sticky th { position: sticky; top: 0; z-index: 1; background: var(--surface); }
.table-striped tbody tr:nth-child(odd) td { background: var(--glass-soft); }
.table-hover tbody tr:hover td { background: var(--control); }
/* Подсвеченная строка не упирается в текст: крайним ячейкам и шапке — отступ, столбцы не съезжают */
.table-hover :is(td, th):first-child, .table-striped :is(td, th):first-child { padding-left: 12px; }
.table-hover :is(td, th):last-child, .table-striped :is(td, th):last-child { padding-right: 12px; }
.table-compact th { padding: 2px 8px 6px; }
.table-compact td { padding: 6px 8px; font-size: 13px; }
.table-lines td, .table-lines th { border-right: 1px solid var(--hair); }
.table-lines td:last-child, .table-lines th:last-child { border-right: 0; }
.table tr.is-selected td { background: var(--accent-soft); }
.table .check { padding: 0; align-items: center; }
.table .check-box { margin-top: 0; }
.table .sort { display: inline-flex; align-items: center; gap: 4px; color: inherit; font: inherit; border-radius: 4px; }
.table .sort .ic { width: 14px; height: 14px; opacity: 0.4; transition: rotate 0.25s var(--ease-out), opacity 0.15s; }
.table .sort:hover { color: var(--ink); }
.table .sort[aria-sort] { color: var(--ink); }
.table .sort[aria-sort] .ic { opacity: 1; }
.table .sort[aria-sort="descending"] .ic { rotate: 180deg; }
.table .num { text-align: right; }
.table .actions { text-align: right; white-space: nowrap; }
.table .cell-user { display: flex; align-items: center; gap: 10px; }
.table-empty td { padding: 28px 8px; text-align: center; color: var(--ink-3); }
.table-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 12px; border-top: 1px solid var(--hair); flex-wrap: wrap; }
.table-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.table-toolbar .search { flex: 1 1 220px; height: 36px; }
}
@layer ui{
/* Хронология и лента активности */
.activity { display: flex; flex-direction: column; }
.activity > li { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--hair); }
.activity > li:last-child { border-bottom: 0; }
.activity-text { font-size: 14px; line-height: 1.4; color: var(--ink-2); }
.activity-text b { font-weight: 500; color: var(--ink); }
.activity time { display: block; font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.activity .pane-flat { margin-top: 8px; font-size: 13.5px; }
.timeline-sm li { font-size: 13px; padding: 5px 0; }
.timeline-crit .dot { background: var(--crit); }
.log-sm { font-size: 12px; max-height: 180px; }
.log-plain { background: none; padding: 0; }
}
@layer ui{
/* Календарь: диапазон дат */
.cal { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.cal-head-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cal-title { font-size: 15px; font-weight: 600; }
.cal-day.is-range { background: var(--accent-soft); border-radius: 0; }
.cal-day.is-start, .cal-day.is-end { background: var(--btn); color: var(--btn-text); font-weight: 600; }
.cal-day.is-start { border-radius: 9px 0 0 9px; }
.cal-day.is-end { border-radius: 0 9px 9px 0; }
.cal-day.is-start.is-end { border-radius: 9px; }
.cal-day:disabled { opacity: 0.35; cursor: not-allowed; }
.date-range { display: flex; align-items: center; gap: 8px; }
.date-range .input { width: 150px; }
.date-range .ic { width: 16px; height: 16px; color: var(--ink-3); }
}
@layer ui{
/* Модальные окна и шторки (элемент <dialog>, открытие и закрытие — компоненты Dialog и Drawer) */
.dialog {
  position: fixed; inset: 0; margin: auto; width: min(480px, calc(100% - 32px)); max-height: calc(100% - 32px);
  padding: 0; border: 1px solid var(--glass-edge); border-radius: var(--r-lg); overflow: hidden;
  background: var(--overlay-bg); color: var(--ink);
  -webkit-backdrop-filter: blur(24px) saturate(140%); backdrop-filter: blur(24px) saturate(140%);
  box-shadow: inset 0 1px 0 var(--glass-highlight), 0 30px 60px -20px rgba(15, 21, 43, 0.45);
  opacity: 0; scale: 0.96; translate: 0 10px;
  transition: opacity 0.18s, scale 0.5s var(--ease-spring), translate 0.5s var(--ease-spring), display 0.5s allow-discrete, overlay 0.5s allow-discrete;
}
.dialog[open] { display: flex; flex-direction: column; opacity: 1; scale: 1; translate: 0 0; }
@starting-style { .dialog[open] { opacity: 0; scale: 0.96; translate: 0 10px; } }
.dialog::backdrop { background: var(--scrim); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); opacity: 0; transition: opacity 0.3s, display 0.5s allow-discrete, overlay 0.5s allow-discrete; }
.dialog[open]::backdrop { opacity: 1; }
@starting-style { .dialog[open]::backdrop { opacity: 0; } }
.dialog:focus { outline: none; }
.dialog-sm { width: min(360px, calc(100% - 32px)); }
.dialog-lg { width: min(720px, calc(100% - 32px)); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px 0; }
.dialog-title { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.dialog-head .icon-btn-sm { width: 32px; height: 32px; }
.dialog-body { padding: 14px 22px; font-size: 14px; color: var(--ink-2); line-height: 1.5; overflow: auto; }
.dialog-body > * + * { margin-top: 12px; }
.dialog-body .form { margin: 0; }
.dialog-foot { display: flex; justify-content: flex-end; align-items: center; gap: 10px; padding: 4px 22px 20px; flex-wrap: wrap; }
.dialog-foot .meta { margin-right: auto; }
.dialog-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--control); border: 1px solid var(--glass-edge); color: var(--ink-2); margin: 0 auto; }
.dialog-icon .ic { width: 24px; height: 24px; }
.dialog-icon.is-crit { background: var(--crit-soft); color: var(--crit-text); border-color: transparent; }
.dialog-center { text-align: center; }
.dialog-center .dialog-head { justify-content: center; padding-top: 24px; }
.dialog-center .dialog-foot { justify-content: center; }
.dialog-center .dialog-foot .btn { flex: 1; }
.dialog-media { aspect-ratio: 16 / 9; background: var(--seg-bg); }
.dialog-media img { width: 100%; height: 100%; object-fit: cover; }
body:has(.dialog[open]) { overflow: hidden; }
/* max-width: none снимает браузерный предел окна (100% - 6px - 2em): без этого нижняя шторка и шторка на телефоне не доходят до правого края */
.drawer { inset: 0 0 0 auto; margin: 0; width: min(420px, 100%); max-width: none; height: 100%; max-height: none; border-radius: var(--r-lg) 0 0 var(--r-lg); scale: 1; translate: 32px 0; }
.drawer[open] { scale: 1; translate: 0 0; }
@starting-style { .drawer[open] { translate: 32px 0; scale: 1; } }
.drawer-left { inset: 0 auto 0 0; border-radius: 0 var(--r-lg) var(--r-lg) 0; translate: -32px 0; }
@starting-style { .drawer-left[open] { translate: -32px 0; } }
.drawer-bottom { inset: auto 0 0 0; width: 100%; height: auto; max-height: 86vh; border-radius: var(--r-lg) var(--r-lg) 0 0; translate: 0 32px; }
@starting-style { .drawer-bottom[open] { translate: 0 32px; } }
.drawer .dialog-body { flex: 1; }
.drawer-handle { width: 40px; height: 4px; border-radius: 2px; background: var(--hair-strong); margin: 10px auto -4px; flex: none; }
.drawer-nav .nav-link { padding: 10px 12px; }
}
@layer ui{
/* Навигация: группа с вложенным списком — «Управление» и «UI Kit» */
.nav-group { display: flex; flex-direction: column; }
.nav-toggle { width: 100%; text-align: left; }
.nav-chev { margin-left: auto; width: 16px; height: 16px; color: var(--ink-3); transition: rotate 0.3s var(--ease-out); }
.nav-group.is-open .nav-chev { rotate: 180deg; }
.nav-group.is-active .nav-toggle { color: var(--ink); }
.nav-sub { display: flex; flex-direction: column; gap: 2px; padding: 2px 0 6px; }
.nav-sub[hidden] { display: none; }
.nav-sub-title { display: none; align-items: center; gap: 10px; padding: 6px 12px 10px; font-family: var(--font-display); font-weight: 500; font-size: 14px; letter-spacing: 0.02em; }
/* Подзаголовок группы: капитель на плашке, чтобы не путался со ссылками; длинные названия ссылок переносятся */
.nav-sub-head {
  position: relative;
  width: fit-content; margin: 12px 0 3px 36px; padding: 3px 8px; border-radius: 6px;
  background: var(--hair); color: var(--ink-2);
  font-size: 10.5px; font-weight: 600; line-height: 1.3; text-transform: uppercase; letter-spacing: 0.08em;
}
/* Линия слева от ссылок не рвётся на подзаголовке и подходит к плашке веткой: над первым подзаголовком
   пусто — получается «Г», дальше ствол идёт сквозь — «├» */
.nav-sub-head::before { content: ""; position: absolute; left: -15px; top: -12px; bottom: -3px; width: 1px; background: var(--hair); }
.nav-sub-head::after { content: ""; position: absolute; left: -15px; top: 50%; width: 15px; height: 1px; background: var(--hair); }
.nav-sub-head:first-child::before, .nav-sub-title + .nav-sub-head::before { top: 50%; }
.nav-sub-link {
  position: relative; z-index: 1; display: flex; align-items: center; gap: 8px;
  padding: 7px 12px 7px 44px; border-radius: 10px; font-size: 14px; font-weight: 450; line-height: 1.3; color: var(--ink-2);
  white-space: normal; overflow-wrap: anywhere;
  transition: background 0.18s, color 0.18s;
}
.nav-sub-link::before { content: ""; position: absolute; left: 21px; top: -2px; bottom: -2px; width: 1px; background: var(--hair); }
.nav-sub-link:hover { background: var(--control); color: var(--ink); }
.nav-sub-link[aria-current="page"] { color: var(--ink); font-weight: 500; }
.nav-sub-link[aria-current="page"]:hover { background: transparent; }
.nav:not(.has-pill) .nav-sub-link[aria-current="page"] { background: var(--glass-strong); }
.nav-sub-link .count { margin-left: auto; }
}
@layer ui{
/* Страницы входа: карточка по центру, поля в колонку, код подтверждения по ячейкам */
.auth-card { width: 400px; max-width: 100%; padding: 28px 28px 24px; gap: 18px; }
.auth-head { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; }
.auth-head .brand-mark { width: 40px; height: 40px; margin-bottom: 8px; }
.auth-icon { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--accent-soft); color: var(--accent-text); margin-bottom: 8px; }
.auth-icon .ic { width: 22px; height: 22px; }
.auth-title { font-family: var(--font-display); font-weight: 500; font-size: 20px; letter-spacing: -0.01em; }
.auth-sub { color: var(--ink-3); font-size: 13.5px; }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form .field-label .link { margin-left: auto; font-size: 12.5px; }
/* На входе обязательны все поля: звёздочки у подписей не нужны */
.auth-form .field-req { display: none; }
.auth-form .btn-block { margin-top: 4px; }
.auth-foot { text-align: center; font-size: 13px; color: var(--ink-3); }
.otp { display: flex; justify-content: center; gap: 8px; }
.otp .input { width: 44px; height: 52px; padding: 0; text-align: center; font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; border-radius: 12px; }
.otp .input:nth-child(4) { margin-left: 8px; }
/* Экран входа: карточка по центру окна, рейки и шапки нет */
.auth-screen { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.auth-foot .btn-link { font-size: inherit; }
/* Настройка второго фактора: шаги в колонку. QR всегда тёмный на белом: иначе камера его не прочтёт */
.totp-setup { display: flex; flex-direction: column; gap: 14px; }
.totp-note { font-size: 13.5px; color: var(--ink-2); line-height: 1.45; }
.totp-qr { align-self: center; box-sizing: content-box; width: 184px; height: 184px; padding: 10px; border-radius: 14px; background: #fff; }
.totp-secret { display: flex; align-items: center; justify-content: center; gap: 8px; }
.totp-secret code { font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.02em; word-spacing: 0.2em; text-align: center; overflow-wrap: anywhere; color: var(--ink); }
/* Резервные коды: два столбца моноширинным, чтобы переписать без ошибок */
.codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 16px; margin: 0; padding: 12px 14px; list-style: none; border-radius: 12px; background: var(--code-bg); font-family: var(--font-mono); font-size: 13.5px; font-variant-numeric: tabular-nums; text-align: center; color: var(--ink); }
.codes-actions { display: flex; gap: 10px; }
.codes-actions .btn { flex: 1; }
}
@layer ui{

/* ---------- Главная: виджеты и режим правки ---------- */

/* Ячейка сетки главной: виджет занимает её целиком, в режиме правки над ним полоса кнопок */
.widget { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.widget-body { flex: 1; display: grid; min-width: 0; }
/* Виджет с новой строки: с первой колонки, сколько бы места ни осталось в прежней */
.widget.is-row { grid-column-start: 1; }
.widget-bar {
  display: flex; align-items: center; gap: 2px; min-height: 40px; padding: 4px 4px 4px 8px;
  border: 1px dashed var(--hair-strong); border-radius: var(--r-md);
  transition: border-color 0.18s, background 0.18s; container-type: inline-size;
}
.widget-bar-title { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.widget-grip { flex: none; width: 16px; height: 16px; margin-right: 4px; color: var(--ink-3); }
/* В узкую полосу название не помещается: оно и так в панели виджета, а скринридер слышит подпись группы */
@container (max-width: 280px) {
  .widget-bar-title { display: none; }
  .widget-grip { margin-right: auto; }
}

/* Мышью виджет берут за любое место, пальцем — за полосу: по остальному палец листает страницу */
.widget.is-editing { position: relative; cursor: grab; -webkit-user-select: none; user-select: none; }
.widget.is-editing .widget-bar { touch-action: none; }
.widget.is-editing:hover .widget-bar { border-color: var(--ink-3); }

/* Перетаскивание: ячейка остаётся местом, куда виджет встанет, а сам он едет за указателем.
   Сдвиг --drag-x и --drag-y ставит pages/home/arrange.ts */
.widget[data-gesture] { z-index: 3; }
.widget[data-gesture="move"]::before {
  content: ""; position: absolute; inset: 0;
  border: 1.5px dashed var(--hair-strong); border-radius: var(--r-lg); background: var(--glass-soft);
}
.widget[data-gesture="move"] > * { translate: var(--drag-x) var(--drag-y); }
.widget[data-gesture="move"] .widget-bar { background: var(--glass-strong); border-style: solid; border-color: var(--glass-edge); }
.widget[data-gesture="move"] .widget-body > * {
  box-shadow: inset 0 1px 0 var(--glass-highlight), 0 28px 56px -20px rgba(15, 21, 43, 0.38);
}
/* Пустая строка под всеми, пока виджет тянут; когда он встал в свою строку последним, вторая не нужна */
.widget-ghost { display: none; }
.grid:has(> .widget[data-gesture="move"]) > .widget-ghost {
  grid-column: 1 / -1; display: grid; place-items: center; min-height: 112px;
  border: 1.5px dashed var(--hair-strong); border-radius: var(--r-lg);
  color: var(--ink-3); font-size: 13px; font-weight: 600;
}
.grid > .widget.is-row[data-gesture="move"] + .widget-ghost { display: none; }
body[data-arrange="move"], body[data-arrange="move"] * { cursor: grabbing !important; }
body[data-arrange="size"], body[data-arrange="size"] * { cursor: ew-resize !important; }

/* Правый край тянет ширину: риска в зазоре между виджетами, рядом — ширина, пока её тянут */
.widget-resize {
  position: absolute; top: 0; bottom: 0; right: calc(var(--gap) / -2 - 7px); z-index: 1;
  width: 14px; cursor: ew-resize; touch-action: none;
}
.widget-resize::after {
  content: ""; position: absolute; top: 50%; left: 5px; width: 4px; height: 36px; translate: 0 -50%;
  border-radius: 2px; background: var(--hair-strong);
  transition: height 0.24s var(--ease-spring), background 0.18s;
}
.widget-resize:hover::after, .widget[data-gesture="size"] .widget-resize::after { height: 56px; background: var(--accent); }
.widget-resize::before {
  content: attr(data-size); position: absolute; top: 50%; right: 18px; translate: 0 -50%;
  padding: 3px 9px; border-radius: 9px; white-space: nowrap; pointer-events: none;
  background: var(--glass-strong); border: 1px solid var(--glass-edge); box-shadow: var(--glass-shadow);
  font-size: 12.5px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums;
  opacity: 0; transition: opacity 0.18s;
}
.widget[data-gesture="size"] .widget-resize::before { opacity: 1; }

.widget-clock { justify-content: center; gap: 8px; }
/* Строке без искорки её колонка не нужна */
.widget .row:not(:has(> :nth-child(4))) { grid-template-columns: 8px minmax(0, 1fr) auto; }
/* Клавиш столько, сколько разделов открыто вошедшему: ряд заполняется сам на любой ширине виджета */
.widget .key-grid { grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); }
}
@layer ui{

/* ---------- Адаптив ---------- */

@media (max-width: 1240px) {
  :root { --rail-w: 84px; }
  .rail { padding: 18px 12px; }
  .brand { justify-content: center; padding: 6px 0; }
  .brand-name, .nav-link span, .me-text { display: none; }
  .nav-link { justify-content: center; padding: 11px 0; }
  .nav-pill::before, .nav:not(.has-pill) .nav-link[aria-current="page"]::before { left: -12px; }
  .me { flex-direction: column; justify-content: center; gap: 8px; padding: 6px 0; }
  .me-settings { margin-left: 0; }
  .cluster { grid-template-columns: 1fr 1fr; row-gap: 24px; }
  .cluster-fx { grid-column: span 2; border-left: 0; border-top: 1px solid var(--hair); padding-left: 0; margin-left: 0; padding-top: 20px; }
  .cluster-fx.cluster-cell + .cluster-cell { border-left: 0; }
}

@media (max-width: 1100px) {
  .grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .c3, .c4, .c5 { grid-column-end: span 3; }
  .c6, .c7, .c8, .c9, .c10, .c11, .c12 { grid-column-end: span 6; }
  /* В шесть колонок ширины из двенадцати сливаются: подпись «4 из 12» здесь врала бы */
  .widget-resize::before { display: none; }
  .notes-layout { grid-template-columns: 240px minmax(0, 1fr); }
  .notes-side { grid-column: span 2; flex-direction: row; }
  .notes-side > * { flex: 1; }
}

@media (max-width: 760px) {
  :root { --rail-w: 0px; --pad: 16px 16px; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .search { min-width: 0; flex: 1 1 auto; }
  .pane-head { flex-wrap: wrap; }
  .pane-tools { flex: 0 1 auto; flex-wrap: wrap; }
  .rail {
    position: fixed; top: auto; bottom: 12px; left: 12px; right: 12px; z-index: 30;
    height: 64px; margin: 0; padding: 8px; flex-direction: row; align-items: center; gap: 0;
    border-radius: 20px;
  }
  .brand, .me .avatar { display: none; }
  .nav { flex-direction: row; flex: 1; min-width: 0; justify-content: space-around; gap: 0; }
  /* В нижней панели от подвала остаётся только кнопка настроек, справа от разделов */
  .rail-foot { margin: 0 0 0 4px; }
  .me { padding: 0; }
  .nav-link { padding: 12px 0; flex: 1; border-radius: 12px; }
  .nav-pill::before, .nav:not(.has-pill) .nav-link[aria-current="page"]::before { left: 50%; top: auto; bottom: -8px; translate: -50% 0; width: 22px; height: 3px; }
  .content { padding: 12px 16px 100px; }
  .topbar { margin-bottom: 16px; gap: 10px; }
  .search kbd { display: none; }
  .grid { grid-template-columns: minmax(0, 1fr); }
  .c3, .c4, .c5, .c6, .c7, .c8, .c9, .c10, .c11, .c12 { grid-column-end: span 1; }
  /* Одна колонка: ширину менять некуда */
  .widget-resize { display: none; }
  .cluster { grid-template-columns: 1fr; padding: 20px; row-gap: 18px; }
  .cluster-cell + .cluster-cell { border-left: 0; border-top: 1px solid var(--hair); padding-left: 0; margin-left: 0; padding-top: 18px; }
  .cluster-fx { grid-column: auto; }
  .clock { font-size: 52px; }
  .meters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-row { grid-template-columns: 1fr; }
  .notes-layout { grid-template-columns: 1fr; }
  .notes-side { grid-column: auto; flex-direction: column; }
  .editor { min-height: 0; }
  .fields { grid-template-columns: 1fr; }
  .minis { grid-template-columns: 1fr; }
  .page-head { margin-bottom: 16px; }
  .page-title { font-size: 21px; }
  .containers th:nth-child(2), .containers td:nth-child(2) { display: none; }
  .toast-host { left: 16px; right: 16px; bottom: 88px; }
}

@media (max-width: 420px) {
  .key-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fx { grid-template-columns: 30px 70px 56px minmax(40px, 1fr); }
}
}
@layer ui{

/* ---------- Библиотека компонентов: адаптив ---------- */

@media (max-width: 1240px) {
  /* Рейка в иконках: вложенный список группы выезжает панелью справа от рейки (её контейнер — сама рейка) */
  .nav { position: static; overflow: visible; margin: 0; padding: 0; -webkit-mask-image: none; mask-image: none; }
  .nav-toggle { justify-content: center; }
  .nav-toggle .nav-chev { display: none; }
  .nav-sub {
    position: absolute; left: calc(100% + 10px); top: 0; bottom: 0; width: 256px; z-index: 5;
    overflow-y: auto; padding: 12px 10px; border-radius: var(--r-xl);
    /* Рейка сама размывает фон, поэтому вложенный backdrop-filter видит только её слой:
       панель делаем почти непрозрачной, иначе сквозь неё читается текст страницы */
    background: color-mix(in srgb, var(--surface) 94%, transparent); border: 1px solid var(--glass-edge);
    box-shadow: inset 0 1px 0 var(--glass-highlight), var(--glass-shadow);
  }
  .nav-sub-title { display: flex; }
  .nav-sub-head { margin-left: 4px; }
  .nav-sub-link { padding-left: 12px; }
  .nav-sub-link::before, .nav-sub-head::before, .nav-sub-head::after { display: none; }
  .tabs-layout { grid-template-columns: 1fr; }
  .tabs-layout .tabs-vertical { flex-direction: row; border-right: 0; border-bottom: 1px solid var(--hair); overflow-x: auto; }
  .tabs-layout .tabs-vertical .tab { border-radius: 10px 10px 0 0; }
  .tabs-layout .tabs-vertical .tabs-pill { border-right: 0; border-bottom: 2px solid var(--ink); }
}

@media (max-width: 760px) {
  /* Нижняя панель: список группы открывается шторкой над ней */
  .nav-group { flex: 1; min-width: 0; }
  .nav-toggle { padding: 12px 0; width: 100%; }
  .nav-sub {
    left: 0; right: 0; top: auto; bottom: calc(100% + 10px); width: auto; max-height: min(62vh, 560px);
    display: grid; grid-template-columns: 1fr 1fr; gap: 2px 8px; align-content: start; padding: 12px;
  }
  .nav-sub[hidden] { display: none; }
  .nav-sub-title, .nav-sub-head, .nav-sub-link[data-nav="ui"] { grid-column: span 2; }
  .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .steps:not(.steps-vertical) { flex-direction: column; }
  .steps:not(.steps-vertical) .step { flex-direction: row; text-align: left; align-items: flex-start; gap: 12px; padding-bottom: 22px; }
  .steps:not(.steps-vertical) .step:last-child { padding-bottom: 0; }
  .steps:not(.steps-vertical) .step::before { top: 32px; bottom: 2px; left: 14px; right: auto; width: 1.5px; height: auto; display: block; }
  .steps:not(.steps-vertical) .step:last-child::before { display: none; }
  .steps:not(.steps-vertical) .step:not(.is-done)::before { background: var(--hair-strong); }
  .steps:not(.steps-vertical) .step-text { padding-top: 5px; }
  .pane-media { margin: -16px -16px 0; }
  .dialog-sheet { inset: auto 0 0 0; margin: 0; width: 100%; max-width: none; max-height: 86vh; border-radius: var(--r-lg) var(--r-lg) 0 0; translate: 0 32px; scale: 1; }
  .dialog-sheet[open] { translate: 0 0; }
  @starting-style { .dialog-sheet[open] { translate: 0 32px; scale: 1; } }
  .drawer { width: 100%; border-radius: 0; }
  .drawer-bottom { border-radius: var(--r-lg) var(--r-lg) 0 0; }
  .table-foot { flex-direction: column; align-items: flex-start; }
  .date-range { flex-wrap: wrap; }
  .stat-display { font-size: 36px; }
  .display { font-size: 40px; }
  .kpi-row { flex-wrap: wrap; }
  .pane-row { flex-direction: column; align-items: stretch; }
  .cmdk-foot { display: none; }
}

@media (max-width: 480px) {
  /* На узком телефоне шторка группы в одну колонку: названия не обрезаются */
  .nav-sub { grid-template-columns: 1fr; }
  .nav-sub-title, .nav-sub-head, .nav-sub-link[data-nav="ui"] { grid-column: auto; }
}
}
@layer ui{

/* Раздел «UI Kit»: оформление документации (обзор, демо, код, токены).
   Сами компоненты живут в пакете @vvlab/ui. */

.kit-lead { max-width: 66ch; color: var(--ink-2); font-size: 15px; line-height: 1.55; }
.kit-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: var(--gap); }
.kit-group-title { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 600; }
.kit-group-title .ic { color: var(--ink-2); }
.kit-links { display: flex; flex-direction: column; gap: 2px; }
.kit-links a {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 7px 10px; margin: 0 -10px; border-radius: 9px;
  font-size: 14px; font-weight: 500; color: var(--ink-2); transition: background 0.15s, color 0.15s;
}
.kit-links a:hover { background: var(--control); color: var(--ink); }
.kit-links a .ic { width: 14px; height: 14px; color: var(--ink-3); }
.kit-intro { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: var(--gap); }
.kit-files td:first-child { font-family: var(--font-mono); font-size: 12.5px; white-space: nowrap; }

/* Демо: панель с заголовком, сценой и кодом */
.kit-demos { display: flex; flex-direction: column; gap: var(--gap); }
.page-kit .demo .pane-head { margin-bottom: 0; }
.demo { gap: 12px; }
.demo-head { display: flex; flex-direction: column; gap: 3px; }
.demo-title { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.demo-note { font-size: 13.5px; color: var(--ink-3); max-width: 76ch; line-height: 1.45; }
.demo-note code, .kit-lead code { font-family: var(--font-mono); font-size: 12px; padding: 1px 5px; border-radius: 5px; background: var(--code-bg); color: var(--ink-2); }
.demo-stage {
  position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; min-width: 0;
  padding: 18px; border-radius: 14px; border: 1px dashed var(--hair-strong);
}
.demo-stage.is-block { display: block; }
.demo-stage.is-col { flex-direction: column; align-items: stretch; }
.demo-stage.is-start { align-items: flex-start; }
.demo-stage.is-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); align-items: start; }
.demo-stage.is-tall { min-height: 220px; }
.demo-stage.is-bare { border: 0; padding: 0; }
.auth-stage { justify-content: center; min-height: 440px; }
.demo-stage.is-bare.auth-stage { min-height: min(72vh, 620px); }
.demo-stage.has-bg {
  border-style: solid; border-color: var(--glass-edge);
  background:
    radial-gradient(70% 90% at 15% 20%, var(--bg-light-1), transparent 70%),
    radial-gradient(60% 80% at 85% 80%, var(--bg-light-3), transparent 70%),
    radial-gradient(50% 70% at 70% 10%, var(--bg-light-2), transparent 70%),
    radial-gradient(40% 60% at 20% 90%, var(--bg-light-4), transparent 70%);
}
.demo-stage.has-bg::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background-image: radial-gradient(circle, var(--mesh) 1px, transparent 1.6px); background-size: 24px 24px;
}
.demo-stage.has-bg > * { position: relative; }
.demo-code { display: flex; flex-direction: column; gap: 8px; }
.demo-code-bar { display: flex; align-items: center; gap: 4px; }
.demo-pre {
  margin: 0; background: var(--code-bg); border-radius: 12px; padding: 12px 14px;
  font-family: var(--font-mono); font-size: 12.5px; line-height: 1.6; color: var(--ink-2);
  overflow: auto; max-height: 460px; white-space: pre; tab-size: 2;
}
.demo-pre[hidden] { display: none; }
.tk-tag { color: var(--s1); }
.tk-attr { color: var(--ink); }
.tk-val { color: var(--s3); }
.tk-cm { color: var(--ink-3); font-style: italic; }
.kit-props { font-size: 13.5px; }
.kit-props td:first-child { font-family: var(--font-mono); font-size: 12.5px; color: var(--ink); white-space: nowrap; }
.kit-props td:last-child { color: var(--ink-2); }
.kit-pager { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); margin-top: calc(var(--gap) + 8px); }
.kit-pager a { display: flex; flex-direction: column; gap: 2px; padding: 14px 18px; border-radius: var(--r-md); }
.kit-pager a small { font-size: 12.5px; color: var(--ink-3); display: flex; align-items: center; gap: 4px; }
.kit-pager a b { font-size: 15px; font-weight: 600; }
.kit-pager a .ic { width: 14px; height: 14px; }
.kit-pager .is-next { text-align: right; align-items: flex-end; }
.kit-pager .is-next small { flex-direction: row-reverse; }
.kit-pager .is-empty { visibility: hidden; }

/* Демо панелей навигации */
.nav-demo { display: flex; flex-direction: column; gap: 4px; width: 240px; max-width: 100%; }
.nav-demo .nav-link[aria-current="page"] { background: var(--glass-strong); box-shadow: inset 0 1px 0 var(--glass-highlight), 0 1px 2px rgba(15, 21, 43, 0.06); }
.nav-demo .nav-link[aria-current="page"]::before { content: ""; position: absolute; left: 0; top: 50%; width: 3px; height: 16px; translate: 0 -50%; border-radius: 0 2px 2px 0; background: var(--accent); }
.nav-demo .nav-sub { padding-top: 2px; }
.nav-demo .nav-sub-link[aria-current="page"] { background: var(--glass-strong); }
.topbar-demo { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.topbar-demo .search { flex: 1 1 260px; }
.demo-stage .tabbar { width: 100%; }
.demo-stage .search { flex: none; }

/* Токены, цвета, типографика, сетка, иконки, движение */
.swatch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; width: 100%; }
.swatch-card { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; min-width: 0; }
.swatch-box {
  position: relative; height: 56px; border-radius: 10px; overflow: hidden; border: 1px solid var(--glass-edge);
  background-image: linear-gradient(45deg, var(--hair) 25%, transparent 25%, transparent 75%, var(--hair) 75%), linear-gradient(45deg, var(--hair) 25%, transparent 25%, transparent 75%, var(--hair) 75%);
  background-size: 12px 12px; background-position: 0 0, 6px 6px;
}
.swatch-box::after { content: ""; position: absolute; inset: 0; background: var(--sw); }
.swatch-card b { font-family: var(--font-mono); font-size: 12px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.swatch-card span { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-3); word-break: break-all; }
.swatch-card small { color: var(--ink-2); font-size: 12.5px; line-height: 1.35; }
.type-row { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 16px; align-items: baseline; padding: 12px 0; border-bottom: 1px solid var(--hair); width: 100%; }
.type-row:last-child { border-bottom: 0; }
.type-row small { font-size: 12px; color: var(--ink-3); font-family: var(--font-mono); line-height: 1.4; }
.grid-demo { width: 100%; }
.gcell { background: var(--control); border: 1px dashed var(--hair-strong); border-radius: 8px; padding: 8px; text-align: center; font-size: 12.5px; color: var(--ink-3); font-family: var(--font-mono); min-width: 0; }
.space-row { display: flex; align-items: center; gap: 12px; font-size: 13px; width: 100%; }
.space-row b { width: 72px; font-family: var(--font-mono); font-size: 12px; color: var(--ink); flex: none; }
.space-row i { display: block; height: 14px; background: var(--accent-soft); border: 1px solid var(--accent); border-radius: 3px; flex: none; }
.space-row span { color: var(--ink-3); font-size: 12.5px; }
.radius-row { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-3); font-family: var(--font-mono); }
.radius-row i { display: block; width: 56px; height: 56px; background: var(--control); border: 1px solid var(--hair-strong); }
.radius-row .r-sm { border-radius: var(--r-sm); }
.radius-row .r-md { border-radius: var(--r-md); }
.radius-row .r-lg { border-radius: var(--r-lg); }
.radius-row .r-xl { border-radius: var(--r-xl); }
.icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 6px; width: 100%; }
.icon-cell {
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 6px 10px; border-radius: 12px;
  font-size: 11.5px; color: var(--ink-3); font-family: var(--font-mono); text-align: center; word-break: break-all;
  transition: background 0.15s, color 0.15s;
}
.icon-cell:hover { background: var(--control-hover); color: var(--ink); }
.icon-cell .ic { width: 22px; height: 22px; color: var(--ink); }
.ease-demo { display: grid; grid-template-columns: 150px 120px minmax(0, 1fr); gap: 16px; align-items: center; width: 100%; }
.ease-name { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.ease-name b { font-weight: 600; }
.ease-name small { color: var(--ink-3); font-family: var(--font-mono); font-size: 11.5px; }
.ease-curve { width: 120px; height: 80px; display: block; overflow: visible; }
.ease-curve .axis { stroke: var(--hair-strong); stroke-width: 1; fill: none; }
.ease-curve .curve { stroke: var(--s1); stroke-width: 2; fill: none; stroke-linecap: round; }
.ease-track { position: relative; height: 32px; border-radius: 16px; background: var(--seg-bg); }
.ease-ball { position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; border-radius: 50%; background: var(--btn); }
.fx-box { width: 120px; height: 72px; border-radius: 14px; display: grid; place-items: center; font-size: 13px; font-weight: 500; }
.fx-draw { width: 120px; height: 72px; overflow: visible; }
.fx-draw path { fill: none; stroke: var(--s1); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.kit-count { font-size: 36px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }

@media (max-width: 1100px) {
  .kit-intro { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .kit-props td:first-child, .kit-files td:first-child { white-space: normal; overflow-wrap: anywhere; }
  .kit-props td:last-child { min-width: 96px; }
  .demo-stage { max-width: 100%; }
  .kit-pager { grid-template-columns: 1fr; }
  .kit-pager .is-empty { display: none; }
  .type-row { grid-template-columns: 1fr; gap: 4px; }
  .ease-demo { grid-template-columns: 1fr; }
  .demo-stage { padding: 14px; }
}
}
