/* Панель ЛИДОХОД — дизайн-система и экраны. Цвета только токенами на :root; тёмная тема — prefers-color-scheme
   и переключатель (data-theme на <html>, ставит assets/theme.js до отрисовки). Анимации — только transform/opacity. */
:root {
  --font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --bg: #f3f3f6; --panel: #fbfbfc; --surface: #ffffff; --surface-2: #f7f7f9; --hover: #f0f0f4; --press: #e8e8ee;
  --border: #e6e6eb; --border-2: #d6d6de; --text: #15151b; --text-2: #494955; --muted: #7c7c88;
  --accent: #4f46e5; --accent-2: #4338ca; --accent-soft: #eeedfd; --accent-ring: rgba(79, 70, 229, .26); --on-accent: #fff;
  --ok: #16a34a; --ok-soft: #e7f6ec; --warn: #d97706; --warn-soft: #fdf3e2; --crit: #dc2626; --crit-soft: #fdeded; --off: #a4a4ae;
  --up: #15803d; --down: #dc2626;
  --viz-1: #4f46e5; --viz-2: #12a594; --viz-grid: #ededf1; --viz-area: rgba(79, 70, 229, .10); --viz-area-2: rgba(18, 165, 148, .08);
  --lq-sent: #4f46e5; --lq-hold: #d97706; --lq-queue: #8b8bd8; --lq-dup: #a4a4ae; --lq-failed: #dc2626; --lq-skipped: #cfcfd8; --lq-none: #7f1d1d;
  --sk: #ececf1; --sk-hi: rgba(255, 255, 255, .75);
  --shadow-1: 0 1px 2px rgba(20, 20, 32, .04);
  --shadow-pop: 0 1px 2px rgba(20, 20, 32, .05), 0 8px 24px -6px rgba(20, 20, 32, .12), 0 28px 56px -16px rgba(20, 20, 32, .18);
  --scrim: rgba(18, 18, 28, .28);
  --r: 10px; --r-sm: 8px; --r-xs: 6px; --ease: cubic-bezier(.2, .8, .2, 1); --t: 200ms;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0b0e; --panel: #111115; --surface: #17171c; --surface-2: #1b1b21; --hover: #1f1f26; --press: #26262e;
    --border: #25252d; --border-2: #33333d; --text: #ececf1; --text-2: #b6b6c2; --muted: #85858f;
    --accent: #8580ff; --accent-2: #9d99ff; --accent-soft: rgba(133, 128, 255, .14); --accent-ring: rgba(133, 128, 255, .32); --on-accent: #0b0b12;
    --ok: #22c55e; --ok-soft: rgba(34, 197, 94, .12); --warn: #f59e0b; --warn-soft: rgba(245, 158, 11, .12); --crit: #f87171; --crit-soft: rgba(248, 113, 113, .12); --off: #62626c;
    --up: #4ade80; --down: #f87171;
    --viz-1: #8580ff; --viz-2: #1a9e8a; --viz-grid: #23232a; --viz-area: rgba(133, 128, 255, .12); --viz-area-2: rgba(26, 158, 138, .10);
    --lq-sent: #8580ff; --lq-hold: #f59e0b; --lq-queue: #5b5ba8; --lq-dup: #62626c; --lq-failed: #f87171; --lq-skipped: #3a3a44; --lq-none: #fca5a5;
    --sk: #1e1e25; --sk-hi: rgba(255, 255, 255, .05);
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-pop: 0 1px 2px rgba(0, 0, 0, .4), 0 12px 32px -8px rgba(0, 0, 0, .6), 0 32px 64px -16px rgba(0, 0, 0, .6);
    --scrim: rgba(0, 0, 0, .55); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b0b0e; --panel: #111115; --surface: #17171c; --surface-2: #1b1b21; --hover: #1f1f26; --press: #26262e;
  --border: #25252d; --border-2: #33333d; --text: #ececf1; --text-2: #b6b6c2; --muted: #85858f;
  --accent: #8580ff; --accent-2: #9d99ff; --accent-soft: rgba(133, 128, 255, .14); --accent-ring: rgba(133, 128, 255, .32); --on-accent: #0b0b12;
  --ok: #22c55e; --ok-soft: rgba(34, 197, 94, .12); --warn: #f59e0b; --warn-soft: rgba(245, 158, 11, .12); --crit: #f87171; --crit-soft: rgba(248, 113, 113, .12); --off: #62626c;
  --up: #4ade80; --down: #f87171;
  --viz-1: #8580ff; --viz-2: #1a9e8a; --viz-grid: #23232a; --viz-area: rgba(133, 128, 255, .12); --viz-area-2: rgba(26, 158, 138, .10);
  --lq-sent: #8580ff; --lq-hold: #f59e0b; --lq-queue: #5b5ba8; --lq-dup: #62626c; --lq-failed: #f87171; --lq-skipped: #3a3a44; --lq-none: #fca5a5;
  --sk: #1e1e25; --sk-hi: rgba(255, 255, 255, .05);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-pop: 0 1px 2px rgba(0, 0, 0, .4), 0 12px 32px -8px rgba(0, 0, 0, .6), 0 32px 64px -16px rgba(0, 0, 0, .6);
  --scrim: rgba(0, 0, 0, .55); color-scheme: dark;
}

/* ---------- основа ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
h1, h2, h3, h4, p { margin: 0; }
h1 { font-size: 24px; line-height: 32px; font-weight: 600; letter-spacing: -.015em; }
h2 { font-size: 16px; line-height: 24px; font-weight: 600; letter-spacing: -.005em; }
h3 { font-size: 14px; line-height: 20px; font-weight: 600; }
a { color: var(--accent); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--accent-soft); }
.num, td, .tabular { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); } .t2 { color: var(--text-2); } .small { font-size: 12.5px; line-height: 18px; }
.ico { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ico.lg { width: 20px; height: 20px; } .ico.xl { width: 28px; height: 28px; stroke-width: 1.5; }
.row { display: flex; align-items: center; gap: 8px; } .grow { flex: 1; min-width: 0; } .wrap { flex-wrap: wrap; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
[hidden] { display: none !important; }

/* ---------- оболочка: навигация слева + панель контента ---------- */
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 14px 10px 12px; gap: 2px; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; font-weight: 700; letter-spacing: .08em; font-size: 14.5px; }
.brand svg { width: 26px; height: 26px; border-radius: 7px; box-shadow: 0 1px 2px rgba(79, 70, 229, .35); }
.nav { position: relative; display: flex; flex-direction: column; gap: 1px; }
.nav-ind { position: absolute; left: 0; right: 0; top: 0; height: 32px; border-radius: var(--r-sm); background: var(--surface); box-shadow: var(--shadow-1), inset 0 0 0 1px var(--border); transition: transform 260ms var(--ease), opacity 150ms; pointer-events: none; }
.nav a { position: relative; z-index: 1; display: flex; align-items: center; gap: 10px; height: 32px; padding: 0 10px; border-radius: var(--r-sm); color: var(--text-2); font-weight: 500; transition: color 150ms, background-color 150ms; }
.nav a:hover { color: var(--text); background: rgba(127, 127, 150, .08); }
.nav a.on { color: var(--text); }
.nav a.on:hover { background: transparent; }
.nav a .ico { color: var(--muted); transition: color 150ms; } .nav a.on .ico { color: var(--accent); }
.nav .sub { height: 30px; padding-left: 36px; font-weight: 450; font-size: 13.5px; }
.nav .sub .lamp { margin-left: auto; }
.nav-sep { height: 1px; background: var(--border); margin: 10px 8px; }
.side-foot { margin-top: auto; display: flex; align-items: center; gap: 8px; padding: 10px 6px 0; border-top: 1px solid var(--border); }
.avatar { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 600; color: var(--accent); background: var(--accent-soft); flex: none; }
.who { min-width: 0; line-height: 16px; } .who b { display: block; font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .who span { font-size: 12px; color: var(--muted); }
.iconbtn { display: inline-grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--muted); transition: background-color 150ms, color 150ms, transform 150ms; }
.iconbtn:hover { background: var(--hover); color: var(--text); } .iconbtn:active { transform: scale(.94); }
.main { min-width: 0; margin: 8px 8px 8px 0; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; min-height: calc(100vh - 16px); }
.page { max-width: 1080px; margin: 0 auto; padding: 32px 40px 72px; }
.page.enter { animation: page-in 220ms var(--ease) both; }
@keyframes page-in { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
.crumbs { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; margin-bottom: 8px; }
.crumbs a { color: var(--muted); } .crumbs a:hover { color: var(--text); } .crumbs .ico { width: 12px; height: 12px; }
.head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 24px; }
.head .lead { color: var(--text-2); margin-top: 4px; max-width: 720px; }
.head .meta { color: var(--muted); font-size: 12.5px; margin-top: 8px; display: flex; flex-wrap: wrap; gap: 4px 14px; }
.head-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }

/* ---------- кнопки ---------- */
.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 34px; padding: 0 14px; border-radius: var(--r-sm); border: 1px solid var(--border-2); background: var(--surface); color: var(--text); font-weight: 500; white-space: nowrap; transition: background-color 150ms, border-color 150ms, color 150ms, box-shadow 150ms, transform 120ms; box-shadow: var(--shadow-1); }
.btn:hover { background: var(--surface-2); border-color: var(--border-2); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn:disabled { opacity: .5; cursor: default; transform: none; }
.btn.primary { background: var(--accent); border-color: transparent; color: var(--on-accent); box-shadow: 0 1px 2px rgba(79, 70, 229, .3), inset 0 1px 0 rgba(255, 255, 255, .12); }
.btn.primary:hover:not(:disabled) { background: var(--accent-2); }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--text-2); }
.btn.ghost:hover { background: var(--hover); color: var(--text); }
.btn.danger { color: var(--crit); } .btn.danger.solid { background: var(--crit); color: #fff; border-color: transparent; }
.btn.sm { height: 28px; padding: 0 10px; font-size: 13px; border-radius: var(--r-xs); }
.btn .ico { width: 15px; height: 15px; }
.btn.busy { color: transparent !important; } .btn.busy::after { content: ""; position: absolute; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-color: var(--muted) transparent var(--muted) transparent; animation: spin .7s linear infinite; }
.btn.primary.busy::after { border-color: rgba(255, 255, 255, .9) transparent rgba(255, 255, 255, .9) transparent; }
.btn .done { position: absolute; inset: 0; display: grid; place-items: center; background: inherit; border-radius: inherit; }
.btn .done path { stroke-dasharray: 24; stroke-dashoffset: 24; animation: draw 320ms var(--ease) forwards; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
.link { border: 0; background: none; padding: 0; color: var(--accent); font-weight: 500; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; } .link.danger { color: var(--crit); }

/* ---------- карточки, плашки, пилюли ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow-1); }
.card-pad { padding: 20px 24px; }
.card-head { display: flex; align-items: center; gap: 12px; padding: 16px 24px; border-bottom: 1px solid var(--border); }
.card-head .sub { color: var(--muted); font-size: 12.5px; }
.card-foot { display: flex; align-items: center; gap: 10px; padding: 14px 24px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--r) var(--r); flex-wrap: wrap; }
.stack > * + * { margin-top: 16px; }
.callout { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); font-size: 13px; line-height: 19px; }
.callout .ico { margin-top: 1px; color: var(--muted); }
.callout.warn { background: var(--warn-soft); border-color: transparent; color: var(--text); } .callout.warn .ico { color: var(--warn); }
.callout.crit { background: var(--crit-soft); border-color: transparent; color: var(--text); } .callout.crit .ico { color: var(--crit); }
.callout.ok { background: var(--ok-soft); border-color: transparent; color: var(--text); } .callout.ok .ico { color: var(--ok); }
.callout.info { background: var(--accent-soft); border-color: transparent; color: var(--text); } .callout.info .ico { color: var(--accent); }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 500; background: var(--hover); color: var(--text-2); white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); } .pill.warn { background: var(--warn-soft); color: var(--warn); } .pill.crit { background: var(--crit-soft); color: var(--crit); }
.pill.accent { background: var(--accent-soft); color: var(--accent); }
.kbd { font: 12px/1 ui-monospace, SFMono-Regular, Consolas, monospace; padding: 2px 6px; border-radius: 5px; background: var(--hover); color: var(--text-2); }
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 56px 24px; gap: 8px; }
.empty .ico-wrap { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); margin-bottom: 8px; }
.empty p { color: var(--muted); max-width: 420px; }
.empty .btn { margin-top: 12px; }

/* ---------- лампы ---------- */
/* Лампы: зелёная работает, жёлтая не настроено, красная ошибка или молчит, серая залитая — выключен,
   полое кольцо — ещё не проверялся. Дышат только лампы с .pulse (сайдбар и шапка блока): в таблицах и пилюлях — статичные. */
.lamp { position: relative; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--off); flex: none; }
.lamp.ok { background: var(--ok); } .lamp.warn { background: var(--warn); } .lamp.crit { background: var(--crit); }
.lamp.unknown { background: transparent; box-shadow: inset 0 0 0 1.5px var(--off); }
/* «идёт» (подключение, первичная загрузка): нейтральная лампа цвета акцента, дышит — не жёлтая «не настроено» */
.lamp.run { background: var(--accent); }
.lamp.pulse.run::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--accent); animation: pulse 1.6s ease-out infinite; }
.lamp.lg { width: 10px; height: 10px; }
.lamp.pulse.ok::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--ok); animation: pulse 3s ease-out infinite; }
.lamp.pulse.crit { animation: flicker 1.8s ease-in-out infinite; }
@keyframes pulse { 0% { transform: scale(1); opacity: .25; } 70%, 100% { transform: scale(1.8); opacity: 0; } }
@keyframes flicker { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--muted); font-size: 12.5px; margin: -12px 0 20px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.status { display: inline-flex; align-items: center; gap: 8px; }

/* ---------- вкладки с подчёркиванием и сегменты с плашкой ---------- */
.tabs { position: relative; display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 24px; overflow-x: auto; scrollbar-width: none; }
.tabs button { position: relative; height: 40px; padding: 0 10px; border: 0; background: none; color: var(--muted); font-weight: 500; white-space: nowrap; display: inline-flex; align-items: center; gap: 7px; transition: color 150ms; }
.tabs button:hover { color: var(--text); }
.tabs button.on { color: var(--text); }
.tabs button.planned { color: var(--off); }
.tabs button .pill { height: 18px; font-size: 11px; padding: 0 6px; }
.tabs .tabs-more { color: var(--text-2); flex: none; } .tabs .tabs-more .ico { width: 13px; height: 13px; }
.tabs-ind { position: absolute; left: 0; bottom: -1px; height: 2px; width: 100px; background: var(--accent); border-radius: 2px; transform-origin: 0 0; transition: transform 240ms var(--ease); pointer-events: none; }
.seg { position: relative; display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--hover); border: 1px solid var(--border); }
.seg button { position: relative; z-index: 1; height: 28px; padding: 0 12px; border: 0; border-radius: 7px; background: none; color: var(--text-2); font-weight: 500; white-space: nowrap; transition: color 150ms; display: inline-flex; align-items: center; gap: 6px; }
.seg button:hover { color: var(--text); } .seg button.on { color: var(--text); }
.seg-ind { position: absolute; top: 3px; left: 0; height: 28px; width: 100px; border-radius: 7px; background: var(--surface); box-shadow: 0 1px 2px rgba(20, 20, 32, .08), 0 0 0 1px var(--border); transform-origin: 0 0; transition: transform 240ms var(--ease); }

/* ---------- формы ---------- */
.form { padding: 24px; display: grid; gap: 22px; }
.field { display: grid; gap: 6px; min-width: 0; }
.f-top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.f-label { font-weight: 500; color: var(--text); font-size: 13.5px; }
.f-meta { margin-left: auto; color: var(--muted); font-size: 12px; white-space: nowrap; }
.f-help { color: var(--muted); font-size: 12.5px; line-height: 18px; max-width: 640px; }
.f-err { color: var(--crit); font-size: 12.5px; line-height: 18px; display: flex; gap: 6px; align-items: flex-start; animation: fade-up 180ms var(--ease); }
.f-err .ico { width: 14px; height: 14px; margin-top: 2px; }
.f-lock { color: var(--muted); font-size: 12px; display: inline-flex; align-items: flex-start; gap: 5px; }
.f-top .f-lock { order: 3; flex-basis: 100%; }   /* причина «только чтение» — отдельной строкой под подписью, не сжимает её */
.f-lock .ico { flex: none; margin-top: 2px; }
.f-lock .ico { width: 13px; height: 13px; }
.f-danger { font-size: 12.5px; color: var(--warn); display: flex; gap: 6px; } .f-danger .ico { width: 14px; height: 14px; margin-top: 2px; }
@keyframes fade-up { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }
.inp { width: 100%; height: 36px; padding: 0 12px; border: 1px solid var(--border-2); border-radius: var(--r-sm); background: var(--surface); color: var(--text); transition: border-color 150ms, box-shadow 150ms; }
.inp::placeholder { color: var(--muted); opacity: .8; }
.inp:hover { border-color: color-mix(in srgb, var(--border-2) 60%, var(--text) 20%); }
.inp:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.inp:disabled { background: var(--surface-2); color: var(--text-2); cursor: default; }
textarea.inp { height: auto; min-height: 88px; padding: 9px 12px; line-height: 20px; resize: vertical; }
.bad .inp, .inp.bad { border-color: var(--crit); } .bad .inp:focus { box-shadow: 0 0 0 3px var(--crit-soft); }
.dirty .f-label::after { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-left: 8px; vertical-align: 2px; animation: pop 200ms var(--ease); }
@keyframes pop { from { transform: scale(0); } to { transform: scale(1); } }
.inp-group { display: flex; align-items: stretch; max-width: 280px; }
.inp-group .inp { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.inp-group .unit { display: grid; place-items: center; padding: 0 12px; border: 1px solid var(--border-2); border-left: 0; border-radius: 0 var(--r-sm) var(--r-sm) 0; background: var(--surface-2); color: var(--muted); font-size: 13px; white-space: nowrap; }
.inp.short { max-width: 280px; } .inp.mid { max-width: 440px; }
.sel { position: relative; max-width: 440px; }
.sel select { appearance: none; -webkit-appearance: none; padding-right: 34px; cursor: pointer; }
.sel .ico { position: absolute; right: 10px; top: 50%; margin-top: -8px; color: var(--muted); pointer-events: none; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .tr { position: relative; width: 34px; height: 20px; border-radius: 999px; background: var(--border-2); transition: background-color 200ms var(--ease); flex: none; }
.switch .tr::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); transition: transform 200ms var(--ease); }
.switch input:checked + .tr { background: var(--accent); } .switch input:checked + .tr::after { transform: translateX(14px); }
.switch input:focus-visible + .tr { box-shadow: 0 0 0 3px var(--accent-ring); }
.switch input:disabled + .tr { opacity: .5; } .switch.disabled { cursor: default; }
.modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; max-width: 640px; }
.mode { position: relative; display: grid; gap: 2px; padding: 12px 14px 12px 38px; border: 1px solid var(--border-2); border-radius: var(--r); background: var(--surface); cursor: pointer; transition: border-color 150ms, background-color 150ms, box-shadow 150ms; }
.mode:hover { border-color: var(--muted); }
.mode input { position: absolute; opacity: 0; }
.mode::before { content: ""; position: absolute; left: 14px; top: 15px; width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--border-2); background: var(--surface); transition: border-color 150ms, border-width 150ms; }
.mode.on { border-color: var(--accent); background: var(--accent-soft); } .mode.on::before { border: 4.5px solid var(--accent); }
.mode.live.on { border-color: var(--ok); background: var(--ok-soft); } .mode.live.on::before { border-color: var(--ok); }
.mode b { font-weight: 600; font-size: 13.5px; } .mode span { color: var(--text-2); font-size: 12.5px; line-height: 17px; }
.mode.disabled { cursor: default; opacity: .75; }
.mode.blocked { cursor: not-allowed; background: var(--surface-2); border-style: dashed; }
.mode.blocked:hover { border-color: var(--border-2); }
.mode.blocked span { color: var(--warn); }
.ro-val { display: grid; gap: 2px; max-width: 640px; }
.ro-val b { font-weight: 600; font-size: 14px; } .ro-val span { color: var(--text-2); font-size: 12.5px; line-height: 17px; }
.ro-note { display: flex; gap: 8px; align-items: flex-start; color: var(--muted); font-size: 12.5px; line-height: 18px; margin-top: 4px; }
.ro-note .ico { width: 13px; height: 13px; margin-top: 2px; flex: none; }
.drawer .modes { grid-template-columns: 1fr; }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.chk { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px; border: 1px solid var(--border-2); border-radius: 999px; cursor: pointer; font-size: 13px; transition: all 150ms; background: var(--surface); }
.chk input { position: absolute; opacity: 0; }
.chk .ico { width: 14px; height: 14px; opacity: 0; transform: scale(.6); transition: opacity 150ms, transform 150ms; margin-left: -4px; }
.chk.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); } .chk.on .ico { opacity: 1; transform: none; }
.hours { display: grid; gap: 10px; max-width: 440px; }
.hours-bar { position: relative; height: 8px; border-radius: 4px; background: var(--hover); overflow: hidden; }
.hours-bar i { position: absolute; top: 0; bottom: 0; left: 0; width: 100%; background: var(--accent); border-radius: 4px; transform-origin: 0 0; transition: transform 240ms var(--ease); }
.hours-scale { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; }
.ph-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ph-chips button { height: 24px; padding: 0 8px; border-radius: 6px; border: 1px dashed var(--border-2); background: none; font: 12px ui-monospace, SFMono-Regular, Consolas, monospace; color: var(--text-2); }
.ph-chips button:hover { border-color: var(--accent); color: var(--accent); }
.preview { padding: 10px 12px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--border); font-size: 13px; color: var(--text-2); white-space: pre-wrap; }
.secret { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface-2); max-width: 640px; flex-wrap: wrap; }
.secret .s-ico { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--border); color: var(--muted); }
.secret.set .s-ico { color: var(--ok); }
.secret .s-txt { flex: 1; min-width: 180px; line-height: 18px; } .secret .s-txt b { font-weight: 500; } .secret .s-txt div { color: var(--muted); font-size: 12.5px; }
.secret-edit { display: flex; gap: 8px; max-width: 640px; animation: fade-up 180ms var(--ease); }
.periods { display: grid; gap: 4px; max-width: 440px; font-size: 12.5px; }
.periods div { display: flex; gap: 8px; color: var(--text-2); } .periods div b { font-weight: 500; color: var(--text); min-width: 80px; }
.dated { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.dated .inp[type="date"] { width: 160px; }
details.adv { border-top: 1px solid var(--border); margin: 0 -24px; padding: 0 24px; }
details.adv summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 6px; padding: 14px 0 0; color: var(--text-2); font-weight: 500; font-size: 13px; }
details.adv summary::-webkit-details-marker { display: none; }
details.adv summary .ico { width: 14px; height: 14px; transition: transform 200ms var(--ease); }
details.adv[open] summary .ico { transform: rotate(90deg); }
details.adv .adv-body { display: grid; gap: 22px; padding: 18px 0 4px; animation: fade-up 200ms var(--ease); }
.planned-card { opacity: .72; }
.test-res { display: flex; gap: 10px; align-items: flex-start; width: 100%; padding: 10px 12px; border-radius: var(--r-sm); font-size: 13px; line-height: 19px; animation: expand 240ms var(--ease); transform-origin: top; }
.test-res.ok { background: var(--ok-soft); } .test-res.bad { background: var(--crit-soft); }
.test-res .mark { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; flex: none; color: #fff; }
.test-res.ok .mark { background: var(--ok); } .test-res.bad .mark { background: var(--crit); }
.test-res .mark .ico { width: 12px; height: 12px; stroke-width: 2.6; }
.test-res .mark path { stroke-dasharray: 24; stroke-dashoffset: 24; animation: draw 360ms 80ms var(--ease) forwards; }
.test-res small { display: block; color: var(--muted); font-size: 12px; }
@keyframes expand { from { opacity: 0; transform: translateY(-4px) scaleY(.96); } to { opacity: 1; transform: none; } }
.savebar { position: sticky; bottom: 16px; z-index: 5; display: flex; align-items: center; gap: 10px; margin-top: 16px; padding: 10px 12px 10px 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-pop); animation: bar-in 240ms var(--ease); }
.savebar .grow { color: var(--text-2); font-size: 13px; }
@keyframes bar-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ---------- таблицы и реестры ---------- */
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.tbl th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12px; padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--surface-2); }
.tbl th:first-child { padding-left: 24px; border-top-left-radius: var(--r); } .tbl th:last-child { padding-right: 24px; border-top-right-radius: var(--r); }
.tbl td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl td:first-child { padding-left: 24px; } .tbl td:last-child { padding-right: 24px; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background-color 120ms; } .tbl tbody tr.click { cursor: pointer; } .tbl tbody tr:hover { background: var(--surface-2); }
.tbl .r { text-align: right; } .tbl .nowrap { white-space: nowrap; }
.tbl .t-main { font-weight: 500; } .tbl .t-sub { color: var(--muted); font-size: 12px; }
.tbl tr.off td { color: var(--muted); } .tbl tr.enter { animation: row-in 360ms var(--ease); }
@keyframes row-in { from { background: var(--accent-soft); } to { background: transparent; } }
.acts { display: flex; gap: 4px; justify-content: flex-end; }
.toolbar { display: flex; align-items: center; gap: 10px; padding: 14px 24px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.toolbar h2 { margin-right: 4px; } .toolbar .count { color: var(--muted); font-size: 13px; }
.menu { position: fixed; z-index: 60; min-width: 200px; padding: 4px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-pop); animation: pop-in 160ms var(--ease); transform-origin: top right; }
.menu button { display: flex; width: 100%; align-items: center; gap: 9px; height: 32px; padding: 0 10px; border: 0; border-radius: 6px; background: none; text-align: left; color: var(--text); }
.menu button:hover { background: var(--hover); } .menu button.danger { color: var(--crit); } .menu hr { border: 0; border-top: 1px solid var(--border); margin: 4px; }
.menu button .ico { color: var(--muted); } .menu button.danger .ico { color: var(--crit); }
@keyframes pop-in { from { opacity: 0; transform: scale(.97) translateY(-4px); } to { opacity: 1; transform: none; } }

/* ---------- модалки, выезжающая панель, тосты ---------- */
.scrim { position: fixed; inset: 0; z-index: 50; background: var(--scrim); animation: fade 200ms ease-out; }
.scrim.out { opacity: 0; transition: opacity 180ms ease-in; }
@keyframes fade { from { opacity: 0; } }
.modal-wrap { position: fixed; inset: 0; z-index: 51; display: grid; place-items: center; padding: 24px; }
.modal { width: min(560px, 100%); max-height: calc(100vh - 48px); overflow: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-pop); animation: modal-in 200ms var(--ease); }
.modal.out { opacity: 0; transform: scale(.98); transition: opacity 150ms ease-in, transform 150ms ease-in; }
@keyframes modal-in { from { opacity: 0; transform: scale(.98) translateY(4px); } to { opacity: 1; transform: none; } }
.modal-head { padding: 22px 24px 0; } .modal-head p { color: var(--text-2); margin-top: 6px; }
.modal-body { padding: 18px 24px; display: grid; gap: 16px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 24px 20px; }
.modal.danger .modal-head h2 { display: flex; align-items: center; gap: 10px; }
.modal.danger .modal-head h2 .ico { color: var(--crit); }
.diff { border: 1px solid var(--border); border-radius: var(--r-sm); overflow: hidden; }
.diff-row { display: grid; grid-template-columns: minmax(120px, 1fr) minmax(0, 2fr); gap: 12px; padding: 10px 14px; border-top: 1px solid var(--border); font-size: 13px; }
.diff-row:first-child { border-top: 0; } .diff-row .k { color: var(--text-2); }
.diff-row .v { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.diff-row .old { color: var(--muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--muted) 60%, transparent); }
.diff-row .new { font-weight: 600; } .diff-row .v .ico { width: 14px; height: 14px; color: var(--muted); }
.drawer-wrap { position: fixed; inset: 0; z-index: 51; pointer-events: none; }
.drawer { position: absolute; top: 8px; right: 8px; bottom: 8px; width: min(520px, calc(100vw - 16px)); pointer-events: auto; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-pop); animation: drawer-in 240ms var(--ease); }
.drawer.out { transform: translateX(calc(100% + 16px)); transition: transform 220ms cubic-bezier(.4, 0, 1, 1); }
@keyframes drawer-in { from { transform: translateX(calc(100% + 16px)); } to { transform: none; } }
.drawer-head { display: flex; align-items: flex-start; gap: 12px; padding: 20px 24px 16px; border-bottom: 1px solid var(--border); }
.drawer-head p { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.drawer-body { flex: 1; overflow-y: auto; }
.drawer-body .form { padding: 20px 24px 28px; }
.drawer-foot { display: flex; align-items: center; gap: 8px; padding: 14px 24px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.drawer-foot .test-res { order: -1; margin-bottom: 4px; }
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
.toast { pointer-events: auto; display: flex; gap: 10px; align-items: flex-start; min-width: 280px; max-width: 420px; padding: 12px 14px; border-radius: 12px; background: var(--text); color: var(--bg); box-shadow: var(--shadow-pop); font-size: 13.5px; animation: toast-in 240ms var(--ease); }
.toast .ico { margin-top: 2px; } .toast.ok .ico { color: #4ade80; } .toast.err .ico { color: #f87171; }
.toast small { display: block; opacity: .7; font-size: 12.5px; margin-top: 2px; }
.toast-act { flex: none; align-self: center; height: 28px; padding: 0 10px; border: 0; border-radius: var(--r-xs); background: color-mix(in srgb, var(--bg) 16%, transparent);
  color: inherit; font-weight: 500; font-size: 13px; transition: background-color 150ms; }
.toast-act:hover { background: color-mix(in srgb, var(--bg) 28%, transparent); }
.toast.out { opacity: 0; transform: translateY(6px) scale(.98); transition: opacity 180ms ease-in, transform 180ms ease-in; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }

/* ---------- скелетоны ---------- */
.sk { position: relative; overflow: hidden; background: var(--sk); border-radius: var(--r-sm); }
.sk::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, var(--sk-hi), transparent); transform: translateX(-100%); animation: shimmer 1.4s ease-in-out infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }
.sk.line { height: 14px; } .sk.h1 { height: 28px; width: 40%; } .sk.block { height: 260px; }

/* ---------- вход ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(1200px 600px at 50% -10%, var(--accent-soft), transparent 70%), var(--bg); }
.auth-card { width: min(400px, 100%); padding: 32px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-pop); animation: modal-in 260ms var(--ease); }
.auth-card .brand { padding: 0 0 24px; font-size: 14px; } .auth-card .brand svg { width: 32px; height: 32px; border-radius: 9px; }
.auth-card h1 { font-size: 22px; } .auth-card .lead { color: var(--text-2); margin: 6px 0 22px; }
.auth-card form { display: grid; gap: 16px; } .auth-card .btn { height: 40px; width: 100%; margin-top: 6px; }
.auth-card .foot { margin-top: 18px; color: var(--muted); font-size: 12.5px; text-align: center; }
.auth-err { display: flex; gap: 8px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--crit-soft); color: var(--text); font-size: 13px; animation: shake 320ms var(--ease); }
.auth-err .ico { color: var(--crit); margin-top: 1px; }
@keyframes shake { 20%, 60% { transform: translateX(-4px); } 40%, 80% { transform: translateX(4px); } }
.pw-meter { height: 4px; border-radius: 2px; background: var(--hover); overflow: hidden; } .pw-meter i { display: block; height: 100%; background: var(--accent); transform-origin: 0 0; transition: transform 200ms var(--ease), background-color 200ms; }

/* ---------- настройки: сетка блоков ---------- */
.blocks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.block-card { display: flex; flex-direction: column; gap: 10px; padding: 20px; color: var(--text); transition: border-color 150ms, box-shadow 200ms, transform 200ms var(--ease); }
.block-card:hover { border-color: var(--border-2); box-shadow: var(--shadow-pop); transform: translateY(-2px); }
.block-card > .row { flex-wrap: nowrap; }   /* лампа всегда в одном месте: справа от названия, длинная подпись обрезается */
.block-card > .row h2 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1 1 auto; min-width: 0; }
.block-card > .row .pill { flex: 0 1 auto; min-width: 0; max-width: 60%; overflow: hidden; text-overflow: ellipsis; }
.block-card .bi { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.block-card p { color: var(--text-2); font-size: 13px; line-height: 19px; flex: 1; }
.block-card .foot { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12.5px; padding-top: 10px; border-top: 1px solid var(--border); }
.block-card.broken { border-color: var(--crit); }
.search-box { position: relative; width: 300px; flex: none; }
.search-box > .ico { position: absolute; left: 11px; top: 10px; color: var(--muted); pointer-events: none; }
.search-box .inp { padding-left: 34px; }
.found { position: absolute; z-index: 20; top: 42px; left: 0; right: 0; padding: 4px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-pop); animation: pop-in 160ms var(--ease); }
.found a { display: grid; gap: 1px; padding: 8px 10px; border-radius: 6px; color: var(--text); }
.found a:hover, .found a:focus-visible { background: var(--hover); }
.found a b { font-weight: 500; font-size: 13.5px; } .found a span { color: var(--muted); font-size: 12px; }
.field.flash { animation: flash 1.6s var(--ease); border-radius: 8px; }
@keyframes flash { 0%, 40% { box-shadow: 0 0 0 6px var(--accent-soft); background: var(--accent-soft); } 100% { box-shadow: 0 0 0 6px transparent; background: transparent; } }
.block-card .chips-row { display: flex; flex-wrap: wrap; gap: 6px; }
.block-card .go { display: inline-flex; align-items: center; gap: 2px; color: var(--accent); font-weight: 500; opacity: 0; transform: translateX(-4px); transition: opacity 150ms, transform 200ms var(--ease); }
.block-card .go .ico { width: 14px; height: 14px; }
.block-card:hover .go, .block-card:focus-visible .go { opacity: 1; transform: none; }

/* ---------- журнал ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 20px; }
.filters.split { display: grid; grid-template-columns: minmax(0, 1fr) 280px; align-items: start; }
.filters.split .inp { width: 100%; }
.feed-day { color: var(--text-2); font-size: 13px; font-weight: 600; margin: 28px 0 10px; }
.feed-day:first-child { margin-top: 0; }
.entry { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 14px; padding: 16px 20px; animation: fade-up 220ms var(--ease) both; }
.entry + .entry { border-top: 1px solid var(--border); }
.entry .avatar { width: 32px; height: 32px; }
.entry .e-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.entry .e-top b { font-weight: 600; } .entry .e-top .muted { font-size: 12.5px; }
.entry .e-top .dot::before { content: "·"; margin-right: 10px; color: var(--muted); }
.entry .items { display: grid; gap: 4px; margin-top: 8px; font-size: 13px; }
.entry .item { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.entry .item .k { color: var(--text-2); } .entry .item .old { color: var(--muted); text-decoration: line-through; }
.entry .item .new { font-weight: 600; } .entry .item .ico { width: 13px; height: 13px; color: var(--muted); }
.entry .why { margin-top: 8px; padding-left: 10px; border-left: 2px solid var(--border-2); color: var(--text-2); font-size: 13px; }

/* ---------- система ---------- */
.tiles6 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.htile { padding: 18px 20px; display: grid; gap: 6px; align-content: start; animation: fade-up 240ms var(--ease) both; }
.htile.off .row b, .htile.off .v { color: var(--muted); }
.htile .row b { font-weight: 600; } .htile .v { font-size: 13px; color: var(--text-2); line-height: 19px; min-height: 38px; }
.htile .when { font-size: 12px; color: var(--muted); }
.htile.crit { border-color: color-mix(in srgb, var(--crit) 45%, var(--border)); } .htile.warn { border-color: color-mix(in srgb, var(--warn) 40%, var(--border)); }
.banner-stop { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-radius: var(--r); background: var(--crit-soft); margin-bottom: 20px; font-weight: 500; }
.banner-stop .ico { color: var(--crit); }
.url-box { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--border); font: 13px ui-monospace, SFMono-Regular, Consolas, monospace; word-break: break-all; }

/* ---------- «Сводка» и графики ---------- */
.card-foot.sticky { position: sticky; bottom: 0; z-index: 4; }
.formula { color: var(--muted); font-size: 12px; line-height: 17px; }
.ov-fresh { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-size: 12.5px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.vs { margin: 0 0 20px 2px; }
.ov.loading .ov-tiles, .ov.loading .ov-row, .ov.loading .ov-plot-wrap, .ov.loading .ov-lists { opacity: .55; transition: opacity 150ms; }
.ov-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.ov-tile { padding: 18px 20px 16px; display: flex; flex-direction: column; min-width: 0; animation: fade-up 260ms var(--ease) both; }
.ov-tile:nth-child(2) { animation-delay: 40ms; } .ov-tile:nth-child(3) { animation-delay: 80ms; } .ov-tile:nth-child(4) { animation-delay: 120ms; }
.ov-top { display: flex; align-items: center; gap: 8px; justify-content: space-between; min-height: 22px; }
.ov-cmp { display: flex; align-items: center; gap: 8px; margin-top: 4px; min-width: 0; white-space: nowrap; }
.ov-cmp .ov-prev { overflow: hidden; text-overflow: ellipsis; }
.ov-part { color: var(--muted); font-size: 12.5px; line-height: 18px; min-height: 18px; margin-top: 4px; font-variant-numeric: tabular-nums; }
.ov-label { color: var(--text-2); font-weight: 500; font-size: 13px; }
.ov-value { font-size: 32px; line-height: 40px; font-weight: 600; letter-spacing: -.02em; margin-top: 6px; white-space: nowrap; }
.ov-value.sm { font-size: 26px; line-height: 34px; }
.ov-prev { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.ov-delta { display: inline-flex; align-items: center; height: 22px; padding: 0 7px; border-radius: 6px; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; background: var(--hover); color: var(--text-2); }
.ov-delta.up { background: var(--ok-soft); color: var(--up); } .ov-delta.down { background: var(--crit-soft); color: var(--down); }
.ov-delta.none, .ov-delta.flat { font-weight: 500; color: var(--muted); background: var(--hover); }
.ov-dtxt { font-weight: 600; font-variant-numeric: tabular-nums; } .ov-dtxt.up { color: var(--up); } .ov-dtxt.down { color: var(--down); }
.ov-dtxt.flat, .ov-dtxt.none { color: var(--muted); font-weight: 500; }
.tbl th.sort { cursor: pointer; user-select: none; transition: color 150ms; }
.tbl th.sort:hover { color: var(--text); } .tbl th.sort.on { color: var(--text); }
.tbl th.sort .ico { width: 12px; height: 12px; vertical-align: -2px; margin-left: 2px; transition: transform 200ms var(--ease); }
.tbl th.sort.asc .ico { transform: rotate(180deg); }
.ov-more { display: flex; justify-content: center; padding: 12px; border-top: 1px solid var(--border); }
.ov-spark { margin: 8px -4px 12px; }
.spark-box { position: relative; height: 38px; container-type: size; }
.spark { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.spark-dot { position: absolute; left: -3px; top: -3px; width: 6px; height: 6px; border-radius: 50%; box-shadow: 0 0 0 2px var(--surface); transition: opacity 200ms; }
.ov-tile .formula { min-height: 45px; padding-top: 10px; border-top: 1px dashed var(--border); }   /* 2 строки: пунктир на одной высоте во всех плитках */
.ov-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 16px; margin-bottom: 16px; }
.ov-side { padding: 18px 20px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ov-side > .formula:first-of-type { margin-top: auto; padding-top: 10px; }
.ov-share { margin: 14px 0 12px; }
.share { display: block; width: 100%; clip-path: inset(0 round 5px); }
.ov-legend { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 24px; margin-bottom: 10px; }
.ov-li { display: flex; align-items: center; gap: 8px; font-size: 13px; min-width: 0; }
.ov-li i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.ov-li .grow { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ov-li b { font-weight: 600; } .ov-li .muted { width: 52px; text-align: right; font-size: 12px; }
.ov-li.bad .grow, .ov-li.bad b { color: var(--crit); }
.ov-chart { margin-bottom: 16px; }
.ov-chart .card-head { flex-wrap: wrap; }
.ov-plot-wrap { position: relative; padding: 16px 16px 8px 8px; }
.ov-plot { position: relative; min-height: 280px; }
.ov-keys { display: flex; gap: 18px; padding: 0 0 8px 16px; font-size: 12.5px; color: var(--text-2); }
.ov-keys span { display: inline-flex; align-items: center; gap: 7px; } .ov-keys i { width: 14px; height: 2px; border-radius: 2px; }
.ov-table { border-top: 1px solid var(--border); animation: fade-up 200ms var(--ease); }
.ov-bar { display: inline-flex; align-items: center; justify-content: flex-end; gap: 10px; }
.ov-bar .track { position: relative; width: 56px; height: 4px; border-radius: 2px; background: var(--hover); overflow: hidden; }
.ov-bar i { position: absolute; inset: 0; border-radius: 2px; background: var(--viz-1); transform-origin: 0 50%; transition: transform 300ms var(--ease); }
.ov-bar b { font-weight: 600; min-width: 44px; }
.lc { position: relative; width: 100%; transition: opacity 200ms; }
.lc-svg { display: block; width: 100%; overflow: visible; }
.lc-grid line { stroke: var(--viz-grid); stroke-width: 1; } .lc-grid line.base { stroke: var(--border-2); }
.lc-grid g { transition: opacity 150ms ease-out; }
.spark-base { stroke: var(--border-2); stroke-width: 1; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.lc-grid text, .lc-x text { fill: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; font-family: var(--font); }
.lc-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.lc-end, .lc-dot { stroke: var(--surface); stroke-width: 2; }
.lc-cross { stroke: var(--border-2); stroke-width: 1; }
.lc-hit { fill: transparent; cursor: crosshair; } .lc-hit:focus { outline: none; }
.lc-tip { position: absolute; top: 4px; left: 0; min-width: 180px; padding: 10px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-pop); pointer-events: none; font-size: 12.5px; transition: transform 90ms linear; z-index: 3; }
.lc-th { color: var(--muted); margin-bottom: 6px; font-size: 12px; }
.lc-tr { display: flex; align-items: center; gap: 8px; line-height: 20px; } .lc-tr i { width: 12px; height: 2px; border-radius: 2px; flex: none; }
.lc-tr b { font-weight: 600; font-variant-numeric: tabular-nums; } .lc-tr span { color: var(--text-2); }
/* столбики + линия (comboChart): столбики — светлый акцент, линия второй меры — акцент с точками; неполный последний день — бледнее, пунктиром */
.cc-bar { fill: var(--viz-1); fill-opacity: .32; transform-box: fill-box; transform-origin: 50% 100%; transition: transform 260ms var(--ease), fill-opacity 150ms; }
.cc-bar.part { fill-opacity: .14; stroke: var(--viz-1); stroke-opacity: .5; stroke-dasharray: 2 2; }
.cc-path { fill: none; stroke: var(--viz-1); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.cc-path.part { stroke-dasharray: 3 3; opacity: .6; }
.cc-line { transition: opacity 220ms 120ms ease-out; }
.cc-dot { fill: var(--viz-1); stroke: var(--surface); stroke-width: 1.5; } .cc-dot.part { opacity: .55; }
.cc-hover { fill: var(--hover); rx: 4px; transition: opacity 120ms; }
.lc-grid text.cc-r { fill: var(--viz-1); opacity: .8; }
.cc-k-bar, .cc-k-line { display: inline-block; flex: none; }
.cc-k-bar { width: 10px; height: 10px; border-radius: 2px; background: var(--viz-1); opacity: .32; }
.cc-k-line { width: 14px; height: 2px; border-radius: 2px; background: var(--viz-1); }
.lc-tr i.cc-k-bar, .ov-keys i.cc-k-bar { width: 10px; height: 10px; border-radius: 2px; } .lc-tr i.cc-k-line, .ov-keys i.cc-k-line { width: 14px; height: 2px; }
.ov-pop { position: fixed; z-index: 60; padding: 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-pop); animation: pop-in 180ms var(--ease); transform-origin: top left; }
.cal-months { display: flex; gap: 24px; }
.cal-title { text-align: center; font-weight: 600; font-size: 13px; margin-bottom: 8px; }
.cal-title::first-letter { text-transform: uppercase; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 34px); gap: 2px 0; }
.cal-w { text-align: center; color: var(--muted); font-size: 11px; height: 24px; line-height: 24px; }
.cal-d { height: 32px; border: 0; background: none; border-radius: 0; font-size: 13px; font-variant-numeric: tabular-nums; color: var(--text); transition: background-color 100ms; }
.cal-d:hover:not(:disabled) { background: var(--hover); border-radius: 8px; }
.cal-d:disabled { color: var(--off); cursor: default; }
.cal-d.today { font-weight: 700; color: var(--accent); }
.cal-d.in { background: var(--accent-soft); }
.cal-d.end { background: var(--accent); color: var(--on-accent); border-radius: 8px; }
.cal-foot { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }

.mtop { display: none; }
@media (max-width: 1100px) { .page { padding: 28px 28px 64px; } .tiles6 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ov-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 800px) {
  /* телефон: компактная шапка сверху (логотип, тема, меню) и нижний таб-бар из 4 разделов */
  .shell { grid-template-columns: 1fr; }
  .mtop { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 8px; padding: 10px 16px; background: var(--bg); border-bottom: 1px solid var(--border); }
  .mtop .brand { padding: 0; margin-right: auto; }
  .side { position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; top: auto; height: auto; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--border); overflow: visible; }
  .side > .brand, .side-foot, .nav-ind, .nav-sep, .side .nav .sub { display: none; }
  .side .nav { flex-direction: row; justify-content: space-around; gap: 0; }
  .nav a { flex: 1; flex-direction: column; gap: 2px; height: 48px; padding: 4px 0; justify-content: center; font-size: 11px; font-weight: 500; }
  .nav a .ico { width: 20px; height: 20px; } .nav a.on { color: var(--accent); background: var(--accent-soft); }
  .main { margin: 0; border-radius: 0; border-width: 0; min-height: 0; padding-bottom: 72px; } .page { padding: 20px 16px 56px; } .tiles6 { grid-template-columns: 1fr; }
  .head { flex-direction: column; } .head-actions { margin-left: 0; justify-content: flex-start; } .search-box { width: 100%; }
  .card-head, .toolbar, .card-foot, .form { padding-left: 16px; padding-right: 16px; }
  .blocks { grid-template-columns: minmax(0, 1fr); } .filters.split { grid-template-columns: minmax(0, 1fr); }
  .ov-tiles { grid-template-columns: 1fr; } .ov-row { grid-template-columns: 1fr; } .ov-legend { grid-template-columns: 1fr; } .cal-months { flex-direction: column; }
  /* сегменты (чипы периода, метрики графика, фильтр журнала) — одна строка с горизонтальной прокруткой и прилипанием */
  .seg { max-width: 100%; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; }
  .seg::-webkit-scrollbar { display: none; }
  .seg button { flex: none; scroll-snap-align: start; }
  .ov-chart .card-head { flex-wrap: wrap; }
  .tbl th:first-child, .tbl td:first-child { padding-left: 16px; }
  .toasts { bottom: 84px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; scroll-behavior: auto !important; }
  .lamp.pulse.ok::after, .lamp.pulse.run::after { display: none; }
}
