/* Nunito (SIL OFL 1.1) — лежит локально, без Google Fonts */
@font-face { font-family: 'Nunito'; font-style: normal; font-display: swap; font-weight: 200 1000; src: url('/fonts/nunito-cyrillic-ext-wght-normal.woff2') format('woff2-variations'), url('/fonts/nunito-cyrillic-ext-wght-normal.woff2') format('woff2'); unicode-range: U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F; }
@font-face { font-family: 'Nunito'; font-style: normal; font-display: swap; font-weight: 200 1000; src: url('/fonts/nunito-cyrillic-wght-normal.woff2') format('woff2-variations'), url('/fonts/nunito-cyrillic-wght-normal.woff2') format('woff2'); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: 'Nunito'; font-style: normal; font-display: swap; font-weight: 200 1000; src: url('/fonts/nunito-latin-ext-wght-normal.woff2') format('woff2-variations'), url('/fonts/nunito-latin-ext-wght-normal.woff2') format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Nunito'; font-style: normal; font-display: swap; font-weight: 200 1000; src: url('/fonts/nunito-latin-wght-normal.woff2') format('woff2-variations'), url('/fonts/nunito-latin-wght-normal.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; }

/* ==========================================================================
   Nyao Desk — интерфейс трекера.
   Цвета Nyao (розовый #FF1C90 → #FF89E2), шрифт Nunito, плотная «рабочая»
   сетка как у больших трекеров. Одна смелая деталь — приборная панель.
   ========================================================================== */

:root {
  --pink: #FF1C90;
  --pink-2: #FF89E2;
  --pink-ink: #D1006F;
  --grad: linear-gradient(135deg, #FF1C90 0%, #FF89E2 100%);

  --bg: #F6F3F7;
  --surface: #FFFFFF;
  --surface-2: #FAF7FB;
  --surface-3: #F1ECF3;
  --hover: #F4EEF6;
  --line: #E6DEE9;
  --line-2: #D6CCDA;
  --ink: #241B2D;
  --ink-2: #5D5368;
  --ink-3: #8C8296;
  --pink-soft: #FFE6F3;
  --pink-soft-2: #FFF2F9;
  --focus: #FF1C90;

  --todo: #6B6275;  --todo-bg: #ECE7EF;
  --prog: #5B3FD0;  --prog-bg: #ECE7FF;
  --done: #0B8A6B;  --done-bg: #DDF5EC;
  --warn: #B86E00;  --warn-bg: #FFF1D6;
  --danger: #D92D4B; --danger-bg: #FDE7EB;

  --t-epic: #8B5CF6; --t-story: #22A06B; --t-task: #2F80ED; --t-bug: #E5383B; --t-subtask: #4BADE8;
  --p-highest: #D92D4B; --p-high: #F0762B; --p-medium: #D69E00; --p-low: #2F80ED; --p-lowest: #8C8296;

  --shadow-1: 0 1px 2px rgba(36, 27, 45, .08);
  --shadow-2: 0 2px 6px rgba(36, 27, 45, .08), 0 8px 24px rgba(36, 27, 45, .08);
  --shadow-3: 0 12px 40px rgba(36, 27, 45, .22);

  --r-xs: 4px; --r-sm: 6px; --r-md: 10px; --r-lg: 14px;
  --topnav-h: 56px;
  --side-w: 244px;
  --font: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #15111B;
  --surface: #1E1926;
  --surface-2: #231D2C;
  --surface-3: #2B2436;
  --hover: #2E2639;
  --line: #352C41;
  --line-2: #463B54;
  --ink: #F3EDF7;
  --ink-2: #C3B8CE;
  --ink-3: #8F849C;
  --pink-soft: #3D1730;
  --pink-soft-2: #2C1526;
  --pink-ink: #FF6BB5;

  --todo: #C3B8CE; --todo-bg: #352C41;
  --prog: #B3A1FF; --prog-bg: #33285C;
  --done: #4FD3AE; --done-bg: #173D33;
  --warn: #FFC46B; --warn-bg: #43321A;
  --danger: #FF7A90; --danger-bg: #4A1D27;
  --p-lowest: #8F849C;

  --shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-2: 0 4px 16px rgba(0, 0, 0, .45);
  --shadow-3: 0 16px 48px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}
a { color: var(--pink-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
p { margin: 0 0 .6em; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
kbd {
  display: inline-block; min-width: 18px; padding: 0 5px; margin: 0 1px;
  font: 700 11px/18px var(--font); text-align: center; color: var(--ink-2);
  background: var(--surface); border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 4px;
}
code { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: .9em; background: var(--surface-3); padding: 1px 5px; border-radius: 4px; }
.i { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.grow { flex: 1; }
.muted { color: var(--ink-3); }
.small { font-size: 12px; }
.tiny { font-size: 11px; }
.row { display: flex; align-items: center; }
.row.gap, .gap { gap: 8px; }
.wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.pad { padding: 12px 0; }
.block { display: block; }
.overdue { color: var(--danger); font-weight: 700; display: inline-flex; gap: 4px; align-items: center; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 8px; top: 8px; z-index: 100; background: var(--surface); padding: 6px 10px; }
.mono-key { font-weight: 700; font-size: 12px; color: var(--ink-2); white-space: nowrap; letter-spacing: .01em; }
.mono-key.strike { text-decoration: line-through; color: var(--ink-3); }
a.mono-key:hover { color: var(--pink-ink); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- Кнопки и поля ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 32px; padding: 0 12px; border-radius: var(--r-sm);
  border: 1px solid transparent; background: var(--surface-3); color: var(--ink);
  font-weight: 700; font-size: 13.5px; white-space: nowrap;
  transition: background .12s, box-shadow .12s, transform .06s;
}
.btn:hover { background: var(--hover); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-icon { width: 32px; padding: 0; }
.btn-primary { background: var(--pink); color: #fff; box-shadow: 0 1px 0 rgba(0, 0, 0, .08), inset 0 -2px 0 rgba(0, 0, 0, .12); }
.btn-primary:hover { background: #F0007F; }
.btn-subtle { background: transparent; color: var(--ink-2); }
.btn-subtle:hover { background: var(--hover); color: var(--ink); }
.btn-subtle.on { color: var(--pink-ink); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(1.05); background: var(--danger); }
.link-btn { background: none; border: 0; padding: 0; color: var(--pink-ink); font-weight: 700; font-size: 12.5px; }
.link-btn:hover { text-decoration: underline; }
.link-btn.danger { color: var(--danger); }
.link-btn.block { display: block; margin-top: 2px; }

.input {
  width: 100%; height: 34px; padding: 0 10px;
  border: 1.5px solid var(--line-2); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink);
  transition: border-color .12s, box-shadow .12s;
}
textarea.input { height: auto; padding: 8px 10px; resize: vertical; line-height: 1.5; }
.input:hover { border-color: var(--ink-3); }
.input:focus { outline: none; border-color: var(--pink); box-shadow: 0 0 0 3px var(--pink-soft); }
.input-sm { height: 30px; font-size: 13px; }
.input-lg { height: 42px; font-size: 17px; font-weight: 700; }
select.input { padding-right: 26px; appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%); background-position: calc(100% - 14px) 50%, calc(100% - 9px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.input-btn { display: flex; align-items: center; gap: 8px; text-align: left; cursor: pointer; height: auto; min-height: 34px; padding: 4px 10px; }
.input-btn .caret { margin-left: auto; color: var(--ink-3); }
.labels-input { flex-wrap: wrap; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field-label { font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.field-hint { font-size: 12px; color: var(--ink-3); }
.with-ico { display: flex; align-items: center; gap: 8px; }
.with-ico > select, .with-ico > input { flex: 1; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.create-form { display: flex; flex-direction: column; gap: 16px; }
.shake { animation: shake .35s; border-color: var(--danger) !important; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

/* Переключатель-тумблер */
.switch { appearance: none; width: 34px; height: 20px; border-radius: 10px; background: var(--line-2); position: relative; cursor: pointer; flex: none; transition: background .15s; margin: 0; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-1); transition: transform .15s; }
.switch:checked { background: var(--pink); }
.switch:checked::after { transform: translateX(14px); }
.switch-row { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; cursor: pointer; }

/* ---------- Бейджи ---------- */
.type-ico { width: 18px; height: 18px; border-radius: 4px; display: inline-grid; place-items: center; color: #fff; flex: none; }
.type-ico .i { width: 12px; height: 12px; stroke-width: 2.6; }
.type-ico.sm { width: 16px; height: 16px; }
.type-ico.sm .i { width: 11px; height: 11px; }
.type-ico.xs { width: 14px; height: 14px; border-radius: 3px; }
.type-ico.xs .i { width: 10px; height: 10px; }
.type-ico.lg { width: 24px; height: 24px; }
.prio-ico { display: inline-grid; place-items: center; flex: none; }
.prio-ico .i { width: 16px; height: 16px; stroke-width: 2.6; }
.lozenge {
  display: inline-block; padding: 1px 7px; border-radius: 4px;
  font-size: 11.5px; font-weight: 800; white-space: nowrap; max-width: 150px; overflow: hidden; text-overflow: ellipsis;
  background: var(--todo-bg); color: var(--todo);
}
.lz-in_progress { background: var(--prog-bg); color: var(--prog); }
.lz-done { background: var(--done-bg); color: var(--done); }
.lz-dot { width: 10px; height: 10px; border-radius: 3px; background: var(--todo); flex: none; }
.lz-dot.lz-in_progress { background: var(--prog); }
.lz-dot.lz-done { background: var(--done); }
.lz-btn { background: none; border: 0; padding: 0; }
.label-chip {
  display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 7px;
  font-size: 11.5px; font-weight: 700; border-radius: 10px; white-space: nowrap;
  color: var(--ink-2); background: color-mix(in srgb, var(--lc) 14%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--lc) 35%, transparent);
}
.label-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--lc, var(--pink)); flex: none; }
.chip-x { border: 0; background: none; padding: 0; display: grid; place-items: center; color: var(--ink-3); }
.chip-x .i { width: 12px; height: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.epic-chip {
  display: inline-block; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding: 0 7px; height: 20px; line-height: 20px; border-radius: 4px; font-size: 11.5px; font-weight: 800;
  color: color-mix(in srgb, var(--ec) 80%, var(--ink)); background: color-mix(in srgb, var(--ec) 16%, var(--surface));
}
a.epic-chip:hover { text-decoration: none; filter: brightness(.97); }
.sp-badge { display: inline-grid; place-items: center; min-width: 22px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--surface-3); color: var(--ink-2); font-size: 11.5px; font-weight: 800; }
.sp-badge.sp-none { color: var(--ink-3); background: transparent; }
.sp-badge.big { min-width: 34px; height: 28px; border: 1px solid var(--line); cursor: pointer; font-size: 13px; }
.sp-badge.big:hover { border-color: var(--pink); color: var(--pink-ink); }
.sp-quick { display: flex; gap: 4px; flex-wrap: wrap; }
.mini-tag { font-size: 10.5px; font-weight: 800; color: var(--done); background: var(--done-bg); padding: 0 6px; border-radius: 8px; margin-left: 6px; }
.due { display: inline-flex; gap: 3px; align-items: center; font-size: 11.5px; font-weight: 700; color: var(--ink-3); }
.due .i { width: 12px; height: 12px; }
.due.today { color: var(--warn); }
.due.overdue { color: var(--danger); }
.swatch { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.swatch.big { width: 28px; height: 28px; border: 0; border-radius: 6px; }
.swatches { display: flex; gap: 6px; flex-wrap: wrap; padding: 8px; }

/* Аватарки */
.avatar {
  --av-h: 320;
  position: relative; display: inline-grid; place-items: center; flex: none; overflow: hidden;
  width: 28px; height: 28px; border-radius: 50%;
  background: hsl(var(--av-h) 70% 88%); color: hsl(var(--av-h) 55% 30%);
  font-size: 11px; font-weight: 800; box-shadow: 0 0 0 2px var(--surface);
}
:root[data-theme="dark"] .avatar { background: hsl(var(--av-h) 35% 30%); color: hsl(var(--av-h) 80% 88%); }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.av-xs { width: 20px; height: 20px; font-size: 9px; }
.av-sm { width: 24px; height: 24px; font-size: 10px; }
.av-lg { width: 40px; height: 40px; font-size: 15px; }
.av-xl { width: 72px; height: 72px; font-size: 26px; }
.av-empty { background: var(--surface-3) !important; color: var(--ink-3) !important; }
.av-empty .i { width: 60%; height: 60%; }
.av-stack { display: flex; }
.av-stack .avatar + .avatar { margin-left: -6px; }
.user-chip { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.user-chip > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proj-av { --pc: #FF1C90; display: inline-grid; place-items: center; flex: none; border-radius: 6px; color: #fff; background: var(--pc); background: linear-gradient(140deg, var(--pc), color-mix(in srgb, var(--pc) 55%, #fff)); }
.proj-av .i { width: 60%; height: 60%; stroke-width: 2.4; }
.pa-xs { width: 20px; height: 20px; border-radius: 5px; }
.pa-md { width: 28px; height: 28px; }
.pa-lg { width: 36px; height: 36px; border-radius: 8px; }
.pa-xl { width: 48px; height: 48px; border-radius: 10px; }

/* Прогресс */
.pbar { position: relative; display: flex; height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; min-width: 60px; }
.pbar-tall { height: 10px; border-radius: 5px; }
.pb-done { background: var(--done); }
.pb-prog { background: var(--prog); }

/* ---------- Оболочка ---------- */
.boot { height: 100vh; display: grid; place-items: center; }
.boot-spinner, .spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--pink-soft); border-top-color: var(--pink); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.page-loading { display: grid; place-items: center; padding: 80px 0; }

.shell { display: flex; flex-direction: column; height: 100vh; }
.topnav {
  position: relative; z-index: 20; flex: none;
  height: var(--topnav-h); display: flex; align-items: center; gap: 4px; padding: 0 12px;
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; padding: 0 10px 0 4px; margin-right: 6px; color: var(--ink); font-weight: 900; font-size: 16.5px; letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.logo-mark { width: 30px; height: 22px; }
.topnav-links { display: flex; gap: 2px; }
.nav-btn {
  position: relative; display: inline-flex; align-items: center; gap: 4px; height: 36px; padding: 0 10px;
  border: 0; background: none; border-radius: var(--r-sm); color: var(--ink-2); font-weight: 700; font-size: 14px;
}
.nav-btn:hover { background: var(--hover); color: var(--ink); text-decoration: none; }
.nav-btn.on { color: var(--pink-ink); }
.nav-btn.on::after { content: ''; position: absolute; left: 8px; right: 8px; bottom: -10px; height: 3px; border-radius: 3px 3px 0 0; background: var(--pink); }
.nav-btn .caret { width: 14px; height: 14px; }
.create-btn { margin-left: 8px; }
.top-search {
  display: flex; align-items: center; gap: 8px; height: 34px; width: 240px; padding: 0 8px 0 10px; margin-right: 6px;
  border: 1.5px solid var(--line-2); border-radius: var(--r-sm); background: var(--surface-2); color: var(--ink-3); font-weight: 600;
}
.top-search:hover { border-color: var(--ink-3); }
.top-search .kbds { margin-left: auto; }
.top-ico { position: relative; width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 50%; background: none; color: var(--ink-2); }
.top-ico:hover { background: var(--hover); color: var(--ink); }
.top-ico .i { width: 20px; height: 20px; }
.bell-badge { position: absolute; top: 3px; right: 2px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--pink); color: #fff; font-size: 10.5px; font-weight: 900; line-height: 17px; box-shadow: 0 0 0 2px var(--surface); }
.top-avatar { border: 0; background: none; padding: 4px; margin-left: 4px; border-radius: 50%; }
.top-avatar:hover { background: var(--hover); }

.shell-body { flex: 1; display: flex; min-height: 0; }
.main { flex: 1; min-width: 0; overflow: auto; outline: none; }
.sidebar {
  flex: none; width: var(--side-w); display: flex; flex-direction: column; gap: 4px;
  padding: 16px 10px 10px; overflow-y: auto; background: var(--surface-2); border-right: 1px solid var(--line);
  transition: width .15s;
}
.sidebar[hidden] { display: none; }
.side-proj { display: flex; align-items: center; gap: 10px; padding: 0 6px 14px; }
.side-proj-text { display: flex; flex-direction: column; min-width: 0; }
.side-proj-text strong { font-size: 14px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-proj-text span { font-size: 12px; color: var(--ink-3); }
.side-nav { display: flex; flex-direction: column; gap: 1px; }
.side-group { font-size: 12px; font-weight: 800; color: var(--ink-3); padding: 12px 10px 4px; }
.side-link {
  position: relative; display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border-radius: var(--r-sm);
  color: var(--ink-2); font-weight: 700; border: 0; background: none; text-align: left; width: 100%;
}
.side-link:hover { background: var(--hover); color: var(--ink); text-decoration: none; }
.side-link.on { background: var(--pink-soft); color: var(--pink-ink); }
.side-link.on::before { content: ''; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--pink); }
.side-link .i { width: 18px; height: 18px; }
.side-collapse { color: var(--ink-3); }
.sidebar.collapsed { width: 60px; padding-left: 8px; padding-right: 8px; }
.sidebar.collapsed .side-proj { justify-content: center; padding: 0 0 12px; }
.sidebar.collapsed .side-proj-text, .sidebar.collapsed .side-link span, .sidebar.collapsed .side-group { display: none; }
.sidebar.collapsed .side-link { justify-content: center; padding: 0; }

/* ---------- Страницы ---------- */
.page { padding: 20px 28px 48px; max-width: 1600px; }
.page-board { max-width: none; padding-right: 0; display: flex; flex-direction: column; height: 100%; padding-bottom: 0; }
.page-head { margin-bottom: 16px; }
.crumbs { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; font-size: 13px; color: var(--ink-3); margin-bottom: 6px; }
.crumbs a { color: var(--ink-3); font-weight: 600; }
.crumbs a:hover { color: var(--ink); }
.crumbs .i { width: 14px; height: 14px; }
.crumb-issue { display: inline-flex; align-items: center; gap: 5px; }
.page-title-row { display: flex; align-items: center; gap: 12px; min-height: 36px; }
.page-title { font-size: 24px; font-weight: 900; letter-spacing: -.015em; }
.page-actions { display: flex; gap: 8px; align-items: center; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); }
.panel-head { display: flex; align-items: center; gap: 8px; padding: 14px 16px 0; }
.panel-head h2 { font-size: 15px; font-weight: 800; }
.panel-body { padding: 12px 16px 16px; }
.empty { text-align: center; padding: 48px 20px; max-width: 460px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty-ico { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; background: var(--pink-soft); color: var(--pink-ink); margin-bottom: 6px; }
.empty-ico .i { width: 30px; height: 30px; }
.empty-title { font-size: 17px; font-weight: 800; }

/* ---------- Поповеры, меню, пикеры ---------- */
.popover {
  position: absolute; z-index: 300; min-width: 200px; max-width: calc(100vw - 16px);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-2);
  animation: pop .12s ease-out;
}
@keyframes pop { from { opacity: 0; transform: translateY(-4px); } }
.menu { padding: 6px; display: flex; flex-direction: column; min-width: 230px; max-height: 70vh; overflow: auto; }
.menu-item {
  display: flex; align-items: center; gap: 10px; min-height: 34px; padding: 0 10px; border: 0; background: none;
  border-radius: var(--r-sm); text-align: left; color: var(--ink); font-weight: 600; width: 100%;
}
.menu-item:hover, .menu-item:focus { background: var(--hover); outline: none; }
.menu-item .i { color: var(--ink-3); }
.menu-item.danger, .menu-item.danger .i { color: var(--danger); }
.menu-item.active { color: var(--pink-ink); }
.menu-item:disabled { opacity: .45; cursor: default; }
.menu-item kbd { margin-left: auto; }
.mi-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mi-check { color: var(--pink) !important; }
.menu-sep { height: 1px; background: var(--line); margin: 5px 4px; }
.menu-head { font-size: 12px; font-weight: 800; color: var(--ink-3); padding: 8px 10px 4px; }
.picker { padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.pick-list { display: flex; flex-direction: column; max-height: 300px; overflow: auto; gap: 1px; }
.pick-item { display: flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 8px; border: 0; background: none; border-radius: var(--r-sm); text-align: left; width: 100%; }
.pick-item:hover, .pick-item:focus, .pick-item.on { background: var(--hover); outline: none; }
.pick-item.on { color: var(--pink-ink); }
.pick-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.pick-sub { font-size: 12px; color: var(--ink-3); }
.pick-empty { padding: 10px; color: var(--ink-3); font-size: 13px; }
.pick-create { color: var(--pink-ink); font-weight: 700; }
.pop-form { padding: 12px; display: flex; flex-direction: column; gap: 10px; }

/* ---------- Модалки ---------- */
.modal-back {
  position: fixed; inset: 0; z-index: 200; display: flex; align-items: flex-start; justify-content: center;
  padding: 6vh 16px 16px; background: rgba(24, 16, 31, .45); overflow-y: auto; animation: fade .12s;
}
@keyframes fade { from { opacity: 0; } }
.modal { width: 100%; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-3); display: flex; flex-direction: column; max-height: 88vh; animation: rise .16s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(10px) scale(.99); } }
.modal-head { display: flex; align-items: center; gap: 8px; padding: 18px 20px 6px; }
.modal-head h2 { flex: 1; font-size: 19px; font-weight: 900; }
.modal-body { padding: 12px 20px 16px; overflow: auto; }
.modal-foot { display: flex; align-items: center; gap: 8px; justify-content: flex-end; padding: 12px 20px 16px; border-top: 1px solid var(--line); }

/* Тосты */
.toasts { position: fixed; left: 20px; bottom: 20px; z-index: 400; display: flex; flex-direction: column; gap: 8px; max-width: 420px; }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 11px 12px 11px 14px; border-radius: var(--r-md);
  background: var(--ink); color: var(--surface); box-shadow: var(--shadow-3); font-weight: 600; animation: rise .18s;
  transition: opacity .3s, transform .3s;
}
.toast.out { opacity: 0; transform: translateY(6px); }
.toast-ok > .i { color: #4FD3AE; }
.toast-err > .i { color: #FF7A90; }
.toast-info > .i { color: var(--pink-2); }
.toast-text { flex: 1; }
.toast-act { border: 0; background: none; color: var(--pink-2); font-weight: 800; }
.toast-x { border: 0; background: none; color: inherit; opacity: .6; display: grid; }

/* ---------- Палитра Ctrl+K ---------- */
.palette-modal { max-height: 72vh; }
.palette-modal .modal-body { padding: 0; }
.palette { display: flex; flex-direction: column; max-height: 70vh; }
.palette-bar { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.palette-bar .i { width: 20px; height: 20px; color: var(--pink); }
.palette-input { flex: 1; border: 0; background: none; font-size: 17px; font-weight: 600; outline: none; }
.palette-results { overflow: auto; padding: 6px; }
.pal-group { font-size: 12px; font-weight: 800; color: var(--ink-3); padding: 10px 10px 4px; }
.pal-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 38px; padding: 0 10px; border: 0; background: none; border-radius: var(--r-sm); text-align: left; }
.pal-item.on { background: var(--pink-soft); }
.pal-label { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: 600; }
.pal-sub { color: var(--ink-3); font-size: 12px; font-weight: 700; }
.pal-ico { width: 22px; height: 22px; display: grid; place-items: center; color: var(--ink-2); }
.pal-empty { padding: 24px; color: var(--ink-3); text-align: center; }
.palette-foot { display: flex; gap: 16px; padding: 8px 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-3); }

/* Горячие клавиши */
.sc-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px 32px; }
.sc-group h3 { font-size: 14px; font-weight: 800; margin-bottom: 8px; }
.sc-group dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; align-items: center; }
.sc-group dt { white-space: nowrap; }
.sc-group dd { margin: 0; color: var(--ink-2); }

/* Уведомления */
.notif-pop { display: flex; flex-direction: column; max-height: 76vh; }
.notif-head { display: flex; align-items: center; gap: 8px; padding: 14px 16px 10px; }
.notif-head strong { font-size: 16px; font-weight: 900; }
.notif-list { overflow: auto; padding: 0 6px; min-height: 80px; }
.notif-list .empty { padding: 24px; }
.notif-foot { display: flex; justify-content: space-between; padding: 10px 16px; border-top: 1px solid var(--line); }
.notif { position: relative; display: flex; gap: 12px; padding: 10px; border-radius: var(--r-md); color: var(--ink); }
.notif:hover { background: var(--hover); text-decoration: none; }
.notif.unread { background: var(--pink-soft-2); }
.notif-av { position: relative; flex: none; }
.notif-verb { position: absolute; right: -4px; bottom: -4px; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; background: var(--pink); color: #fff; box-shadow: 0 0 0 2px var(--surface); }
.notif-verb .i { width: 11px; height: 11px; stroke-width: 2.6; }
.notif-body { display: flex; flex-direction: column; min-width: 0; padding-right: 14px; }
.notif-text { font-size: 13.5px; }
.notif-time { font-size: 12px; color: var(--ink-3); }
.notif-dot { position: absolute; right: 10px; top: 14px; width: 8px; height: 8px; border-radius: 50%; background: var(--pink); }

/* Вкладки */
.tabs { display: flex; gap: 2px; border-bottom: 2px solid var(--line); margin-bottom: 12px; overflow-x: auto; }
.tab { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border: 0; background: none; font-weight: 700; color: var(--ink-2); white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab.on { color: var(--pink-ink); }
.tab.on::after { content: ''; position: absolute; left: 6px; right: 6px; bottom: -2px; height: 3px; border-radius: 3px; background: var(--pink); }
.tab-count { font-size: 11px; font-weight: 800; background: var(--surface-3); color: var(--ink-2); border-radius: 8px; padding: 0 6px; }

/* ---------- Доска ---------- */
.board-toolbar { display: flex; flex-direction: column; gap: 10px; margin: 0 28px 14px 0; }
.tb-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.search-wrap { position: relative; width: 200px; }
.search-wrap > .i { position: absolute; left: 9px; color: var(--ink-3); pointer-events: none; }
.search-wrap .input { padding-left: 30px; }
.tb-selects { display: flex; gap: 6px; }
.tb-selects .input { width: auto; max-width: 170px; }
.tb-label { display: flex; align-items: center; gap: 6px; color: var(--ink-3); }
.tb-label .input { width: auto; }
.av-filter { display: flex; }
.av-toggle { border: 0; background: none; padding: 0; margin-left: -4px; border-radius: 50%; transition: transform .1s; }
.av-toggle:first-child { margin-left: 0; }
.av-toggle:hover { transform: translateY(-2px); z-index: 1; }
.av-toggle.on .avatar { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--pink); }

/* Тумблеры быстрых фильтров — маленькая «кабина» */
.toggle-panel { display: flex; flex-wrap: wrap; gap: 6px; }
.tswitch {
  display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 11px 0 9px; border-radius: 14px;
  border: 1.5px solid var(--line-2); background: var(--surface); color: var(--ink-2); font-weight: 700; font-size: 12.5px;
}
.tswitch:hover { border-color: var(--ink-3); color: var(--ink); }
.tswitch-led { width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); box-shadow: inset 0 1px 1px rgba(0, 0, 0, .2); transition: background .15s, box-shadow .15s; }
.tswitch.on { border-color: var(--pink); color: var(--pink-ink); background: var(--pink-soft-2); }
.tswitch.on .tswitch-led { background: var(--pink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pink) 25%, transparent), 0 0 8px var(--pink); }

.board-scroll { flex: 1; overflow: auto; padding: 0 28px 24px 0; min-height: 0; }
.board { --cols: 3; display: flex; flex-direction: column; gap: 6px; min-width: calc(var(--cols) * 250px); }
.board-head, .lane-cols { display: grid; grid-template-columns: repeat(var(--cols), minmax(250px, 1fr)); gap: 10px; }
.board-head { position: sticky; top: 0; z-index: 2; background: var(--bg); padding-bottom: 2px; }
.col-head {
  display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px;
  background: var(--surface-3); border-radius: var(--r-md) var(--r-md) 0 0;
  font-size: 12.5px; font-weight: 800; color: var(--ink-2);
}
.col-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.col-count { font-weight: 800; color: var(--ink-3); }
.col-head .wip { margin-left: auto; font-size: 11px; font-weight: 800; color: var(--ink-3); background: var(--surface); padding: 1px 7px; border-radius: 8px; }
.col-head.over { background: var(--danger-bg); color: var(--danger); }
.col-head.over .wip { background: var(--danger); color: #fff; }
.col-done { margin-left: auto; color: var(--done); }
.col-head .wip + .col-done { margin-left: 0; }
.col-body { display: flex; flex-direction: column; gap: 8px; min-height: 120px; padding: 8px; background: var(--surface-3); border-radius: 0 0 var(--r-md) var(--r-md); transition: background .12s, box-shadow .12s; }
.lane + .lane .col-body, .lane-head + .lane-cols .col-body { border-radius: var(--r-md); }
.col-body.drop-on { background: var(--pink-soft); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--pink) 40%, transparent); }
.board.is-dragging .col-body { background: color-mix(in srgb, var(--surface-3) 70%, var(--pink-soft)); }
.board.is-dragging .quick-create { opacity: .3; }
.drop-ph { height: 64px; border-radius: var(--r-sm); border: 2px dashed var(--pink); background: color-mix(in srgb, var(--pink) 6%, transparent); flex: none; }
.lane-head { display: flex; align-items: center; gap: 8px; width: 100%; height: 38px; margin-top: 10px; padding: 0 6px; background: none; border: 0; border-bottom: 1px solid var(--line); text-align: left; color: var(--ink); }
.lane-head strong { font-weight: 800; }
.lane-head + .lane-cols { margin-top: 8px; }
.board-empty { padding: 20px 0; }

.bcard {
  position: relative; display: flex; flex-direction: column; gap: 8px; padding: 10px 12px 9px;
  background: var(--surface); border-radius: var(--r-sm); box-shadow: var(--shadow-1), 0 0 0 1px var(--line);
  cursor: grab; transition: box-shadow .12s, background .12s;
}
.bcard:hover { background: var(--surface-2); box-shadow: var(--shadow-2), 0 0 0 1px var(--line-2); }
.bcard:focus-visible { outline: 2px solid var(--pink); outline-offset: 1px; }
.bcard.dragging { opacity: .35; }
.bcard.flagged { background: color-mix(in srgb, var(--warn-bg) 80%, var(--surface)); box-shadow: var(--shadow-1), inset 3px 0 0 var(--warn); }
.bcard.is-done .bcard-title { color: var(--ink-2); }
.bcard-title { font-weight: 600; font-size: 14px; line-height: 1.35; word-break: break-word; padding-right: 10px; }
.bcard.compact { gap: 5px; padding: 7px 10px; }
.bcard.compact .bcard-title { font-size: 13px; }
.bcard-foot { display: flex; align-items: center; gap: 6px; }
.flag-corner { position: absolute; top: 8px; right: 8px; color: var(--warn); }
.flag-corner .i { width: 14px; height: 14px; fill: currentColor; }
.kid-count { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 800; color: var(--ink-3); }
.kid-count .i { width: 13px; height: 13px; }
.bcard-more { display: grid; place-items: center; width: 22px; height: 22px; border: 0; border-radius: 4px; background: none; color: var(--ink-3); opacity: 0; }
.bcard:hover .bcard-more, .irow:hover .bcard-more, .bcard-more:focus { opacity: 1; }
.bcard-more:hover { background: var(--surface-3); color: var(--ink); }
.quick-create { margin-top: auto; display: flex; flex-direction: column; gap: 6px; }
.qc-btn { display: flex; align-items: center; gap: 6px; width: 100%; height: 32px; padding: 0 8px; border: 0; background: none; border-radius: var(--r-sm); color: var(--ink-3); font-weight: 700; }
.qc-btn:hover { background: var(--hover); color: var(--ink); }
.burst { position: fixed; z-index: 500; pointer-events: none; }
.burst span { position: absolute; width: 7px; height: 7px; border-radius: 2px; background: var(--pink); animation: burst .8s ease-out forwards; transform: rotate(var(--a)); }
.burst span:nth-child(3n) { background: var(--pink-2); }
.burst span:nth-child(4n) { background: #FFC940; }
@keyframes burst { to { transform: rotate(var(--a)) translateY(-54px) scale(.3); opacity: 0; } }

.sprint-meta { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 6px; font-size: 13px; color: var(--ink-2); }
.sprint-meta > span { display: inline-flex; align-items: center; gap: 6px; }
.days-left { font-weight: 700; }
.days-left.soon { color: var(--warn); }
.days-left.late { color: var(--danger); }
.complete-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.complete-stats > div { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px; display: flex; flex-direction: column; }
.complete-stats strong { font-size: 28px; font-weight: 900; }

/* ---------- Строки задач (бэклог, списки) ---------- */
.irow {
  display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 4px 10px;
  background: var(--surface); border-bottom: 1px solid var(--line); cursor: pointer;
}
.irow:hover { background: var(--surface-2); }
.irow.sel { background: var(--pink-soft); }
.irow.flagged { box-shadow: inset 3px 0 0 var(--warn); }
.irow.dragging { opacity: .4; }
.irow-title { flex: 1; min-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.irow-meta { display: flex; align-items: center; gap: 8px; flex: none; }
.grip { color: var(--ink-3); cursor: grab; opacity: .5; display: grid; }
.irow:hover .grip { opacity: 1; }
.flag-mini { color: var(--warn); display: grid; }
.flag-mini .i, .flag-pill .i { fill: currentColor; width: 14px; height: 14px; }
.flag-pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 800; color: var(--warn); background: var(--warn-bg); padding: 2px 8px; border-radius: 10px; }

/* ---------- Задача ---------- */
.issue-modal { max-height: 90vh; height: 90vh; }
.issue-modal .modal-body { padding: 0; height: 100%; display: flex; }
.issue-modal-body { flex: 1; display: flex; min-height: 0; }
.issue-view { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.iv-head { display: flex; align-items: center; gap: 6px; padding: 12px 16px 8px 24px; }
.iv-head .crumbs { margin: 0; }
.iv-cols { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 360px; min-height: 0; }
.iv-main { overflow: auto; padding: 4px 24px 32px; transition: box-shadow .12s; }
.iv-main.drop-hover { box-shadow: inset 0 0 0 3px var(--pink); }
.iv-side { overflow: auto; padding: 8px 20px 24px; border-left: 1px solid var(--line); background: var(--surface); }
.iv-page .iv-side { background: transparent; }
.page-issue { max-width: 1400px; }
.page-issue .issue-view { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); min-height: calc(100vh - 120px); }
.iv-title h1 { font-size: 24px; font-weight: 900; letter-spacing: -.01em; line-height: 1.25; }
.inline-edit { border-radius: var(--r-sm); padding: 4px 6px; margin: 0 -6px; }
.inline-edit.can:not(.editing):hover { background: var(--hover); cursor: text; }
.inline-edit.editing { display: flex; flex-direction: column; gap: 6px; }
.ie-actions { display: flex; gap: 4px; justify-content: flex-end; }
.ie-actions .btn { height: 28px; width: 28px; }
.iv-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 8px; }
.iv-sec { margin-top: 22px; }
.iv-sec-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.iv-sec-head h2 { font-size: 14.5px; font-weight: 800; }
.desc-view { border-radius: var(--r-sm); padding: 6px 8px; margin: 0 -8px; min-height: 40px; }
.desc-view.can:hover { background: var(--hover); cursor: text; }
.iv-desc .editor + .row { margin-top: 8px; }
.child-progress { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.child-progress .pbar { flex: 1; }
.child-list { border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.child-list:empty { display: none; }
.child-list > p { padding: 10px 12px; margin: 0; }
.child-row { display: flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 10px; border-bottom: 1px solid var(--line); }
.child-row:last-child { border-bottom: 0; }
.child-row:hover { background: var(--surface-2); }
.child-title { flex: 1; color: var(--ink); font-weight: 600; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.child-title.done { color: var(--ink-3); text-decoration: line-through; }
.quick-child { margin-top: 8px; }
.links .child-row { border: 1px solid var(--line); border-radius: var(--r-sm); margin-bottom: 4px; }
.link-group { font-size: 12.5px; font-weight: 800; color: var(--ink-3); margin: 8px 0 4px; }
.att-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.att { position: relative; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; background: var(--surface); }
.att-thumb { display: grid; place-items: center; height: 96px; background: var(--surface-3); }
.att-thumb img { width: 100%; height: 100%; object-fit: cover; }
.att-file { display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--ink-3); font-weight: 900; font-size: 11px; }
.att-file .i { width: 28px; height: 28px; }
.att-meta { padding: 6px 8px; display: flex; flex-direction: column; }
.att-name { font-size: 12.5px; font-weight: 700; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-del { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border-radius: 6px; border: 0; background: var(--surface); color: var(--danger); display: grid; place-items: center; opacity: 0; box-shadow: var(--shadow-1); }
.att:hover .att-del, .att-del:focus { opacity: 1; }
.att-drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 140px; border: 2px dashed var(--line-2); border-radius: var(--r-md); background: none; color: var(--ink-3); font-weight: 700; font-size: 12.5px; padding: 10px; }
.att-drop:hover { border-color: var(--pink); color: var(--pink-ink); }
.activity { display: flex; flex-direction: column; gap: 14px; }
.composer { display: flex; gap: 10px; align-items: flex-start; }
.composer-fake { flex: 1; text-align: left; height: 40px; padding: 0 12px; border: 1.5px solid var(--line-2); border-radius: var(--r-sm); background: var(--surface); color: var(--ink-3); }
.composer-fake:hover { border-color: var(--ink-3); }
.composer .row { margin-top: 8px; }
.comment { display: flex; gap: 10px; }
.cm-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 2px; }
.cm-body { font-size: 14px; }
.cm-actions { display: flex; gap: 12px; margin-top: 4px; }
.hist { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; }
.hist-change { display: flex; align-items: center; gap: 8px; margin-top: 4px; font-size: 12.5px; flex-wrap: wrap; }
.hist-old { text-decoration: line-through; color: var(--ink-3); background: var(--surface-3); padding: 1px 6px; border-radius: 4px; }
.hist-new { font-weight: 700; background: var(--pink-soft-2); padding: 1px 6px; border-radius: 4px; }
.status-btn { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px; border-radius: var(--r-sm); border: 0; font-weight: 800; background: var(--todo-bg); color: var(--todo); }
.status-btn.sb-in_progress { background: var(--prog); color: #fff; }
.status-btn.sb-done { background: var(--done); color: #fff; }
.status-btn:hover:not(:disabled) { filter: brightness(1.06); }
.resolution { display: inline-flex; align-items: center; gap: 4px; color: var(--done); font-weight: 700; font-size: 13px; }
.details-box { margin-top: 16px; border: 1px solid var(--line); border-radius: var(--r-md); }
.details-box > summary { padding: 12px 14px; font-weight: 800; cursor: pointer; list-style: none; border-bottom: 1px solid var(--line); }
.details-box > summary::-webkit-details-marker { display: none; }
.details { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 2px 8px; padding: 10px 8px; align-items: start; }
.dl { font-size: 12.5px; font-weight: 700; color: var(--ink-3); padding: 7px 6px; }
.dv { padding: 5px 6px; border-radius: var(--r-sm); min-height: 32px; display: flex; align-items: center; font-size: 13.5px; }
.dv > div { min-width: 0; }
.dv.editable { cursor: pointer; }
.dv.editable:hover { background: var(--hover); }
.iv-dates { margin-top: 14px; display: flex; flex-direction: column; gap: 2px; padding: 0 4px; }
.tt { width: 100%; }
.tt-bar { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.tt-bar span { display: block; height: 100%; background: var(--prog); }
.tt-legend { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-2); margin-top: 3px; }

/* Разметка текста */
.md { overflow-wrap: anywhere; }
.md > :last-child { margin-bottom: 0; }
.md h2, .md h3, .md h4 { margin: .8em 0 .4em; font-weight: 800; }
.md h2 { font-size: 18px; } .md h3 { font-size: 16px; } .md h4 { font-size: 14.5px; }
.md ul, .md ol { margin: 0 0 .6em; padding-left: 22px; }
.md li.task-li { list-style: none; margin-left: -20px; display: flex; gap: 6px; align-items: baseline; }
.md blockquote { margin: 0 0 .6em; padding: 4px 12px; border-left: 3px solid var(--pink-2); color: var(--ink-2); background: var(--surface-2); border-radius: 0 6px 6px 0; }
.md pre { background: var(--surface-3); padding: 10px 12px; border-radius: 8px; overflow: auto; }
.md pre code { background: none; padding: 0; }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 1em 0; }
.mention { display: inline-block; padding: 0 5px; border-radius: 10px; background: var(--pink-soft); color: var(--pink-ink); font-weight: 700; }
.issue-ref { font-weight: 800; }

/* Редактор */
.editor { border: 1.5px solid var(--line-2); border-radius: var(--r-sm); background: var(--surface); position: relative; }
.editor:focus-within { border-color: var(--pink); box-shadow: 0 0 0 3px var(--pink-soft); }
.editor-bar { display: flex; align-items: center; gap: 1px; padding: 4px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tool { width: 28px; height: 28px; display: grid; place-items: center; border: 0; background: none; border-radius: 4px; color: var(--ink-2); }
.tool:hover { background: var(--hover); color: var(--ink); }
.tool .i { width: 15px; height: 15px; }
.tool-text { width: auto; padding: 0 8px; font-size: 12.5px; font-weight: 700; }
.tool-text.on { color: var(--pink-ink); background: var(--pink-soft); }
.tool-sep { width: 1px; height: 18px; background: var(--line); margin: 0 4px; }
.editor-ta { border: 0 !important; box-shadow: none !important; border-radius: 0 0 var(--r-sm) var(--r-sm); min-height: 90px; }
.editor-preview { padding: 10px 12px; min-height: 90px; }
.mention-pop { position: absolute; left: 12px; bottom: -4px; transform: translateY(100%); z-index: 50; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-2); padding: 4px; min-width: 220px; }

/* ---------- Адаптив ---------- */
@media (max-width: 1100px) {
  .iv-cols { grid-template-columns: 1fr; overflow: auto; }
  .iv-main, .iv-side { overflow: visible; }
  .iv-side { border-left: 0; border-top: 1px solid var(--line); }
  .top-search { width: 40px; padding: 0; justify-content: center; }
  .top-search span, .top-search .kbds { display: none; }
}
@media (max-width: 820px) {
  .topnav-links { display: none; }
  .sidebar { width: 60px; padding-left: 8px; padding-right: 8px; }
  .sidebar .side-proj-text, .sidebar .side-link span, .sidebar .side-group { display: none; }
  .sidebar .side-link { justify-content: center; padding: 0; }
  .page { padding: 16px; }
  .form-grid-2 { grid-template-columns: 1fr; }
  .create-btn span { display: none; }
  .sc-grid { grid-template-columns: 1fr; }
  .brand span { display: none; }
}

/* ---------- Вход ---------- */
.login-body { display: grid; place-items: center; min-height: 100vh; padding: 16px;
  background: radial-gradient(1200px 600px at 20% -10%, var(--pink-soft), transparent 60%), var(--bg); }
.login-card { width: 100%; max-width: 380px; text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 36px 28px 30px; box-shadow: var(--shadow-2); }
.login-card .logo-mark { width: 64px; height: 46px; margin-bottom: 14px; }
.login-card h1 { font-size: 24px; font-weight: 900; margin-bottom: 6px; }
.login-providers { display: flex; flex-direction: column; gap: 10px; margin-top: 22px; align-items: center; }
.login-btn { width: 100%; height: 42px; font-size: 15px; }
.login-error { color: var(--danger); background: var(--danger-bg); border-radius: 8px; padding: 8px 12px; margin-top: 12px; font-weight: 700; }

/* ---------- Бэклог ---------- */
.backlog-tb { margin-bottom: 14px; }
.seg { display: inline-flex; background: var(--surface-3); border-radius: var(--r-sm); padding: 2px; }
.seg-btn { border: 0; background: none; height: 28px; padding: 0 10px; border-radius: 5px; font-weight: 700; font-size: 13px; color: var(--ink-2); }
.seg-btn.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.backlog-layout { display: flex; gap: 16px; align-items: flex-start; }
.backlog-main { flex: 1; min-width: 0; }
.backlog-list { display: flex; flex-direction: column; gap: 14px; }
.epics-panel { width: 250px; flex: none; position: sticky; top: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px; display: flex; flex-direction: column; gap: 4px; max-height: calc(100vh - 140px); overflow: auto; }
.epics-panel[hidden] { display: none; }
.ep-head { display: flex; align-items: center; padding: 2px 4px 6px; }
.ep-head h2 { font-size: 14.5px; font-weight: 800; }
.ep-empty { padding: 4px 6px; }
.ep-item { position: relative; display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; padding: 8px 8px 8px 10px; border: 1px solid transparent; border-radius: var(--r-sm); background: none; }
.ep-item:hover { background: var(--hover); }
.ep-item.on { background: var(--pink-soft-2); border-color: color-mix(in srgb, var(--pink) 30%, transparent); }
.ep-item.drop-on { border-color: var(--pink); background: var(--pink-soft); }
.ep-bar { width: 4px; align-self: stretch; border-radius: 2px; background: var(--ec, var(--t-epic)); flex: none; }
.ep-text { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ep-text strong { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ep-open { opacity: 0; color: var(--ink-3); display: grid; }
.ep-item:hover .ep-open { opacity: 1; }
.sprint-box { background: var(--surface-3); border-radius: var(--r-md); padding: 4px; }
.sprint-box.active { background: color-mix(in srgb, var(--prog-bg) 60%, var(--surface-3)); }
.sb-head { display: flex; align-items: center; gap: 10px; padding: 6px 8px; flex-wrap: wrap; }
.sb-toggle { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 4px 2px; font-size: 14.5px; color: var(--ink); }
.sb-goal { display: flex; align-items: center; gap: 6px; padding: 0 12px 8px 36px; color: var(--ink-2); font-size: 13px; }
.pts-trio { display: inline-flex; gap: 3px; }
.pt { min-width: 24px; height: 20px; padding: 0 6px; border-radius: 10px; font-size: 11.5px; font-weight: 800; display: inline-grid; place-items: center; }
.pt.todo { background: var(--todo-bg); color: var(--todo); }
.pt.prog { background: var(--prog-bg); color: var(--prog); }
.pt.done { background: var(--done-bg); color: var(--done); }
.drop-list { background: var(--surface); border-radius: var(--r-sm); min-height: 44px; overflow: hidden; border: 1px solid var(--line); transition: box-shadow .12s; }
.drop-list.drop-on { box-shadow: 0 0 0 2px var(--pink); }
.drop-list .irow:last-child { border-bottom: 0; }
.drop-empty { padding: 14px; text-align: center; color: var(--ink-3); font-size: 13px; border: 2px dashed var(--line-2); border-radius: var(--r-sm); margin: 6px; }
.drop-ph.thin { height: 4px; border: 0; background: var(--pink); border-radius: 2px; margin: 0 8px; }
.row-cb { width: 16px; height: 16px; accent-color: var(--pink); flex: none; margin: 0; opacity: .35; }
.irow:hover .row-cb, .row-cb:checked, .row-cb:focus { opacity: 1; }
.qc-row { display: flex; gap: 6px; padding: 6px 4px 2px; }
.qc-type { width: 110px; flex: none; }
.drag-ghost { position: absolute; top: -100px; padding: 6px 12px; background: var(--pink); color: #fff; border-radius: 8px; font-weight: 800; }
.bulk-bar { position: sticky; bottom: 16px; z-index: 30; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 16px; padding: 10px 14px; background: var(--ink); color: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-3); animation: rise .15s; }
.bulk-bar[hidden] { display: none; }
.bulk-bar .btn { background: color-mix(in srgb, var(--surface) 14%, transparent); color: var(--surface); }
.bulk-bar .btn:hover { background: color-mix(in srgb, var(--surface) 24%, transparent); }
.bulk-bar .btn-danger { background: var(--danger); }
@media (max-width: 1000px) { .epics-panel { display: none; } }

/* Палитра графиков (проверена валидатором: CVD и контраст, светлая и тёмная) */
:root { --c1: #E0147F; --c2: #5B3FD0; --c3: #0B8A6B; --c4: #C77700; --c-neutral: #9A90A3; --seq-0: #F6EEF4; --seq-1: #FFC7E3; --seq-2: #FF8CC6; --seq-3: #F0439B; --seq-4: #B10A62; }
:root[data-theme="dark"] { --c1: #F04A9E; --c2: #9179F0; --c3: #23A886; --c4: #B87E1E; --c-neutral: #6F657B; --seq-0: #2A2233; --seq-1: #4F2240; --seq-2: #86285F; --seq-3: #C7347F; --seq-4: #FF7DBE; }

/* ---------- Графики ---------- */
.chart { position: relative; }
.chart-plot { position: relative; width: 100%; }
.chart svg { display: block; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { stroke: var(--line-2); stroke-width: 1; }
.chart .tick { fill: var(--ink-3); font-size: 11px; font-weight: 600; }
.chart .direct { fill: var(--ink); font-size: 12px; font-weight: 800; }
.chart .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .dot { stroke: var(--surface); stroke-width: 2; }
.chart .cross { stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .bar { transition: opacity .1s; }
.chart .bar.hl { opacity: .8; }
.chart-tip { position: absolute; z-index: 5; pointer-events: none; min-width: 140px; padding: 8px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); box-shadow: var(--shadow-2); font-size: 12.5px; }
.chart-tip strong { display: block; margin-bottom: 4px; }
.tip-row { display: flex; align-items: center; gap: 6px; }
.tip-row b { margin-left: auto; padding-left: 10px; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; font-size: 12.5px; color: var(--ink-2); }
.chart-legend.col { flex-direction: column; gap: 6px; margin: 0; }
.chart-legend.col .lg-item b { margin-left: auto; padding-left: 16px; color: var(--ink); }
.lg-item { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.lg-swatch { width: 12px; height: 12px; border-radius: 3px; background: var(--sc); flex: none; }
.lg-swatch.dashed { height: 0; border-top: 2px dashed var(--sc); background: none; border-radius: 0; }
.hbars { display: flex; flex-direction: column; gap: 6px; }
.hbar { display: grid; grid-template-columns: minmax(90px, 160px) 1fr auto; align-items: center; gap: 10px; border: 0; background: none; padding: 3px 4px; border-radius: 6px; text-align: left; font-size: 13px; }
button.hbar:hover { background: var(--hover); }
.hbar-label { display: flex; align-items: center; gap: 6px; min-width: 0; font-weight: 600; }
.hbar-label > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { height: 10px; border-radius: 5px; background: var(--surface-3); overflow: hidden; }
.hbar-fill { display: block; height: 100%; border-radius: 0 5px 5px 0; min-width: 2px; }
.hbar-val { font-weight: 800; font-size: 12.5px; white-space: nowrap; }
.donut-wrap { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.donut-track { fill: none; stroke: var(--surface-3); stroke-width: 18; }
.donut-num { fill: var(--ink); font-size: 26px; font-weight: 900; }
.donut-sub { fill: var(--ink-3); font-size: 11px; font-weight: 700; }
.heat .tick { fill: var(--ink-3); font-size: 10px; font-weight: 700; }
.heat-legend { display: flex; align-items: center; gap: 3px; margin-top: 6px; }
.heat-sw { width: 11px; height: 11px; border-radius: 2px; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-size: 12px; font-weight: 800; color: var(--ink-3); padding: 8px 10px; border-bottom: 2px solid var(--line); white-space: nowrap; }
.table td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table.compact td, .table.compact th { padding: 5px 8px; }
.table tr:hover td { background: var(--surface-2); }
.table .num { text-align: right; font-weight: 700; }

/* ---------- Отчёты ---------- */
.report-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.report-card { display: flex; flex-direction: column; gap: 6px; padding: 18px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); color: var(--ink); transition: border-color .12s, box-shadow .12s; }
.report-card:hover { text-decoration: none; border-color: var(--pink); box-shadow: var(--shadow-2); }
.report-card strong { font-size: 15.5px; font-weight: 800; }
.rc-ico { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; background: var(--pink-soft); color: var(--pink-ink); margin-bottom: 6px; }
.rc-ico .i { width: 22px; height: 22px; }
.report-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 20px; align-items: start; }
.report-nav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; }
.report-nav a { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: var(--r-sm); color: var(--ink-2); font-weight: 700; }
.report-nav a:hover { background: var(--hover); text-decoration: none; }
.report-nav a.on { background: var(--pink-soft); color: var(--pink-ink); }
.report-body { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.report-controls { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.report-controls .input { width: auto; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 14px; }
.kpi-val { font-size: 26px; font-weight: 900; letter-spacing: -.02em; }
.kpi-label { color: var(--ink-3); font-size: 12.5px; font-weight: 700; }
.kpi.good .kpi-val { color: var(--done); }
.kpi.warn .kpi-val { color: var(--warn); }
.breakdown { display: flex; flex-direction: column; gap: 18px; }
.table-scroll { overflow-x: auto; }
.matrix .heat-cell { text-align: center; font-weight: 800; }
@media (max-width: 900px) { .report-layout { grid-template-columns: 1fr; } .report-nav { flex-direction: row; overflow-x: auto; position: static; } }

/* ---------- Сводка ---------- */
.proj-title { display: flex; align-items: center; gap: 14px; }
.proj-desc { max-width: 72ch; color: var(--ink-2); margin: -4px 0 16px; }
.btn.starred .i { fill: #FFC940; stroke: #D69E00; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin-bottom: 16px; }
.tile { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); color: var(--ink); }
.tile:hover { text-decoration: none; border-color: var(--line-2); box-shadow: var(--shadow-1); }
.tile-top { display: flex; align-items: center; gap: 10px; }
.tile-ico { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-3); color: var(--ink-2); flex: none; }
.tile-num { font-size: 24px; font-weight: 900; line-height: 1.1; }
.tile-label { font-size: 12.5px; color: var(--ink-3); font-weight: 700; }
.tile.good .tile-ico { background: var(--done-bg); color: var(--done); }
.tile.warn .tile-ico { background: var(--warn-bg); color: var(--warn); }
.tile.bad .tile-ico { background: var(--danger-bg); color: var(--danger); }
.tile.bad .tile-num { color: var(--danger); }
.summary-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 14px; align-items: start; }
.summary-left { columns: 2; column-gap: 14px; }
.summary-left > .panel { break-inside: avoid; margin-bottom: 14px; }
.summary-left > .panel.span-all { column-span: all; }
.sprint-card { display: flex; flex-direction: column; gap: 10px; }
.epic-progress { display: flex; flex-direction: column; gap: 4px; }
.ep-row { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: var(--r-sm); color: var(--ink); }
.ep-row:hover { background: var(--hover); text-decoration: none; }
.feed { display: flex; flex-direction: column; gap: 14px; }
.feed-item { display: flex; gap: 10px; font-size: 13.5px; }
.feed-body { min-width: 0; overflow-wrap: anywhere; }
.feed-meta { display: flex; gap: 10px; align-items: center; margin-top: 2px; }
.feed-issue { display: inline-flex; align-items: center; gap: 4px; font-weight: 800; color: var(--ink-2); }
a.hbar { color: var(--ink); }
a.hbar:hover { background: var(--hover); text-decoration: none; }
@media (max-width: 1200px) { .summary-grid { grid-template-columns: 1fr; } }
@media (max-width: 800px) { .summary-left { columns: 1; } }

/* ---------- Проекты ---------- */
.proj-table td { vertical-align: middle; }
.proj-table tr.archived { opacity: .55; }
.proj-link { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.proj-link:hover { text-decoration: none; }
.proj-link:hover strong { color: var(--pink-ink); }
.star-cell { width: 36px; }
.star-btn { border: 0; background: none; color: var(--ink-3); display: grid; padding: 4px; border-radius: 6px; }
.star-btn:hover { background: var(--hover); }
.star-btn.on .i { fill: #FFC940; stroke: #D69E00; }
.proj-preview { display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.tpl { display: flex; flex-direction: column; gap: 4px; text-align: left; padding: 12px; border: 1.5px solid var(--line-2); border-radius: var(--r-md); background: var(--surface); }
.tpl:hover { border-color: var(--ink-3); }
.tpl.on { border-color: var(--pink); background: var(--pink-soft-2); box-shadow: 0 0 0 3px var(--pink-soft); }
.tpl-ico { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--pink-soft); color: var(--pink-ink); margin-bottom: 4px; }
.tpl-flow { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 6px; }
.tpl-flow .lozenge { font-size: 10px; }
.icon-pick { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ip { width: 34px; height: 34px; border-radius: 8px; border: 1.5px solid var(--line-2); background: var(--surface); display: grid; place-items: center; color: var(--ink-2); }
.ip.on { border-color: var(--pink); color: var(--pink-ink); background: var(--pink-soft-2); }
.swatch.on { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--ink); }

/* ---------- Моя работа ---------- */
.section-head { display: flex; align-items: center; gap: 8px; margin: 8px 0 10px; }
.section-head h2 { font-size: 16px; font-weight: 800; }
.proj-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-bottom: 26px; }
.proj-card { display: flex; flex-direction: column; gap: 12px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); border-top: 4px solid var(--pc, var(--pink)); }
.pc-top { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.pc-top:hover { text-decoration: none; }
.pc-top:hover strong { color: var(--pink-ink); }
.pc-links { display: flex; flex-direction: column; gap: 2px; }
.pc-links a { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 6px; color: var(--ink-2); font-size: 13px; font-weight: 700; }
.pc-links a:hover { background: var(--hover); text-decoration: none; color: var(--ink); }
.group-title { font-size: 13.5px; font-weight: 800; margin: 14px 0 6px; }
.list-box { border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; background: var(--surface); }
.list-box .irow:last-child { border-bottom: 0; }

/* ---------- Поиск задач ---------- */
.nav-bar { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.nav-row { display: flex; align-items: flex-start; gap: 8px; flex-wrap: wrap; }
.nav-row > .seg { flex: none; }
.filter-chip { display: inline-flex; align-items: center; gap: 4px; height: 30px; padding: 0 8px 0 11px; border-radius: var(--r-sm); border: 1.5px solid var(--line-2); background: var(--surface); font-weight: 700; font-size: 13px; color: var(--ink-2); }
.filter-chip:hover { border-color: var(--ink-3); }
.filter-chip.on { border-color: var(--pink); color: var(--pink-ink); background: var(--pink-soft-2); }
.filter-chip:disabled { opacity: .7; cursor: default; }
.jql-wrap { flex: 1; min-width: 300px; display: flex; flex-direction: column; gap: 6px; }
.jql-input { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: 13px; }
.jql-sugg { display: flex; flex-wrap: wrap; gap: 4px; min-height: 0; }
.jql-chip { border: 1px solid var(--line-2); background: var(--surface-2); border-radius: 12px; padding: 1px 9px; font-size: 12px; font-weight: 700; color: var(--ink-2); }
.jql-chip:hover { border-color: var(--pink); color: var(--pink-ink); }
.jql-preview { display: flex; align-items: center; gap: 8px; }
.jql-preview code { max-width: 70ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jql-error { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: var(--r-md); background: var(--danger-bg); color: var(--danger); margin-bottom: 12px; font-weight: 600; }
.jql-error[hidden] { display: none; }
.jql-pos { margin: 6px 0 0; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; color: var(--ink); background: var(--surface); padding: 6px 8px; border-radius: 6px; white-space: pre-wrap; }
.res-head { display: flex; align-items: baseline; gap: 10px; margin: 4px 0 8px; }
.nav-table th.sortable { cursor: pointer; user-select: none; }
.nav-table th.sortable:hover { color: var(--ink); }
.sort-ico { width: 13px; height: 13px; margin-left: 3px; }
.nav-table tbody tr { cursor: pointer; }
.nav-table tr.sel td { background: var(--pink-soft-2); }
.nav-table tr.flagged td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
.title-cell { display: flex; align-items: center; gap: 6px; min-width: 240px; }
.title-cell .irow-title { min-width: 0; }
.pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 12px; font-weight: 700; }
.jql-help code { white-space: nowrap; }

/* ---------- Дашборд ---------- */
.dash-grid { --dcols: 2; display: grid; grid-template-columns: repeat(var(--dcols), minmax(0, 1fr)); gap: 16px; align-items: start; }
.dash-col { display: flex; flex-direction: column; gap: 16px; min-height: 80px; }
.dash-grid.editing .dash-col { background: var(--surface-3); border-radius: var(--r-lg); padding: 8px; outline: 2px dashed var(--line-2); outline-offset: -2px; }
.dash-empty { grid-column: 1 / -1; }
.dash-drop-hint { display: flex; align-items: center; justify-content: center; gap: 6px; height: 44px; border: 2px dashed var(--line-2); border-radius: var(--r-md); background: none; color: var(--ink-3); font-weight: 700; }
.dash-drop-hint:hover { border-color: var(--pink); color: var(--pink-ink); }
.gadget { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); min-width: 0; }
.gadget.dragging { opacity: .4; }
.dash-grid.editing .gadget { cursor: grab; }
.gadget-ph { height: 90px; border: 2px dashed var(--pink); border-radius: var(--r-md); background: var(--pink-soft-2); }
.gadget-head { display: flex; align-items: center; gap: 8px; padding: 12px 12px 0 16px; }
.gadget-head h2 { font-size: 15px; font-weight: 800; }
.g-act { width: 28px; height: 28px; border: 0; background: none; border-radius: 6px; display: grid; place-items: center; color: var(--ink-3); opacity: .6; }
.gadget:hover .g-act, .g-act:focus { opacity: 1; }
.g-act:hover { background: var(--hover); color: var(--ink); }
.g-act.danger:hover { color: var(--danger); }
.gadget-body { padding: 12px 16px 16px; min-width: 0; }
.gadget-body > .spinner { margin: 20px auto; }
.g-more { display: inline-block; margin-top: 10px; font-weight: 700; font-size: 13px; }
.list-box.flat { border: 0; border-radius: 0; }
.list-box.flat .irow { padding-left: 0; padding-right: 0; }
.list-box.flat .irow-meta .epic-chip, .list-box.flat .irow-meta .label-chip { display: none; }
.g-sprint { display: flex; flex-direction: column; gap: 6px; color: var(--ink); padding: 8px; border-radius: var(--r-sm); }
.g-sprint:hover { background: var(--hover); text-decoration: none; }
.gadget-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
@media (max-width: 1000px) { .dash-grid { grid-template-columns: 1fr; } }

/* ---------- Приборная панель (кабина) ----------
   Единственное «громкое» место интерфейса: всегда тёмная панель
   с приборами, табло и тумблерами, в любой теме. */
.g-cockpit { background: #16171D; border-color: #2A2C36; color: #E9E6EF; overflow: hidden; }
.g-cockpit .gadget-head h2 { color: #F1EEF6; }
.g-cockpit .g-act { color: #9A97A6; }
.g-cockpit .g-act:hover { background: #262833; color: #fff; }
.cockpit {
  --ck-metal: #1D1F27; --ck-edge: #30323E; --ck-amber: #FFB547; --ck-green: #3DDC97; --ck-red: #FF4D6A; --ck-blue: #62B6FF;
  display: flex; flex-direction: column; gap: 14px;
  padding: 14px; border-radius: 12px;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .012) 0 2px, transparent 2px 4px),
    linear-gradient(180deg, #20222B, #17181E);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05), inset 0 0 0 1px #2A2C36;
}
.ck-row { display: grid; gap: 12px; }
.ck-gauges { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.instrument { display: flex; flex-direction: column; align-items: center; background: var(--ck-metal); border-radius: 12px; padding: 8px 6px 10px; box-shadow: inset 0 0 0 1px var(--ck-edge), inset 0 8px 18px rgba(0, 0, 0, .35); }
.gauge { width: 100%; max-width: 200px; }
.g-bezel { fill: #0E0F13; stroke: #3A3D4A; stroke-width: 3; }
.g-track { fill: none; stroke: #2B2D38; stroke-width: 8; stroke-linecap: round; }
.g-zone { fill: none; stroke-width: 8; }
.z-green { stroke: var(--ck-green); opacity: .8; }
.z-amber { stroke: var(--ck-amber); opacity: .85; }
.z-red { stroke: var(--ck-red); opacity: .85; }
.g-tick { stroke: #C9C6D3; stroke-width: 2; }
.g-num { fill: #9C99A8; font-size: 10px; font-weight: 800; }
.g-needle path { fill: #FF1C90; filter: drop-shadow(0 0 4px rgba(255, 28, 144, .7)); }
.g-needle { transition: transform 1.1s cubic-bezier(.2, 1.4, .4, 1); }
.g-hub { fill: #2F313C; stroke: #FF89E2; stroke-width: 2; }
.g-read { fill: #F4F1F8; font-size: 20px; font-weight: 900; }
.inst-label { font-size: 11.5px; font-weight: 700; color: #A9A6B6; text-align: center; margin-top: -4px; }
.ck-bottom { grid-template-columns: 1.3fr 1fr auto; align-items: stretch; }
.readouts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.readout { background: #0C0D10; border-radius: 8px; padding: 6px 8px; box-shadow: inset 0 0 0 1px #262833, inset 0 4px 10px rgba(0, 0, 0, .6); }
.ro-val { font-size: 22px; font-weight: 900; color: var(--ck-amber); letter-spacing: .08em; text-shadow: 0 0 8px rgba(255, 181, 71, .45); line-height: 1.1; }
.readout.green .ro-val { color: var(--ck-green); text-shadow: 0 0 8px rgba(61, 220, 151, .4); }
.readout.amber .ro-val { color: #FFD27A; }
.ro-label { font-size: 10.5px; font-weight: 700; color: #8E8B9B; }
.annunciators { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.ann {
  border: 0; border-radius: 6px; padding: 6px 4px; font-size: 10.5px; font-weight: 900; letter-spacing: .06em;
  background: #23252E; color: #585B69; box-shadow: inset 0 0 0 1px #30323E, inset 0 -2px 0 rgba(0, 0, 0, .4);
  transition: background .2s, color .2s, box-shadow .2s;
}
.ann:hover { filter: brightness(1.2); }
.ann.on.red { background: #4A1420; color: #FF8A9D; box-shadow: inset 0 0 0 1px #FF4D6A, 0 0 14px rgba(255, 77, 106, .35); }
.ann.on.amber { background: #43300E; color: #FFD27A; box-shadow: inset 0 0 0 1px #FFB547, 0 0 14px rgba(255, 181, 71, .3); }
.ann.on.green { background: #0F3A2A; color: #7DF0BF; box-shadow: inset 0 0 0 1px #3DDC97, 0 0 12px rgba(61, 220, 151, .25); }
.ann.on.blue { background: #102C45; color: #9DD3FF; box-shadow: inset 0 0 0 1px #62B6FF, 0 0 12px rgba(98, 182, 255, .25); }
.ck-controls { display: flex; flex-direction: column; gap: 8px; align-items: stretch; min-width: 118px; }
.master-caution {
  display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1;
  height: 52px; border: 0; border-radius: 8px; font-size: 11px; font-weight: 900; letter-spacing: .08em;
  background: #2A2310; color: #6D5F35; box-shadow: inset 0 0 0 2px #3C3420, inset 0 -3px 0 rgba(0, 0, 0, .5);
}
.master-caution.lit { background: #6B4A00; color: #FFE08A; box-shadow: inset 0 0 0 2px #FFB547, 0 0 20px rgba(255, 181, 71, .55); animation: caution 1.2s steps(2, jump-none) infinite; }
.master-caution:active { transform: translateY(1px); }
@keyframes caution { 50% { background: #3A2A06; box-shadow: inset 0 0 0 2px #8A6414; } }
.ck-toggle { display: flex; align-items: center; gap: 8px; border: 0; background: none; color: #C6C3D1; font-weight: 800; font-size: 12px; padding: 2px 0; }
.ck-lever { position: relative; width: 16px; height: 28px; border-radius: 8px; background: #0C0D10; box-shadow: inset 0 0 0 1px #3A3D4A; flex: none; }
.ck-lever::after { content: ''; position: absolute; left: 2px; top: 14px; width: 12px; height: 12px; border-radius: 50%; background: linear-gradient(180deg, #D8D5E0, #8E8B9B); transition: top .15s; box-shadow: 0 2px 3px rgba(0, 0, 0, .6); }
.ck-toggle.on .ck-lever::after { top: 2px; background: linear-gradient(180deg, #FF89E2, #FF1C90); box-shadow: 0 0 8px rgba(255, 28, 144, .7); }
.ck-btn { display: flex; align-items: center; justify-content: center; gap: 6px; height: 34px; border: 0; border-radius: 8px; background: #FF1C90; color: #fff; font-weight: 900; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .25); }
.ck-btn:hover { background: #F0007F; }
@media (max-width: 1300px) { .ck-bottom { grid-template-columns: 1fr 1fr; } .ck-controls { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; align-items: center; } .master-caution { width: 110px; } }
@media (max-width: 700px) { .ck-gauges { grid-template-columns: 1fr 1fr; } .ck-bottom { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .master-caution.lit { animation: none; } }

/* ---------- Фильтры, уведомления, аккаунт ---------- */
.jql-cell { display: inline-block; max-width: 520px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
.notif-page { padding: 6px; }
.account-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; align-items: start; max-width: 1100px; }
.big-name { font-size: 18px; font-weight: 900; }
.admin-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 800; color: var(--pink-ink); background: var(--pink-soft); padding: 2px 8px; border-radius: 10px; margin-top: 4px; }

/* ---------- Таймлайн ---------- */
.tl { --row: 40px; }
.tl-grid { display: grid; grid-template-columns: 320px minmax(0, 1fr); border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); overflow: hidden; }
.tl-names { border-right: 1px solid var(--line); background: var(--surface); }
.tl-names-head { height: 36px; display: flex; align-items: center; padding: 0 12px; font-size: 12px; font-weight: 800; color: var(--ink-3); border-bottom: 1px solid var(--line); }
.tl-markers-spacer { height: 30px; border-bottom: 1px solid var(--line); }
.tl-name { height: var(--row); display: flex; align-items: center; gap: 6px; padding: 0 10px; border-bottom: 1px solid var(--line); min-width: 0; }
.tl-name.lvl-1 { padding-left: 42px; background: var(--surface-2); }
.tl-exp { width: 22px; height: 22px; border: 0; background: none; border-radius: 4px; display: grid; place-items: center; color: var(--ink-3); flex: none; }
.tl-exp:hover:not(:disabled) { background: var(--hover); }
.tl-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); font-weight: 700; font-size: 13px; }
.tl-prog { width: 54px; flex: none; }
.tl-scroll { overflow-x: auto; overflow-y: hidden; }
.tl-canvas { position: relative; }
.tl-scale { position: relative; height: 36px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.tl-month { position: absolute; top: 0; height: 36px; padding: 0 8px; display: flex; align-items: center; border-left: 1px solid var(--line); font-size: 12px; font-weight: 800; color: var(--ink-2); white-space: nowrap; overflow: hidden; }
.tl-week { position: absolute; bottom: 2px; font-size: 10px; color: var(--ink-3); font-weight: 700; transform: translateX(-50%); }
.tl-markers { position: relative; height: 30px; border-bottom: 1px solid var(--line); }
.tl-sprint { position: absolute; top: 5px; height: 20px; border-radius: 4px; padding: 0 6px; font-size: 11px; font-weight: 800; line-height: 20px; overflow: hidden; white-space: nowrap; background: var(--prog-bg); color: var(--prog); }
.tl-sprint.closed { background: var(--surface-3); color: var(--ink-3); }
.tl-sprint.future { background: transparent; box-shadow: inset 0 0 0 1px var(--line-2); color: var(--ink-3); }
.tl-version { position: absolute; top: 4px; display: flex; align-items: center; gap: 3px; transform: translateX(-8px); font-size: 11px; font-weight: 800; color: var(--pink-ink); white-space: nowrap; }
.tl-version .i { width: 14px; height: 14px; }
.tl-version.released { color: var(--done); }
.tl-lane-bg { position: absolute; top: 66px; bottom: 0; left: 0; pointer-events: none; }
.tl-today { position: absolute; top: -66px; bottom: 0; width: 2px; background: var(--pink); z-index: 2; }
.tl-today::before { content: ''; position: absolute; top: 0; left: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--pink); }
.tl-weekend { position: absolute; top: 0; bottom: 0; background: var(--surface-2); }
.tl-bars { position: relative; }
.tl-row { position: relative; height: var(--row); border-bottom: 1px solid var(--line); }
.tl-bar { position: absolute; top: 8px; height: 24px; border-radius: 6px; background: color-mix(in srgb, var(--bc) 22%, var(--surface)); box-shadow: inset 0 0 0 1.5px var(--bc); display: flex; align-items: center; cursor: grab; user-select: none; touch-action: none; z-index: 1; }
.tl-bar.partial { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--bc) 18%, var(--surface)) 0 6px, var(--surface) 6px 12px); }
.tl-bar.done { opacity: .6; }
.tl-bar.dragging { cursor: grabbing; box-shadow: inset 0 0 0 2px var(--bc), var(--shadow-2); z-index: 3; }
.tl-bar-label { flex: 1; padding: 0 8px; font-size: 12px; font-weight: 800; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--ink); }
.tl-h { width: 8px; align-self: stretch; cursor: ew-resize; border-radius: 6px; }
.tl-h:hover { background: color-mix(in srgb, var(--bc) 50%, transparent); }
.tl-set { position: absolute; top: 8px; height: 24px; display: inline-flex; align-items: center; gap: 4px; border: 1px dashed var(--line-2); border-radius: 6px; background: var(--surface); color: var(--ink-3); font-size: 12px; font-weight: 700; padding: 0 8px; z-index: 1; }
.tl-set:hover { border-color: var(--pink); color: var(--pink-ink); }

/* ---------- Релизы ---------- */
.rel-list { display: flex; flex-direction: column; gap: 10px; }
.rel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); }
.rel-head { display: flex; align-items: center; gap: 12px; padding: 10px 12px; flex-wrap: wrap; }
.rel-ico { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; background: var(--pink-soft); color: var(--pink-ink); flex: none; }
.rel.released .rel-ico { background: var(--done-bg); color: var(--done); }
.rel-title { flex: 1; display: flex; flex-direction: column; min-width: 160px; }
.rel-title strong { font-size: 15px; font-weight: 800; }
.rel-prog { width: 180px; display: flex; align-items: center; gap: 8px; }
.rel-prog .pbar { flex: 1; }
.rel-date { width: 110px; text-align: right; }
.rel-issues { margin: 0 12px 12px; }
.lozenge.lz-late { background: var(--danger-bg); color: var(--danger); }

/* ---------- Страницы ---------- */
.pg-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 18px; align-items: start; }
.pg-tree { position: sticky; top: 0; display: flex; flex-direction: column; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px; max-height: calc(100vh - 150px); overflow: auto; }
.pg-tree-head { display: flex; align-items: center; padding: 0 4px; }
.pg-links { display: flex; flex-direction: column; gap: 1px; }
.pg-link { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: var(--r-sm); color: var(--ink-2); font-weight: 700; font-size: 13.5px; }
.pg-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pg-link:hover { background: var(--hover); text-decoration: none; color: var(--ink); }
.pg-link.on { background: var(--pink-soft); color: var(--pink-ink); }
.pg-tags { display: flex; flex-wrap: wrap; gap: 4px; padding-top: 6px; border-top: 1px solid var(--line); }
.pg-view { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 20px 32px 32px; min-height: 60vh; min-width: 0; }
.pg-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.pg-bar a { display: inline-flex; align-items: center; gap: 4px; }
.pg-title { font-size: 30px; font-weight: 900; letter-spacing: -.02em; margin-bottom: 10px; }
.pg-title-in { height: 50px; font-size: 26px; font-weight: 900; border-color: transparent; padding: 0 6px; margin-bottom: 10px; }
.pg-title-in:hover { border-color: var(--line-2); }
.pg-meta { margin-bottom: 10px; }
.pg-body { max-width: 76ch; font-size: 15px; line-height: 1.65; margin-top: 12px; }
.pg-children { margin-top: 28px; padding-top: 14px; border-top: 1px solid var(--line); }
.pg-children h2 { font-size: 14px; font-weight: 800; margin-bottom: 6px; }
@media (max-width: 900px) { .pg-layout { grid-template-columns: 1fr; } .pg-tree { position: static; max-height: none; } .pg-view { padding: 16px; } }

/* ---------- Настройки ---------- */
.settings-body { display: flex; flex-direction: column; gap: 16px; max-width: 980px; }
.settings-form { max-width: 620px; }
.notice { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: var(--r-md); background: var(--warn-bg); color: var(--warn); font-weight: 700; }
.danger-panel { border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); }
.danger-row { display: flex; align-items: center; gap: 16px; justify-content: space-between; padding: 6px 0; }
.roles-table .num { text-align: center; }
.ok-ico { color: var(--done); }
.wf-preview { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 10px; background: var(--surface-2); border-radius: var(--r-sm); }
.wf-preview .i { color: var(--ink-3); width: 14px; height: 14px; }
.wf-list { display: flex; flex-direction: column; gap: 6px; }
.wf-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); }
.wf-row.dragging { opacity: .4; }
.wf-row > .input { max-width: 260px; }
.wf-row select.input { max-width: 170px; }
.wf-wip { display: flex; align-items: center; gap: 6px; }
.wf-wip .input { width: 64px; }
.wf-count { margin-left: auto; white-space: nowrap; }
.lb-list { display: flex; flex-direction: column; gap: 6px; }
.lb-row { display: flex; align-items: center; gap: 10px; }
.lb-row .label-chip { min-width: 110px; }
.lb-row .input { max-width: 240px; }
@media (max-width: 820px) {
  .page-title-row { flex-wrap: wrap; }
  .page-title { font-size: 21px; }
  .tb-selects { flex-wrap: wrap; }
  .search-wrap { width: 100%; }
  .board-toolbar { margin-right: 16px; }
  .board-scroll { padding-right: 16px; }
  .iv-head { padding-left: 16px; }
  .iv-main { padding: 4px 16px 24px; }
  .irow-meta .epic-chip, .irow-meta .label-chip, .irow-meta .lozenge { display: none; }
  .modal-back { padding: 8px; }
  .issue-modal { height: 96vh; max-height: 96vh; }
}

/* =====================================================================
   Экраны: обзор, конструктор, данные
   ===================================================================== */
.col { display: flex; flex-direction: column; gap: 4px; }
.stack-sm { display: flex; flex-direction: column; gap: 6px; }
.table-wrap { overflow: auto; }
.nowrap { white-space: nowrap; }
.err { color: var(--danger); }
.mono { font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace; }
.btn.on { background: var(--pink-soft); color: var(--pink-ink); }
.sc-pal-item, .sc-seg-b, .sc-layer, .sc-device-empty, .sc-board.new, .sc-swatch, .sc-ord-n, .sc-day, .sc-chip { border: 0; background: transparent; }

.sc-body { margin-top: 16px; }
.sc-alert { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: var(--r-md); margin-bottom: 10px; font-weight: 600; }
.sc-alert .i { width: 22px; height: 22px; }
.sc-alert.lv-danger { background: var(--danger); color: #fff; }
.sc-alert.lv-warning { background: var(--warn-bg); color: var(--warn); }
.sc-alert.lv-info { background: var(--prog-bg); color: var(--prog); }
.sc-alert .btn { background: rgba(255, 255, 255, .85); color: #241B2D; }

.sc-howto { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.sc-step { display: flex; gap: 14px; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); }
.sc-step > b { width: 34px; height: 34px; flex: none; border-radius: 50%; background: var(--pink); color: #fff; display: grid; place-items: center; font-weight: 900; }
.sc-step > div { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.sc-step code { font-size: 13px; background: var(--surface-3); padding: 3px 8px; border-radius: 6px; overflow-wrap: anywhere; }

.sc-devices { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.sc-device { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.sc-device-top { display: flex; align-items: center; gap: 10px; }
.sc-led { width: 10px; height: 10px; border-radius: 50%; background: var(--line-2); flex: none; }
.sc-led.on { background: #22B573; box-shadow: 0 0 0 4px rgba(34, 181, 115, .18); }
.sc-led.bad { background: var(--danger); box-shadow: 0 0 0 4px var(--danger-bg); }
.sc-device-boards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.sc-mini { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 700; min-width: 0; }
.sc-mini > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-device-empty { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 90px; border: 1.5px dashed var(--line-2); border-radius: var(--r-md); color: var(--ink-3); font-weight: 700; }
.sc-device-empty:hover { border-color: var(--pink); color: var(--pink-ink); }
.sc-code-in { font-size: 28px; height: 56px; font-weight: 900; letter-spacing: .18em; text-align: center; text-transform: uppercase; }

.sc-thumb { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(36, 27, 45, .08); }
.sc-thumb.portrait { aspect-ratio: 9 / 16; width: auto; height: 100%; max-height: 100%; margin: 0 auto; }
.sc-thumb-w { position: absolute; border-radius: 3px; display: grid; place-items: center; overflow: hidden; }
.sc-thumb-w .i { width: 40%; height: 40%; max-width: 22px; max-height: 22px; min-width: 8px; min-height: 8px; opacity: .5; }
.sc-thumb-holder { aspect-ratio: 16 / 9; display: flex; align-items: center; justify-content: center; background: var(--surface-3); border-radius: 8px; overflow: hidden; }

.sc-pl { display: flex; flex-direction: column; gap: 8px; }
.sc-pl-row { display: flex; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-md); }
.sc-pl-main { flex: 1; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.sc-pl-main .input[type=number] { width: 76px; }
.sc-days { display: flex; flex-wrap: wrap; gap: 4px; }
.sc-day { min-width: 34px; height: 28px; padding: 0 8px; border-radius: 14px; border: 1px solid var(--line-2); font-size: 12px; font-weight: 800; color: var(--ink-3); background: var(--surface); }
.sc-day.on { background: var(--pink); border-color: var(--pink); color: #fff; }
.sc-day.wide { font-weight: 700; }

.sc-boards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.sc-board { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px; display: flex; flex-direction: column; gap: 10px; }
.sc-board:hover { border-color: var(--line-2); box-shadow: var(--shadow-2); }
.sc-board-link { display: block; }
.sc-board-meta { display: flex; align-items: flex-start; gap: 6px; }
.sc-board-meta a { color: inherit; }
.sc-board.new { align-items: center; justify-content: center; min-height: 210px; border-style: dashed; border-width: 1.5px; color: var(--ink-2); text-align: center; }
.sc-board.new:hover { border-color: var(--pink); }
.sc-new-ic { width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center; background: var(--pink-soft); color: var(--pink-ink); }
.sc-new-ic .i { width: 24px; height: 24px; }
.sc-tpls { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; max-height: 56vh; overflow: auto; padding: 2px; }
.sc-tpl-group { grid-column: 1 / -1; font-size: 12px; font-weight: 800; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; margin-top: 6px; }

.sc-ds { display: flex; flex-direction: column; }
.sc-ds-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; color: inherit; border-bottom: 1px solid var(--line); }
.sc-ds-row:last-child { border-bottom: 0; }
.sc-ds-row:hover { background: var(--hover); }
.sc-ds-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--pink-soft); color: var(--pink-ink); flex: none; }

.sc-rooms { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; }
.sc-bk { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.sc-bk:last-child { border-bottom: 0; }
.sc-bk b { font-variant-numeric: tabular-nums; min-width: 92px; }

.sc-mons { display: flex; flex-direction: column; }
.sc-mon { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.sc-mon:last-child { border-bottom: 0; }
.sc-mon-st { text-align: right; min-width: 150px; }

.sc-assets { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; max-height: 60vh; overflow: auto; }
.sc-assets.big { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); max-height: none; }
.sc-asset { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 6px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); text-align: left; font-size: 12px; font-weight: 700; min-width: 0; }
.sc-asset > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-asset img, .sc-asset video, .sc-asset-vid { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 6px; background: var(--surface-3); }
.sc-asset-vid { display: grid; place-items: center; color: var(--ink-3); }
.sc-asset .btn { position: absolute; top: 10px; right: 10px; background: var(--surface); }
button.sc-asset:hover { border-color: var(--pink); }

/* --- конструктор --- */
.page.sc-ed-page { max-width: none; height: 100%; display: flex; flex-direction: column; padding: 10px 14px 0; }
.sc-ed-top { display: flex; align-items: center; gap: 6px; padding-bottom: 10px; }
.sc-ed-title { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.sc-ed-name { font: inherit; font-size: 18px; font-weight: 900; border: 1px solid transparent; background: transparent; color: var(--ink); border-radius: 8px; padding: 4px 8px; min-width: 120px; width: 26ch; }
.sc-ed-name:hover:not(:disabled) { border-color: var(--line-2); }
.sc-ed-name:focus { outline: none; border-color: var(--pink); background: var(--surface); }
.sc-save.err { color: var(--danger); font-weight: 700; }
.sc-zoom { min-width: 40px; text-align: right; font-variant-numeric: tabular-nums; }
.sc-ed { flex: 1; min-height: 0; display: grid; grid-template-columns: 236px minmax(0, 1fr) 320px; gap: 12px; }
.sc-ed.ro { grid-template-columns: minmax(0, 1fr) 320px; }
.sc-pal, .sc-insp { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md) var(--r-md) 0 0; overflow: auto; min-height: 0; }
.sc-pal { padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.sc-pal-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px; }
.sc-pal-list { display: flex; flex-direction: column; gap: 2px; }
.sc-pal-group { font-size: 11px; font-weight: 800; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; padding: 10px 6px 4px; }
.sc-pal-item { display: flex; align-items: center; gap: 8px; padding: 6px; border-radius: 8px; text-align: left; font-weight: 700; font-size: 13px; cursor: grab; touch-action: none; user-select: none; }
.sc-pal-item:hover { background: var(--hover); }
.sc-pal-ic { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--pink-soft); color: var(--pink-ink); flex: none; }
.sc-ed-center { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.sc-stage-wrap { position: relative; flex: 1; min-height: 0; overflow: hidden; border-radius: var(--r-md); background: var(--surface-3); background-image: radial-gradient(var(--line-2) 1px, transparent 1px); background-size: 16px 16px; }
.sc-canvas { position: absolute; left: 0; top: 0; transform-origin: 0 0; overflow: hidden; background-size: cover; background-position: center; box-shadow: 0 10px 40px rgba(36, 27, 45, .25); }
.sc-slot { position: absolute; }
.sc-gridlines { position: absolute; inset: 0; pointer-events: none; }
.sc-cell { position: absolute; border-radius: 14px; outline: 3px dashed rgba(255, 28, 144, .28); outline-offset: -3px; }
.sc-ov { position: absolute; z-index: 2; touch-action: none; outline: none; cursor: crosshair; }
.sc-ed.ro .sc-ov { cursor: default; }
.sc-box { position: absolute; border-radius: 6px; cursor: move; }
.sc-ed.ro .sc-box { cursor: pointer; }
.sc-box:hover { box-shadow: inset 0 0 0 2px rgba(255, 28, 144, .55); }
.sc-box.on { box-shadow: inset 0 0 0 2px var(--pink), 0 0 0 1px rgba(255, 255, 255, .7); }
.sc-box.bad { box-shadow: inset 0 0 0 2px var(--danger); }
.sc-box-tag { position: absolute; left: 4px; top: 4px; display: none; align-items: center; gap: 4px; padding: 2px 7px 2px 5px; border-radius: 6px; background: var(--pink); color: #fff; font-size: 11px; font-weight: 800; white-space: nowrap; pointer-events: none; max-width: calc(100% - 8px); overflow: hidden; }
.sc-box-tag .i { width: 12px; height: 12px; }
.sc-box-tag em { font-style: normal; opacity: .8; }
.sc-box:hover .sc-box-tag, .sc-box.on .sc-box-tag { display: inline-flex; }
.sc-box.bad .sc-box-tag { display: inline-flex; background: var(--danger); }
.sc-h { position: absolute; width: 12px; height: 12px; background: #fff; border: 2px solid var(--pink); border-radius: 3px; z-index: 3; }
.sc-h-n, .sc-h-s { left: calc(50% - 6px); cursor: ns-resize; }
.sc-h-e, .sc-h-w { top: calc(50% - 6px); cursor: ew-resize; }
.sc-h-n, .sc-h-ne, .sc-h-nw { top: -6px; }
.sc-h-s, .sc-h-se, .sc-h-sw { bottom: -6px; }
.sc-h-e, .sc-h-ne, .sc-h-se { right: -6px; }
.sc-h-w, .sc-h-nw, .sc-h-sw { left: -6px; }
.sc-h-ne, .sc-h-sw { cursor: nesw-resize; }
.sc-h-nw, .sc-h-se { cursor: nwse-resize; }
.sc-ghost { position: absolute; border-radius: 8px; background: rgba(255, 28, 144, .16); box-shadow: inset 0 0 0 2px var(--pink); display: grid; place-items: center; color: var(--pink-ink); font-weight: 900; font-size: 13px; pointer-events: none; z-index: 4; }
.sc-ghost.bad { background: rgba(217, 45, 75, .18); box-shadow: inset 0 0 0 2px var(--danger); color: var(--danger); }
.sc-drag-chip { position: fixed; z-index: 1000; display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 8px; background: var(--ink); color: var(--surface); font-weight: 800; font-size: 13px; pointer-events: none; box-shadow: var(--shadow-3); }
body.sc-dragging, body.sc-dragging * { cursor: grabbing !important; user-select: none; }
.sc-ed-hint { padding: 8px 2px 10px; display: flex; align-items: center; flex-wrap: wrap; gap: 3px; }
.sc-insp { display: flex; flex-direction: column; }
.sc-insp-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.sc-insp-sec { padding: 12px 14px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.sc-insp-sec h3 { font-size: 12px; font-weight: 800; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; }
.sc-insp-fields { display: flex; flex-direction: column; gap: 10px; }
.sc-insp-fields textarea { height: auto; padding: 6px 10px; resize: vertical; }
.sc-insp-actions { display: flex; align-items: center; gap: 6px; padding: 12px 14px; }
.sc-seg { display: flex; flex-wrap: wrap; gap: 4px; padding: 3px; background: var(--surface-3); border-radius: 10px; }
.sc-seg-b { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 6px 8px; border-radius: 8px; font-size: 12.5px; font-weight: 700; color: var(--ink-2); white-space: nowrap; }
.sc-seg-b.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.sc-sw { width: 14px; height: 14px; border-radius: 4px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15); }
.sc-sw.th-light { background: #F3EEF4; }
.sc-sw.th-dark { background: #0E0B13; }
.sc-sw.th-brand { background: linear-gradient(135deg, #5C0E43, #1B0716); }
.sc-swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.sc-swatch { position: relative; width: 28px; height: 28px; border-radius: 8px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); display: grid; place-items: center; color: var(--ink-3); cursor: pointer; flex: none; }
.sc-swatch.on { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--ink); }
.sc-swatch.custom { background: var(--surface-3); overflow: hidden; }
.sc-swatch input[type=color] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; border: 0; padding: 0; }
.sc-grid4 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sc-grid4 label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 700; color: var(--ink-2); }
.sc-layers { display: flex; flex-direction: column; gap: 2px; }
.sc-layer { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; text-align: left; font-size: 13px; font-weight: 600; min-width: 0; }
.sc-layer span.grow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-layer:hover { background: var(--hover); }
.sc-asset-ctl { display: flex; align-items: center; gap: 8px; min-width: 0; }
.sc-asset-ctl img, .sc-asset-ctl .sc-asset-vid, .sc-asset-none { width: 48px; height: 32px; border-radius: 6px; object-fit: cover; flex: none; background: var(--surface-3); display: grid; place-items: center; color: var(--ink-3); aspect-ratio: auto; }
.sc-asset-ctl .grow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-toggle { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; cursor: pointer; }
.sc-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.sc-toggle-ui { width: 34px; height: 20px; border-radius: 10px; background: var(--line-2); position: relative; flex: none; transition: background .15s; }
.sc-toggle-ui::after { content: ''; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: var(--shadow-1); }
.sc-toggle input:checked + .sc-toggle-ui { background: var(--pink); }
.sc-toggle input:checked + .sc-toggle-ui::after { transform: translateX(14px); }
.sc-toggle input:focus-visible + .sc-toggle-ui { box-shadow: 0 0 0 3px var(--pink-soft); }
.sc-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.sc-chip { padding: 4px 10px; border-radius: 14px; border: 1px solid var(--line-2); font-size: 12px; font-weight: 700; color: var(--ink-2); background: var(--surface); }
.sc-chip.on { background: var(--pink); border-color: var(--pink); color: #fff; }
.sc-pick-pop .menu { max-height: 60vh; }

/* --- данные и пульты --- */
.sc-data { display: flex; flex-direction: column; gap: 14px; max-width: 1200px; }
.sc-num-table { border-collapse: collapse; width: 100%; }
.sc-num-table th { text-align: left; font-size: 12px; color: var(--ink-3); font-weight: 800; padding: 4px 6px; }
.sc-num-table td { padding: 4px 6px; vertical-align: middle; }
.sc-num-table .input { width: 100%; min-width: 70px; }
.sc-num-val { font-weight: 800; }
.sc-w-xs { width: 64px !important; min-width: 0 !important; }
.sc-w-s { width: 110px !important; }
.sc-sheet { overflow: auto; max-height: 70vh; border: 1px solid var(--line); border-radius: var(--r-sm); }
.sc-sheet table { border-collapse: collapse; min-width: 100%; }
.sc-sheet th, .sc-sheet td { border: 1px solid var(--line); padding: 0; }
.sc-sheet thead th { position: sticky; top: 0; background: var(--surface-3); z-index: 1; }
.sc-tb-n { width: 40px; text-align: center; font-size: 12px; }
.sc-cell-in { width: 100%; min-width: 120px; border: 0; background: transparent; color: var(--ink); font: inherit; font-size: 13px; padding: 7px 8px; }
.sc-cell-in.head { font-weight: 800; }
.sc-cell-in:focus { outline: 2px solid var(--pink); outline-offset: -2px; background: var(--surface); }
.sc-tb-x { opacity: .4; }
.sc-tb-x:hover { opacity: 1; }
.sc-slides { display: flex; flex-direction: column; gap: 10px; }
.sc-slide { display: flex; gap: 12px; padding: 10px; border: 1px solid var(--line); border-radius: var(--r-md); align-items: flex-start; }
.sc-slide-pic { width: 180px; aspect-ratio: 16 / 9; border-radius: 8px; background: var(--surface-3); display: grid; place-items: center; color: var(--ink-3); overflow: hidden; flex: none; }
.sc-slide-pic img { width: 100%; height: 100%; object-fit: cover; }
.sc-slide-title { font-weight: 800; }
.sc-slide textarea { height: auto; padding: 6px 10px; }
.sc-pult .panel-body { gap: 16px; }
.sc-pult h3 { font-size: 13px; font-weight: 800; color: var(--ink-3); }
.sc-big-row { display: flex; flex-wrap: wrap; gap: 10px; }
.sc-big-row > * { flex: 1 1 160px; }
.btn.sc-big { height: 56px; font-size: 17px; font-weight: 800; border-radius: 14px; justify-content: center; }
.btn.sc-big .i { width: 20px; height: 20px; }
.sc-big-in { height: 56px; font-size: 24px; font-weight: 900; text-align: center; }
.sc-q-now { display: flex; flex-direction: column; align-items: center; padding: 18px; background: var(--surface-3); border-radius: 14px; gap: 2px; }
.sc-q-now strong { font-size: 54px; font-weight: 900; letter-spacing: .02em; line-height: 1.1; }
.sc-q-now span:last-child { font-weight: 800; color: var(--pink-ink); }
.sc-ord { display: flex; flex-wrap: wrap; gap: 8px; }
.sc-ord-n { min-width: 92px; padding: 10px 14px; border-radius: 12px; font-size: 26px; font-weight: 900; display: flex; flex-direction: column; align-items: center; border: 2px solid var(--line-2); background: var(--surface); }
.sc-ord-n small { font-size: 10px; font-weight: 700; color: var(--ink-3); }
.sc-ord-n.done { border-color: #22B573; background: #E3F7EE; color: #0B6B4F; }
.sc-ord-n:hover:not(:disabled) { border-color: var(--pink); }
.sc-m { display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: start; }
.sc-m-side { display: flex; flex-direction: column; gap: 10px; align-items: stretch; text-align: center; }
.sc-m-team { font-weight: 900; font-size: 18px; border-bottom: 4px solid; padding-bottom: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-m-score { font-size: 72px; font-weight: 900; line-height: 1; }
.sc-m-mid { display: flex; flex-direction: column; gap: 10px; align-items: stretch; min-width: 170px; }
.sc-m-clock { font-size: 40px; font-weight: 900; text-align: center; font-variant-numeric: tabular-nums; }
.btn.sc-yc { background: #FFC940; color: #3A2A00; }
.btn.sc-rc { background: var(--danger); color: #fff; }
.sc-m-ev { padding-left: 18px; display: flex; flex-direction: column; gap: 3px; max-height: 240px; overflow: auto; }

@media (max-width: 1100px) {
  .sc-ed { grid-template-columns: minmax(0, 1fr) 300px; }
  .sc-ed .sc-pal { display: none; }
}
@media (max-width: 760px) {
  .page.sc-ed-page { height: auto; }
  .sc-ed, .sc-ed.ro { grid-template-columns: 1fr; }
  .sc-stage-wrap { height: 56vw; flex: none; }
  .sc-insp { border-radius: var(--r-md); }
  .sc-m { grid-template-columns: 1fr 1fr; }
  .sc-m-mid { grid-column: 1 / -1; order: -1; }
  .sc-slide { flex-direction: column; }
  .sc-slide-pic { width: 100%; }
  .sc-mon { flex-wrap: wrap; }
  .sc-mon-st { text-align: left; min-width: 0; }
}

/* Заставки ожидания экрана */
.sc-device-idle { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sc-device-idle .i { width: 14px; height: 14px; }
.sc-idle-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(262px, 1fr)); gap: 12px; }
.sc-idle-opt { display: flex; flex-direction: column; gap: 8px; padding: 5px 5px 9px; border: 2px solid transparent; border-radius: 12px; background: transparent; text-align: left; }
.sc-idle-opt:hover { background: var(--hover); }
.sc-idle-opt.on { border-color: var(--pink); background: var(--pink-soft-2); }
.sc-idle-opt strong { padding: 0 4px; font-size: 13px; }
.sc-idle-frame { position: relative; overflow: hidden; border-radius: 8px; background: #000; pointer-events: none; }
