:root {
  --ink: #07111f;
  --ink-2: #0b192b;
  --ink-3: #13253a;
  --paper: #f6f5f0;
  --white: #ffffff;
  --blue: #82d8ff;
  --pink: #ff8fbd;
  --green: #74e0b1;
  --amber: #ffd37a;
  --muted: #9cabbc;
  --dark-muted: #647181;
  --line: rgba(255, 255, 255, .14);
  --paper-line: rgba(7, 17, 31, .14);
  --mono: "DM Mono", monospace;
  --sans: "Manrope", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: var(--sans); line-height: 1.6; }
button, input, select { font: inherit; }
button, select, input[type="range"] { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--pink); outline-offset: 4px; }
.lab-shell { width: min(1240px, calc(100% - 48px)); margin-inline: auto; }
.skip-link { position: fixed; z-index: 100; left: 12px; top: -100px; padding: 10px 15px; background: white; color: var(--ink); }
.skip-link:focus { top: 12px; }
.eyebrow { margin: 0 0 14px; color: #718195; font: 500 .7rem/1.4 var(--mono); letter-spacing: .14em; text-transform: uppercase; }

.lab-header { color: white; background: var(--ink); }
.nav { min-height: 78px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 12px; color: white; text-decoration: none; font-weight: 800; letter-spacing: -.02em; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid rgba(255,255,255,.32); border-radius: 11px; background: rgba(255,255,255,.06); font: 500 .75rem var(--mono); }
.nav-actions { display: flex; align-items: center; gap: 28px; }
.nav-actions a { color: #c3cfdb; font-size: .82rem; font-weight: 700; text-decoration: none; }
.nav-actions a:last-child { padding: 9px 16px; border: 1px solid rgba(255,255,255,.32); border-radius: 99px; color: white; }
.nav-actions a:hover { color: var(--blue); }

.lab-hero { min-height: 440px; display: grid; grid-template-columns: 1fr .52fr; gap: 80px; align-items: center; color: white; }
.lab-hero::before { content: ""; position: absolute; z-index: -2; inset: 78px 0 auto; height: 440px; background: radial-gradient(circle at 78% 45%, rgba(130,216,255,.14), transparent 27%), linear-gradient(130deg, #07111f, #0a192b); }
.lab-hero::after { content: ""; position: absolute; z-index: -1; inset: 78px 0 auto; height: 440px; opacity: .08; background-image: linear-gradient(rgba(255,255,255,.12) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.12) 1px, transparent 1px); background-size: 55px 55px; }
.lab-hero h1 { max-width: 810px; margin: 0 0 25px; font-size: clamp(3.4rem, 6vw, 6.4rem); line-height: .98; letter-spacing: -.065em; }
.lab-hero h1 em { color: var(--blue); font-family: Georgia, serif; font-weight: 400; }
.hero-copy { max-width: 720px; margin: 0; color: #b5c2d1; font-size: 1.05rem; }
.lab-hero .eyebrow { color: var(--pink); }
.hero-badge { display: grid; gap: 7px; align-self: center; padding: 24px; border: 1px solid var(--line); border-radius: 12px; background: rgba(17,35,54,.7); box-shadow: 0 25px 70px rgba(0,0,0,.25); backdrop-filter: blur(12px); }
.hero-badge span { color: var(--green); font: .65rem var(--mono); letter-spacing: .1em; }
.hero-badge strong { font-size: .92rem; }
.hero-badge small { color: #8292a5; }

.simulator { margin-block: 80px 110px; }
.noscript-note { margin: 0 0 18px; padding: 14px 16px; border: 1px solid #d66b99; border-radius: 6px; background: #fff3f8; color: #5c2940; font-size: .88rem; }
.control-bar { display: grid; grid-template-columns: 1fr 1.2fr auto; gap: 24px; align-items: end; padding: 24px; border: 1px solid var(--paper-line); background: white; box-shadow: 0 18px 45px rgba(22,37,53,.08); }
.control-group { display: grid; gap: 8px; }
.control-group label, #nodeForm label { color: #4c5b6b; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.control-group output, #nodeForm output { color: var(--ink); font-family: var(--mono); }
select, input[type="text"] { width: 100%; min-height: 45px; padding: 0 12px; border: 1px solid #c9cfd5; border-radius: 4px; color: var(--ink); background: #fafafa; }
input[type="range"] { width: 100%; accent-color: #258dc0; }
.button-cluster { display: flex; gap: 10px; }
.button { min-height: 46px; padding: 0 19px; border: 0; border-radius: 4px; font-size: .78rem; font-weight: 800; transition: transform .2s, background .2s; }
.button:hover { transform: translateY(-2px); }
.button-primary { color: var(--ink); background: var(--blue); }
.button-secondary { border: 1px solid #c5ccd4; background: white; }
.button-optimize { min-width: 190px; color: var(--ink); background: var(--pink); }
.button:disabled { cursor: not-allowed; opacity: .45; transform: none; }
.scenario-description { max-width: 790px; margin: 18px 0 25px; color: #697584; font-size: .9rem; }

.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--paper-line); border-bottom: 0; background: #eae9e4; }
.kpi-grid article { min-height: 130px; display: grid; align-content: center; padding: 23px; border-right: 1px solid var(--paper-line); }
.kpi-grid article:last-child { border-right: 0; }
.kpi-grid span { color: #6e7985; font: .64rem var(--mono); text-transform: uppercase; }
.kpi-grid strong { margin: 5px 0 0; font-size: 2rem; letter-spacing: -.04em; }
.kpi-grid small { color: #8b949e; font-size: .7rem; }

.workspace-grid { display: grid; grid-template-columns: minmax(0, 1fr) 280px; border: 1px solid var(--paper-line); background: var(--ink); }
.canvas-panel { min-width: 0; padding: 26px; border-right: 1px solid var(--line); color: white; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.panel-heading h2, .inspector h2 { margin: 0; font-size: 1.25rem; }
.canvas-panel .eyebrow, .inspector .eyebrow { margin-bottom: 5px; color: #728397; }
.icon-button { padding: 7px 11px; border: 1px solid var(--line); border-radius: 4px; background: transparent; color: #9cabbc; font: .64rem var(--mono); }
.svg-wrap { width: 100%; min-height: 390px; display: grid; place-items: center; overflow: hidden; background: radial-gradient(circle at center, rgba(130,216,255,.09), transparent 55%), linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px); background-size: auto, 40px 40px, 40px 40px; }
#workflowSvg { width: 100%; height: auto; overflow: visible; }
.edge { fill: none; stroke: #30445a; stroke-width: 4; }
.edge-glow { fill: none; stroke: rgba(130,216,255,.15); stroke-width: 11; }
.flow-token { fill: var(--blue); filter: drop-shadow(0 0 5px rgba(130,216,255,.85)); }
.flow-paused .flow-token { display: none; }
.node { cursor: pointer; }
.node rect { fill: #122337; stroke: #3c5067; stroke-width: 2; rx: 9; transition: fill .2s, stroke .2s; }
.node:hover rect, .node.selected rect { stroke: var(--blue); }
.node.warning rect { stroke: var(--amber); }
.node.bottleneck rect { fill: #321b2b; stroke: var(--pink); filter: drop-shadow(0 0 10px rgba(255,143,189,.35)); }
.node.automated rect { fill: #102c2a; stroke: var(--green); }
.node-title { fill: white; font: 700 14px var(--sans); }
.node-meta { fill: #8191a3; font: 10px var(--mono); }
.node-queue { fill: var(--pink); }
.legend { display: flex; flex-wrap: wrap; gap: 18px; padding-top: 16px; border-top: 1px solid var(--line); color: #8292a4; font: .6rem var(--mono); }
.legend span { display: flex; align-items: center; gap: 7px; }
.legend i { width: 8px; height: 8px; border-radius: 50%; background: #3c5067; }.legend .legend-warning { background: var(--amber); }.legend .legend-problem { background: var(--pink); }.legend .legend-automated { background: var(--green); }

.inspector { padding: 26px; color: white; background: #091522; }
.inspector-help { margin-top: 12px; color: #8292a4; font-size: .82rem; }
#nodeForm { display: grid; gap: 10px; margin-top: 25px; }
#nodeForm[hidden] { display: none; }
#nodeForm input[type="range"] { margin-bottom: 10px; }
.node-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.node-stats div { padding: 9px; background: #122337; }
.node-stats span { display: block; color: #738599; font: .56rem var(--mono); text-transform: uppercase; }
.node-stats strong { font-size: .82rem; }

.diagnosis-panel { display: grid; grid-template-columns: 1fr auto; gap: 50px; align-items: center; padding: 40px; border: 1px solid var(--paper-line); border-top: 0; background: white; }
.diagnosis-panel h2 { margin: 0 0 10px; font-size: clamp(1.8rem, 3vw, 2.8rem); letter-spacing: -.04em; }
.diagnosis-panel p { max-width: 760px; margin-bottom: 8px; color: #647181; }
.diagnosis-panel .eyebrow { margin-bottom: 8px; }
#diagnosisRecommendation { color: #26384b; font-weight: 700; }
.diagnosis-action { display: grid; justify-items: center; gap: 11px; }
.text-button { border: 0; background: none; color: #40556c; font-size: .72rem; text-decoration: underline; }
#shareStatus { min-height: 18px; color: #607080; font-size: .68rem; }

.comparison { padding: 45px; border: 1px solid var(--paper-line); border-top: 0; background: #deddd7; }
.comparison[hidden] { display: none; }
.comparison-heading { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 50px; align-items: end; }
.comparison-heading .eyebrow { grid-column: 1 / -1; margin: 0; }
.comparison-heading h2 { margin: 0; font-size: 2.5rem; letter-spacing: -.05em; }
.comparison-heading p { margin: 0; color: #687381; font-size: .8rem; }
.change-list { display: grid; gap: 8px; margin: 30px 0; padding-left: 20px; color: #3d4b59; font-size: .86rem; }
.comparison-table-wrap, .table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: 13px 15px; border-bottom: 1px solid var(--paper-line); white-space: nowrap; }
th { color: #687482; font: .61rem var(--mono); text-transform: uppercase; }
td { font-size: .8rem; }
.improved { color: #087d60; font-weight: 800; }
.accessible-results { border: 1px solid var(--paper-line); border-top: 0; background: white; }
.accessible-results summary { cursor: pointer; padding: 18px 25px; font-size: .8rem; font-weight: 800; }
.accessible-results .table-wrap { padding: 0 25px 25px; }
.sr-status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

.explainer { padding-bottom: 115px; }
.explainer > header { display: grid; grid-template-columns: .35fr 1fr; gap: 40px; align-items: start; margin-bottom: 50px; }
.explainer > header .eyebrow { margin-top: 13px; }
.explainer > header h2 { max-width: 800px; margin: 0; font-size: clamp(2.4rem, 4.5vw, 4.6rem); line-height: 1.08; letter-spacing: -.055em; }
.explainer-grid { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--paper-line); }
.explainer-grid section { min-height: 230px; padding: 25px 20px 20px 0; border-right: 1px solid var(--paper-line); }
.explainer-grid section:not(:first-child) { padding-left: 20px; }
.explainer-grid section:last-child { border-right: 0; }
.explainer-grid span { color: #97a0aa; font: .65rem var(--mono); }
.explainer-grid h3 { margin: 45px 0 8px; font-size: 1rem; }
.explainer-grid p { color: #687482; font-size: .82rem; }
.faq { max-width: 880px; margin: 100px auto 0; }
.faq h2 { margin: 0 0 25px; font-size: 2.7rem; letter-spacing: -.05em; }
.faq details { border-top: 1px solid var(--paper-line); }
.faq details:last-child { border-bottom: 1px solid var(--paper-line); }
.faq summary { cursor: pointer; padding: 19px 0; font-weight: 800; }
.faq details p { padding: 0 0 20px; color: #637080; }

.lab-footer { padding: 30px 0; color: #8695a7; background: #050d17; font-size: .75rem; }
.lab-footer .lab-shell { display: flex; justify-content: space-between; gap: 20px; }
.lab-footer p { margin: 0; }
.lab-footer a { color: #c6d2de; }

@media (max-width: 960px) {
  .lab-hero { grid-template-columns: 1fr; gap: 30px; padding-block: 70px; }
  .hero-badge { max-width: 500px; }
  .control-bar { grid-template-columns: 1fr 1fr; }.button-cluster { grid-column: 1 / -1; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }.kpi-grid article:nth-child(2) { border-right: 0; }.kpi-grid article:nth-child(-n+2) { border-bottom: 1px solid var(--paper-line); }
  .workspace-grid { grid-template-columns: 1fr; }.canvas-panel { border-right: 0; border-bottom: 1px solid var(--line); }.inspector { min-height: 250px; }
  .explainer-grid { grid-template-columns: 1fr 1fr; }.explainer-grid section:nth-child(2) { border-right: 0; }.explainer-grid section:nth-child(-n+2) { border-bottom: 1px solid var(--paper-line); }
}

@media (max-width: 650px) {
  .lab-shell { width: min(100% - 28px, 1240px); }.nav { min-height: 68px; }.nav-actions a:first-child { display: none; }
  .lab-hero::before, .lab-hero::after { top: 68px; height: 520px; }.lab-hero { min-height: 520px; }.lab-hero h1 { font-size: 3.35rem; }
  .simulator { margin-block: 55px 85px; }.control-bar { grid-template-columns: 1fr; padding: 18px; }.button-cluster { grid-column: auto; }.button-cluster .button { flex: 1; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }.kpi-grid article { min-height: 115px; padding: 17px; }.kpi-grid strong { font-size: 1.45rem; }
  .canvas-panel { padding: 16px; }.svg-wrap { min-height: 305px; overflow-x: auto; }.svg-wrap svg { min-width: 760px; }.legend { gap: 10px; }
  .diagnosis-panel { grid-template-columns: 1fr; padding: 27px; gap: 25px; }.diagnosis-action { justify-items: stretch; }.comparison { padding: 27px 18px; }.comparison-heading { grid-template-columns: 1fr; }.comparison-heading .eyebrow { grid-column: auto; }
  .explainer > header { grid-template-columns: 1fr; gap: 5px; }.explainer-grid { grid-template-columns: 1fr; }.explainer-grid section, .explainer-grid section:not(:first-child) { min-height: auto; padding: 24px 0; border-right: 0; border-bottom: 1px solid var(--paper-line); }.explainer-grid h3 { margin-top: 20px; }
  .lab-footer .lab-shell { flex-direction: column; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .flow-token { display: none; }
}
