/* Sigmend · Bench Instrument */
:root {
  --bg: #0F1720;
  --surface: #16212C;
  --text: #E6EDF3;
  --primary: #36D6C3;
  --accent: #F5C04A;
  --muted: #9AA8B6;
  --outline: #687A8B;
  --line: #243341;
  --grat: rgba(154, 168, 182, 0.08);
  --error: #FF7A85;
  --on-primary: #0F1720;
  --gap: #8AB4FF;
  --spike: #FF8A7A;
  --flat: #F5C04A;
  --drift: #C9A2FF;
  --series: #9AA8B6;
  --rail: rgba(54, 214, 195, 0.45);
  --veil: rgba(22, 33, 44, 0.9);
  --r-s: 4px;
  --r-m: 6px;
  --r-l: 10px;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --pad: clamp(16px, 5vw, 32px);
  --max: 1200px;
  --header-h: 60px;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #F6F8FA;
    --surface: #FFFFFF;
    --text: #0F1720;
    --primary: #0B6E64;
    --accent: #8A6200;
    --muted: #4A5865;
    --outline: #6B7785;
    --line: #D5DDE4;
    --grat: rgba(15, 23, 32, 0.06);
    --error: #B3261E;
    --on-primary: #FFFFFF;
    --gap: #2F5FD0;
    --spike: #C2412F;
    --flat: #8A6200;
    --drift: #7A4CC9;
    --series: #4A5865;
    --rail: rgba(11, 110, 100, 0.45);
    --veil: rgba(255, 255, 255, 0.92);
    color-scheme: light;
  }
}
@media (prefers-contrast: more) {
  :root { --bg: #0A0F14; --text: #FFFFFF; --muted: #C5D0DA; --outline: #9AA8B6; --primary: #5EEAD4; --line: #687A8B; }
}
@media (prefers-contrast: more) and (prefers-color-scheme: light) {
  :root { --bg: #FFFFFF; --text: #000000; --muted: #2C3640; --outline: #4A5865; --primary: #08544C; --line: #6B7785; }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 64px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.625;
  overflow-wrap: break-word;
}
img, svg { max-width: 100%; }
img { height: auto; display: block; }
h1, h2, h3 { font-weight: 600; line-height: 1.2; margin: 0 0 0.6em; }
h1 { font-size: clamp(1.75rem, 1.2rem + 2.4vw, 2.5rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.375rem, 1.1rem + 1.2vw, 1.875rem); }
h3 { font-size: clamp(1.125rem, 1.05rem + 0.3vw, 1.25rem); }
p { margin: 0 0 1em; }
ul, ol { padding-left: 1.25em; }
a { color: var(--primary); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 2px; }
code, .mono { font-family: var(--mono); }
.small { font-size: 0.875rem; line-height: 1.45; }
.muted { color: var(--muted); }
.lead { font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem); line-height: 1.55; }
.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; }
.prose { max-width: 68ch; }
.container.prose { max-width: calc(var(--max) + 2 * var(--pad)); }
.container.prose > * { max-width: 68ch; }
[hidden] { display: none !important; }

.container { width: 100%; max-width: calc(var(--max) + 2 * var(--pad)); margin-inline: auto; padding-inline: var(--pad); }
.container > *, .grid-2 > *, .tool-grid > *, .repair-grid > *, .rule-grid > * { min-width: 0; }

.skip { position: absolute; left: 8px; top: -60px; z-index: 100; background: var(--primary); color: var(--on-primary); padding: 10px 14px; border-radius: var(--r-m); font-weight: 600; }
.skip:focus { top: 8px; }

/* Eyebrow / mono labels */
.eyebrow, .mono-label { font-family: var(--mono); font-weight: 500; font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin: 0 0 0.75rem; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--surface); border-bottom: 1px solid var(--line); }
.hdr { display: flex; align-items: center; gap: 12px; min-height: var(--header-h); }
.brand { display: inline-flex; align-items: center; flex: 0 0 auto; border-radius: var(--r-s); }
.brand img { height: 32px; width: auto; border-radius: var(--r-s); }
.menu-btn { margin-left: auto; width: 44px; height: 44px; display: inline-grid; place-items: center; background: transparent; border: 1px solid var(--outline); border-radius: var(--r-m); color: var(--text); cursor: pointer; }
.menu-icon, .menu-icon::before, .menu-icon::after { display: block; width: 18px; height: 2px; background: currentColor; position: relative; }
.menu-icon::before, .menu-icon::after { content: ""; position: absolute; left: 0; }
.menu-icon::before { top: -6px; }
.menu-icon::after { top: 6px; }
.menu-btn[aria-expanded="true"] .menu-icon { background: transparent; }
.menu-btn[aria-expanded="true"] .menu-icon::before { top: 0; transform: rotate(45deg); }
.menu-btn[aria-expanded="true"] .menu-icon::after { top: 0; transform: rotate(-45deg); }
.site-nav { display: none; }
.site-nav.open { display: block; position: absolute; left: 0; right: 0; top: 100%; background: var(--surface); border-bottom: 1px solid var(--line); padding: 8px var(--pad) 20px; max-height: calc(100vh - var(--header-h)); overflow-y: auto; }
.site-nav ul { list-style: none; margin: 0; padding: 0; }
.site-nav li a { display: flex; align-items: center; min-height: 48px; color: var(--text); text-decoration: none; border-bottom: 1px solid var(--line); }
.site-nav li a[aria-current="page"] { color: var(--primary); }
.site-nav .btn { margin-top: 16px; width: 100%; }
@media (min-width: 1000px) {
  :root { --header-h: 64px; }
  .menu-btn { display: none; }
  .site-nav, .site-nav.open { display: flex; position: static; align-items: center; gap: 20px; margin-left: auto; padding: 0; border: 0; background: none; max-height: none; overflow: visible; }
  .site-nav ul { display: flex; gap: 4px; }
  .site-nav li a { border: 0; min-height: 44px; padding: 0 10px; font-size: 0.9375rem; border-bottom: 2px solid transparent; }
  .site-nav li a:hover { color: var(--primary); }
  .site-nav li a[aria-current="page"] { border-bottom-color: var(--primary); }
  .site-nav .btn { margin: 0; width: auto; }
}

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 10px 20px; border-radius: var(--r-m); font: 600 1rem/1.2 var(--sans); text-decoration: none; cursor: pointer; border: 1px solid transparent; text-align: center; }
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover { filter: brightness(1.08); text-decoration: none; }
.btn-secondary { background: transparent; color: var(--text); border-color: var(--outline); }
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }
.btn-sm { min-height: 44px; padding: 8px 14px; font-size: 0.875rem; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; filter: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 1.25rem 0 0.75rem; }
.linkbtn { background: none; border: 0; padding: 4px 0; min-height: 44px; color: var(--primary); font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* Chips and glyphs */
.chip { display: inline-flex; align-items: center; gap: 6px; font: 500 0.75rem/1 var(--mono); letter-spacing: 0.05em; text-transform: uppercase; border: 1px solid var(--outline); color: var(--muted); padding: 6px 8px; border-radius: var(--r-s); white-space: nowrap; }
.chip-now { border-color: var(--primary); color: var(--primary); }
.chip-planned { border-style: dashed; }
.chip-default { border-color: var(--accent); color: var(--accent); text-transform: none; letter-spacing: 0; }
.chip-accepted { border-color: var(--primary); color: var(--primary); }
.chip-rejected { border-color: var(--spike); color: var(--spike); }
.glyph { font-family: var(--mono); font-weight: 500; display: inline-block; min-width: 1.1em; text-align: center; }
.g-gap { color: var(--gap); }
.g-spike { color: var(--spike); }
.g-flat { color: var(--flat); }
.g-drift { color: var(--drift); }

/* Sections and trace rail */
.sec { padding-block: clamp(48px, 7vw, 96px); }
.sec + .sec { padding-top: 0; }
.sec h2.traced::before { content: ""; display: block; width: 56px; height: 0; border-top: 2px solid var(--rail); margin-bottom: 14px; }
.sec h2.t-gap::before { border-top-style: dashed; }
.sec h2.t-flat::before { border-top-color: var(--flat); }
.idx { font-family: var(--mono); font-size: 0.75rem; color: var(--muted); letter-spacing: 0.06em; display: block; margin-bottom: 6px; }
@media (min-width: 960px) {
  main.railed { position: relative; }
  main.railed .sec > .container { position: relative; padding-left: calc(var(--pad) + 40px); }
  main.railed .sec > .container::before { content: ""; position: absolute; left: calc(var(--pad) + 11px); top: 0; bottom: -96px; border-left: 2px solid var(--rail); }
  main.railed .sec:last-child > .container::before { bottom: 0; }
  main.railed .sec h2.traced { position: relative; }
  main.railed .sec h2.traced::before { position: absolute; left: -35px; top: 0.35em; width: 10px; height: 10px; border: 2px solid var(--primary); background: var(--bg); border-radius: 50%; margin: 0; }
  main.railed .sec h2.t-gap::before { border-style: dashed; }
  main.railed .sec h2.t-flat::before { border-color: var(--flat); }
}

/* Panels with graticule */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); padding: clamp(16px, 3vw, 24px); }
.graticule { background-color: var(--surface); background-image: linear-gradient(var(--grat) 1px, transparent 1px), linear-gradient(90deg, var(--grat) 1px, transparent 1px); background-size: 8px 8px; }

/* Charts */
.chart { display: block; width: 100%; height: auto; overflow: visible; }
.chart .s-line { fill: none; stroke: var(--series); stroke-width: 1.6; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.chart .s-orig { fill: none; stroke: var(--series); stroke-width: 1.6; stroke-dasharray: 5 4; vector-effect: non-scaling-stroke; }
.chart .s-rep { fill: none; stroke: var(--primary); stroke-width: 2; vector-effect: non-scaling-stroke; }
.chart .s-hero { fill: none; stroke: var(--primary); stroke-width: 2; vector-effect: non-scaling-stroke; }
.chart .ax { font: 400 11px var(--mono); fill: var(--muted); }
.chart .axl { stroke: var(--line); stroke-width: 1; }
.chart .o-gap { fill: var(--gap); fill-opacity: 0.16; }
.chart .o-gap-edge { stroke: var(--gap); stroke-width: 1.5; stroke-dasharray: 4 3; }
.chart .o-spike { fill: var(--spike); }
.chart .o-ring { fill: none; stroke: var(--spike); stroke-width: 1.5; }
.chart .o-flat { stroke: var(--flat); stroke-width: 5; stroke-linecap: butt; }
.chart .o-drift-edge { stroke: var(--drift); stroke-width: 1; }
.chart .hatch-line { stroke: var(--drift); stroke-width: 1.5; stroke-opacity: 0.55; }
.chart .o-band { fill: var(--primary); fill-opacity: 0.12; }
.chart .o-limit { stroke: var(--accent); stroke-width: 1.2; stroke-dasharray: 6 4; }
.chart .o-mean { stroke: var(--drift); stroke-width: 2; fill: none; }
.chart .o-dot { fill: var(--series); }
.chart .o-focus { fill: none; stroke: var(--text); stroke-width: 1; stroke-dasharray: 2 3; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; list-style: none; padding: 0; margin: 10px 0 0; font: 400 0.8125rem/1.4 var(--mono); color: var(--muted); }
.legend li { display: inline-flex; align-items: center; gap: 6px; }
@media (prefers-reduced-motion: no-preference) {
  .chart .draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: trace 900ms ease-out forwards; }
  .chart .fade { opacity: 0; animation: fadein 300ms ease-out forwards; }
}
.chart .d7 { animation-delay: 700ms; }
.chart .d8 { animation-delay: 800ms; }
.pb-72 { padding-bottom: 72px; }
.mt-12 { margin-top: 12px; }
@keyframes trace { to { stroke-dashoffset: 0; } }
@keyframes fadein { to { opacity: 1; } }

/* Hero */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); }
.hero-grid { display: grid; gap: 24px; padding-block: 40px 48px; position: relative; z-index: 1; }
.hero h1 { font-size: clamp(2.125rem, 1.4rem + 3vw, 3.25rem); line-height: 1.12; max-width: 16ch; }
.tagline { font-style: italic; color: var(--primary); font-size: 1.125rem; margin-bottom: 1rem; }
.hero-stage { position: relative; border-radius: var(--r-l); overflow: hidden; border: 1px solid var(--line); margin: 0 var(--pad) 40px; }
.hero-grid { padding-bottom: 24px; }
.hero-stage > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 60% 50%; }
.hero-chart { position: relative; margin: 72px 12px 12px; background-color: var(--veil); border: 1px solid var(--line); border-radius: var(--r-m); padding: 12px; }
.hero-chart figcaption { font-size: 0.8125rem; color: var(--muted); margin-top: 6px; }
@media (min-width: 960px) {
  .hero { min-height: 600px; }
  .hero-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); padding-block: 72px; align-items: center; }
  .hero-copy { max-width: 470px; }
  .hero-grid { padding-bottom: 72px; }
  .hero-stage { position: absolute; top: 0; bottom: 0; right: 0; width: 55%; margin: 0; border: 0; border-radius: 0; border-left: 1px solid var(--line); }
  .hero-chart { position: absolute; left: 6%; right: 6%; bottom: 56px; margin: 0; padding: 16px; }
  .hero-slot { min-height: 1px; }
}

/* Problem cards */
.cards-4 { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .cards-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .cards-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.pcard { background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--c, var(--primary)); border-radius: var(--r-m); padding: 18px; display: flex; flex-direction: column; }
.pcard h3 { display: flex; align-items: center; gap: 8px; }
.pcard p { font-size: 0.9375rem; color: var(--text); }
.pcard a { margin-top: auto; }
.pcard .spark { margin: 4px 0 12px; height: 64px; border-radius: var(--r-s); }
.c-gap { --c: var(--gap); }
.c-spike { --c: var(--spike); }
.c-flat { --c: var(--flat); }
.c-drift { --c: var(--drift); }

/* Steps */
.steps { list-style: none; padding: 0; margin: 0 0 1.5rem; display: grid; gap: 20px; counter-reset: s; }
.steps li { position: relative; padding-left: 56px; }
.steps li::before { counter-increment: s; content: counter(s, decimal-leading-zero); position: absolute; left: 0; top: -2px; font: 500 1.5rem/1 var(--mono); color: var(--primary); }
.steps h3 { margin-bottom: 0.3em; }
@media (min-width: 960px) {
  .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
  .steps li { padding-left: 0; padding-top: 44px; border-top: 2px solid var(--rail); }
  .steps li::before { top: 12px; }
}

/* Privacy band */
.band { background: var(--surface); border-block: 1px solid var(--line); margin-bottom: clamp(48px, 7vw, 96px); }
.band-grid { display: grid; gap: 24px; padding-block: 40px; align-items: center; }
.band-media { border-radius: var(--r-l); overflow: hidden; border: 1px solid var(--line); }
.band-media img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
@media (min-width: 860px) { .band-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 48px; padding-block: 56px; } }

/* Audience list */
.aud { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: 16px; }
.aud li { padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface); }
@media (min-width: 760px) { .aud { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Plans */
.plans { display: grid; gap: 16px; margin-bottom: 1rem; }
@media (min-width: 760px) { .plans { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.plan { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: 20px; display: flex; flex-direction: column; gap: 4px; }
.plan.free { border-top: 3px solid var(--primary); }
.plan-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.plan-head h2, .plan-head h3 { margin: 0; }
.plan ul { margin: 0 0 1rem; }
.plan .btn { margin-top: auto; align-self: flex-start; }
.checks { list-style: none; padding: 0; }
.checks li { position: relative; padding-left: 24px; margin-bottom: 6px; }
.checks li::before { content: "✓"; position: absolute; left: 0; color: var(--primary); font-family: var(--mono); }

/* Roadmap rows */
.rows { list-style: none; padding: 0; margin: 0 0 1rem; border-top: 1px solid var(--line); }
.rows li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.rows li > span:first-child { flex: 1 1 240px; min-width: 0; }

/* Early access */
.ea { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); padding: clamp(20px, 4vw, 40px); display: grid; gap: 24px; }
@media (min-width: 860px) { .ea { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: start; } }
.inline-form { display: grid; gap: 10px; }
.inline-form .row { display: grid; gap: 10px; }
.inline-form label { margin-bottom: 0; }
.loaded, .vals { overflow-wrap: anywhere; }
@media (min-width: 600px) { .inline-form .row { display: flex; gap: 10px; align-items: flex-start; } .inline-form .row input { flex: 1 1 auto; } }

/* Forms */
label, .label { display: block; font-weight: 600; margin-bottom: 6px; }
input[type="text"], input[type="email"], input[type="number"], input:not([type]), select, textarea {
  width: 100%; max-width: 100%; min-height: 48px; padding: 10px 12px; font: 400 1rem/1.4 var(--sans); color: var(--text); background: var(--bg); border: 1px solid var(--outline); border-radius: var(--r-s);
}
input[type="number"] { font-family: var(--mono); }
textarea { min-height: 150px; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--primary); outline-offset: 0; border-color: var(--primary); }
.field { margin-bottom: 18px; }
.help { display: block; font-size: 0.875rem; color: var(--muted); margin-top: 6px; line-height: 1.45; }
.err { display: block; color: var(--error); font-size: 0.875rem; margin-top: 6px; }
.invalid { border-color: var(--error) !important; border-width: 2px !important; }
.form-status { margin-top: 12px; }
.form-status.ok { color: var(--primary); font-weight: 600; }
.form-status.bad { color: var(--error); }
.hp { position: absolute !important; left: -10000px !important; top: auto; width: 1px; height: 1px; overflow: hidden; }
fieldset { border: 1px solid var(--line); border-radius: var(--r-m); padding: 14px; margin: 0 0 18px; min-width: 0; }
legend { font-weight: 600; padding: 0 6px; }
.radio-cards { display: grid; gap: 8px; }
@media (min-width: 520px) { .radio-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.radio-cards label { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; border: 1px solid var(--line); border-radius: var(--r-s); padding: 10px; margin: 0; cursor: pointer; }
.radio-cards input { margin-top: 4px; accent-color: var(--primary); width: 18px; height: 18px; flex: 0 0 auto; }
.radio-cards strong { display: block; }
.pair { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }

/* Page head */
.page-head { padding-block: clamp(32px, 6vw, 64px) clamp(24px, 4vw, 40px); }
.page-head p { max-width: 68ch; }

/* Tools */
.tools-head { display: grid; gap: 20px; }
@media (min-width: 960px) { .tools-head { grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); align-items: end; } }
.note { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-left: 3px solid var(--primary); border-radius: var(--r-m); padding: 12px 14px; background: var(--surface); font-size: 0.9375rem; }
.note p { margin: 0; }
.note .ic { flex: 0 0 auto; width: 20px; height: 20px; color: var(--primary); margin-top: 2px; }
.tool-tabs { position: sticky; top: var(--header-h); z-index: 40; background: var(--bg); border-bottom: 1px solid var(--line); }
.tool-tabs ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tool-tabs a { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 52px; padding: 6px 8px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 0.9375rem; border-bottom: 3px solid transparent; line-height: 1.2; }
.tool-tabs a:hover { color: var(--text); }
.tool-tabs a[aria-current="true"] { color: var(--primary); border-bottom-color: var(--primary); }
.tool-sec { padding-block: clamp(40px, 6vw, 72px); border-bottom: 1px solid var(--line); }
.tool-intro { display: grid; gap: 20px; margin-bottom: 24px; align-items: center; }
.tool-intro .art { border-radius: var(--r-l); overflow: hidden; border: 1px solid var(--line); max-width: 360px; }
.tool-intro .art img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
@media (min-width: 760px) { .tool-intro { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); } .tool-intro .art { justify-self: end; width: 100%; } }
.tool-grid { display: grid; gap: 20px; }
@media (min-width: 960px) { .tool-grid { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); align-items: start; } }
.drop { border: 1.5px dashed var(--outline); border-radius: var(--r-m); padding: 16px; display: grid; gap: 10px; margin-bottom: 14px; }
.drop.over { border-color: var(--primary); background: rgba(54, 214, 195, 0.06); }
.drop .btn { width: 100%; }
.loaded { font: 400 0.8125rem/1.5 var(--mono); color: var(--muted); margin: 10px 0; }
.alert { border: 1px solid var(--error); border-left-width: 4px; border-radius: var(--r-m); padding: 12px 14px; color: var(--text); background: var(--surface); margin-bottom: 14px; }
.alert strong { color: var(--error); }
.setting { border-top: 1px solid var(--line); padding: 14px 0; }
.setting label { margin-bottom: 4px; }
.stepper { display: flex; align-items: center; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.stepper input { width: 110px; flex: 0 0 auto; text-align: center; }
.stepper button { width: 44px; height: 44px; border: 1px solid var(--outline); border-radius: var(--r-s); background: var(--bg); color: var(--text); font: 500 1.125rem var(--mono); cursor: pointer; }
.stepper button:hover { border-color: var(--primary); }
.stepper .unit { font-family: var(--mono); color: var(--muted); }
.switch { display: inline-flex; align-items: center; gap: 8px; font-weight: 400; margin-top: 8px; min-height: 44px; cursor: pointer; }
.switch input { width: 20px; height: 20px; accent-color: var(--primary); }
details.settings > summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; }
.chart-panel { padding: 12px; }
.chart-tools { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: flex-end; margin-bottom: 10px; }
.chart-tools .field { margin: 0; flex: 1 1 180px; }
.summary { font-weight: 600; font-size: 1.0625rem; }
.issue-list { list-style: none; padding: 0; margin: 12px 0; max-height: 380px; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--r-m); }
.issue-list li + li { border-top: 1px solid var(--line); }
.issue-list button { display: flex; gap: 10px; width: 100%; text-align: left; background: none; border: 0; color: var(--text); padding: 12px; font: 400 0.9375rem/1.5 var(--sans); cursor: pointer; }
.issue-list button:hover, .issue-list button[aria-pressed="true"] { background: rgba(54, 214, 195, 0.08); }
.issue-list .glyph { margin-top: 1px; }
.issue-list .more { padding: 12px; color: var(--muted); font-size: 0.875rem; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-m); margin: 12px 0; max-height: 380px; }
table { border-collapse: collapse; width: 100%; font: 400 0.8125rem/1.4 var(--mono); }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td.wrap { white-space: normal; min-width: 200px; font-family: var(--sans); font-size: 0.9375rem; }
th { color: var(--muted); font-weight: 500; position: sticky; top: 0; background: var(--surface); }
.empty-chart { padding: 48px 16px; text-align: center; color: var(--muted); border: 1px dashed var(--outline); border-radius: var(--r-m); }

.fix-types { list-style: none; padding: 0; margin: 0 0 20px; display: grid; gap: 8px; }
.fix-types li { padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-s); background: var(--surface); }
.repair-grid { display: grid; gap: 20px; }
@media (min-width: 960px) { .repair-grid { grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); align-items: start; } .repair-side { position: sticky; top: calc(var(--header-h) + 72px); } }
.bulk { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-bottom: 12px; }
.changes { display: grid; gap: 14px; }
@media (min-width: 700px) { .changes { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.change { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: 14px; }
.change-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.change-head h3 { font-size: 1rem; margin: 0; }
.change .chart { border-radius: var(--r-s); margin-bottom: 8px; }
.change .btn-row { margin: 10px 0 0; }
.change .vals { font: 400 0.8125rem/1.5 var(--mono); color: var(--muted); margin: 0; overflow-wrap: anywhere; }
.notice { border-left: 3px solid var(--muted); padding: 10px 14px; background: var(--surface); border-radius: 0 var(--r-m) var(--r-m) 0; margin: 0 0 16px; font-size: 0.9375rem; }
.side-block { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: 16px; margin-bottom: 16px; }
.side-block h3 { font-size: 1rem; }
.side-block .btn { width: 100%; margin-bottom: 10px; }
.rule-grid { display: grid; gap: 24px; }
@media (min-width: 960px) { .rule-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: start; } }
.rule-text { font-size: 1.125rem; border-left: 3px solid var(--primary); padding-left: 12px; margin: 0 0 16px; }
.code-tabs { display: flex; gap: 4px; margin-bottom: -1px; }
.code-tabs button { min-height: 44px; padding: 0 16px; background: transparent; color: var(--muted); border: 1px solid var(--line); border-bottom: 0; border-radius: var(--r-s) var(--r-s) 0 0; font: 500 0.875rem var(--mono); cursor: pointer; }
.code-tabs button[aria-selected="true"] { background: var(--surface); color: var(--primary); }
pre.code { margin: 0 0 12px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 0 var(--r-s) var(--r-s) var(--r-s); font: 400 0.875rem/1.55 var(--mono); overflow-x: auto; white-space: pre; min-height: 120px; }

/* How it works */
.method-layout { display: grid; gap: 24px; }
.toc { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0 0 8px; }
.toc a { display: inline-flex; align-items: center; min-height: 40px; padding: 4px 12px; border: 1px solid var(--outline); border-radius: var(--r-s); font: 500 0.8125rem var(--mono); text-decoration: none; color: var(--text); }
.toc a:hover, .toc a[aria-current="true"] { border-color: var(--primary); color: var(--primary); }
@media (min-width: 1000px) {
  .method-layout { grid-template-columns: 220px minmax(0, 1fr); gap: 40px; }
  .toc { position: sticky; top: calc(var(--header-h) + 24px); flex-direction: column; align-self: start; }
}
.method { padding-block: 32px; border-top: 1px solid var(--line); display: grid; gap: 20px; }
@media (min-width: 860px) { .method.has-fig { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); align-items: start; } }
.method h2 { display: flex; gap: 10px; align-items: baseline; }
.method figure { margin: 0; }
.method figcaption { font-size: 0.8125rem; color: var(--muted); margin-top: 6px; }
.fig { padding: 10px; border: 1px solid var(--line); border-radius: var(--r-m); }
.summary-box { border: 1px solid var(--line); border-left: 3px solid var(--primary); border-radius: var(--r-m); padding: 16px 18px; background: var(--surface); max-width: 75ch; }
dl.gloss { margin: 0; }
dl.gloss dt { font-weight: 600; margin-top: 14px; }
dl.gloss dd { margin: 4px 0 0; color: var(--text); }
.x-list { list-style: none; padding: 0; }
.x-list li { position: relative; padding-left: 28px; margin-bottom: 12px; }
.x-list li::before { content: "×"; position: absolute; left: 4px; top: -1px; font: 500 1.125rem var(--mono); color: var(--spike); }

/* About */
.about-top { display: grid; gap: 24px; align-items: center; }
.about-top .art { border-radius: var(--r-l); overflow: hidden; border: 1px solid var(--line); }
.about-top .art img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
@media (min-width: 900px) { .about-top { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: 48px; } }
.principles { list-style: none; padding: 0; display: grid; gap: 14px; }
.principles li { padding-left: 44px; position: relative; }
.principles li span.n { position: absolute; left: 0; top: 2px; font: 500 0.875rem var(--mono); color: var(--primary); }

/* Contact */
.contact-grid { display: grid; gap: 32px; }
@media (min-width: 900px) { .contact-grid { grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); align-items: start; } }
.err-summary { border: 1px solid var(--error); border-radius: var(--r-m); padding: 12px 14px; margin-bottom: 18px; }
.err-summary ul { margin: 6px 0 0; }

/* FAQ */
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 12px; font-weight: 600; list-style: none; padding: 10px 0; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font: 500 1.25rem var(--mono); color: var(--primary); flex: 0 0 auto; }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: 0 0 16px; color: var(--text); }

/* 404 */
.nf { text-align: center; padding-block: clamp(40px, 8vw, 96px); }
.nf .art { max-width: 880px; margin: 0 auto 32px; border-radius: var(--r-l); overflow: hidden; border: 1px solid var(--line); }
.nf .art img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.nf .btn-row { justify-content: center; }
.nf p { margin-inline: auto; max-width: 52ch; }

/* Legal prose */
.legal-prose { max-width: 72ch; padding-bottom: 72px; }
.legal-prose h2 { font-size: 1.25rem; margin-top: 2em; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); margin-top: 0; }
.ftr { display: grid; gap: 28px; padding-block: 40px 24px; }
@media (min-width: 860px) { .ftr { grid-template-columns: minmax(0, 5fr) minmax(0, 4fr) minmax(0, 3fr); } }
.ftr ul { list-style: none; padding: 0; margin: 0; columns: 2; column-gap: 24px; }
.ftr li a { display: inline-flex; min-height: 36px; align-items: center; color: var(--text); }
.ftr .brand { margin-bottom: 14px; }
.legal { border-top: 1px solid var(--line); padding-block: 16px 24px; font-size: 0.875rem; color: var(--muted); }
.legal p { margin: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
