/* Сторож — панель. Без сборщика и CDN: шрифты системные, иконки — инлайн-SVG Lucide.
   Тема: тёмная или светлая по системе, переключатель в шапке. */

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

:root {
  color-scheme: light;
  --bg: #f3f6fb;
  --bg-glow: rgba(37, 99, 235, .07);
  --surface: #ffffff;
  --surface-2: #f6f8fc;
  --line: #e2e8f0;
  --line-2: #cbd5e1;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #556274;          /* 5,9:1 на белом */
  --accent: #1d4ed8;
  --btn: #1d4ed8; --btn-ink: #ffffff;   /* 6,7:1 */
  --ok: #16a34a;   --ok-ink: #15803d;   --ok-sub: #dcfce7;
  --bad: #dc2626;  --bad-ink: #b91c1c;  --bad-sub: #fee2e2;
  --warn: #d97706; --warn-ink: #b45309; --warn-sub: #fef3c7;
  --none: #94a3b8; --none-ink: #475569; --none-sub: #eef2f7;
  --hub: #7c3aed;  --hub-sub: #ede9fe;
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 6px 20px rgba(15, 23, 42, .06);
  --shadow-lg: 0 14px 40px rgba(15, 23, 42, .16);
  --r: 12px; --r-lg: 18px;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #070b14;
    --bg-glow: rgba(56, 189, 248, .09);
    --surface: #0e1525;
    --surface-2: #121b2f;
    --line: #1c2840;
    --line-2: #2a3a5a;
    --ink: #e7eefa;
    --ink-2: #bccadf;
    --muted: #8e9db7;        /* 6,4:1 на --surface */
    --accent: #7dd3fc;
    --btn: #2563eb; --btn-ink: #ffffff;
    --ok: #22c55e;   --ok-ink: #4ade80;   --ok-sub: rgba(34, 197, 94, .13);
    --bad: #ef4444;  --bad-ink: #fca5a5;  --bad-sub: rgba(239, 68, 68, .14);
    --warn: #f59e0b; --warn-ink: #fcd34d; --warn-sub: rgba(245, 158, 11, .14);
    --none: #475569; --none-ink: #94a3b8; --none-sub: rgba(148, 163, 184, .1);
    --hub: #a78bfa;  --hub-sub: rgba(167, 139, 250, .14);
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 28px rgba(0, 0, 0, .35);
    --shadow-lg: 0 16px 44px rgba(0, 0, 0, .55);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #070b14;
  --bg-glow: rgba(56, 189, 248, .09);
  --surface: #0e1525;
  --surface-2: #121b2f;
  --line: #1c2840;
  --line-2: #2a3a5a;
  --ink: #e7eefa;
  --ink-2: #bccadf;
  --muted: #8e9db7;
  --accent: #7dd3fc;
  --btn: #2563eb; --btn-ink: #ffffff;
  --ok: #22c55e;   --ok-ink: #4ade80;   --ok-sub: rgba(34, 197, 94, .13);
  --bad: #ef4444;  --bad-ink: #fca5a5;  --bad-sub: rgba(239, 68, 68, .14);
  --warn: #f59e0b; --warn-ink: #fcd34d; --warn-sub: rgba(245, 158, 11, .14);
  --none: #475569; --none-ink: #94a3b8; --none-sub: rgba(148, 163, 184, .1);
  --hub: #a78bfa;  --hub-sub: rgba(167, 139, 250, .14);
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 28px rgba(0, 0, 0, .35);
    --shadow-lg: 0 16px 44px rgba(0, 0, 0, .55);
}

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(1200px 520px at 50% -180px, var(--bg-glow), transparent 70%), var(--bg);
  background-attachment: fixed;
  color: var(--ink);
  font: 15px/1.5 var(--font);
  font-variant-numeric: tabular-nums;
}
a { color: var(--accent); text-underline-offset: 3px; }
code { font-family: var(--mono); font-size: .9em; background: var(--surface-2); border: 1px solid var(--line);
       border-radius: 6px; padding: .05em .4em; overflow-wrap: anywhere; }
h1, h2 { line-height: 1.25; margin: 0; }
.muted { color: var(--muted); }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--btn); color: var(--btn-ink); padding: 8px 14px;
        border-radius: 8px; z-index: 100; }
.skip:focus { left: 12px; }

.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.ic { width: 18px; height: 18px; flex: none; }
.ic-sm { width: 14px; height: 14px; vertical-align: -2px; }

/* ── шапка ─────────────────────────────────────────────────────────────── */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px max(16px, calc((100vw - 1200px) / 2 + 16px));
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; margin-right: auto; }
.logo { width: 34px; height: 34px; flex: none; }
.brand-t { display: flex; flex-direction: column; font-weight: 750; font-size: 17px; letter-spacing: .01em; line-height: 1.1; }
.brand-t small { font-weight: 500; font-size: 12px; color: var(--muted); letter-spacing: 0; }
.nav { order: 3; display: flex; gap: 4px; width: 100%; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav-a { display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; border-radius: 999px;
         color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: 14px; white-space: nowrap; min-height: 40px; }
.nav-a:hover { background: var(--surface-2); color: var(--ink); }
@media (max-width: 420px) { .nav-a { padding: 8px 9px; gap: 5px; font-size: 13.5px; } }
.nav-a.is-on { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.top-act { display: flex; gap: 6px; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line);
            background: var(--surface); color: var(--ink-2); cursor: pointer; }
.icon-btn:hover { color: var(--ink); border-color: var(--line-2); }
.ic-sun { display: none; }
:root[data-theme="dark"] .ic-moon { display: none; }
:root[data-theme="dark"] .ic-sun { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ic-moon { display: none; }
  :root:not([data-theme="light"]) .ic-sun { display: block; }
}
@media (min-width: 860px) {
  .nav { order: 0; width: auto; }
  .brand { margin-right: 18px; }
  .top-act { margin-left: auto; }
}

main.wrap { padding-top: 22px; padding-bottom: 40px; }
.foot { color: var(--muted); font-size: 13px; padding-bottom: 28px; }

/* ── кнопки ────────────────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px;
       border: 0; border-radius: 10px; background: var(--btn); color: var(--btn-ink); font: 600 15px/1 var(--font);
       cursor: pointer; text-decoration: none; white-space: nowrap; transition: filter .15s, transform .15s; }
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .6; cursor: progress; }
.btn--ghost { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2); }
.btn--sm { min-height: 36px; padding: 0 12px; font-size: 14px; }
.btn--wide { width: 100%; }

/* ── герой ─────────────────────────────────────────────────────────────── */
.hero { position: relative; display: grid; grid-template-columns: auto 1fr; gap: 14px 18px; align-items: center;
        padding: 22px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line);
        box-shadow: var(--shadow); overflow: hidden; }
.hero::after { content: ""; position: absolute; inset: auto -20% -60% 30%; height: 180%; pointer-events: none;
               background: radial-gradient(closest-side, var(--hero-glow, transparent), transparent); opacity: .5; }
.hero--up { --hero: var(--ok); --hero-glow: var(--ok-sub); }
.hero--down { --hero: var(--bad); --hero-glow: var(--bad-sub); }
.hero--warn { --hero: var(--warn); --hero-glow: var(--warn-sub); }
.hero h1 { font-size: clamp(22px, 5vw, 32px); font-weight: 800; letter-spacing: -.01em; }
.hero p { margin: 4px 0 0; color: var(--muted); }
.hero .btn { grid-column: 1 / -1; position: relative; z-index: 1; }
.hero-t { position: relative; z-index: 1; min-width: 0; }
/* Лампочка состояния: стеклянный шар с бликом и белым знаком; при аварии и замечаниях — расходящееся кольцо */
.orb { position: relative; width: 44px; height: 44px; border-radius: 50%; z-index: 1; display: grid; place-items: center; color: #fff;
       background: radial-gradient(120% 120% at 30% 18%, color-mix(in srgb, var(--hero) 50%, #fff) 0%, var(--hero) 46%,
                   color-mix(in srgb, var(--hero) 70%, #000) 100%);
       box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), inset 0 -5px 10px rgba(0, 0, 0, .16),
                   0 0 0 4px color-mix(in srgb, var(--hero) 13%, transparent),
                   0 10px 22px -8px color-mix(in srgb, var(--hero) 75%, transparent); }
.orb::before { content: ""; position: absolute; left: 20%; top: 7%; width: 60%; height: 40%; border-radius: 50%;
               background: linear-gradient(180deg, rgba(255, 255, 255, .6), rgba(255, 255, 255, 0)); pointer-events: none; }
.orb .orb-ic { position: relative; width: 22px; height: 22px; stroke-width: 2.8; filter: drop-shadow(0 1px 1.5px rgba(0, 0, 0, .3)); }
.orb span { position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--hero); opacity: 0; }
.hero--down .orb span, .hero--warn .orb span { animation: ring 2.2s ease-out infinite; }
@keyframes ring { 0% { transform: scale(.9); opacity: .75; } 100% { transform: scale(1.65); opacity: 0; } }
@media (min-width: 700px) {
  .hero { grid-template-columns: auto 1fr auto; padding: 26px 28px; }
  .hero .btn { grid-column: auto; }
  .orb { width: 50px; height: 50px; }
  .orb .orb-ic { width: 24px; height: 24px; }
}

/* ── плитки ────────────────────────────────────────────────────────────── */
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 14px 0 6px; }
.kpis > .tile:last-child:nth-child(odd) { grid-column: 1 / -1; }
@media (min-width: 700px) {
  .kpis { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
  .kpis > .tile:last-child:nth-child(odd) { grid-column: auto; }
}
.kpis--4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr)); }
.tile { position: relative; display: grid; gap: 2px; padding: 14px 16px; border-radius: var(--r); background: var(--surface);
        border: 1px solid var(--line); min-width: 0; }
.tile-ic { position: absolute; right: 14px; top: 14px; color: var(--t, var(--none-ink)); opacity: .9; }
.tile-l { font-size: 13px; color: var(--muted); padding-right: 26px; }
.tile-v { font-size: 22px; font-weight: 780; color: var(--ink); letter-spacing: -.01em; overflow-wrap: anywhere; }
.tile-s { font-size: 13px; color: var(--t-ink, var(--muted)); overflow-wrap: anywhere; }
.tile--ok { --t: var(--ok); --t-ink: var(--ok-ink); }
.tile--bad { --t: var(--bad); --t-ink: var(--bad-ink); border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); }
.tile--warn { --t: var(--warn); --t-ink: var(--warn-ink); }

/* ── заметки ───────────────────────────────────────────────────────────── */
.note { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--r); margin: 14px 0;
        background: var(--n-sub, var(--none-sub)); border: 1px solid color-mix(in srgb, var(--n, var(--none)) 35%, transparent); }
.note > .ic { color: var(--n, var(--none-ink)); margin-top: 2px; }
.note b { display: block; }
.note p { margin: 2px 0 0; color: var(--ink-2); overflow-wrap: anywhere; }
.note--bad { --n: var(--bad); --n-sub: var(--bad-sub); }
.note--warn { --n: var(--warn); --n-sub: var(--warn-sub); }

/* ── группы и строки ───────────────────────────────────────────────────── */
.group { margin-top: 26px; }
.group h2 { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 750; color: var(--ink-2);
            margin: 0 4px 10px; text-transform: none; }
.group--alert h2 { color: var(--bad-ink); }
.g-cnt { font-size: 12px; font-weight: 700; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line);
         border-radius: 999px; padding: 1px 9px; }
.g-cnt--bad { color: var(--bad-ink); background: var(--bad-sub); border-color: transparent; }
.rows { display: grid; gap: 8px; }

.row { display: grid; grid-template-columns: 12px minmax(0, 1fr); gap: 4px 12px; align-items: center;
       padding: 12px 14px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line);
       color: var(--ink); text-decoration: none; transition: border-color .15s, transform .15s, box-shadow .15s; }
.row:hover { border-color: var(--line-2); box-shadow: var(--shadow); }
.row--down { border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); background:
             linear-gradient(90deg, var(--bad-sub), transparent 60%), var(--surface); }
.row--check { border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); }
.row-main { display: grid; min-width: 0; }
.row-name { font-weight: 680; overflow-wrap: anywhere; }
.row-url { font-weight: 400; color: var(--muted); font-size: 13px; margin-left: 8px; }
.row-sub { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.row--down .row-sub { color: var(--bad-ink); }
.row--check .row-sub { color: var(--warn-ink); }
.row .bars, .row .nums, .row .badges { grid-column: 2; }
.nums { display: flex; gap: 18px; }
.row-num { display: inline-flex; align-items: baseline; gap: 6px; line-height: 1.2; }
.row-num b { font-size: 15px; font-weight: 700; }
.row-num small { font-size: 12px; color: var(--muted); white-space: nowrap; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badges:empty { display: none; }
@media (min-width: 640px) {
  .row { grid-template-columns: 12px minmax(0, 1fr) auto; }
  .row .nums { grid-column: 3; grid-row: 1; }
  .row .bars, .row .badges { grid-column: 2 / -1; }
  .row-num { display: inline-grid; gap: 0; text-align: right; min-width: 70px; }
}
@media (min-width: 1040px) {
  /* Колонки фиксированной ширины: у всех строк полоски и цифры стоят ровно друг под другом. */
  .row { grid-template-columns: 12px minmax(0, 1fr) 200px 160px 230px; gap: 0 18px; }
  .row .nums { justify-content: flex-end; }
  .row .bars, .row .badges { grid-column: auto; }
  .row .nums { grid-column: auto; grid-row: auto; }
  .row .badges { justify-content: flex-end; }
}

.row.row--pulse { grid-template-columns: 12px minmax(0, 1fr) auto; }
.row--pulse .nums { grid-column: 3; grid-row: 1; }
.row--pulse .row-num { display: inline-grid; gap: 0; text-align: right; }

/* статусная точка */
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--d, var(--none)); flex: none;
       box-shadow: 0 0 0 3px color-mix(in srgb, var(--d, var(--none)) 22%, transparent); }
.dot--up { --d: var(--ok); }
.dot--down { --d: var(--bad); animation: blink 1.6s ease-in-out infinite; }
.dot--check { --d: var(--warn); }
.dot--pending, .dot--paused, .dot--unknown { --d: var(--none); }
@keyframes blink { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--bad) 10%, transparent); } }

/* полоска 30/90 дней */
.bars { display: flex; gap: 2px; height: 22px; align-items: stretch; width: 100%; max-width: 100%; }
.b { display: block; flex: 1 1 0; min-width: 2px; max-width: 8px; border-radius: 2px; background: var(--none-sub);
     box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--none) 30%, transparent); }
.b--ok { background: var(--ok); box-shadow: none; opacity: .85; }
.b--minor { background: var(--warn); box-shadow: none; }
.b--bad { background: var(--bad); box-shadow: none; }
.bars--big { height: 34px; gap: 2px; }
.bars--big .b { max-width: none; }
/* На телефоне 90 полосок не помещаются — показываем последние 30 дней. */
@media (max-width: 639px) { .bars--big .b:nth-child(-n+60) { display: none; } }

/* значки */
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 650; padding: 3px 8px;
         border-radius: 999px; background: var(--b-sub, var(--none-sub)); color: var(--b, var(--none-ink)); white-space: nowrap; }
.badge--ok { --b: var(--ok-ink); --b-sub: var(--ok-sub); }
.badge--warn { --b: var(--warn-ink); --b-sub: var(--warn-sub); }
.badge--bad { --b: var(--bad-ink); --b-sub: var(--bad-sub); }
.badge--hub { --b: var(--hub); --b-sub: var(--hub-sub); }

.pill { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 650; padding: 3px 10px;
        border-radius: 999px; background: var(--p-sub, var(--none-sub)); color: var(--p, var(--none-ink)); white-space: nowrap; }
.pill .dot { width: 8px; height: 8px; box-shadow: none; animation: none; }
.pill--up { --p: var(--ok-ink); --p-sub: var(--ok-sub); }
.pill--down { --p: var(--bad-ink); --p-sub: var(--bad-sub); }
.pill--check { --p: var(--warn-ink); --p-sub: var(--warn-sub); }

.legend { margin: 22px 4px 0; font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.legend .b { display: inline-block; width: 8px; height: 14px; flex: none; }

/* ── карточка цели ─────────────────────────────────────────────────────── */
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; font-weight: 600;
        font-size: 14px; margin-bottom: 12px; min-height: 32px; }
.back:hover { color: var(--ink); }
.d-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.d-head h1 { font-size: clamp(22px, 5vw, 30px); font-weight: 800; overflow-wrap: anywhere; }
.d-head .muted { margin: 6px 0 0; }
.ext { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; margin-top: 4px; overflow-wrap: anywhere; }
.d-since { margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; color: var(--muted); font-size: 14px; }

.panel { padding: 18px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); margin: 14px 0; }
.panel h2 { font-size: 16px; font-weight: 750; margin-bottom: 12px; }
.panel > .muted { margin: 10px 0 0; font-size: 13px; }

.facts { display: grid; grid-template-columns: 1fr; gap: 2px 18px; margin: 0; }
.facts dt { color: var(--muted); font-size: 13px; margin-top: 8px; }
.facts dd { margin: 0; overflow-wrap: anywhere; }
@media (min-width: 700px) {
  .facts { grid-template-columns: minmax(170px, 240px) 1fr; }
  .facts dt { margin-top: 0; padding: 7px 0; border-bottom: 1px solid var(--line); }
  .facts dd { padding: 7px 0; border-bottom: 1px solid var(--line); }
}

.chart { margin: 0; }
.chart svg { display: block; width: 100%; height: 200px; border-radius: 10px; background: var(--surface-2); }
.ch-line { fill: none; stroke: var(--accent); stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.ch-s1 { stop-color: var(--accent); stop-opacity: .28; }
.ch-s2 { stop-color: var(--accent); stop-opacity: 0; }
.ch-grid { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.ch-fail { stroke: var(--bad); stroke-width: 2; vector-effect: non-scaling-stroke; opacity: .8; }
.chart figcaption { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 6px; }

.tbl-wrap { overflow-x: auto; margin: 0 -4px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 520px; }
.tbl th { text-align: left; font-size: 12px; font-weight: 700; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
.tbl td.nw { white-space: nowrap; }                 /* дата, длительность, отметка — одной строкой */
.tbl td.nm { white-space: nowrap; }                 /* имя сайта целиком */
/* Аварии на телефоне — карточки: имя и отметка, ниже начало и длительность, ниже причина */
@media (max-width: 640px) {
  .tbl--inc { min-width: 0; }
  .tbl--inc thead { display: none; }
  .tbl--inc, .tbl--inc tbody { display: block; }
  .tbl--inc tr { display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "nm nm st" "dt du du" "why why why";
                 gap: 4px 8px; align-items: center; padding: 12px 2px; border-bottom: 1px solid var(--line); }
  .tbl--inc1 tr { grid-template-areas: "dt du st" "why why why"; }
  .tbl--inc td { display: block; border: 0; padding: 0; }
  .tbl--inc td.nm { grid-area: nm; font-weight: 650; overflow: hidden; text-overflow: ellipsis; }
  .tbl--inc td.st { grid-area: st; }
  .tbl--inc td.dt { grid-area: dt; color: var(--muted); font-size: 13px; }
  .tbl--inc td.du { grid-area: du; color: var(--muted); font-size: 13px; }
  .tbl--inc td.du::before { content: "· длилась "; }
  .tbl--inc td.why { grid-area: why; }
}
.tbl tr:last-child td { border-bottom: 0; }
.tbl small { color: var(--muted); }

.fl { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.fi { display: flex; gap: 10px; align-items: baseline; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); }
.fi span { overflow-wrap: anywhere; }
.fi small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.fi small.err { color: var(--bad-ink); }
.fi .dot { transform: translateY(1px); }

/* ── пульсы ────────────────────────────────────────────────────────────── */
.pulse-card .pc-head .row { border: 0; padding: 0 0 12px; background: none; box-shadow: none; }
.pulse-url { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 6px 0 12px; }
.pulse-url code { padding: 8px 10px; font-size: 13px; flex: 1 1 280px; }
.snips details { border: 1px solid var(--line); border-radius: 10px; margin: 8px 0; background: var(--surface-2); }
.snips summary { cursor: pointer; padding: 10px 12px; font-weight: 650; font-size: 14px; min-height: 44px; display: flex; align-items: center; }
.snips pre { margin: 0; padding: 0 12px 12px; overflow-x: auto; }
.snips pre code { display: block; background: none; border: 0; padding: 0; white-space: pre; font-size: 13px; }
.snips p { margin: 0 12px 12px; font-size: 13px; }
.howto { margin: 0; padding-left: 20px; display: grid; gap: 6px; }

/* ── управление: список, формы ────────────────────────────────────────── */
.head-act, .hero-act { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.hero .hero-act { grid-column: 1 / -1; position: relative; z-index: 1; }
@media (min-width: 700px) { .hero .hero-act { grid-column: auto; } }
form.inline { display: inline; margin: 0; }
.btn--danger { background: var(--bad-sub); color: var(--bad-ink); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--bad) 35%, transparent); }
.btn--danger:hover { filter: none; background: color-mix(in srgb, var(--bad) 20%, var(--surface)); }

.flash { display: flex; gap: 10px; align-items: center; padding: 12px 16px; border-radius: var(--r); margin: 0 0 14px;
         background: var(--ok-sub); color: var(--ok-ink); font-weight: 600; }
.errs { margin: 6px 0 0; padding-left: 18px; }
.errs li { margin: 2px 0; }

.mrow { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 12px 14px; border-radius: var(--r);
        background: var(--surface); border: 1px solid var(--line); align-items: center; }
.mrow-main { display: flex; gap: 12px; align-items: baseline; color: var(--ink); text-decoration: none; min-width: 0; }
.mrow-main > span { display: grid; min-width: 0; }
.mrow-main b { overflow-wrap: anywhere; }
.mrow-main .dot { flex: none; transform: translateY(1px); }
.mrow-what { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.mrow-act { display: flex; flex-wrap: wrap; gap: 6px; }
@media (max-width: 480px) { .mrow-act .btn--sm { padding: 0 10px; gap: 6px; } }
@media (min-width: 900px) { .mrow { grid-template-columns: minmax(0, 1fr) auto; } .mrow-act { justify-content: flex-end; } }

.form { display: grid; gap: 4px; }
.form.panel { max-width: 760px; }
.form .fld { margin-bottom: 10px; }
.fld em { font-style: normal; font-weight: 400; color: var(--muted); }
.fld small { font-weight: 400; color: var(--muted); font-size: 13px; }
.fld textarea, .fld select, .dur select { font: 15px/1.45 var(--font); padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line-2);
          background: var(--surface-2); color: var(--ink); width: 100%; min-height: 46px; }
.fld textarea { resize: vertical; }
.fld textarea:focus-visible, .fld select:focus-visible { border-color: var(--accent); }
.dur { display: flex; gap: 8px; }
.dur input { max-width: 120px; }
.dur select { max-width: 160px; }
.fs { border: 1px solid var(--line); border-radius: var(--r); padding: 10px 14px 4px; margin: 4px 0 12px; }
.fs legend { font-weight: 700; font-size: 14px; padding: 0 6px; color: var(--ink-2); }
.more { border: 1px dashed var(--line-2); border-radius: var(--r); padding: 0 14px; margin: 4px 0 12px; }
.more summary { cursor: pointer; font-weight: 650; min-height: 44px; display: flex; align-items: center; }
.more[open] { padding-bottom: 6px; }
.form-act { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.form-del { margin: 6px 0 0; }
.panel h3 { font-size: 15px; margin: 18px 0 8px; }
.panel h2 .ic { vertical-align: -3px; margin-right: 4px; }
.chan { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; margin: 0 0 10px; color: var(--ink-2); }
.chan small.err { flex-basis: 100%; color: var(--bad-ink); }
.found { display: grid; gap: 6px; margin: 8px 0; color: var(--ink-2); font-size: 14px; }
.found-row { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 8px 10px;
             border-radius: 10px; background: var(--surface-2); }
code.totp { font-size: 16px; letter-spacing: .06em; }
.pc-edit { margin: -4px 0 10px; font-size: 14px; }
.pc-edit a { color: var(--muted); text-decoration: none; }
.pc-edit a:hover { color: var(--ink); }

/* ── выпадающие списки ────────────────────────────────────────────────── */
.dd { position: relative; width: 100%; }
.dd--short { width: auto; min-width: 140px; }
.dd-native { position: absolute !important; opacity: 0; pointer-events: none; width: 1px !important; height: 1px !important;
             min-height: 0 !important; padding: 0 !important; border: 0 !important; left: 0; bottom: 0; }
.dd-btn, select { -webkit-appearance: none; appearance: none; }
.dd-btn { display: flex; align-items: center; width: 100%; min-height: 46px; padding: 10px 42px 10px 12px; text-align: left;
          font: 15px/1.3 var(--font); color: var(--ink); background: var(--surface-2); border: 1px solid var(--line-2);
          border-radius: 10px; cursor: pointer; position: relative; }
.dd-btn::after, .dd-toggle::after, .fld select, .dur select { --chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }
.dd-btn::after, .dd-toggle::after { content: ""; position: absolute; right: 14px; top: 50%; width: 16px; height: 16px; margin-top: -8px;
          background: var(--muted); -webkit-mask: var(--chev) center / contain no-repeat; mask: var(--chev) center / contain no-repeat;
          transition: transform .15s; }
.dd-btn[aria-expanded="true"]::after, .dd--combo input[aria-expanded="true"] + .dd-toggle::after { transform: rotate(180deg); }
.dd-btn:hover { border-color: var(--accent); }
.dd-btn[aria-expanded="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.dd--combo input { padding-right: 44px; }
.dd-toggle { position: absolute; right: 2px; top: 2px; bottom: 2px; width: 40px; border: 0; background: transparent; cursor: pointer;
             border-radius: 0 9px 9px 0; }
.dd-list { position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% + 6px); margin: 0; padding: 6px; list-style: none;
           max-height: 300px; overflow-y: auto; background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px;
           box-shadow: var(--shadow-lg, 0 12px 40px rgba(0, 0, 0, .25)); min-width: 180px; }
.dd-list.up { top: auto; bottom: calc(100% + 6px); }
.dd-list li { position: relative; padding: 10px 36px 10px 12px; border-radius: 8px; cursor: pointer; color: var(--ink);
              font-size: 15px; line-height: 1.3; }
.dd-list li:hover, .dd-list li.is-active { background: var(--surface-2); }
.dd-list li.is-active { box-shadow: inset 0 0 0 1px var(--line-2); }
.dd-list li[aria-selected="true"] { color: var(--accent); font-weight: 650; }
.dd-list li[aria-selected="true"]::after { content: ""; position: absolute; right: 12px; top: 50%; width: 16px; height: 16px; margin-top: -8px;
              background: var(--accent); --tick: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
              -webkit-mask: var(--tick) center / contain no-repeat; mask: var(--tick) center / contain no-repeat; }
/* Без скриптов — обычный select, но со своей стрелкой */
.fld select, .dur select { padding-right: 40px; background: var(--surface-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238e9db7' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center / 16px; }

/* ── инструкция ───────────────────────────────────────────────────────── */
.toc { display: grid; grid-template-columns: 1fr; gap: 2px 18px; }
.toc a { color: var(--ink-2); text-decoration: none; padding: 7px 4px; border-bottom: 1px solid var(--line); font-weight: 600; font-size: 14px; }
.toc a:hover { color: var(--accent); }
@media (min-width: 700px) { .toc { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1040px) { .toc { grid-template-columns: 1fr 1fr 1fr; } }
.guide-sec { scroll-margin-top: 120px; line-height: 1.6; }
.guide-sec h2 { font-size: 19px; }
.guide-sec p { margin: 0 0 12px; }
.gl { margin: 0 0 12px; padding-left: 22px; display: grid; gap: 8px; }
.gl .dot { vertical-align: -1px; margin: 0 2px; }
.gl .b { display: inline-block; width: 8px; height: 14px; vertical-align: -2px; margin: 0 2px; }
b.ui { font-weight: 650; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 6px; padding: 0 6px;
       white-space: nowrap; font-size: .94em; }
.ex { margin: 10px 0 12px; padding: 12px 14px; border-radius: var(--r); background: color-mix(in srgb, var(--accent) 8%, var(--surface-2));
      border-left: 3px solid var(--accent); }
.ex pre { margin: 8px 0; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
          overflow-x: auto; font: 13px/1.5 var(--mono); white-space: pre; }
.msg { display: grid; gap: 4px; padding: 10px 12px; border-radius: 12px 12px 12px 4px; background: var(--surface-2);
       border: 1px solid var(--line); font-size: 13px; line-height: 1.45; min-width: 220px; }
.msg span { color: var(--ink-2); }
.guide-sec code { white-space: nowrap; }      /* адрес или команда не рвутся посередине; длинное — в <pre> */
.tbl--guide td { overflow-wrap: break-word; }
.tbl--guide { min-width: 640px; }
.tbl--guide td { line-height: 1.5; }
/* Телефон: таблица инструкции — стопка карточек, у каждой ячейки своя подпись */
@media (max-width: 640px) {
  .tbl--guide { min-width: 0; }
  .tbl--guide thead { display: none; }
  .tbl--guide, .tbl--guide tbody, .tbl--guide tr, .tbl--guide td { display: block; width: 100%; }
  .tbl--guide tr { padding: 10px 0; border-bottom: 1px solid var(--line); }
  .tbl--guide td { border: 0; padding: 3px 4px; }
  .tbl--guide td::before { content: attr(data-h); display: block; font-size: 12px; font-weight: 700; color: var(--muted); }
  b.ui { white-space: normal; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
}
.warnline { padding: 10px 12px; border-radius: 10px; background: var(--warn-sub); color: var(--ink); }
.totop { margin: 4px 0 0 !important; font-size: 13px; }
.totop a { color: var(--muted); text-decoration: none; }

/* ── вход ──────────────────────────────────────────────────────────────── */
/* Фон — медленное «северное сияние» в цветах логотипа поверх тонкой сетки; карточка — стекло с градиентной кромкой */
body.is-auth { --aurora-a: rgba(56, 189, 248, .30); --aurora-b: rgba(34, 197, 94, .22); --aurora-c: rgba(99, 102, 241, .22);
               --grid: rgba(15, 23, 42, .06); }
:root[data-theme="dark"] body.is-auth { --aurora-a: rgba(56, 189, 248, .22); --aurora-b: rgba(34, 197, 94, .16);
                                        --aurora-c: rgba(99, 102, 241, .20); --grid: rgba(148, 163, 184, .07); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body.is-auth { --aurora-a: rgba(56, 189, 248, .22); --aurora-b: rgba(34, 197, 94, .16);
                                                 --aurora-c: rgba(99, 102, 241, .20); --grid: rgba(148, 163, 184, .07); }
}
body.is-auth .foot { display: none; }
.auth { min-height: calc(100vh - 48px); min-height: calc(100dvh - 48px); display: grid; place-items: center; padding: 8px 0 24px; }
.auth-bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.auth-bg::before { content: ""; position: absolute; inset: -25%;
                   background: radial-gradient(34% 30% at 22% 28%, var(--aurora-a), transparent 70%),
                               radial-gradient(30% 28% at 78% 22%, var(--aurora-b), transparent 70%),
                               radial-gradient(38% 34% at 62% 82%, var(--aurora-c), transparent 70%);
                   filter: blur(24px); animation: aurora 26s ease-in-out infinite alternate; }
.auth-bg::after { content: ""; position: absolute; inset: 0;
                  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
                  background-size: 44px 44px;
                  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 45%, #000 25%, transparent 75%);
                  mask-image: radial-gradient(ellipse 70% 60% at 50% 45%, #000 25%, transparent 75%); }
@keyframes aurora { 0% { transform: translate3d(0, 0, 0) rotate(0deg) scale(1); }
                    100% { transform: translate3d(4%, -3%, 0) rotate(10deg) scale(1.1); } }
.auth-card { position: relative; z-index: 1; width: 100%; max-width: 410px; padding: 30px 28px 22px; border-radius: 24px;
             background: color-mix(in srgb, var(--surface) 84%, transparent);
             -webkit-backdrop-filter: blur(18px) saturate(140%); backdrop-filter: blur(18px) saturate(140%);
             border: 1px solid color-mix(in srgb, var(--line-2) 70%, transparent);
             box-shadow: 0 30px 80px -28px rgba(2, 6, 23, .55), inset 0 1px 0 rgba(255, 255, 255, .06); }
.auth-card::before { content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none;
                     background: linear-gradient(145deg, rgba(56, 189, 248, .7), rgba(34, 197, 94, .35) 32%, transparent 58%);
                     -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
                     -webkit-mask-composite: xor; mask-composite: exclude; }
.auth-head { text-align: center; }
.auth-mark { position: relative; width: 68px; height: 68px; margin: 0 auto 16px; display: grid; place-items: center; border-radius: 22px;
             background: linear-gradient(160deg, color-mix(in srgb, #38bdf8 18%, var(--surface-2)), var(--surface-2));
             border: 1px solid var(--line-2); box-shadow: 0 12px 30px -12px rgba(56, 189, 248, .55); }
.auth-mark .logo { width: 42px; height: 42px; }
.auth-mark::after { content: ""; position: absolute; inset: -7px; border-radius: 27px; border: 1.5px solid rgba(56, 189, 248, .5);
                    opacity: 0; animation: auth-ring 3.2s ease-out infinite; }
@keyframes auth-ring { 0% { transform: scale(.9); opacity: .8; } 100% { transform: scale(1.3); opacity: 0; } }
.auth-head h1 { font-size: 25px; font-weight: 800; letter-spacing: -.01em; margin: 0; }
.auth-head p { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.auth-pulse { display: block; width: 100%; height: 26px; margin: 12px 0 16px; overflow: visible; }
.auth-pulse path { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.auth-pulse-base { stroke: color-mix(in srgb, var(--accent) 22%, var(--line)); }
.auth-pulse-beat { stroke: url(#ap); stroke-width: 2.6; stroke-dasharray: 30 100; stroke-dashoffset: 30; animation: auth-beat 3.4s linear infinite;
                   filter: drop-shadow(0 0 4px rgba(56, 189, 248, .7)); }
@keyframes auth-beat { 0% { stroke-dashoffset: 30; } 100% { stroke-dashoffset: -100; } }
.auth-form .fld { margin-bottom: 14px; }
.inp { position: relative; display: block; }
.inp > .ic { position: absolute; left: 14px; top: 50%; width: 18px; height: 18px; margin-top: -9px; color: var(--muted);
             pointer-events: none; transition: color .15s; }
.inp:focus-within > .ic { color: var(--accent); }
.fld .inp input { padding-left: 44px; min-height: 50px; border-radius: 12px; font-weight: 500; }
.fld .inp--pw input { padding-right: 50px; }
.fld .inp input:focus-visible { outline: none; border-color: var(--accent);
                                box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); }
.inp-eye { position: absolute; right: 6px; top: 50%; width: 38px; height: 38px; margin-top: -19px; display: grid; place-items: center;
           border: 0; border-radius: 9px; background: transparent; color: var(--muted); cursor: pointer; }
.inp-eye[hidden] { display: none; }
.inp-eye:hover { color: var(--ink); background: var(--surface); }
.inp-eye .ic { width: 18px; height: 18px; }
.inp-eye .ic-off, .inp-eye[aria-pressed="true"] .ic-on { display: none; }
.inp-eye[aria-pressed="true"] .ic-off { display: block; }
.caps { display: flex; align-items: center; gap: 8px; margin: -6px 0 12px; font-size: 13px; font-weight: 600; color: var(--warn-ink); }
.caps[hidden] { display: none; }
.caps .ic { width: 16px; height: 16px; }
.auth-form .chk input { accent-color: var(--btn); }
.btn--auth { min-height: 50px; border-radius: 12px; font-size: 16px; gap: 10px; border: 0;
             background: linear-gradient(135deg, #2563eb, #0ea5e9 55%, #10b981); color: #fff;
             box-shadow: 0 10px 24px -10px rgba(14, 165, 233, .8); transition: transform .15s, box-shadow .15s, filter .15s; }
.btn--auth:hover { filter: brightness(1.06); box-shadow: 0 14px 30px -10px rgba(14, 165, 233, .9); }
.btn--auth:active { transform: translateY(1px); }
.btn--auth .ic { transition: transform .2s; }
.btn--auth:hover .ic { transform: translateX(3px); }
.btn--auth[aria-busy="true"] { pointer-events: none; filter: saturate(.7); }
.btn--auth[aria-busy="true"] .ic { animation: auth-go .8s ease-in-out infinite alternate; }
@keyframes auth-go { to { transform: translateX(5px); } }
.auth-trust { margin: 18px 0 0; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12.5px;
              text-align: center; text-wrap: balance; }
.auth-trust .ic { display: inline-block; width: 15px; height: 15px; margin-right: 6px; vertical-align: -3px; color: var(--ok); }
.login-err { display: flex; align-items: flex-start; gap: 9px; background: var(--bad-sub); color: var(--bad-ink); padding: 11px 13px;
             border-radius: 12px; margin: 0 0 14px; font-size: 14px; font-weight: 600; animation: auth-shake .4s ease-in-out; }
.login-err .ic { width: 18px; height: 18px; flex: none; margin-top: 1px; }
@keyframes auth-shake { 20%, 60% { transform: translateX(-4px); } 40%, 80% { transform: translateX(4px); } }
@media (max-width: 420px) {
  .auth-card { padding: 24px 18px 18px; border-radius: 20px; }
  .auth-head h1 { font-size: 22px; }
}
.fld { display: grid; gap: 6px; margin-bottom: 12px; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.fld input { font: 16px var(--font); padding: 11px 12px; border-radius: 10px; border: 1px solid var(--line-2);
             background: var(--surface-2); color: var(--ink); min-height: 46px; width: 100%; }
.fld input:focus-visible { border-color: var(--accent); }
.chk { display: flex; gap: 10px; align-items: center; margin: 6px 0 16px; font-size: 14px; color: var(--ink-2); min-height: 32px; }
.chk input { width: 18px; height: 18px; }

/* ── всплывашка ────────────────────────────────────────────────────────── */
.toast { visibility: hidden; position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 140%); max-width: calc(100% - 32px);
         background: var(--ink); color: var(--bg); padding: 12px 16px; border-radius: 12px; font-weight: 600; font-size: 14px;
         box-shadow: var(--shadow); transition: transform .25s ease; z-index: 60; }
.toast.is-on { visibility: visible; transform: translate(-50%, 0); }
.toast--bad { background: var(--bad); color: #fff; }

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