/* Look borrowed from the stageshow kit (benjitaylor/skills): a quiet grey canvas, one white surface for the
   editor, the system font, five inks and one blue accent, one big number with the rest as lines,
   no borders where a fill or space already separates. Left aligned, one column. */
:root {
  color-scheme: light;
  --canvas: #f6f5f4;
  --surface: #ffffff;
  --well: #efeeec;
  --text-strong: #262628;
  --text: #6b6b6f;          /* kit #7a7a7d stepped up a tone for white */
  --text-faint: #9a9a9d;
  --line: rgba(0, 0, 0, 0.07);
  --accent: #3b82f6;
  --accent-text: #2563eb;
  --ok: #15803d; --warn: #b45309;
  --series-speed: #2a78d6;  /* dataviz slot 1, validated on #ffffff */
  --series-hr: #eb6834;     /* dataviz slot 2 */
  --grid: rgba(0, 0, 0, 0.06);
  --dim: rgba(255, 255, 255, 0.78);
  --edge: #262628;
  --shadow-window: 0 0 0 1px rgba(0, 0, 0, 0.06), 0 4px 16px rgba(0, 0, 0, 0.06);
  --shadow-thumb: 0 0 0 0.5px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.12);
  --r-sm: 6px; --r-md: 8px; --r-window: 12px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --canvas: #111113; --surface: #1a1a1d; --well: #0f0f11; --text-strong: #ececee; --text: #a3a3a8; --text-faint: #6c6c70;
    --line: rgba(255, 255, 255, 0.08); --accent: #3b82f6; --accent-text: #7fb0ff; --ok: #4ade80; --warn: #fbbf24;
    --series-speed: #3987e5; --series-hr: #d95926; --grid: rgba(255, 255, 255, 0.07); --dim: rgba(26, 26, 29, 0.78); --edge: #ececee;
    --shadow-window: 0 0 0 1px rgba(255, 255, 255, 0.07); --shadow-thumb: 0 0 0 1px rgba(255, 255, 255, 0.1);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #111113; --surface: #1a1a1d; --well: #0f0f11; --text-strong: #ececee; --text: #a3a3a8; --text-faint: #6c6c70;
  --line: rgba(255, 255, 255, 0.08); --accent: #3b82f6; --accent-text: #7fb0ff; --ok: #4ade80; --warn: #fbbf24;
  --series-speed: #3987e5; --series-hr: #d95926; --grid: rgba(255, 255, 255, 0.07); --dim: rgba(26, 26, 29, 0.78); --edge: #ececee;
  --shadow-window: 0 0 0 1px rgba(255, 255, 255, 0.07); --shadow-thumb: 0 0 0 1px rgba(255, 255, 255, 0.1);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--canvas); color: var(--text-strong); font: 400 15px/1.5 var(--font); }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
code { font: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
h1, h2 { font-weight: 600; letter-spacing: -0.01em; text-wrap: balance; }

/* page */
.masthead, .bench, .foot { width: min(760px, 100% - 32px); margin-inline: auto; }
.masthead { padding: 48px 0 20px; }
h1 { font-size: 1.75rem; line-height: 1.2; margin: 0 0 6px; }
.lead { margin: 0; color: var(--text); max-width: 58ch; }
.bench { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; padding-bottom: 56px; }
.bench > *, .window > *, .pane > * { min-width: 0; }

/* the one surface */
.window { background: var(--surface); border-radius: var(--r-window); box-shadow: var(--shadow-window); padding: 20px; display: grid; gap: 16px; }
.intake { display: grid; gap: 12px; }
.drop { display: grid; gap: 2px; justify-items: center; text-align: center; padding: 28px 16px; background: var(--well); border-radius: var(--r-md); cursor: pointer; }
.drop:hover, .drop.over { box-shadow: inset 0 0 0 1.5px var(--accent); }
.drop-title { font-weight: 500; }
.like-link { color: var(--accent-text); }
.drop-hint { color: var(--text-faint); font-size: 0.87rem; }
.intake-links { display: grid; gap: 6px; color: var(--text); font-size: 0.93rem; }
.intake-links p { margin: 0; }
.link-btn { font: inherit; color: var(--accent-text); background: none; border: 0; padding: 0; cursor: pointer; }
.link-btn:hover { text-decoration: underline; text-underline-offset: 3px; }
.example-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; }
.example-list li { display: contents; }
.example-list .link-btn { justify-self: start; font-weight: 500; }

.files { list-style: none; margin: 0; padding: 0; display: grid; }
.files:empty { display: none; }
.file { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 2px 12px; padding: 10px 0; }
.file + .file { border-top: 1px solid var(--line); }
.file:not(:has(input[type=radio])) { grid-template-columns: minmax(0, 1fr) auto; }
.file:not(:has(input[type=radio])) .meta { grid-column: 1 / -1; }
.has-files .drop { padding: 12px 16px; }
.has-files .drop-hint { display: none; }
.file input[type=radio] { accent-color: var(--accent); margin: 0; }
.file .name { font-weight: 500; word-break: break-all; }
.file .state { font-weight: 400; font-size: 0.87rem; margin-left: 8px; word-break: normal; }
.file .state.ok { color: var(--ok); }
.file .state.warn { color: var(--warn); }
.file .state.example { color: var(--text-faint); }
.file .meta { grid-column: 2 / -1; color: var(--text); font-size: 0.87rem; }
.file .x { background: none; border: 0; color: var(--text-faint); cursor: pointer; font: inherit; font-size: 0.87rem; padding: 4px 6px; border-radius: var(--r-sm); }
.file .x:hover { color: var(--text-strong); background: var(--well); }

.summary { display: grid; gap: 2px; }
.summary .big { font-size: 2.6rem; font-weight: 600; line-height: 1.05; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.summary .sub { color: var(--text); font-variant-numeric: tabular-nums; }

/* segmented tabs */
.workbench { display: grid; gap: 4px; }
.tabs { display: inline-flex; justify-self: start; gap: 2px; padding: 2px; background: var(--well); border-radius: var(--r-md); max-width: 100%; overflow-x: auto; }
.tabs button { font: 500 0.87rem var(--font); color: var(--text); background: none; border: 0; border-radius: var(--r-sm); padding: 6px 12px; cursor: pointer; white-space: nowrap; }
.tabs button:hover:not(:disabled):not([aria-selected="true"]) { color: var(--text-strong); }
.tabs button[aria-selected="true"] { color: var(--text-strong); background: var(--surface); box-shadow: var(--shadow-thumb); }
.tabs button:disabled { opacity: 0.4; cursor: not-allowed; }
.pane { padding: 12px 0 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.help { margin: 0; color: var(--text); max-width: 62ch; font-size: 0.93rem; }

/* charts */
.charts { position: relative; display: grid; gap: 8px; margin: 0 -8px; }
.chart { margin: 0; }
.chart figcaption { font-size: 0.82rem; color: var(--text); margin: 0 0 2px 8px; }
.chart-title { color: var(--text-strong); font-weight: 500; }
.chart-unit { color: var(--text-faint); }
canvas { display: block; width: 100%; touch-action: pan-y; }
.tip { position: absolute; z-index: 2; pointer-events: none; background: var(--surface); border-radius: var(--r-md); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08), 0 4px 16px rgba(0, 0, 0, 0.12); padding: 8px 12px; font-size: 0.82rem; display: grid; gap: 3px; min-width: 150px; font-variant-numeric: tabular-nums; }
.tip-time { color: var(--text); }
.tip-row { display: grid; grid-template-columns: 14px auto 1fr; align-items: center; gap: 6px; }
.tip-row b { font-weight: 600; }
.tip-row span:last-child { color: var(--text); }
.key { width: 12px; height: 2px; border-radius: 1px; }

.range { position: relative; height: 28px; margin: -6px -4px 0 28px; }
.range input { position: absolute; inset: 0; width: 100%; margin: 0; height: 28px; background: none; pointer-events: none; -webkit-appearance: none; appearance: none; }
.range input::-webkit-slider-runnable-track { height: 4px; background: transparent; }
.range input::-webkit-slider-thumb { -webkit-appearance: none; pointer-events: auto; width: 16px; height: 22px; margin-top: -9px; border-radius: 5px; background: var(--surface); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12), 0 1px 4px rgba(0, 0, 0, 0.18); cursor: ew-resize; }
.range input::-moz-range-thumb { pointer-events: auto; width: 14px; height: 20px; border-radius: 5px; background: var(--surface); border: 1px solid rgba(0, 0, 0, 0.15); cursor: ew-resize; }
.range input:focus-visible { outline: none; }
.range input:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px var(--accent); }
.range::before { content: ""; position: absolute; left: 0; right: 0; top: 12px; height: 4px; border-radius: 2px; background: var(--well); }

.readout { display: flex; flex-wrap: wrap; gap: 4px 20px; font-variant-numeric: tabular-nums; font-size: 0.93rem; }
.readout:empty { display: none; }
.readout .kv { display: inline-flex; gap: 6px; align-items: baseline; }
.readout .k { color: var(--text); }
.readout .v { font-weight: 600; }
.readout .v.cut { color: var(--text-faint); font-weight: 500; }

.table-view summary { cursor: pointer; color: var(--text); font-size: 0.87rem; }
.table-wrap { overflow-x: auto; margin-top: 8px; }
table { border-collapse: collapse; width: 100%; font-size: 0.87rem; font-variant-numeric: tabular-nums; }
th, td { text-align: right; padding: 7px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th:first-child, td:first-child { text-align: left; padding-left: 0; }
th { color: var(--text); font-weight: 500; }

.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; max-width: 480px; }
.field-input { display: grid; gap: 6px; color: var(--text); font-size: 0.87rem; }
select, input[type=number] { font: 400 0.93rem var(--font); color: var(--text-strong); background: var(--surface); border: 0; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12); border-radius: var(--r-md); height: 34px; padding: 0 10px; }
:root[data-theme="dark"] select, :root[data-theme="dark"] input[type=number] { box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12); background: var(--well); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) select, :root:not([data-theme="light"]) input[type=number] { box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12); background: var(--well); } }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.primary { font: 500 0.93rem var(--font); color: #fff; background: var(--accent); border: 0; border-radius: var(--r-md); height: 34px; padding: 0 14px; cursor: pointer; }
.primary:hover { background: #2f74e4; }
.primary:disabled { opacity: 0.4; cursor: not-allowed; }
a.primary { display: inline-flex; align-items: center; text-decoration: none; }

.issues { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: 0.93rem; }
.issues li::marker { color: var(--warn); }
.merge-list { margin: 0; padding-left: 20px; display: grid; gap: 4px; font-size: 0.93rem; font-variant-numeric: tabular-nums; }
.merge-list .when { color: var(--text); }

.result { margin-top: 12px; padding: 14px 16px; background: var(--well); border-radius: var(--r-md); display: grid; gap: 8px; font-size: 0.93rem; }
.result.err { color: var(--warn); }
.result-head { font-variant-numeric: tabular-nums; }
.result-head strong { color: var(--ok); font-weight: 600; }
.result ul { margin: 0; padding-left: 18px; color: var(--text); }
.result .after { margin: 0; color: var(--text); font-size: 0.87rem; max-width: 62ch; }
.dl { justify-self: start; }

/* text under the editor */
.guide { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px 28px; }
.guide h2 { font-size: 1rem; margin: 0 0 4px; }
.guide p { margin: 0; color: var(--text); font-size: 0.93rem; max-width: 60ch; }
.faq { grid-column: 1 / -1; margin-top: 12px; }
.faq details { border-top: 1px solid var(--line); padding: 10px 0; }
.faq summary { cursor: pointer; font-weight: 500; }
.faq p { margin-top: 6px; }
.foot { color: var(--text-faint); font-size: 0.82rem; padding: 0 0 32px; }

/* how-to article */
.brand-link { color: var(--text-strong); font-weight: 600; }
.doc-head { width: min(680px, 100% - 32px); padding: 40px 0 0; }
.doc { width: min(680px, 100% - 32px); margin-inline: auto; padding-bottom: 56px; display: grid; gap: 28px; }
.doc > * { min-width: 0; }
.doc h1 { font-size: 2rem; margin: 12px 0 0; }
.doc h2 { font-size: 1.15rem; margin: 0 0 8px; }
.doc p { margin: 0 0 8px; max-width: 64ch; }
.doc section { scroll-margin-top: 16px; }
.answer { background: var(--surface); border-radius: var(--r-window); box-shadow: var(--shadow-window); padding: 16px 20px 8px; }
.answer h2 { font-size: 1rem; margin-bottom: 4px; }
.answer td { white-space: normal; text-align: left; vertical-align: top; }
.answer th { text-align: left; }
.answer tr:last-child td { border-bottom: 0; }
.answer .yes { color: var(--ok); }
.answer .partly { color: var(--warn); }
.steps { margin: 0 0 8px; padding-left: 1.4em; display: grid; gap: 6px; max-width: 64ch; }
.steps li::marker { color: var(--text); }
.note { color: var(--text); font-size: 0.93rem; }
.sources { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 10px 20px; max-width: 68ch; }
.sources dt { font-weight: 500; }
.sources dd { margin: 0; color: var(--text); }
.cta { background: var(--surface); border-radius: var(--r-window); box-shadow: var(--shadow-window); padding: 18px 20px; }
.cta p { color: var(--text); }

@media (max-width: 560px) {
  .masthead { padding-top: 32px; }
  .window { padding: 14px; border-radius: 10px; }
  .summary .big { font-size: 2.2rem; }
  .tabs .wide { display: none; }
  .tabs button { padding: 6px 11px; }
  .doc h1 { font-size: 1.7rem; }
  .sources { grid-template-columns: 1fr; gap: 2px; }
  .sources dd { margin-bottom: 10px; }
  .answer thead { display: none; }
  .answer tr { display: grid; gap: 2px; padding: 8px 0; border-bottom: 1px solid var(--line); }
  .answer td { display: block; border: 0; padding: 0; }
  .answer td:first-child { font-weight: 500; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
.masthead:not(.doc-head) .brand-link { display: inline-block; margin-bottom: 18px; font-size: 0.93rem; }
.crumbs { font-size: 0.93rem; color: var(--text); }
.crumbs a { color: var(--text-strong); font-weight: 600; }
.related { display: grid; gap: 6px; padding-left: 1.2em; margin: 0; }
.compare td, .compare th { text-align: left; vertical-align: top; white-space: normal; }
.table-scroll { overflow-x: auto; }
.doc .table-scroll { --w: min(920px, 100vw - 32px); width: var(--w); margin-left: calc((100% - var(--w)) / 2); }
.table-scroll .compare { min-width: 760px; }
.compare td { padding-right: 10px; }
