:root {
  color-scheme: dark;
  --tree-line: #393b42;
  --tree-muted: #c7cad5;
}
* { box-sizing: border-box; }
body { margin: 0; background: #111111; color: #ffffff; font: 16px/1.5 Arial, Helvetica, sans-serif; }
main { width: min(1192px, calc(100% - 32px)); margin: 0 auto; padding: 30px 0 48px; }
main.expanded { width: calc(100% - 32px); }
h1, h2, p { margin: 0; }
h1 { font-size: 30px; line-height: 1.2; }
h2 { font-size: 20px; }
a { color: inherit; }
.page-heading, .results-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.eyebrow { color: #ef6570; font-size: 13px; margin-bottom: 6px; }
.reference-link { font-size: 14px; text-underline-offset: 4px; }
.intro { color: var(--tree-muted); margin-top: 14px; max-width: 840px; }
.controls { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; padding: 24px 0; }
.number-field { flex: 1; min-width: 190px; }
label { display: block; font-size: 14px; font-weight: 700; margin-bottom: 6px; }
input { width: 100%; min-width: 0; height: 44px; border: 1px solid #666971; border-radius: 4px; padding: 8px 12px; background: #0c0d0f; color: #ffffff; font: 16px Consolas, monospace; }
button { display: inline-flex; gap: 8px; align-items: center; justify-content: center; height: 44px; padding: 0 14px; border: 1px solid #55585f; border-radius: 4px; background: #24262b; color: #ffffff; font: 700 14px Arial, sans-serif; cursor: pointer; }
button:hover { background: #34373e; }
button.primary { background: #b82737; border-color: #e94c5c; }
button.primary:hover { background: #d33042; }
button:disabled { opacity: .5; cursor: default; }
button svg { width: 18px; height: 18px; flex: 0 0 18px; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid #ffffff; outline-offset: 3px; }
.error { color: #ff9d9d; margin-bottom: 18px; }
.input-guide { margin-bottom: 24px; border-top: 1px solid var(--tree-line); padding-top: 14px; font-size: 14px; }
.input-guide summary { cursor: pointer; font-weight: 700; }
.input-guide-content { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; padding-top: 16px; }
.input-guide h2 { font-size: 16px; margin-bottom: 8px; }
.input-guide p { color: var(--tree-muted); margin-bottom: 10px; overflow-wrap: anywhere; }
.input-guide strong, .input-guide code { color: #ffffff; }
.input-guide code { font-family: Consolas, 'Liberation Mono', monospace; }
.input-guide sup { line-height: 0; }
.input-examples { margin: 12px 0; }
.input-examples > div { display: grid; grid-template-columns: 100px minmax(0, 1fr); gap: 10px; padding: 4px 0; }
.input-examples dt, .input-examples dd { font: inherit; margin: 0; color: var(--tree-muted); }
.results { border-top: 1px solid var(--tree-line); padding-top: 20px; }
#run-status { color: var(--tree-muted); font-size: 14px; margin-top: 4px; overflow-wrap: anywhere; }
.toolbar { display: flex; gap: 8px; flex-shrink: 0; }
.toolbar button { width: 44px; padding: 0; }
.summary { display: grid; grid-template-columns: 90px 110px minmax(0, 1fr); gap: 16px; margin: 20px 0; }
dt { font-size: 12px; color: var(--tree-muted); }
dd { margin: 2px 0 0; font: 700 16px/1.5 Consolas, monospace; overflow-wrap: anywhere; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 18px 0 12px; font-size: 12px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { display: inline-block; width: 13px; height: 13px; border: 1px solid #ffffff55; }
table { width: 100%; border-collapse: collapse; table-layout: fixed; font: 14px/1.25 Consolas, 'Liberation Mono', monospace; }
.row-number { width: 52px; }
th, td { border: 1px solid var(--tree-line); }
thead th { padding: 8px 4px; background: #23252b; text-align: center; font: 700 13px/1.25 Arial, sans-serif; }
.column-letter { display: block; color: #b9bdc8; font-size: 11px; font-weight: 400; margin-bottom: 5px; }
tbody td { padding: 2px 5px; color: #08090b; text-align: right; vertical-align: top; overflow-wrap: anywhere; }
tbody th { padding: 2px; background: #1e2026; color: #c7cad5; text-align: center; font-size: 11px; font-weight: 400; }
tbody th.peak-row-number { background: #ffe27a; color: #111111; font-weight: 800; box-shadow: inset 0 0 0 1px #d3a836; }
td.empty { background: #0d0e10; }
.mod0 { background: #f4cccc; }
.mod1 { background: #c0c0c0; }
.mod2 { background: #93c47d; }
.mod3 { background: #e06666; }
.mod4 { background: #6fa8dc; }
.mod5 { background: #f6b26b; }
tr.terminal { border-top: 3px solid #eeeeee; }
.table-note { color: var(--tree-muted); font-size: 13px; margin-top: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
@media (max-width: 640px) {
  main, main.expanded { width: calc(100% - 20px); padding-top: 24px; }
  .page-heading { align-items: start; flex-direction: column; gap: 10px; }
  h1 { font-size: 26px; }
  .number-field { flex-basis: 100%; }
  .input-guide-content { grid-template-columns: 1fr; gap: 12px; }
  .summary { grid-template-columns: 1fr 1fr; gap: 10px; }
  .peak { grid-column: 1 / -1; }
  .row-number { width: 32px; }
  table { font-size: 12px; }
  thead th { font-size: 11px; }
  tbody td { padding: 2px 3px; }
}
