/* Tender Desk — панель.
 *
 * Токены и размеры — из макета редизайна (design_handoff_tender_desk_redesign).
 * Шрифты лежат рядом (static/fonts, лицензия OFL): в закрытом контуре
 * интернета нет, и страница не должна ничего тянуть из сети.
 *
 * Цвет — только из токенов: тёмная тема переопределяет их, а не правила.
 * Цвета статусов одинаковы в обеих темах: хорошо, внимание, риск, AI, Telegram.
 */

/* --- шрифты ---------------------------------------------------------------- */

@font-face { font-family: 'Onest'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('/static/fonts/onest-cyrillic-400-normal.woff2') format('woff2');
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: 'Onest'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('/static/fonts/onest-latin-400-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; }
@font-face { font-family: 'Onest'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('/static/fonts/onest-cyrillic-500-normal.woff2') format('woff2');
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: 'Onest'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('/static/fonts/onest-latin-500-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; }
@font-face { font-family: 'Onest'; font-style: normal; font-weight: 600; font-display: swap;
  src: url('/static/fonts/onest-cyrillic-600-normal.woff2') format('woff2');
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: 'Onest'; font-style: normal; font-weight: 600; font-display: swap;
  src: url('/static/fonts/onest-latin-600-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; }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('/static/fonts/jetbrains-mono-cyrillic-400-normal.woff2') format('woff2');
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('/static/fonts/jetbrains-mono-latin-400-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; }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('/static/fonts/jetbrains-mono-cyrillic-500-normal.woff2') format('woff2');
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('/static/fonts/jetbrains-mono-latin-500-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; }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 600; font-display: swap;
  src: url('/static/fonts/jetbrains-mono-cyrillic-600-normal.woff2') format('woff2');
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 600; font-display: swap;
  src: url('/static/fonts/jetbrains-mono-latin-600-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; }

/* --- токены ---------------------------------------------------------------- */

:root {
  color-scheme: light;
  --bg: #F4F3EF; --surface: #FFFFFF; --surface-2: #F8F7F4; --muted: #EFEDE8;
  --line: #E4E2DC; --line-3: #D5D2CA;
  --ink: #1B1D1F; --ink-2: #4E5358; --ink-3: #83888D; --ink-4: #A9ADB1;
  --accent: #2F52D0; --accent-2: #2744B3; --on-accent: #FFFFFF;
  --accent-ink: #1E3A9E; --accent-tint: #E9EDFB; --accent-tint-2: #D6DEFA;
  --inverse: #1B1D1F; --inverse-2: #33363A; --inverse-3: #46494E;
  --good-tint: #E3F3EA; --good-tint-2: #F4FAF6; --good-ink: #155F3F;
  --warn-tint: #FBF1DC; --warn-tint-2: #FFFBF2; --warn-ink: #7A5000; --warn-line: #EFDDB4;
  --crit-tint: #FBE7E2; --crit-tint-2: #FFF8F6; --crit-ink: #8E2A1A; --crit-line: #F2C4B9;
  --ai-tint: #EEEAFD; --ai-tint-2: #F7F5FE; --ai-ink: #4B34A8; --ai-line: #CFC6F5;
  --tg-tint: #E1F0F9; --tg-tint-2: #F4FAFD; --tg-ink: #145E8A; --tg-line: #BFDDF0;

  /* Базовые цвета статусов — одинаковые в обеих темах. */
  --good: #1E7F55; --warn: #D99A00; --crit: #B93A26; --ai: #6B4FD8; --tg: #1D7FB8;

  --shadow-menu: 0 12px 32px rgba(27, 29, 31, .12);
  --shadow-float: 0 16px 40px rgba(27, 29, 31, .28);
  --shadow-drawer: -18px 0 48px rgba(27, 29, 31, .10);
  --shadow-modal: 0 24px 60px rgba(27, 29, 31, .3);
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: 'Onest', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #131416; --surface: #1B1D20; --surface-2: #212327; --muted: #2A2D31;
  --line: #303338; --line-3: #464A50;
  --ink: #ECEBE7; --ink-2: #B6B8BB; --ink-3: #8D9196; --ink-4: #6C7075;
  --accent: #6F8CF0; --accent-2: #8CA3F4; --on-accent: #0E1322;
  --accent-ink: #B3C3FA; --accent-tint: #1F2A4A; --accent-tint-2: #2A3862;
  --inverse: #3A3D42; --inverse-2: #46494E; --inverse-3: #55585D;
  --good-tint: #16301F; --good-tint-2: #172420; --good-ink: #86D4A9;
  --warn-tint: #3A2E12; --warn-tint-2: #262015; --warn-ink: #F0C766; --warn-line: #5A4819;
  --crit-tint: #3D1C17; --crit-tint-2: #2A1B19; --crit-ink: #F4A796; --crit-line: #6A2F25;
  --ai-tint: #2A2250; --ai-tint-2: #211E33; --ai-ink: #C6B9FF; --ai-line: #4A3F86;
  --tg-tint: #12303F; --tg-tint-2: #15232B; --tg-ink: #93CDEC; --tg-line: #244F66;
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #131416; --surface: #1B1D20; --surface-2: #212327; --muted: #2A2D31;
    --line: #303338; --line-3: #464A50;
    --ink: #ECEBE7; --ink-2: #B6B8BB; --ink-3: #8D9196; --ink-4: #6C7075;
    --accent: #6F8CF0; --accent-2: #8CA3F4; --on-accent: #0E1322;
    --accent-ink: #B3C3FA; --accent-tint: #1F2A4A; --accent-tint-2: #2A3862;
    --inverse: #3A3D42; --inverse-2: #46494E; --inverse-3: #55585D;
    --good-tint: #16301F; --good-tint-2: #172420; --good-ink: #86D4A9;
    --warn-tint: #3A2E12; --warn-tint-2: #262015; --warn-ink: #F0C766; --warn-line: #5A4819;
    --crit-tint: #3D1C17; --crit-tint-2: #2A1B19; --crit-ink: #F4A796; --crit-line: #6A2F25;
    --ai-tint: #2A2250; --ai-tint-2: #211E33; --ai-ink: #C6B9FF; --ai-line: #4A3F86;
    --tg-tint: #12303F; --tg-tint-2: #15232B; --tg-ink: #93CDEC; --tg-line: #244F66;
  }
}

/* --- основа ----------------------------------------------------------------- */

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans);
  font-size: 14px; line-height: 1.45; -webkit-font-smoothing: antialiased;
  font-feature-settings: "tnum" 1;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--accent-tint-2); }
[hidden] { display: none !important; }
svg { flex-shrink: 0; }
h1, h2, h3, h4 { margin: 0; }
p { margin: 0; }
code, kbd, .mono { font-family: var(--mono); }
kbd {
  font: 500 11px var(--mono); padding: 2px 6px; border: 1px solid var(--line);
  border-radius: 4px; background: var(--surface-2); color: var(--ink-2);
}
.muted { color: var(--ink-3); }
.ink2 { color: var(--ink-2); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.sep { color: var(--line-3); }
.dashed { color: var(--ink-2); border-bottom: 1px dashed var(--line-3); }
.dashed:hover { color: var(--ink); }
.link-btn { border: 0; background: transparent; padding: 0; color: var(--accent); font-size: inherit; }
.link-btn:hover { color: var(--accent-2); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dot--sq { border-radius: 2px; }
.dot--ring { background: transparent; border: 1.5px solid var(--ink-4); }

/* --- кнопки и поля ------------------------------------------------------------ */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 34px; padding: 0 12px; border: 1px solid var(--line-3); border-radius: 8px;
  background: var(--surface); color: var(--ink); font-size: 13px; font-weight: 500;
  white-space: nowrap; text-decoration: none;
}
.btn:hover { border-color: var(--ink); color: var(--ink); }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.btn--primary:hover { background: var(--accent-2); border-color: var(--accent-2); color: #FFFFFF; }
.btn--dark { background: var(--inverse); border-color: var(--inverse); color: #FFFFFF; font-weight: 600; }
.btn--dark:hover { background: var(--inverse-2); border-color: var(--inverse-2); color: #FFFFFF; }
.btn--ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn--ghost:hover { background: var(--muted); border-color: transparent; color: var(--ink); }
.btn--danger { color: var(--crit); }
.btn--danger:hover { border-color: var(--crit); color: var(--crit); }
.btn--sm { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 7px; }
.btn--lg { height: 38px; padding: 0 14px; font-size: 14px; font-weight: 600; }
.btn--icon { width: 32px; padding: 0; }
.btn.is-on { border-color: var(--accent); background: var(--accent-tint); color: var(--accent-ink); }

.input, .select, .textarea {
  height: 36px; width: 100%; padding: 0 10px; border: 1px solid var(--line-3);
  border-radius: 8px; background: var(--surface); color: var(--ink); font-size: 14px; outline: none;
}
.textarea { height: auto; min-height: 120px; padding: 10px 12px; line-height: 1.5; resize: vertical; font: 400 13px/1.55 var(--mono); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
.input--mono { font: 500 14px var(--mono); }
.input--num { text-align: right; font: 500 14px var(--mono); }
.input.is-changed, .select.is-changed { border-color: var(--warn); }
.input.is-bad { border-color: var(--crit); }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; }
.field__hint { font-weight: 400; font-size: 12px; color: var(--ink-3); line-height: 1.4; }
.field__err { font-weight: 500; font-size: 12px; color: var(--crit-ink); }
.suffix { position: relative; display: block; }
.suffix .input { padding-right: 60px; }
.suffix span { position: absolute; right: 12px; top: 9px; font-size: 13px; font-weight: 400; color: var(--ink-3); }

.switch { display: inline-flex; align-items: center; gap: 8px; border: 0; background: transparent; padding: 0; text-align: left; }
.switch__track { width: 34px; height: 20px; border-radius: 10px; background: var(--line-3); position: relative; flex-shrink: 0; transition: background .1s; }
.switch__track::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #FFFFFF; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: left .1s; }
.switch.is-on .switch__track { background: var(--accent); }
.switch.is-on .switch__track::after { left: 16px; }
.switch--sm .switch__track { width: 26px; height: 16px; }
.switch--sm .switch__track::after { width: 12px; height: 12px; }
.switch--sm.is-on .switch__track::after { left: 12px; }

.check {
  width: 18px; height: 18px; padding: 0; border-radius: 5px; border: 1.5px solid var(--line-3);
  background: var(--surface); display: grid; place-items: center; flex-shrink: 0;
}
.check.is-on { border-color: var(--accent); background: var(--accent); }
.check svg { display: none; }
.check.is-on svg { display: block; }

.tagbox {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-height: 42px;
  padding: 5px 6px; border: 1px solid var(--line-3); border-radius: 9px; background: var(--surface);
  font-weight: 400;
}
.tagbox:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
.tagbox.is-bad { border-color: var(--crit); }
.tagbox input { flex: 1; min-width: 140px; height: 30px; border: 0; outline: none; background: transparent; font-size: 14px; padding: 0 6px; color: var(--ink); }
.tag { display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 4px 0 10px; border-radius: 6px; background: var(--muted); font-size: 13px; color: var(--ink); }
.tag--accent { background: var(--accent-tint); color: var(--accent-ink); font-weight: 500; }
.tag button { width: 20px; height: 20px; border: 0; border-radius: 4px; background: transparent; color: inherit; opacity: .7; padding: 0; }
.tag button:hover { background: var(--line); opacity: 1; }

.note { display: grid; grid-template-columns: 18px 1fr; gap: 10px; padding: 12px 14px; border-radius: 10px; font-size: 13px; line-height: 1.45; }
.note--info { background: var(--accent-tint); color: var(--accent-ink); }
.note--warn { background: var(--warn-tint); color: var(--warn-ink); }
.note--good { background: var(--good-tint); color: var(--good-ink); }
.note--crit { background: var(--crit-tint); color: var(--crit-ink); }
.note--plain { background: var(--surface-2); color: var(--ink-2); }

/* --- шапка ------------------------------------------------------------------ */

.top {
  position: sticky; top: 0; z-index: 50; height: 56px; background: var(--surface);
  border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 18px; padding: 0 20px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); flex-shrink: 0; }
.brand:hover { color: var(--ink); }
.logo-mark { display: block; flex-shrink: 0; }
.brand__name { font-weight: 600; font-size: 15px; letter-spacing: -.01em; white-space: nowrap; }
.nav { display: flex; align-items: center; gap: 2px; flex: 0 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav__item {
  position: relative; display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 11px;
  border-radius: 7px; color: var(--ink-2); font-size: 14px; font-weight: 500; white-space: nowrap;
}
.nav__item:hover { background: var(--muted); color: var(--ink); }
.nav__item.is-active { background: var(--accent-tint); color: var(--accent-ink); font-weight: 600; }
.nav__badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--muted); color: var(--ink-2); font: 600 11px/18px var(--mono); text-align: center; }
.nav__item.is-active .nav__badge { background: var(--accent); color: var(--on-accent); }
.nav__warn { width: 7px; height: 7px; border-radius: 50%; background: #E0A100; }
.nav__warn--crit { background: var(--crit); }
.nav__div { width: 1px; height: 18px; background: var(--line); margin: 0 8px; flex-shrink: 0; }
.top__search { flex: 1 1 200px; min-width: 200px; max-width: 520px; margin-left: auto; position: relative; }
.top__search svg { position: absolute; left: 11px; top: 10px; color: var(--ink-3); }
.top__search input {
  width: 100%; height: 36px; border: 1px solid var(--line); background: var(--surface-2);
  border-radius: 8px; padding: 0 64px 0 34px; font-size: 14px; color: var(--ink); outline: none;
}
.top__search input:focus { border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px var(--accent-tint); }
.top__search kbd { position: absolute; right: 8px; top: 8px; height: 20px; line-height: 16px; }
.icon-btn.top__searchbtn { display: none; }
.top__pop {
  position: absolute; left: 12px; right: 12px; top: 62px; display: flex; gap: 8px; padding: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-menu); z-index: 60;
}
.icon-btn {
  width: 36px; height: 36px; flex-shrink: 0; border: 0; border-radius: 8px; background: transparent;
  display: grid; place-items: center; color: var(--ink-2);
}
.icon-btn:hover { background: var(--muted); color: var(--ink); }
.icon-btn--line { border: 1px solid var(--line); }
.crawl { display: flex; align-items: center; gap: 7px; height: 34px; padding: 0 10px; border-radius: 7px; color: var(--ink-2); font-size: 13px; white-space: nowrap; flex-shrink: 0; }
.crawl:hover { background: var(--muted); color: var(--ink); }
.crawl__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 3px var(--good-tint); }
.crawl__dot--warn { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-tint); }
.crawl__dot--crit { background: var(--crit); box-shadow: 0 0 0 3px var(--crit-tint); }
.user { position: relative; flex-shrink: 0; }
.user__btn { display: flex; align-items: center; gap: 9px; height: 38px; padding: 0 8px 0 4px; border: 1px solid transparent; border-radius: 9px; background: transparent; }
.user__btn:hover { background: var(--muted); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--inverse); color: #FFFFFF; display: grid; place-items: center; font-size: 12px; font-weight: 600; flex-shrink: 0; }
.user__who { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; }
.user__name { font-size: 13px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.user__role { font-size: 11px; color: var(--ink-3); white-space: nowrap; }
.menu {
  position: absolute; background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow-menu); padding: 6px; z-index: 60;
}
.user .menu { right: 0; top: 46px; width: 260px; }
.menu__head { padding: 10px 10px 12px; border-bottom: 1px solid var(--muted); margin-bottom: 6px; }
.menu__item {
  display: flex; align-items: center; gap: 10px; width: 100%; height: 36px; padding: 0 10px; border: 0;
  border-radius: 7px; background: transparent; color: var(--ink); font-size: 14px; text-align: left;
}
.menu__item:hover { background: var(--bg); color: var(--ink); }
.menu__item--danger, .menu__item--danger:hover { color: var(--crit); }
.menu__item--danger:hover { background: var(--crit-tint); }
.menu__item.is-on { background: var(--accent-tint); }

@media (max-width: 1359px) {
  .top__search, .crawl__text, .user__who { display: none; }
  .icon-btn.top__searchbtn { display: grid; }
  .top__spacer { flex: 1 1 0; }
}
@media (max-width: 1099px) {
  .brand__name, .nav__div { display: none; }
}

/* --- страница --------------------------------------------------------------- */

.page { max-width: 1760px; margin: 0 auto; padding: 20px 24px 120px; display: flex; flex-direction: column; gap: 16px; }
.page--1560 { max-width: 1560px; }
.page--1400 { max-width: 1400px; }
.page--1200 { max-width: 1200px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head__text { display: flex; flex-direction: column; gap: 4px; }
.h1 { font-size: 24px; line-height: 1.2; font-weight: 600; letter-spacing: -.01em; }
.lead { font-size: 13px; color: var(--ink-3); line-height: 1.5; max-width: 760px; }
.meta-line { font-size: 13px; color: var(--ink-3); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.card--pad { padding: 16px; }
.card__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; padding: 16px 16px 10px; }
.h2 { font-size: 15px; font-weight: 600; }
.h3 { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.readonly-pill { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px; border-radius: 8px; background: var(--muted); color: var(--ink-2); font-size: 13px; }

/* --- плитки ----------------------------------------------------------------- */

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr)); gap: 10px; }
/* Девять плиток ленты: на широком экране — по шесть в ряд, второй ряд ровно
   под первым, а не растянутые на всю ширину. */
@media (min-width: 1200px) { #feed-tiles { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.tiles--200 { grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); }
.tile {
  position: relative; text-align: left; display: flex; flex-direction: column; gap: 6px;
  padding: 14px 16px 13px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
}
button.tile:hover { border-color: var(--line-3); }
.tile.is-on { border-color: var(--accent); background: var(--accent-tint); box-shadow: 0 0 0 1px var(--accent); }
.tile__label { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.tile__row { display: flex; align-items: baseline; gap: 8px; }
.tile__value { font-size: 28px; line-height: 1; font-weight: 600; letter-spacing: -.02em; }
.tile__value--sm { font-size: 22px; }
.tile__unit { font-size: 12px; color: var(--ink-3); }
.tile__cta { margin-left: auto; font-size: 12px; font-weight: 500; color: var(--line-3); white-space: nowrap; }
.tile.is-on .tile__cta { color: var(--accent-ink); }
.tile__note { font-size: 12px; color: var(--ink-3); line-height: 1.35; }
/* Свои плитки: пустая — пунктир и «Настроить», у заполненной — «⋯» в углу. */
.tile-slot { position: relative; display: flex; }
.tile-slot > .tile { flex: 1 1 auto; min-width: 0; }
.tile--empty { border-style: dashed; background: transparent; justify-content: center; gap: 4px; color: var(--ink-3); }
button.tile--empty:hover { border-color: var(--accent); color: var(--accent-ink); background: var(--accent-tint); }
.tile__plus { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.tile--own { padding-right: 34px; }
.tile__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile__more {
  position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; display: grid; place-items: center;
  border: 0; border-radius: 6px; background: transparent; color: var(--ink-3);
}
.tile__more:hover { background: var(--muted); color: var(--ink); }
.tile-slot > .menu { top: 38px; right: 0; width: 300px; }
.menu__item:disabled { opacity: .45; cursor: default; }
.menu__item:disabled:hover { background: transparent; }
.menu__sep { margin: 6px 4px 4px; padding: 6px 6px 2px; border-top: 1px solid var(--muted); font-size: 11px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; }
.menu__sep:empty { padding: 0; }

/* --- обзор отбора ------------------------------------------------------------ */

.overview__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; }
.overview__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); border-top: 1px solid var(--muted); }
.overview__col { padding: 14px 16px 16px; border-right: 1px solid var(--muted); }
.overview__col:last-child { border-right: 0; }
.overview__title { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.bins { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; align-items: end; height: 150px; }
.bin {
  display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch; gap: 6px; height: 100%;
  padding: 6px 6px 4px; border: 1px solid transparent; border-radius: 8px; background: transparent; text-align: left;
}
.bin:hover { background: var(--surface-2); border-color: var(--line); }
.bin.is-on { border-color: var(--accent); background: var(--accent-tint); }
.bin.is-dim, .barrow.is-dim { opacity: .45; }
.bin__count { font-size: 15px; font-weight: 600; }
.bin__bar { border-radius: 4px; min-height: 3px; }
.bin__label { font-size: 12px; font-weight: 500; line-height: 1.2; }
.bin__range { font: 500 11px var(--mono); color: var(--ink-3); }
.barrows { display: flex; flex-direction: column; }
.barrow {
  display: grid; grid-template-columns: minmax(0, 150px) 1fr 44px; align-items: center; gap: 10px;
  height: 28px; padding: 0 6px; margin: 0 -6px; border: 0; border-radius: 6px; background: transparent; text-align: left;
}
.barrow--wide { grid-template-columns: minmax(0, 1fr) 90px 28px; }
.barrow:hover { background: var(--bg); }
.barrow.is-on { background: var(--accent-tint); }
.barrow__label { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track { height: 6px; border-radius: 3px; background: var(--muted); overflow: hidden; display: block; }
.track > span { display: block; height: 100%; border-radius: 3px; background: var(--accent); }
.track--10 { height: 10px; border-radius: 5px; }
.barrow__count { font-size: 13px; color: var(--ink-2); text-align: right; }

/* --- лента ------------------------------------------------------------------- */

.feedbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--muted); }
.seg { display: flex; gap: 2px; padding: 3px; background: var(--muted); border-radius: 9px; }
.seg__item { display: flex; align-items: center; gap: 7px; height: 30px; padding: 0 12px; border: 0; border-radius: 7px; background: transparent; color: var(--ink-2); font-size: 13px; font-weight: 500; }
.seg__item:hover { color: var(--ink); }
.seg__item.is-on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(27, 29, 31, .10); }
.seg__count { font: 500 11px var(--mono); color: var(--ink-3); }
.pop { position: relative; }
.pop > .menu { left: 0; top: 40px; width: 300px; display: flex; flex-direction: column; padding: 0; }
.pop--right > .menu { left: auto; right: 0; width: 230px; padding: 6px; }
.menu__help { padding: 10px 12px 6px; font-size: 12px; color: var(--ink-3); line-height: 1.4; }
.menu__list { max-height: 300px; overflow: auto; padding: 0 6px 6px; }
.opt {
  display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; align-items: center; gap: 10px; width: 100%;
  min-height: 36px; padding: 6px 8px; border: 0; border-radius: 7px; background: transparent; text-align: left;
}
.opt:hover { background: var(--bg); }
.opt__box { width: 16px; height: 16px; border-radius: 4px; border: 1.5px solid var(--line-3); display: grid; place-items: center; }
.opt__box--radio { border-radius: 50%; }
.opt.is-on .opt__box { border-color: var(--accent); background: var(--accent); }
.opt__box svg { display: none; }
.opt.is-on .opt__box svg { display: block; }
.opt__text { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.opt__label { font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
.opt__sub { font-size: 11px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.opt__count { font: 500 11px var(--mono); color: var(--ink-3); }
.sortopt { display: flex; align-items: center; justify-content: space-between; width: 100%; height: 34px; padding: 0 10px; border: 0; border-radius: 7px; background: transparent; font-size: 13px; text-align: left; }
.sortopt:hover { background: var(--bg); }
.sortopt.is-on { background: var(--accent-tint); }

.filters { display: flex; flex-direction: column; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--muted); background: var(--surface-2); }
.filters__row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.search { position: relative; flex: 1 1 260px; max-width: 380px; }
.search svg { position: absolute; left: 10px; top: 9px; color: var(--ink-3); }
.search input { width: 100%; height: 33px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); padding: 0 10px 0 32px; font-size: 13px; outline: none; color: var(--ink); }
.search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
.fbtn {
  display: flex; align-items: center; gap: 6px; height: 33px; min-width: max-content; padding: 0 10px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink);
  font-size: 13px; font-weight: 500; white-space: nowrap;
}
.fbtn:hover { border-color: var(--line-3); }
.fbtn.is-on { border-color: var(--accent); background: var(--accent-tint); color: var(--accent-ink); }
.fbtn svg { opacity: .6; }
.tog {
  display: flex; align-items: center; gap: 7px; height: 33px; padding: 0 11px 0 8px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--surface); color: var(--ink); font-size: 13px; font-weight: 500; white-space: nowrap;
}
.tog:hover { border-color: var(--line-3); }
.tog.is-on { border-color: var(--accent); background: var(--accent-tint); color: var(--accent-ink); }
.tog .switch__track { width: 26px; height: 16px; }
.tog .switch__track::after { width: 12px; height: 12px; }
.tog.is-on .switch__track { background: var(--accent); }
.tog.is-on .switch__track::after { left: 12px; }
.vsep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }
.chips { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.chip { display: flex; align-items: center; gap: 6px; height: 26px; padding: 0 6px 0 10px; border: 0; border-radius: 13px; background: var(--accent-tint); color: var(--accent-ink); font-size: 12px; font-weight: 500; }
.chip:hover { background: var(--accent-tint-2); }
.amount { display: flex; flex-direction: column; gap: 10px; padding: 4px 12px 12px; }
.amount__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pill { height: 28px; padding: 0 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); font-size: 12px; color: var(--ink-2); }
.pill:hover { border-color: var(--accent); color: var(--accent-ink); }
.pill.is-on { border-color: var(--accent); background: var(--accent-tint); color: var(--accent-ink); }

.sumline { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 16px; border-bottom: 1px solid var(--muted); font-size: 13px; }
.sumline__left { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--ink-2); }
.sumline b { color: var(--ink); font-weight: 600; }
.legend { display: flex; align-items: center; gap: 14px; font-size: 12px; color: var(--ink-3); flex-wrap: wrap; }
.legend > span { display: flex; align-items: center; gap: 5px; }

.table { min-width: 1180px; }
.trow {
  display: grid; grid-template-columns: 18px 48px minmax(0, 1fr) minmax(0, 240px) 96px 128px 104px 118px;
  align-items: start; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--muted); cursor: pointer;
}
.trow:hover { background: var(--surface-2); }
.trow.is-sel { background: var(--accent-tint); box-shadow: inset 3px 0 0 var(--accent); }
.trow.is-picked { background: var(--accent-tint); }
.trow--head { align-items: center; height: 46px; padding-top: 0; padding-bottom: 0; font-size: 13px; font-weight: 600; color: var(--ink-2); cursor: default; background: var(--surface); }
.trow--head:hover { background: var(--surface); }
.readonly .trow { grid-template-columns: 48px minmax(0, 1fr) minmax(0, 240px) 96px 128px 104px 118px; }
.compact .trow:not(.trow--head) { padding-top: 8px; padding-bottom: 8px; }
/* Заголовок, по которому сортируют, — кнопка во всю высоту строки: в узкую
   надпись не попадали. Подсветка при наведении показывает, куда нажмёте. */
.th-sort {
  display: flex; align-items: center; gap: 4px; height: 34px; margin: 0 -8px; padding: 0 8px;
  border: 0; border-radius: 7px; background: transparent; color: var(--ink-2);
  font-size: 13px; font-weight: 600; cursor: pointer; transition: background .12s, color .12s;
}
.th-sort:hover { background: var(--accent-tint); color: var(--accent-ink); }
.th-sort.is-on { color: var(--ink); background: var(--surface-2); }
.th-sort.is-on:hover { background: var(--accent-tint); color: var(--accent-ink); }
.th-sort--right { justify-content: flex-end; }
.trow .check { margin-top: 3px; }
.score {
  display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 26px; border-radius: 7px;
  font: 600 13px var(--mono);
}
.s1 { background: var(--good-tint); color: var(--good-ink); --step: var(--good); }
.s2 { background: var(--accent-tint); color: var(--accent-ink); --step: var(--accent); }
.s3 { background: var(--warn-tint); color: var(--warn-ink); --step: var(--warn); }
.s4 { background: var(--crit-tint); color: var(--crit-ink); --step: var(--crit); }
.s0 { background: var(--muted); color: var(--ink-3); --step: var(--ink-4); }
/* Балл без прочитанных документов — предварительный: обведён рамкой. */
.score.is-prelim { box-shadow: inset 0 0 0 1.5px var(--step); }
.cell { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.cell--r { align-items: flex-end; }
.title2 { font-size: 14px; line-height: 1.4; font-weight: 500; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.trow.is-reviewed .title2 { color: var(--ink-2); }
/* Не открывали — едва заметная полоса слева и чуть плотнее название;
   открывали — название чуть тише, как посещённая ссылка. Не ярко: это
   подсказка, а не сигнал. */
.trow.is-unseen:not(.is-sel) { box-shadow: inset 2px 0 0 var(--accent-tint-2); }
.trow.is-unseen .title2 { font-weight: 600; }
.trow.is-seen .title2 { color: var(--ink-2); }
.mcard.is-unseen:not(.is-sel) { box-shadow: inset 2px 0 0 var(--accent-tint-2); }
.mcard.is-seen .mcard__title { color: var(--ink-2); }
.rowmeta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12px; color: var(--ink-3); }
.rowmeta .mono { font-size: 11px; }
.cust { font-size: 13px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cust-sub { font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.amt { font-size: 14px; font-weight: 500; white-space: nowrap; }
.amt-unit { font-size: 11px; color: var(--ink-3); }
.pay { font-size: 13px; line-height: 1.35; }
.dl { font-size: 13px; font-weight: 500; }
.dl-left { font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.dl-left.is-soon { color: var(--crit); font-weight: 600; }
.flag {
  display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px; border: 1px solid var(--line);
  border-radius: 5px; background: var(--surface); color: var(--ink-2); font-size: 11px; font-weight: 500; white-space: nowrap;
}
button.flag:hover { filter: brightness(.96); }
.flag--prio { border-color: var(--accent-tint); background: var(--accent-tint); color: var(--accent-ink); }
.flag--changed { border-color: var(--warn-tint); background: var(--warn-tint); color: var(--warn-ink); }
.flag--rfi { background: var(--muted); color: var(--ink-2); border-color: var(--line-3); font-weight: 600; letter-spacing: .02em; }
.flag--rev { border-color: var(--muted); background: var(--muted); color: var(--ink-2); }
.flag--deal { border-color: var(--muted); background: var(--muted); color: var(--ink-2); }
.flag--deal.is-mine { border-color: var(--good-tint, var(--accent-tint)); background: var(--good-tint, var(--accent-tint)); color: var(--good-ink, var(--accent-ink)); }
.flag--lg { height: 24px; padding: 0 8px; border-radius: 6px; font-size: 12px; }
.proc { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; }
.proc__row { display: flex; gap: 4px; flex-wrap: wrap; }
.mk {
  display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 7px; border-radius: 6px;
  border: 1px solid transparent; font: 600 11px var(--mono); white-space: nowrap;
}
/* Документы: прочитаны правилами — нейтральная метка, без «AI». */
.mk--doc { background: var(--muted); color: var(--ink-2); }
.mk--doc-part { background: var(--surface); border-color: var(--line-3); color: var(--ink-2); }
.mk--doc-warn { background: var(--warn-tint); color: var(--warn-ink); }
.mk--doc-none { background: transparent; color: var(--ink-4); }
/* AI — только работа модели: внесла условия или написала сводку. */
.mk--ai { background: var(--ai-tint); color: var(--ai-ink); }
.mk--tg { background: var(--tg-tint); color: var(--tg-ink); }
.mk--tg-digest { background: var(--surface); border-color: var(--tg-line); color: var(--tg-ink); }
.mk--tg-held { background: var(--surface); border-color: var(--line); color: var(--ink-2); }
.mk--tg-failed { background: var(--crit-tint); color: var(--crit-ink); }
.mk--tg-none { background: transparent; color: var(--ink-4); }
.ai-tag { display: inline-flex; align-items: center; gap: 3px; height: 18px; padding: 0 5px; border-radius: 5px; background: var(--ai-tint); color: var(--ai-ink); font: 600 10px var(--mono); vertical-align: 1px; }
.empty { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 40px 24px 44px; }
.empty__title { font-size: 16px; font-weight: 600; }
.empty__text { font-size: 13px; color: var(--ink-2); max-width: 560px; line-height: 1.5; }
.pguide { font-size: 13px; color: var(--ink-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; background: var(--surface-2); }
.pguide summary { cursor: pointer; font-weight: 500; color: var(--ink); }
.pguide p, .pguide div { margin: 8px 0 0; line-height: 1.5; }
.pguide ul, .pwarn ul { margin: 6px 0 0; padding-left: 18px; line-height: 1.5; }
.pwarn { align-items: flex-start; }
.srcs { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0 16px; }
.srcs__row { cursor: pointer; }
.blockers { display: flex; flex-direction: column; gap: 6px; width: 100%; max-width: 760px; }
.blockers__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; }
.blockers__row > span { min-width: 0; overflow-wrap: anywhere; }
.feedfoot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; font-size: 13px; color: var(--ink-3); flex-wrap: wrap; }
.feedfoot__keys { display: flex; align-items: center; gap: 8px; }
.cards { display: none; flex-direction: column; }
.mcard { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--muted); cursor: pointer; }
.mcard.is-sel { background: var(--accent-tint); box-shadow: inset 3px 0 0 var(--accent); }
.mcard__top { display: flex; align-items: flex-start; gap: 10px; }
.mcard__title { font-size: 15px; line-height: 1.4; font-weight: 500; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.mcard__row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 13px; }
.scrollx { overflow-x: auto; }
@media (max-width: 819px) {
  .page { padding: 16px 12px 100px; }
  .tiles { grid-template-columns: 1fr 1fr; gap: 8px; }
  .tile { padding: 12px; }
  .tile__value { font-size: 24px; }
  .tile__cta, .tile__unit { display: none; }
  .top { gap: 8px; padding: 0 12px; }
  .scrollx { display: none; }
  .cards { display: flex; }
  .legend { display: none; }
}

.mine {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  padding: 10px 16px; border-bottom: 1px solid var(--muted); font-size: 13px; color: var(--ink-2);
}
.mine b { color: var(--ink); font-weight: 600; }

/* --- шторка разбора ----------------------------------------------------------- */

.drawer {
  position: fixed; top: 56px; right: 0; bottom: 0; width: min(680px, 100vw); background: var(--surface);
  border-left: 1px solid var(--line); box-shadow: var(--shadow-drawer); z-index: 40; display: flex; flex-direction: column;
}
.drawer__bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; height: 48px; padding: 0 12px 0 20px; border-bottom: 1px solid var(--muted); flex-shrink: 0; }
.drawer__nav { display: flex; align-items: center; gap: 4px; }
.sqbtn { width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); display: grid; place-items: center; color: var(--ink-2); padding: 0; }
.sqbtn:hover { background: var(--bg); color: var(--ink); }
.drawer__scroll { flex: 1; overflow-y: auto; overflow-x: hidden; }
.drawer__top { display: flex; flex-direction: column; gap: 14px; padding: 18px 20px 16px; }
.dhead { display: flex; align-items: flex-start; gap: 14px; }
.bigscore { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 64px; height: 64px; border-radius: 12px; flex-shrink: 0; }
.bigscore b { font: 600 22px var(--mono); line-height: 1; }
.bigscore span { font-size: 10px; font-weight: 500; margin-top: 4px; opacity: .8; }
.bigscore.is-prelim { box-shadow: inset 0 0 0 2px var(--step); }
.verdict { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 6px; font-size: 12px; font-weight: 600; }
.v-participate { background: var(--good-tint); color: var(--good); }
.v-review { background: var(--warn-tint); color: var(--warn-ink); }
.v-reject { background: var(--muted); color: var(--ink-2); }
.dtitle { font-size: 18px; line-height: 1.35; font-weight: 600; letter-spacing: -.005em; text-wrap: pretty; }
.strip { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.strip__row { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: start; padding: 11px 12px; }
.strip__row + .strip__row { border-top: 1px solid var(--muted); }
.strip__icon { width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center; }
.strip__title { font-size: 13px; font-weight: 600; }
.strip__text { font-size: 12px; color: var(--ink-2); line-height: 1.45; }
.tone-good { background: var(--good-tint-2); } .tone-good .strip__icon { background: var(--good-tint); color: var(--good-ink); }
.tone-warn { background: var(--warn-tint-2); } .tone-warn .strip__icon { background: var(--warn-tint); color: var(--warn-ink); }
.tone-crit { background: var(--crit-tint-2); } .tone-crit .strip__icon { background: var(--crit-tint); color: var(--crit-ink); }
.tone-tg { background: var(--tg-tint-2); } .tone-tg .strip__icon { background: var(--tg-tint); color: var(--tg-ink); }
.tone-ai { background: var(--ai-tint-2); } .tone-ai .strip__icon { background: var(--ai-tint); color: var(--ai-ink); }
.tone-plain { background: var(--surface); } .tone-plain .strip__icon { background: var(--muted); color: var(--ink-3); }
.kv { display: grid; grid-template-columns: 120px minmax(0, 1fr); row-gap: 8px; column-gap: 14px; font-size: 13px; }
.kv > .k { color: var(--ink-3); }
.dtabs { display: flex; gap: 4px; padding: 0 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 2; }
.dtab { display: flex; align-items: center; gap: 6px; height: 42px; padding: 0 10px; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; background: transparent; color: var(--ink-3); font-size: 13px; font-weight: 600; }
.dtab:hover { color: var(--ink); }
.dtab.is-on { color: var(--ink); border-bottom-color: var(--accent); }
.dpane { display: flex; flex-direction: column; gap: 22px; padding: 18px 20px 28px; }
.dsec { display: flex; flex-direction: column; gap: 8px; }
.dsec__head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.dsec h3 { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.summary { font-size: 14px; line-height: 1.55; text-wrap: pretty; }
.signals { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-radius: 8px; background: var(--surface-2); }
.signals__title { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.signals__list { display: flex; gap: 5px; flex-wrap: wrap; }
.signal { height: 22px; padding: 0 8px; border-radius: 5px; background: var(--surface); border: 1px solid var(--line); font-size: 12px; line-height: 20px; }
/* «Мнение AI» — сводка модели: пунктирная рамка цвета AI, а не заливка
 * статуса. Это мнение, и читаться как вывод правил оно не должно. */
.opinion { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border: 1px dashed var(--ai-line); border-radius: 10px; background: var(--ai-tint-2); }
.opinion__head { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--ai-ink); }
.opinion__text { font-size: 14px; line-height: 1.55; }
.opinion__foot { font-size: 12px; color: var(--ink-3); font-style: italic; }
.crit-row { display: grid; grid-template-columns: minmax(0, 1fr) 44px 150px 60px; align-items: center; gap: 10px; height: 28px; font-size: 13px; }
.crit-row__name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crit-row__w { font: 500 11px var(--mono); color: var(--ink-3); text-align: right; }
.crit-row__v { font: 600 12px var(--mono); text-align: right; }
.crit-row__v.is-unknown { font: 500 11px var(--sans); color: var(--ink-3); }
.fine { font-size: 12px; color: var(--ink-3); line-height: 1.45; }
.conds { display: flex; flex-direction: column; border: 1px solid var(--muted); border-radius: 10px; overflow: hidden; }
.cond + .cond { border-top: 1px solid var(--muted); }
.cond__btn { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto 16px; align-items: start; gap: 10px; width: 100%; padding: 10px 12px; border: 0; background: var(--surface); text-align: left; }
.cond__btn:hover, .cond.is-open .cond__btn { background: var(--surface-2); }
.cond__dot { width: 10px; height: 10px; margin-top: 4px; border-radius: 50%; }
.cst-red { background: var(--crit); } .cst-yellow { background: var(--warn); } .cst-green { background: var(--good); }
.cst-deal_breaker { background: var(--ink); } .cst-unknown { background: transparent; border: 1.5px solid var(--ink-4); }
.cond__label { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; }
.cond__value { font-size: 13px; color: var(--ink-2); line-height: 1.4; }
.cond__where { font: 500 11px var(--mono); color: var(--ink-3); white-space: nowrap; margin-top: 2px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.cond__chev { margin-top: 3px; color: var(--ink-3); }
.cond.is-open .cond__chev { transform: rotate(180deg); }
.cond__body { display: flex; flex-direction: column; gap: 8px; padding: 0 12px 12px 34px; background: var(--surface-2); }
.quote { margin: 0; padding: 8px 12px; border-left: 3px solid var(--line-3); background: var(--surface); font-size: 13px; line-height: 1.5; border-radius: 0 6px 6px 0; }
.quote--ai { border-left-color: var(--ai-line); background: var(--ai-tint-2); }
.cond__note { font-size: 12px; color: var(--ink-2); line-height: 1.45; }
.cond__note--dispute { color: var(--warn-ink); }
.cond--ok { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 9px 12px; }
.docs { display: flex; flex-direction: column; border: 1px solid var(--muted); border-radius: 10px; overflow: hidden; }
.doc { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 11px 12px; }
.doc + .doc { border-top: 1px solid var(--muted); }
.doc__ext { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; font: 600 9px var(--mono); background: var(--muted); color: var(--ink-2); text-transform: uppercase; }
.doc__name { font-size: 13px; font-weight: 500; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.doc__note { font-size: 12px; color: var(--ink-3); line-height: 1.4; }
.doc__state { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 7px; border-radius: 6px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.st-good { background: var(--good-tint); color: var(--good-ink); }
.st-warn { background: var(--warn-tint); color: var(--warn-ink); }
.st-crit { background: var(--crit-tint); color: var(--crit-ink); }
.st-plain { background: var(--muted); color: var(--ink-2); }
.st-ai { background: var(--ai-tint); color: var(--ai-ink); }
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.timeline li { display: grid; grid-template-columns: 96px 16px 1fr; gap: 10px; }
.timeline__at { font: 500 12px var(--mono); color: var(--ink-3); padding-top: 1px; }
.timeline__rail { display: flex; flex-direction: column; align-items: center; }
.timeline__dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 4px; flex-shrink: 0; background: var(--line-3); }
.timeline__line { flex: 1; width: 1px; background: var(--line); min-height: 16px; }
.timeline li:last-child .timeline__line { display: none; }
.timeline__text { display: flex; flex-direction: column; gap: 2px; padding-bottom: 14px; font-size: 13px; line-height: 1.4; }
.drawer__foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 20px; border-top: 1px solid var(--line); background: var(--surface-2); flex-shrink: 0; }
.fb.is-yes { border-color: var(--good); background: var(--good-tint); color: var(--good-ink); }
.fb.is-no { border-color: var(--crit); background: var(--crit-tint); color: var(--crit-ink); }
.fb:hover { border-color: var(--ink); }

/* --- плавающее: пачка, тост, модалка ------------------------------------------- */

.bulk {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; align-items: center; gap: 6px;
  padding: 6px 6px 6px 16px; border-radius: 12px; background: var(--inverse); color: #FFFFFF; box-shadow: var(--shadow-float); z-index: 45;
}
.bulk__count { font-size: 13px; font-weight: 500; margin-right: 8px; white-space: nowrap; }
.bulk .btn { height: 34px; border: 0; }
.bulk__main { background: var(--surface); color: var(--ink); font-weight: 600; }
.bulk__main:hover { background: var(--accent-tint); color: var(--ink); }
.bulk__alt { background: transparent; color: #FFFFFF; }
.bulk__alt:hover { background: var(--inverse-2); color: #FFFFFF; }
.toast {
  position: fixed; left: 24px; bottom: 24px; display: flex; align-items: center; gap: 14px; max-width: 460px;
  padding: 12px 14px 12px 16px; border-radius: 10px; background: var(--inverse); color: #FFFFFF; font-size: 13px;
  line-height: 1.4; box-shadow: var(--shadow-float); z-index: 90;
}
.toast button { height: 28px; padding: 0 10px; border: 0; border-radius: 6px; background: var(--inverse-2); color: #FFFFFF; font-size: 13px; font-weight: 600; white-space: nowrap; }
.toast button:hover { background: var(--inverse-3); }
.modal-back { position: fixed; inset: 0; background: rgba(27, 29, 31, .4); z-index: 80; display: grid; place-items: center; padding: 16px; }
.modal { width: 100%; max-width: 480px; background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-modal); padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.modal__title { font-size: 18px; font-weight: 600; }
.modal__foot { display: flex; justify-content: flex-end; gap: 8px; }
.secret { font: 600 20px var(--mono); padding: 12px 14px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); letter-spacing: .02em; word-break: break-all; }

/* --- вход ---------------------------------------------------------------------- */

.gate { position: fixed; inset: 0; z-index: 100; background: var(--bg); overflow: auto; }
.gate__layout { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr); }
.gate__splash { display: none; }
@media (min-width: 880px) {
  .gate__layout { grid-template-columns: minmax(0, 1.1fr) minmax(440px, 1fr); }
  /* Панель-заставка тёмная в обеих темах. */
  .gate__splash {
    position: sticky; top: 0; height: 100vh; min-height: 560px; display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto; background: #121315; color: #ECEBE7; overflow: hidden;
  }
  .gate__brand { display: none; }
}
.gate__splashhead { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 32px; }
.gate__splash .brand { color: #ECEBE7; gap: 12px; }
.gate__replay {
  display: flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border: 1px solid #2E3135;
  border-radius: 8px; background: transparent; color: #B6B8BB; font-size: 12px; font-weight: 500; cursor: pointer;
}
.gate__replay:hover { border-color: #55585D; color: #ECEBE7; }
.gate__stage { position: relative; min-height: 0; }
.gate__caption { margin: 0; padding: 18px 32px 26px; font-size: 14px; line-height: 1.55; color: #8D9196; max-width: 560px; text-wrap: pretty; }
.splash { position: absolute; inset: 0; overflow: hidden; }
.splash__board { position: absolute; left: 0; top: 0; transform-origin: 0 0; display: flex; flex-direction: column; gap: 22px; }
.splash__doc { position: relative; padding: 22px 26px 24px; border-radius: 12px; background: #1A1C1F; border: 1px solid #26292D; }
.splash__dochead { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 14px; font: 500 11px var(--mono); color: #5F6368; letter-spacing: .02em; }
.splash__par { margin: 0; font: 400 13px/1.7 'Onest', sans-serif; color: #74787D; }
.splash__frag { color: #9A9EA3; border-radius: 3px; padding: 1px 2px; margin: 0 -2px; transition: background .3s, color .3s; }
.splash__score {
  position: absolute; top: 14px; right: 16px; display: flex; align-items: center; gap: 10px; padding: 6px 10px 6px 6px;
  border-radius: 9px; background: #16301F; border: 1px solid #2A5A3D; transform-origin: right top;
}
.splash__scorenum { display: grid; place-items: center; width: 40px; height: 30px; border-radius: 6px; background: #1E7F55; color: #FFFFFF; font: 600 15px var(--mono); }
.splash__facts { display: flex; flex-direction: column; border-top: 1px solid #26292D; padding-top: 12px; }
.splash__row { display: grid; grid-template-columns: 10px 118px minmax(0, 1fr) 54px; gap: 10px; align-items: center; height: 32px; }
.splash__value { justify-self: start; font: 500 12px/20px var(--mono); color: transparent; background: #1E2023; border-radius: 5px; padding: 0 8px; min-width: 80px; white-space: nowrap; height: 20px; }
.splash__overlay { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
.splash__chips { position: absolute; inset: 0; pointer-events: none; }
.splash__chip {
  position: absolute; height: 22px; padding: 0 8px; border-radius: 5px; border: 1px solid; font: 500 12px/20px var(--mono);
  white-space: nowrap; box-shadow: 0 6px 18px rgba(0, 0, 0, .4);
}
.gate__wrap { min-height: 100vh; display: grid; grid-template-rows: auto 1fr auto; }
.gate__head, .gate__foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 28px; flex-wrap: wrap; font-size: 12px; color: var(--ink-3); }
.gate__main { display: flex; align-items: center; justify-content: center; padding: 24px; }
.gate__col { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 14px; }
.gate__card { display: flex; flex-direction: column; gap: 18px; padding: 28px 28px 24px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 1px 2px rgba(27, 29, 31, .04); }
.gate__title { font-size: 22px; font-weight: 600; letter-spacing: -.01em; }
.gate__note { font-size: 14px; line-height: 1.5; color: var(--ink-2); text-wrap: pretty; }
.gate__fields { display: flex; flex-direction: column; gap: 14px; }
.gate .input { height: 42px; padding: 0 12px; border-radius: 9px; font-size: 15px; }
.pw { position: relative; display: block; }
.pw .input { padding-right: 44px; }
.pw button { position: absolute; right: 4px; top: 4px; width: 34px; height: 34px; border: 0; border-radius: 7px; background: transparent; color: var(--ink-3); display: grid; place-items: center; }
.pw button:hover { background: var(--bg); color: var(--ink); }
.meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.meter span { height: 4px; border-radius: 2px; background: var(--muted); }
.rules { display: flex; flex-direction: column; gap: 3px; }
.rule { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--ink-3); }
.rule.is-ok { color: var(--good); }
.rule.is-bad { color: var(--warn-ink); }
.submit { display: flex; align-items: center; justify-content: space-between; height: 44px; padding: 0 16px; border: 0; border-radius: 9px; background: var(--accent); color: var(--on-accent); font-size: 15px; font-weight: 600; }
.submit:hover { background: var(--accent-2); }
.gate__fine { padding-top: 14px; border-top: 1px solid var(--muted); font-size: 12px; line-height: 1.5; color: var(--ink-3); }
.lock__time { font: 600 36px var(--mono); letter-spacing: -.02em; }

/* --- состояние ------------------------------------------------------------------ */

.anchors { display: flex; gap: 4px; flex-wrap: wrap; }
.anchor { display: flex; align-items: center; gap: 6px; white-space: nowrap; height: 30px; padding: 0 12px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); font-size: 13px; }
.anchor:hover { border-color: var(--accent); color: var(--accent-ink); }
.alert { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 14px; align-items: start; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.alert--critical { border-color: var(--crit-line); box-shadow: inset 4px 0 0 var(--crit); }
.alert--warning { border-color: var(--warn-line); box-shadow: inset 4px 0 0 var(--warn); }
.alert--info { box-shadow: inset 4px 0 0 var(--ink-4); }
.alert__icon { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; }
.alert--critical .alert__icon { background: var(--crit-tint); color: var(--crit); }
.alert--warning .alert__icon { background: var(--warn-tint); color: var(--warn); }
.alert--info .alert__icon { background: var(--muted); color: var(--ink-3); }
.alert__title { font-size: 15px; font-weight: 600; }
.alert__level { height: 20px; padding: 0 7px; border-radius: 5px; font-size: 11px; font-weight: 600; line-height: 20px; }
.alert__text { font-size: 13px; line-height: 1.5; color: var(--ink-2); }
.calm { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; font-size: 14px; color: var(--good-ink); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); gap: 16px; }
.grid2 > * { min-width: 0; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 16px; }
.frow { display: grid; grid-template-columns: minmax(0, 170px) 1fr 90px; gap: 12px; align-items: center; height: 36px; padding: 0 8px; margin: 0 -8px; border-radius: 7px; color: var(--ink); }
a.frow:hover, button.frow:hover { background: var(--bg); color: var(--ink); }
.qrow { display: grid; grid-template-columns: minmax(0, 170px) 1fr 70px; gap: 12px; align-items: center; height: 28px; font-size: 13px; }
.wrow { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 7px 0; font-size: 13px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); gap: 1px; background: var(--muted); border: 1px solid var(--muted); border-radius: 9px; overflow: hidden; }
.stat { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; background: var(--surface); min-width: 0; overflow-wrap: anywhere; }
.stat__label { font-size: 12px; color: var(--ink-3); }
.stat__value { font-size: 17px; font-weight: 600; }
.stat__sub { font-size: 11px; color: var(--ink-3); }
.sec-icon { width: 24px; height: 24px; border-radius: 6px; display: grid; place-items: center; }
.plat { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 2fr) 90px 90px 90px 120px 120px; gap: 12px; padding: 12px 16px; align-items: start; border-bottom: 1px solid var(--muted); font-size: 13px; }
.plat--head { height: 34px; padding-top: 0; padding-bottom: 0; align-items: center; border-top: 1px solid var(--muted); font-size: 12px; font-weight: 500; color: var(--ink-3); }
.num { text-align: right; }
.dead { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; gap: 14px; align-items: start; padding: 12px 16px; border-top: 1px solid var(--muted); font-size: 13px; }
.err-code { display: block; padding: 7px 10px; border-radius: 6px; background: var(--crit-tint-2); color: var(--crit-ink); font: 500 12px/1.5 var(--mono); white-space: pre-wrap; word-break: break-word; }
.cmd { padding: 5px 10px; border-radius: 6px; background: var(--bg); font: 500 12px var(--mono); color: var(--ink); }
.meterbar { height: 8px; border-radius: 4px; background: var(--muted); overflow: hidden; }
.meterbar > span { display: block; height: 100%; border-radius: 4px; background: var(--accent); }
.meterbar.is-warn > span { background: var(--warn); }
.meterbar.is-crit > span { background: var(--crit); }
.verdict-line { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 8px; font-size: 13px; line-height: 1.45; }
.vl-ok { background: var(--good-tint); color: var(--good-ink); }
.vl-info { background: var(--muted); color: var(--ink-2); }
.vl-warning { background: var(--warn-tint); color: var(--warn-ink); }
.vl-critical { background: var(--crit-tint); color: var(--crit-ink); }
.list-rows { display: flex; flex-direction: column; }
.list-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--muted); font-size: 13px; }

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

.settings { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 24px; align-items: start; }
.snav { position: sticky; top: 76px; display: flex; flex-direction: column; gap: 14px; }
.snav__group { display: flex; flex-direction: column; gap: 2px; }
.snav__label { padding: 0 10px 4px; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-4); }
.snav__item { display: flex; align-items: center; justify-content: space-between; gap: 8px; height: 36px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: var(--ink-2); font-size: 14px; font-weight: 500; text-align: left; }
.snav__item:hover { background: var(--muted); color: var(--ink); }
.snav__item.is-on { background: var(--accent-tint); color: var(--accent-ink); font-weight: 600; }
.sbody { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.shead { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.shead__title { font-size: 20px; font-weight: 600; }
.shead__lead { font-size: 14px; line-height: 1.5; color: var(--ink-2); max-width: 820px; text-wrap: pretty; }
.file-chip { padding: 5px 10px; border-radius: 6px; background: var(--muted); font: 500 12px var(--mono); color: var(--ink-2); }
.block { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.block__head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.block__title { font-size: 15px; font-weight: 600; }
.block__lead { font-size: 13px; color: var(--ink-3); line-height: 1.45; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 14px; }
.wrow2 { display: grid; grid-template-columns: minmax(0, 260px) minmax(min(120px, 100%), 1fr) 64px 120px; gap: 16px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--muted); }
.wrow2:last-child { border-bottom: 0; }
.wrow2 input[type="range"] { width: 100%; accent-color: var(--accent); }
.zones { display: flex; height: 34px; border-radius: 8px; overflow: hidden; font-size: 12px; font-weight: 600; }
.zones span { display: flex; align-items: center; padding: 0 10px; white-space: nowrap; overflow: hidden; }
.sw-row { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 12px; align-items: start; padding: 10px 0; border: 0; border-bottom: 1px solid var(--muted); background: transparent; text-align: left; width: 100%; }
.sw-row:last-child { border-bottom: 0; }
.sw-row__label { font-size: 14px; font-weight: 500; }
.sw-row__hint { font-size: 12px; color: var(--ink-3); line-height: 1.45; }
.rule-row { display: grid; grid-template-columns: minmax(0, 240px) minmax(0, 1fr); gap: 18px; padding: 14px 0; border-top: 1px solid var(--muted); }
.stable { width: 100%; border-collapse: collapse; font-size: 13px; }
.stable th { text-align: left; font-size: 12px; font-weight: 500; color: var(--ink-3); padding: 8px 10px; border-bottom: 1px solid var(--muted); }
.stable td { padding: 10px; border-bottom: 1px solid var(--muted); vertical-align: top; }
.stable tr:last-child td { border-bottom: 0; }
.savebar {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; align-items: center; gap: 14px;
  padding: 10px 10px 10px 18px; border-radius: 12px; background: var(--inverse); color: #FFFFFF; box-shadow: var(--shadow-float); z-index: 45; max-width: calc(100vw - 32px);
}
.savebar__text { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.savebar__title { font-size: 14px; font-weight: 600; }
.savebar__sub { font-size: 12px; color: #C9CBCE; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 520px; }
.savebar__sub.is-err { color: #F4A796; }
.savebar .btn { border: 0; height: 36px; }
.savebar__cancel { background: transparent; color: #FFFFFF; }
.savebar__cancel:hover { background: var(--inverse-2); color: #FFFFFF; }
.safe { display: grid; grid-template-columns: 18px 1fr; gap: 10px; padding: 12px 14px; border-radius: 10px; background: var(--good-tint); color: var(--good-ink); font-size: 13px; line-height: 1.5; }
.prompt { display: flex; flex-direction: column; gap: 8px; padding: 14px 0; border-top: 1px solid var(--muted); }
.prompt:first-of-type { border-top: 0; }
.roles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 10px; }
.role-card { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; }
.role-card b { font-size: 14px; }
@media (max-width: 899px) {
  .settings { grid-template-columns: 1fr; }
  .snav { position: static; }
  .wrow2 { grid-template-columns: 1fr 64px; }
  .wrow2 input[type="range"], .wrow2 > :last-child { display: none; }
  .rule-row { grid-template-columns: 1fr; }
}

/* --- итоги, пропуски, заказчики, справка ------------------------------------------- */

.pending { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 14px; align-items: start; padding: 14px 16px; border-top: 1px solid var(--muted); }
.pending__acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.won { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr)); gap: 10px; padding: 12px; margin-top: 10px; border-radius: 8px; background: var(--surface-2); }
.orow { display: grid; grid-template-columns: 48px minmax(0, 1fr) 130px 110px 170px 130px 150px; gap: 12px; align-items: center; padding: 10px 16px; border-top: 1px solid var(--muted); font-size: 13px; }
.orow__owner { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.orow__owner.is-mine { color: var(--accent); font-weight: 500; }
.orow--head { font-size: 12px; font-weight: 500; color: var(--ink-3); height: 36px; padding-top: 0; padding-bottom: 0; }
.cause { display: grid; grid-template-columns: minmax(0, 1fr) 90px; gap: 6px 16px; padding: 12px 0; border-top: 1px solid var(--muted); }
.cause__label { font-size: 14px; font-weight: 600; }
.cause__count { font: 500 12px var(--mono); color: var(--ink-2); text-align: right; }
.cause__fix { font-size: 13px; color: var(--ink); }
.mrow { display: grid; grid-template-columns: 48px minmax(0, 1fr) minmax(0, 320px); gap: 12px; align-items: start; padding: 10px 16px; border-top: 1px solid var(--muted); font-size: 13px; }
.reason-tag { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 5px; background: var(--muted); color: var(--ink-2); font-size: 11px; font-weight: 500; margin: 0 4px 4px 0; }
.crow { display: grid; grid-template-columns: 90px minmax(0, 1fr) auto; gap: 14px; align-items: start; padding: 12px 16px; border-top: 1px solid var(--muted); font-size: 13px; }
.crow__count { display: flex; flex-direction: column; gap: 5px; }
.crow__acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.legend-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 1fr)); gap: 16px; }
.legend-row { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 14px; align-items: start; padding: 10px 0; border-top: 1px solid var(--muted); font-size: 13px; line-height: 1.45; }
.legend-row:first-of-type { border-top: 0; }
.spinner-line { padding: 24px 16px; font-size: 13px; color: var(--ink-3); }
.err-line { padding: 16px; font-size: 13px; color: var(--crit-ink); }

/* --- Инструкция --------------------------------------------------------------------- */
.guide { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 24px; align-items: start; margin-top: 8px; }
.guide__toc { position: sticky; top: 76px; display: flex; flex-direction: column; gap: 2px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.guide__toc .h3 { margin-bottom: 6px; }
.guide__toc-link { display: flex; gap: 10px; align-items: baseline; padding: 6px 8px; border-radius: 8px; color: var(--ink-2); font-size: 13px; text-decoration: none; line-height: 1.35; }
.guide__toc-link:hover { background: var(--muted); color: var(--ink); }
.guide__body { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.guide__part { gap: 12px; scroll-margin-top: 76px; }
.guide__p { margin: 0; font-size: 14px; line-height: 1.6; color: var(--ink-2); }
.guide__p b, .guide__list b { color: var(--ink); }
.guide__list { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; line-height: 1.55; color: var(--ink-2); }
.guide__ui { display: inline-block; padding: 0 6px; border: 1px solid var(--line-3); border-radius: 6px; background: var(--muted); color: var(--ink); font-size: 13px; font-weight: 500; line-height: 1.6; white-space: nowrap; }
.guide__table { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.guide__row { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; line-height: 1.55; color: var(--ink-2); }
.guide__term { color: var(--ink); }
@media (max-width: 900px) {
  .guide { grid-template-columns: minmax(0, 1fr); }
  .guide__toc { position: static; }
  .guide__row { grid-template-columns: minmax(0, 1fr); gap: 4px; }
}

/* --- Состояние: строки диска и квот -------------------------------------------- */
.disk-row { display: grid; grid-template-columns: minmax(0, 280px) 1fr 220px; gap: 12px; align-items: center; font-size: 13px; }
.disk-row__free { text-align: right; }
.disk-row--compact { grid-template-columns: minmax(0, 170px) 1fr auto; }
.srv-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr)); gap: 8px; }
.srv-link { display: grid; grid-template-columns: 10px minmax(0, 1fr); gap: 8px; align-items: start; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.srv-link > .dot { margin-top: 5px; }
.srv-link__value { font-size: 14px; font-weight: 600; }
.srv-link__detail { font-size: 11px; color: var(--ink-3); line-height: 1.35; overflow-wrap: anywhere; }
.srv-card { display: flex; flex-direction: column; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; min-width: 0; }
.srv-note { font-size: 12px; line-height: 1.4; padding: 6px 9px; border-radius: 7px; }
.crow { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--muted); font-size: 13px; }
.crow:last-child { border-bottom: 0; }
.quotas { display: grid; grid-template-columns: minmax(0, 320px) minmax(0, 1fr); gap: 24px; }
.quota-row { display: grid; grid-template-columns: minmax(0, 200px) 1fr 160px; gap: 12px; align-items: center; min-height: 30px; font-size: 13px; }
.quota-row__value { text-align: right; color: var(--ink-2); }
.plat-table { min-width: 980px; }
.drawer__num { min-width: 0; max-width: 100%; }
.drawer__num-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

/* --- телефон: ничего не шире экрана -------------------------------------------------
   Меню — своей строкой во всю ширину, с прокруткой и затуханием у края: так
   видно, что пунктов больше. Таблица площадок, «Исчерпали попытки», квоты и
   диск — в один столбец: в семь колонок они уходили за край, и страница
   ездила вбок. */
@media (max-width: 819px) {
  :root { --top-h: 86px; }
  .top { flex-wrap: wrap; height: var(--top-h); row-gap: 0; padding-top: 6px; align-content: flex-start; }
  .nav {
    order: 10; flex: 1 0 100%; min-width: 0; padding: 2px 0 6px;
    -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent);
    mask-image: linear-gradient(90deg, #000 85%, transparent);
  }
  .nav__item { height: 32px; padding: 0 10px; font-size: 13px; }
  .drawer { top: var(--top-h); }
  .drawer__bar { padding: 0 8px 0 12px; }
  .drawer__bar > :last-child { min-width: 0; }

  .plat-table { min-width: 0; }
  .plat--head { display: none; }
  .plat { grid-template-columns: minmax(0, 1fr) auto auto; gap: 6px 10px; }
  .plat > :nth-child(1) { order: 1; }
  .plat > :nth-child(6) { order: 2; align-self: center; }
  .plat > :nth-child(7) { order: 3; }
  .plat > :nth-child(2) { order: 4; grid-column: 1 / -1; }
  .plat > :nth-child(3), .plat > :nth-child(4), .plat > :nth-child(5) { display: none; }

  .dead { grid-template-columns: minmax(0, 1fr); gap: 8px; overflow-wrap: anywhere; }
  .dead > :last-child { justify-self: start; }

  .quotas { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .quota-row { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; }
  .quota-row > .track, .quota-row > .small.muted { grid-column: 1 / -1; order: 3; }

  .disk-row { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .disk-row__free { text-align: left; }
  .kv > * { min-width: 0; overflow-wrap: anywhere; }
  .card { min-width: 0; }
}

/* --- замечания ------------------------------------------------------------------ */

.notes__compose { gap: 10px; }
.notes__compose.is-drop { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
.notes__text { min-height: 110px; font: 400 14px/1.5 var(--sans, inherit); }
.notes__bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.notes__bar .btn { display: inline-flex; align-items: center; gap: 6px; }
.notes__grow { flex: 1 1 0; }
.notes__hint { min-width: 0; }
.notes__files { display: flex; flex-wrap: wrap; gap: 8px; }
.notes__files:empty { display: none; }
.notes__thumb { position: relative; display: block; width: 132px; height: 92px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface-2); }
.notes__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
a.notes__thumb:hover { border-color: var(--accent); }
.notes__remove { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 6px; background: rgba(20, 22, 24, .65); color: #FFFFFF; }
.notes__voice .notes__remove { position: static; background: transparent; color: var(--ink-3); }
.notes__voice .notes__remove:hover { color: var(--crit); }
.notes__voice { display: flex; align-items: center; gap: 8px; color: var(--ink-3); flex-wrap: wrap; }
.notes__voice audio { height: 34px; max-width: 100%; }
.notes__recording { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 9px; background: var(--crit-tint-2); color: var(--crit-ink); font-size: 13px; }
.notes__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--crit); animation: notes-pulse 1.2s ease-in-out infinite; }
@keyframes notes-pulse { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .notes__dot { animation: none; } }
.btn.is-rec { border-color: var(--crit); color: var(--crit); }
.notes__list { display: flex; flex-direction: column; gap: 10px; }
.notes__item { gap: 10px; }
.notes__item.is-done { opacity: .72; }
.notes__head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.notes__body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.5; }
.notes__status { font-size: 12px; font-weight: 500; padding: 2px 8px; border-radius: 10px; background: var(--accent-tint); color: var(--accent-ink); }
.notes__status.is-done { background: var(--good-tint); color: var(--good-ink); }
.notes__git { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--ink-3); }
.notes__git--ok { color: var(--good-ink); }
.notes__git--err { color: var(--crit-ink); }
