/* Bioinformaniac portal: a sharp, technical interface. Black or deep-space surfaces, one accent colour,
   cut corners, HUD brackets, condensed headings and monospace labels. No glows, no colour gradients. */
@font-face { font-family: "BM Sans"; font-weight: 400; font-display: swap; src: url(../fonts/Barlow-400.woff2) format("woff2"); }
@font-face { font-family: "BM Sans"; font-weight: 500; font-display: swap; src: url(../fonts/Barlow-500.woff2) format("woff2"); }
@font-face { font-family: "BM Sans"; font-weight: 600; font-display: swap; src: url(../fonts/Barlow-600.woff2) format("woff2"); }
@font-face { font-family: "BM Sans"; font-weight: 700; font-display: swap; src: url(../fonts/Barlow-700.woff2) format("woff2"); }
@font-face { font-family: "BM Cond"; font-weight: 500; font-display: swap; src: url(../fonts/BarlowCondensed-500.woff2) format("woff2"); }
@font-face { font-family: "BM Cond"; font-weight: 600; font-display: swap; src: url(../fonts/BarlowCondensed-600.woff2) format("woff2"); }
@font-face { font-family: "BM Cond"; font-weight: 700; font-display: swap; src: url(../fonts/BarlowCondensed-700.woff2) format("woff2"); }
@font-face { font-family: "BM Mono"; font-weight: 400 600; font-display: swap; src: url(../fonts/JetBrainsMono-400.woff2) format("woff2"); }

/* ---------- themes (chosen by an admin) ---------- */
:root, :root[data-theme="core"] {
  --bg: #050607;
  --panel: #0b0e10;
  --panel-2: #11151a;
  --line: #1c2227;
  --line-2: #2c343b;
  --text: #ecf0f2;
  --text-2: #a8b2b9;
  --muted: #6b767e;
  --field: #080a0c;
  --grid: rgba(255, 255, 255, .035);
  --shade: rgba(0, 0, 0, .6);
  --accent: #e8590c; --on-accent: #050607; --accent-dim: rgba(232, 89, 12, .12); --accent-line: rgba(232, 89, 12, .5);
  --danger: #ff5a4f; --ok: #3fb950; --warn: #f2b134;
  --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70;
  color-scheme: dark;
}
:root[data-theme="vast"] {
  --bg: #03050c;
  --panel: #070b17;
  --panel-2: #0c1222;
  --line: #151d33;
  --line-2: #233050;
  --text: #e8edff;
  --text-2: #a2adcf;
  --muted: #65709a;
  --field: #050812;
  --grid: rgba(150, 175, 255, .04);
  --shade: rgba(0, 2, 10, .65);
  color-scheme: dark;
}
:root[data-theme="lab"] {
  --bg: #eef0ee;
  --panel: #ffffff;
  --panel-2: #e6e9e6;
  --line: #d0d5d0;
  --line-2: #aeb5ae;
  --text: #0a0d0b;
  --text-2: #3a423d;
  --muted: #69716c;
  --field: #ffffff;
  --grid: rgba(0, 0, 0, .045);
  --shade: rgba(10, 14, 12, .35);
  --danger: #c4241a; --ok: #3f7d00; --warn: #9a6400;
  --series-1: #2a78d6; --series-2: #eb6834; --series-3: #1baf7a;
  color-scheme: light;
}
:root[data-accent="volt"] { --accent: #76b900; --accent-dim: rgba(118, 185, 0, .12); --accent-line: rgba(118, 185, 0, .45); }
:root[data-accent="ion"] { --accent: #00c8ff; --accent-dim: rgba(0, 200, 255, .12); --accent-line: rgba(0, 200, 255, .45); }
:root[data-accent="flare"] { --accent: #ff6b1a; --accent-dim: rgba(255, 107, 26, .12); --accent-line: rgba(255, 107, 26, .45); }
:root[data-accent="pulse"] { --accent: #ff2d8a; --accent-dim: rgba(255, 45, 138, .12); --accent-line: rgba(255, 45, 138, .45); }
:root[data-theme="lab"][data-accent="ember"], :root[data-theme="lab"]:not([data-accent]) { --accent: #b9440a; --on-accent: #ffffff; --accent-dim: rgba(185, 68, 10, .1); --accent-line: rgba(185, 68, 10, .5); }
:root[data-theme="lab"][data-accent="volt"] { --accent: #4a8200; --on-accent: #ffffff; --accent-dim: rgba(74, 130, 0, .1); --accent-line: rgba(74, 130, 0, .5); }
:root[data-theme="lab"][data-accent="ion"] { --accent: #00739e; --on-accent: #ffffff; --accent-dim: rgba(0, 115, 158, .1); }
:root[data-theme="lab"][data-accent="flare"] { --accent: #c24600; --on-accent: #ffffff; --accent-dim: rgba(194, 70, 0, .1); }
:root[data-theme="lab"][data-accent="pulse"] { --accent: #b8125f; --on-accent: #ffffff; --accent-dim: rgba(184, 18, 95, .1); }

:root {
  --nav-h: 58px;
  --cut: 14px;
  --cut-sm: 7px;
  --sans: "BM Sans", "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  --cond: "BM Cond", "Barlow Condensed", "Arial Narrow", sans-serif;
  --mono: "BM Mono", "JetBrains Mono", ui-monospace, Menlo, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; background-color: var(--bg); color: var(--text); font: 400 17px/1.6 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden;
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 64px 64px; background-attachment: fixed; }
:root[data-theme="vast"] body { background-image:
  radial-gradient(1px 1px at 12% 18%, rgba(255,255,255,.55) 50%, transparent 51%),
  radial-gradient(1px 1px at 68% 9%, rgba(255,255,255,.4) 50%, transparent 51%),
  radial-gradient(1px 1px at 84% 42%, rgba(255,255,255,.5) 50%, transparent 51%),
  radial-gradient(1px 1px at 35% 64%, rgba(255,255,255,.35) 50%, transparent 51%),
  radial-gradient(1px 1px at 52% 31%, rgba(255,255,255,.3) 50%, transparent 51%),
  radial-gradient(1px 1px at 91% 77%, rgba(255,255,255,.45) 50%, transparent 51%),
  radial-gradient(1px 1px at 22% 88%, rgba(255,255,255,.35) 50%, transparent 51%),
  radial-gradient(1.5px 1.5px at 6% 52%, rgba(255,255,255,.5) 50%, transparent 51%),
  linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 640px 640px, 640px 640px, 640px 640px, 640px 640px, 640px 640px, 640px 640px, 640px 640px, 640px 640px, 96px 96px, 96px 96px; }
body.in-app { overflow: hidden; background-image: none; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-family: var(--cond); font-weight: 700; line-height: 1; letter-spacing: .01em; text-transform: uppercase; }
p { margin: 0; }
[hidden] { display: none !important; }
::selection { background: var(--accent); color: var(--on-accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.cut { clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, var(--cut) 100%, 0 calc(100% - var(--cut))); }
.mono { font-family: var(--mono); }
.tag { font: 600 11.5px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.tag .dim { color: var(--muted); }

/* HUD corner brackets on panels */
.hud { position: relative; }
.hud::before, .hud::after { content: ""; position: absolute; width: 12px; height: 12px; pointer-events: none; z-index: 2; }
.hud::before { left: -1px; top: -1px; border-left: 2px solid var(--accent); border-top: 2px solid var(--accent); }
.hud::after { right: -1px; bottom: -1px; border-right: 2px solid var(--accent); border-bottom: 2px solid var(--accent); }

/* ---------- top bar ---------- */
.nav { position: sticky; top: 0; z-index: 50; background: var(--bg); border-bottom: 1px solid var(--line); }
.nav-row { height: var(--nav-h); display: flex; align-items: center; gap: 18px; padding: 0 clamp(16px, 3vw, 36px); }
.brand { display: flex; align-items: center; gap: 11px; flex-shrink: 0; color: var(--text); }
.brand svg { width: 30px; height: 30px; color: var(--accent); }
.brand span { font: 700 23px/1 var(--cond); letter-spacing: .04em; text-transform: uppercase; }
.brand span i { font-style: normal; color: var(--accent); }
.tabs { display: flex; align-items: stretch; gap: 0; margin-left: 18px; height: var(--nav-h); }
.tab { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 100%; padding: 0 16px; border: 0; background: none; cursor: pointer;
  color: var(--text-2); font: 600 15px/1 var(--cond); letter-spacing: .1em; text-transform: uppercase; }
.tab:hover { color: var(--text); background: var(--panel); }
.tab.is-active { color: var(--text); }
.tab.is-active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--accent); }
.tab .chev { width: 12px; height: 12px; transition: transform .15s; }
.menu { position: relative; }
.menu.open .tab .chev { transform: rotate(180deg); }
.dropdown { position: absolute; top: 100%; left: 0; min-width: 400px; padding: 6px; background: var(--panel); border: 1px solid var(--line-2);
  box-shadow: 0 18px 40px var(--shade); opacity: 0; transform: translateY(-4px); pointer-events: none; transition: opacity .12s, transform .12s; z-index: 60; }
.menu.open .dropdown { opacity: 1; transform: none; pointer-events: auto; }
.dropdown.right { left: auto; right: 0; min-width: 260px; }
.dd-item { display: flex; align-items: center; gap: 14px; padding: 12px; border-left: 2px solid transparent; }
.dd-item:hover, .dd-item:focus-visible { background: var(--panel-2); border-left-color: var(--accent); outline: none; }
.dd-item img { width: 40px; height: 40px; object-fit: contain; flex-shrink: 0; }
.dd-item .t { flex: 1; min-width: 0; }
.dd-item strong { display: block; font: 700 19px/1.1 var(--cond); letter-spacing: .05em; text-transform: uppercase; }
.dd-item .d { display: block; color: var(--muted); font-size: 14px; line-height: 1.4; margin-top: 3px; }
.dd-item .code { font: 600 11px var(--mono); color: var(--accent); letter-spacing: .1em; }
.dd-sep { height: 1px; margin: 6px 0; background: var(--line); }
.dd-foot { display: flex; justify-content: space-between; align-items: center; padding: 9px 12px; color: var(--text-2); font: 600 12px var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.dd-foot:hover { color: var(--accent); }
.dd-foot svg { width: 14px; height: 14px; }
.dd-link { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border: 0; background: none; color: var(--text-2); font-weight: 600; font-size: 15px; cursor: pointer; text-align: left; border-left: 2px solid transparent; }
.dd-link:hover { background: var(--panel-2); color: var(--text); border-left-color: var(--accent); }
.dd-link svg { width: 16px; height: 16px; }
.dd-head { padding: 10px 12px 8px; }
.dd-head strong { display: block; font-size: 15px; }
.dd-head span { color: var(--muted); font: 12px var(--mono); word-break: break-all; }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.user-chip { display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 12px 0 3px; border: 1px solid var(--line-2); background: var(--panel); cursor: pointer; font-weight: 600; font-size: 14.5px; }
.user-chip:hover { border-color: var(--accent); }
.user-chip .uname { max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip .chev { width: 12px; height: 12px; color: var(--muted); }
.avatar { width: 30px; height: 30px; flex-shrink: 0; display: grid; place-items: center; background: var(--accent); color: var(--on-accent);
  font: 700 13px/1 var(--cond); letter-spacing: .06em; overflow: hidden; clip-path: polygon(0 0, 100% 0, 100% 70%, 70% 100%, 0 100%); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 112px; height: 112px; font-size: 40px; }
.icon-btn { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--line-2); background: var(--panel); cursor: pointer; color: var(--text-2); }
.icon-btn:hover { color: var(--accent); border-color: var(--accent); }
.icon-btn svg { width: 16px; height: 16px; }
.burger { display: none; }

.nav-sub { display: none; align-items: center; gap: 12px; padding: 8px clamp(16px, 3vw, 36px); border-top: 1px solid var(--line); background: var(--panel); font-size: 14.5px; color: var(--text-2); }
body.in-app .nav-sub.has { display: flex; }
.nav-sub .tagline { flex-shrink: 0; font: 600 11px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; padding: 5px 8px; background: var(--accent); color: var(--on-accent); }
.nav-sub .msg { flex: 1; min-width: 0; }
.nav-sub .msg b { color: var(--text); }

/* inside an app: the bar hides, the tab at the top brings it back */
body.in-app .nav { position: fixed; left: 0; right: 0; top: 0; transform: translateY(-100%); transition: transform .18s ease; }
body.in-app .nav.peek { transform: none; box-shadow: 0 16px 40px var(--shade); }
.peek-tab { display: none; position: fixed; z-index: 49; top: 0; left: 50%; transform: translateX(-50%); height: 20px; padding: 0 16px 0 12px; gap: 6px; align-items: center;
  border: 0; background: var(--accent); color: var(--on-accent); font: 600 10.5px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; cursor: pointer;
  clip-path: polygon(0 0, 100% 0, calc(100% - 10px) 100%, 10px 100%); }
.peek-tab svg { width: 12px; height: 12px; }
body.in-app .peek-tab { display: inline-flex; }
.peek-zone { display: none; position: fixed; z-index: 48; top: 0; left: 0; right: 0; height: 6px; }
body.in-app .peek-zone { display: block; }

/* ---------- buttons, fields ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; height: 42px; padding: 0 20px; border: 0; cursor: pointer; white-space: nowrap;
  font: 700 15px/1 var(--cond); letter-spacing: .12em; text-transform: uppercase; transition: background .12s, color .12s, box-shadow .12s;
  clip-path: polygon(0 0, calc(100% - var(--cut-sm)) 0, 100% var(--cut-sm), 100% 100%, var(--cut-sm) 100%, 0 calc(100% - var(--cut-sm))); }
.btn svg { width: 16px; height: 16px; }
.btn.primary { background: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--text); color: var(--bg); }
.btn.ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.btn.ghost:hover { box-shadow: inset 0 0 0 1px var(--accent); color: var(--accent); }
.btn.soft { background: var(--panel-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.btn.soft:hover { box-shadow: inset 0 0 0 1px var(--accent); }
.btn.danger { background: transparent; color: var(--danger); box-shadow: inset 0 0 0 1px var(--line-2); }
.btn.danger:hover { box-shadow: inset 0 0 0 1px var(--danger); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn.lg { height: 52px; padding: 0 28px; font-size: 17px; }
.btn.icon { width: 32px; padding: 0; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.link { color: var(--accent); font-weight: 600; background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.field { display: grid; gap: 6px; align-content: start; }
.field label { font: 600 11.5px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--text-2); }
.field input, .field select { height: 44px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 0; background: var(--field); color: var(--text); font: inherit; font-size: 16px; outline: none; }
.field input:focus, .field select:focus { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.field input[readonly] { color: var(--muted); }
.field .hint { font-size: 13.5px; color: var(--muted); }
.check { display: flex; align-items: center; gap: 8px; font-size: 15px; color: var(--text-2); }
.check input { accent-color: var(--accent); }
.form-error { min-height: 1.3em; color: var(--danger); font-size: 14.5px; font-weight: 600; }
.form-ok { color: var(--ok); font-size: 15px; font-weight: 600; }

/* ---------- page structure ---------- */
.view { display: none; }
.view.is-on { display: block; }
.wrap { width: min(1220px, 100% - 32px); margin: 0 auto; }
.section { padding: clamp(56px, 7vw, 96px) 0; border-top: 1px solid var(--line); }
.sec-head { max-width: 760px; margin-bottom: 40px; }
.sec-head h2 { font-size: clamp(36px, 4.4vw, 56px); margin: 14px 0 16px; }
.sec-head p { color: var(--text-2); font-size: 18.5px; }

/* hero, with a figurative network behind it */
.hero-band { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); }
.hero-net { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.hero-net line { stroke-width: 1; }
.hero-band > .wrap { position: relative; z-index: 1; }
.hero-band .lead, .hero-band h1 { text-shadow: 0 0 18px var(--bg), 0 0 6px var(--bg); }
.hero { padding: clamp(48px, 7vw, 92px) 0 clamp(44px, 6vw, 80px); }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: center; }
.hero h1 { font-size: clamp(58px, 8.2vw, 118px); line-height: .9; margin: 20px 0 26px; letter-spacing: 0; }
.hero h1 .pre { display: block; font-size: .42em; color: var(--text-2); letter-spacing: .12em; margin-bottom: 10px; }
.hero h1 .acc { color: var(--accent); }
.hero .lead { font-size: clamp(18px, 1.45vw, 20px); color: var(--text-2); max-width: 600px; }
.hero .lead strong { color: var(--text); font-weight: 600; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.readout { display: grid; grid-template-columns: repeat(3, auto); justify-content: start; gap: 0; margin-top: 34px; border: 1px solid var(--line); width: max-content; max-width: 100%; }
.readout div { padding: 10px 18px; font: 11.5px var(--mono); color: var(--muted); letter-spacing: .1em; text-transform: uppercase; }
.readout div + div { border-left: 1px solid var(--line); }
.readout b { display: block; font: 700 26px/1.1 var(--cond); color: var(--text); letter-spacing: .02em; margin-top: 3px; }

.console { background: var(--panel); border: 1px solid var(--line); }
.console-bar { display: flex; align-items: center; gap: 12px; height: 34px; padding: 0 14px; border-bottom: 1px solid var(--line); font: 11px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.console-bar .live { color: var(--accent); display: inline-flex; align-items: center; gap: 6px; }
.console-bar .live i { width: 6px; height: 6px; background: var(--accent); animation: blink 1.6s steps(2) infinite; }
.console-bar .r { margin-left: auto; }
@keyframes blink { 50% { opacity: .15; } }
.console-body { display: grid; grid-template-columns: 1.2fr 1fr; }
.console-body > div { padding: 16px; }
.console-body > div + div { border-left: 1px solid var(--line); }
.console-body .lbl { font: 600 10.5px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--text-2); margin-bottom: 6px; }
.console-body .lbl b { color: var(--accent); margin-right: 6px; }
.console-body svg { width: 100%; height: auto; color: var(--text-2); }
.console-foot { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); }
.console-foot div { white-space: nowrap; padding: 10px 14px; font: 10.5px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.console-foot div + div { border-left: 1px solid var(--line); }
.console-foot b { display: block; font: 600 15px/1.3 var(--mono); color: var(--text); letter-spacing: 0; text-transform: none; }

/* products on home */
.products { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.pcard { position: relative; padding: 30px 32px 32px; background: var(--panel); border: 1px solid var(--line); display: flex; flex-direction: column; transition: border-color .15s; }
.pcard:hover { border-color: var(--accent-line); }
.pcard .code { position: absolute; right: 22px; top: 20px; font: 600 11px var(--mono); letter-spacing: .16em; color: var(--muted); }
.pcard .head { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.pcard .head img { width: 54px; height: 54px; object-fit: contain; }
.pcard h3 { font-size: 40px; letter-spacing: .03em; }
.pcard .sub { font: 600 11.5px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin-top: 6px; }
.pcard > p { color: var(--text-2); font-size: 17px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 16px 0 2px; }
.chip { padding: 4px 9px; font: 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); border: 1px solid var(--line-2); }
ul.spec { list-style: none; padding: 0; margin: 22px 0 28px; display: grid; gap: 0; border-top: 1px solid var(--line); }
ul.spec li { display: grid; grid-template-columns: 120px 1fr; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 15.5px; color: var(--text-2); }
ul.spec li b { font: 600 11px/1.9 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--text); }
.pcard .actions { margin-top: auto; display: flex; flex-wrap: wrap; gap: 10px; }

/* numbers strip */
.stats { display: grid; grid-template-columns: repeat(6, 1fr); border: 1px solid var(--line); background: var(--panel); }
.stat { padding: 22px 18px; }
.stat + .stat { border-left: 1px solid var(--line); }
.stat b { display: block; font: 700 54px/1 var(--cond); color: var(--text); }
.stat b em { font-style: normal; color: var(--accent); }
.stat span { display: block; margin-top: 8px; font: 11px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }

/* steps */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.step { padding: 26px 26px 28px; background: var(--panel); border: 1px solid var(--line); }
.step .n { font: 600 12px var(--mono); letter-spacing: .16em; color: var(--accent); }
.step h3 { font-size: 26px; margin: 16px 0 10px; }
.step p { color: var(--text-2); font-size: 16px; }

/* data table */
table.jt { width: 100%; border-collapse: collapse; font-size: 15.5px; background: var(--panel); border: 1px solid var(--line); }
table.jt th { text-align: left; padding: 12px 16px; font: 600 11px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--text-2); border-bottom: 1px solid var(--line-2); background: var(--panel-2); }
table.jt td { padding: 12px 16px; border-bottom: 1px solid var(--line); color: var(--text-2); vertical-align: top; }
table.jt tr:last-child td { border-bottom: 0; }
table.jt td.y { color: var(--accent); font: 600 13px var(--mono); letter-spacing: .08em; text-transform: uppercase; }
table.jt td.n { color: var(--muted); font: 13px var(--mono); letter-spacing: .08em; text-transform: uppercase; }

/* docs teaser */
.chapters-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 28px; list-style: none; padding: 0; margin: 0 0 28px; }
.chapters-list li { border-bottom: 1px solid var(--line); }
.chapters-list a { display: flex; gap: 12px; padding: 9px 0; color: var(--text-2); font-size: 15.5px; }
.chapters-list a:hover { color: var(--accent); }
.chapters-list .no { font: 600 12px/1.9 var(--mono); color: var(--accent); min-width: 24px; }

.footer { padding: 34px 0 44px; color: var(--muted); font: 12px var(--mono); letter-spacing: .08em; border-top: 1px solid var(--line); }
.footer .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; }
.footer nav { display: flex; gap: 20px; text-transform: uppercase; }
.footer nav a:hover { color: var(--accent); }
.footer .brand span { font-size: 19px; }
.footer .brand svg { width: 24px; height: 24px; }

/* products page */
.page { padding: 40px 0 80px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 30px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.page-head h1 { font-size: clamp(42px, 5vw, 64px); margin-top: 12px; }
.page-head p { color: var(--text-2); margin-top: 10px; }
.prod { display: grid; grid-template-columns: 1fr 1.1fr; gap: 44px; align-items: start; padding: 40px 0; border-bottom: 1px solid var(--line); }
.prod .head { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.prod .head img { width: 58px; height: 58px; object-fit: contain; }
.prod h2 { font-size: 48px; }
.prod .lead { color: var(--text-2); font-size: 18px; margin-bottom: 8px; }
.mods { display: grid; gap: 14px; }
.mod { padding: 18px 22px; background: var(--panel); border: 1px solid var(--line); }
.mod h4 { font-size: 22px; margin-bottom: 10px; }
.mod h4 small { font: 600 11px var(--mono); letter-spacing: .12em; color: var(--muted); margin-left: 8px; }
.mod ol, .mod ul { margin: 0; padding-left: 24px; color: var(--text-2); font-size: 15.5px; display: grid; gap: 4px; }
.mod li::marker { color: var(--muted); font-family: var(--mono); font-size: 12px; }
.mod .demo { font: 600 10.5px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--on-accent); background: var(--accent); padding: 1px 5px; margin-left: 6px; }

/* ---------- app views ---------- */
.view-app.is-on { position: fixed; inset: 0; display: flex; flex-direction: column; }
.frame-wrap { position: relative; flex: 1; min-height: 0; background: var(--bg); }
.frame-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: var(--bg); }
.loader { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; background: var(--bg); transition: opacity .25s; }
.loader.done { opacity: 0; pointer-events: none; }
.loader .box { display: grid; justify-items: center; gap: 14px; color: var(--text-2); font: 600 12px var(--mono); letter-spacing: .14em; text-transform: uppercase; }
.loader img { width: 54px; height: 54px; object-fit: contain; }
.loader .track { width: 180px; height: 2px; background: var(--line-2); overflow: hidden; }
.loader .track i { display: block; width: 35%; height: 100%; background: var(--accent); animation: slide 1s linear infinite; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(290%); } }

/* ---------- cards, tables ---------- */
.card { padding: 24px; background: var(--panel); border: 1px solid var(--line); }
.card + .card { margin-top: 18px; }
.card-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 18px; }
.card-head img { width: 36px; height: 36px; object-fit: contain; }
.card-head h2 { font-size: 26px; }
.card-head .sub { color: var(--muted); font-size: 14.5px; margin-top: 3px; }
.card-head .right { margin-left: auto; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th { text-align: left; font: 600 11px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: 0 10px 10px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.table td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; color: var(--text-2); }
.table tr:last-child td { border-bottom: 0; }
.table td.name { color: var(--text); font-weight: 600; }
.table td.name small { display: block; color: var(--muted); font-weight: 400; font: 12.5px var(--mono); margin-top: 2px; }
.table td.num { font-family: var(--mono); font-size: 13.5px; white-space: nowrap; }
.table td.act { text-align: right; white-space: nowrap; }
.table td.act .btn + .btn { margin-left: 6px; }
.table tr.clickable { cursor: pointer; }
.table tr.clickable:hover td { background: var(--panel-2); }
.badge { display: inline-block; padding: 3px 7px; font: 600 10.5px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; border: 1px solid var(--line-2); color: var(--text-2); white-space: nowrap; }
.badge.acc { border-color: var(--accent); color: var(--accent); }
.badge.off { border-color: var(--danger); color: var(--danger); }
.empty { padding: 24px; text-align: center; color: var(--muted); border: 1px dashed var(--line-2); font-size: 15.5px; }
.meter { min-width: 260px; }
.meter .lbl { display: flex; justify-content: space-between; font: 11.5px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--text-2); margin-bottom: 7px; }
.meter .track { height: 6px; background: var(--panel-2); border: 1px solid var(--line); overflow: hidden; }
.meter .track i { display: block; height: 100%; background: var(--accent); }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; margin: 0 0 10px; font: 13px var(--mono); }
.crumbs button { border: 0; background: none; cursor: pointer; color: var(--text-2); padding: 4px 8px; }
.crumbs button:hover { color: var(--accent); }
.crumbs span { color: var(--muted); }
.fname { display: inline-flex; align-items: center; gap: 10px; border: 0; background: none; padding: 0; color: inherit; font: inherit; font-weight: 600; text-align: left; }
.fname.dir { cursor: pointer; }
.fname.dir:hover { color: var(--accent); }
.fname svg { width: 17px; height: 17px; color: var(--muted); flex-shrink: 0; }
.fname.dir svg { color: var(--accent); }
.account { display: grid; grid-template-columns: 300px 1fr; gap: 20px; align-items: start; }
.profile { text-align: center; display: grid; justify-items: center; gap: 10px; }
.profile h2 { font-size: 28px; margin-top: 8px; }
.profile .em { color: var(--muted); font: 13px var(--mono); word-break: break-all; }
.profile .since { color: var(--muted); font-size: 13.5px; }
.profile .row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.form-grid { display: grid; gap: 16px; }
.form-grid .two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.gate { max-width: 560px; margin: 80px auto; padding: 40px 34px; background: var(--panel); border: 1px solid var(--line); text-align: center; }
.gate h2 { font-size: 34px; margin: 12px 0 12px; }
.gate p { color: var(--text-2); margin-bottom: 24px; }
.gate .cta-row { justify-content: center; margin-top: 0; }

/* restricted panels: admin sign-in, password reset */
.door { max-width: 460px; margin: clamp(40px, 10vh, 110px) auto; padding: 34px 32px 30px; background: var(--panel); border: 1px solid var(--line); }
.door h2 { font-size: 40px; margin: 14px 0 8px; }
.door p.sub { color: var(--text-2); margin-bottom: 22px; font-size: 16px; }
.door form { display: grid; gap: 14px; }
.door .btn.primary { width: 100%; height: 48px; margin-top: 4px; }
.door .foot { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); font: 12px var(--mono); color: var(--muted); letter-spacing: .04em; }
.door .foot code { color: var(--text-2); }

/* contact, bio, recovery code */
.contact-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: 20px; align-items: start; }
.contact-info h2 { font-size: 28px; margin-bottom: 12px; }
.contact-info p { color: var(--text-2); }
.field textarea { padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 0; background: var(--field); color: var(--text); font: inherit; font-size: 16px; line-height: 1.5; outline: none; resize: vertical; min-height: 110px; }
.field textarea:focus { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.bio-view { color: var(--text-2); font-size: 15px; text-align: left; white-space: pre-line; margin: 6px 0 4px; border-top: 1px solid var(--line); padding-top: 12px; width: 100%; }
.bio-view:empty { display: none; }
.alt-line { margin-top: 16px; text-align: center; font-size: 14.5px; }
.door .btn.ghost { margin-top: 2px; }
.codebox { padding: 16px; text-align: center; font: 600 22px/1.2 var(--mono); letter-spacing: .08em; color: var(--accent); border: 1px dashed var(--accent); background: var(--field); user-select: all; word-break: break-all; }
.msg-item { padding: 16px 0; border-bottom: 1px solid var(--line); }
.msg-item:last-child { border-bottom: 0; }
.msg-item.unread .msg-subject::before { content: ""; display: inline-block; width: 8px; height: 8px; background: var(--accent); margin-right: 8px; vertical-align: middle; }
.msg-head { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; }
.msg-subject { font-weight: 700; font-size: 16.5px; }
.msg-meta { color: var(--muted); font: 12.5px var(--mono); }
.msg-body { margin-top: 8px; color: var(--text-2); white-space: pre-line; font-size: 15.5px; }
.msg-actions { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }

/* uploader */
.drop { display: grid; place-items: center; gap: 6px; padding: 28px 18px; border: 1px dashed var(--line-2); text-align: center; color: var(--text-2); cursor: pointer; }
.drop.over { border-color: var(--accent); background: var(--accent-dim); }
.drop svg { width: 26px; height: 26px; color: var(--accent); }
.drop b { color: var(--text); }
.drop small { color: var(--muted); }
.uploads { display: grid; gap: 8px; margin-top: 12px; max-height: 220px; overflow-y: auto; }
.upl { display: grid; grid-template-columns: 1fr auto; gap: 5px 12px; padding: 9px 12px; background: var(--panel-2); border: 1px solid var(--line); font-size: 14.5px; }
.upl .n { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upl .s { color: var(--muted); font: 12.5px var(--mono); }
.upl .track { grid-column: 1 / -1; height: 3px; background: var(--line); overflow: hidden; }
.upl .track i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.upl.err .s { color: var(--danger); }
.upl.ok .s { color: var(--accent); }

/* ---------- docs ---------- */
.docs { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 48px; padding: 32px 0 80px; }
.docs-nav { position: sticky; top: calc(var(--nav-h) + 18px); align-self: start; max-height: calc(100vh - var(--nav-h) - 36px); overflow-y: auto; padding: 14px; background: var(--panel); border: 1px solid var(--line); font-size: 15px; }
.docs-nav input { width: 100%; height: 38px; padding: 0 12px; border: 1px solid var(--line-2); background: var(--field); color: var(--text); font: inherit; margin-bottom: 8px; }
.docs-nav h5 { margin: 16px 0 6px; font: 600 11px var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }
.docs-nav a { display: grid; grid-template-columns: 28px 1fr; padding: 6px 8px; color: var(--text-2); line-height: 1.35; border-left: 2px solid transparent; }
.docs-nav a .no { font: 12px/1.6 var(--mono); color: var(--muted); }
.docs-nav a:hover { color: var(--text); background: var(--panel-2); }
.docs-nav a.on { color: var(--text); background: var(--panel-2); border-left-color: var(--accent); font-weight: 600; }
.docs-nav a.on .no { color: var(--accent); }
.doc { max-width: 780px; }
.doc .chapter { display: none; }
.doc .chapter.on { display: block; }
.doc .part { font: 600 11.5px var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }
.doc h1 { font-size: clamp(40px, 4.6vw, 60px); margin: 14px 0 10px; }
.doc .standfirst { font-size: 20px; line-height: 1.55; color: var(--text-2); margin: 12px 0 28px; padding: 0 0 24px; border-bottom: 1px solid var(--line); }
.doc h2 { font-size: 30px; margin: 40px 0 12px; }
.doc h3 { font-size: 22px; margin: 26px 0 8px; color: var(--text); }
.doc p, .doc li { font-size: 17.5px; line-height: 1.75; color: var(--text); }
:root:not([data-theme="lab"]) .doc p, :root:not([data-theme="lab"]) .doc li { color: #cfd6db; }
.doc p + p { margin-top: 14px; }
.doc ul, .doc ol { padding-left: 24px; margin: 12px 0; display: grid; gap: 6px; }
.doc li::marker { color: var(--accent); }
.doc em { color: var(--text); }
.doc code { font: 14px var(--mono); background: var(--panel-2); padding: 1px 6px; border: 1px solid var(--line); }
.doc .cite { color: var(--muted); font-size: .9em; white-space: normal; }
.doc aside { margin: 24px 0; padding: 16px 20px; background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--accent); }
.doc aside.pitfall { border-left-color: var(--danger); }
.doc aside h4 { font: 600 11.5px var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }
.doc aside.pitfall h4 { color: var(--danger); }
.doc aside.tool h4 { color: var(--text-2); }
.doc aside p, .doc aside li { font-size: 16.5px; }
.doc .eq { font: 17px var(--mono); text-align: center; margin: 18px 0; color: var(--text); padding: 12px; border: 1px solid var(--line); background: var(--panel); }
.doc table.jt { margin: 18px 0; font-size: 15px; }
.doc .refs { margin-top: 40px; padding: 18px 20px; background: var(--panel); border: 1px solid var(--line); }
.doc .refs h2 { margin: 0 0 12px; font-size: 22px; }
.doc .refs ol { list-style: none; padding: 0; gap: 9px; counter-reset: r; }
.doc .refs li { counter-increment: r; display: grid; grid-template-columns: 34px 1fr; font-size: 15px; line-height: 1.55; color: var(--text-2); }
.doc .refs li::before { content: "[" counter(r) "]"; font: 12.5px/1.9 var(--mono); color: var(--accent); }
.doc .refs li i { color: var(--text); }
.doc .pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 40px; }
.doc .pager a { display: grid; gap: 4px; max-width: 48%; padding: 12px 16px; background: var(--panel); border: 1px solid var(--line); }
.doc .pager a:hover { border-color: var(--accent); }
.doc .pager small { color: var(--accent); font: 11px var(--mono); letter-spacing: .12em; text-transform: uppercase; }
.doc .pager span { font: 700 20px/1.1 var(--cond); text-transform: uppercase; }
.doc .pager .next { margin-left: auto; text-align: right; }

/* ---------- admin ---------- */
.subtabs { display: flex; flex-wrap: wrap; gap: 0; border-bottom: 1px solid var(--line); margin-bottom: 26px; }
.subtabs button { position: relative; height: 44px; padding: 0 18px; border: 0; background: none; cursor: pointer; color: var(--text-2); font: 600 15px var(--cond); letter-spacing: .1em; text-transform: uppercase; }
.subtabs button:hover { color: var(--text); background: var(--panel); }
.subtabs button.on { color: var(--text); }
.subtabs button.on::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--accent); }
.subtabs .count { display: inline-block; min-width: 18px; padding: 2px 5px; margin-left: 6px; background: var(--accent); color: var(--on-accent); font: 600 10.5px/1 var(--mono); }
.kpis { display: grid; grid-template-columns: repeat(6, 1fr); border: 1px solid var(--line); background: var(--panel); margin-bottom: 20px; }
.kpi { padding: 18px 16px 16px; }
.kpi + .kpi { border-left: 1px solid var(--line); }
.kpi .v { font: 700 40px/1 var(--cond); }
.kpi .l { color: var(--muted); font: 11px var(--mono); letter-spacing: .1em; text-transform: uppercase; margin-top: 8px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-2 > .card + .card { margin-top: 0; }
.chart-card h3 { font-size: 22px; }
.chart-card .sub { color: var(--muted); font-size: 14px; margin-top: 4px; }
.chart { position: relative; margin-top: 14px; }
.chart svg { width: 100%; height: auto; overflow: visible; }
.chart .grid line { stroke: var(--line); stroke-width: 1; }
.chart .axis text { fill: var(--muted); font: 11px var(--mono); }
.legend { display: flex; flex-wrap: wrap; gap: 16px; font: 12px var(--mono); color: var(--text-2); margin-top: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 14px; height: 3px; display: inline-block; }
.tip { position: absolute; z-index: 5; pointer-events: none; padding: 9px 11px; background: var(--panel-2); border: 1px solid var(--line-2); box-shadow: 0 10px 24px var(--shade); font: 12px var(--mono); color: var(--text); white-space: nowrap; transform: translate(-50%, -100%); margin-top: -10px; }
.tip b { display: block; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.tip .row { display: flex; align-items: center; gap: 7px; }
.tip .row i { width: 10px; height: 3px; }
.tablev { margin-top: 10px; }
.tablev summary { cursor: pointer; color: var(--muted); font: 11.5px var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.tablev .table-wrap { max-height: 240px; overflow: auto; margin-top: 8px; }
.status { display: inline-flex; align-items: center; gap: 7px; font: 600 12px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); }
.status i { width: 8px; height: 8px; background: var(--ok); }
.status.down i { background: var(--danger); }
.status.down { color: var(--danger); }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(580px, 100vw); z-index: 70; background: var(--panel); border-left: 1px solid var(--line-2); box-shadow: -20px 0 50px var(--shade);
  padding: 26px; overflow-y: auto; transform: translateX(100%); transition: transform .2s, visibility .2s; visibility: hidden; box-shadow: none; }
.drawer.open { transform: none; visibility: visible; box-shadow: -20px 0 50px var(--shade); }
.drawer .close { position: absolute; top: 16px; right: 16px; }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: grid; grid-template-columns: 150px 92px 1fr; gap: 12px; padding: 9px 2px; border-bottom: 1px solid var(--line); font-size: 14.5px; color: var(--text-2); }
.feed time { color: var(--muted); font: 12.5px var(--mono); }
.feed .app { font: 600 11px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.feed .who { color: var(--text); font-weight: 600; }
.swatches { display: flex; flex-wrap: wrap; gap: 12px; }
.swatch { display: grid; gap: 10px; justify-items: start; padding: 12px; background: var(--panel-2); border: 1px solid var(--line); cursor: pointer; min-width: 170px; font: 600 14px var(--cond); letter-spacing: .1em; text-transform: uppercase; color: var(--text); }
.swatch:hover { border-color: var(--line-2); }
.swatch.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.swatch .pv { display: flex; height: 30px; width: 100%; border: 1px solid var(--line-2); }
.swatch .pv i { flex: 1; }
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin-bottom: 16px; }
.filters .field { min-width: 190px; }
.filters .field select, .filters .field input { height: 40px; font-size: 15px; }
.linkbox { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.linkbox input { flex: 1; min-width: 0; height: 38px; padding: 0 10px; border: 1px solid var(--accent); background: var(--field); color: var(--text); font: 12.5px var(--mono); }

/* ---------- dialogs, toasts ---------- */
dialog { padding: 0; border: 0; background: transparent; color: var(--text); max-width: calc(100vw - 32px); }
dialog::backdrop { background: var(--shade); }
.modal { position: relative; width: 450px; max-width: 100%; padding: 30px; background: var(--panel); border: 1px solid var(--line-2); box-shadow: 0 30px 70px var(--shade); }
.modal.wide { width: 640px; }
.modal .close { position: absolute; top: 12px; right: 12px; }
.modal .mhead { margin-bottom: 22px; }
.modal .mhead h2 { font-size: 34px; margin-top: 10px; }
.modal .mhead p { color: var(--text-2); font-size: 15.5px; margin-top: 8px; }
.modal .mhead.center { text-align: center; }
.seg { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line-2); margin-bottom: 20px; }
.seg button { height: 38px; border: 0; background: none; cursor: pointer; font: 600 14px var(--cond); letter-spacing: .12em; text-transform: uppercase; color: var(--text-2); }
.seg button + button { border-left: 1px solid var(--line-2); }
.seg button.on { background: var(--accent); color: var(--on-accent); }
.modal form { display: grid; gap: 14px; }
.modal form .btn.primary { width: 100%; height: 46px; }
.modal .alt { text-align: center; color: var(--muted); font-size: 14.5px; margin-top: 14px; }
.modal .alt + .alt { margin-top: 6px; }
.avatar-pick { display: flex; align-items: center; gap: 14px; }
.avatar-pick .avatar { width: 46px; height: 46px; font-size: 17px; }
.avatar-pick .avatar svg { width: 22px; height: 22px; }
.lock-list { list-style: none; padding: 0; margin: 0 0 22px; display: grid; gap: 0; border-top: 1px solid var(--line); }
.lock-list li { display: grid; grid-template-columns: 24px 1fr; gap: 6px; padding: 9px 0; border-bottom: 1px solid var(--line); color: var(--text-2); font-size: 15.5px; }
.lock-list svg { width: 16px; height: 16px; color: var(--accent); margin-top: 4px; }
.two-btn { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.two-btn .btn { width: 100%; height: 44px; }
.toasts { position: fixed; z-index: 100; right: 20px; bottom: 20px; display: grid; gap: 10px; max-width: min(420px, calc(100vw - 40px)); }
.toast { display: flex; gap: 10px; align-items: flex-start; padding: 13px 15px; background: var(--panel-2); border: 1px solid var(--line-2); border-left: 3px solid var(--ok); box-shadow: 0 16px 34px var(--shade); font-size: 15px; }
.toast.error { border-left-color: var(--danger); }
.toast.info { border-left-color: var(--accent); }
.toast svg { width: 17px; height: 17px; flex-shrink: 0; margin-top: 2px; }
.toast.ok svg, .toast.info svg { color: var(--accent); }
.toast.error svg { color: var(--danger); }
.toast.out { opacity: 0; transition: opacity .2s; }

/* ---------- small screens ---------- */
@media (max-width: 1050px) {
  .hero-grid, .products, .prod, .account, .grid-2, .docs, .contact-grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(3, 1fr); }
  .stat:nth-child(4) { border-left: 0; }
  .stat:nth-child(n+4) { border-top: 1px solid var(--line); }
  .chapters-list { grid-template-columns: 1fr 1fr; }
  .kpis { grid-template-columns: repeat(3, 1fr); }
  .kpi:nth-child(4) { border-left: 0; }
  .kpi:nth-child(n+4) { border-top: 1px solid var(--line); }
  .docs-nav { position: static; max-height: 280px; }
  .docs { gap: 22px; }
}
@media (max-width: 760px) {
  body { font-size: 16px; }
  .burger { display: grid; }
  .tabs { position: fixed; top: var(--nav-h); left: 0; right: 0; margin: 0; height: auto; padding: 8px 16px 14px; flex-direction: column; align-items: stretch;
    background: var(--panel); border-bottom: 1px solid var(--line-2); box-shadow: 0 16px 40px var(--shade); display: none; }
  .nav.menu-open .tabs { display: flex; }
  .tab { height: 48px; justify-content: space-between; }
  .tab.is-active::after { display: none; }
  .tab.is-active { color: var(--accent); }
  .dropdown { position: static; min-width: 0; box-shadow: none; display: none; transform: none; opacity: 1; pointer-events: auto; }
  .menu.open .dropdown { display: block; }
  .user-menu .dropdown { position: absolute; display: block; opacity: 0; pointer-events: none; }
  .user-menu.open .dropdown { opacity: 1; pointer-events: auto; }
  .user-chip .uname, .user-chip .chev { display: none; }
  .user-chip { padding: 0 3px; }
  .guest-only .btn.ghost { display: none; }
  .readout { grid-template-columns: 1fr 1fr 1fr; width: 100%; }
  .readout div { padding: 10px 12px; }
  .console-body { grid-template-columns: 1fr; }
  .console-body > div + div { border-left: 0; border-top: 1px solid var(--line); }
  .console-foot { grid-template-columns: 1fr 1fr; }
  .console-foot div:nth-child(3) { border-left: 0; }
  .console-foot div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(odd) { border-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--line); }
  ul.spec li { grid-template-columns: 1fr; gap: 2px; }
  .chapters-list { grid-template-columns: 1fr; }
  .form-grid .two { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .kpi:nth-child(odd) { border-left: 0; }
  .kpi:nth-child(n+3) { border-top: 1px solid var(--line); }
  .table .hide-sm { display: none; }
  .feed li { grid-template-columns: 1fr; gap: 2px; }
  .nav-sub .msg .long { display: none; }
  .pcard { padding: 24px 20px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- pricing ---------- */
.price-toggle { align-self: end; }
.price-toggle button { padding: 9px 14px; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-top: 8px; }
.plan { position: relative; display: flex; flex-direction: column; padding: 24px 22px; background: var(--panel); border: 1px solid var(--line); }
.plan.featured { border-color: var(--accent-line); box-shadow: 0 0 0 1px var(--accent-line) inset; }
.plan .ribbon { position: absolute; top: -11px; right: 16px; padding: 3px 10px; background: var(--accent); color: var(--on-accent); font: 700 11px var(--mono); text-transform: uppercase; letter-spacing: .1em; }
.plan h3 { margin: 0; font: italic 700 26px var(--cond); text-transform: uppercase; letter-spacing: .04em; }
.plan .tagline { margin: 4px 0 14px; color: var(--text-2); font-size: 15px; min-height: 44px; }
.plan .price { display: flex; align-items: baseline; gap: 8px; margin-bottom: 14px; }
.plan .price b { font: 700 44px/1 var(--cond); }
.plan .price span { color: var(--muted); font-size: 14px; }
.plan ul { list-style: none; padding: 0; margin: 0 0 20px; display: grid; gap: 8px; flex: 1; }
.plan li { display: flex; gap: 8px; font-size: 14.5px; color: var(--text-2); }
.plan li svg { width: 16px; height: 16px; color: var(--accent); flex: none; margin-top: 3px; }
.plan .cta .btn { width: 100%; justify-content: center; }
.plans-note { color: var(--text-2); font-size: 14.5px; margin-top: 16px; }
.faq { margin-top: 34px; max-width: 860px; }
.faq details { border-bottom: 1px solid var(--line); padding: 12px 0; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq p { color: var(--text-2); margin: 8px 0 0; }
.legal .doc { max-width: 860px; }
.legal .doc h2 { font: italic 700 20px var(--cond); text-transform: uppercase; letter-spacing: .04em; margin: 26px 0 6px; }
.terms-check { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; color: var(--text-2); margin: 4px 0 12px; }
.terms-check input { margin-top: 4px; accent-color: var(--accent); }
.meter { margin: 12px 0; }
.meter .lab { display: flex; justify-content: space-between; font-size: 14px; color: var(--text-2); }
.meter .lab b { color: var(--text); font-weight: 600; }
.meter .bar { height: 8px; background: var(--panel-2); border: 1px solid var(--line); margin-top: 5px; }
.meter .bar i { display: block; height: 100%; background: var(--accent); }
.meter .bar i.hot { background: var(--danger); }
.plan-now { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.plan-now .muted { color: var(--muted); font-size: 13.5px; }

/* references: one link per reference (opens in a new tab), text flows normally inside the numbered row */
.doc .refs li > a.ref-link, .doc .refs li > span { display: block; min-width: 0; }
a.ref-link { color: inherit; text-decoration: none; border-bottom: 1px solid transparent; transition: color .15s, border-color .15s; }
a.ref-link:hover { color: var(--accent); border-bottom-color: var(--accent-line); }
a.ref-link i { color: inherit; }
.doc .refs li a.ref-link::after { content: " ↗"; font-size: 12px; color: var(--muted); }

/* ---------- teaching components in the Docs ---------- */
.doc h3 { font: italic 700 20px var(--cond); text-transform: uppercase; letter-spacing: .04em; margin: 26px 0 8px; color: var(--text); }
.doc aside.objectives { border-left-color: var(--ok); background: color-mix(in srgb, var(--ok) 6%, var(--panel)); }
.doc aside.objectives h4 { color: var(--ok); }
.doc aside.objectives ul { margin: 0; padding-left: 20px; }
.doc aside.worked { border-left-color: var(--series-1); }
.doc aside.worked h4 { color: var(--series-1); }
.doc aside.worked table { width: 100%; border-collapse: collapse; margin: 10px 0; font: 14.5px var(--mono); }
.doc aside.worked th, .doc aside.worked td { border-bottom: 1px solid var(--line); padding: 5px 8px; text-align: right; }
.doc aside.worked th:first-child, .doc aside.worked td:first-child { text-align: left; }
.doc aside.worked th { color: var(--muted); font-weight: 600; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }
.doc aside.library { border-left-color: var(--warn); }
.doc aside.library h4 { color: var(--warn); }
.doc aside.library ul { margin: 0; padding-left: 0; list-style: none; }
.doc aside.library li { margin: 0 0 10px; padding-left: 26px; position: relative; }
.doc aside.library li::before { content: "▤"; position: absolute; left: 0; top: 0; color: var(--warn); }
.doc aside.library li b { color: var(--text); }
.doc dl.keyterms { display: grid; grid-template-columns: minmax(150px, 220px) 1fr; gap: 6px 18px; margin: 18px 0 24px; padding: 16px 20px; background: var(--panel); border: 1px solid var(--line); }
.doc dl.keyterms dt { font: 600 14px var(--mono); color: var(--accent); }
.doc dl.keyterms dd { margin: 0; font-size: 16px; color: var(--text-2); }
.doc .quiz { margin: 28px 0; padding: 16px 20px 8px; border: 1px solid var(--line); background: var(--panel); }
.doc .quiz h4 { font: 600 11.5px var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--accent); margin: 0 0 10px; }
.doc .quiz details { border-top: 1px solid var(--line); padding: 10px 0; }
.doc .quiz summary { cursor: pointer; font-weight: 600; font-size: 16.5px; list-style: none; padding-left: 24px; position: relative; }
.doc .quiz summary::before { content: "?"; position: absolute; left: 0; top: 0; width: 17px; height: 17px; display: grid; place-items: center; font: 700 12px var(--mono); color: var(--on-accent); background: var(--accent); }
.doc .quiz details[open] summary::before { content: "✓"; }
.doc .quiz details p { margin: 8px 0 4px 24px; color: var(--text-2); font-size: 16px; }
.doc figure.diagram { margin: 22px 0; padding: 14px; border: 1px solid var(--line); background: var(--panel); }
.doc figure.diagram svg { width: 100%; height: auto; display: block; }
.doc figure.diagram figcaption { font-size: 14px; color: var(--muted); margin-top: 8px; }
@media (max-width: 700px) { .doc dl.keyterms { grid-template-columns: 1fr; } }
/* keep the docs column inside the screen on phones; wide tables scroll inside their box */
@media (max-width: 1100px) { .docs { grid-template-columns: minmax(0, 1fr); } .docs > * { min-width: 0; } }
.doc aside.worked table, .doc table.jt { display: block; overflow-x: auto; max-width: 100%; }
.doc aside.worked table tbody, .doc table.jt tbody { display: table; width: 100%; }
.doc code, .doc .standfirst, .doc li, .doc p { overflow-wrap: anywhere; }

/* ---------- header on tablets and phones: a full-screen menu ---------- */
.tabs-auth { display: none; }
@media (max-width: 1024px) {
  .burger { display: grid; }
  .nav-right .guest-only .btn.ghost { display: none; }
  .tabs { position: fixed; top: var(--nav-h); left: 0; right: 0; bottom: 0; margin: 0; height: auto; padding: 10px clamp(16px, 4vw, 36px) 28px; flex-direction: column; align-items: stretch;
    background: var(--bg); border-top: 1px solid var(--line); display: none; overflow-y: auto; overscroll-behavior: contain; z-index: 60; }
  .nav.menu-open .tabs { display: flex; }
  body:has(.nav.menu-open) { overflow: hidden; }
  .tabs > .tab, .tabs > .menu > .tab { height: 60px; justify-content: space-between; font-size: 18px; border-bottom: 1px solid var(--line); padding: 0 4px; width: 100%; }
  .tab.is-active::after { display: none; }
  .tab.is-active { color: var(--accent); }
  .tabs .dropdown { position: static; min-width: 0; box-shadow: none; display: none; transform: none; opacity: 1; pointer-events: auto; border: 0; padding: 6px 0 10px; }
  .tabs .menu.open .dropdown { display: block; }
  .tabs .dd-item { padding: 12px 4px; }
  .tabs-auth:not([hidden]) { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 22px; }
  .tabs-auth .btn { justify-content: center; height: 48px; }
  body.in-app .tabs { top: var(--nav-h); }
}
@media (max-width: 420px) { .tabs-auth:not([hidden]) { grid-template-columns: 1fr; } }
/* inside an app on a phone, the menu tab sits at the bottom so it never covers the app's own top bar */
@media (max-width: 700px) {
  body.in-app .peek-tab { top: auto; bottom: 0; left: auto; right: 14px; transform: none; height: 24px; clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 100%, 0 100%); }
  body.in-app .peek-tab svg { transform: rotate(180deg); }
}
/* nothing may widen the page on phones (the browser would zoom the whole site out) */
html, body { overflow-x: clip; }
.hero-band { overflow: clip; }
@media (max-width: 1024px) {
  .tabs > * { flex-shrink: 0; }
  .tabs-auth .btn.ghost { display: inline-flex !important; }
}

/* references: long lists scroll inside their box; book notes say which chapter to read */
.doc .refs ol { max-height: 380px; overflow-y: auto; overscroll-behavior: contain; padding-right: 10px; margin-bottom: 0;
  scrollbar-width: thin; scrollbar-color: var(--line-2) transparent;
  mask-image: linear-gradient(to bottom, #000 calc(100% - 28px), transparent); -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 28px), transparent); }
.doc .refs ol::-webkit-scrollbar { width: 6px; }
.doc .refs ol::-webkit-scrollbar-thumb { background: var(--line-2); }
.doc .refs ol { padding-bottom: 24px; }
.doc .refs .ref-note { display: block; margin-top: 3px; font-size: 13.5px; color: var(--accent); font-style: normal; }
.doc .refs h2 + ol::before { content: none; }
.doc .refs-count { font: 500 12px var(--mono); color: var(--muted); letter-spacing: .08em; }
@media (max-width: 700px) { .doc .refs ol { max-height: 320px; } }
.doc .refs li a.ref-link:has(.ref-note)::after { content: none; }
.doc .refs .ref-note::after { content: " ↗"; font-size: 12px; color: var(--muted); }
.footer nav { flex-wrap: wrap; row-gap: 8px; }
.footer .wrap { flex-wrap: wrap; }
