/* npt-solo-web — base stylesheet.
   Components here use design tokens only (custom properties). The values come from the active visual template,
   app/static/css/skins/<id>.css, scoped to body[data-skin]. docs/THEMING.md lists the token contract.
   No colours, font names or sizes are written below except as fallbacks for tokens a template may leave out. */

/* ---------------------------------------------------------------- defaults a template may override (not colours) */
body {
  --font-body: "Pretendard Variable", "Pretendard", -apple-system, BlinkMacSystemFont, "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR",
               "Noto Sans CJK KR", "Malgun Gothic", "맑은 고딕", system-ui, sans-serif;
  --font-display: var(--font-body);
  --font-figure: var(--font-body);
  --font-figure-lg: var(--font-figure);
  --font-code: ui-monospace, "SFMono-Regular", "Cascadia Mono", "Consolas", "Noto Sans Mono", "DejaVu Sans Mono", monospace;
  --fs-xs: .75rem; --fs-sm: .875rem; --fs-md: 1rem; --fs-lg: 1.125rem; --fs-xl: 1.375rem; --fs-2xl: 1.75rem; --fs-3xl: 2.25rem;
  --fs-hero: clamp(2.125rem, 1.4rem + 2.8vw, 3.25rem);
  --fs-figure: 1.75rem; --fs-figure-lg: 2.75rem;
  --lh-body: 1.7; --lh-snug: 1.4; --lh-tight: 1.2;
  --fw-body: 400; --fw-strong: 650; --fw-display: 700; --fw-figure: 600;
  --track-display: -.015em; --track-label: 0; --track-figure: -.01em; --label-transform: none;
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px; --s-9: 96px;
  --wrap: 1160px; --gutter: 16px; --section-gap: var(--s-8); --grid-gap: var(--s-5);
  --panel-pad: var(--s-5); --cell-y: 12px; --cell-x: 12px; --control-h: 44px; --btn-px: 16px; --figure-pad: var(--s-4);
  --r-1: 4px; --r-2: 8px; --r-3: 12px; --r-pill: 999px; --r-btn: var(--r-1);
  --panel-border: 1px solid var(--line); --panel-shadow: none; --table-border: 1px solid var(--line);
  --mast-h: 64px; --mast-border: 1px solid var(--line);
  --dur-1: 120ms; --dur-2: 220ms; --ease: cubic-bezier(.2, .7, .2, 1);
  --chart-bar-r: 2; --chart-stroke: 2px; --area-opacity: 0; --band-opacity: .16; --chart-h: 280px;
  --step-dot: 32px;
}
@media (max-width: 640px), (pointer: coarse) { body[data-skin] { --control-h: 44px; } }

/* ---------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; color-scheme: light dark; }
:root[data-theme="dark"] { color-scheme: dark; }
:root[data-theme="light"] { color-scheme: light; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font-body); font-size: var(--fs-md); line-height: var(--lh-body); font-weight: var(--fw-body);
  word-break: keep-all; overflow-wrap: break-word; line-break: strict;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; font-kerning: normal;
}
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: var(--fw-display); line-height: var(--lh-tight); letter-spacing: var(--track-display);
  margin: 0; color: var(--text); text-wrap: balance; }
h1 { font-size: var(--fs-3xl); }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-lg); line-height: var(--lh-snug); }
p, ul, ol, dl, dd, figure, fieldset { margin: 0; }
p, li { text-wrap: pretty; }
ul, ol { padding-left: 1.25em; }
li + li { margin-top: var(--s-1); }
strong, b { font-weight: var(--fw-strong); }
small, .small { font-size: var(--fs-sm); }
img, svg { max-width: 100%; }
a { color: var(--link); text-decoration-line: underline; text-decoration-thickness: 1px; text-underline-offset: .22em;
  text-decoration-color: color-mix(in srgb, currentColor 45%, transparent); }
a:hover { text-decoration-color: currentColor; text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
::selection { background: var(--accent-soft); color: var(--text); }
hr { border: 0; border-top: 1px solid var(--line); margin: 0; }
code, kbd, pre, samp, .mono { font-family: var(--font-code); font-size: .92em; }
.mono { overflow-wrap: anywhere; word-break: normal; }
.num { font-family: var(--font-figure); font-variant-numeric: tabular-nums lining-nums; font-feature-settings: "tnum" 1, "lnum" 1; }
.muted { color: var(--text-2); }
.nowrap { 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: var(--s-4); top: -100px; z-index: 60; background: var(--surface); color: var(--text); padding: var(--s-2) var(--s-4);
  border: 2px solid var(--focus); border-radius: var(--r-1); font-weight: var(--fw-strong); }
.skip:focus { top: var(--s-2); }
[hidden] { display: none !important; }

/* ---------------------------------------------------------------- shell: masthead, status line, main, footer */
.shell { min-height: 100vh; display: flex; flex-direction: column; }
.main { flex: 1 0 auto; }
.main:focus { outline: none; }
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.mast { background: var(--mast-bg); color: var(--mast-text); border-bottom: var(--mast-border); position: sticky; top: 0; z-index: 30; }
.mast-in { max-width: var(--mast-wrap, calc(var(--wrap) + 160px)); margin-inline: auto; padding-inline: var(--gutter); min-height: var(--mast-h);
  display: flex; align-items: center; gap: var(--s-4); position: relative; }
.brand { display: inline-flex; align-items: center; gap: var(--s-2); min-height: 44px; color: var(--mast-text); text-decoration: none;
  font-family: var(--font-display); font-weight: var(--fw-display); font-size: var(--fs-lg); letter-spacing: var(--track-display); white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 28px; height: 28px; flex: none; color: var(--mark, var(--mast-text)); }
.brand-tag { font-family: var(--font-body); font-size: var(--fs-xs); font-weight: 600; color: var(--mast-text-2); letter-spacing: 0;
  border: 1px solid currentColor; border-radius: var(--r-pill); padding: 1px 8px; }
.nav { display: flex; align-items: center; gap: var(--s-4); flex: 1; min-width: 0; }
.nav-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: nowrap; gap: 2px; flex: 1; justify-content: flex-end; }
.nav-list li { margin: 0; }
.nav-list a { display: flex; align-items: center; min-height: var(--control-h); padding-inline: 10px; color: var(--mast-text-2); text-decoration: none;
  font-size: var(--fs-sm); font-weight: 500; border-radius: var(--r-1); white-space: nowrap; }
.nav-list a:hover { color: var(--mast-text); background: var(--mast-hover, transparent); }
.nav-list a[aria-current="page"] { color: var(--mast-text); font-weight: var(--fw-strong); box-shadow: inset 0 -2px 0 var(--mast-accent); border-radius: 0; }
.tools { display: flex; align-items: center; gap: var(--s-2); flex: none; }
.tools .btn, .tools button { min-height: 36px; padding-inline: 12px; font-size: var(--fs-sm); background: transparent; color: var(--mast-text);
  border-color: var(--mast-line, var(--line-strong)); }
.tools .btn:hover, .tools button:hover { background: var(--mast-hover, var(--surface-2)); }
.menu-btn { display: none; margin-left: auto; }
.menu-btn:hover, .menu-btn[aria-expanded="true"] { background: var(--mast-hover); color: var(--mast-text); }
.menu-icon { width: 16px; height: 2px; background: currentColor; position: relative; display: inline-block; }
.menu-icon::before, .menu-icon::after { content: ""; position: absolute; left: 0; width: 16px; height: 2px; background: currentColor; }
.menu-icon::before { top: -5px; } .menu-icon::after { top: 5px; }
/* one-row header only where every language fits (English labels are longer); templates with a side rail undo this */
@media (max-width: 1320px) {
  .menu-btn { display: inline-flex; background: transparent; color: var(--mast-text); border-color: var(--mast-line, var(--line-strong)); }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; align-items: stretch; gap: var(--s-3);
    background: var(--mast-bg); border-bottom: var(--mast-border); padding: var(--s-2) var(--gutter) var(--s-4); box-shadow: var(--menu-shadow, none); }
  .nav.open { display: flex; }
  .nav-list { flex-direction: column; gap: 0; justify-content: flex-start; }
  .nav-list a { min-height: 48px; font-size: var(--fs-md); padding-inline: var(--s-2); border-bottom: 1px solid var(--mast-line, var(--line)); border-radius: 0; }
  .nav-list a[aria-current="page"] { box-shadow: inset 3px 0 0 var(--mast-accent); padding-left: var(--s-4); }
  .tools { flex-wrap: wrap; }
  .tools .btn, .tools button { min-height: 44px; }
}
.statusline { background: var(--status-bg, var(--bg)); color: var(--text-2); border-bottom: 1px solid var(--line); font-size: var(--fs-xs); }
.statusline-in { max-width: var(--mast-wrap, calc(var(--wrap) + 160px)); margin-inline: auto; padding: 6px var(--gutter); display: flex; flex-wrap: wrap; align-items: center;
  gap: 4px var(--s-5); min-height: 36px; }
.sl-item { display: inline-flex; align-items: center; gap: var(--s-2); white-space: nowrap; }
.sl-label { color: var(--text-2); }
.sl-item .num { color: var(--text); font-weight: 600; }
.statusline .chip { min-height: 22px; }
.foot { border-top: 1px solid var(--line); color: var(--text-2); font-size: var(--fs-sm); margin-top: var(--s-6); }
.foot-in { max-width: var(--mast-wrap, calc(var(--wrap) + 160px)); margin-inline: auto; padding: var(--s-5) var(--gutter) var(--s-7); display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5);
  justify-content: space-between; align-items: center; }
.foot-links { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-4); }
.foot-links a { color: var(--text-2); display: inline-flex; align-items: center; min-height: 32px; }

/* ---------------------------------------------------------------- page rhythm */
.page { padding-block: var(--s-6) var(--s-8); display: flex; flex-direction: column; gap: var(--section-gap); }
.page > * { min-width: 0; }
.dev-note { font-size: var(--fs-xs); color: var(--text-2); margin-bottom: calc(var(--section-gap) * -1 + var(--s-3)); }
.page-head { display: flex; flex-direction: column; gap: var(--s-3); max-width: 46rem; }
.page-head.wide { max-width: none; }
.kicker { font-size: var(--fs-xs); font-weight: 650; color: var(--text-2); letter-spacing: var(--track-label); text-transform: var(--label-transform); }
.lead { font-size: var(--fs-lg); color: var(--text-2); line-height: 1.65; max-width: 40em; }
.page-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-4); font-size: var(--fs-sm); color: var(--text-2); }
.page-meta .num { color: var(--text); }
.actions { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; }
.section { display: flex; flex-direction: column; gap: var(--s-4); min-width: 0; }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--s-2) var(--s-4); }
.section-head > p { font-size: var(--fs-sm); color: var(--text-2); }
.section-note { font-size: var(--fs-sm); color: var(--text-2); max-width: 46em; line-height: 1.6; }
.notes { display: flex; flex-direction: column; gap: var(--s-2); font-size: var(--fs-sm); color: var(--text-2); max-width: 46em; line-height: 1.6; }
.panel { background: var(--panel-bg, var(--surface)); border: var(--panel-border); border-radius: var(--r-2); box-shadow: var(--panel-shadow);
  padding: var(--panel-pad); display: flex; flex-direction: column; gap: var(--s-4); min-width: 0; }
.cols { display: grid; gap: var(--grid-gap); grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)); align-items: start; }
.cols-2 { --cols: 2; } .cols-3 { --cols: 3; } .cols-4 { --cols: 4; }
.split { display: grid; gap: var(--s-7); grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); align-items: start; }
.split.even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 960px) { .cols-3, .cols-4 { --cols: 2; } .split, .split.even { grid-template-columns: minmax(0, 1fr); gap: var(--s-6); } }
@media (max-width: 640px) { .cols-2, .cols-3, .cols-4 { --cols: 1; } }
.stack { display: flex; flex-direction: column; gap: var(--s-3); min-width: 0; }
.cluster { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-3); align-items: center; }
.spread { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-4); align-items: center; justify-content: space-between; }
.deco { display: none; }

/* ---------------------------------------------------------------- figures (key numbers) and statements */
.figures { display: grid; gap: var(--figure-gap, var(--s-4)); grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--figure-min, 12.5rem)), 1fr)); margin: 0; }
.figure { display: flex; flex-direction: column; gap: 6px; padding: var(--figure-pad); min-width: 0;
  background: var(--figure-bg, transparent); border: var(--figure-border, 0); border-radius: var(--r-2); }
.figure-label { font-size: var(--fs-xs); font-weight: 650; color: var(--text-2); letter-spacing: var(--track-label); text-transform: var(--label-transform); order: -1; }
.figure-value { font-family: var(--font-figure-lg); font-size: var(--fs-figure); font-weight: var(--fw-figure); line-height: 1.1; letter-spacing: var(--track-figure);
  font-variant-numeric: tabular-nums lining-nums; font-feature-settings: "tnum" 1, "lnum" 1; color: var(--text); }
.figure-value .unit { font-family: var(--font-body); font-size: var(--fs-sm); font-weight: 500; color: var(--text-2); letter-spacing: 0; margin-left: .3em; white-space: nowrap; }
.figure-value .pm { font-family: var(--font-figure); font-size: .5em; font-weight: 500; color: var(--text-2); letter-spacing: 0; margin-left: .35em; white-space: nowrap; }
.figure-value .chip { font-size: var(--fs-sm); }
.figure-note { font-size: var(--fs-sm); color: var(--text-2); line-height: 1.5; }
.figure.is-lead .figure-value { font-size: var(--fs-figure-lg); }
.figures-me { grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 1fr)); }
@media (max-width: 1100px) { .figures-me { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .figures { --figure-min: 9.5rem; }
  .figures-me { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .figures .figure.is-lead { grid-column: 1 / -1; }
  .figure-value { font-size: calc(var(--fs-figure) * .82); }
  .figure.is-lead .figure-value { font-size: calc(var(--fs-figure-lg) * .8); }
}
.figures-meta { font-size: var(--fs-xs); color: var(--text-2); }
.statement { display: flex; flex-direction: column; margin: 0; }
.statement-row { display: flex; align-items: baseline; gap: var(--s-2); padding-block: 7px; }
.statement-row dt { display: flex; align-items: baseline; gap: var(--s-2); flex: 1; min-width: 0; }
.statement-row dt::after { content: ""; flex: 1; min-width: var(--s-4); border-bottom: 1px dotted var(--line-strong); transform: translateY(-.28em); }
.statement-row dd { font-family: var(--font-figure); font-variant-numeric: tabular-nums lining-nums; font-feature-settings: "tnum" 1, "lnum" 1;
  white-space: nowrap; text-align: right; min-width: 4.5ch; }
.statement-row.is-total { border-top: 1px solid var(--text); border-bottom: 3px double var(--text); margin-top: var(--s-1); padding-block: 9px; font-weight: var(--fw-strong); }
.statement-row.is-total dt::after { border-bottom-color: transparent; }
.split-key { width: 10px; height: 10px; border-radius: 2px; flex: none; display: inline-block; transform: translateY(1px); }
.split-key.imm { background: var(--mine); } .split-key.lock { background: var(--locked); } .split-key.op { background: var(--text-2); }
.statement-row.is-sub { border-top: 1px solid var(--line-strong); font-weight: var(--fw-strong); }
.statement-row.is-sub dt::after { border-bottom-color: transparent; }
.unit-tag { font-family: var(--font-body); font-size: var(--fs-xs); color: var(--text-2); margin-left: .35em; }

/* ---------------------------------------------------------------- chips, badges, notices */
.chip { display: inline-flex; align-items: center; gap: .5em; padding: 2px 10px 2px 8px; min-height: 26px; border-radius: var(--r-chip, var(--r-pill));
  font-family: var(--font-body); font-size: var(--fs-xs); font-weight: 650; line-height: 1.25; letter-spacing: 0; white-space: nowrap;
  background: var(--chip-bg); color: var(--text); border: 1px solid var(--chip-border, transparent); vertical-align: middle; }
.chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--text-2); flex: none; }
.chip.working::before, .chip.ok::before, .chip.mining::before, .chip.canonical::before, .chip.active::before, .chip.approved::before,
.chip.L0::before, .chip.resolved::before { background: var(--ok); }
.chip.waiting::before, .chip.normal_wait::before, .chip.pending::before, .chip.node_accepted::before, .chip.enrolled::before,
.chip.never_connected::before, .chip.superseded::before, .chip.candidate::before, .chip.submitted::before, .chip.cancelled::before { background: var(--text-2); }
.chip.paused::before, .chip.degraded::before, .chip.offline::before, .chip.L1::before, .chip.L2::before, .chip.L3::before, .chip.retired::before,
.chip.deprecated::before, .chip.open::before, .chip.term_soon::before { background: var(--warn); }
.chip.down::before, .chip.dead::before, .chip.lost_race::before, .chip.reorged::before, .chip.L4::before, .chip.L5::before, .chip.L6::before,
.chip.revoked::before, .chip.rejected::before, .chip.suspended::before, .chip.term_expired::before { background: var(--danger); }
.chip.released::before, .chip.reclaimed::before { background: var(--locked); }
.chip.is-quiet { background: transparent; border-color: var(--line); }
.badge-mine { display: inline-flex; align-items: center; padding: 1px 7px; border-radius: var(--r-1); font-size: var(--fs-xs); font-weight: 700; line-height: 1.4;
  color: var(--on-mine); background: var(--mine); white-space: nowrap; vertical-align: middle; }
.tbd { display: inline-flex; align-items: center; gap: 4px; font-family: var(--font-body); font-size: var(--fs-xs); font-weight: 600; color: var(--text-2);
  border: 1px dashed var(--line-strong); border-radius: var(--r-1); padding: 0 6px; line-height: 1.6; white-space: nowrap; vertical-align: middle; }
.notice { display: flex; flex-direction: column; gap: var(--s-2); padding: var(--s-3) var(--s-4); border-radius: var(--r-notice, var(--r-2));
  background: var(--info-soft); color: var(--text); border-left: 3px solid var(--info); line-height: 1.6; }
.notice > h2, .notice > h3 { font-size: var(--fs-md); font-family: var(--font-body); letter-spacing: 0; }
.notice.warn { background: var(--warn-soft); border-left-color: var(--warn); }
.notice.danger { background: var(--danger-soft); border-left-color: var(--danger); }
.notice.ok { background: var(--ok-soft); border-left-color: var(--ok); }
.notice.inline { flex-direction: row; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-3); }
.notice a { color: var(--text); font-weight: var(--fw-strong); }
.risk-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: var(--s-2); }
.risk-list li { margin: 0; padding-left: 1.1em; position: relative; }
.risk-list li::before { content: ""; position: absolute; left: 0; top: .72em; width: 6px; height: 6px; border-radius: 50%; background: var(--warn); }
.empty { padding: var(--s-6) var(--s-4); text-align: center; color: var(--text-2); border: 1px dashed var(--line-strong); border-radius: var(--r-2); }
.empty strong { display: block; color: var(--text); margin-bottom: var(--s-1); }

/* ---------------------------------------------------------------- controls */
button, .btn {
  font: inherit; font-size: var(--fs-sm); font-weight: 650; line-height: 1.2; display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: var(--control-h); padding: 0 var(--btn-px); border-radius: var(--r-btn); border: 1px solid var(--btn-border, var(--line-strong));
  background: var(--btn-bg, var(--surface)); color: var(--btn-text, var(--text)); cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background-color var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
}
button:hover, .btn:hover { background: var(--btn-bg-hover, var(--surface-2)); text-decoration: none; }
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
button.primary:hover, .btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
button.danger, .btn.danger { color: var(--danger); border-color: var(--danger); background: var(--btn-bg, var(--surface)); }
button.danger:hover { background: var(--danger-soft); }
button.quiet, .btn.quiet { background: transparent; border-color: transparent; color: var(--link); padding-inline: var(--s-2); }
button.quiet:hover, .btn.quiet:hover { background: var(--surface-2); }
button:disabled { opacity: .5; cursor: not-allowed; }
.btn-arrow::after { content: "→"; font-weight: 400; }
input[type=text], input[type=email], input[type=password], input[type=number], select, textarea {
  font: inherit; font-size: var(--fs-md); color: var(--text); background: var(--field-bg, var(--surface)); border: 1px solid var(--field-border, var(--line-strong));
  border-radius: var(--r-field, var(--r-1)); min-height: var(--control-h); padding: 0 var(--s-3); width: 100%; min-width: 0;
}
select { padding-right: var(--s-6); }
textarea { padding: var(--s-3); min-height: 150px; font-family: var(--font-code); font-size: var(--fs-sm); line-height: 1.55; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--text-2); opacity: 1; }
label { display: block; font-weight: 650; font-size: var(--fs-sm); margin-bottom: 6px; }
.field { display: flex; flex-direction: column; min-width: 0; }
.field label { margin-bottom: 6px; }
.help { font-size: var(--fs-sm); color: var(--text-2); margin-top: 6px; line-height: 1.55; }
.check { display: flex; gap: var(--s-3); align-items: flex-start; font-weight: 500; font-size: var(--fs-md); margin: 0; cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 2px 0 0; flex: none; accent-color: var(--accent); }
.form-row { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: flex-end; }
.form-row > .field { flex: 1 1 14rem; }
fieldset { border: 0; padding: 0; min-width: 0; }
legend { font-weight: var(--fw-strong); padding: 0; margin-bottom: var(--s-3); }
.seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--line-strong); border-radius: var(--r-seg, var(--r-btn)); overflow: hidden; background: var(--surface); }
.seg button { border: 0; border-radius: 0; min-height: 36px; padding: 0 12px; background: transparent; color: var(--text); font-weight: 600; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button:hover { background: var(--surface-2); }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.seg button:focus-visible { outline-offset: -3px; }
@media (max-width: 640px), (pointer: coarse) { .seg button { min-height: 44px; } }
.ctl-label { font-size: var(--fs-xs); font-weight: 650; color: var(--text-2); letter-spacing: var(--track-label); text-transform: var(--label-transform); }
.ctl-group { display: inline-flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; }
.tabs { display: flex; gap: var(--s-1); flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.tabs button { border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: transparent; color: var(--text-2); margin-bottom: -1px; }
.tabs button:hover { color: var(--text); background: transparent; }
.tabs button[aria-selected="true"] { border-bottom-color: var(--accent-line, var(--accent)); color: var(--text); }
.tabpanel { padding-top: var(--s-4); display: flex; flex-direction: column; gap: var(--s-3); }

/* ---------------------------------------------------------------- tables */
.table-wrap { position: relative; overflow-x: auto; -webkit-overflow-scrolling: touch; border: var(--table-border); border-radius: var(--r-2); background: var(--table-bg, var(--surface)); }
table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
caption { text-align: left; padding: 0 0 var(--s-2); color: var(--text-2); font-size: var(--fs-sm); }
th, td { padding: var(--cell-y) var(--cell-x); text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
thead th { font-size: var(--fs-xs); font-weight: 650; color: var(--text-2); letter-spacing: var(--track-label); text-transform: var(--label-transform);
  white-space: nowrap; background: var(--th-bg, transparent); vertical-align: bottom; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--row-hover, transparent); }
td.num, th.num { text-align: right; }
td.num { font-family: var(--font-figure); font-variant-numeric: tabular-nums lining-nums; font-feature-settings: "tnum" 1, "lnum" 1; white-space: nowrap; }
td .mono, td.mono { font-size: var(--fs-xs); }
td.mono { white-space: nowrap; overflow-wrap: normal; }
th button.sort { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
th button.sort::after { content: "↕"; color: var(--text-2); font-weight: 400; }
th[aria-sort="ascending"] button.sort::after { content: "↑"; color: var(--text); }
th[aria-sort="descending"] button.sort::after { content: "↓"; color: var(--text); }
th button.sort:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.locked { color: var(--locked); }
.mine-amt { color: var(--mine); }
.cell-main { font-weight: var(--fw-strong); color: var(--text); }
.cell-sub { display: block; font-size: var(--fs-xs); color: var(--text-2); }
@media (max-width: 640px) {
  .table-wrap table { min-width: 560px; }
  .table-wrap td, .table-wrap th { white-space: nowrap; }
  .table-wrap.is-stack { border: 0; background: transparent; overflow: visible; }
  .is-stack table { min-width: 0; }
  .is-stack table, .is-stack tbody, .is-stack tr, .is-stack td { display: block; width: 100%; }
  .is-stack thead { display: none; }   /* each cell carries its own label; no hidden sort buttons in the tab order */
  .is-stack tr { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-2); padding: var(--s-2) var(--s-3); }
  .is-stack tr + tr { margin-top: var(--s-3); }
  .is-stack td { display: block; border: 0; padding: 6px 0; text-align: right; white-space: normal; overflow: hidden; }
  .is-stack td::before { content: attr(data-label); float: left; color: var(--text-2); font-size: var(--fs-xs); font-weight: 600; text-align: left;
    max-width: 46%; margin-right: var(--s-3); line-height: 1.9; }
  .is-stack td[data-label=""]::before { content: none; }
  .is-stack td[data-label=""] { text-align: left; }
  .is-stack td.is-head { font-size: var(--fs-md); padding-bottom: var(--s-2); border-bottom: 1px solid var(--line); margin-bottom: var(--s-1); }
  .is-stack tbody tr:hover td { background: transparent; }
}

/* ---------------------------------------------------------------- steps, flow, split bar, gauge */
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.steps > li { counter-increment: step; display: grid; grid-template-columns: var(--step-dot) minmax(0, 1fr) auto; gap: var(--s-3) var(--s-4);
  align-items: start; padding-block: var(--s-3); position: relative; margin: 0; }
.steps > li::before { content: counter(step); width: var(--step-dot); height: var(--step-dot); border-radius: 50%; display: grid; place-items: center;
  font-family: var(--font-figure); font-variant-numeric: tabular-nums; font-weight: 650; font-size: var(--fs-sm); line-height: 1;
  border: 2px solid var(--line-strong); color: var(--text); background: var(--surface); position: relative; z-index: 1; }
.steps > li:not(:last-child)::after { content: ""; position: absolute; left: calc(var(--step-dot) / 2 - 1px); top: calc(var(--s-3) + var(--step-dot));
  bottom: calc(var(--s-3) * -1); width: 2px; background: var(--line); }
.steps > li.done::before { background: var(--ok); border-color: var(--ok); color: var(--on-ok); }
.steps > li.done:not(:last-child)::after { background: var(--ok); }
.steps > li.is-next::before { border-color: var(--accent-line, var(--accent)); box-shadow: 0 0 0 4px var(--accent-soft); }
.step-title { font-weight: var(--fw-strong); color: var(--text); display: block; line-height: var(--lh-snug); }
.step-help { font-size: var(--fs-sm); color: var(--text-2); line-height: 1.55; margin-top: 2px; display: block; }
.step-state { padding-top: 4px; }
.progress { display: flex; align-items: center; gap: var(--s-3); font-size: var(--fs-sm); color: var(--text-2); }
.progress-bar { flex: 1; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; display: flex; max-width: 16rem; }
.progress-bar span { background: var(--ok); }
.flow { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-5); counter-reset: flow; }
.flow > li { counter-increment: flow; display: flex; flex-direction: column; gap: var(--s-2); margin: 0; position: relative; min-width: 0; }
.flow > li::before { content: counter(flow); font-family: var(--font-figure-lg); font-variant-numeric: tabular-nums; font-weight: var(--fw-figure);
  font-size: var(--fs-xl); line-height: 1; color: var(--text-2); }
.flow h3 { font-size: var(--fs-lg); }
.flow p { color: var(--text-2); font-size: var(--fs-sm); line-height: 1.65; }
@media (max-width: 760px) { .flow { grid-template-columns: minmax(0, 1fr); } }
.splitbar { display: flex; height: 10px; overflow: hidden; gap: 2px; border-radius: var(--r-1); }
.splitbar span { display: block; height: 100%; }
.splitbar .imm { background: var(--mine); flex: 50; } .splitbar .lock { background: var(--locked); flex: 50; } .splitbar .op { background: var(--text-2); flex: 28; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: var(--fs-xs); color: var(--text-2); }
.legend .key-item, .legend .key { display: inline-flex; align-items: center; gap: 6px; color: var(--text); }
.legend .sw { width: 16px; height: 3px; border-radius: 2px; display: inline-block; }
.legend .sw.box { height: 10px; width: 10px; border-radius: 2px; }
.gauge { position: relative; height: 24px; border-radius: var(--r-1); background: var(--surface-2); border: 1px solid var(--line-strong); margin: var(--s-2) 0 0; }
.gauge .band { position: absolute; top: 0; bottom: 0; background: var(--ok-soft); border-left: 2px solid var(--ok); border-right: 2px dashed var(--warn); }
.gauge .needle { position: absolute; top: -5px; bottom: -5px; width: 3px; background: var(--text); border-radius: 2px; }
.gauge .needle-sd { position: absolute; top: 7px; bottom: 7px; background: var(--text-2); opacity: .45; border-radius: 3px; }
.gauge-scale { display: flex; justify-content: space-between; font-size: var(--fs-xs); color: var(--text-2); }

/* ---------------------------------------------------------------- charts (SVG module colours come from tokens) */
.chart-panel { position: relative; }
.chart-head { display: flex; flex-wrap: wrap; gap: var(--s-3) var(--s-4); align-items: center; justify-content: space-between; }
.chart-controls { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-4); align-items: center; }
.chart { position: relative; width: 100%; height: var(--chart-h); }
.chart:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; border-radius: var(--r-1); }
.chart[aria-busy="true"]::after { content: attr(data-loading); position: absolute; inset: 0; display: grid; place-items: center; color: var(--text-2); font-size: var(--fs-sm); }
.chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart .gridline { stroke: var(--c-grid); stroke-width: 1; stroke-dasharray: var(--grid-dash, none); }
.chart .axis text { fill: var(--text-2); font-size: 11px; font-family: var(--font-figure); font-variant-numeric: tabular-nums; }
.chart .axis line { stroke: var(--line); }
.chart .s1 { stroke: var(--c-s1); fill: none; stroke-width: var(--chart-stroke); }
.chart .s2 { stroke: var(--c-s2); fill: none; stroke-width: calc(var(--chart-stroke) * .75); }
.chart .s3 { stroke: var(--c-s3); fill: none; stroke-width: var(--chart-stroke); }
.chart .band1 { fill: var(--c-s1); opacity: var(--band-opacity); }
.chart .area1 { fill: var(--c-s1); opacity: var(--area-opacity); }
.chart .f-mine, .chart .f-members { fill: var(--c-mine); }
.chart .f-pool_other, .chart .f-fleet { fill: var(--c-pool); }
.chart .f-network_other { fill: var(--c-other); }
.chart .refline { stroke: var(--text-2); stroke-dasharray: 4 4; stroke-width: 1; }
.chart .reflabel { fill: var(--text-2); font-size: 11px; font-family: var(--font-body); }
.chart .cursor { stroke: var(--text); stroke-width: 1; opacity: .5; }
.chart .dot { stroke: var(--surface); stroke-width: 2; }
.chart .dot.s1d { fill: var(--c-s1); } .chart .dot.s2d { fill: var(--c-s2); } .chart .dot.s3d { fill: var(--c-s3); }
.chart .hit { fill: transparent; }
.chart .bar-focus { fill: none; stroke: var(--text); stroke-width: 1.5; }
.chart-tip { position: absolute; pointer-events: none; background: var(--surface); color: var(--text); border: 1px solid var(--line-strong); border-radius: var(--r-1);
  padding: 8px 10px; font-size: var(--fs-xs); min-width: 160px; box-shadow: var(--tip-shadow, 0 4px 16px rgba(0, 0, 0, .12)); z-index: 5; line-height: 1.5; }
.chart-tip .tt { color: var(--text-2); margin-bottom: 2px; }
.chart-tip .tr { display: flex; align-items: center; gap: 6px; }
.chart-tip .tr b { font-family: var(--font-figure); font-variant-numeric: tabular-nums; font-weight: 650; }
.chart-tip .tk { width: 12px; height: 3px; border-radius: 2px; display: inline-block; }
.chart-note { font-size: var(--fs-xs); color: var(--text-2); line-height: 1.6; }
.chart-empty { display: grid; place-items: center; height: 100%; color: var(--text-2); font-size: var(--fs-sm); text-align: center; padding: var(--s-4); }
details.table-view summary { cursor: pointer; font-size: var(--fs-sm); color: var(--link); font-weight: 600; min-height: 32px; display: inline-flex; align-items: center; }
details.table-view .table-wrap { max-height: 280px; overflow: auto; margin-top: var(--s-2); }
.kbd-hint { font-size: var(--fs-xs); color: var(--text-2); }
kbd { font-size: .85em; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; background: var(--surface); }

/* ---------------------------------------------------------------- code, one-time values, toast */
.cmd { position: relative; background: var(--code-bg); border: 1px solid var(--line); border-radius: var(--r-2); min-width: 0; }
.cmd pre { margin: 0; padding: 48px var(--s-4) var(--s-4); overflow-x: auto; font-family: var(--font-code); font-size: var(--fs-xs); line-height: 1.7;
  color: var(--code-text); white-space: pre; word-break: normal; overflow-wrap: normal; tab-size: 2; }
.cmd button { position: absolute; top: var(--s-2); right: var(--s-2); min-height: 36px; padding-inline: 12px; font-size: var(--fs-xs); }
@media (max-width: 640px), (pointer: coarse) { .cmd button { min-height: 44px; } .cmd pre { padding-top: 60px; } }
.once { border: 2px dashed var(--warn); border-radius: var(--r-2); padding: var(--s-4); background: var(--warn-soft); display: flex; flex-direction: column; gap: var(--s-3); }
.once > strong { font-size: var(--fs-md); }
/* TOTP enrolment QR. Its black-on-white colours are part of the drawing (fill attributes set by app.js, quiet zone
   included), not template tokens: scanners need them the same in every template and theme. */
.enroll-qr { margin: 0; display: flex; flex-direction: column; align-items: flex-start; gap: var(--s-2); }
.enroll-qr[hidden] { display: none; }
.enroll-qr svg { max-width: 100%; height: auto; display: block; border-radius: var(--r-2); }
.secret { font-family: var(--font-code); font-size: var(--fs-md); word-break: break-all; user-select: all; padding: var(--s-2) var(--s-3);
  background: var(--surface); color: var(--text); border-radius: var(--r-1); border: 1px solid var(--line); }
.toast { position: fixed; right: var(--s-4); bottom: var(--s-4); left: var(--s-4); max-width: 26rem; margin-left: auto; background: var(--surface); color: var(--text);
  border: 1px solid var(--line-strong); border-left: 4px solid var(--info); border-radius: var(--r-2); padding: var(--s-3) var(--s-4); z-index: 50;
  box-shadow: 0 8px 28px rgba(0, 0, 0, .18); font-size: var(--fs-sm); }
.toast.err { border-left-color: var(--danger); }
.result-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; }
.result-list li { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; padding: var(--s-2) 0; border-bottom: 1px solid var(--line); margin: 0; font-size: var(--fs-sm); }
.result-list li:last-child { border-bottom: 0; }
.timeline { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; }
.timeline > li { display: grid; grid-template-columns: minmax(0, 11rem) minmax(0, 1fr); gap: var(--s-2) var(--s-5); padding-block: var(--s-4); border-top: 1px solid var(--line); margin: 0; }
.timeline > li:first-child { border-top: 0; }
.timeline time { font-size: var(--fs-sm); color: var(--text-2); }
.timeline-body { display: flex; flex-direction: column; gap: var(--s-1); }
.timeline-body p { font-size: var(--fs-sm); color: var(--text-2); }
@media (max-width: 640px) { .timeline > li { grid-template-columns: minmax(0, 1fr); } }
.status-list { list-style: none; padding: 0; margin: 0; }
.status-list > li { display: flex; justify-content: space-between; align-items: center; gap: var(--s-3); padding-block: var(--s-3); border-top: 1px solid var(--line); margin: 0; }
.status-list > li:first-child { border-top: 0; }
.defs { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: var(--s-2) var(--s-5); margin: 0; font-size: var(--fs-sm); }
.defs dt { color: var(--text-2); }
.defs dd { margin: 0; }

/* ---------------------------------------------------------------- page patterns */
.narrow { max-width: 40rem; width: 100%; }
.message { margin-inline: auto; margin-top: var(--s-5); }
.message h1 { font-size: var(--fs-2xl); }
.login-accounts button { justify-content: flex-start; width: 100%; }
.progress-bar span { flex: none; width: 0; }
.next-flag { margin-top: var(--s-2); }
.start-split { align-items: start; }
@media (min-width: 961px) { .start-split > .panel:first-child { position: sticky; top: calc(var(--mast-h) + var(--s-4)); } }
.verify-list { display: flex; flex-direction: column; gap: var(--s-2); padding-left: 1.4em; font-size: var(--fs-sm); }
.terms { display: flex; flex-direction: column; gap: var(--s-4); padding: var(--s-4); border: 1px solid var(--line); border-radius: var(--r-2); background: var(--bg-2); }
.terms legend { float: left; width: 100%; margin: 0; }
.terms-list { display: flex; flex-direction: column; gap: var(--s-2); font-size: var(--fs-sm); color: var(--text); padding-left: 1.2em; max-height: 22rem; overflow-y: auto; }
.odds-unit { flex: 0 1 8rem; }
.odds-split { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); }
.odds-figures { --figure-min: 9rem; }
.odds-figures .figure-value { white-space: nowrap; }
@media (max-width: 960px) { .odds-split { grid-template-columns: minmax(0, 1fr); } }
.state-defs { grid-template-columns: max-content minmax(0, 1fr); align-items: start; row-gap: var(--s-3); }
.state-defs dd { color: var(--text-2); }
.contract-line { font-size: var(--fs-sm); }
.invite { display: flex; flex-direction: column; gap: var(--s-2); max-width: 46em; }
.invite-contact { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; }
.rig-line + .rig-line { margin-top: var(--s-1); }
.approve-form { padding-bottom: var(--s-4); border-bottom: 1px solid var(--line); }
.doc { display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 46rem); gap: var(--s-7); align-items: start; }
.doc-toc { position: sticky; top: calc(var(--mast-h) + var(--s-4)); display: flex; flex-direction: column; gap: var(--s-2); }
.toc-title { font-size: var(--fs-xs); font-family: var(--font-body); font-weight: 650; color: var(--text-2); letter-spacing: var(--track-label); text-transform: var(--label-transform); }
.doc-toc ol { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; border-left: 1px solid var(--line); }
.doc-toc li { margin: 0; }
.doc-toc a { display: flex; align-items: center; min-height: 34px; padding-left: var(--s-3); color: var(--text-2); text-decoration: none; font-size: var(--fs-sm); margin-left: -1px; border-left: 2px solid transparent; }
.doc-toc a:hover { color: var(--text); border-left-color: var(--line-strong); }
.doc-body { display: flex; flex-direction: column; gap: var(--s-7); min-width: 0; }
.doc-section { display: flex; flex-direction: column; gap: var(--s-3); scroll-margin-top: calc(var(--mast-h) + var(--s-5)); }
.doc-section h2 { font-size: var(--fs-xl); }
.doc-section p, .doc-section li { line-height: 1.8; }
.doc-section ul { display: flex; flex-direction: column; gap: var(--s-2); }
@media (max-width: 960px) { .doc { grid-template-columns: minmax(0, 1fr); gap: var(--s-5); } .doc-toc { position: static; } }

/* ---------------------------------------------------------------- template picker (settings, admin) */
.skin-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15.5rem), 1fr)); gap: var(--s-4); }
.skin-option { position: relative; display: flex; flex-direction: column; gap: var(--s-3); margin: 0; padding: var(--s-3); cursor: pointer; font-weight: 400;
  border: 1px solid var(--line-strong); border-radius: var(--r-3); background: var(--surface); color: var(--text); }
.skin-option:hover { border-color: var(--text-2); }
.skin-option.is-checked { border-color: var(--accent-line, var(--accent)); box-shadow: 0 0 0 1px var(--accent-line, var(--accent)); }
.skin-option:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.skin-choice { display: flex; align-items: center; gap: var(--s-2); font-weight: var(--fw-strong); font-size: var(--fs-md); min-height: 28px; }
.skin-choice input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); flex: none; }
.skin-choice input:focus-visible { outline: none; }
.skin-blurb { font-size: var(--fs-sm); color: var(--text-2); line-height: 1.55; }
.skin-flag { font-size: var(--fs-xs); font-weight: 600; color: var(--text-2); }
.swatch { display: grid; grid-template-rows: 18px 1fr; height: 104px; border-radius: var(--r-2); overflow: hidden; background: var(--bg); color: var(--text);
  border: 1px solid var(--line); font-family: var(--font-body); }
.swatch-bar { background: var(--mast-bg); border-bottom: var(--mast-border); display: flex; align-items: center; gap: 4px; padding: 0 8px; }
.swatch-bar i { width: 18px; height: 4px; border-radius: 2px; background: var(--mast-text-2); opacity: .7; }
.swatch-bar i:first-child { background: var(--mast-accent); opacity: 1; }
.swatch-body { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 6px 10px; padding: 10px 12px; }
.swatch-title { font-family: var(--font-display); font-weight: var(--fw-display); font-size: 15px; line-height: 1.15; letter-spacing: var(--track-display); color: var(--text); }
.swatch-figure { font-family: var(--font-figure-lg); font-weight: var(--fw-figure); font-size: 22px; line-height: 1; font-variant-numeric: tabular-nums; color: var(--text); }
.swatch-keys { display: flex; gap: 5px; grid-column: 1 / -1; }
.swatch-keys i { height: 6px; flex: 1; border-radius: 3px; }
.swatch-keys i:nth-child(1) { background: var(--accent); } .swatch-keys i:nth-child(2) { background: var(--mine); }
.swatch-keys i:nth-child(3) { background: var(--locked); } .swatch-keys i:nth-child(4) { background: var(--line-strong); }

/* ---------------------------------------------------------------- motion, contrast modes, print */
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
@media (forced-colors: active) {
  .chart .f-mine, .chart .f-members { fill: CanvasText; } .chart .f-pool_other, .chart .f-fleet { fill: GrayText; } .chart .f-network_other { fill: Canvas; stroke: CanvasText; }
  .chip::before, .key, .badge-mine { forced-color-adjust: none; }
  .steps > li::before { border: 2px solid CanvasText; }
}
@media print { .mast, .statusline, .foot, .menu-btn, .tools, .toast { display: none !important; } body { background: #fff; color: #000; } }

/* ---------------------------------------------------------------- touch: 44 px targets on phones and coarse pointers (last, so it wins) */
@media (max-width: 640px), (pointer: coarse) {
  body[data-skin] details.table-view summary, body[data-skin] .foot-links a, body[data-skin] .doc-toc a, body[data-skin] .tools .btn,
  body[data-skin] .tools button, body[data-skin] .nav-list a, body[data-skin] .seg button, body[data-skin] .cmd button { min-height: 44px; }
  /* links that stand on their own (not inside a sentence) get a full-size target too */
  body[data-skin] .section-head a, body[data-skin] .actions a:not(.btn), body[data-skin] .notice.inline a, body[data-skin] .empty a,
  body[data-skin] td a, body[data-skin] .invite-contact a { display: inline-flex; align-items: center; min-height: 44px; }
  body[data-skin] button, body[data-skin] .btn { min-width: 44px; }
}
/* G4-3: the "invitation only · pilot in preparation" line on the home page (NPT_WEB_SIGNUP_OPEN=0) */
.pilot-note { display: block; max-width: 100%; min-width: 0; overflow-wrap: anywhere; }
.pilot-note strong { display: block; margin-bottom: 2px; }
/* a long state label ("unknown (no fresh report)") may wrap inside a narrow figure card instead of widening the page */
.figure-value .chip { white-space: normal; max-width: 100%; }
