/* =========================================================================================
   Clearway cabinet — design system «Flow» (v3, 10.10.2026)

   One idea runs through it: this product moves traffic, so the interface shows movement where
   something actually flows — route lines carry packets, the balance bar streams, live states
   breathe — and stays still everywhere else. Motion stops for prefers-reduced-motion.

   Structure: tokens → base → layout/shell → primitives (buttons, badges, fields) → surfaces
   (cards, callouts, tables) → patterns (route, entries, steps…) → utilities.
   Light by default; dark by system preference or [data-theme]. Text pairs are ≥ 4.5:1.
   ========================================================================================= */

/* Fonts from our own server. Google Fonts did not load from parts of the Russian network
   (12.10.2026: the cabinet fell back to system fonts and pages waited 30 s+ on the stylesheet).
   Variable fonts: one file per script covers every weight; cyrillic is what most pages need. */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("/static/fonts/inter-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: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("/static/fonts/inter-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: "JetBrains Mono"; font-style: normal; font-weight: 100 800; font-display: swap;
  src: url("/static/fonts/jetbrains-mono-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: "JetBrains Mono"; font-style: normal; font-weight: 100 800; font-display: swap;
  src: url("/static/fonts/jetbrains-mono-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; }

/* ---------- tokens ---------- */
:root {
  --bg: #F5F7F6;
  --bg-grid: rgba(13, 21, 19, .045);
  --surface: #FFFFFF;
  --surface-2: #F3F5F4;
  --surface-3: #E8EDEA;
  --side: #FAFBFA;
  --line: rgba(13, 21, 19, .09);
  --line-strong: rgba(13, 21, 19, .16);
  --text: #0C1412;
  --text-2: #475651;
  --text-3: #66746E;

  --mint: #6EE7C0;
  --mint-2: #3CCB9F;
  --mint-3: #13A37A;
  --accent-text: #087250;
  --accent-soft: #E3F8F0;
  --accent-fg: #04201A;
  --flow: linear-gradient(90deg, #13A37A, #6EE7C0 55%, #A8F7DC);

  --ok: #0E7A51;   --ok-bg: #E5F6EE;
  --warn: #8A5200; --warn-bg: #FFF2DB;
  --err: #B92F28;  --err-bg: #FCEBEA;
  --info: #1E55C6; --info-bg: #E9F0FD;
  --on-err: #FFFFFF; --on-ok: #FFFFFF;
  --focus: #12A37A;

  --shadow-xs: 0 1px 0 rgba(13, 21, 19, .03);
  --shadow-sm: 0 1px 2px rgba(13, 21, 19, .05);
  --shadow: 0 1px 2px rgba(13, 21, 19, .04), 0 8px 24px rgba(13, 21, 19, .06);
  --shadow-lg: 0 18px 48px rgba(13, 21, 19, .16), 0 2px 6px rgba(13, 21, 19, .06);
  --overlay: rgba(8, 12, 11, .45);
  color-scheme: light;

  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Consolas, monospace;
  --r-xs: 6px; --r-sm: 8px; --r: 10px; --r-lg: 14px; --r-xl: 18px; --r-pill: 999px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px;
  --side-w: 252px; --header-h: 58px; --tabbar-h: 62px; --wrap: 1060px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #07090C; --bg-grid: rgba(110, 231, 192, .05);
    --surface: #0E1318; --surface-2: #131A21; --surface-3: #1A232C; --side: #0A0E12;
    --line: rgba(232, 237, 243, .09); --line-strong: rgba(232, 237, 243, .16);
    --text: #E9EEF2; --text-2: #A5B1BD; --text-3: #8592A0;
    --accent-text: #74EBC4; --accent-soft: rgba(110, 231, 192, .1); --accent-fg: #04201A;
    --ok: #5BE2A7; --ok-bg: rgba(91, 226, 167, .1);
    --warn: #F4B75A; --warn-bg: rgba(244, 183, 90, .1);
    --err: #F2877F; --err-bg: rgba(242, 135, 127, .1);
    --info: #89B0FF; --info-bg: rgba(137, 176, 255, .1);
    --on-err: #2A0806; --on-ok: #04150E; --focus: #6EE7C0;
    --shadow-xs: none; --shadow-sm: none;
    --shadow: 0 0 0 1px var(--line), 0 12px 32px rgba(0, 0, 0, .4);
    --shadow-lg: 0 0 0 1px var(--line), 0 24px 64px rgba(0, 0, 0, .6);
    --overlay: rgba(0, 0, 0, .62);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #07090C; --bg-grid: rgba(110, 231, 192, .05);
  --surface: #0E1318; --surface-2: #131A21; --surface-3: #1A232C; --side: #0A0E12;
  --line: rgba(232, 237, 243, .09); --line-strong: rgba(232, 237, 243, .16);
  --text: #E9EEF2; --text-2: #A5B1BD; --text-3: #8592A0;
  --accent-text: #74EBC4; --accent-soft: rgba(110, 231, 192, .1); --accent-fg: #04201A;
  --ok: #5BE2A7; --ok-bg: rgba(91, 226, 167, .1);
  --warn: #F4B75A; --warn-bg: rgba(244, 183, 90, .1);
  --err: #F2877F; --err-bg: rgba(242, 135, 127, .1);
  --info: #89B0FF; --info-bg: rgba(137, 176, 255, .1);
  --on-err: #2A0806; --on-ok: #04150E; --focus: #6EE7C0;
  --shadow-xs: none; --shadow-sm: none;
  --shadow: 0 0 0 1px var(--line), 0 12px 32px rgba(0, 0, 0, .4);
  --shadow-lg: 0 0 0 1px var(--line), 0 24px 64px rgba(0, 0, 0, .6);
  --overlay: rgba(0, 0, 0, .62);
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 450 14.5px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01", "ss03"; }
h1, h2, h3, h4 { margin: 0; color: var(--text); font-weight: 650; line-height: 1.2; }
h1 { font-size: 28px; letter-spacing: -.028em; }
h2 { font-size: 17px; letter-spacing: -.016em; }
h3 { font-size: 15px; letter-spacing: -.01em; }
p { margin: 0; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
strong, b { font-weight: 650; }
code, kbd, .mono { font-family: var(--mono); font-size: .875em; font-variant-ligatures: none; }
code { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-xs); padding: 1px 5px; word-break: break-all; }
img, svg { vertical-align: middle; }
hr { border: 0; border-top: 1px solid var(--line); margin: var(--s5) 0; }
::selection { background: var(--mint); color: var(--accent-fg); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--r-sm); }
::placeholder { color: var(--text-3); opacity: 1; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--surface); padding: 8px 12px; border-radius: var(--r-sm); box-shadow: var(--shadow); }
.skip-link:focus { left: 8px; }
.no-js [role="tabpanel"][hidden] { display: block !important; }

/* motion vocabulary — only for things that really flow */
@keyframes flow-x { to { background-position: -48px 0; } }
@keyframes flow-y { to { background-position: 0 -48px; } }
/* opacity only: composited by the GPU, no repaint per frame (a box-shadow pulse repainted
   every dot on every frame and made long server lists stutter on phones) */
@keyframes breathe { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes sheen { from { transform: translateX(-100%); } to { transform: translateX(260%); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pop-in { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- shell ---------- */
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--s6); }
.app-main { padding: var(--s6) 0 var(--s8); min-height: calc(100vh - 60px); }
.app-footer { color: var(--text-3); font-size: 12.5px; padding: var(--s5) 0 var(--s6); text-align: center; }
.app-footer a { color: var(--text-3); }

/* faint data grid behind the top of every page — the "network" the product lives in */
.shell-main { position: relative; isolation: isolate; }
.shell-main::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 340px; z-index: -1; pointer-events: none;
  background-image: radial-gradient(var(--bg-grid) 1px, transparent 1.2px); background-size: 22px 22px;
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent); mask-image: linear-gradient(to bottom, #000, transparent); }

/* logo */
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none !important;
  font: 700 19px/1 var(--sans); letter-spacing: -.04em; }
.logo-mark { width: 30px; height: 30px; flex: none; border-radius: 9px; box-shadow: 0 6px 16px rgba(13, 60, 48, .25); }
.logo .logo-text { color: var(--text); }
.logo .logo-text > span { color: var(--accent-text); }

/* sidebar (≥ 1100px) */
.sidebar { display: none; }
@media (min-width: 1100px) {
  body.has-shell .app-header { display: none; }
  body.has-shell .shell-main { margin-left: var(--side-w); }
  body.has-shell .app-main { padding-top: var(--s7); }
  body.has-shell .sidebar {
    display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; width: var(--side-w); z-index: 30;
    background: var(--side); border-right: 1px solid var(--line); padding: var(--s4) var(--s3) var(--s3);
  }
}
.side-top { padding: 6px 10px var(--s4); }
.sidenav { display: flex; flex-direction: column; gap: 1px; flex: 1; overflow-y: auto; margin: 0 -2px; padding: 0 2px; }
.sidenav-label { padding: var(--s4) 10px 6px; font-size: 11px; font-weight: 650; letter-spacing: .09em; text-transform: uppercase; color: var(--text-3); }
.sidenav-label:first-child { padding-top: 4px; }
.sidenav a { position: relative; display: flex; align-items: center; gap: 11px; height: 36px; padding: 0 10px; border-radius: var(--r-sm);
  color: var(--text-2); font-weight: 520; font-size: 14px; text-decoration: none !important; transition: background .15s var(--ease), color .15s; }
.sidenav a svg { width: 18px; height: 18px; flex: none; color: var(--text-3); transition: color .15s; }
.sidenav a:hover { background: var(--surface-2); color: var(--text); }
.sidenav a:hover svg { color: var(--text-2); }
.sidenav a[aria-current="page"] { background: var(--surface); color: var(--text); font-weight: 600;
  box-shadow: 0 0 0 1px var(--line), var(--shadow-sm); }
.sidenav a[aria-current="page"] svg { color: var(--accent-text); }
.sidenav a[aria-current="page"]::before { content: ""; position: absolute; left: 0; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--mint-2); }
.sidenav a .count { margin-left: auto; }

.side-balance { display: grid; gap: 6px; margin: var(--s3) 0 var(--s2); padding: 14px; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--line); color: var(--text); text-decoration: none !important;
  box-shadow: var(--shadow-xs); transition: border-color .15s, box-shadow .15s; }
.side-balance:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.side-balance .sb-head { display: flex; align-items: center; justify-content: space-between; }
.side-balance .lbl { font-size: 12px; font-weight: 600; color: var(--text-3); letter-spacing: .02em; }
.side-balance .val { font-size: 22px; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.side-balance .hint { font-size: 12px; color: var(--text-3); }
.side-balance .sb-cta { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 13px; font-weight: 600; color: var(--accent-text); }
.side-balance .sb-cta svg { width: 14px; height: 14px; transition: transform .2s var(--ease); }
.side-balance:hover .sb-cta svg { transform: translateX(3px); }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); animation: breathe 2.4s ease-in-out infinite; }

.side-account { position: relative; }
.side-account > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--r);
  transition: background .15s; }
.side-account > summary::-webkit-details-marker { display: none; }
.side-account > summary:hover, .side-account[open] > summary { background: var(--surface-2); }
.side-account .who { display: grid; min-width: 0; flex: 1; line-height: 1.3; }
.side-account .em { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-account .rl { font-size: 11.5px; color: var(--text-3); }
.side-account > summary > svg { width: 16px; height: 16px; color: var(--text-3); flex: none; }
.side-account .menu-panel { top: auto; bottom: calc(100% + 6px); left: 0; right: 0; min-width: 0; }

/* header (< 1100px) */
.app-header { position: sticky; top: 0; z-index: 30; height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid var(--line); }
.app-header .wrap { height: 100%; display: flex; align-items: center; gap: var(--s5); }
.app-header .logo-mark { width: 26px; height: 26px; }
.mainnav { display: flex; gap: 2px; flex: 1; }
.mainnav a { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: var(--r-sm); color: var(--text-2);
  font-weight: 550; font-size: 14px; text-decoration: none !important; }
.mainnav a:hover { background: var(--surface-2); color: var(--text); }
.mainnav a[aria-current="page"] { background: var(--surface); color: var(--text); box-shadow: 0 0 0 1px var(--line); }
.header-right { display: flex; align-items: center; gap: var(--s2); margin-left: auto; }
.balance-chip { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 4px 0 12px; border-radius: var(--r-pill);
  border: 1px solid var(--line); background: var(--surface); color: var(--text); font-weight: 600; font-size: 13.5px;
  font-variant-numeric: tabular-nums; text-decoration: none !important; white-space: nowrap; }
.balance-chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.balance-chip.low .dot { background: var(--warn); } .balance-chip.out .dot { background: var(--err); }
.balance-chip .topup { height: 28px; display: inline-flex; align-items: center; padding: 0 11px; border-radius: var(--r-pill);
  background: var(--mint); color: var(--accent-fg); font-size: 12.5px; }
.count { display: inline-flex; min-width: 18px; height: 18px; padding: 0 5px; align-items: center; justify-content: center;
  border-radius: var(--r-pill); background: var(--err); color: var(--on-err); font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* menus on <details> */
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.avatar-btn { display: inline-flex; align-items: center; gap: 8px; padding: 3px; border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--surface); }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex: none;
  background: linear-gradient(135deg, #A8F7DC, #3CCB9F); color: var(--accent-fg); font-weight: 700; font-size: 13px; text-transform: uppercase; }
.menu-panel { position: absolute; right: 0; top: calc(100% + 8px); min-width: 260px; z-index: 40; padding: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); animation: pop-in .14s var(--ease); }
.menu-panel a, .menu-panel button { display: flex; width: 100%; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border-radius: var(--r-sm);
  color: var(--text); background: none; border: 0; font: 500 14px var(--sans); text-align: left; cursor: pointer; text-decoration: none !important; }
.menu-panel a:hover, .menu-panel button:hover { background: var(--surface-2); }
.menu-panel svg { width: 17px; height: 17px; color: var(--text-3); flex: none; }
.menu-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.menu-sep { height: 1px; background: var(--line); margin: 6px 4px; }
.menu-label { padding: 6px 10px 2px; font-size: 11.5px; color: var(--text-3); }
.theme-switch { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; margin: 4px; padding: 3px; border-radius: var(--r); background: var(--surface-2); }
.theme-switch button { justify-content: center; height: 30px; padding: 0 6px; font-size: 12.5px; border-radius: 7px; color: var(--text-2); }
.theme-switch button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 0 0 1px var(--line), var(--shadow-sm); }

/* phone: bottom tab bar */
.tabbar { display: none; }
@media (max-width: 768px) {
  .mainnav, .header-menu { display: none; }
  .wrap { padding: 0 var(--s4); }
  .app-main { padding: var(--s5) 0 calc(var(--tabbar-h) + var(--s6)); }
  .app-footer { padding-bottom: calc(var(--tabbar-h) + var(--s5)); }
  .tabbar { display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--line); }
  .tabbar a, .tabbar summary { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    height: var(--tabbar-h); color: var(--text-3); font-size: 11px; font-weight: 600; text-decoration: none; }
  .tabbar svg { width: 22px; height: 22px; }
  .tabbar a[aria-current="page"] { color: var(--accent-text); }
  .tabbar a[aria-current="page"]::before { content: ""; position: absolute; top: 0; left: 30%; right: 30%; height: 2px; border-radius: 0 0 2px 2px; background: var(--mint-2); }
  .tabbar .count { position: absolute; top: 7px; left: 56%; }
  .tabbar .menu { position: static; }
  .tabbar .menu-panel { position: fixed; left: 8px; right: 8px; top: auto; bottom: calc(var(--tabbar-h) + 8px + env(safe-area-inset-bottom)); min-width: 0; }
  h1 { font-size: 24px; }
}

/* ---------- page head ---------- */
.page-head { display: flex; gap: var(--s4); align-items: flex-end; justify-content: space-between; flex-wrap: wrap; margin-bottom: var(--s6); }
.page-head .sub { color: var(--text-2); margin-top: 8px; max-width: 62ch; font-size: 15px; }
.eyebrow { font-size: 12px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); margin-bottom: 6px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; margin-bottom: var(--s3); color: var(--text-3); font-size: 13.5px; font-weight: 550; }
.back-link svg { width: 15px; height: 15px; }
.back-link:hover { color: var(--text); text-decoration: none; }
.mono-title { font-family: var(--mono); font-weight: 600; letter-spacing: -.02em; word-break: break-all; }
.section-title { margin: var(--s7) 0 var(--s3); font-size: 11.5px; font-weight: 650; letter-spacing: .09em; text-transform: uppercase; color: var(--text-3); }
.block-head { display: flex; align-items: flex-start; gap: var(--s3); margin: var(--s7) 0 var(--s4); }
.block-head .n { width: 30px; height: 30px; flex: none; border-radius: var(--r-sm); display: flex; align-items: center; justify-content: center;
  background: var(--surface); border: 1px solid var(--line); color: var(--accent-text); font-weight: 700; font-size: 13.5px; box-shadow: var(--shadow-xs); }
.block-head .n svg { width: 16px; height: 16px; }
.block-head h2 { font-size: 19px; letter-spacing: -.02em; }
.block-head .sub { margin-top: 3px; color: var(--text-2); font-size: 14px; }

/* ---------- surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-xs); }
.card-pad { padding: var(--s5); }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; margin-bottom: var(--s4); }
.card-head .sub { color: var(--text-2); font-size: 14px; margin-top: 4px; }
.card + .card { margin-top: var(--s4); }
.grid > .card, .entries > .card { margin-top: 0; }
.card-link { display: block; color: inherit; text-decoration: none !important; transition: border-color .15s, box-shadow .2s var(--ease), transform .2s var(--ease); }
.card-link:hover { border-color: var(--line-strong); box-shadow: var(--shadow); transform: translateY(-1px); }
@media (max-width: 640px) { .card-pad { padding: var(--s4); } }

/* stat */
.stat .label { color: var(--text-2); font-size: 13px; font-weight: 550; }
.stat .value { margin-top: 6px; font-size: 30px; font-weight: 700; letter-spacing: -.035em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat .value small { font-size: 14px; color: var(--text-3); font-weight: 600; letter-spacing: 0; }
.stat .hint { margin-top: 6px; color: var(--text-3); font-size: 13px; }

/* meters: the filled part streams while there is something to stream */
.meter, .flowbar { position: relative; height: 6px; margin-top: var(--s3); background: var(--surface-3); border-radius: var(--r-pill); overflow: hidden; }
.meter > span, .flowbar > span { position: relative; display: block; height: 100%; border-radius: inherit; background: var(--flow); overflow: hidden; }
.meter > span::after, .flowbar > span::after { content: ""; position: absolute; inset: 0; width: 40%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent); animation: sheen 2.6s var(--ease) infinite; }
.meter.warn > span, .flowbar.low > span { background: linear-gradient(90deg, #C77700, #F4B75A); }
.meter.err > span, .flowbar.out > span { background: var(--err); }
.meter.err > span::after, .flowbar.out > span::after { display: none; }
.flowbar { margin-top: 4px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: var(--r);
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font: 600 14px/1 var(--sans); letter-spacing: -.005em;
  cursor: pointer; white-space: nowrap; text-decoration: none !important; box-shadow: var(--shadow-xs);
  transition: background .15s, border-color .15s, box-shadow .2s var(--ease), transform .1s; }
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 17px; height: 17px; flex: none; }
.btn-primary { background: var(--mint); border-color: transparent; color: var(--accent-fg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 1px 2px rgba(19, 163, 122, .3), 0 6px 18px -6px rgba(19, 163, 122, .55); }
.btn-primary:hover { background: #7FEDC9; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); box-shadow: none; }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { background: transparent; color: var(--err); border-color: color-mix(in srgb, var(--err) 40%, transparent); box-shadow: none; }
.btn-danger:hover { background: var(--err-bg); }
.btn-danger-solid { background: var(--err); color: var(--on-err); border-color: transparent; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: var(--r-sm); }
.btn-sm svg { width: 15px; height: 15px; }
.btn-lg { height: 48px; padding: 0 24px; font-size: 15.5px; border-radius: 12px; }
.btn-block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; }
.btn.is-busy { position: relative; color: transparent !important; }
.btn.is-busy::after { content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor;
  border-color: var(--text-2) var(--text-2) var(--text-2) transparent; animation: spin .7s linear infinite; }
@media (max-width: 768px) { .btn { height: 44px; } .btn-sm { height: 40px; } }

/* ---------- badges & tags ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: var(--r-pill);
  font-size: 12.5px; font-weight: 600; background: var(--surface-2); color: var(--text-2); white-space: nowrap; box-shadow: inset 0 0 0 1px var(--line); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.ok { background: var(--ok-bg); color: var(--ok); box-shadow: none; }
.status .badge.ok::before, .entry-top .badge.ok::before { animation: breathe 2.4s ease-in-out infinite; }
.badge.warn { background: var(--warn-bg); color: var(--warn); box-shadow: none; }
.badge.err { background: var(--err-bg); color: var(--err); box-shadow: none; }
.badge.info { background: var(--info-bg); color: var(--info); box-shadow: none; }
.badge.plain::before { display: none; }
.badge.live::before { animation: breathe 1.6s ease-in-out infinite; }
.tag { display: inline-block; padding: 3px 9px; border-radius: var(--r-pill); font-size: 11.5px; font-weight: 650; letter-spacing: .02em;
  background: var(--mint); color: var(--accent-fg); }

/* ---------- callouts ---------- */
.callout { display: flex; gap: var(--s3); padding: 14px var(--s4); border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface-2); color: var(--text); }
.callout > svg { width: 19px; height: 19px; flex: none; margin-top: 1px; color: var(--text-3); }
.callout > div { min-width: 0; flex: 1; }
.callout .title { font-weight: 650; font-size: 14.5px; }
.callout .body { color: var(--text-2); margin-top: 2px; font-size: 14px; }
.callout.info { background: var(--info-bg); border-color: transparent; } .callout.info > svg { color: var(--info); }
.callout.ok { background: var(--ok-bg); border-color: transparent; } .callout.ok > svg { color: var(--ok); }
.callout.warn { background: var(--warn-bg); border-color: transparent; } .callout.warn > svg { color: var(--warn); }
.callout.err { background: var(--err-bg); border-color: transparent; } .callout.err > svg { color: var(--err); }
.callout.info .body, .callout.ok .body, .callout.warn .body, .callout.err .body { color: var(--text); opacity: .82; }
.banner { border-radius: 0; border: 0; border-bottom: 1px solid var(--line); padding: 10px var(--s5); }

/* ---------- forms ---------- */
.field { display: block; }
.field + .field { margin-top: var(--s4); }
.field label, .label { display: block; margin-bottom: 6px; font-size: 13.5px; font-weight: 600; color: var(--text); }
.field .hint { margin-top: 6px; color: var(--text-3); font-size: 13px; }
.field .error { margin-top: 6px; color: var(--err); font-size: 13px; font-weight: 550; }
.input, .field input:not([type=checkbox]):not([type=radio]), .field select, .field textarea {
  width: 100%; min-height: 40px; padding: 9px 12px; border-radius: var(--r); border: 1px solid var(--line-strong); background: var(--surface);
  color: var(--text); font: 450 14.5px/1.4 var(--sans); box-shadow: var(--shadow-xs); transition: border-color .15s, box-shadow .15s; }
.field textarea { min-height: 104px; resize: vertical; }
.field input.mono, .field textarea.mono, .input.mono { font-family: var(--mono); font-size: 13px; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--mint-3);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--mint) 35%, transparent); }
.field [aria-invalid="true"] { border-color: var(--err); }
.field-row { display: grid; grid-template-columns: 2fr 1fr; gap: var(--s3); }
.field-row > .field + .field, .field-row > * + * { margin-top: 0; }
@media (max-width: 560px) { .field-row { grid-template-columns: 1fr; } .field-row > .field + .field { margin-top: var(--s4); } }
@media (max-width: 768px) { .input, .field input:not([type=checkbox]):not([type=radio]), .field select { min-height: 44px; font-size: 16px; } }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--mint-3); }
.form-actions { display: flex; gap: var(--s2); flex-wrap: wrap; align-items: center; margin-top: var(--s5); }

/* ---------- tabs (segmented) ---------- */
.tabs { display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--r); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); flex-wrap: wrap; }
.tabs [role="tab"] { height: 32px; padding: 0 14px; border: 0; border-radius: var(--r-sm); background: none; color: var(--text-2);
  font: 600 13.5px var(--sans); cursor: pointer; transition: background .15s, color .15s; }
.tabs [role="tab"]:hover { color: var(--text); }
.tabs [role="tab"][aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: 0 0 0 1px var(--line), var(--shadow-sm); }
[role="tabpanel"] { margin-top: var(--s4); }

/* ---------- disclosure ---------- */
details.disclosure { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
details.disclosure > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-height: 46px;
  padding: 11px var(--s4); font-weight: 600; font-size: 14px; }
details.disclosure > summary::-webkit-details-marker { display: none; }
details.disclosure > summary::before { content: ""; width: 7px; height: 7px; flex: none; margin-right: 2px; border-right: 1.75px solid var(--text-3);
  border-bottom: 1.75px solid var(--text-3); transform: rotate(-45deg); transition: transform .2s var(--ease); }
details.disclosure[open] > summary::before { transform: rotate(45deg); }
details.disclosure > summary .sub { margin-left: auto; color: var(--text-3); font-weight: 450; font-size: 13px; }
details.disclosure > .disclosure-body { padding: 0 var(--s4) var(--s4); }
details.disclosure + details.disclosure { margin-top: var(--s2); }
@media (max-width: 640px) { details.disclosure > summary .sub { margin-left: 19px; flex-basis: 100%; } }

/* ---------- copy blocks & key/value ---------- */
.copybox { position: relative; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface-2); }
.copybox pre { margin: 0; padding: 14px var(--s4); padding-right: 116px; max-height: 340px; overflow: auto; color: var(--text);
  font: 12.5px/1.65 var(--mono); white-space: pre-wrap; word-break: break-all; }
.copybox .copy-btn { position: absolute; top: 8px; right: 8px; }
.copybox.one-line pre { white-space: pre; overflow-x: auto; max-height: none; }
@media (max-width: 640px) { .copybox.one-line pre { white-space: pre-wrap; padding-right: var(--s4); padding-top: 50px; } }
.copy-btn { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: var(--r-sm);
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font: 600 12.5px var(--sans); cursor: pointer; white-space: nowrap;
  box-shadow: var(--shadow-xs); transition: background .15s, color .15s; }
.copy-btn:hover { background: var(--surface-3); }
.copy-btn svg { width: 14px; height: 14px; }
.copy-btn.copied { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.kv { margin: 0; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); }
.kv > div { display: grid; grid-template-columns: 140px minmax(0, 1fr) auto; align-items: center; gap: var(--s3); min-height: 46px; padding: 6px 8px 6px var(--s4); }
.kv > div + div { border-top: 1px solid var(--line); }
.kv dt { color: var(--text-2); font-size: 13px; font-weight: 550; }
.kv dd { margin: 0; font: 12.5px/1.5 var(--mono); word-break: break-all; }
.kv > div.diff { background: var(--accent-soft); }
.kv > div.diff dt::after { content: "другое"; display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: var(--r-pill);
  background: var(--mint); color: var(--accent-fg); font-size: 10.5px; font-weight: 700; letter-spacing: .02em; vertical-align: 1px; }
@media (max-width: 560px) { .kv > div { grid-template-columns: 1fr auto; } .kv dt { grid-column: 1 / -1; } }

/* ---------- tables (cards on phones) ---------- */
.table-wrap { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; box-shadow: var(--shadow-xs); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { padding: 11px var(--s4); text-align: left; font-size: 11.5px; font-weight: 650; letter-spacing: .07em; text-transform: uppercase;
  color: var(--text-3); background: var(--surface-2); border-bottom: 1px solid var(--line); }
.table td { padding: 13px var(--s4); border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) {
  .table.cards thead { display: none; }
  .table.cards, .table.cards tbody, .table.cards tr, .table.cards td { display: block; width: 100%; }
  .table.cards tr { padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line); }
  .table.cards tr:last-child { border-bottom: 0; }
  .table.cards td { display: flex; justify-content: space-between; gap: var(--s3); padding: 4px 0; border: 0; text-align: right; }
  .table.cards td::before { content: attr(data-label); color: var(--text-3); font-size: 12.5px; font-weight: 600; text-align: left; }
}

/* ---------- status ---------- */
.status { display: flex; gap: var(--s4); align-items: flex-start; }
.status .icon { width: 44px; height: 44px; flex: none; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  background: var(--surface-2); color: var(--text-3); box-shadow: inset 0 0 0 1px var(--line); }
.status .icon svg { width: 22px; height: 22px; }
.status.ok .icon { background: var(--ok-bg); color: var(--ok); box-shadow: none; }
.status.warn .icon { background: var(--warn-bg); color: var(--warn); box-shadow: none; }
.status.err .icon { background: var(--err-bg); color: var(--err); box-shadow: none; }
.status .title { font-size: 17px; font-weight: 650; letter-spacing: -.015em; }
.status .text { margin-top: 4px; color: var(--text-2); }
.status .whose { display: inline-flex; margin-top: 10px; padding: 3px 9px; border-radius: var(--r-pill); background: var(--surface-2);
  font-size: 12px; font-weight: 600; color: var(--text-2); box-shadow: inset 0 0 0 1px var(--line); }

/* hero status: a hairline in the state's colour; when traffic flows a packet of light runs along it,
   and faint data streams drift across the right side of the card. */
.status.hero { position: relative; overflow: hidden; padding: var(--s5); isolation: isolate; }
.status.hero::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 2px; background: var(--line-strong); }
.status.hero.ok::before { background: linear-gradient(90deg, transparent, var(--mint-3) 20%, var(--mint) 60%, transparent); }
.status.hero.ok::after { content: ""; position: absolute; top: 0; left: 0; width: 22%; height: 2px;
  background: linear-gradient(90deg, transparent, #fff, var(--mint), transparent); filter: blur(.4px); animation: sheen 2.8s var(--ease) infinite; }
.status.hero.warn::before { background: var(--warn); } .status.hero.err::before { background: var(--err); }
.status.hero .title { font-size: 19px; }
.flowart { position: absolute; inset: 0 0 0 auto; width: min(46%, 440px); z-index: -1; pointer-events: none;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 45%, #000 80%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 45%, #000 80%, transparent); }
.flowart i { position: absolute; left: 0; right: 0; height: 1.5px; border-radius: 2px; opacity: .55;
  background: repeating-linear-gradient(90deg, var(--mint-2) 0 var(--d, 10px), transparent var(--d, 10px) 48px); background-size: 48px 1.5px;
  animation: flow-x var(--t, 1.6s) linear infinite; }
.flowart i:nth-child(1) { top: 22%; --d: 14px; --t: 1.9s; opacity: .35; }
.flowart i:nth-child(2) { top: 36%; --d: 6px;  --t: 1.2s; opacity: .6; }
.flowart i:nth-child(3) { top: 50%; --d: 22px; --t: 1.5s; opacity: .75; height: 2px; }
.flowart i:nth-child(4) { top: 64%; --d: 8px;  --t: 1.05s; opacity: .5; }
.flowart i:nth-child(5) { top: 78%; --d: 16px; --t: 2.2s; opacity: .3; }
.status.hero:not(.ok) .flowart { display: none; }
@media (max-width: 640px) { .flowart { width: 70%; opacity: .5; } }

/* ---------- route: subscribers → entries → gateway → node ---------- */
.route { display: grid; grid-template-columns: auto minmax(0, 1.5fr) auto minmax(28px, .55fr) auto; align-items: center;
  padding: var(--s5) var(--s4); border-radius: var(--r-lg); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.route-node { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 104px; text-align: center; }
.route-node .ic { width: 46px; height: 46px; border-radius: 14px; display: flex; align-items: center; justify-content: center;
  background: var(--surface); color: var(--text-2); box-shadow: 0 0 0 1px var(--line), var(--shadow-sm); }
.route-node .ic svg { width: 21px; height: 21px; }
.route-node .nm { font-size: 12.5px; font-weight: 650; }
.route-node .sb { font: 11px var(--mono); color: var(--text-3); word-break: break-all; }
.route-node.ok .ic { color: var(--ok); box-shadow: 0 0 0 1px color-mix(in srgb, var(--ok) 35%, transparent), 0 0 0 5px var(--ok-bg); }
.route-node.warn .ic { color: var(--warn); box-shadow: 0 0 0 1px color-mix(in srgb, var(--warn) 35%, transparent), 0 0 0 5px var(--warn-bg); }
.route-node.err .ic { color: var(--err); box-shadow: 0 0 0 1px color-mix(in srgb, var(--err) 35%, transparent), 0 0 0 5px var(--err-bg); }
.route-links { display: flex; flex-direction: column; gap: 12px; padding: 0 4px; }
.route-link { position: relative; display: flex; align-items: center; justify-content: center; min-height: 34px; }
/* the wire: dashed and still when idle, a moving stream of packets when traffic flows */
.route-link::before, .route-line { content: ""; height: 2px; border-radius: 2px;
  background: repeating-linear-gradient(90deg, var(--line-strong) 0 6px, transparent 6px 12px); }
.route-link::before { position: absolute; left: 0; right: 0; top: 50%; margin-top: -1px; }
.route-link.ok::before, .route-line.ok { background: repeating-linear-gradient(90deg, var(--mint-3) 0 14px, var(--mint) 14px 22px, transparent 22px 24px);
  background-size: 48px 2px; animation: flow-x 1.1s linear infinite; }
.route-link.warn::before { background: repeating-linear-gradient(90deg, color-mix(in srgb, var(--warn) 70%, transparent) 0 6px, transparent 6px 12px); }
.route-line.err { background: repeating-linear-gradient(90deg, var(--err) 0 6px, transparent 6px 12px); }
.route-link .chip { position: relative; display: inline-flex; align-items: center; gap: 7px; max-width: 100%; height: 30px; padding: 0 12px;
  border-radius: var(--r-pill); background: var(--surface); box-shadow: 0 0 0 1px var(--line), var(--shadow-sm); font-size: 12.5px; font-weight: 650; }
.route-link .chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); flex: none; }
.route-link.ok .chip .dot { background: var(--ok); animation: breathe 2.4s ease-in-out infinite; }
.route-link.warn .chip .dot { background: var(--warn); }
.route-link .chip small { color: var(--text-3); font-weight: 550; font-variant-numeric: tabular-nums; }
@media (max-width: 720px) {
  .route { grid-template-columns: 1fr; justify-items: center; gap: 6px; padding: var(--s4); }
  .route-links { width: 100%; padding: 4px 0; }
  .route-link::before { left: 50%; right: auto; top: -6px; bottom: -6px; width: 2px; height: auto; margin: 0;
    background: repeating-linear-gradient(180deg, var(--line-strong) 0 6px, transparent 6px 12px); }
  .route-link.ok::before { background: repeating-linear-gradient(180deg, var(--mint-3) 0 14px, var(--mint) 14px 22px, transparent 22px 24px);
    background-size: 2px 48px; animation: flow-y 1.1s linear infinite; }
  .route-line { width: 2px; height: 24px; background: repeating-linear-gradient(180deg, var(--line-strong) 0 6px, transparent 6px 12px); }
  .route-line.ok { background: repeating-linear-gradient(180deg, var(--mint-3) 0 14px, var(--mint) 14px 22px, transparent 22px 24px);
    background-size: 2px 48px; animation: flow-y 1.1s linear infinite; }
}

/* ---------- entries ---------- */
.entries { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4); }
@media (max-width: 760px) { .entries { grid-template-columns: 1fr; } }
.entry { display: flex; flex-direction: column; gap: 14px; padding: var(--s5); }
.entry-top { display: flex; align-items: flex-start; gap: var(--s3); }
.entry-num { width: 36px; height: 36px; flex: none; border-radius: 11px; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px; background: var(--surface-2); color: var(--text-2); box-shadow: inset 0 0 0 1px var(--line); }
.entry.ok .entry-num { background: var(--accent-soft); color: var(--accent-text); box-shadow: none; }
.entry-top .nm { font-size: 16px; font-weight: 700; letter-spacing: -.015em; }
.entry-top .rl { margin-top: 1px; color: var(--text-3); font-size: 13px; }
.entry-top .badge { margin-left: auto; }
.entry-host { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 6px 6px 6px 12px; border-radius: var(--r);
  background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); font: 12.5px var(--mono); }
.entry-host span { flex: 1; min-width: 0; word-break: break-all; }
.entry-metrics { display: flex; gap: var(--s6); }
.entry-metrics .v { font-size: 22px; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.entry-metrics .v small { font-size: 13px; font-weight: 600; }
.entry-metrics .k { font-size: 12px; color: var(--text-3); }
.entry .meter { margin-top: 0; }
.entry-actions { display: flex; gap: var(--s2); flex-wrap: wrap; align-items: center; margin-top: auto; }

.entry-rows { display: grid; gap: 6px; margin-top: 10px; }
.entry-row { display: flex; align-items: center; gap: 10px; min-width: 0; font-size: 13.5px; }
.entry-row .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); flex: none; }
.entry-row.ok .dot { background: var(--ok); }
.entry-row.warn .dot { background: var(--warn); }
.entry-row .nm { flex: none; min-width: 56px; font-weight: 600; }
.entry-row .h { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); font: 12px var(--mono); }
.entry-row .g { margin-left: auto; color: var(--text-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.entry-row .g.st { color: var(--warn); font-weight: 600; }

/* ---------- server list ---------- */
.server { display: flex; gap: var(--s4); align-items: center; padding: var(--s4) var(--s5); }
.server + .server { border-top: 1px solid var(--line); }
.server .main { flex: 1; min-width: 0; }
.server .name { font: 600 14.5px var(--mono); letter-spacing: -.01em; word-break: break-all; }
.server .meta { margin-top: 2px; color: var(--text-3); font-size: 13px; }
.server-title { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.server-title .meta { margin-top: 0; }
.server .advice { margin-top: 10px; max-width: 70ch; color: var(--text-2); font-size: 13.5px; }
.server .actions { display: flex; gap: var(--s2); align-items: center; flex: none; }
@media (max-width: 640px) { .server { flex-direction: column; align-items: stretch; padding: var(--s4); } .server .actions { flex-wrap: wrap; } .server .actions .btn { flex: 1; } }

/* ---------- wizard steps ---------- */
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.step { position: relative; padding: 0 0 var(--s5) 48px; }
.step:last-child { padding-bottom: 0; }
.step::before { counter-increment: step; content: counter(step); position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; background: var(--surface); color: var(--text-2);
  box-shadow: 0 0 0 1px var(--line-strong); }
.step::after { content: ""; position: absolute; left: 14.5px; top: 36px; bottom: 6px; width: 1px; background: var(--line-strong); }
.step:last-child::after { display: none; }
.step.done::before { content: "✓"; background: var(--ok-bg); color: var(--ok); box-shadow: none; }
.step.current::before { background: var(--mint); color: var(--accent-fg); box-shadow: 0 0 0 4px var(--accent-soft); }
.step > h3 { padding-top: 4px; }
.step > .step-body { margin-top: var(--s3); }
.step .optional { color: var(--text-3); font-weight: 500; font-size: 13px; }
.steps .step-body > p { max-width: 72ch; }

/* ---------- onboarding checklist ---------- */
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { display: flex; align-items: center; gap: var(--s3); padding: 12px 0; border-top: 1px solid var(--line); }
.checklist li:first-child { border-top: 0; padding-top: 4px; }
.checklist .tick { width: 22px; height: 22px; flex: none; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  border: 1.75px solid var(--line-strong); color: transparent; font-size: 12px; font-weight: 800; }
.checklist li.done .tick { background: var(--mint-3); border-color: var(--mint-3); color: #fff; }
.checklist .what { flex: 1; font-weight: 600; font-size: 14px; }
.checklist .what small { display: block; color: var(--text-3); font-weight: 450; font-size: 12.5px; }
.checklist li.done .what { color: var(--text-3); }
.progress-label { color: var(--text-2); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- empty state ---------- */
.empty { padding: var(--s7) var(--s5); text-align: center; }
.empty .icon { width: 52px; height: 52px; margin: 0 auto var(--s4); border-radius: 14px; display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent-text); }
.empty .icon svg { width: 24px; height: 24px; }
.empty h2 { font-size: 17px; }
.empty p { max-width: 46ch; margin: 8px auto 0; color: var(--text-2); }
.empty .btn { margin-top: var(--s5); }

/* ---------- dialog & toast ---------- */
dialog.modal { width: min(480px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: var(--r-xl); background: var(--surface); color: var(--text);
  box-shadow: var(--shadow-lg); }
dialog.modal[open] { animation: pop-in .18s var(--ease); }
dialog.modal::backdrop { background: var(--overlay); backdrop-filter: blur(2px); }
dialog.modal .modal-body { padding: var(--s5); }
dialog.modal .modal-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--s2); padding: 0 var(--s5) var(--s5); }
.toasts { position: fixed; z-index: 60; left: 50%; bottom: var(--s5); transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; width: min(440px, calc(100vw - 24px)); }
@media (max-width: 768px) { .toasts { bottom: calc(var(--tabbar-h) + 12px + env(safe-area-inset-bottom)); } }
.toast { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-lg); background: var(--text); color: var(--bg);
  box-shadow: var(--shadow-lg); font-weight: 550; font-size: 14px; animation: pop-in .2s var(--ease); }
.toast.err { background: var(--err); color: var(--on-err); }

/* ---------- glossary term ---------- */
.term { position: relative; padding: 0; border: 0; border-bottom: 1px dashed var(--text-3); background: none; color: inherit; font: inherit; cursor: help; }
.term-tip { position: absolute; z-index: 50; left: 0; top: calc(100% + 6px); width: min(300px, 80vw); padding: 10px 12px; border-radius: var(--r);
  background: var(--text); color: var(--bg); font-size: 13px; font-weight: 450; line-height: 1.45; text-align: left; box-shadow: var(--shadow-lg); }

/* ---------- auth pages ---------- */
.auth { min-height: calc(100vh - 80px); display: flex; align-items: center; justify-content: center; padding: var(--s6) var(--s4); }
.auth-card { width: min(420px, 100%); }
.auth .logo { margin-bottom: var(--s5); font-size: 22px; }
.auth .logo .logo-mark { width: 36px; height: 36px; }
.divider { display: flex; align-items: center; gap: var(--s3); margin: var(--s4) 0; color: var(--text-3); font-size: 12.5px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------- support thread ---------- */
.thread { display: flex; flex-direction: column; gap: var(--s3); }
.msg { max-width: min(640px, 92%); padding: 11px 15px; border-radius: 16px; }
.msg .who { margin-bottom: 3px; font-size: 12px; font-weight: 650; color: var(--text-3); }
.msg .text { white-space: pre-wrap; word-wrap: break-word; }
.msg.mine { align-self: flex-end; background: var(--accent-soft); border-bottom-right-radius: 5px; }
.msg.theirs { align-self: flex-start; background: var(--surface-2); border-bottom-left-radius: 5px; box-shadow: inset 0 0 0 1px var(--line); }

/* ---------- packages ---------- */
.pkg { position: relative; display: flex; flex-direction: column; gap: 4px; padding: var(--s5); border-radius: var(--r-lg); background: var(--surface);
  border: 1px solid var(--line); box-shadow: var(--shadow-xs); transition: border-color .15s, box-shadow .2s var(--ease), transform .2s var(--ease); }
.pkg:hover { border-color: var(--line-strong); box-shadow: var(--shadow); transform: translateY(-1px); }
.pkg.best { border-color: transparent; box-shadow: 0 0 0 1.5px var(--mint-2), 0 10px 30px -10px rgba(19, 163, 122, .45); }
.pkg .size { font-size: 26px; font-weight: 700; letter-spacing: -.035em; }
.pkg .price { font-size: 17px; font-weight: 650; font-variant-numeric: tabular-nums; }
.pkg .per { color: var(--text-3); font-size: 13px; }
.pkg .tag { position: absolute; top: -10px; left: var(--s5); }
.pkg form { margin-top: auto; padding-top: var(--s3); }

/* ---------- layout utilities ---------- */
.stack > * + * { margin-top: var(--s4); }
.stack-lg > * + * { margin-top: var(--s5); }
.stack-sm > * + * { margin-top: var(--s2); }
.cluster { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; }
.spread { display: flex; gap: var(--s3); align-items: center; justify-content: space-between; flex-wrap: wrap; }
.center-x { justify-content: center; }
.grid { display: grid; gap: var(--s4); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }
.mt-0 { margin-top: 0 !important; } .mt-1 { margin-top: var(--s1); } .mt-2 { margin-top: var(--s2); } .mt-3 { margin-top: var(--s3); }
.mt-4 { margin-top: var(--s4); } .mt-5 { margin-top: var(--s5); } .mt-6 { margin-top: var(--s6); }
.text-muted { color: var(--text-2); } .text-faint { color: var(--text-3); }
.text-sm { font-size: 13px; } .text-lg { font-size: 17px; } .text-center { text-align: center; }
.text-ok { color: var(--ok); } .text-warn { color: var(--warn); } .text-err { color: var(--err); }
.nowrap { white-space: nowrap; } .break { word-break: break-all; } .w-full { width: 100%; }
@media (max-width: 640px) { .hide-sm { display: none !important; } }
@media (min-width: 641px) { .show-sm { display: none !important; } }
@media (max-width: 460px) {
  .entry-top { flex-wrap: wrap; }
  .entry-top .badge { order: 3; margin-left: 48px; }
}

/* ---------- operator matrix ---------- */
.opmatrix { border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); box-shadow: var(--shadow-xs); }
.opmatrix .table th:nth-child(3), .opmatrix .table td:nth-child(3) { background: color-mix(in srgb, var(--accent-soft) 70%, transparent); }
.opmatrix .table th .tag { margin-left: 6px; vertical-align: 1px; text-transform: none; letter-spacing: .02em; }
.op { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; }
.op::before { content: ""; width: 8px; height: 8px; border-radius: 50%; flex: none; }
.op-yes { color: var(--ok); } .op-yes::before { background: var(--ok); }
.op-part { color: var(--warn); } .op-part::before { background: var(--warn); }
.op-no { color: var(--err); } .op-no::before { background: var(--err); }
.opnote { padding: 12px var(--s4); border-top: 1px solid var(--line); color: var(--text-2); font-size: 13px; background: var(--surface-2); }
@media (max-width: 520px) { .opmatrix .table th, .opmatrix .table td { padding: 10px 10px; } .op { font-size: 12.5px; } }
.entry-reco { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: var(--r); background: var(--accent-soft); color: var(--text); font-size: 13px; font-weight: 500; }
.entry-reco svg { width: 16px; height: 16px; flex: none; margin-top: 1px; color: var(--accent-text); }

.route-link.ok::before, .route-line.ok, .flowart i, .status.hero.ok::after { will-change: background-position, transform; }
@media (prefers-reduced-data: reduce) { .flowart { display: none; } }


/* Folded setup sections on a working server's page: the head stays a section title, the body
   opens on click or when a link points at it (#node, #address, #entry1). */
details.fold > summary { list-style: none; cursor: pointer; border-radius: var(--r-md); }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary .block-head { position: relative; padding-right: 34px; }
details.fold > summary .block-head::after { content: ""; position: absolute; right: 10px; top: 9px; width: 8px; height: 8px;
  border-right: 1.75px solid var(--text-3); border-bottom: 1.75px solid var(--text-3); transform: rotate(45deg); transition: transform .15s ease; }
details.fold[open] > summary .block-head::after { transform: rotate(-135deg); top: 13px; }
details.fold > summary:hover h2 { color: var(--accent-ink, var(--text)); }
details.fold > summary:focus-visible { outline: 2px solid var(--focus, var(--accent)); outline-offset: 4px; }
details.fold:not([open]) > summary .block-head { margin-bottom: 0; }
