:root {
  color-scheme: dark;
  --page: #141613; --panel: #1b1e19; --stage: #171a15; --raised: #23271f;
  --text: #eff1e7; --muted: #a7ad9e; --quiet: #92998a; --line: #33382e;
  --lime: #d4f780; --lime-soft: #aecd74;
  --body: Satoshi, system-ui, sans-serif; --mono: "IBM Plex Mono", ui-monospace, monospace;
  --xs: .75rem; --sm: .875rem; --base: 1rem; --title: clamp(1.85rem, 1.35rem + 1.5vw, 2.25rem);
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--page); color: var(--text); font: 500 var(--base)/1.5 var(--body); }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, a:focus-visible, [tabindex]:focus-visible, input:focus-visible + span { outline: 2px solid var(--lime); outline-offset: 3px; }
code { font-family: var(--mono); }
.sprites, .sr { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; z-index: 10; top: 8px; left: 8px; background: var(--lime); color: #141613; padding: 8px; transform: translateY(-150%); }
.skip:focus { transform: none; }
.icon { display: inline-block; width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.wrap { width: min(100% - 88px, 1376px); margin: 0 auto; }
.top { border-bottom: 1px solid var(--line); background: #181b16; }
.top-inner { min-height: 63px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.wordmark { display: flex; gap: 5px; align-items: center; font-weight: 900; letter-spacing: -.025em; white-space: nowrap; }
.terminal { display: grid; place-items: center; margin-right: 8px; width: 31px; height: 31px; border-radius: 6px; background: var(--lime); color: #202617; }
.terminal .icon { width: 19px; height: 19px; stroke-width: 2; }
.brand-second { color: #d3d8ca; }
.top-status { font: 500 var(--xs)/1.2 var(--mono); color: var(--muted); display: flex; align-items: center; gap: 8px; }
.top-status i, .log-foot i { height: 7px; width: 7px; background: var(--lime); border-radius: 50%; box-shadow: 0 0 0 3px #d4f71816; flex: none; }
.intro { padding: 31px 0 26px; }
.eyebrow { display: flex; align-items: center; gap: 8px; color: var(--lime-soft); letter-spacing: .115em; font: 500 var(--xs)/1.3 var(--mono); letter-spacing: .105em; }
.eyebrow span { background: currentColor; width: 15px; height: 1px; }
h1 { font-size: var(--title); font-weight: 900; letter-spacing: -.045em; line-height: 1.13; margin: 10px 0 8px; }
h1 em { font-style: normal; color: var(--lime); }
.intro p { margin: 0; color: var(--muted); }
.intro code, .tip code { color: var(--lime); background: #252c1e; border: 1px solid #384431; border-radius: 4px; padding: 1px 5px; font-size: var(--sm); white-space: nowrap; }
.workbench { display: grid; grid-template-columns: minmax(0, 1.87fr) minmax(340px, 1fr); gap: 16px; align-items: stretch; }
.panel { border: 1px solid var(--line); border-radius: 8px; background: var(--panel); min-width: 0; overflow: hidden; }
.bar { display: flex; justify-content: space-between; align-items: center; padding: 0 16px; gap: 8px; min-height: 53px; border-bottom: 1px solid var(--line); }
.bar h2 { margin: 0; display: flex; align-items: center; gap: 9px; white-space: nowrap; font-size: var(--base); font-weight: 700; }
.bar h2 > .icon { color: var(--lime-soft); }
.meta, .count { font: 500 var(--xs)/1.2 var(--mono); color: var(--muted); border: 1px solid #3b4135; background: #272c23; border-radius: 4px; padding: 4px 7px; white-space: nowrap; }
.meta { letter-spacing: .045em; }
.count { color: var(--lime); min-width: 24px; text-align: center; }
.controls { padding: 11px 16px 12px; border-bottom: 1px solid var(--line); }
.mode-line, fieldset { display: flex; align-items: center; gap: 12px; min-width: 0; }
.mode-line { justify-content: space-between; }
fieldset { margin: 0; border: 0; padding: 0; }
.prop { font: 500 var(--xs)/1.2 var(--mono); color: var(--text); white-space: nowrap; }
.segments { display: flex; align-items: stretch; gap: 2px; border: 1px solid #3b4135; border-radius: 6px; background: #171a15; padding: 3px; }
.segments label { position: relative; cursor: pointer; }
.segments input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.segments label span { display: grid; place-items: center; min-height: 32px; border-radius: 3px; padding: 0 10px; color: var(--muted); font: 500 var(--xs)/1.1 var(--mono); }
.segments label:hover span { color: var(--text); background: #2e3428; }
.segments input:checked + span { color: #1e2915; background: var(--lime); font-weight: 600; }
.action { border: 1px solid transparent; background: transparent; color: var(--muted); border-radius: 5px; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 8px; white-space: nowrap; font: 500 var(--xs)/1 var(--mono); }
.action .icon { width: 15px; height: 15px; }
.action:hover { background: #2b3127; color: var(--text); border-color: #3b4135; }
#mode-description { margin: 6px 0 0; color: var(--muted); font-size: var(--sm); min-height: 21px; }
.canvas { display: flex; flex-direction: column; }
.stage { flex: 1; padding: 18px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; background-color: var(--stage); background-image: radial-gradient(#9ba88a2d 1px, transparent 1px); background-size: 16px 16px; }
.sample { min-width: 0; min-height: 171px; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 11px 6px 4px; background: #1b1f18d9; border: 1px solid #373e31; border-radius: 4px; }
.sample.selected { border-color: #849952; background: #23291ce8; }
.sample.traced:not(.selected) { border-color: var(--sample); }
.sample .index { position: absolute; top: 8px; left: 10px; color: var(--quiet); font: 400 var(--xs)/1.4 var(--mono); pointer-events: none; }
.sample::before, .sample::after { content: ""; position: absolute; width: 8px; height: 8px; pointer-events: none; }
.sample::before { top: -1px; right: -1px; border-top: 1px solid #69745f; border-right: 1px solid #69745f; border-radius: 0 4px 0 0; }
.sample::after { bottom: -1px; left: -1px; border-bottom: 1px solid #69745f; border-left: 1px solid #69745f; border-radius: 0 0 0 4px; }
.sample.selected::before, .sample.selected::after { border-color: var(--lime); }
.sample-svg { display: block; width: min(100%, 154px); height: 111px; overflow: visible; }
.geometry { cursor: crosshair; }
.geometry:hover, .geometry.is-down { stroke: #f4f7e8; }
.geometry.is-down { stroke: var(--sample); }
.geometry.pulse { stroke: #fff; }
.sample-label { min-height: 40px; background: none; border: 0; border-radius: 3px; padding: 0 8px; color: var(--sample); font: 500 var(--sm)/1 var(--mono); }
.sample-label:hover { text-decoration: underline; text-underline-offset: 4px; }
.canvas-foot { min-height: 51px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 16px; border-top: 1px solid var(--line); }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 13px; }
.legend span, .canvas-hint { display: inline-flex; align-items: center; gap: 6px; font: 400 var(--xs)/1.3 var(--mono); color: var(--muted); white-space: nowrap; }
.legend i { width: 7px; height: 7px; background: var(--event); border-radius: 50%; }
.hover-key { --event: #d4f780; } .over-key { --event: #7ee0c0; } .out-key { --event: #b8a6f3; } .down-key { --event: #ffad85; } .click-key { --event: #f2d17d; }
.canvas-hint .icon { width: 14px; height: 14px; color: var(--lime-soft); }
.rail { display: grid; gap: 16px; grid-template-rows: minmax(242px, .94fr) minmax(273px, 1fr); min-width: 0; }
.event-panel, .code-panel { display: flex; flex-direction: column; }
.log-window { flex: 1; position: relative; min-height: 145px; overflow: auto; scrollbar-color: #50594a transparent; }
.empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 4px; padding: 12px; text-align: center; color: var(--muted); font-size: var(--sm); }
.empty-icon { width: 39px; height: 39px; border: 1px solid #3e4736; border-radius: 7px; display: grid; place-items: center; color: var(--lime-soft); background: #252c20; margin-bottom: 4px; }
.empty strong { color: var(--text); font-weight: 700; }
.log-list { position: absolute; inset: 0; padding: 5px 12px; height: max-content; min-width: 100%; }
.log-row { display: grid; align-items: center; grid-template-columns: 89px 88px 1fr; gap: 8px; min-height: 33px; padding: 4px; border-bottom: 1px solid #32382e; font: 400 var(--xs)/1.2 var(--mono); }
.log-row time { color: var(--quiet); font-variant-numeric: tabular-nums; }
.log-row .event-name { color: var(--event); }
.log-target { text-align: left; background: none; border: 0; padding: 3px 0; color: var(--text); font: inherit; }
.log-target:hover { text-decoration: underline; }
.log-foot, .inspector-foot { min-height: 34px; padding: 0 16px; display: flex; align-items: center; justify-content: space-between; gap: 8px; border-top: 1px solid var(--line); font: 400 var(--xs)/1.3 var(--mono); color: var(--muted); }
.log-foot span:first-child { display: flex; align-items: center; gap: 8px; color: var(--lime-soft); letter-spacing: .055em; }
.tabs { display: flex; align-items: stretch; gap: 12px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted); min-height: 41px; padding: 0 5px; font: 500 var(--xs)/1 var(--mono); }
.tabs button:hover { color: var(--text); }
.tabs button[aria-selected="true"] { border-bottom-color: var(--lime); color: var(--lime); }
#code-view { flex: 1; min-height: 142px; position: relative; overflow: auto; background: #171a15; scrollbar-color: #50594a transparent; }
pre { position: absolute; min-width: 100%; margin: 0; padding: 9px 13px 9px 0; font: 400 var(--xs)/1.58 var(--mono); color: #d9ded3; tab-size: 2; }
.code-line { display: block; min-height: 1.58em; }
.ln { display: inline-block; width: 38px; color: var(--quiet); text-align: right; margin-right: 13px; user-select: none; }
.tok-tag { color: #bde886; } .tok-string { color: #f1c481; } .tok-attr { color: #9bd9cb; } .tok-comment { color: #a1a99a; }
.inspector-foot { justify-content: flex-start; letter-spacing: .055em; }
#target { color: var(--lime); letter-spacing: 0; }
.tip { display: flex; align-items: center; gap: 10px; min-height: 49px; border-top: 1px solid var(--line); margin: 17px 0 18px; padding: 9px 2px; color: var(--muted); font-size: var(--sm); }
.tip .icon { color: var(--lime-soft); }
.tip p { margin: 0; }
.tip strong { color: var(--text); }
@media (max-width: 1120px) { .wrap { width: calc(100% - 56px); } .canvas-hint { display: none; } .mode-line, fieldset { gap: 8px; } .segments label span { padding-inline: 8px; } }
@media (max-width: 940px) { .mode-line fieldset { align-items: flex-start; flex-direction: column; } .mode-line { align-items: flex-end; } }
@media (max-width: 790px) { .workbench { grid-template-columns: minmax(0, 1fr); } .rail { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: minmax(288px, auto); } .mode-line fieldset { flex-direction: row; align-items: center; } }
@media (max-width: 580px) {
  .wrap { width: calc(100% - 28px); } .top-inner { min-height: 56px; } .top-status { font-size: var(--xs); }
  .intro { padding: 24px 0 21px; } .intro p { font-size: var(--sm); }
  .rail { grid-template-columns: minmax(0, 1fr); grid-template-rows: 244px 285px; }
  .stage { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 10px; gap: 9px; }
  .sample { min-height: 145px; padding-top: 14px; }
  .sample-svg { height: 93px; }
  .bar, .controls, .canvas-foot { padding-inline: 11px; }
  .mode-line fieldset { flex-direction: column; align-items: flex-start; }
  .segments label span, .action { min-height: 40px; }
  .legend { gap: 8px 12px; }
}
