/* Yagis — панель мониторинга карточек. Тема: картография, изолинии. */

:root {
  --paper: #f3f5f4;
  --surface: #ffffff;
  --surface-2: #e9eeec;
  --ink: #16222e;
  --ink-2: #4c5a66;
  --ink-3: #7d8a94;
  --line: #d5ddda;
  --line-strong: #b9c5c1;
  --accent: #0b6e69;
  --accent-ink: #ffffff;
  --accent-soft: #d8ecea;

  --ok: #2f8f5b;
  --ok-soft: #dcf0e3;
  --run: #2d6bd8;
  --run-soft: #dde8fb;
  --queue: #b7800f;
  --queue-soft: #f6ebcf;
  --err: #cf4040;
  --err-soft: #f9dfdf;
  --idle: #7d8a94;
  --idle-soft: #e6eaec;

  --radius-s: 6px;
  --radius-m: 10px;
  --shadow-pop: 0 12px 32px rgba(22, 34, 46, 0.18);
  --sidebar: 232px;
  --font: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0f1a20;
    --surface: #16232b;
    --surface-2: #1d2d36;
    --ink: #e4ecef;
    --ink-2: #a9b8bf;
    --ink-3: #7b8c94;
    --line: #26363f;
    --line-strong: #34474f;
    --accent: #3fb3aa;
    --accent-ink: #062523;
    --accent-soft: #163a39;
    --ok-soft: #173a29;
    --run-soft: #1a2c4d;
    --queue-soft: #3a2f12;
    --err-soft: #43201f;
    --idle-soft: #22313a;
    --shadow-pop: 0 12px 32px rgba(0, 0, 0, 0.5);
  }
}
:root[data-theme="dark"] {
  --paper: #0f1a20;
  --surface: #16232b;
  --surface-2: #1d2d36;
  --ink: #e4ecef;
  --ink-2: #a9b8bf;
  --ink-3: #7b8c94;
  --line: #26363f;
  --line-strong: #34474f;
  --accent: #3fb3aa;
  --accent-ink: #062523;
  --accent-soft: #163a39;
  --ok-soft: #173a29;
  --run-soft: #1a2c4d;
  --queue-soft: #3a2f12;
  --err-soft: #43201f;
  --idle-soft: #22313a;
  --shadow-pop: 0 12px 32px rgba(0, 0, 0, 0.5);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 15px/1.5 var(--font);
  font-variant-numeric: tabular-nums;
}
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
h1, h2, h3 { line-height: 1.2; margin: 0; font-weight: 650; letter-spacing: -0.01em; }
h1 { font-size: 26px; }
h2 { font-size: 19px; }
h3 { font-size: 15px; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.break { overflow-wrap: anywhere; }

/* ---- каркас --------------------------------------------------------- */

.app { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }

.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 4px;
  padding: 20px 14px;
  background: var(--surface);
  border-right: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; color: var(--ink); text-decoration: none; }
.brand-mark { width: 30px; height: 30px; flex: none; }
.brand-name { font-size: 19px; font-weight: 700; letter-spacing: -0.02em; }
.brand-sub { display: block; font-size: 12px; color: var(--ink-3); font-weight: 400; letter-spacing: 0; }
.nav-group { margin-top: 14px; padding: 0 10px 4px; font-size: 12px; color: var(--ink-3); }
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--radius-s);
  color: var(--ink-2); text-decoration: none; font-weight: 500;
}
.nav a svg { width: 18px; height: 18px; flex: none; }
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
.nav .count {
  margin-left: auto; min-width: 20px; padding: 0 6px; border-radius: 10px;
  background: var(--err); color: #fff; font-size: 12px; text-align: center; line-height: 20px;
}
.sidebar-foot { margin-top: auto; padding: 10px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-2); }
.sidebar-foot .user { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 8px; }

.sys { display: flex; align-items: center; gap: 8px; }
.sys-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--idle); flex: none; }
.sys[data-state="ok"] .sys-dot { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.sys[data-state="bad"] .sys-dot { background: var(--err); box-shadow: 0 0 0 3px var(--err-soft); }

.main { min-width: 0; padding: 26px 32px 48px; }
.topbar { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.topbar h1 { margin-right: auto; }
.crumbs { font-size: 13px; color: var(--ink-3); margin-bottom: 4px; }
.crumbs a { color: var(--ink-3); }

.btn.menu-toggle { display: none; }

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; z-index: 1000; left: 0; top: 0; width: 260px;
    transform: translateX(-100%); transition: transform .2s ease;
  }
  .app[data-menu="open"] .sidebar { transform: none; box-shadow: var(--shadow-pop); }
  .btn.menu-toggle { display: inline-flex; }
  .main { padding: 16px 16px 40px; }
}

/* ---- элементы ------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 14px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-s);
  background: var(--surface); color: var(--ink);
  font: 500 14px var(--font); cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: var(--ink-3); }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.08); border-color: var(--accent); }
.btn-danger { color: var(--err); }
.btn-danger:hover { border-color: var(--err); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--surface-2); border-color: transparent; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn-icon { width: 34px; padding: 0; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.field { display: grid; gap: 6px; }
.field > span { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.field .hint { font-size: 12px; color: var(--ink-3); }
.input, select.input, textarea.input {
  width: 100%; min-height: 38px; padding: 8px 11px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-s);
  background: var(--surface); color: var(--ink); font: 400 14px var(--font);
}
textarea.input { min-height: 84px; resize: vertical; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 13px; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 13px; }

.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track {
  width: 36px; height: 20px; border-radius: 10px; background: var(--line-strong);
  position: relative; transition: background .15s; flex: none;
}
.switch .track::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px;
  border-radius: 50%; background: #fff; transition: transform .15s;
}
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch input:disabled + .track { opacity: .45; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); }
.panel-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.panel-head h2 { font-size: 16px; margin-right: auto; }
.panel-body { padding: 18px; }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 9px 2px 8px; border-radius: 20px;
  font-size: 12.5px; font-weight: 500; white-space: nowrap;
  background: var(--idle-soft); color: var(--ink-2);
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.plain::before { display: none; }
.st-success { background: var(--ok-soft); color: var(--ok); }
.st-running { background: var(--run-soft); color: var(--run); }
.st-running::before { animation: pulse 1.2s ease-in-out infinite; }
.st-queued { background: var(--queue-soft); color: var(--queue); }
.st-error { background: var(--err-soft); color: var(--err); }
.st-idle { background: var(--idle-soft); color: var(--idle); }
@keyframes pulse { 50% { opacity: .3; } }

.table-wrap { overflow-x: auto; }
table.grid { width: 100%; border-collapse: collapse; font-size: 14px; }
table.grid th {
  text-align: left; font-weight: 500; font-size: 13px; color: var(--ink-3);
  padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.grid td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.grid tr:last-child td { border-bottom: 0; }
table.grid tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
table.grid .num { text-align: right; }
.row-actions { display: flex; gap: 4px; justify-content: flex-end; }

.empty { padding: 40px 20px; text-align: center; color: var(--ink-2); }
.empty h3 { margin-bottom: 6px; color: var(--ink); }
.empty .btn { margin-top: 14px; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.toolbar .input { width: auto; min-width: 160px; }
.toolbar .grow { flex: 1 1 220px; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; scrollbar-width: none; }
.tabs button {
  padding: 10px 14px; border: 0; background: none; cursor: pointer;
  font: 500 14px var(--font); color: var(--ink-2); border-bottom: 2px solid transparent; margin-bottom: -1px;
  white-space: nowrap;
}
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.tabs .tab-count { margin-left: 6px; font-size: 12px; color: var(--ink-3); }

.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; padding: 12px 14px; font-size: 13px; color: var(--ink-3); }

/* ---- сводная строка ------------------------------------------------- */

.ticker {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m);
  margin-bottom: 18px;
}
.ticker > div { padding: 14px 18px; border-left: 1px solid var(--line); }
.ticker > div:first-child { border-left: 0; }
.ticker .v { font-size: 22px; font-weight: 650; letter-spacing: -0.02em; }
.ticker .v small { font-size: 15px; font-weight: 500; color: var(--ink-3); }
.ticker .k { font-size: 13px; color: var(--ink-3); }
@media (max-width: 700px) {
  .ticker { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ticker > div:nth-child(3) { border-left: 0; }
  .ticker > div:nth-child(n+3) { border-top: 1px solid var(--line); }
}

/* ---- дашборд -------------------------------------------------------- */

.dash-top { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; margin-bottom: 18px; }
@media (max-width: 1100px) { .dash-top { grid-template-columns: 1fr; } }

.map-panel { position: relative; overflow: hidden; }
#map { height: 430px; background: var(--surface-2); }
.map-legend {
  position: absolute; z-index: 500; left: 12px; bottom: 12px;
  display: flex; gap: 12px; flex-wrap: wrap;
  padding: 8px 12px; border-radius: var(--radius-s);
  background: color-mix(in srgb, var(--surface) 92%, transparent); border: 1px solid var(--line);
  font-size: 12.5px;
}
.map-legend label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.map-legend input { accent-color: var(--accent); margin: 0; }
.leg { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

.pin {
  width: 18px; height: 18px; border-radius: 50%;
  border: 3px solid #fff; box-shadow: 0 1px 5px rgba(0,0,0,.4);
}
/* Подложка карты в тёмной теме приглушается, маркеры остаются яркими */
:root[data-theme="dark"] .leaflet-tile-pane { filter: brightness(.72) saturate(.55) contrast(1.05); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .leaflet-tile-pane { filter: brightness(.72) saturate(.55) contrast(1.05); }
}
.cluster {
  display: grid; place-items: center; border-radius: 50%;
  color: #fff; font: 650 13px var(--font);
  border: 3px solid rgba(255,255,255,.85); box-shadow: 0 1px 6px rgba(0,0,0,.3);
}
.leaflet-popup-content { font: 14px/1.45 var(--font); margin: 12px 14px; }
.leaflet-popup-content a { font-weight: 600; }

.side-col { display: grid; gap: 18px; align-content: start; }
.feed { list-style: none; margin: 0; padding: 4px 0; max-height: 300px; overflow-y: auto; }
.feed li { display: grid; grid-template-columns: 10px 1fr; gap: 10px; padding: 9px 18px; font-size: 13.5px; }
.feed .dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 7px; background: var(--idle); }
.feed .t { color: var(--ink-3); font-size: 12px; }
.feed .ev-changes .dot { background: var(--accent); }
.feed .ev-run_error .dot, .feed .ev-notify_error .dot { background: var(--err); }
.feed .ev-run_success .dot, .feed .ev-baseline .dot { background: var(--ok); }
.feed .ev-selector_warning .dot { background: var(--queue); }

.quick { display: grid; gap: 8px; }
.quick .btn { justify-content: flex-start; }

/* ---- проект --------------------------------------------------------- */

.project-head { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 18px; }
.project-head .title { flex: 1 1 300px; min-width: 0; }
.project-head h1 { overflow-wrap: anywhere; }
.project-head .meta { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 8px; font-size: 13.5px; color: var(--ink-2); }
.project-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }

.alert { padding: 12px 16px; border-radius: var(--radius-m); background: var(--err-soft); color: var(--ink); margin-bottom: 18px; font-size: 14px; border-left: 3px solid var(--err); }
.alert.info { background: var(--accent-soft); border-left-color: var(--accent); }

.overview { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 18px; align-items: start; }
@media (max-width: 1100px) { .overview { grid-template-columns: 1fr; } }

.props { display: grid; grid-template-columns: 190px minmax(0, 1fr); }
.props > dt, .props > dd { margin: 0; padding: 11px 18px; border-bottom: 1px solid var(--line); }
.props > dt { color: var(--ink-2); font-size: 14px; }
.props > dd { overflow-wrap: anywhere; }
.props > dt:last-of-type, .props > dd:last-of-type { border-bottom: 0; }
.props .na { color: var(--ink-3); font-style: italic; }
.props ul { margin: 0; padding-left: 18px; }
@media (max-width: 600px) {
  .props { grid-template-columns: 1fr; }
  .props > dt { border-bottom: 0; padding-bottom: 0; font-size: 13px; }
}
.kv { display: grid; grid-template-columns: fit-content(45%) minmax(0, 1fr); gap: 2px 14px; font-size: 14px; }
.kv span:nth-child(odd) { color: var(--ink-3); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { padding: 2px 9px; border-radius: 12px; background: var(--surface-2); font-size: 13px; }

.embed { width: 100%; height: 320px; border: 0; display: block; border-radius: 0 0 var(--radius-m) var(--radius-m); }
.service { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 13.5px; }
.service span:nth-child(odd) { color: var(--ink-3); }

.rating { color: #e0a100; letter-spacing: 1px; white-space: nowrap; }
.review { padding: 16px 18px; border-bottom: 1px solid var(--line); }
.review:last-child { border-bottom: 0; }
.review-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.review-head b { font-weight: 600; }
.review-text { white-space: pre-line; overflow-wrap: anywhere; max-width: 78ch; }
.reply {
  margin-top: 10px; padding: 10px 14px; border-left: 3px solid var(--accent);
  background: var(--accent-soft); border-radius: 0 var(--radius-s) var(--radius-s) 0; font-size: 14px; max-width: 78ch;
  white-space: pre-line;
}
.reply .muted { display: block; font-size: 12px; margin-bottom: 2px; }
.noreply { margin-top: 8px; font-size: 13px; color: var(--err); }
.thread .reply { margin-top: 6px; }
.complaints { display: grid; gap: 8px; margin-top: 10px; max-width: 78ch; }
.complaint { padding: 10px 14px; border-radius: var(--radius-s); background: var(--queue-soft); border-left: 3px solid var(--queue); font-size: 14px; }
.complaint-head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; margin-bottom: 4px; }
.complaint-status { margin-left: auto; font-size: 13px; font-weight: 600; }
.complaint-text { white-space: pre-line; overflow-wrap: anywhere; }
.thread .reply-user { border-left-color: var(--line-strong); background: var(--paper); margin-left: 18px; }
.tag-new { background: var(--accent); color: var(--accent-ink); }

.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
@media (max-width: 1000px) { .settings-grid { grid-template-columns: 1fr; } }
.form-grid { display: grid; gap: 14px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; padding-top: 4px; }

.triggers { list-style: none; margin: 0; padding: 0; }
.triggers li { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; padding: 12px 18px; border-bottom: 1px solid var(--line); align-items: center; }
.triggers li:last-child { border-bottom: 0; }
.triggers .desc { font-size: 13px; color: var(--ink-3); }
.triggers .thr { grid-column: 1 / -1; display: flex; gap: 10px; align-items: center; font-size: 13px; color: var(--ink-2); }
.triggers .thr .input { width: 90px; min-height: 32px; padding: 4px 8px; }
.triggers li.na { opacity: .6; }

/* Диф «было → стало» — главный акцент панели */
.diff-list { list-style: none; margin: 0; padding: 0; }
.diff-run { padding: 4px 18px 14px; border-bottom: 1px solid var(--line); }
.diff-run:last-child { border-bottom: 0; }
.diff-run > header { display: flex; gap: 10px; align-items: baseline; padding: 12px 0 6px; font-size: 13px; color: var(--ink-3); }
.diff-item { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 4px 16px; padding: 10px 0; border-top: 1px dashed var(--line); }
.diff-item:first-of-type { border-top: 0; }
.diff-param { font-weight: 600; font-size: 14px; }
.diff-param .kind { display: block; font-weight: 400; font-size: 12px; color: var(--ink-3); }
.diff-vals { display: grid; gap: 4px; min-width: 0; }
.diff-old, .diff-new {
  display: grid; grid-template-columns: 22px minmax(0, 1fr); align-items: start;
  font-size: 14px; overflow-wrap: anywhere;
}
.diff-old { color: var(--ink-3); }
.diff-old .val, .diff-new .val { justify-self: start; }
.diff-old .val { text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--err) 70%, transparent); }
.diff-new .val { background: linear-gradient(transparent 58%, color-mix(in srgb, var(--accent) 22%, transparent) 58%); }
.diff-old .sym, .diff-new .sym { font-weight: 700; line-height: 1.45; }
.diff-old .sym { color: var(--err); }
.diff-new .sym { color: var(--accent); }
.diff-summary { grid-column: 2; font-size: 13px; color: var(--ink-2); }
@media (max-width: 700px) { .diff-item { grid-template-columns: 1fr; } .diff-summary { grid-column: 1; } }

/* ---- уведомления ---------------------------------------------------- */

.notes { list-style: none; margin: 0; padding: 0; }
.note { display: grid; grid-template-columns: 12px 1fr auto; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.note:last-child { border-bottom: 0; }
.note .dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 7px; background: transparent; border: 2px solid var(--line-strong); }
.note.unread .dot { background: var(--accent); border-color: var(--accent); }
.note.lv-error.unread .dot { background: var(--err); border-color: var(--err); }
.note h3 { font-size: 14.5px; }
.note.unread h3 { font-weight: 700; }
.note .body { white-space: pre-line; font-size: 14px; color: var(--ink-2); margin-top: 4px; overflow-wrap: anywhere; }
.note .when { font-size: 12px; color: var(--ink-3); white-space: nowrap; }

/* ---- модальное окно и тосты ---------------------------------------- */

dialog.modal {
  width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px);
  padding: 0; border: 1px solid var(--line); border-radius: var(--radius-m);
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-pop);
}
dialog.modal.wide { width: min(820px, calc(100vw - 32px)); }
dialog.modal::backdrop { background: rgba(10, 20, 26, .45); }
dialog.modal > form { display: flex; flex-direction: column; max-height: calc(100vh - 50px); }
.modal-head { display: flex; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 17px; margin-right: auto; }
.modal-body { padding: 20px; overflow-y: auto; display: grid; gap: 14px; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--line); }

.toasts { position: fixed; z-index: 3000; right: 16px; bottom: 16px; display: grid; gap: 8px; max-width: min(380px, calc(100vw - 32px)); }
.toast {
  padding: 12px 16px; border-radius: var(--radius-s); background: var(--ink); color: var(--paper);
  box-shadow: var(--shadow-pop); font-size: 14px; animation: toast-in .2s ease-out;
}
.toast.error { background: var(--err); color: #fff; }
.toast b { display: block; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }

pre.json {
  margin: 0; padding: 12px; border-radius: var(--radius-s); background: var(--surface-2);
  font: 12.5px/1.5 ui-monospace, "Cascadia Mono", Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere;
  max-height: 260px; overflow: auto;
}

/* ---- вход ----------------------------------------------------------- */

.login {
  min-height: 100vh; display: grid; place-items: center; padding: 16px;
  background:
    radial-gradient(circle at 20% 30%, transparent 0 60px, color-mix(in srgb, var(--accent) 9%, transparent) 61px 62px, transparent 63px 110px, color-mix(in srgb, var(--accent) 9%, transparent) 111px 112px, transparent 113px 160px, color-mix(in srgb, var(--accent) 9%, transparent) 161px 162px, transparent 163px),
    radial-gradient(circle at 82% 75%, transparent 0 40px, color-mix(in srgb, var(--accent) 9%, transparent) 41px 42px, transparent 43px 90px, color-mix(in srgb, var(--accent) 9%, transparent) 91px 92px, transparent 93px 140px, color-mix(in srgb, var(--accent) 9%, transparent) 141px 142px, transparent 143px 190px, color-mix(in srgb, var(--accent) 9%, transparent) 191px 192px, transparent 193px),
    var(--paper);
}
.login-card { width: min(380px, 100%); padding: 32px 28px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-pop); }
.login-card .brand { padding: 0 0 22px; }
.login-card form { display: grid; gap: 14px; }
.login-card .btn { height: 40px; margin-top: 6px; }
.form-error { color: var(--err); font-size: 14px; min-height: 1.2em; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---- окно входа через удалённый браузер ------------------------------- */

dialog.modal.rl-modal { width: min(1160px, calc(100vw - 32px)); }
.rl-screen { position: relative; border: 1px solid var(--line); border-radius: var(--radius-s); overflow: hidden; background: #fff; }
.rl-screen { display: flex; justify-content: center; }
.rl-screen canvas { display: block; width: auto; height: auto; max-width: 100%; max-height: 68vh; cursor: pointer; }
.rl-input { position: absolute; left: 0; top: 0; width: 1px; height: 1px; opacity: 0; border: 0; padding: 0; resize: none; }
.rl-loading { position: absolute; inset: 0; display: grid; place-items: center; color: #4c5a66; font-size: 14px; background: #f3f5f4; }
.rl-status { font-size: 14px; }
.rl-status[data-kind="error"] { color: var(--err); }
.rl-status[data-kind="ok"] { color: var(--ok); }

.chain-row td { background: var(--surface-2); }

.review-photos { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.review-photos a { display: block; width: 96px; height: 96px; border-radius: var(--radius-s); overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); }
.review-photos img { width: 100%; height: 100%; object-fit: cover; display: block; }
.review-photos a:hover { border-color: var(--accent); }
