/* SillyRouter — public site + cabinet.
   Look: a night-time ledger. Warm ink background, paper-coloured text, one candle-amber accent,
   book serif for headings and figures, plain grotesque for the interface, mono for keys and model ids.
   Colour carries meaning only where it has to: amber = action, green/orange/red = model and request state. */

/* ---------------------------------------------------------------- fonts (self-hosted, OFL, see fonts/OFL.txt) */
@font-face { font-family: "Plex Sans"; font-weight: 400; font-display: swap; src: url("fonts/plex-sans-latin-400.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: "Plex Sans"; font-weight: 400; font-display: swap; src: url("fonts/plex-sans-cyrillic-400.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Plex Sans"; font-weight: 400; font-display: swap; src: url("fonts/plex-sans-latin-ext-400.woff2") format("woff2");
  unicode-range: U+20A0-20AB, U+20AD-20C0; }
@font-face { font-family: "Plex Sans"; font-weight: 500; font-display: swap; src: url("fonts/plex-sans-latin-500.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: "Plex Sans"; font-weight: 500; font-display: swap; src: url("fonts/plex-sans-cyrillic-500.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Plex Sans"; font-weight: 500; font-display: swap; src: url("fonts/plex-sans-latin-ext-500.woff2") format("woff2");
  unicode-range: U+20A0-20AB, U+20AD-20C0; }
@font-face { font-family: "Plex Sans"; font-weight: 600; font-display: swap; src: url("fonts/plex-sans-latin-600.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: "Plex Sans"; font-weight: 600; font-display: swap; src: url("fonts/plex-sans-cyrillic-600.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Plex Sans"; font-weight: 600; font-display: swap; src: url("fonts/plex-sans-latin-ext-600.woff2") format("woff2");
  unicode-range: U+20A0-20AB, U+20AD-20C0; }

@font-face { font-family: "Plex Mono"; font-weight: 400; font-display: swap; src: url("fonts/plex-mono-latin-400.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: "Plex Mono"; font-weight: 400; font-display: swap; src: url("fonts/plex-mono-cyrillic-400.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Plex Mono"; font-weight: 500; font-display: swap; src: url("fonts/plex-mono-latin-500.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: "Plex Mono"; font-weight: 500; font-display: swap; src: url("fonts/plex-mono-cyrillic-500.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }

@font-face { font-family: "Piazzolla"; font-weight: 100 900; font-display: swap; src: url("fonts/piazzolla-latin.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: "Piazzolla"; font-weight: 100 900; font-display: swap; src: url("fonts/piazzolla-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Piazzolla"; font-weight: 100 900; font-display: swap; src: url("fonts/piazzolla-latin-ext.woff2") format("woff2");
  unicode-range: U+20A0-20AB, U+20AD-20C0; }
@font-face { font-family: "Piazzolla"; font-style: italic; font-weight: 100 900; font-display: swap; src: url("fonts/piazzolla-latin-italic.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: "Piazzolla"; font-style: italic; font-weight: 100 900; font-display: swap; src: url("fonts/piazzolla-cyrillic-italic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }

/* ---------------------------------------------------------------- tokens */
:root {
  color-scheme: dark;
  --bg: #15120f;
  --surface: #1c1915;
  --surface-2: #25211c;
  --line: #342e27;
  --line-2: #4b4339;
  --ink: #ede4d3;
  --ink-2: #b9ad98;
  --ink-3: #978b77;
  --accent: #e3a945;
  --accent-hover: #efbb5e;
  --accent-ink: #1a1307;
  --accent-text: #e9b65c;
  --accent-wash: rgba(227, 169, 69, .10);
  --bar: #e3a945;
  --bar-hover: #f4c978;
  --ok: #8fc27a;
  --warn: #e49a52;
  --err: #ec6f5f;
  --warn-wash: rgba(228, 154, 82, .10);
  --err-wash: rgba(236, 111, 95, .10);
  --focus: #f3cf7a;
  --shadow: 0 10px 30px rgba(0, 0, 0, .45);

  --f-sans: "Plex Sans", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --f-serif: "Piazzolla", Georgia, "Times New Roman", serif;
  --f-mono: "Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  --r: 5px;
  --r-lg: 8px;
  --wrap: 1160px;
  --gutter: 16px;
  --header-h: 60px;
}
@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #f5efe3;
    --surface: #fbf8f1;
    --surface-2: #ede5d5;
    --line: #ddd2bf;
    --line-2: #c4b59c;
    --ink: #231c14;
    --ink-2: #5c5042;
    --ink-3: #766957;
    --accent: #dfa040;
    --accent-hover: #d08e2a;
    --accent-ink: #1f1608;
    --accent-text: #8a5a0e;
    --accent-wash: rgba(176, 116, 20, .10);
    --bar: #b5761a;
    --bar-hover: #8a5a0e;
    --ok: #2f7a3a;
    --warn: #a5560f;
    --err: #b23a2c;
    --warn-wash: rgba(165, 86, 15, .08);
    --err-wash: rgba(178, 58, 44, .08);
    --focus: #8a5a0e;
    --shadow: 0 10px 30px rgba(60, 40, 10, .18);
  }
}

/* ---------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 16px/1.55 var(--f-sans);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: hidden;
  min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
}
body > main { flex: 1 0 auto; width: 100%; }
main { display: block; outline: none; min-height: 60vh; }
img, svg { display: block; max-width: 100%; }
p { margin: 0 0 .8em; }
h1, h2, h3 { margin: 0; font-weight: 600; }
h1, h2 { font-family: var(--f-serif); letter-spacing: -.012em; }
h1 { font-size: clamp(32px, 5.2vw, 54px); line-height: 1.06; }
h2 { font-size: clamp(24px, 3vw, 30px); line-height: 1.15; }
h3 { font-size: 17px; line-height: 1.3; }
a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 1px;
  text-underline-offset: .22em; }
a:hover { color: var(--accent-text); }
code, kbd, .mono { font-family: var(--f-mono); font-size: .9em; }
code { overflow-wrap: anywhere; }
b, strong { font-weight: 600; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.small { font-size: 14px; }
.ok-text { color: var(--ok); } .err-text { color: var(--err); } .warn-text { color: var(--warn); }
.num { font-variant-numeric: tabular-nums lining-nums; text-align: right; white-space: nowrap; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 50; background: var(--accent); color: var(--accent-ink); padding: 8px 12px;
  border-radius: var(--r); text-decoration: none; font-weight: 600; }
.skip:focus { top: 8px; }
.label { font-family: var(--f-sans); font-size: 13px; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 16px; border: 1px solid var(--line-2); border-radius: var(--r);
  background: transparent; color: var(--ink); font: 500 15px/1.2 var(--f-sans); text-decoration: none;
  cursor: pointer; white-space: nowrap; user-select: none; transition: background-color .12s, border-color .12s, color .12s;
}
.btn:hover { border-color: var(--ink-3); color: var(--ink); background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: default; transform: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-ink); }
.btn-ghost { border-color: transparent; }
.btn-ghost:hover { border-color: transparent; }
.btn-danger { color: var(--err); }
.btn-danger:hover { color: var(--err); border-color: var(--err); background: var(--err-wash); }
.btn-sm { min-height: 32px; padding: 0 11px; font-size: 14px; }
.btn-lg { min-height: 48px; padding: 0 22px; font-size: 16px; }
.btn-block { width: 100%; }
@media (pointer: coarse) { .btn-sm { min-height: 40px; } }
.btn .ic { width: 16px; height: 16px; flex: none; }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--ink); cursor: pointer; text-decoration: underline;
  text-decoration-color: var(--accent); text-underline-offset: .22em; }
.linkish:hover { color: var(--accent-text); }

/* ---------------------------------------------------------------- forms */
label { display: block; }
.field { display: grid; gap: 6px; }
.field > span, .field-label { font-size: 14px; font-weight: 500; color: var(--ink-2); }
.field .hint, .hint { font-size: 13.5px; font-weight: 400; color: var(--ink-3); line-height: 1.45; }
input, select, textarea {
  width: 100%; min-height: 44px; padding: 9px 12px; border: 1px solid var(--line-2); border-radius: var(--r);
  background: var(--bg); color: var(--ink); font: 400 16px/1.3 var(--f-sans);
}
input::placeholder { color: var(--ink-3); opacity: 1; }
input:hover, select:hover { border-color: var(--ink-3); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--focus); outline-offset: 1px; border-color: var(--line-2); }
select { appearance: none; padding-right: 34px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(135deg, var(--ink-2) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
input[type="number"] { font-variant-numeric: tabular-nums; }
.check { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; font-size: 15px; color: var(--ink); }
.check input { width: 18px; height: 18px; min-height: 0; margin: 0; accent-color: var(--accent); }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { padding: 0; }
.form-error { color: var(--err); font-size: 14px; min-height: 0; }

/* amount chips */
.chips { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; }
.chips label { position: relative; }
.chips input { position: absolute; opacity: 0; width: 1px; height: 1px; min-height: 0; }
.chips span {
  display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 4px;
  border: 1px solid var(--line-2); border-radius: var(--r); font-weight: 500; font-size: 15px; cursor: pointer; white-space: nowrap;
}
.chips span:hover { border-color: var(--ink-3); }
.chips input:checked + span { border-color: var(--accent); background: var(--accent-wash); color: var(--ink); box-shadow: inset 0 0 0 1px var(--accent); }
.chips input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---------------------------------------------------------------- header */
.site-header { position: sticky; top: 0; z-index: 30; background: var(--bg); border-bottom: 1px solid var(--line); }
.bar { display: flex; align-items: center; gap: 28px; height: var(--header-h); }
.brand { font-family: var(--f-serif); font-size: 23px; font-weight: 600; letter-spacing: -.015em; color: var(--ink); text-decoration: none;
  white-space: nowrap; line-height: 1; }
.brand i { font-style: italic; font-weight: 500; color: var(--accent-text); padding-right: .03em; }
.brand:hover { color: var(--ink); }
.nav { display: flex; align-items: stretch; gap: 22px; height: 100%; }
.nav a { display: flex; align-items: center; color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: 15px;
  border-bottom: 2px solid transparent; margin-bottom: -1px; padding-top: 2px; }
.nav a:hover { color: var(--ink); }
.nav a.on { color: var(--ink); border-bottom-color: var(--accent); }
.bar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.bal-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 12px; border: 1px solid var(--line-2);
  border-radius: var(--r); text-decoration: none; color: var(--ink); font-weight: 600; font-size: 15px; white-space: nowrap; }
.bal-chip:hover { border-color: var(--accent); color: var(--ink); }
.bal-chip small { font-weight: 500; color: var(--accent-text); font-size: 13px; }
.menu-btn { display: none; width: 44px; padding: 0; }
.menu-btn svg { width: 20px; height: 20px; }

@media (max-width: 820px) {
  .bar { gap: 12px; }
  .menu-btn { display: inline-flex; }
  .nav {
    display: none; position: absolute; left: 0; right: 0; top: var(--header-h); height: auto;
    flex-direction: column; gap: 0; padding: 6px var(--gutter) 14px; background: var(--bg); border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
  }
  .site-header.open .nav { display: flex; }
  .nav a { min-height: 48px; border-bottom: 1px solid var(--line); margin: 0; padding: 0; font-size: 16px; }
  .nav a:last-child { border-bottom: 0; }
  .nav a.on { border-bottom-color: var(--line); color: var(--accent-text); }
  .hide-sm { display: none !important; }
}

/* ---------------------------------------------------------------- generic layout bits */
.section { padding: 64px 0; border-top: 1px solid var(--line); }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px; margin-bottom: 28px; }
.section-head p { margin: 0; color: var(--ink-2); max-width: 560px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; }
.rule { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
.note { font-size: 14px; color: var(--ink-2); padding: 10px 12px; border-left: 2px solid var(--warn); background: var(--warn-wash);
  border-radius: 0 var(--r) var(--r) 0; line-height: 1.45; }
.note a { color: inherit; }
.empty { color: var(--ink-2); padding: 18px 0; }
.copyline { display: flex; align-items: center; gap: 8px; min-width: 0; }
.copyline code { flex: 1; min-width: 0; padding: 10px 12px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r);
  font-size: 14.5px; line-height: 1.35; color: var(--ink); overflow-wrap: anywhere; }
.copyline code.js-base, .copyline code.js-full { overflow-wrap: break-word; }
.copyline .btn { flex: none; }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 1px 8px; border: 1px solid var(--line-2); border-radius: 4px;
  font-size: 13px; line-height: 1.6; color: var(--ink-2); white-space: nowrap; font-weight: 500; }
.tag-err { color: var(--err); border-color: color-mix(in srgb, var(--err) 45%, transparent); background: var(--err-wash); }
.tag-warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, transparent); background: var(--warn-wash); }
.tag-ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); }

/* status dot + label */
.state { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; color: var(--ink-2); white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--ink-3); }
.dot.ok { background: var(--ok); }
.dot.degraded { background: var(--warn); }
.dot.down { background: var(--err); }
.dot.unknown { background: transparent; box-shadow: inset 0 0 0 1.5px var(--ink-3); }

/* ---------------------------------------------------------------- landing */
.intro { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 56px; align-items: start; padding-top: 64px; padding-bottom: 72px; }
.intro h1 { max-width: 13em; }
.lead { font-size: 18.5px; line-height: 1.55; color: var(--ink-2); max-width: 34em; margin: 22px 0 28px; }
.cta { display: flex; flex-wrap: wrap; gap: 10px; }
.endpoint { margin-top: 32px; max-width: 520px; }
.endpoint .label { display: block; margin-bottom: 8px; }

.receipt { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px 22px 18px; }
.receipt-title { font-size: 21px; margin-bottom: 16px; }
.calc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.calc-grid .full { grid-column: 1 / -1; }
.calc-lines { border-top: 1px dashed var(--line-2); padding-top: 12px; margin-top: 4px; }
.leader { display: flex; align-items: baseline; gap: 8px; padding: 5px 0; font-size: 15px; }
.leader > :first-child { color: var(--ink-2); min-width: 0; }
.leader .dots { flex: 1 1 24px; min-width: 16px; border-bottom: 1px dotted var(--line-2); transform: translateY(-.3em); }
.leader > :last-child { white-space: nowrap; font-variant-numeric: tabular-nums lining-nums; }
.calc-total { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; border-top: 1px dashed var(--line-2);
  margin-top: 8px; padding-top: 12px; }
.calc-total b { font-family: var(--f-serif); font-size: 34px; font-weight: 600; letter-spacing: -.01em; color: var(--accent-text); white-space: nowrap; }
.calc-total span { color: var(--ink-2); }
.calc-per { margin: 8px 0 0; color: var(--ink); }
.calc-note { margin: 14px 0 0; font-size: 13.5px; color: var(--ink-3); line-height: 1.45; }

/* price "menu" */
.menu { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 480px), 1fr)); gap: 20px 40px; }
.dish { padding: 4px 0 0; }
.dish-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-bottom: 6px; }
.dish-name { font-family: var(--f-mono); font-size: 18px; font-weight: 500; color: var(--ink); overflow-wrap: anywhere; }
.dish-desc { color: var(--ink-2); margin: 0 0 12px; }
.dish .leader { border-bottom: 0; }
.dish .leader .unit { color: var(--ink-3); font-size: 14px; }
.dish .leader.em > :last-child { color: var(--accent-text); font-weight: 600; }
.menu-foot { margin-top: 26px; color: var(--ink-3); font-size: 14px; max-width: 760px; }

/* facts — ledger of plain statements */
.facts { margin: 0; display: grid; grid-template-columns: minmax(200px, 300px) minmax(0, 1fr); }
.facts dt, .facts dd { margin: 0; padding: 18px 0; border-top: 1px solid var(--line); }
.facts dt { font-family: var(--f-serif); font-size: 20px; font-weight: 600; line-height: 1.3; padding-right: 32px; }
.facts dd { color: var(--ink-2); max-width: 640px; }
.facts dd a { color: var(--ink); }

/* faq */
.faq { border-top: 1px solid var(--line); max-width: 860px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 0; min-height: 56px; font-weight: 500; font-size: 17px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; flex: none; width: 10px; height: 10px; border-right: 1.5px solid var(--ink-2); border-bottom: 1.5px solid var(--ink-2);
  transform: rotate(45deg) translate(-2px, -2px); transition: transform .15s; }
.faq details[open] summary::after { transform: rotate(-135deg) translate(-2px, -2px); }
.faq summary:hover { color: var(--accent-text); }
.faq .answer { padding: 0 0 18px; color: var(--ink-2); max-width: 700px; }
.faq .answer p:last-child { margin-bottom: 0; }
.faq .answer a { color: var(--ink); }

/* ---------------------------------------------------------------- connect */
.page-head { padding: 52px 0 28px; }
.page-head p { color: var(--ink-2); font-size: 18px; max-width: 640px; margin: 14px 0 0; }
.connect-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 32px; align-items: start; padding-bottom: 64px; }
.creds { display: grid; gap: 18px; }
.creds .field-label { display: flex; justify-content: space-between; gap: 12px; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 22px; }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; min-height: 44px; padding: 0 12px;
  color: var(--ink-2); font: 500 15px var(--f-sans); cursor: pointer; }
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.steps { list-style: none; counter-reset: s; margin: 0; padding: 0; }
.steps li { counter-increment: s; position: relative; padding: 0 0 16px 44px; min-height: 30px; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: -1px; width: 28px; height: 28px; border: 1px solid var(--line-2);
  border-radius: 50%; display: grid; place-items: center; font-family: var(--f-serif); font-weight: 600; font-size: 15px; color: var(--accent-text); }
.steps b { font-weight: 600; color: var(--ink); }
.steps .ui { font-family: var(--f-mono); font-size: 14px; background: var(--surface-2); padding: 1px 6px; border-radius: 4px; color: var(--ink); white-space: nowrap; }
.pre { position: relative; }
.pre pre { margin: 0; padding: 14px 16px; padding-right: 110px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r);
  font: 13.5px/1.6 var(--f-mono); color: var(--ink); overflow-x: auto; white-space: pre; }
.pre .btn { position: absolute; top: 8px; right: 8px; background: var(--surface); }
.errors-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.errors-table td { padding: 10px 0; border-top: 1px solid var(--line); vertical-align: top; }
.errors-table td:first-child { width: 1%; white-space: nowrap; padding-right: 24px; font-family: var(--f-mono); font-weight: 500; color: var(--ink); }
.errors-table td:last-child { color: var(--ink-2); }

/* ---------------------------------------------------------------- auth */
.auth { max-width: 440px; margin: 0 auto; padding: 56px 0 72px; }
.auth h1 { font-size: 36px; margin-bottom: 8px; }
.auth .switch { color: var(--ink-2); margin-bottom: 24px; }
.auth form { display: grid; gap: 16px; }
.auth .legal { font-size: 13.5px; color: var(--ink-3); margin: 0; }
.auth .legal a { color: var(--ink-2); }

/* ---------------------------------------------------------------- cabinet */
.cab { display: grid; grid-template-columns: 310px minmax(0, 1fr); gap: 40px; align-items: start; padding-top: 32px; padding-bottom: 72px; }
.cab-side { position: sticky; top: calc(var(--header-h) + 20px); display: grid; gap: 16px; }
.cab > *, .cab-side > * { min-width: 0; }
.bal-big { font-family: var(--f-serif); font-size: 46px; font-weight: 600; line-height: 1.05; letter-spacing: -.015em; margin: 6px 0 4px;
  font-variant-numeric: tabular-nums lining-nums; overflow-wrap: anywhere; }
.bal-big .cur { color: var(--ink-3); font-weight: 500; margin-left: .12em; }
.bal-sub { color: var(--ink-3); font-size: 14px; }
.topup { display: grid; gap: 14px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.topup legend { margin-bottom: 8px; }
.prov { display: grid; gap: 6px; }
.prov label { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: var(--r); cursor: pointer; }
.prov label:has(input:checked) { border-color: var(--accent); background: var(--accent-wash); }
.prov input { width: 18px; height: 18px; min-height: 0; margin: 2px 0 0; accent-color: var(--accent); flex: none; }
.prov small { display: block; color: var(--ink-3); font-size: 13px; }
.pending { display: grid; gap: 10px; margin-top: 18px; padding: 14px; border: 1px solid var(--accent); border-radius: var(--r); background: var(--accent-wash); }
.pending h3 { font-size: 16px; display: flex; align-items: center; gap: 10px; }
.pp-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pp-hide { flex: none; width: 32px; height: 32px; margin: -6px -6px -6px 0; display: grid; place-items: center; font: 400 22px/1 var(--f-sans);
  color: var(--ink-3); background: none; border: 0; border-radius: var(--r); cursor: pointer; }
.pp-hide:hover { color: var(--ink); background: var(--surface-2); }
.pending p { margin: 0; font-size: 14px; color: var(--ink-2); }
.pending .row { display: flex; flex-wrap: wrap; gap: 8px; }
.pending.failed { border-color: var(--err); background: var(--err-wash); }
.spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--accent); animation: spin 1s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } * { scroll-behavior: auto !important; } }
.redeem summary { cursor: pointer; color: var(--ink-2); font-size: 15px; min-height: 40px; display: flex; align-items: center; list-style: none; gap: 8px; }
.redeem summary::-webkit-details-marker { display: none; }
.redeem summary::before { content: "+"; font-family: var(--f-mono); color: var(--accent-text); width: 12px; }
.redeem[open] summary::before { content: "−"; }
.redeem summary:hover { color: var(--ink); }
.redeem form { display: flex; gap: 8px; margin-top: 6px; }
.redeem input { font-family: var(--f-mono); font-size: 15px; text-transform: uppercase; }
.redeem input::placeholder { text-transform: none; }

.cab-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 10px 24px; margin-bottom: 8px; }
.cab-head h1 { font-size: clamp(30px, 4vw, 40px); }
.whoami { color: var(--ink-3); font-size: 14px; }
.subnav { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 4px 0 18px; }
.subnav a { color: var(--ink-2); text-decoration: none; font-size: 15px; min-height: 36px; display: inline-flex; align-items: center; }
.subnav a:hover { color: var(--accent-text); }
.status-line { display: flex; flex-wrap: wrap; gap: 6px 20px; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.status-line .mono { color: var(--ink); font-size: 14px; }
.block { padding: 36px 0 0; }
.block-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 10px 20px; margin-bottom: 16px; }
.block-head h2 { font-size: 26px; }
.block-head p { margin: 0; color: var(--ink-3); font-size: 14px; }

/* keys */
.key-create { display: flex; gap: 8px; margin-bottom: 14px; }
.key-create input { max-width: 340px; }
.newkey { border: 1px solid var(--accent); border-radius: var(--r-lg); padding: 18px; margin-bottom: 16px; background: var(--accent-wash); display: grid; gap: 12px; }
.newkey h3 { font-size: 17px; }
.newkey p { margin: 0; color: var(--ink-2); font-size: 14.5px; }
.newkey .keyval { font-family: var(--f-mono); font-size: 16px; line-height: 1.45; padding: 12px 14px; background: var(--bg); border: 1px dashed var(--accent);
  border-radius: var(--r); overflow-wrap: anywhere; user-select: all; color: var(--ink); }
.newkey .row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.keys { border-top: 1px solid var(--line); }
.key { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, .7fr) minmax(0, 1fr) auto; gap: 6px 20px; align-items: center;
  padding: 14px 0; border-bottom: 1px solid var(--line); }
.key-name { font-weight: 600; overflow-wrap: anywhere; }
.key-name .faint { font-weight: 400; }
.key-hint { font-family: var(--f-mono); font-size: 13.5px; color: var(--ink-3); margin-top: 2px; }
.key-meta { font-size: 14px; color: var(--ink-2); }
.key-meta .k { display: block; color: var(--ink-3); font-size: 12.5px; }
.key-acts { display: flex; gap: 6px; justify-content: flex-end; }
.key.off .key-name, .key.off .key-meta { opacity: .55; }

/* spend chart */
.totals { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 0 0 20px; }
.totals div { border-left: 1px solid var(--line); padding-left: 14px; }
.totals dt { font-size: 13px; color: var(--ink-3); margin-bottom: 4px; }
.totals dd { margin: 0; font-family: var(--f-serif); font-size: 24px; font-weight: 600; line-height: 1.15; font-variant-numeric: tabular-nums lining-nums; }
.totals dd small { display: block; font-family: var(--f-sans); font-size: 13px; font-weight: 400; color: var(--ink-3); margin-top: 2px; }
.chart { position: relative; height: 190px; user-select: none; touch-action: pan-y; }
.chart svg { width: 100%; height: 100%; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .base { stroke: var(--line-2); stroke-width: 1; }
.chart .axis { fill: var(--ink-3); font: 12px var(--f-sans); font-variant-numeric: tabular-nums; }
.chart .bar { fill: var(--bar); }
.chart .hit { fill: transparent; cursor: pointer; }
.chart .col.hover .bar, .chart .col.sel .bar { fill: var(--bar-hover); }
.chart .col.hover .hit, .chart .col.sel .hit { fill: var(--accent-wash); }
.chart .zero { fill: var(--line-2); }
.tip { position: absolute; z-index: 5; pointer-events: none; min-width: 170px; padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--line-2);
  border-radius: var(--r); box-shadow: var(--shadow); font-size: 13.5px; line-height: 1.5; color: var(--ink-2); }
.tip b { display: block; color: var(--ink); font-weight: 600; margin-bottom: 2px; }
.tip .v { color: var(--ink); font-variant-numeric: tabular-nums; }

/* history */
.filters { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: end; margin-bottom: 12px; }
.filters .field { min-width: 180px; flex: 0 1 220px; }
.filters .check { margin-left: 4px; }
.htable { width: 100%; border-collapse: collapse; font-size: 15px; table-layout: fixed; }
.htable col.c-t { width: 100px; } .htable col.c-tok { width: 128px; } .htable col.c-cost { width: 96px; }
.htable col.c-dur { width: 72px; } .htable col.c-st { width: 156px; }
.htable th { text-align: left; font-size: 13px; font-weight: 500; color: var(--ink-3); padding: 0 10px 8px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.htable th.num { text-align: right; }
.htable td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.htable th:first-child, .htable td:first-child { padding-left: 0; }
.htable th:last-child, .htable td:last-child { padding-right: 0; }
.htable .t { white-space: nowrap; color: var(--ink-2); }
.htable .m { min-width: 0; }
.htable .m .mono, .htable .m .kn { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.htable .m .mono { font-size: 14px; color: var(--ink); }
.htable .m .kn { font-size: 13px; color: var(--ink-3); }
.htable .tok { white-space: nowrap; }
.htable .tok .arr { color: var(--ink-3); padding: 0 3px; }
.htable .cost { font-weight: 500; white-space: nowrap; }
.htable .cost .faint { font-weight: 400; }
.htable .cost .est { color: var(--warn); margin-right: 2px; cursor: help; }
.htable .dur { color: var(--ink-2); white-space: nowrap; }
.htable .st { white-space: nowrap; text-align: right; }
.htable tr.prob { cursor: pointer; }
.htable tr.prob:hover td { background: var(--surface); }
.htable tr.prob:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.htable .more { display: inline-block; width: 7px; height: 7px; margin: 0 2px 3px 10px; border-right: 1.5px solid var(--ink-3); border-bottom: 1.5px solid var(--ink-3);
  transform: rotate(45deg); transition: transform .15s; vertical-align: middle; }
.htable tr.prob:hover .more { border-color: var(--ink); }
.htable tr.has-detail .more { transform: rotate(-135deg); margin-bottom: -2px; }
.htable tr.detail td { padding-top: 0; color: var(--ink-2); font-size: 14px; background: var(--surface); white-space: normal; text-align: left; }
.htable tr.detail .mono { font-size: 13px; overflow-wrap: anywhere; color: var(--ink); }
.htable tr.has-detail td { border-bottom-color: transparent; background: var(--surface); }
.more-row { display: flex; align-items: center; gap: 14px; margin-top: 14px; color: var(--ink-3); font-size: 14px; }

/* payments, referral, account */
.ptable { width: 100%; border-collapse: collapse; font-size: 15px; }
.ptable td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: baseline; }
.ptable td:first-child { padding-left: 0; color: var(--ink-2); white-space: nowrap; width: 1%; }
.ptable td:last-child { padding-right: 0; text-align: right; }
.ptable .amt { font-weight: 600; white-space: nowrap; text-align: right; width: 1%; }
.ref { display: grid; gap: 14px; max-width: 680px; }
.ref-stats { display: flex; flex-wrap: wrap; gap: 8px 28px; color: var(--ink-2); }
.ref-stats b { color: var(--ink); font-family: var(--f-serif); font-size: 22px; font-weight: 600; margin-left: 6px; }
.acct { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.acct form { display: grid; gap: 12px; max-width: 380px; }
.acct .who { display: grid; gap: 12px; align-content: start; }
.acct .who p { margin: 0; color: var(--ink-2); }

/* ---------------------------------------------------------------- footer */
.site-footer { border-top: 1px solid var(--line); padding: 28px 0 36px; color: var(--ink-3); font-size: 14px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 10px 28px; align-items: baseline; justify-content: space-between; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.site-footer a { color: var(--ink-2); text-decoration-color: var(--line-2); }
.site-footer a:hover { color: var(--ink); text-decoration-color: var(--accent); }

/* ---------------------------------------------------------------- toast & dialog */
#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 100; max-width: min(520px, calc(100% - 32px));
  padding: 12px 16px; border-radius: var(--r); background: var(--ink); color: var(--bg); font-size: 15px; font-weight: 500; line-height: 1.4;
  box-shadow: var(--shadow); display: none; }
#toast.err { background: var(--err); color: #1b0b08; }
dialog { width: min(460px, calc(100% - 32px)); padding: 24px; border: 1px solid var(--line-2); border-radius: var(--r-lg);
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(10, 8, 6, .72); }
dialog h3 { font-family: var(--f-serif); font-size: 22px; margin-bottom: 8px; }
dialog p { color: var(--ink-2); }
dialog .row { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 18px; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1120px) {
  .cab { grid-template-columns: minmax(0, 1fr); gap: 8px; padding-top: 20px; }
  .cab-side { position: static; }
}
@media (max-width: 1020px) {
  .intro { grid-template-columns: 1fr; gap: 40px; padding-top: 44px; padding-bottom: 56px; }
  .receipt { max-width: 560px; }
  .connect-grid { grid-template-columns: 1fr; }
  .totals { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .section { padding: 48px 0; }
  .lead { font-size: 17px; }
  .facts { grid-template-columns: 1fr; }
  .facts dt { padding: 18px 0 4px; }
  .facts dd { border-top: 0; padding: 0 0 18px; }
  .key { grid-template-columns: minmax(0, 1fr) auto; }
  .key-main { grid-column: 1 / -1; }
  .key-meta { grid-row: 2; }
  .key-acts { grid-column: 1 / -1; justify-content: flex-start; }
  .acct { grid-template-columns: 1fr; }
  .filters .field { flex: 1 1 140px; min-width: 0; }
  .bal-big { font-size: 42px; }
  .ptable td { padding: 11px 6px; }
}
@media (max-width: 760px) {
  /* history table becomes cards */
  .htable thead, .htable colgroup { display: none; }
  .htable, .htable tbody { display: block; }
  .htable tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .htable td { display: block; padding: 0 !important; border: 0; background: none !important; }
  .htable td.t { grid-column: 1; grid-row: 1; font-size: 14px; }
  .htable td.cost { grid-column: 2; grid-row: 1 / span 2; text-align: right; align-self: start; }
  .htable td.m { grid-column: 1; grid-row: 2; }
  .htable td.m { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .htable td.m .mono, .htable td.m .kn { display: inline; }
  .htable td.m .kn::before { content: " · "; }
  .htable td.tok { grid-column: 1; grid-row: 3; text-align: left; color: var(--ink-2); font-size: 14px; }
  .htable td.dur { grid-column: 2; grid-row: 3; font-size: 14px; }
  .htable td.st { grid-column: 1 / -1; grid-row: 4; text-align: left; }
  .htable td.cost .faint { color: var(--ink-3); }
  .htable td.st:empty { display: none; }
  .htable td.st .tag { margin-top: 6px; }
  .htable tr.has-detail { border-bottom: 0; padding-bottom: 4px; }
  .htable tr.detail { display: block; padding: 0 0 12px; }
  .htable tr.detail td { padding: 10px 12px !important; background: var(--surface) !important; border-radius: var(--r); }
}
@media (max-width: 560px) {
  /* payments: two lines per row */
  .ptable, .ptable tbody { display: block; }
  .ptable tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 11px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
  .ptable td { display: block; padding: 0 !important; border: 0; width: auto !important; }
  .ptable td:nth-child(1) { grid-column: 1; grid-row: 2; font-size: 13.5px; color: var(--ink-3); }
  .ptable td:nth-child(2) { grid-column: 1; grid-row: 1; }
  .ptable td:nth-child(3) { grid-column: 2; grid-row: 1; }
  .ptable td:nth-child(4) { grid-column: 2; grid-row: 2; text-align: right; }
  .ptable td.empty { grid-column: 1 / -1; grid-row: 1; }
}
@media (max-width: 480px) {
  .chips { grid-auto-flow: row; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .calc-grid { grid-template-columns: 1fr 1fr; }
  .cta .btn { flex: 1 1 auto; }
  .key-create { flex-direction: column; }
  .key-create input { max-width: none; }
  .totals dd { font-size: 21px; }
  .receipt { padding: 18px 16px 16px; }
  .panel { padding: 18px 16px; }
  .pre pre { padding-right: 16px; padding-top: 52px; }
}

/* ---------------------------------------------------------------- terms / long documents */
.doc-nav { display: flex; gap: 20px; margin-left: auto; }
.doc-nav a { color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: 15px; min-height: 40px; display: inline-flex; align-items: center; }
.doc-nav a:hover { color: var(--ink); }
@media (max-width: 420px) { .hide-xs { display: none !important; } .doc-nav { gap: 16px; } }
.doc-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 56px; align-items: start; padding-top: 48px; padding-bottom: 80px; }
.toc { position: sticky; top: calc(var(--header-h) + 24px); max-height: calc(100vh - var(--header-h) - 48px); overflow: auto; }
.toc summary { list-style: none; cursor: default; margin-bottom: 10px; }
.toc summary::-webkit-details-marker { display: none; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc a { display: block; padding: 5px 0 5px 14px; margin-left: -1px; border-left: 2px solid transparent; color: var(--ink-2); text-decoration: none;
  font-size: 14px; line-height: 1.35; }
.toc a:hover { color: var(--ink); }
.toc a.on { color: var(--ink); border-left-color: var(--accent); }

.prose { max-width: 70ch; font-family: var(--f-serif); font-size: 18px; line-height: 1.68; color: var(--ink); outline: none;
  font-variant-numeric: lining-nums; hyphens: auto; overflow-wrap: break-word; }
.prose h1 { font-size: clamp(32px, 4.6vw, 46px); line-height: 1.08; margin: 0 0 10px; }
.prose .doc-date, .prose h1 + p { font-family: var(--f-sans); font-size: 14px; color: var(--ink-3); margin-bottom: 36px; }
.prose h2 { font-size: clamp(23px, 2.6vw, 28px); margin: 2.3em 0 .65em; padding-top: 1em; border-top: 1px solid var(--line); position: relative; }
.prose h2:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }
.prose h3 { font-family: var(--f-serif); font-size: 20px; margin: 1.6em 0 .5em; }
.prose p, .prose li { color: color-mix(in srgb, var(--ink) 90%, var(--bg)); }
.prose p { margin: 0 0 .9em; }
.prose ul, .prose ol { margin: 0 0 1em; padding-left: 1.3em; }
.prose li { margin: .35em 0; padding-left: .2em; }
.prose li::marker { color: var(--accent-text); }
.prose strong { color: var(--ink); font-weight: 650; }
.prose a { color: var(--ink); }
.prose a:hover { color: var(--accent-text); }
.prose code { font-size: .82em; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
.prose .anchor { position: absolute; left: -1.1em; color: var(--ink-3); text-decoration: none; font-weight: 400; opacity: 0; transition: opacity .12s; padding-right: .3em; }
.prose h2:hover .anchor, .prose .anchor:focus { opacity: 1; }
.prose p.clause { display: grid; grid-template-columns: 3.1em minmax(0, 1fr); column-gap: .35em; }
.prose .cl-no { font-family: var(--f-sans); font-size: .78em; color: var(--ink-3); padding-top: .3em; font-variant-numeric: tabular-nums; }
.prose .clause-sub { margin-left: calc(3.1em + .35em); }
.prose ul.summary { list-style: none; padding: 18px 22px; margin: 0 0 1em; background: var(--surface); border: 1px solid var(--line);
  border-left: 3px solid var(--accent); border-radius: 0 var(--r-lg) var(--r-lg) 0; font-size: 17px; line-height: 1.55; }
.prose ul.summary li { position: relative; padding-left: 1.1em; margin: .55em 0; }
.prose ul.summary li::before { content: ""; position: absolute; left: 0; top: .68em; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.table-scroll { overflow-x: auto; margin: 0 0 1.2em; border: 1px solid var(--line); border-radius: var(--r); }
.prose .table-scroll > table { margin: 0; }
.prose table { width: 100%; border-collapse: collapse; font-family: var(--f-sans); font-size: 15px; line-height: 1.45; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.prose th { font-weight: 600; font-size: 13.5px; color: var(--ink-2); background: var(--surface); }
.prose tr:last-child td { border-bottom: 0; }
.prose td:first-child { color: var(--ink); min-width: 12em; }
.prose td { color: var(--ink-2); }
@media (max-width: 1020px) {
  .doc-layout { grid-template-columns: 1fr; gap: 20px; padding-top: 28px; }
  .toc { position: static; max-height: none; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 4px 16px; background: var(--surface); }
  .toc summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; justify-content: space-between; margin: 0; }
  .toc summary::after { content: "+"; font-family: var(--f-mono); color: var(--accent-text); font-size: 16px; }
  .toc details[open] summary::after { content: "−"; }
  .toc ol { margin-bottom: 12px; }
  .toc a { padding: 8px 0 8px 14px; font-size: 15px; }
}
@media (max-width: 560px) {
  .prose { font-size: 17px; line-height: 1.62; }
  .prose p.clause { grid-template-columns: 2.6em minmax(0, 1fr); column-gap: .25em; }
  .prose .clause-sub { margin-left: 0; }
  .prose td:first-child { min-width: 0; width: 56%; }
  .prose th, .prose td { padding: 10px 12px; }
  .prose ul.summary { padding: 14px 16px; font-size: 16px; }
  .prose .anchor { display: none; }
}
.only-menu { display: none !important; }
@media (max-width: 820px) { .site-header.open .nav .only-menu:not([hidden]) { display: flex !important; } }
@media (min-height: 760px) and (min-width: 1121px) { .cab-side { position: sticky; } }
@media (max-height: 759px) and (min-width: 1121px) { .cab-side { position: static; } }
main:focus, main:focus-visible, [tabindex="-1"]:focus { outline: none; }

/* Cloudflare Turnstile on the signup form: reserve the widget's height so the form doesn't jump */
.captcha { min-height: 65px; max-width: 100%; overflow: hidden; }

/* six header links don't fit between the mobile menu and a wide screen: drop "Вопросы" there (the FAQ is on the home page) */
@media (min-width: 821px) and (max-width: 1000px) { .nav { gap: 16px; } .nav a[data-nav="faq"] { display: none; } }

/* unread mark next to "Поддержка" in the header */
.nav-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-left: 6px; vertical-align: .15em; }

/* ---------------------------------------------------------------- support chat (/support) */
.support-page { padding-bottom: 72px; }
.support-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 32px; align-items: start; }
.chat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); display: flex; flex-direction: column; min-width: 0; }
.chat-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; padding: 14px 18px;
  border-bottom: 1px solid var(--line); }
.chat-title { font-family: var(--f-serif); font-size: 19px; }
.chat-host { font-family: var(--f-sans); font-size: 14px; font-weight: 400; color: var(--ink-3); }
.chat-who { font-size: 14px; color: var(--ink-3); }
.chat-who b { color: var(--ink-2); font-weight: 500; }
.chat-log { height: clamp(300px, 52vh, 600px); overflow-y: auto; overscroll-behavior: contain; padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.chat-empty { margin: auto; max-width: 36ch; text-align: center; color: var(--ink-3); }
.msg { max-width: min(82%, 640px); }
.msg.me { align-self: flex-end; }
.msg-meta { font-size: 12.5px; color: var(--ink-3); margin-bottom: 4px; }
.msg.me .msg-meta { text-align: right; }
.msg-body { padding: 10px 14px; border-radius: var(--r-lg); white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; }
.msg.me .msg-body { background: var(--surface-2); border: 1px solid var(--line-2); }
.msg.op .msg-body { background: var(--bg); border: 1px solid var(--line); border-left: 3px solid var(--accent); }
.chat-closed { margin: 0; padding: 10px 18px; font-size: 14px; color: var(--ink-2); background: var(--accent-wash); border-top: 1px solid var(--line); }
.chat-form { display: grid; gap: 10px; padding: 14px 18px 18px; border-top: 1px solid var(--line); }
.chat-form textarea { resize: vertical; min-height: 104px; max-height: 50vh; line-height: 1.5; }
.chat-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.support-side { display: grid; gap: 22px; align-content: start; }
.support-side p { margin: 0; }
.side-title { font-family: var(--f-sans); font-size: 15px; font-weight: 600; margin-bottom: 8px; }
.side-block ul { margin: 0 0 12px; padding-left: 1.2em; color: var(--ink-2); font-size: 15px; }
.side-block li { margin: 4px 0; }
.side-block li::marker { color: var(--accent-text); }
.guest-link p { color: var(--ink-2); font-size: 14.5px; margin-bottom: 12px; }
.guest-link code { font-size: 13px; }
.warn-box { padding: 14px 16px; border-radius: var(--r-lg); background: var(--warn-wash); border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent);
  font-size: 14.5px; color: var(--ink-2); line-height: 1.5; }
.warn-box b { color: var(--ink); }
@media (pointer: coarse) { .hide-touch { display: none; } }
@media (max-width: 900px) {
  .support-grid { grid-template-columns: 1fr; }
  .chat-log { height: clamp(280px, 55vh, 520px); }
}
@media (max-width: 560px) {
  .chat-head, .chat-form { padding-left: 14px; padding-right: 14px; }
  .chat-log { padding: 14px; }
  .msg { max-width: 92%; }
  .page-head { padding-top: 32px; }
}

/* ---------------------------------------------------------------- pricing page (/pricing) */
.pricing-page { padding-bottom: 72px; }
.pp-section { padding: 36px 0; border-top: 1px solid var(--line); }
.pp-section h2 { margin-bottom: 14px; }
.pp-lead, .pp-text { color: var(--ink-2); max-width: 760px; }
.pp-list { margin: 0 0 14px; padding-left: 1.2em; max-width: 760px; color: var(--ink-2); }
.pp-list li { margin: 6px 0; }
.pp-list li::marker { color: var(--accent-text); }
.pp-list b { color: var(--ink); }
.pricing-page .facts dd { color: var(--ink-2); }
.price-table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.45; }
.price-table th, .price-table td { text-align: left; vertical-align: top; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.price-table th { font-weight: 600; font-size: 13.5px; color: var(--ink-2); background: var(--surface); white-space: nowrap; }
.price-table tr:last-child td { border-bottom: 0; }
.price-table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums lining-nums; }
.price-table th:not(:first-child) { text-align: right; }
.price-table .em { color: var(--accent-text); font-weight: 600; }
.pt-name { display: block; font-size: 15.5px; font-weight: 500; color: var(--ink); overflow-wrap: anywhere; }
.pt-desc { display: block; margin-top: 2px; font-size: 14px; color: var(--ink-3); }
@media (max-width: 640px) {
  .price-table thead { display: none; }
  .price-table, .price-table tbody, .price-table tr, .price-table td { display: block; width: 100%; }
  .price-table tr { padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .price-table tr:last-child { border-bottom: 0; }
  .price-table td { border: 0; padding: 3px 0; text-align: left; }
  .price-table td[data-label] { display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  .price-table td[data-label]::before { content: attr(data-label); color: var(--ink-3); font-weight: 400; text-align: left; }
  .price-table td:first-child { margin-bottom: 6px; }
}
