/* ==================================================================
   THE LAB (2026-09-16) — the test home page: a guide on the left that
   says where a story lives in the data, and the dials on the right that
   put every knob of the scan in the reporter's hands. Same desk, same
   tokens; every class prefixed `l-` because the explorer's `x-` and the
   map's `m-` mount inside pages that have their own CSS.
   ================================================================== */
body { display: grid; grid-template-rows: auto 1fr; overflow: hidden; }
header .l-tag { font-size: 10px; letter-spacing: .06em; text-transform: none; color: var(--graphite); }
main.l-main { display: grid; grid-template-columns: 24rem minmax(0, 1fr); min-height: 0; }
@media (max-width: 64rem) {
  body { overflow: auto; }
  main.l-main { grid-template-columns: 1fr; grid-template-rows: auto auto; }
  /* Stacked: the conversation grows with its answer instead of scrolling
     inside a box above the cards. */
  .l-guide { max-height: none; border-right: 0; border-bottom: 1px solid var(--rule); }
  .l-log { overflow: visible; }
}

/* --- the guide ---------------------------------------------------- */
.l-guide { display: grid; grid-template-rows: auto 1fr auto; min-height: 0;
  border-right: 1px solid var(--rule); background: var(--leaf); }
.l-guidehead, .l-dialhead { padding: .8rem 1rem .6rem; border-bottom: 1px solid var(--rule); }
.l-guidehead b, .l-dialhead b { display: block; font-family: var(--display); font-weight: 500;
  font-size: 1rem; margin-bottom: .25rem; }
.l-guidehead span, .l-dialhead span { font-size: 11px; line-height: 1.6; color: var(--graphite);
  font-family: var(--body); display: block; max-width: var(--measure); }
.l-log { overflow-y: auto; padding: .8rem 1rem; display: flex; flex-direction: column; gap: .9rem; }
.l-msg { font-family: var(--body); font-size: 12.5px; line-height: 1.6; max-width: 100%; }
.l-msg p { margin: 0 0 .4rem; }
.l-msg-me { align-self: flex-end; background: var(--hl); padding: .5rem .7rem; max-width: 92%; }
.l-msg-guide { border-left: 2px solid var(--mark-here); padding-left: .7rem; }
.l-msg-wait { color: var(--graphite); font-style: italic; }
.l-msg-err { color: var(--red); }
.l-try { display: inline; text-transform: none; letter-spacing: 0; font-size: 12px;
  font-family: var(--body); margin: 0 .3rem .3rem 0; padding: .15rem .5rem; }
.l-looks { list-style: none; margin: .5rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .35rem; }
.l-look { display: grid; grid-template-columns: auto 1fr; gap: .5rem; align-items: start;
  border: 1px solid var(--rule); padding: .4rem .5rem; background: var(--desk); }
.l-look button { font-size: 10px; padding: .2rem .5rem; }
.l-look button.l-ran { background: var(--ink); color: var(--leaf); border-color: var(--ink); }
.l-look .l-what { font-family: var(--mono); font-size: 11px; }
.l-look .l-why { font-size: 11.5px; color: var(--graphite); display: block; }
.l-look a { font-size: 10px; letter-spacing: .06em; text-transform: uppercase; }
.l-nodata { margin: .5rem 0 0; padding: .4rem .6rem; border-left: 2px solid var(--rule);
  font-size: 11.5px; color: var(--graphite); }
.l-nodata b { display: block; font-size: 10px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--graphite); font-weight: 500; margin-bottom: .2rem; }
.l-nodata ul { margin: 0; padding-left: 1rem; }
.l-flag { font-size: 10.5px; color: var(--ochre); }
.l-ask { border-top: 1px solid var(--rule); padding: .6rem 1rem .8rem; display: flex; flex-direction: column; gap: .45rem; }
.l-ask textarea { font: inherit; font-family: var(--body); font-size: 12.5px; color: var(--ink);
  background: var(--desk); border: 1px solid var(--rule); padding: .45rem .55rem; resize: vertical; }
.l-ask textarea:focus { outline: none; border-color: var(--graphite); }
.l-askrow { display: flex; align-items: center; gap: .6rem; }
.l-cost { font-size: 10px; color: var(--graphite); letter-spacing: .05em; margin-right: auto; }

/* --- the dials ---------------------------------------------------- */
.l-work { overflow-y: auto; min-height: 0; }
.l-dials { border-bottom: 1px solid var(--rule); background: var(--leaf); }
.l-panel { padding: .7rem 1.2rem .8rem; border-bottom: 1px solid var(--rule); }
.l-row { display: flex; gap: .7rem 1.1rem; flex-wrap: wrap; align-items: flex-end; margin-bottom: .6rem; }
.l-row:last-child { margin-bottom: 0; }
.l-row-ds { align-items: flex-start; }
.l-lab { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--graphite); padding-top: .2rem; min-width: 5rem; }
.l-checks { display: flex; flex-wrap: wrap; gap: .25rem .5rem; flex: 1; }
.l-checks label { font-size: 11px; display: inline-flex; gap: .3rem; align-items: center;
  border: 1px solid var(--rule); padding: .15rem .45rem; background: var(--desk); cursor: pointer; white-space: nowrap; }
.l-checks label:has(input:checked) { border-color: var(--ink); background: var(--hl); }
.l-checks input { margin: 0; }
.l-ctl { display: flex; flex-direction: column; gap: .2rem; }
.l-ctl > span { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--graphite); }
.l-ctl select, .l-ctl input[type=text], .l-ctl input[type=date] { font: inherit; font-size: 12px; color: var(--ink);
  background: var(--desk); border: 1px solid var(--rule); padding: .25rem .35rem; max-width: 20rem; }
.l-ctl.l-wide select { min-width: 16rem; max-width: 26rem; }
.l-ctl input[type=range] { width: 9rem; accent-color: var(--mark-here); }
.l-ctl output { color: var(--ink); font-weight: 500; }
.l-go { background: var(--ink); color: var(--leaf); border-color: var(--ink); }
.l-go:hover { background: var(--graphite); border-color: var(--graphite); }
.l-more summary { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--graphite);
  cursor: pointer; margin-bottom: .6rem; }
.l-fine { font-family: var(--body); font-size: 11px; color: var(--graphite); line-height: 1.6;
  max-width: var(--measure); margin: .3rem 0 .9rem; }

/* --- the results ---------------------------------------------------- */
.l-results { padding: 1rem 1.2rem 5rem; display: flex; flex-direction: column; gap: 1.2rem; }
.l-empty { color: var(--graphite); font-family: var(--body); font-size: 12.5px; }
.l-card { border: 1px solid var(--rule); background: var(--leaf); padding: .8rem 1rem 1rem; }
.l-card.l-busy { opacity: .6; }
.l-cardtop { display: flex; align-items: baseline; gap: .8rem; flex-wrap: wrap; margin-bottom: .3rem; }
.l-cardtop h2 { font-family: var(--display); font-weight: 500; font-size: 1.05rem; margin: 0; letter-spacing: 0; text-transform: none; }
.l-cardtop .l-sub { font-size: 13px; color: var(--graphite); letter-spacing: .03em; }
.l-cardtop .spacer { margin-left: auto; }
.l-cardtop a, .l-cardtop button { font-size: 10px; }
.l-why { font-family: var(--body); font-size: 11.5px; color: var(--graphite); margin: 0 0 .5rem; }
.l-note { font-family: var(--body); font-size: 11px; line-height: 1.6; color: var(--graphite);
  max-width: 44rem; margin: .6rem 0 0; }
.l-note.l-warn { color: var(--ink); background: var(--tint-fact); border-left: 2px solid var(--ochre); padding: .4rem .6rem; }
.l-err { color: var(--red); font-family: var(--body); font-size: 12px; }

.l-plot { position: relative; }
.l-plot svg { display: block; width: 100%; height: auto; overflow: visible; }
.l-grid { stroke: var(--rule); stroke-width: .5; }
.l-axis { stroke: var(--rule); }
.l-tick { fill: var(--graphite); font-size: 10px; }
.l-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.l-partial { stroke-dasharray: 3 3; }
.l-break { stroke: var(--red); stroke-width: 1; stroke-dasharray: 4 3; }
.l-breaklab { fill: var(--red); font-size: 9.5px; }
.l-dot { stroke: var(--leaf); stroke-width: 2; }
.l-bar { rx: 1; }
.l-barlab { font-size: 10.5px; fill: var(--ink); }
.l-barval { font-size: 10.5px; fill: var(--ink); font-variant-numeric: tabular-nums; }
.l-legend { display: flex; gap: .9rem; flex-wrap: wrap; font-size: 11px; margin: .2rem 0 .5rem; }
.l-legend span { display: inline-flex; align-items: center; gap: .35rem; }
.l-legend i { width: .85rem; border-top: 2px solid currentColor; display: block; }

table.l-table { border-collapse: collapse; font-size: 11.5px; width: 100%; }
.l-scroll { overflow-x: auto; border: 1px solid var(--rule); margin-top: .6rem; max-height: 32rem; overflow-y: auto; }
table.l-table th, table.l-table td { padding: .28rem .5rem; text-align: left; border-bottom: 1px solid var(--rule);
  white-space: nowrap; vertical-align: middle; }
table.l-table th { position: sticky; top: 0; background: var(--desk); font-weight: 500; font-size: 10px;
  letter-spacing: .08em; text-transform: uppercase; color: var(--graphite); }
table.l-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.l-table tr.l-click { cursor: pointer; }
table.l-table tr.l-click:hover td { background: var(--hover); }
table.l-table td.wrap { white-space: normal; min-width: 18rem; font-family: var(--body); }
.l-spark { width: 110px; height: 22px; display: block; }
.l-spark .b { fill: var(--graphite); opacity: .45; }
.l-spark .n { fill: var(--mark-here); }
.l-q { font-size: 10px; letter-spacing: .04em; }
.l-q.ok { color: var(--green); }
.l-q.meh { color: var(--graphite); }
.l-up { color: var(--red); } .l-down { color: var(--blue); }
.l-stats { display: flex; gap: 1.4rem; flex-wrap: wrap; margin: .3rem 0 .6rem; }
.l-stat b { display: block; font-size: 1.3rem; font-weight: 400; font-family: var(--display); }
.l-stat i { font-style: normal; font-size: 10px; letter-spacing: .09em; text-transform: uppercase; color: var(--graphite); }
.l-toggle { border: 0; padding: 0; font-size: 10px; letter-spacing: .08em; color: var(--graphite); text-decoration: underline; }

/* THE ANSWER, first and in the reader's own words; the guide's line about
   where the data lives sits under it in the small type */
.l-answer { font-family: var(--display); font-size: 15px; font-weight: 500; line-height: 1.5; margin: 0 0 .5rem; color: var(--ink); }
.l-answer.l-wait { color: var(--graphite); font-style: italic; font-weight: 400; }
.l-msg-guide > p:not(.l-answer) { font-size: 12px; color: var(--graphite); }
.l-places { font-family: var(--mono); font-size: 10.5px; letter-spacing: .04em; color: var(--graphite); }

.l-lead { font-family: var(--body); font-size: 12px; line-height: 1.6; margin: 0 0 .7rem; max-width: 46rem; }
.l-lead b { font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; font-weight: 500; color: var(--graphite); }

/* The public demo is the lab alone: the header's other pages are not served. */
:root[data-demo="1"] header a.home { display: none; }

/* The demo's opening: no dials, and the starter questions as cards where
   the answers will land. */
:root[data-demo="1"] #dials, :root[data-demo="1"] .l-cost { display: none; }
.l-starters { padding: 2rem 0 0; max-width: 60rem; }
.l-starters h2 { margin: 0 0 .4rem; font: 600 22px/1.3 var(--display); color: var(--ink); }
.l-starters > p { margin: 0 0 1.2rem; font: 14px/1.55 var(--body); color: var(--graphite); }
.l-starter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: .8rem; }
.l-starter {
  display: flex; flex-direction: column; gap: .45rem; text-align: left;
  padding: 1rem 1.1rem; min-height: 6.5rem; cursor: pointer;
  background: var(--leaf); border: 1px solid var(--rule); border-left: 3px solid var(--mark-here);
  text-transform: none; letter-spacing: 0; color: var(--ink);
}
.l-starter:hover, .l-starter:focus-visible { border-color: var(--ink); border-left-color: var(--mark-here); background: var(--hover); }
.l-starter b { font: 600 15.5px/1.35 var(--display); }
.l-starter span { font: 12.5px/1.45 var(--body); color: var(--graphite); }

.l-how { margin-top: .6rem; font-size: 12px; color: var(--graphite); }
.l-how summary { cursor: pointer; font-family: var(--mono); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; }
.l-how[open] summary { margin-bottom: .5rem; }

/* The demo's welcome, where the answers will appear. */
.l-welcome { padding: 1.6rem 0 0; max-width: 58rem; font: 14.5px/1.6 var(--body); color: var(--ink); }
.l-welcome h1 { margin: 0 0 1rem; font: 600 26px/1.3 var(--display); max-width: 36rem; }
.l-welcome h2 { margin: 1.8rem 0 .6rem; font: 600 13px/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--graphite); }
.l-welcome p { margin: 0; max-width: 44rem; }
.l-steps { margin: 0; padding-left: 1.3rem; display: grid; gap: .45rem; max-width: 44rem; }
.l-steps b { font-weight: 600; }
.l-know { margin: 0; padding-left: 1.2rem; display: grid; gap: .3rem; color: var(--graphite); }
.l-starter, .l-starter b, .l-starter span { white-space: normal; overflow-wrap: anywhere; min-width: 0; }

/* The ZIP starter: a card with its own input. */
.l-starter-zip { cursor: default; }
.l-zip { display: flex; gap: .4rem; margin-top: .3rem; }
.l-zip input { flex: 1; min-width: 0; font: 14px var(--body); color: var(--ink); background: var(--desk);
  border: 1px solid var(--rule); padding: .45rem .55rem; }
.l-zip button { padding: .45rem .9rem; }
.l-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* The report-card grid for campuses on a run of F's. */
.l-grid-wrap { overflow-x: auto; margin: .2rem 0 1rem; }
.l-grid-title { margin: 0 0 .5rem; font: 600 14px/1.4 var(--body); color: var(--ink); }
.l-report { border-collapse: collapse; font: 13px/1.3 var(--body); }
.l-report th, .l-report td { padding: .35rem .5rem; text-align: center; border-bottom: 1px solid var(--rule); }
.l-report thead th { font: 500 11px var(--mono); color: var(--graphite); }
.l-report tbody th { text-align: left; font-weight: 500; white-space: nowrap; padding-right: 1rem; }
.l-g { font: 600 13px var(--mono); min-width: 2rem; }
.l-g-F { background: var(--red); color: #fff; }
.l-g-D { background: var(--tint-fact); color: var(--ink); }
.l-g-none { color: var(--graphite); }
.l-g-run { font: 600 13px var(--mono); }
.l-back { align-self: flex-start; text-transform: none; letter-spacing: 0; font: 500 13px var(--body);
  padding: .4rem .8rem; }

/* Chart text at its real size: the charts are drawn at the width they are
   shown at (chartWidth), so these px are px on a phone too. */
@media (max-width: 40rem) {
  .l-barlab, .l-barval, .l-tick { font-size: 11px; }
  .l-results { padding: .8rem .6rem 4rem; }
  .l-card { padding: .9rem .8rem; }
  .l-welcome h1 { font-size: 22px; }
}

/* Stacked layout: the page scrolls as one document. The desktop layout
   fits the window, and on a phone that squeezed the conversation into
   whatever height the cards left it, cutting the answer off mid-sentence. */
@media (max-width: 64rem) {
  html, body { height: auto; }
  body { display: block; overflow: visible; }
  main.l-main { display: block; min-height: 0; }
  .l-guide { display: block; }
  .l-work { overflow: visible; }
}

/* The loading panel that stands where the examples were. */
.l-loading { padding: 2.4rem 0 0; max-width: 40rem; }
.l-loading-q { margin: 0 0 1.4rem; font: 600 22px/1.35 var(--display); color: var(--ink); }
.l-loading-steps { margin: 0; padding: 0; list-style: none; display: grid; gap: .8rem; font: 15px/1.4 var(--body); }
.l-loading-steps li { display: flex; align-items: center; gap: .7rem; color: var(--graphite); }
.l-loading-steps li::before { content: ''; width: .75rem; height: .75rem; border-radius: 50%;
  border: 2px solid var(--rule); flex: none; }
.l-loading-steps li.on { color: var(--ink); }
.l-loading-steps li.on::before { border-color: var(--mark-here); border-top-color: transparent; animation: l-spin .9s linear infinite; }
.l-loading-steps li.done { color: var(--ink); }
.l-loading-steps li.done::before { background: var(--mark-here); border-color: var(--mark-here); }
@keyframes l-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .l-loading-steps li.on::before { animation: none; border-top-color: var(--mark-here); } }
