:root {
  color-scheme: dark;
  --bg: #07101f;
  --panel: #0d1b31;
  --surface: #132641;
  --line: #29405f;
  --text: #f5f8ff;
  --muted: #a8b8cc;
  --cyan: #42e5d3;
  --blue: #7597ff;
  --danger: #ff7e8e;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--text); background: radial-gradient(circle at 85% 0, #153653, transparent 35%), var(--bg); }
button, input, select { font: inherit; }
button, input, select { border: 1px solid var(--line); border-radius: 10px; }
button { padding: .75rem 1rem; color: var(--text); background: var(--surface); cursor: pointer; font-weight: 800; }
button:hover:not(:disabled), button:focus-visible { border-color: var(--cyan); outline: none; }
button:disabled { cursor: not-allowed; opacity: .45; }
button.primary { color: #041219; background: var(--cyan); border-color: var(--cyan); }
button.quiet { color: var(--muted); background: transparent; }
.topbar { display: flex; justify-content: space-between; gap: 1rem; padding: .85rem clamp(1rem, 4vw, 3.5rem); border-bottom: 1px solid var(--line); color: var(--muted); background: rgba(7, 16, 31, .9); }
.topbar a { color: var(--cyan); text-decoration: none; }
main { width: min(1440px, 100%); margin: auto; padding: clamp(1rem, 3vw, 2.5rem); }
.hero { display: grid; grid-template-columns: 1.25fr .75fr; gap: 1.4rem; align-items: end; margin-bottom: 1.4rem; }
h1 { max-width: 760px; margin: .25rem 0 .8rem; font-size: clamp(2.2rem, 6vw, 4.7rem); line-height: .98; }
h2 { margin: 0; font-size: 1.12rem; }
.hero > div > p:last-child { max-width: 700px; color: var(--muted); line-height: 1.7; }
.eyebrow { margin: 0 0 .35rem; color: var(--cyan); font-size: .71rem; font-weight: 900; letter-spacing: .13em; text-transform: uppercase; }
.summary, .controls, .graph-panel, .inspectors article, .code-panel { border: 1px solid var(--line); border-radius: 16px; background: rgba(13, 27, 49, .93); }
.summary { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0; padding: 1.2rem; }
.summary div { padding: .35rem .7rem; border-left: 1px solid var(--line); }
.summary div:first-child { border-left: 0; }
dt { color: var(--muted); font-size: .68rem; } dd { margin: .25rem 0 0; font-weight: 850; }
.workspace { display: grid; grid-template-columns: minmax(240px, 300px) 1fr; gap: 1.2rem; align-items: start; }
.controls { position: sticky; top: 1rem; display: grid; gap: .72rem; padding: 1.2rem; }
.controls label { margin-top: .4rem; font-size: .78rem; font-weight: 800; }
.controls input, .controls select { width: 100%; padding: .7rem; color: var(--text); background: #09182b; }
.controls hr { width: 100%; margin: .65rem 0; border: 0; border-top: 1px solid var(--line); }
.feedback { min-height: 2.4rem; margin: 0; color: var(--muted); font-size: .76rem; line-height: 1.5; }
.feedback.error { color: var(--danger); }
.stage { display: grid; gap: 1.2rem; min-width: 0; }
.graph-panel, .code-panel { padding: 1.2rem; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.section-heading > span { max-width: 330px; color: var(--muted); font-size: .72rem; text-align: right; }
.graph { display: grid; place-items: center; margin-top: 1rem; }
.graph article { width: min(270px, 100%); padding: .9rem; border: 1px solid var(--line); border-radius: 12px; background: #09182b; transition: 160ms ease; }
.graph article.active { border-color: var(--cyan); background: #103448; transform: translateY(-2px); }
.graph article.failed { border-color: var(--danger); background: #321a2a; }
.graph article small, .graph article span { display: block; color: var(--muted); font-size: .68rem; }
.graph article strong { display: block; margin: .35rem 0; }
.arrow, .branches > div > span { padding: .55rem; color: var(--muted); font-size: .7rem; }
.branches { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; gap: .7rem; }
.branches > div { display: grid; place-items: center; min-width: 0; }
.branches article { width: 100%; min-height: 110px; }
.inspectors { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
.inspectors article { min-width: 0; min-height: 225px; padding: 1.2rem; }
pre { overflow: auto; margin: .7rem 0 0; color: #dbe8ff; font: .77rem/1.65 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; }
#resolution-log { display: grid; gap: .45rem; margin: .7rem 0 0; padding: 0; list-style: none; }
#resolution-log li { padding: .55rem .7rem; border-left: 3px solid var(--blue); color: var(--muted); background: #09182b; font: .72rem ui-monospace, monospace; }
#resolution-log li.error { border-color: var(--danger); color: #ffd8dd; }
.tabs { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: 1rem; }
.tabs button[aria-selected="true"] { color: #041219; background: var(--cyan); border-color: var(--cyan); }
#code-view { min-height: 280px; padding: 1rem; border-radius: 10px; background: #06111f; }
@media (max-width: 960px) { .hero, .workspace { grid-template-columns: 1fr; } .controls { position: static; } }
@media (max-width: 650px) { .topbar { flex-direction: column; } .summary, .branches, .inspectors { grid-template-columns: 1fr; } .summary div { border-left: 0; border-top: 1px solid var(--line); } .summary div:first-child { border-top: 0; } .section-heading { align-items: flex-start; flex-direction: column; } .section-heading > span { text-align: left; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }
