/* Richie interface. D29: readability first - high contrast, tabular figures, large key totals, status by word +
   colour + shape of the mark, no emoji. Look: dark tinted base with a faint grid, Manrope for text, Exo 2 italic
   for page titles and key totals only, JetBrains Mono for small labels; four colour themes on one structure.
   Spacing: one scale tied to the font size (--s1..--s5); controls and cells pad in em of their own text. */

@font-face { font-family: "Manrope"; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url(fonts/manrope-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: "Manrope"; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url(fonts/manrope-latin-ext-wght-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F,
    U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url(fonts/manrope-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: "Exo 2"; font-style: italic; font-weight: 800; font-display: swap;
  src: url(fonts/exo-2-latin-800-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: "Exo 2"; font-style: italic; font-weight: 800; font-display: swap;
  src: url(fonts/exo-2-cyrillic-800-italic.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(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; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 100 800; font-display: swap;
  src: url(fonts/jetbrains-mono-cyrillic-wght-normal.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }

/* Tokens. Status colours are the same in every theme, so a word and its mark mean the same after a switch. */
:root {
  --sans: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --display: "Exo 2", "Manrope", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --s1: 0.25rem; --s2: 0.5rem; --s3: 0.75rem; --s4: 1rem; --s5: 1.5rem;
  --radius: 10px; --radius-sm: 6px;
  --ok: #4ade80; --warn: #ffa53d; --bad: #ff6b6b; --info: #6cb2ff;
  --ok-bg: rgba(74, 222, 128, 0.14); --warn-bg: rgba(255, 165, 61, 0.14);
  --bad-bg: rgba(255, 107, 107, 0.15); --info-bg: rgba(108, 178, 255, 0.14);
  --focus: #ffffff;
  color-scheme: dark;
}
/* Циан (по умолчанию) */
:root, :root[data-theme="cyan"] {
  --bg: #050d12; --panel: #0a1820; --panel-2: #0f222c; --border: #1b3443; --border-strong: #2b4b5d;
  --text: #ecf6fa; --muted: #9db4c0; --accent: #3dd8f0; --accent-2: #7cc4ff; --accent-ink: #03141a;
  --g1: #2ef2e0; --g2: #38bdf8; --g3: #a5f3fc;
  --grid: rgba(61, 216, 240, 0.045); --glow: rgba(56, 189, 248, 0.16);
}
/* Жёлтая */
:root[data-theme="yellow"] {
  --bg: #0c0b05; --panel: #17150b; --panel-2: #201e10; --border: #36321a; --border-strong: #4f4925;
  --text: #f8f6e9; --muted: #bfba9c; --accent: #f5dd3d; --accent-2: #c8f05a; --accent-ink: #161300;
  --g1: #ffe14d; --g2: #f9f871; --g3: #b6f35c;
  --grid: rgba(245, 221, 61, 0.04); --glow: rgba(245, 221, 61, 0.12);
}
/* Зелёная */
:root[data-theme="green"] {
  --bg: #050e0c; --panel: #0a1814; --panel-2: #0f211b; --border: #1a3129; --border-strong: #28473c;
  --text: #eef7f3; --muted: #9cb5ab; --accent: #3ff0a0; --accent-2: #c6f55a; --accent-ink: #02140c;
  --g1: #3df5a0; --g2: #2ee6c8; --g3: #c6f55a;
  --grid: rgba(63, 240, 160, 0.045); --glow: rgba(46, 230, 200, 0.13);
}
/* Фиолетовая */
:root[data-theme="violet"] {
  --bg: #0b0814; --panel: #141024; --panel-2: #1c1631; --border: #2d2648; --border-strong: #443a64;
  --text: #f2eefb; --muted: #b3aacb; --accent: #b69cff; --accent-2: #f08cff; --accent-ink: #130a24;
  --g1: #b794ff; --g2: #8f7cff; --g3: #f08cff;
  --grid: rgba(182, 156, 255, 0.05); --glow: rgba(143, 124, 255, 0.17);
}
:root { --grad: linear-gradient(100deg, var(--g1), var(--g2) 55%, var(--g3)); }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  color: var(--text); font: 400 15px/1.45 var(--sans); font-variant-numeric: tabular-nums;
  background-color: var(--bg);
  background-image: radial-gradient(70rem 26rem at 50% -12rem, var(--glow), transparent 70%),
    linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: auto, 40px 40px, 40px 40px;
}
main.wrap, footer.wrap { flex: 1 0 auto; width: 100%; padding-bottom: var(--s5); }
footer.wrap { flex: none; padding-bottom: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.wrap { max-width: 1360px; margin: 0 auto; padding: 0 16px; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; }

/* type: one page title per screen in Exo 2 italic; everything else Manrope */
h1 { font: italic 800 1.55rem/1.2 var(--display); letter-spacing: 0.005em; margin: var(--s5) 0 var(--s2); }
h2 { font-size: 1.15rem; font-weight: 700; line-height: 1.3; margin: var(--s5) 0 var(--s2); }
h3 { font-size: 1rem; font-weight: 700; margin: var(--s4) 0 var(--s2); }
h1 .badge, h2 .badge, h3 .badge { vertical-align: 0.15em; }
p { margin: var(--s2) 0; }
ul, ol { margin: var(--s2) 0; padding-left: 1.25em; }
.lead { max-width: 60rem; }
.sub { color: var(--muted); font-size: 0.86rem; font-weight: 500; }
h1 .sub, h2 .sub { font-family: var(--sans); font-style: normal; font-weight: 500; letter-spacing: 0; }
.mono, code { font-family: var(--mono); font-size: 0.86em; }
.strong, strong { font-weight: 700; }
.pos, .ok-text { color: var(--ok); }
.neg, .bad-text { color: var(--bad); }
.warn-text { color: var(--warn); }
.zero, .muted { color: var(--muted); }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* section divider: dashed line with small triangle ends */
main > h2, main > section:not(.card):not(.tiles) > h2:first-child, .foot {
  padding-top: var(--s4);
  background:
    conic-gradient(from -30deg at 50% 100%, var(--accent) 60deg, transparent 0) left top / 8px 7px no-repeat,
    conic-gradient(from -30deg at 50% 100%, var(--accent) 60deg, transparent 0) right top / 8px 7px no-repeat,
    repeating-linear-gradient(90deg, var(--border-strong) 0 5px, transparent 5px 10px) left 3px / 100% 1px no-repeat;
}

/* header */
.top { position: sticky; top: 0; z-index: 10; border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--panel) 90%, transparent); backdrop-filter: blur(10px); }
.top-in { display: flex; align-items: center; gap: var(--s2) var(--s4); min-height: 3.25rem; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: var(--s2); color: var(--text); flex: none; }
.brand:hover { text-decoration: none; }
.logo { display: block; width: 2.25rem; height: auto; color: var(--text); flex: none; }
.wordmark { font: italic 800 1.3rem/1 var(--display); letter-spacing: 0.01em; }
.nav { display: flex; gap: 2px; flex-wrap: wrap; flex: 1; min-width: 0; }
.nav a, .tabs a { position: relative; color: var(--muted); font-weight: 600; font-size: 0.875rem;
  padding: 0.45em 0.55em; border-radius: var(--radius-sm); white-space: nowrap; }
.nav a:hover, .tabs a:hover { color: var(--text); background: var(--panel-2); text-decoration: none; }
.nav a[aria-current="page"], .tabs a[aria-current="page"] { color: var(--text); background: var(--panel-2); }
.nav a[aria-current="page"]::after, .tabs a[aria-current="page"]::after { content: ""; position: absolute;
  left: 0.55em; right: 0.55em; bottom: 2px; height: 2px; border-radius: 2px; background: var(--grad); }
.who { margin-left: auto; display: flex; gap: var(--s2); align-items: center; font-size: 0.9rem; font-weight: 600; }
.who form { margin: 0; }
.who + .themes { margin-left: 0; }
.demo-line { color: var(--muted); font-size: 0.8rem; padding-bottom: var(--s2); }
.demo-line::before { content: "[ данные ]"; font: 700 0.7rem var(--mono); letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--accent); margin-right: var(--s2); }

/* theme switch: four swatches */
.themes { display: flex; gap: 6px; align-items: center; margin-left: auto; flex: none; }
button.swatch { width: 1.35rem; height: 1.35rem; min-height: 0; padding: 0; border-radius: 50%;
  border: 2px solid var(--border-strong); box-shadow: none; }
button.swatch:hover { border-color: var(--text); }
button.swatch[aria-pressed="true"] { border-color: var(--text); box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px var(--muted); }
.swatch[data-theme-set="cyan"] { background: linear-gradient(135deg, #2ef2e0, #38bdf8); }
.swatch[data-theme-set="yellow"] { background: linear-gradient(135deg, #ffe14d, #b6f35c); }
.swatch[data-theme-set="green"] { background: linear-gradient(135deg, #3df5a0, #c6f55a); }
.swatch[data-theme-set="violet"] { background: linear-gradient(135deg, #b794ff, #f08cff); }

/* strips under the header: a notice for the signed-in admin (.strip.info or .strip.warn), trading off (bad) */
.strip { font-size: 0.875rem; border-top: 1px solid var(--info); background: var(--info-bg); }
.strip > .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s1) var(--s3);
  padding-top: var(--s2); padding-bottom: var(--s2); }
.strip p { margin: 0; }
.strip.warn { background: var(--warn-bg); border-top-color: var(--warn); }
.strip.warn strong { color: var(--warn); }
.strip.info strong { color: var(--info); }
.halt-banner { background: var(--bad-bg); color: var(--text); border-top: 2px solid var(--bad);
  border-bottom: 2px solid var(--bad); }
.halt-banner strong { color: var(--bad); }
.halt-in { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s4); padding: var(--s2) 0; }
.halt-in p { margin: 0; }
.halt-in input { width: 7em; }
form.kill { margin: var(--s2) 0 var(--s4); }

/* buttons: pill; primary - gradient with a soft glow; the rest outlined */
button, .btn {
  font: 650 0.9rem/1.2 var(--sans); color: var(--text); background: transparent;
  border: 1px solid var(--border-strong); border-radius: 999px; padding: 0.5em 0.95em; min-height: 2.35em;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 0.4em;
  white-space: nowrap; transition: border-color 0.12s, background-color 0.12s, box-shadow 0.12s;
}
button:hover, .btn:hover { border-color: var(--accent); background-color: var(--panel-2); text-decoration: none; }
button.primary, .btn.primary { background: var(--grad); border-color: transparent; color: var(--accent-ink);
  font-weight: 800; box-shadow: 0 0 0 1px color-mix(in srgb, var(--g2) 40%, transparent),
  0 4px 18px color-mix(in srgb, var(--g2) 28%, transparent); }
button.primary:hover, .btn.primary:hover { filter: brightness(1.06); border-color: transparent;
  box-shadow: 0 0 0 1px var(--g2), 0 6px 24px color-mix(in srgb, var(--g2) 45%, transparent); }
button.danger, .btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 60%, transparent); }
button.danger:hover { background-color: var(--bad-bg); border-color: var(--bad); }
button:disabled, button:disabled:hover { opacity: 0.45; cursor: not-allowed; background-color: transparent;
  border-color: var(--border-strong); box-shadow: none; filter: none; }
.actions { display: flex; gap: var(--s2); flex-wrap: wrap; align-items: center; }
.actions form { margin: 0; }
.grid td.actions { display: table-cell; }  /* a cell stays a cell; its forms line up inside */
.grid td.actions > form { display: inline-flex; margin: 0 var(--s2) var(--s1) 0; vertical-align: top; }
.grid td.actions > details { margin-bottom: var(--s1); }

/* forms */
.inline { display: flex; gap: var(--s2) var(--s3); flex-wrap: wrap; align-items: flex-end; margin: var(--s2) 0; }
.inline label { flex-direction: row; align-items: center; gap: var(--s2); }
.form { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: var(--s3); align-items: end; }
.form .span-all { grid-column: 1 / -1; }
.stack { display: grid; gap: var(--s3); margin: var(--s3) 0; }
label { display: flex; flex-direction: column; gap: var(--s1); color: var(--muted); font-size: 0.86rem; font-weight: 600; }
label.check span { display: flex; gap: var(--s2); align-items: center; }
input, select, textarea {
  font: 500 0.95rem/1.3 var(--sans); color: var(--text); background: var(--bg);
  border: 1px solid var(--border-strong); border-radius: 8px; padding: 0.45em 0.7em; min-height: 2.35em; min-width: 0;
  transition: border-color 0.12s, box-shadow 0.12s;
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 0.75; }
input:hover, select:hover, textarea:hover { border-color: var(--muted); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
input[type="checkbox"], input[type="radio"] { min-height: 0; width: 1.05em; height: 1.05em; accent-color: var(--accent); }
input[type="file"] { padding: 0.35em; font-size: 0.85rem; }
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), select { height: 2.4em; min-height: 0; }
textarea { font-family: var(--mono); font-size: 0.88rem; width: 100%; }
input.code { font: 600 1.4rem/1.2 var(--mono); letter-spacing: 0.25em; max-width: 9em; }
details.edit { width: 100%; }
details.edit summary, details.card summary, details.crit summary { cursor: pointer; }
details.edit summary { color: var(--accent); font-size: 0.9rem; font-weight: 600; }
details.edit .form { margin: var(--s3) 0; min-width: 17rem; }
details.crit summary { text-decoration: underline dotted; text-underline-offset: 3px; }
details.crit ul { margin: var(--s1) 0 0; padding-left: 1.1em; }

/* cards and messages */
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: var(--s4); margin: var(--s4) 0; }
.card > :first-child { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }
.card h2 { margin-top: 0; }
.card > h3:first-child { margin-top: 0; }
details.card { border-style: dashed; }
details.card[open] > summary { margin-bottom: var(--s3); }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); gap: var(--s4); margin: var(--s4) 0; }
.cols .card { margin: 0; }
.flash { padding: var(--s3) var(--s4); border-radius: var(--radius-sm); background: var(--panel);
  border: 1px dashed var(--border-strong); }
.flash.ok-text, .flash.bad-text, .flash.warn-text { border-style: solid; border-width: 1px 1px 1px 3px; color: var(--text); }
.flash.ok-text { border-color: var(--ok); background: var(--ok-bg); }
.flash.bad-text { border-color: var(--bad); background: var(--bad-bg); }
.flash.warn-text { border-color: var(--warn); background: var(--warn-bg); }
.flash.cmd { margin: var(--s3) 0; border-style: solid; }
.flash > :first-child { margin-top: 0; }
.flash > :last-child { margin-bottom: 0; }
.empty strong { display: block; font-size: 1rem; margin-bottom: var(--s1); }

/* tables: sticky heads inside their card, zebra and hover rows; numbers right-aligned and tabular */
.table-wrap { overflow: auto; max-height: 78vh; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--panel); margin: var(--s2) 0; }
.card .table-wrap { background: var(--bg); }
table.grid { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 0.94rem; }
.grid th, .grid td { padding: 0.45em 0.7em; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
.grid thead th { position: sticky; top: 0; z-index: 2; background: var(--panel-2); color: var(--muted);
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.01em; white-space: nowrap; vertical-align: bottom;
  border-bottom-color: var(--border-strong); }
.grid tbody tr:nth-child(even) > td { background: color-mix(in srgb, var(--panel-2) 45%, transparent); }
.grid tbody tr:hover > td { background: color-mix(in srgb, var(--accent) 7%, var(--panel)); }
.grid tr:last-child > td { border-bottom: 0; }
.grid td.num, .grid th.num { text-align: right; white-space: nowrap; }
.grid td.num { font-size: 0.98rem; font-weight: 500; }
.grid td.num .sub { white-space: normal; }
.grid tr.next > td { background: color-mix(in srgb, var(--info) 12%, var(--panel)); }
.grid tr.next > td:first-child { box-shadow: inset 3px 0 0 var(--info); }
.grid tr.best-worst > td { background: var(--ok-bg); }
.grid tr.best-worst > td:first-child { box-shadow: inset 3px 0 0 var(--ok); }
.grid tr.hypo > td { color: var(--muted); font-style: italic; }
.grid tr.total > td { background: var(--panel-2); font-weight: 700; border-top: 1px solid var(--border-strong); }
.grid tr.group-first > td { border-top: 2px solid var(--border-strong); }
.grid ul { margin: 0; padding-left: 1.1em; }
.grid tbody td:first-child:not(.num):not([colspan]) { min-width: 10rem; }
.signal { min-width: 14rem; }

/* status: word + colour + shape of the mark (D29): ok - filled circle, bad - filled diamond, warn - dashed
   outline with a triangle, info - ring, live - filled play triangle, muted - dash */
.badge { display: inline-flex; align-items: center; gap: 0.45em; font: 700 0.78rem/1.25 var(--sans);
  font-style: normal; letter-spacing: 0.01em; padding: 0.2em 0.6em; border-radius: var(--radius-sm);
  border: 1px solid currentColor; white-space: nowrap; text-transform: none; vertical-align: middle; }
.badge::before { content: ""; flex: none; width: 0.55em; height: 0.55em; background: currentColor; }
.badge.ok { color: var(--ok); background: var(--ok-bg); }
.badge.ok::before { border-radius: 50%; }
.badge.bad { color: var(--bad); background: var(--bad-bg); }
.badge.bad::before { transform: rotate(45deg); width: 0.5em; height: 0.5em; }
.badge.warn { color: var(--warn); background: transparent; border-style: dashed; }
.badge.warn::before { clip-path: polygon(50% 0, 100% 100%, 0 100%); width: 0.65em; height: 0.58em; }
.badge.info { color: var(--info); background: var(--info-bg); }
.badge.info::before { background: transparent; border: 2px solid currentColor; border-radius: 50%; width: 0.62em; height: 0.62em; }
.badge.live { color: var(--warn); background: var(--warn-bg); }
.badge.live::before { clip-path: polygon(0 0, 100% 50%, 0 100%); width: 0.55em; height: 0.62em; }
.badge.muted { color: var(--muted); background: transparent; border-color: var(--border-strong); }
.badge.muted::before { height: 2px; width: 0.6em; }

/* terms with a hint: dotted underline; the hint shows on hover and on focus (tab, tap); app.js keeps it in view */
.term { border-bottom: 1px dotted currentColor; cursor: help; }
.term:hover, .term:focus { border-bottom-style: solid; border-bottom-color: var(--accent); outline: none; }
.term:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
.tip { position: fixed; z-index: 50; display: block; width: max-content; max-width: min(21rem, calc(100vw - 24px));
  padding: var(--s2) var(--s3); border-radius: 8px; background: var(--panel-2); color: var(--text);
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--border-strong));
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55); font: 500 0.84rem/1.45 var(--sans); letter-spacing: normal; text-transform: none;
  text-align: left; white-space: normal; visibility: hidden; opacity: 0; pointer-events: none; transition: opacity 0.12s; }
.tip::before { content: ""; position: absolute; left: 8px; right: 8px; top: -1px; height: 2px; background: var(--grad); }
.term:hover > .tip, .term:focus > .tip { visibility: visible; opacity: 1; }

/* ladder tab */
.head h1 { display: flex; gap: var(--s3); align-items: center; flex-wrap: wrap; }
.headline { font-size: 1.15rem; font-weight: 700; margin: var(--s3) 0 var(--s1); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13.5rem), 1fr)); gap: var(--s3); margin: var(--s4) 0; }
.tile { position: relative; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: var(--s3) var(--s4); overflow: hidden; }
.tile::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--grad); opacity: 0.8; }
.tile-h { font: 700 0.72rem/1.35 var(--mono); letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); margin-bottom: var(--s1); }
.tile-v { font: italic 800 1.85rem/1.15 var(--display); font-variant-numeric: tabular-nums; margin-top: var(--s1); letter-spacing: 0.01em; }
.tile-v + .sub { margin-bottom: var(--s1); }
.tile .note { margin-top: var(--s2); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: var(--s1) var(--s4); margin: 0; }
.kv dt { color: var(--muted); font-weight: 600; font-size: 0.92rem; }
.kv dd { margin: 0; text-align: right; font-size: 1rem; font-weight: 600; }
.kv dd.big { font: italic 800 1.6rem/1.15 var(--display); }
.bar { height: 6px; background: var(--panel-2); border-radius: 999px; margin: var(--s3) 0 var(--s2); overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--grad); }
.exit .table-wrap, #inversion .table-wrap { margin: var(--s3) 0; }

/* sign-in, account, admins */
.card.auth-card { max-width: 25rem; margin: 3rem auto; padding: var(--s5); position: relative;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 18%, transparent), 0 18px 60px var(--glow); }
.auth-brand { display: flex; align-items: center; gap: var(--s3); margin-bottom: var(--s4); }
.auth-brand .logo { width: 3.5rem; }
.auth-brand .wordmark { font-size: 2rem; }
.auth-card h1 { margin-top: 0; font-size: 1.3rem; }
.auth-card .stack button { width: 100%; min-height: 2.6em; }
.enroll { display: flex; gap: var(--s5); flex-wrap: wrap; align-items: flex-start; margin: var(--s4) 0; }
.qr { width: 220px; height: 220px; background: #fff; border-radius: 8px; padding: 6px; flex: none; }
.qr svg { width: 100%; height: 100%; display: block; }
.secret { display: inline-block; font-size: 1.15rem; letter-spacing: 0.08em; word-spacing: 0.3em; background: var(--bg);
  border: 1px dashed var(--border-strong); border-radius: 8px; padding: var(--s2) var(--s3); margin: var(--s1) 0 var(--s2);
  user-select: all; overflow-wrap: anywhere; }
.steps { padding-left: 1.4em; margin: var(--s2) 0; }
.steps li { margin: var(--s1) 0; }
.tabs { display: flex; gap: 2px; flex-wrap: wrap; margin: var(--s4) 0 0; padding-bottom: var(--s1);
  border-bottom: 1px solid var(--border); }

/* bracket */
.bracket { display: grid; grid-template-columns: repeat(3, minmax(11rem, 1fr)); gap: var(--s3); overflow-x: auto; padding: var(--s1) 0 var(--s2); }
.b-col { position: relative; display: flex; flex-direction: column; justify-content: space-around; gap: var(--s2); }
.b-col > .b-h { position: absolute; top: 0; left: 0; }
.b-col:has(> .b-h) { padding-top: 1.6rem; }
.b-h { font: 700 0.72rem var(--mono); letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.b-match { border: 1px solid var(--border); border-radius: 8px; background: var(--panel); overflow: hidden; }
.b-pl { display: flex; justify-content: space-between; gap: var(--s3); padding: 0.4em 0.7em; color: var(--text);
  border-bottom: 1px solid var(--border); font-size: 0.92rem; }
a.b-pl:hover { background: var(--panel-2); text-decoration: none; }
.b-pl:last-child { border-bottom: 0; }
.b-pl.fav { background: color-mix(in srgb, var(--accent) 14%, var(--panel)); font-weight: 700; box-shadow: inset 3px 0 0 var(--accent); }

/* bot preview */
.chat { display: flex; flex-direction: column; gap: var(--s3); max-width: 40rem; margin-top: var(--s4); }
.msg { background: var(--panel); border: 1px solid var(--border); border-radius: 14px 14px 14px 4px; padding: var(--s3) var(--s4); }
.msg-h { font-weight: 800; margin-bottom: var(--s1); }
.btns { display: flex; gap: var(--s2); flex-wrap: wrap; margin-top: var(--s3); }

/* footer */
.foot { margin-top: var(--s4); padding-bottom: var(--s4); color: var(--muted); font: 500 0.75rem/1.5 var(--mono); }
.foot-in { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s4); justify-content: space-between; }
.foot b { color: var(--text); font-weight: 700; }

@media (max-width: 1300px) {
  .nav { order: 3; flex: 1 0 100%; margin: 0 -0.55em; padding-bottom: var(--s1); }
}
@media (max-width: 720px) {
  .top { position: static; backdrop-filter: none; }
  .top-in { padding-top: var(--s2); }
  .nav { flex-wrap: nowrap; overflow-x: auto; }
  h1 { font-size: 1.35rem; }
  .headline { font-size: 1.05rem; }
  .tile-v { font-size: 1.6rem; }
  .card { padding: var(--s3); }
  .card.auth-card { margin: var(--s5) auto; padding: var(--s4); }
  .grid th, .grid td { padding: 0.4em 0.6em; }
  .table-wrap { max-height: none; }
}

/* Decision requests (UX package 4): the one-time «allow notifications» button (static/requests.js); the
   switch of the parameters screen for an on/off parameter (telegram_money). */
.rq-allow { display: block; min-height: 44px; margin: var(--s3) 0; }
.flag-state { font-weight: 600; }
