/* Паром — styles. Owner: WEB agent.
   Fonts are self-hosted in static/fonts (OFL, see the licence files there); nothing loads from outside.
   No inline styles anywhere (CSP style-src 'self').

   Theme «река ночью»: cool navy/graphite, aqua accent, buoy-orange for money. Dark is the default
   (<html data-theme="dark">); light is chosen with the toggle and remembered by theme.js.
   Layout follows the cabinet pattern the owner asked for: a floating sidebar card, a main column,
   stat tiles, cards with kv rows, dense tables. One signature: the «переправа» strip on a route. */

@font-face {
  font-family: "Onest";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/onest-cyrillic-wght-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Onest";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/onest-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Onest";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/onest-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Unbounded";
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url("fonts/unbounded-cyrillic-wght-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Unbounded";
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url("fonts/unbounded-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2191, U+2193, U+2212;
}

/* ------------------------------------------------------------------ tokens */

:root,
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d1217;
  --bg-raised: #141b22;
  --bg-sunken: #0a0e12;
  --bg-hover: #1a232c;
  --bg-input: #10161c;
  --bg-sidebar: #141b22;
  --line: #26323d;
  --line-soft: #1c262f;
  --card-line: #1c262f;
  --text: #e4ebf1;
  --text-dim: #8fa1b1;
  --text-faint: #5a6b7a;
  --accent: #3cc7d9;
  --accent-deep: #86e3ee;
  --accent-2: #f0a35e;
  --accent-contrast: #06171b;
  --ok: #4fc58e;
  --warn: #e9b350;
  --danger: #ef7676;
  --link: #86e3ee;
  --tint-aqua: #11303a;
  --tint-navy: #16243a;
  --tint-sand: #2f2a1d;
  --tint-sage: #18302a;
  --tint-rose: #35222a;
  --code-key: #86e3ee;
  --code-str: #f0c48e;
  --code-num: #9fd9a8;
  --shadow-panel: 0 1px 0 rgba(255, 255, 255, .025) inset, 0 14px 36px -24px rgba(0, 0, 0, .6);
  --shadow-pop: 0 24px 60px -20px rgba(0, 0, 0, .7);
  --backdrop: rgba(3, 7, 10, .62);
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #eef2f6;
  --bg-raised: #ffffff;
  --bg-sunken: #e5eaf0;
  --bg-hover: #f3f6f9;
  --bg-input: #ffffff;
  --bg-sidebar: #ffffff;
  --line: #d7dee6;
  --line-soft: #e6ebf0;
  --card-line: transparent;
  --text: #15202b;
  --text-dim: #5d6e7e;
  --text-faint: #95a3b1;
  --accent: #0b8fa3;
  --accent-deep: #087282;
  --accent-2: #c96a1f;
  --accent-contrast: #ffffff;
  --ok: #2f8f62;
  --warn: #b9791a;
  --danger: #cc4b55;
  --link: #087282;
  --tint-aqua: #dcf1f4;
  --tint-navy: #e1e8f3;
  --tint-sand: #f4ecdc;
  --tint-sage: #e1efe7;
  --tint-rose: #f4e3e6;
  --code-key: #087282;
  --code-str: #9a5517;
  --code-num: #2f7f55;
  --shadow-panel: 0 1px 2px rgba(21, 32, 43, .04), 0 12px 32px -22px rgba(21, 32, 43, .22);
  --shadow-pop: 0 24px 60px -24px rgba(21, 32, 43, .35);
  --backdrop: rgba(21, 32, 43, .35);
}

:root {
  --accent-soft: color-mix(in srgb, var(--accent) 12%, transparent);
  --ok-soft: color-mix(in srgb, var(--ok) 14%, transparent);
  --warn-soft: color-mix(in srgb, var(--warn) 14%, transparent);
  --danger-soft: color-mix(in srgb, var(--danger) 14%, transparent);
  --neutral-soft: color-mix(in srgb, var(--text-dim) 14%, transparent);
  --focus-ring: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
  --grad-brand: linear-gradient(135deg, #46d3e3 0%, #138ea0 55%, #0b5f6d 100%);
  --grad-buoy: linear-gradient(135deg, #f3b27a, #e07f4f);

  --font: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: "Unbounded", "Onest", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;

  --r-card: 20px;
  --r-ctl: 12px;
  --r-sm: 8px;
  --r-side: 24px;
}

/* ------------------------------------------------------------------ base */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 400 14px/1.5 var(--font);
  font-feature-settings: "cv01", "ss01";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -.005em; }
h1 { font-size: 21px; line-height: 1.3; }
h2 { font-size: 14.5px; line-height: 1.35; }
h3 { font-size: 13.5px; line-height: 1.4; }
p { margin: 0; }
ul, ol { margin: 0; padding-left: 1.2em; }
hr { border: 0; border-top: 1px solid var(--line-soft); margin: 14px 0; }
code, pre, .mono { font-family: var(--mono); font-size: 12.5px; }
img, svg { display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: color-mix(in srgb, var(--accent) 35%, transparent); }
:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: 8px; }
[hidden] { display: none !important; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; padding: 0; margin: -1px;
}
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 8px 14px; border-radius: var(--r-ctl);
  background: var(--text); color: var(--bg-raised); font-weight: 600; }
.skip-link:focus { top: 12px; }

.num, .tnum, td, .kv dd, .nav-meta, .tile-value, .stat-v { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-dim); }
.faint { color: var(--text-faint); }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; }
.pos { color: var(--ok); }
.neg { color: var(--danger); }
.money { color: var(--accent-2); }
.nowrap { white-space: nowrap; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.spacer { flex: 1; }
.stack { display: grid; gap: 14px; align-content: start; min-width: 0; }
.stack-sm { display: grid; gap: 8px; }
.section { margin-top: 18px; }
.mt-s { margin-top: 10px; }
.inline { display: inline; }
.prewrap { white-space: pre-wrap; }

/* ------------------------------------------------------------------ shell */

.shell { display: flex; align-items: flex-start; min-height: 100vh; }
.sidebar {
  position: sticky; top: 14px; flex: none;
  width: 256px; height: calc(100vh - 28px); margin: 14px 0 14px 14px;
  display: flex; flex-direction: column; gap: 18px;
  padding: 18px 12px 16px;
  background: var(--bg-sidebar);
  border: 1px solid var(--card-line);
  border-radius: var(--r-side);
  box-shadow: var(--shadow-panel);
  overflow-y: auto; overscroll-behavior: contain;
  scrollbar-width: thin;
}
.sb-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 6px; }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--text); }
.brand:hover { text-decoration: none; }
.mark {
  width: 40px; height: 40px; flex: none; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--grad-brand);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .25) inset, 0 6px 16px -8px rgba(19, 142, 160, .8);
}
.mark svg { width: 26px; height: 26px; }
.mark--lg { width: 48px; height: 48px; border-radius: 14px; }
.mark--lg svg { width: 31px; height: 31px; }
.wordmark { font-family: var(--display); font-weight: 500; font-size: 15px; letter-spacing: .01em; }
.brand-tag { font-size: 11px; color: var(--text-faint); display: block; font-family: var(--font); letter-spacing: 0; font-weight: 500; }

.sb-nav { display: grid; gap: 2px; }
.nav-group { font-size: 11px; color: var(--text-faint); padding: 12px 12px 4px; font-weight: 600; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; border-radius: 12px;
  font-size: 13.5px; font-weight: 500; color: var(--text-dim);
  transition: background-color .12s ease, color .12s ease;
}
.nav-item:hover { background: var(--bg-hover); color: var(--text); text-decoration: none; }
.nav-item[aria-current="page"] { background: var(--accent-soft); color: var(--accent-deep); font-weight: 600; }
:root[data-theme="light"] .nav-item[aria-current="page"] { color: var(--accent-deep); }
.nav-item svg { width: 17px; height: 17px; flex: none; }
.nav-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-meta { font-size: 12px; font-weight: 600; color: var(--text-faint); white-space: nowrap; }
.nav-item[aria-current="page"] .nav-meta { color: color-mix(in srgb, var(--accent-deep) 70%, transparent); }
.nav-badge {
  min-width: 16px; height: 16px; padding: 0 5px; border-radius: 999px;
  display: inline-grid; place-items: center;
  font-size: 10.5px; font-weight: 700; line-height: 1; color: #2b1407;
  background: var(--grad-buoy);
}

.sb-foot { margin-top: auto; display: grid; gap: 10px; }
.sb-tools { display: flex; align-items: center; gap: 8px; }
.live {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600;
  color: var(--ok); background: color-mix(in srgb, var(--ok) 8%, transparent);
  margin-right: auto;
}
.live .dot { width: 7px; height: 7px; }
.live.is-warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 9%, transparent); }
.live.is-off { color: var(--danger); background: color-mix(in srgb, var(--danger) 9%, transparent); }

.icon-btn {
  position: relative;
  width: 34px; height: 34px; flex: none; border-radius: 11px;
  display: inline-grid; place-items: center;
  border: 1px solid var(--line-soft); background: transparent; color: var(--text-dim);
  cursor: pointer; transition: background-color .12s ease, color .12s ease;
}
.icon-btn:hover { background: var(--bg-hover); color: var(--text); text-decoration: none; }
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn .pip { position: absolute; top: 6px; right: 7px; width: 7px; height: 7px; border-radius: 50%;
  background: var(--grad-buoy); box-shadow: 0 0 0 2px var(--bg-sidebar); }
.icon-btn--plain { border-color: transparent; }
.theme-ic-sun { display: none; }
:root[data-theme="light"] .theme-ic-sun { display: block; }
:root[data-theme="light"] .theme-ic-moon { display: none; }

.usercard {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 9px 9px 10px; border-radius: 14px; background: var(--bg-hover);
}
.avatar {
  width: 32px; height: 32px; flex: none; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 700; letter-spacing: .02em; color: #2b1407;
  background: var(--grad-buoy);
}
.uc-text { flex: 1; min-width: 0; display: grid; line-height: 1.25; }
.uc-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uc-role { font-size: 11px; color: var(--text-faint); }
.usercard form { margin: 0; }
.usercard .icon-btn { width: 30px; height: 30px; border-color: transparent; }

.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.main { width: 100%; max-width: 1240px; padding: 28px 32px 40px; flex: 1; }
.footer {
  display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center;
  padding: 0 32px 24px; max-width: 1240px; font-size: 12px; color: var(--text-faint);
}
.footer a { color: var(--text-dim); }

.mbar { display: none; }
.sb-close { display: none; }
.sb-backdrop { display: none; }

.fakebar {
  margin: 14px 32px 0; padding: 9px 14px; border-radius: var(--r-ctl);
  font-size: 12.5px; color: var(--warn); background: var(--warn-soft);
  border: 1px solid color-mix(in srgb, var(--warn) 22%, transparent);
}
.killbar {
  margin: 0 0 18px; padding: 11px 14px; border-radius: var(--r-ctl);
  color: var(--danger); background: var(--danger-soft); font-weight: 600; font-size: 13px;
}

/* bare pages (login, errors before login) */
.bare { min-height: 100vh; display: grid; place-items: center; padding: 32px 16px; }

/* ------------------------------------------------------------------ page head */

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px 20px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head-text { min-width: 0; flex: 1 1 320px; }
.page-sub { margin-top: 4px; font-size: 13px; color: var(--text-dim); max-width: 72ch; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.title-host { font-family: var(--mono); font-size: 19px; font-weight: 600; letter-spacing: -.01em; overflow-wrap: anywhere; }
.back { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-dim); margin-bottom: 10px; }
.back:hover { color: var(--text); text-decoration: none; }
.back svg { width: 15px; height: 15px; }

.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 26px 0 12px; }
.block-head h2 { font-size: 15px; }
.block-head a { font-size: 13px; }
.block-head .count-pill { margin-right: auto; }

/* ------------------------------------------------------------------ cards */

.card {
  background: var(--bg-raised);
  border: 1px solid var(--card-line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-panel);
  min-width: 0;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px 14px; flex-wrap: wrap; padding: 16px 20px 10px; }
.card-head h2, .card-head h3 { min-width: 0; }
.card-head .sub { font-size: 12px; color: var(--text-faint); }
.card-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.card-body { padding: 4px 20px 18px; }
.card-body > p + p, .card-body > p + .row, .card-body > .row + p { margin-top: 10px; }
.card-note { font-size: 12.5px; color: var(--text-dim); }
.card-flush { padding: 0 0 6px; }
.card + .card { margin-top: 0; }
.subcard { margin-top: 14px; padding: 14px 16px; border-radius: 14px; background: var(--bg-sunken); border: 1px solid var(--line-soft); }
.subcard h3 { margin-bottom: 4px; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.grid-main { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 14px; align-items: start; }

/* KV rows */
.kv { margin: 0; display: grid; }
.kv-row { display: flex; align-items: center; justify-content: space-between; gap: 6px 18px; min-height: 44px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.kv-row:last-child { border-bottom: 0; }
.kv dt { font-size: 13px; color: var(--text-dim); flex: none; max-width: 48%; }
.kv dd { margin: 0; font-size: 13px; text-align: right; min-width: 0; overflow-wrap: anywhere; display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.kv--top .kv-row { align-items: flex-start; }

/* ------------------------------------------------------------------ stat tiles */

.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.tile {
  position: relative; min-width: 0;
  padding: 18px 20px 17px; border-radius: var(--r-card);
  border: 1px solid var(--card-line); box-shadow: var(--shadow-panel);
  background: linear-gradient(140deg, var(--tint, var(--tint-navy)) 0%, transparent 72%), var(--bg-raised);
}
.tile--aqua { --tint: var(--tint-aqua); }
.tile--navy { --tint: var(--tint-navy); }
.tile--sand { --tint: var(--tint-sand); }
.tile--sage { --tint: var(--tint-sage); }
.tile--rose { --tint: var(--tint-rose); }
.tile-label { font-size: 12px; color: var(--text-dim); font-weight: 500; }
.tile-value { margin-top: 10px; font-family: var(--display); font-size: 26px; font-weight: 600; line-height: 1.1; letter-spacing: -.02em; overflow-wrap: anywhere; }
.tile-unit { font-family: var(--font); font-size: 13px; font-weight: 600; color: var(--text-dim); letter-spacing: 0; margin-left: 3px; }
.tile-value.money .tile-unit { color: inherit; opacity: .8; }
.tile-sub { margin-top: 8px; font-size: 12px; color: var(--text-dim); display: flex; gap: 4px 12px; flex-wrap: wrap; }
.tile-btn { position: absolute; top: 14px; right: 14px; width: 30px; height: 30px; border-radius: 10px;
  background: color-mix(in srgb, var(--bg-raised) 60%, transparent); border-color: var(--line-soft); }
.down { color: var(--accent); font-weight: 600; }
.up { color: var(--ok); font-weight: 600; }

/* compact stat strip (route page) */
.stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; }
.stat { padding: 14px 18px; border-left: 1px solid var(--line-soft); min-width: 0; }
.stat:first-child { border-left: 0; }
.stat-k { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-faint); }
.stat-v { margin-top: 4px; font-size: 18px; font-weight: 700; white-space: nowrap; }
.stat-v small { font-size: 12px; font-weight: 600; color: var(--text-dim); }
.stat-s { font-size: 11.5px; color: var(--text-faint); margin-top: 2px; }

/* ------------------------------------------------------------------ chips, dots */

.chip {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; line-height: 1.45; white-space: nowrap;
  color: var(--text-dim); background: var(--neutral-soft);
}
.chip.tone-ok { color: var(--ok); background: var(--ok-soft); }
.chip.tone-warn { color: var(--warn); background: var(--warn-soft); }
.chip.tone-bad, .chip.tone-danger { color: var(--danger); background: var(--danger-soft); }
.chip.tone-info { color: var(--accent-deep); background: var(--accent-soft); }
.chip.tone-neutral, .chip.tone-muted { color: var(--text-dim); background: var(--neutral-soft); }
.chip.tone-off { color: var(--danger); background: transparent; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--danger) 45%, transparent); }
.chip--sm { font-size: 11px; padding: 1px 8px; }

.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; display: inline-block; background: var(--text-faint); }
.dot.on { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 18%, transparent); animation: pulse 2.6s ease-in-out infinite; }
.dot.off { background: var(--danger); box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 16%, transparent); }
.dot.warn { background: var(--warn); }
.live .dot { background: currentColor; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 18%, transparent); }
.live.is-ok .dot { animation: pulse 2.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }

.count-pill { display: inline-block; padding: 0 7px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--neutral-soft); color: var(--text-dim); }

/* ------------------------------------------------------------------ buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 36px; padding: 8px 16px; border-radius: var(--r-ctl);
  border: 1px solid var(--line); background: transparent; color: var(--text);
  font-size: 13px; font-weight: 600; line-height: 1.2; white-space: nowrap;
  cursor: pointer; text-decoration: none;
  transition: background-color .12s ease, border-color .12s ease, color .12s ease, opacity .12s ease;
}
.btn:hover { background: var(--bg-hover); text-decoration: none; }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn-primary { background: var(--text); color: var(--bg-raised); border-color: var(--text); }
.btn-primary:hover { background: color-mix(in srgb, var(--text) 86%, var(--bg)); }
.btn-accent { background: var(--accent); color: var(--accent-contrast); border-color: var(--accent); }
.btn-accent:hover { background: color-mix(in srgb, var(--accent) 86%, var(--bg)); }
.btn-danger { background: var(--danger); color: #1c0607; border-color: var(--danger); }
:root[data-theme="light"] .btn-danger { color: #fff; }
.btn-danger:hover { background: color-mix(in srgb, var(--danger) 86%, var(--bg)); }
.btn-ghost-danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.btn-ghost-danger:hover { background: var(--danger-soft); }
.btn-sm, .btn-small { min-height: 30px; padding: 5px 11px; font-size: 12.5px; border-radius: 10px; }
.btn-block { width: 100%; min-height: 44px; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.btn[data-copied] { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 45%, transparent); }
.linkbtn { border: 0; background: none; padding: 0; color: var(--link); cursor: pointer; font-weight: 500; }
.linkbtn:hover { text-decoration: underline; text-underline-offset: 3px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ------------------------------------------------------------------ forms */

.form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field label, .label { font-size: 12.5px; font-weight: 500; color: var(--text-dim); }
.field input, .field select, .field textarea, .input {
  width: 100%; min-height: 42px; padding: 9px 13px;
  border-radius: var(--r-ctl); border: 1px solid var(--line);
  background: var(--bg-input); color: var(--text);
  font-size: 14px; transition: border-color .12s ease, box-shadow .12s ease;
}
.field textarea { min-height: 84px; resize: vertical; line-height: 1.45; }
.field textarea.mono { font-size: 12px; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: color-mix(in srgb, var(--text-dim) 45%, var(--line)); }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus-ring); }
.field input[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-color: var(--danger); }
.field input[type="file"] { padding: 8px; min-height: 0; }
.field select { appearance: none; padding-right: 34px;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-dim) 50%), linear-gradient(135deg, var(--text-dim) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.hint { font-size: 12px; color: var(--text-faint); }
.error { font-size: 12.5px; color: var(--danger); font-weight: 500; }
.inline-fields { display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap; }
.inline-fields > .btn { margin-top: 27px; }
.inline-fields > .field { flex: 1 1 160px; }
.field--narrow { flex: 0 0 110px !important; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { font-size: 12.5px; font-weight: 500; color: var(--text-dim); padding: 0; margin-bottom: 8px; }
.check { display: flex; align-items: flex-start; gap: 9px; font-size: 13px; cursor: pointer; }
.check input { margin: 2px 0 0; width: 16px; height: 16px; accent-color: var(--accent); flex: none; }
.code-input { font-family: var(--mono) !important; font-size: 20px !important; letter-spacing: .3em; text-align: center; }
.filters { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 14px; }
.filters .field { flex: 0 1 260px; }

/* choice cards (wizard, exit form) */
.choices { display: grid; gap: 10px; }
.choices--cols { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.choice { position: relative; display: flex; gap: 12px; padding: 14px 16px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--bg-input); cursor: pointer; transition: border-color .12s ease, background-color .12s ease; }
.choice:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.choice input { margin: 3px 0 0; accent-color: var(--accent); width: 16px; height: 16px; flex: none; }
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.choice:has(input:disabled) { opacity: .5; cursor: not-allowed; }
.choice-body { display: grid; gap: 3px; min-width: 0; }
.choice-title { font-weight: 600; font-size: 13.5px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.choice-price { font-size: 17px; font-weight: 700; color: var(--accent-2); }
.choice-meta { font-size: 12px; color: var(--text-dim); }
.choice-tag { font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--neutral-soft); color: var(--text-dim); justify-self: start; }
.tag { font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--neutral-soft); color: var(--text-dim); }
.cert-step:has(input[name="ca_mode"][value="custom"]:not(:checked)) .custom-only,
.exit-form:has(input[name="ca_mode"][value="custom"]:not(:checked)) .custom-only { display: none; }
.cert-step:has(input[name="ca_mode"][value="issued"]:not(:checked)) .issued-only,
.exit-form:has(input[name="ca_mode"][value="issued"]:not(:checked)) .issued-only { display: none; }

/* ------------------------------------------------------------------ alerts, notices */

.alert { padding: 11px 14px; border-radius: var(--r-ctl); font-size: 13px; color: var(--danger); background: var(--danger-soft);
  border: 1px solid color-mix(in srgb, var(--danger) 25%, transparent); margin-bottom: 14px; }
.alert a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.alert--ok { color: var(--ok); background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 25%, transparent); }
.alert--warn { color: var(--warn); background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 25%, transparent); }
.alert--info { color: var(--text); background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 22%, transparent); }
.card-body .alert:last-child, .stack > .alert { margin-bottom: 0; }

.notices { display: grid; gap: 8px; margin-bottom: 18px; }
.notice { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px 12px 16px; border-radius: 14px;
  background: var(--bg-raised); border: 1px solid var(--card-line); box-shadow: var(--shadow-panel); position: relative; overflow: hidden; }
.notice::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent); }
.notice-warning::before { background: var(--warn); }
.notice-danger::before { background: var(--danger); }
.notice-success::before { background: var(--ok); }
.notice-text { flex: 1; font-size: 13px; min-width: 0; }
.notice-when { font-size: 11.5px; color: var(--text-faint); margin-top: 2px; }
.notice form { margin: 0; flex: none; }
.notice.is-read { opacity: .62; box-shadow: none; }

.hint-box { padding: 11px 14px; border-radius: var(--r-ctl); background: var(--bg-sunken); border: 1px solid var(--line-soft); font-size: 12.5px; color: var(--text-dim); }
.hint-list { list-style: none; padding: 0; display: grid; gap: 6px; }
.hint-list li { padding-left: 14px; position: relative; }
.hint-list li::before { content: ""; position: absolute; left: 0; top: .6em; width: 5px; height: 5px; border-radius: 50%; background: var(--text-faint); }
.empty { padding: 30px 22px; text-align: center; color: var(--text-dim); }
.empty strong { display: block; color: var(--text); font-size: 15px; margin-bottom: 6px; }
.empty .actions { justify-content: center; margin-top: 16px; }
.soon { color: var(--text-dim); font-size: 13px; }

/* one-time secrets (password, key) */
.once { padding: 16px 18px; border-radius: 16px; background: var(--tint-sand); border: 1px solid color-mix(in srgb, var(--accent-2) 30%, transparent); }
.once > strong { display: block; color: var(--accent-2); font-size: 14px; margin-bottom: 4px; }
.once .kv-row { border-color: color-mix(in srgb, var(--accent-2) 18%, transparent); }
.once h3 { margin: 12px 0 6px; font-size: 12.5px; color: var(--text-dim); }

/* ------------------------------------------------------------------ copy rows, code */

.copyrow { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; min-width: 0; flex-wrap: wrap; justify-content: flex-end; }
.copyrow .value { font-family: var(--mono); font-size: 12.5px; overflow-wrap: anywhere; }
.copyrow .value.masked { color: var(--text-dim); letter-spacing: .02em; }
.btn-copy { border: 1px solid var(--line); background: transparent; color: var(--text-dim); border-radius: 8px;
  padding: 3px 9px; font-size: 11.5px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.btn-copy:hover { color: var(--text); background: var(--bg-hover); }
.btn-copy[data-copied] { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 45%, transparent); }

.code { border-radius: 14px; background: var(--bg-sunken); border: 1px solid var(--line-soft); overflow: hidden; min-width: 0; }
.code-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 8px 7px 14px; border-bottom: 1px solid var(--line-soft); }
.code-title { font-size: 12px; font-weight: 600; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.code-title .mono { font-size: 11.5px; color: var(--text-faint); font-weight: 400; }
.code pre { margin: 0; padding: 12px 14px; overflow-x: auto; font-size: 12px; line-height: 1.55; white-space: pre; tab-size: 2; color: var(--text); max-height: 420px; }
.code--wrap pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.code + .code { margin-top: 10px; }
.tk-key { color: var(--code-key); }
.tk-str { color: var(--code-str); }
.tk-num { color: var(--code-num); }
.tk-com { color: var(--text-faint); }

details.fold > summary { list-style: none; cursor: pointer; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold[open] > summary .when-closed { display: none; }
details.fold:not([open]) > summary .when-open { display: none; }
details.fold > .fold-body { margin-top: 10px; }
.disclose { display: block; }
.disclose > summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; cursor: pointer; list-style: none; font-size: 13px; font-weight: 600; }
.disclose > summary::-webkit-details-marker { display: none; }
.disclose > summary::after { content: ""; width: 8px; height: 8px; border-right: 1.6px solid var(--text-faint); border-bottom: 1.6px solid var(--text-faint); transform: rotate(45deg); margin-right: 4px; transition: transform .15s ease; }
.disclose[open] > summary::after { transform: rotate(-135deg); }
.disclose + .disclose { border-top: 1px solid var(--line-soft); }

/* ------------------------------------------------------------------ tables */

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-faint);
  padding: 10px 14px; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
.table td { padding: 8px 14px; height: 52px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background-color .1s ease; }
.table tbody tr:hover { background: var(--bg-hover); }
.table th:first-child, .table td:first-child { padding-left: 20px; }
.table th:last-child, .table td:last-child { padding-right: 20px; }
.table .num { text-align: right; }
.table .sub { font-size: 12px; color: var(--text-faint); }
.table .when { white-space: nowrap; color: var(--text-dim); }
.rowlink { color: var(--text); font-weight: 600; }
.rowlink:hover { text-decoration: none; color: var(--accent-deep); }
tr.is-link { position: relative; cursor: pointer; }
tr.is-link .rowlink::after { content: ""; position: absolute; inset: 0; }
tr.is-link td a:not(.rowlink), tr.is-link td form, tr.is-link td button { position: relative; z-index: 1; }
.table-empty { padding: 22px 20px; color: var(--text-dim); font-size: 13px; }
.pager { padding: 12px 20px 8px; font-size: 13px; }
.host { font-family: var(--mono); font-weight: 600; font-size: 13px; }

/* ------------------------------------------------------------------ route cards */

.rcards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.rcard { display: grid; gap: 10px; padding: 16px 18px 12px; color: var(--text); transition: border-color .12s ease, transform .12s ease; }
.rcard:hover { text-decoration: none; border-color: var(--line); }
.rcard-top { display: flex; align-items: center; gap: 10px; min-width: 0; }
.rcard-host { font-family: var(--mono); font-weight: 600; font-size: 13.5px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.rcard-note { font-size: 12px; color: var(--text-dim); margin-top: -6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rcard-path { font-family: var(--mono); font-size: 12px; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rcard-speed { font-size: 22px; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.rcard-speed .unit { font-size: 12.5px; color: var(--text-dim); font-weight: 600; }
.rcard-speed .quiet { color: var(--text-faint); font-size: 15px; font-weight: 600; }
.rcard-foot { display: flex; justify-content: space-between; gap: 10px; padding-top: 10px; border-top: 1px solid var(--line-soft); font-size: 12px; }
.rcard-foot .mono { color: var(--text-faint); font-size: 11.5px; }
.health { display: inline-flex; align-items: center; gap: 6px; color: var(--text-dim); white-space: nowrap; }
.health::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--text-faint); }
.health.is-up { color: var(--ok); }
.health.is-up::before { background: var(--ok); }
.health.is-down { color: var(--danger); }
.health.is-down::before { background: var(--danger); }

/* ------------------------------------------------------------------ tabs, segmented */

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line-soft); margin: 4px 0 18px; overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: 10px 14px; font-size: 13.5px; font-weight: 600; color: var(--text-dim); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a[aria-current="page"] { color: var(--text); border-bottom-color: var(--accent); }

.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 12px; background: var(--bg-sunken); border: 1px solid var(--line-soft); }
.seg a { padding: 5px 12px; border-radius: 9px; font-size: 12.5px; font-weight: 600; color: var(--text-dim); white-space: nowrap; }
.seg a:hover { color: var(--text); text-decoration: none; }
.seg a[aria-current="page"] { background: var(--bg-raised); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .2); }

/* ------------------------------------------------------------------ the «переправа» strip */

.crossing { display: grid; grid-template-columns: minmax(0, 1fr) minmax(120px, 1.1fr) minmax(0, 1fr); align-items: center; gap: 4px 14px; padding: 16px 20px; }
.bank { display: grid; gap: 2px; min-width: 0; }
.bank--exit { text-align: right; justify-items: end; }
.bank-label { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-faint); }
.bank-host { font-family: var(--mono); font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.bank-state { font-size: 12px; color: var(--text-dim); }
.bank.is-up .bank-state { color: var(--ok); }
.bank.is-down .bank-state { color: var(--danger); }
.river { display: grid; justify-items: center; gap: 2px; min-width: 0; }
.river svg { width: 100%; height: 34px; }
.river .water { fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linecap: round; opacity: .55; }
.river .water + .water { opacity: .3; }
.river .cable { stroke: var(--text-faint); stroke-width: 1; stroke-dasharray: 3 4; }
.river .hull { fill: var(--accent-2); }
.river .cabin { fill: none; stroke: var(--accent-2); stroke-width: 1.6; stroke-linejoin: round; }
.crossing.is-still .river .water { stroke: var(--text-faint); }
.crossing.is-still .river .hull { fill: var(--text-faint); }
.crossing.is-still .river .cabin { stroke: var(--text-faint); }
.river-rate { font-size: 12px; font-weight: 600; color: var(--text-dim); white-space: nowrap; }
@media (prefers-reduced-motion: no-preference) {
  .crossing.is-moving .river .boat { animation: sail 7s ease-in-out infinite alternate; }
}
@keyframes sail { from { transform: translateX(-26px); } to { transform: translateX(26px); } }

/* ------------------------------------------------------------------ charts, meters */

.chart { width: 100%; height: 150px; }
.chart--sm { height: 80px; }
.chart .grid { stroke: var(--line-soft); stroke-width: 1; }
.chart .area-down { fill: color-mix(in srgb, var(--accent) 22%, transparent); }
.chart .line-down { fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linejoin: round; }
.chart .line-up { fill: none; stroke: var(--ok); stroke-width: 1.5; stroke-linejoin: round; }
.chart .line-dim { fill: none; stroke: var(--accent-2); stroke-width: 1.5; stroke-linejoin: round; }
.chart .cap { stroke: var(--danger); stroke-width: 1; stroke-dasharray: 4 4; opacity: .7; }
.chart .bar-5xx { fill: var(--danger); }
.chart .bar-429 { fill: var(--warn); }
.chart .bar-none { fill: var(--line-soft); }
.chart-meta { display: flex; justify-content: space-between; gap: 10px; font-size: 11.5px; color: var(--text-faint); margin-top: 6px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-dim); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 3px; border-radius: 2px; display: inline-block; background: var(--accent); }
.legend .lg-up { background: var(--ok); }
.legend .lg-dim { background: var(--accent-2); }
.legend .lg-cap { background: var(--danger); }
.legend .lg-429 { background: var(--warn); }
.legend .lg-5xx { background: var(--danger); }

.meter { display: grid; gap: 6px; }
.bar { height: 6px; border-radius: 999px; background: var(--line-soft); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.bar.is-hot > span { background: var(--warn); }
.w0 { width: 0; } .w5 { width: 5%; } .w10 { width: 10%; } .w15 { width: 15%; } .w20 { width: 20%; } .w25 { width: 25%; }
.w30 { width: 30%; } .w35 { width: 35%; } .w40 { width: 40%; } .w45 { width: 45%; } .w50 { width: 50%; } .w55 { width: 55%; }
.w60 { width: 60%; } .w65 { width: 65%; } .w70 { width: 70%; } .w75 { width: 75%; } .w80 { width: 80%; } .w85 { width: 85%; }
.w90 { width: 90%; } .w95 { width: 95%; } .w100 { width: 100%; }

/* ------------------------------------------------------------------ balance */

.balance-big { font-family: var(--display); font-size: 34px; font-weight: 600; letter-spacing: -.02em; line-height: 1.1; color: var(--accent-2); }
.balance-big.neg { color: var(--danger); }
.presets { display: flex; gap: 8px; flex-wrap: wrap; }
.preset { padding: 6px 12px; border-radius: 10px; border: 1px solid var(--line); font-size: 12.5px; font-weight: 600; color: var(--text); }
.preset:hover { background: var(--bg-hover); text-decoration: none; }
.preset span { color: var(--text-dim); font-weight: 500; margin-left: 4px; }
.requisites { white-space: pre-wrap; font-size: 13px; }
.ops { list-style: none; padding: 0; margin: 0; }
.op { border-bottom: 1px solid var(--line-soft); }
.op:last-child { border-bottom: 0; }
.op-row { display: flex; align-items: center; gap: 12px; padding: 11px 20px; min-height: 56px; }
.op-ic { width: 32px; height: 32px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--neutral-soft); color: var(--text-dim); }
.op-ic svg { width: 16px; height: 16px; }
.op-ic.is-in { background: var(--ok-soft); color: var(--ok); }
.op-ic.is-out { background: var(--accent-soft); color: var(--accent); }
.op-main { flex: 1; min-width: 0; display: grid; gap: 1px; }
.op-title { font-size: 13px; font-weight: 600; }
.op-sub { font-size: 12px; color: var(--text-faint); overflow-wrap: anywhere; }
.op-amt { text-align: right; font-weight: 700; font-size: 13.5px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.op-amt small { display: block; font-size: 11.5px; font-weight: 500; color: var(--text-faint); }
details.op > summary { list-style: none; cursor: pointer; }
details.op > summary::-webkit-details-marker { display: none; }
details.op > summary:hover { background: var(--bg-hover); }
details.op > summary .op-title::after { content: " ▾"; color: var(--text-faint); font-size: 11px; }
details.op[open] > summary .op-title::after { content: " ▴"; }
.op-hours { padding: 0 20px 10px 64px; display: grid; gap: 2px; font-size: 12px; color: var(--text-dim); }
.op-hours div { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; border-bottom: 1px dashed var(--line-soft); font-variant-numeric: tabular-nums; }
.op-hours div:last-child { border-bottom: 0; }
.day-head { padding: 12px 20px 4px; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-faint); }

/* ------------------------------------------------------------------ guide */

.steps-guide { counter-reset: g; display: grid; gap: 22px; list-style: none; padding-top: 20px !important; }
.gstep { counter-increment: g; display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 0 14px; }
.gstep::before { content: counter(g); width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; font-weight: 700; font-size: 13px;
  background: var(--accent-soft); color: var(--accent-deep); grid-row: span 3; }
.gstep h2 { font-size: 15px; margin-top: 4px; }
.gstep .gbody { display: grid; gap: 10px; margin-top: 8px; font-size: 13.5px; color: var(--text-dim); max-width: 78ch; }
.gstep .gbody strong { color: var(--text); }
.prose { max-width: 74ch; }
.prose h2 { font-size: 15px; margin: 22px 0 8px; }
.prose p, .prose li { font-size: 13.5px; color: var(--text-dim); }
.prose li + li { margin-top: 4px; }

/* ------------------------------------------------------------------ danger zone */

.danger-zone { border-color: color-mix(in srgb, var(--danger) 30%, transparent) !important;
  background: linear-gradient(140deg, var(--tint-rose) 0%, transparent 65%), var(--bg-raised); }
.danger-zone h2 { color: var(--danger); }
.danger-zone .card-body p { color: var(--text-dim); font-size: 13px; }

/* ------------------------------------------------------------------ wizard */

.wizard { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 14px; align-items: start; }
.steps { list-style: none; padding: 0; margin: 0 0 14px; display: flex; gap: 6px; flex-wrap: wrap; counter-reset: s; }
.steps li { counter-increment: s; font-size: 12px; font-weight: 600; color: var(--text-faint); padding: 5px 11px 5px 7px; border-radius: 999px; background: var(--bg-raised); border: 1px solid var(--card-line); display: inline-flex; gap: 7px; align-items: center; }
.steps li::before { content: counter(s); width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 10.5px; background: var(--neutral-soft); }
.steps li.is-done { color: var(--text-dim); }
.steps li.is-done::before { background: var(--ok-soft); color: var(--ok); }
.steps li.is-current { color: var(--accent-deep); background: var(--accent-soft); border-color: transparent; }
.steps li.is-current::before { background: var(--accent); color: var(--accent-contrast); }
.wizard-step { padding: 20px 22px 18px; display: grid; gap: 14px; }
.wizard-step h2 { font-size: 17px; }
.lead { font-size: 13.5px; color: var(--text-dim); max-width: 72ch; }
.wizard-nav { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 6px; border-top: 1px solid var(--line-soft); margin-top: 4px; padding-top: 14px; }
.summary { padding: 16px 20px; position: sticky; top: 14px; }
.summary h3 { margin-bottom: 6px; }
.result { padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); display: grid; gap: 4px; }
.result.is-ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
.result.is-bad { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.result-title { font-weight: 700; font-size: 14px; }
.result.is-ok .result-title { color: var(--ok); }
.result.is-bad .result-title { color: var(--danger); }
.result p { font-size: 13px; }
.tech { font-family: var(--mono); font-size: 11.5px; color: var(--text-faint); }
.cmd-list h3 { font-size: 12.5px; color: var(--text-dim); margin: 6px 0; }

/* ------------------------------------------------------------------ login card */

.login { width: 100%; max-width: 440px; padding: 30px 30px 26px; border-radius: 24px; background: var(--bg-raised);
  border: 1px solid var(--card-line); box-shadow: var(--shadow-panel), var(--shadow-pop); }
.login--wide { max-width: 560px; }
.login .brand { margin-bottom: 18px; }
.login .wordmark { font-size: 18px; }
.login h1 { font-size: 19px; margin-bottom: 4px; }
.login-sub { color: var(--text-dim); font-size: 13.5px; margin-bottom: 20px; }
.login .form { gap: 14px; }
.login .field label { text-transform: lowercase; font-size: 12px; }
.login-foot { margin-top: 18px; font-size: 12px; color: var(--text-faint); }
.login .alert { margin-bottom: 16px; }
.login-theme { position: fixed; top: 16px; right: 16px; }

/* ------------------------------------------------------------------ responsive */

@media (max-width: 1180px) {
  .grid-main { grid-template-columns: minmax(0, 1fr); }
  .wizard { grid-template-columns: minmax(0, 1fr); }
  .summary { position: static; }
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stat:nth-child(4) { border-left: 0; }
  .stat:nth-child(n+4) { border-top: 1px solid var(--line-soft); }
}

@media (max-width: 960px) {
  .shell { display: block; }
  .mbar {
    display: flex; align-items: center; gap: 10px;
    position: sticky; top: 0; z-index: 30;
    padding: 10px 16px; background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line-soft);
  }
  .mbar .brand { margin-right: auto; }
  .mbar .mark { width: 34px; height: 34px; border-radius: 10px; }
  .mbar .mark svg { width: 22px; height: 22px; }
  .sidebar {
    position: fixed; z-index: 60; top: 10px; left: 10px; bottom: 10px;
    height: auto; margin: 0; width: min(300px, calc(100vw - 40px));
    transform: translateX(calc(-100% - 24px)); visibility: hidden;
    transition: transform .22s ease, visibility 0s linear .22s;
    box-shadow: var(--shadow-panel), var(--shadow-pop);
  }
  .sidebar.is-open, .sidebar:target { transform: none; visibility: visible; transition: transform .22s ease, visibility 0s; }
  .sb-close { display: inline-grid; }
  .sb-backdrop { display: block; position: fixed; inset: 0; z-index: 55; background: var(--backdrop); opacity: 0; pointer-events: none; transition: opacity .2s ease; }
  .nav-open .sb-backdrop { opacity: 1; pointer-events: auto; }
  .main { padding: 18px 16px 32px; }
  .footer { padding: 0 16px 22px; }
  .fakebar { margin: 12px 16px 0; }
  .tiles { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .rcards, .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .crossing { grid-template-columns: minmax(0, 1fr); }
  .bank--exit { text-align: left; justify-items: start; }
  .river { justify-items: start; }
  .river svg { max-width: 220px; }
}

@media (max-width: 720px) {
  .table--stack thead { display: none; }
  .table--stack, .table--stack tbody, .table--stack tr, .table--stack td { display: block; width: 100%; }
  .table--stack tr { padding: 10px 16px; border-bottom: 1px solid var(--line-soft); }
  .table--stack tbody tr:last-child { border-bottom: 0; }
  .table--stack td { height: auto; padding: 4px 0 !important; border: 0; display: block; text-align: right; overflow-wrap: anywhere; }
  .table--stack td::before { content: attr(data-label); float: left; margin-right: 14px; color: var(--text-faint); font-size: 12px; line-height: 1.9; }
  .table--stack td[data-label=""]::before { content: none; }
  .table--stack td .row { justify-content: flex-end; }
  .table--stack .num { text-align: right; }
  .table--stack tr.is-link .rowlink::after { content: none; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { border-left: 0 !important; border-top: 1px solid var(--line-soft); }
  .stat:nth-child(-n+2) { border-top: 0; }
  .kv-row { flex-wrap: wrap; }
  .kv dt { max-width: none; }
  .kv dd { justify-content: flex-start; text-align: left; width: 100%; }
  .page-actions { width: 100%; }
  .wizard-step { padding: 16px; }
  .op-row { padding: 10px 16px; }
  .op-hours { padding-left: 16px; padding-right: 16px; }
  .login { padding: 24px 20px 22px; }
  .card-head { padding: 14px 16px 8px; }
  .card-body { padding: 4px 16px 16px; }
  .table th:first-child, .table td:first-child { padding-left: 16px; }
  .table th:last-child, .table td:last-child { padding-right: 16px; }
}

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

@media print {
  .sidebar, .mbar, .footer, .fakebar { display: none !important; }
  .main { padding: 0; }
}
