:root {
  --aubergine: #3d2438;
  --aubergine-ink: #2a1826;
  --surface: #fbf7f1;
  --surface-2: #f4ede3;
  --rule: #d9cdbe;
  --coral: #a13f30;
  --coral-soft: #eaa392;
  --ink: #241d22;
  --muted: #5f5157;
  --focus: #1f5fa8;
  --sans: "Segoe UI", "Helvetica Neue", Arial, system-ui, sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--surface-2);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.55;
  overflow-x: hidden;
}

img, svg { max-width: 100%; height: auto; }

/* Shared header */
.site-header { background: var(--aubergine); color: #f7efe6; border-bottom: 3px solid var(--coral); }
.header-inner { max-width: 64rem; margin: 0 auto; padding: 0.7rem 1.25rem; display: flex; align-items: baseline; justify-content: space-between; gap: 0.8rem 1.5rem; flex-wrap: wrap; }
.site-header .brand { font-weight: 700; letter-spacing: 0.01em; font-size: 1.05rem; }
.site-header .brand a { color: #fbf3ea; text-decoration: none; }
.site-header .brand a:hover { text-decoration: underline; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.3rem 1.1rem; }
.site-nav a { color: #f2d9cf; text-decoration: none; font-size: 0.95rem; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: #fff; text-decoration: underline; text-underline-offset: 3px; }

/* Shared footer */
.site-footer { background: var(--aubergine-ink); color: #e7d9cf; font-size: 0.9rem; }
.footer-inner { max-width: 64rem; margin: 0 auto; padding: 1.1rem 1.25rem 1.4rem; display: flex; flex-wrap: wrap; gap: 0.6rem 1.6rem; justify-content: space-between; }
.site-footer p { margin: 0; max-width: 34rem; }
.site-footer a { color: #f0c9bc; text-underline-offset: 2px; }
.site-footer a:hover { color: #fff; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.35rem 1rem; }

/* Page surface */
.page { max-width: 60rem; margin: 0 auto; padding: 1.5rem 1.25rem 3rem; background: var(--surface); border-left: 1px solid var(--rule); border-right: 1px solid var(--rule); }
.page.home { padding-top: 1.9rem; }

h1 { font-size: clamp(1.55rem, 1.15rem + 1.7vw, 2.35rem); line-height: 1.18; color: var(--aubergine-ink); margin: 0.4rem 0 0.8rem; font-weight: 650; letter-spacing: -0.01em; }
h2 { font-size: 1.2rem; color: var(--aubergine-ink); margin: 2rem 0 0.55rem; }
h3 { font-size: 1.02rem; margin: 0 0 0.4rem; color: var(--aubergine-ink); }
p { max-width: 44rem; }
a { color: #7a2f4f; text-underline-offset: 2px; }
a:hover { color: var(--aubergine-ink); }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.lede { font-size: 1.06rem; }
.lede-sub { color: var(--muted); }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Home: before / after example */
.example { border-top: 3px solid var(--aubergine); padding-top: 0.35rem; margin-top: 1.8rem; }
.ex-columns { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 46rem) { .ex-columns { grid-template-columns: 1fr 1fr; } }
.ex-panel { margin: 0; background: #fff; border: 1px solid var(--rule); border-radius: 3px; padding: 0.8rem 0.9rem 0.9rem; }
.ex-panel figcaption { font-weight: 650; color: var(--aubergine-ink); margin-bottom: 0.5rem; padding-bottom: 0.35rem; border-bottom: 1px solid var(--rule); }
.ex-before { border-left: 5px solid var(--muted); }
.ex-after { border-left: 5px solid var(--coral); }
.ex-flow { list-style: none; margin: 0 0 0.6rem; padding: 0; display: flex; flex-direction: column; gap: 0.25rem; }
.ex-stage { background: var(--surface); border: 1px solid var(--rule); border-radius: 2px; padding: 0.35rem 0.55rem; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.15rem 0.7rem; }
.ex-name { font-weight: 600; color: var(--aubergine-ink); flex: 1 1 8rem; }
.ex-num { font-size: 0.82rem; color: var(--coral); font-weight: 700; }
.ex-owner { flex-basis: 100%; font-size: 0.78rem; color: var(--muted); }
.ex-stage.is-worst { background: #fdeee8; border-color: var(--coral); }
.ex-stage.is-worst .ex-num { color: #8d3324; }
.ex-gap { font-size: 0.82rem; color: var(--muted); padding-left: 1.1rem; position: relative; }
.ex-gap::before { content: ""; position: absolute; left: 0.35rem; top: 0.15rem; bottom: 0.15rem; width: 2px; background: var(--coral-soft); }
.ex-handoff { height: 0.55rem; margin-left: 1.2rem; border-left: 2px solid var(--coral-soft); position: relative; }
.ex-handoff::after { content: ""; position: absolute; left: -0.28rem; bottom: -0.1rem; width: 0.5rem; height: 0.5rem; border-right: 2px solid var(--coral-soft); border-bottom: 2px solid var(--coral-soft); transform: rotate(45deg); }
.ex-outcome { font-size: 0.9rem; color: var(--muted); margin: 0; }
.ex-bar-caption { margin: 1rem 0 0.3rem; font-size: 0.92rem; }
.ex-bar { display: flex; height: 1.5rem; border: 1px solid var(--aubergine); border-radius: 2px; overflow: hidden; background: #fff; }
.ex-bar-work { background: var(--aubergine); min-width: 3px; }
.ex-bar-wait { background: var(--coral); }
.ex-bar-key { font-size: 0.85rem; color: var(--muted); margin: 0.35rem 0 0; }
.swatch { display: inline-block; width: 0.8rem; height: 0.8rem; border-radius: 1px; vertical-align: -0.1rem; margin: 0 0.25rem 0 0.5rem; }
.swatch-work { background: var(--aubergine); }
.swatch-wait { background: var(--coral); }

/* Home: start + guides */
.start { margin-top: 2rem; background: var(--surface-2); border: 1px solid var(--rule); border-left: 5px solid var(--aubergine); padding: 0.8rem 1rem 1rem; }
.start h2 { margin-top: 0; }
.cta { display: inline-block; background: var(--aubergine); color: #fff; text-decoration: none; font-weight: 600; padding: 0.5rem 1.1rem; border-radius: 2px; border: 1px solid var(--aubergine); }
.cta:hover { background: var(--aubergine-ink); color: #fff; }
.guides { margin-top: 2rem; border-top: 3px solid var(--aubergine); padding-top: 0.35rem; }
.guide-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.guide-list li { background: #fff; border: 1px solid var(--rule); border-left: 4px solid var(--coral-soft); padding: 0.55rem 0.8rem; display: flex; flex-direction: column; gap: 0.1rem; }
.guide-list a { font-weight: 600; }
.guide-note { font-size: 0.88rem; color: var(--muted); }
.origin { margin-top: 2rem; font-size: 0.9rem; color: var(--muted); }

/* Tool page */
.page.tool { padding-top: 1.6rem; }
.notice { border-left: 4px solid var(--coral); background: #fdf1ec; padding: 0.6rem 0.9rem; margin: 1rem 0; }
.how-list { padding-left: 1.3rem; max-width: 46rem; }
.how-list li { margin: 0.4rem 0; }
.unit-note { background: var(--surface-2); border: 1px solid var(--rule); padding: 0.6rem 0.9rem; font-size: 0.95rem; }
#tool { border-top: 3px solid var(--aubergine); padding-top: 0.35rem; margin-top: 2rem; }
fieldset { border: 1px solid var(--rule); border-radius: 3px; padding: 0.9rem 1rem 1.1rem; background: #fff; min-inline-size: 0; }
fieldset:disabled { opacity: 0.72; }
legend { font-weight: 650; color: var(--aubergine-ink); padding: 0 0.4rem; }
.field-hint { color: var(--muted); font-size: 0.9rem; margin: 0.2rem 0 0.8rem; }
.stages { display: grid; gap: 0.6rem; }
.stage { border: 1px solid var(--rule); border-left: 5px solid var(--coral-soft); border-radius: 2px; background: var(--surface); padding: 0.55rem 0.7rem 0.7rem; }
.stage-head { display: flex; align-items: baseline; gap: 0.6rem; justify-content: space-between; flex-wrap: wrap; }
.stage-num { font-family: var(--mono); font-size: 0.85rem; color: var(--aubergine); font-weight: 700; }
.stage-grid { display: grid; grid-template-columns: 1fr; gap: 0.55rem; }
@media (min-width: 34rem) { .stage-grid { grid-template-columns: minmax(8rem, 2fr) minmax(5.5rem, 1fr) minmax(5.5rem, 1fr) minmax(7rem, 1.3fr); } }
.stage-grid label { display: block; font-size: 0.82rem; color: var(--muted); margin-bottom: 0.15rem; }
.stage-grid input { width: 100%; min-width: 0; font-family: var(--mono); font-size: 0.95rem; padding: 0.32rem 0.4rem; border: 1px solid #a89madd; border: 1px solid #a8998a; border-radius: 2px; background: #fff; color: var(--ink); }
.stage-grid input[type="text"] { font-family: var(--sans); }
.stage-grid input[type="number"] { font-variant-numeric: tabular-nums; }
.stage-controls { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; margin: 0.9rem 0 0.2rem; }
.counter-note { font-size: 0.85rem; color: var(--muted); }
.notes-block { margin-top: 1rem; }
.notes-block label { font-weight: 600; display: block; }
textarea { width: 100%; max-width: 100%; font-family: var(--sans); font-size: 0.95rem; padding: 0.4rem 0.5rem; border: 1px solid #a8998a; border-radius: 2px; background: #fff; color: var(--ink); resize: vertical; }
.run-row { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: 1.1rem; }
button { font: inherit; font-size: 0.95rem; padding: 0.42rem 0.9rem; border-radius: 2px; border: 1px solid var(--aubergine); background: #fff; color: var(--aubergine-ink); cursor: pointer; }
button:hover:not(:disabled) { background: var(--surface-2); }
button:disabled { cursor: not-allowed; opacity: 0.6; }
#run { background: var(--aubergine); color: #fff; border-color: var(--aubergine); }
#run:hover:not(:disabled) { background: var(--aubergine-ink); }
#download { border-color: var(--coral); color: #8d3324; }
#download:hover:not(:disabled) { background: #fdf1ec; }
.results { margin-top: 1.25rem; border-top: 1px solid var(--rule); padding-top: 0.6rem; }
.placeholder { color: var(--muted); font-style: italic; }
.result-error { border-left: 4px solid #a3261a; background: #fdf0ee; padding: 0.5rem 0.8rem; }
.result-error h3 { color: #7d1d13; }
.totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); gap: 0.6rem; margin: 0.6rem 0 1rem; }
.total { border: 1px solid var(--rule); background: #fff; padding: 0.5rem 0.7rem; border-radius: 2px; }
.total .k { display: block; font-size: 0.8rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.total .v { display: block; font-family: var(--mono); font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.bar { display: flex; height: 1.6rem; border: 1px solid var(--aubergine); border-radius: 2px; overflow: hidden; margin: 0.4rem 0 0.3rem; background: #fff; }
.bar-seg { height: 100%; display: flex; align-items: center; justify-content: center; font-size: 0.72rem; font-family: var(--mono); color: #fff; overflow: hidden; white-space: nowrap; }
.bar-work { background: var(--aubergine); }
.bar-wait { background: var(--coral); }
.bar-empty { background: #efe6da; color: var(--muted); flex: 1; font-size: 0.78rem; }
.bar-key { font-size: 0.85rem; color: var(--muted); margin: 0 0 0.8rem; }
.bar-key .swatch { vertical-align: -0.1rem; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 0.92rem; background: #fff; }
caption { text-align: left; font-weight: 600; color: var(--aubergine-ink); padding-bottom: 0.3rem; }
th, td { border: 1px solid var(--rule); padding: 0.3rem 0.45rem; text-align: left; vertical-align: top; }
th { background: var(--surface-2); font-weight: 600; }
td.num, th.num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
tfoot td, tfoot th { background: #f7f0e6; font-weight: 600; }
.largest { background: #fdeee8; }
.largest-tag { display: inline-block; font-size: 0.72rem; font-family: var(--mono); background: var(--coral); color: #fff; padding: 0 0.3rem; border-radius: 2px; margin-left: 0.3rem; }
.finding { margin: 0.8rem 0; padding: 0.6rem 0.8rem; background: var(--surface-2); border-left: 4px solid var(--coral); }
.finding h3 { margin-top: 0; }
.export-note { font-size: 0.88rem; color: var(--muted); }
.limits-list { padding-left: 1.2rem; max-width: 46rem; }
.limits-list li { margin: 0.35rem 0; }

/* Article page */
.article-header { border-bottom: 3px solid var(--aubergine); padding-bottom: 0.7rem; margin-bottom: 1.2rem; }
.article-header .kicker { font-family: var(--mono); font-size: 0.82rem; color: var(--coral); text-transform: uppercase; letter-spacing: 0.06em; margin: 0 0 0.3rem; }
.article-header p { color: var(--muted); margin: 0.4rem 0 0; }
.article-body h2 { margin-top: 1.7rem; }
.article-body p, .article-body li { max-width: 44rem; }

/* Small screens */
@media (max-width: 420px) {
  .page { padding: 1.1rem 0.9rem 2.2rem; }
  .header-inner, .footer-inner { padding-left: 0.9rem; padding-right: 0.9rem; }
  h1 { font-size: 1.5rem; }
  .run-row button, .stage-controls button { width: 100%; }
}

/* Coordinator responsive completion of preserved generated source. */
*,*::before,*::after{box-sizing:border-box}img,svg{max-width:100%}input,textarea,select{max-width:100%;min-width:0}fieldset{min-width:0} .header-inner,.footer-inner{flex-wrap:wrap} .site-nav ul{display:flex;flex-wrap:wrap;gap:1rem;list-style:none;padding:0} .skip-link{position:absolute;left:-9999px}.skip-link:focus{left:1rem;top:1rem;z-index:100;background:white;color:black;padding:1rem}article.page.article{max-width:78rem;margin:auto;padding:clamp(1rem,4vw,3rem)}.article-body{max-width:72ch}.article-body p,.article-body li{line-height:1.7}button,a,input,textarea,select{touch-action:manipulation}:focus-visible{outline:3px solid #865600;outline-offset:3px}table{max-width:100%}td,th{overflow-wrap:anywhere}
@media(max-width:680px){.hero,.hero-grid,.tool-layout,.experiment-layout,.workbench,.workspace,.desk-layout,.map-layout,.ba-grid,.gallery,.guide-list,.totals,.result-grid,.results-grid,.two-column,.editorial-grid{grid-template-columns:minmax(0,1fr)!important}.page{min-width:0}.stage-row{flex-wrap:wrap}.site-header .header-inner{display:flex;flex-direction:column;align-items:flex-start}h1{overflow-wrap:anywhere}table{font-size:.85rem}}

.site-header a.brand{color:#fff}.visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.ex-bar-work{flex:13 1 0;color:white}.ex-bar-wait{flex:4780 1 0;color:white}
