/* Панель администратора. Рабочий инструмент: всё находится за секунды, цвет несёт смысл.
   Мир: схема линий. Три строки подписки — три линии своего цвета, входы — станции; красный и янтарный —
   только состояния. Тёмная рельса меню — рамка панели в обеих темах. */

:root {
  --bg: #F3F5F8; --surface: #FFFFFF; --surface-2: #EEF1F5; --raised: #E8ECF1;
  --line: #E3E7ED; --line-2: #CDD4DD;
  --text: #121821; --text-2: #39424E; --muted: #66707D; --dim: #C6CDD6;
  --accent: #2563EB; --accent-soft: #E6EEFD;
  --ok: #1B8A3D; --warn: #B26B00; --bad: #D1242F;
  --ok-soft: #E3F4E8; --warn-soft: #FBF0DC; --bad-soft: #FCE7E8;
  --l1: #2F6FED; --l2: #7C4DDB; --l3: #0E9F92; --l4: #C026D3;
  --c1: #2F6FED; --c2: #D88A1E; --c3: #1B8A3D; --c4: #7C4DDB;
  --rail: #0D1219; --rail-2: #161E28; --rail-line: #1F2833; --rail-text: #D7DEE7; --rail-muted: #7E8A99;
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --r: 10px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0F1319; --surface: #161B22; --surface-2: #1D232C; --raised: #242B35;
    --line: #232A34; --line-2: #313A46;
    --text: #E6EAF0; --text-2: #BCC4CF; --muted: #8893A1; --dim: #3A4350;
    --accent: #6EA0FF; --accent-soft: #1A2740;
    --ok: #46C16A; --warn: #E5A63B; --bad: #F2585E;
    --ok-soft: #14291C; --warn-soft: #2E2413; --bad-soft: #321A1C;
    --l1: #5B8FFF; --l2: #A07CFF; --l3: #2EC4B6; --l4: #E879F9;
    --c1: #5B8FFF; --c2: #E5A63B; --c3: #46C16A; --c4: #A07CFF;
    --rail: #0A0D12; --rail-2: #121821; --rail-line: #1A212B;
  }
}

html { color-scheme: light dark; }
body { font-size: 14px; -webkit-font-smoothing: antialiased; }
::selection { background: var(--accent-soft); color: var(--text); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
h1 { font-size: 22px; letter-spacing: -0.015em; }
h2 { font-size: 14px; letter-spacing: -0.005em; }
.num, td.num, .value, table { font-variant-numeric: tabular-nums; }

/* ── Рамка: рельса меню слева, рабочая область справа ─────────────────────────────── */
.layout { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px;
  padding: 16px 12px; background: var(--rail); color: var(--rail-text); overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 12px; font-size: 15px; font-weight: 650; letter-spacing: -0.01em; color: #fff; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 26px; height: 26px; flex: none; border-radius: 7px; background: var(--rail-2); }
.status-line { display: flex; align-items: center; gap: 8px; margin: 0 4px 10px; padding: 8px 10px; border-radius: 8px; background: var(--rail-2); color: var(--rail-text); font-size: 13px; text-decoration: none; }
.status-line:hover { background: var(--rail-line); }
.status-line.bad { color: #FFB4B6; }
.nav-group { display: flex; flex-direction: column; gap: 1px; margin-top: 8px; }
.nav-label { padding: 6px 12px 4px; font-size: 11.5px; font-weight: 500; color: var(--rail-muted); }
.nav a {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  height: 36px; padding: 0 10px 0 12px; border-radius: 8px; color: var(--rail-text); text-decoration: none;
  transition: background .15s var(--ease-out), color .15s var(--ease-out);
}
.nav a:hover { background: var(--rail-2); color: #fff; }
.nav a.active { background: var(--rail-line); color: #fff; font-weight: 600; }
.nav a.active::before { content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--l1); }
.nav a:active { transform: scale(.985); }
.nav-item { display: flex; align-items: center; gap: 10px; min-width: 0; }
.nav-item svg { flex: none; opacity: .85; }
.nav .count { min-width: 20px; height: 20px; padding: 0 6px; flex: none; border-radius: 10px; background: #3A2A10; color: #F5C46B; font-size: 12px; font-weight: 600; line-height: 20px; text-align: center; }
.nav .count.bad { background: #3A1618; color: #FF9FA3; }
.who { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 8px 0; border-top: 1px solid var(--rail-line); color: var(--rail-muted); font-size: 13px; }
.who .linkbtn { color: var(--rail-muted); }
.who .linkbtn:hover { color: #fff; }

.topbar { display: none; }
.scrim { display: none; }
.main { min-width: 0; padding: 28px 36px 64px; }
.wrap { max-width: 1180px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; min-height: 36px; }
.page-head .sub { display: none; }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .topbar {
    position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 12px;
    background: var(--rail); color: var(--rail-text);
  }
  .topbar b { font-size: 15px; font-weight: 600; color: #fff; }
  .topbar .dot { margin-left: auto; }
  .menu-btn { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 8px; color: #fff; }
  .menu-btn:active { background: var(--rail-2); }
  .side {
    position: fixed; z-index: 50; inset: 0 auto 0 0; width: min(280px, 84vw); height: 100%;
    transform: translateX(-100%); transition: transform .28s var(--ease-out); box-shadow: 0 0 40px rgba(0, 0, 0, .35);
  }
  .menu-open .side { transform: none; }
  .scrim { position: fixed; inset: 0; z-index: 40; background: rgba(5, 8, 12, .5); opacity: 0; pointer-events: none; transition: opacity .2s var(--ease-out); display: block; }
  .menu-open .scrim { opacity: 1; pointer-events: auto; }
  .nav a { height: 44px; }
  .main { padding: 18px 16px 48px; }
  .page-title { display: none; }
  .page-head:has(> .page-title:only-child) { display: none; }
  .wrap { gap: 16px; }
}
@media (prefers-reduced-motion: reduce) { .side, .scrim, .nav a { transition: none; } }

/* ── Поверхности ─────────────────────────────────────────────────────────────────── */
.card { min-width: 0; padding: 18px 20px; background: var(--surface); border-radius: var(--r); }
.card .head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.card .head .small, .card .head .muted { font-weight: 400; }
.card table tr:last-child td { border-bottom: 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-head a { color: var(--muted); font-size: 13px; text-decoration: none; }
.section-head a:hover { color: var(--text); }
.grid { display: grid; gap: 20px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.g4 { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; }
.split { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 20px; align-items: start; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } }

/* Показатели — подпись и число в одной полосе */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px 24px; padding: 16px 20px; background: var(--surface); border-radius: var(--r); }
.kpi { display: flex; flex-direction: column; gap: 2px; min-width: 0; text-decoration: none; }
.kpi .label { font-size: 12.5px; color: var(--muted); }
.kpi .value { font-size: 21px; font-weight: 650; letter-spacing: -0.01em; white-space: nowrap; }
.kpi .value .of { font-weight: 400; color: var(--muted); }
.kpi .hint { display: none; }
.kpi.warn .value { color: var(--warn); } .kpi.bad .value { color: var(--bad); }
a.kpi:hover .label { color: var(--text); }
.kpi .small-value { font-size: 14px; font-weight: 500; letter-spacing: 0; white-space: normal; }

/* Требует внимания — список строк, а не плашки */
.attention { display: flex; flex-direction: column; padding: 6px 8px; background: var(--surface); border-radius: var(--r); }
.attention a { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 6px 12px; border-radius: 8px; text-decoration: none; }
.attention a:hover { background: var(--surface-2); }
.attention a + a { border-top: 1px solid var(--line); border-radius: 0; }
.attention .go { margin-left: auto; color: var(--muted); }
.attention .bad { color: var(--bad); font-weight: 500; }

/* ── Схема линий ──────────────────────────────────────────────────────────────────── */
.lines { display: flex; flex-direction: column; }
.line { display: grid; grid-template-columns: minmax(150px, 210px) minmax(0, 1fr) minmax(170px, 230px); align-items: center; gap: 18px; padding: 14px 0; }
.line + .line { border-top: 1px solid var(--line); }
.line-name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.line-badge { display: grid; place-items: center; width: 26px; height: 26px; flex: none; border-radius: 50%; background: var(--lc); color: #fff; font-size: 13px; font-weight: 700; }
.line-name .grow b { display: block; font-weight: 600; }
.line-name .grow > span { display: block; font-size: 12.5px; color: var(--muted); }
.track { position: relative; display: flex; align-items: center; justify-content: space-between; height: 44px; padding: 0 6px; }
.track::before { content: ""; position: absolute; left: 6px; right: 6px; top: 50%; height: 4px; margin-top: -2px; border-radius: 2px; background: var(--lc); opacity: .9; }
.station { position: relative; z-index: 1; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; }
.station i { display: block; width: 14px; height: 14px; border-radius: 50%; background: var(--surface); border: 3px solid var(--lc); transition: transform .15s var(--ease-out); }
.station.bad i { background: var(--bad); border-color: var(--bad); box-shadow: 0 0 0 3px var(--surface); }
.station.none i { border-color: var(--dim); }
.station.issued i { width: 20px; height: 20px; border-width: 5px; background: var(--surface); box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--lc); }
.station.issued.bad i { background: var(--bad); }
.station:hover i { transform: scale(1.18); }
.station .tip { position: absolute; bottom: calc(100% + 6px); left: 50%; z-index: 5; width: max-content; max-width: 240px; padding: 8px 10px; border-radius: 8px; background: #121821; color: #E6EAF0; font-size: 12.5px; line-height: 1.45; text-align: left; opacity: 0; transform: translate(-50%, 4px); pointer-events: none; transition: opacity .12s var(--ease-out), transform .12s var(--ease-out); box-shadow: 0 8px 24px rgba(0, 0, 0, .25); }
.station:hover .tip, .station:focus-visible .tip { opacity: 1; transform: translate(-50%, 0); }
.station .tip b { display: block; color: #fff; }
.station .tip span { color: #A9B3C1; }
.line-now { min-width: 0; text-align: right; }
.line-now b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.line-now span { font-size: 12.5px; color: var(--muted); }
.l1 { --lc: var(--l1); } .l2 { --lc: var(--l2); } .l3 { --lc: var(--l3); } .l4 { --lc: var(--l4); }
@media (max-width: 760px) {
  .line { grid-template-columns: 1fr; gap: 6px; }
  .line-now { display: flex; align-items: baseline; gap: 8px; text-align: left; padding-left: 36px; }
  .line-now b { flex: none; }
  .track { padding: 0; }
  .track::before { left: 0; right: 0; }
  .station { width: 22px; height: 22px; }
  .station i { width: 12px; height: 12px; border-width: 2.5px; }
  .station.issued i { width: 17px; height: 17px; border-width: 4px; }
}

/* ── Таблицы ──────────────────────────────────────────────────────────────────────── */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; padding: 6px 8px; font-size: 12px; font-weight: 500; color: var(--muted); border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
td.num, th.num { text-align: right; }
td a { text-decoration: none; }
td a:hover { text-decoration: underline; text-underline-offset: 3px; }
.table-card { overflow-x: auto; }
.table-card table { min-width: 640px; }
.group-row td { padding-top: 16px; background: none !important; border-bottom: 1px solid var(--line); }
.cells { display: grid; grid-template-columns: repeat(24, 1fr); gap: 2px; height: 14px; min-width: 144px; }
.cells i { border-radius: 2px; }
.cells .ok { background: var(--ok); opacity: .55; } .cells .warn { background: var(--warn); } .cells .down { background: var(--bad); } .cells .none { background: var(--line); }
.tag { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 6px; background: var(--surface-2); color: var(--text-2); font-size: 12px; white-space: nowrap; }

.meter { height: 4px; background: var(--line); }
.meter i { display: block; height: 100%; background: var(--c, var(--ok)); }
.bars { display: flex; align-items: flex-end; gap: 2px; height: 90px; }
.bars button { flex: 1; display: flex; align-items: flex-end; height: 100%; min-width: 0; }
.bars i { width: 100%; min-height: 2px; border-radius: 2px 2px 0 0; background: var(--dim); }
.bars i.s-warn { background: var(--warn); }
.bars i.s-down { background: var(--bad); height: 100% !important; opacity: .4; }
.bars i.s-none { background: var(--line); height: 100% !important; opacity: .5; }
.bars button:hover i, .bars.picking button[aria-pressed="true"] i { background: var(--accent); }
.readout { display: flex; align-items: baseline; gap: 10px; min-height: 20px; font-size: 13px; color: var(--muted); }
.readout b { color: var(--text); }
.axis { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }

/* ── Формы и кнопки ───────────────────────────────────────────────────────────────── */
input[type="text"], input[type="password"], input[type="search"], input[type="number"], select, textarea {
  height: 36px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; outline: none;
  transition: border-color .15s var(--ease-out), box-shadow .15s var(--ease-out);
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input::placeholder { color: var(--muted); }
label.field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
label.field input, label.field select { color: var(--text); }
.btn { transition: background .15s var(--ease-out), border-color .15s var(--ease-out), transform .1s var(--ease-out); }
.btn:active { transform: scale(.97); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn-ghost { background: transparent; }
form.inline { display: inline-flex; gap: 6px; align-items: center; margin: 0; }
.flash { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: var(--r); background: var(--ok-soft); color: var(--text); }
.flash::before { content: ""; width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--ok); }
.flash.bad { background: var(--bad-soft); }
.flash.bad::before { background: var(--bad); }

/* ── Фильтры, вкладки, журнал ─────────────────────────────────────────────────────── */
.filters { display: flex; gap: 2px; flex-wrap: wrap; }
.filters a { padding: 5px 10px; border-radius: 7px; color: var(--muted); text-decoration: none; }
.filters a:hover { color: var(--text); background: var(--surface-2); }
.filters a.active { color: var(--text); background: var(--surface); font-weight: 600; }
.filters a b { font-weight: 400; color: var(--muted); }
.tabs { display: flex; gap: 2px; padding: 3px; border-radius: 9px; background: var(--surface-2); overflow-x: auto; max-width: 100%; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { padding: 5px 12px; border-radius: 7px; color: var(--text-2); font-size: 13.5px; text-decoration: none; white-space: nowrap; }
.tabs a:hover { color: var(--text); }
.tabs a.active { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.log { display: flex; flex-direction: column; gap: 4px; }
.log div { display: flex; gap: 12px; align-items: baseline; }
.log time { flex: none; width: 110px; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.lvl-error { color: var(--bad); } .lvl-warning { color: var(--warn); } .lvl-info { color: var(--text); }
.sev { display: inline-flex; align-items: center; gap: 8px; }
.sev::before { content: ""; width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--dim); }
.sev.down::before, .sev.error::before { background: var(--bad); }
.sev.slow::before, .sev.warning::before { background: var(--warn); }
.msg { white-space: pre-line; overflow-wrap: anywhere; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.empty { padding: 8px 0; color: var(--muted); }
.empty .mark, .empty p { display: none; }
.empty b { font-weight: 400; }
.linkbtn { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; font-size: 12px; }
.linkbtn:hover { color: var(--bad); }
a.btn { text-decoration: none; color: var(--text); }
a.btn-primary { color: #fff; }

.login { display: grid; place-items: center; min-height: 100vh; padding: 24px; background: var(--rail); }
.login form { width: 100%; max-width: 340px; padding: 24px; border-radius: 14px; background: var(--surface); display: flex; flex-direction: column; gap: 10px; }
.login input, .login .btn { width: 100%; height: 40px; }

.wizard { display: flex; gap: 16px; margin: 0; padding: 0; list-style: none; color: var(--muted); }
.wizard li b { margin-right: 6px; font-weight: 400; }
.wizard li.on { color: var(--accent); font-weight: 600; }
.picklist { display: flex; flex-direction: column; margin-top: 12px; }
.pick { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }

/* ── Графики ──────────────────────────────────────────────────────────────────────── */
.charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 1080px) { .charts { grid-template-columns: 1fr; } }
.chart-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.chart-head h2 { margin-bottom: 2px; }
.chart-legend { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 14px; }
.chart-legend button { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); white-space: nowrap; }
.chart-legend button.off { opacity: .4; }
.chart-legend i, .chart-tip i { display: inline-block; width: 10px; height: 3px; border-radius: 2px; }
.chart { position: relative; min-height: 210px; }
.chart-svg { display: block; overflow: visible; }
.chart-grid { stroke: var(--line); stroke-width: 1; }
.chart-axis { fill: var(--muted); font-size: 11px; font-family: var(--sans); font-variant-numeric: tabular-nums; }
.chart-line { fill: none; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.chart-area { opacity: .08; }
.chart-loss { fill: var(--bad); }
.chart-cursor { stroke: var(--text); stroke-width: 1; opacity: .35; }
.chart-dot { stroke: var(--surface); stroke-width: 2; }
.chart-tip { position: absolute; z-index: 5; min-width: 180px; padding: 10px 12px; border-radius: 8px; background: #121821; color: #E6EAF0; font-size: 12.5px; line-height: 1.55; pointer-events: none; box-shadow: 0 8px 24px rgba(0, 0, 0, .22); }
.chart-tip-head { margin-bottom: 4px; font-weight: 600; color: #fff; }
.chart-tip div:not(.chart-tip-head):not(.chart-tip-note) { display: flex; align-items: center; gap: 8px; }
.chart-tip b { margin-left: auto; padding-left: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.chart-tip-note { margin-top: 4px; color: #FF9FA3; }
.chart-empty { fill: var(--muted); font-size: 13px; font-family: var(--sans); }
.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.chart-note { margin-top: 6px; font-size: 12px; color: var(--muted); }
.chart-note i { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 2px; background: var(--bad); vertical-align: 0; }

/* ── Настройки ────────────────────────────────────────────────────────────────────── */
.settings { display: flex; flex-direction: column; gap: 20px; max-width: 780px; }
.setting { display: flex; align-items: flex-start; gap: 16px; padding: 12px 0; margin: 0; }
.setting + .setting { border-top: 1px solid var(--line); }
.setting b { display: block; font-weight: 600; }
.setting p { margin-top: 2px; font-size: 13px; color: var(--muted); max-width: 60ch; }
.switch { position: relative; width: 44px; height: 26px; flex: none; margin-top: 2px; border-radius: 13px; background: var(--line-2); transition: background .18s var(--ease-out); }
.switch i { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .18s var(--ease-out); }
.switch.on { background: var(--ok); }
.switch.on i { transform: translateX(18px); }
.switch:active i { width: 23px; }
.callout { margin: 0 0 6px; padding: 10px 12px; border-radius: 8px; font-size: 13px; background: var(--surface-2); }
.callout.warn { background: var(--warn-soft); color: var(--text); }
.choice { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; margin: 0; padding: 0; border: 0; }
.choice legend { margin-bottom: 6px; padding: 0; }
.option { display: flex; gap: 10px; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: 10px; cursor: pointer; transition: border-color .15s var(--ease-out), background .15s var(--ease-out); }
.option:hover { background: var(--surface-2); }
.option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.option input { margin-top: 3px; accent-color: var(--accent); }
.option b { display: block; font-weight: 600; }
.option span span { display: block; margin-top: 2px; font-size: 13px; color: var(--muted); }
.facts { display: grid; grid-template-columns: minmax(150px, 200px) 1fr; gap: 10px 20px; margin: 0; }
.facts dt { color: var(--muted); font-size: 13px; }
.facts dd { margin: 0; }
@media (max-width: 560px) { .facts { grid-template-columns: 1fr; gap: 2px; } .facts dd { margin-bottom: 10px; } }
.inline-actions summary { list-style: none; display: inline-flex; }
.inline-actions summary::-webkit-details-marker { display: none; }
.inline-actions[open] summary { background: var(--surface-2); }
.add-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.add-row input { width: 170px; }
.add-row span { flex-basis: 100%; }

/* ── Пользователи ─────────────────────────────────────────────────────────────────── */
tr[data-href] { cursor: pointer; }
.who-cell { display: flex; align-items: baseline; gap: 10px; }
.who-cell .dot { flex: none; transform: translateY(-1px); }
.facts.compact { grid-template-columns: auto 1fr; gap: 8px 16px; }
.facts.compact dd { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 560px) { .facts.compact { grid-template-columns: auto 1fr; gap: 8px 16px; } .facts.compact dd { margin: 0; } }
.more { margin-top: 12px; }
.more summary { cursor: pointer; color: var(--muted); font-size: 13px; list-style: none; }
.more summary::-webkit-details-marker { display: none; }
.more summary::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 8px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-3px) rotate(45deg); transition: transform .15s var(--ease-out); }
.more[open] summary::after { transform: translateY(0) rotate(-135deg); }
.more summary:hover { color: var(--text); }
.count-inline { display: inline-grid; place-items: center; min-width: 18px; height: 18px; margin-left: 4px; padding: 0 5px; border-radius: 9px; background: var(--warn-soft); color: var(--warn); font-size: 11.5px; font-weight: 600; }
.attention-card { box-shadow: inset 0 0 0 1px var(--warn); }
@media (max-width: 560px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; padding: 14px 16px; }
  .split > .first-mobile { order: -1; }
}

/* ── Подписка: строки в приложении ────────────────────────────────────────────────── */
.cs { max-width: 860px; padding: 6px 20px; }
textarea { height: auto; padding: 10px 12px; line-height: 1.45; resize: vertical; }
textarea.code { width: 100%; font-family: var(--mono); font-size: 12.5px; color: var(--text); }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; flex: none; border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface); color: var(--text-2); transition: background .15s var(--ease-out), color .15s var(--ease-out); }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn.sm { width: 30px; height: 30px; border-color: transparent; background: transparent; color: var(--muted); }
.icon-btn.sm:hover { background: var(--surface-2); color: var(--text); }
.icon-btn[disabled] { opacity: .3; pointer-events: none; }
.icon-btn[aria-expanded="true"] { background: var(--surface-2); color: var(--text); }
.sl { margin: 0; padding: 0; list-style: none; }
.sl-row { padding: 10px 0; border-top: 1px solid var(--line); scroll-margin-top: 16px; background: var(--surface); }
.sl-row:first-child { border-top: 0; }
.sl-row.off .sl-title, .sl-row.off .sl-meta { opacity: .45; }
.sl-row.dragging { opacity: .4; }
.sl-row[draggable="true"] { cursor: grabbing; }
.sl-main { display: flex; align-items: center; gap: 10px; }
.sl-main .switch { margin-top: 0; }
.sl-grip { display: grid; place-items: center; width: 20px; height: 32px; flex: none; margin-left: -6px; border-radius: 6px; color: var(--dim); cursor: grab; touch-action: none; }
.sl-grip:hover { color: var(--muted); background: var(--surface-2); }
.sl-title { font-weight: 600; overflow-wrap: anywhere; }
.sl-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: 1px; font-size: 12.5px; color: var(--muted); }
.hl { display: inline-flex; align-items: center; gap: 5px; }
.hl::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--dim); }
.hl.ok::before { background: var(--ok); } .hl.warn::before { background: var(--warn); } .hl.bad::before { background: var(--bad); }
.hl.bad { color: var(--bad); }
.t-accent-soft { color: var(--accent); }
.sl-actions { display: flex; gap: 0; flex: none; }
.sl-edit { display: flex; flex-direction: column; gap: 12px; margin: 12px 0 4px 66px; max-width: 520px; }
.sl-edit[hidden] { display: none; }
.sl-edit input[type="text"] { width: 100%; }
.fld { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); }
.fld > span { width: 44px; flex: none; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border-radius: 9px; background: var(--surface-2); }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: 5px 12px; border-radius: 7px; font-size: 13.5px; color: var(--text-2); cursor: pointer; transition: background .15s var(--ease-out); }
.seg span:hover { color: var(--text); }
.seg input:checked + span { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(0, 0, 0, .14); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
input.cs-users { display: none; width: 100%; }
.cs-form:has(input[name="audience"][value="users"]:checked) input.cs-users { display: block; }
label.check { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
label.check input { accent-color: var(--accent); width: 16px; height: 16px; }
.cs-outs-wrap { margin-top: 8px; max-height: 300px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.cs-outs { width: 100%; font-size: 12.5px; }
.cs-outs td { padding: 6px 10px; }
.cs-outs tr.cs-main td:first-child { font-weight: 600; }
.cs-outs tr.cs-dead td { opacity: .5; }
.dlg { width: min(540px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; border: 0; border-radius: 14px; background: var(--surface); color: var(--text); box-shadow: 0 24px 64px rgba(0, 0, 0, .35); }
.dlg::backdrop { background: rgba(8, 10, 14, .55); }
.dlg[open] { animation: dlg-in .16s var(--ease-out); }
@keyframes dlg-in { from { opacity: 0; transform: translateY(6px) scale(.985); } }
.dlg-head { display: flex; align-items: center; gap: 10px; padding: 16px 16px 0 20px; }
.dlg-head b { flex: 1; font-size: 16px; }
.dlg-x { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; color: var(--muted); font-size: 22px; line-height: 1; }
.dlg-x:hover { background: var(--surface-2); color: var(--text); }
.dlg-step { display: flex; flex-direction: column; gap: 14px; padding: 16px 20px 20px; }
.dlg-step[hidden] { display: none; }
.dlg-step input[type="text"], .dlg-step input[type="search"] { width: 100%; }
.dlg-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 2px; }
.found { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: 8px; background: var(--surface-2); font-size: 13.5px; color: var(--text-2); }
.found b { color: var(--text); font-weight: 600; }
.found:empty { display: none; }
.pv { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.cs-preview { margin: 6px 0 0; padding-left: 20px; font-size: 13.5px; }
.cs-preview li { padding: 2px 0; overflow-wrap: anywhere; }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 50; padding: 8px 14px; border-radius: 9px; background: #121821; color: #E6EAF0; font-size: 13.5px; transform: translateX(-50%); box-shadow: 0 8px 24px rgba(0, 0, 0, .25); }
.toast[hidden] { display: none; }
@media (max-width: 560px) {
  .cs { padding: 4px 14px; }
  .sl-main { align-items: flex-start; gap: 8px; }
  .sl-main .switch { margin-top: 3px; }
  .sl-edit { margin-left: 0; }
  .pv { grid-template-columns: 1fr; }
}

/* ── Карточка человека: сейчас и трудности ──────────────────────────────────────────── */
.now-card { padding: 14px 18px; }
.now-head { display: flex; align-items: center; gap: 8px; }
.now-head .muted { margin-left: 2px; }
.now-row { display: flex; align-items: baseline; gap: 12px; margin-top: 8px; font-size: 13.5px; }
.now-row .mono { flex: none; }
.issues { margin: 10px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.issues li { position: relative; padding-left: 16px; font-size: 13.5px; line-height: 1.45; }
.issues li::before { content: ""; position: absolute; left: 2px; top: .55em; width: 7px; height: 7px; border-radius: 50%; background: var(--warn); }
.issues li.bad::before { background: var(--bad); }
.issue-line { max-width: 420px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--warn); }
.issue-line.bad { color: var(--bad); }
@media (max-width: 560px) { .now-row { flex-wrap: wrap; gap: 2px 10px; } .now-row .grow { flex-basis: 100%; order: 3; } }
