/* Afterglow site: one light system around the silicon-navy cell. Archivo only, tabular figures,
   white surfaces on a pale ground separated by tone, hairlines only inside tables, no gradients or shadows.
   The print rules at the end are unchanged: printed passports and QR cards depend on them. */

@font-face { font-family: "Archivo"; src: url("../vendor/fonts/Archivo-Variable.ttf") format("truetype"); font-weight: 100 900; font-stretch: 62% 125%; font-style: normal; font-display: swap; }
@font-face { font-family: "Archivo"; src: url("../vendor/fonts/Archivo-Italic-Variable.ttf") format("truetype"); font-weight: 100 900; font-stretch: 62% 125%; font-style: italic; font-display: swap; }

:root {
  --cell: #15224a; --cell-deep: #0e1838;
  --ink: #1d2433; --ink-2: #5b6677; --ink-3: #6b7587;
  --busbar: #c6ccd6; --busbar-2: #e0e4ea;
  --page: #e8ecf1; --surface: #fbfcfd;
  --sun: #f2b705;
  --pair-a: #b8860b; --pair-b: #2f55a4; --pair-c: #1f9e4a;
  --film: rgba(52, 38, 22, 0.55);
  --alert: #b3261e; --focus: #2f55a4;
  --radius: 6px;
  --rule: #d5dae2;
  --font: "Archivo", "Helvetica Neue", Arial, sans-serif;
  /* type: two sizes do the visible work on any screen */
  --display: clamp(2.4rem, 6.5vw, 6rem);
  --title: clamp(1.6rem, 2.6vw, 2rem);
  --page-title: clamp(2rem, 3.4vw, 2.6rem);
  --body: 17px;
  --label: 0.8rem;
  --measure: 66ch;
  /* space */
  --gutter: 24px;
  --section: clamp(64px, 10vw, 160px);
  --wrap: 1080px;
}
@media (max-width: 480px) { :root { --gutter: 16px; } }

* { box-sizing: border-box; }
html { font-size: clamp(var(--body), 0.95vw, 19px); -webkit-text-size-adjust: 100%; }   /* a little larger on big screens */
body { margin: 0; background: var(--page); color: var(--ink); font-family: var(--font); font-size: 1rem; line-height: 1.5; font-variant-numeric: tabular-nums; }
h1, h2, h3, p, dl, dd, dt, ul, ol, figure { margin: 0; }
a { color: var(--cell); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.14em; text-decoration-color: var(--busbar); }
a:hover { text-decoration-color: var(--cell); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* type */
.display { font-size: var(--display); font-weight: 700; font-stretch: 112.5%; letter-spacing: -0.03em; line-height: 0.95; color: var(--cell); text-wrap: balance; }
.title { font-size: var(--title); font-weight: 700; font-stretch: 108%; letter-spacing: -0.015em; line-height: 1.1; color: var(--cell); text-wrap: balance; }
.page-title { font-size: var(--page-title); font-weight: 700; font-stretch: 112.5%; letter-spacing: -0.025em; line-height: 1; color: var(--cell); margin-bottom: 12px; }
.lede { font-size: 1.06rem; color: var(--ink-2); max-width: var(--measure); margin-bottom: 24px; }
.label { font-size: var(--label); font-stretch: 88%; color: var(--ink-2); }
/* one word drawn as an outline in amber (after the Lando Norris site's hollowed words) */
.hollow { color: transparent; -webkit-text-stroke: 0.035em var(--sun); paint-order: stroke fill; }
.num-big { font-size: var(--display); font-weight: 700; font-stretch: 112.5%; letter-spacing: -0.03em; line-height: 1; color: var(--cell); }
.muted { color: var(--ink-2); }
.small { font-size: 0.88rem; }

/* layout */
/* the nav: the ui-refresh branch's own lines (site.css 25-29, 206-210, 352-358 there), copied verbatim; test/house.test.js checks they stay so */
.nav { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 14px 24px; background: var(--surface); border-bottom: 1px solid var(--busbar); }
.nav__name { font-weight: 700; font-stretch: 118%; color: var(--cell); text-decoration: none; font-size: 1.25rem; }
.nav__links { display: flex; gap: 18px; }
.nav__links a { color: var(--ink-2); text-decoration: none; padding: 4px 0; border-bottom: 2px solid transparent; }
.nav__links a.is-on { color: var(--cell); border-bottom-color: var(--cell); }
.nav { position: sticky; top: 0; z-index: 5; padding: 16px 28px; }
.nav__name { font-size: 1.35rem; }
.nav__links { gap: 22px; }
.nav__links a { font-weight: 500; }
.nav__links a:hover { color: var(--cell); }
.nav { transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.5s cubic-bezier(0.2, 0.8, 0.2, 1); }
.nav__name { display: inline-flex; align-items: center; }
.nav__sun { --p: 0; flex: none; width: 17px; height: 17px; margin-right: 10px; border-radius: 50%; background: conic-gradient(var(--sun) calc(var(--p) * 360deg), var(--busbar-2) 0); box-shadow: inset 0 0 0 2px var(--cell); }
body.has-hero .nav { position: fixed; left: 0; right: 0; top: 0; }
body.has-hero .nav.is-tucked { transform: translateY(-100%); opacity: 0; pointer-events: none; }
body.has-hero .view { padding-top: 0; }
.view { max-width: var(--wrap); margin: 0 auto; padding: 36px var(--gutter) 64px; }
/* the front page lays out its own full-width sections and ends with its own close */
body[data-page="front"] .view { max-width: none; padding: 0; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding-inline: var(--gutter); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.stack { display: grid; gap: 12px; }

/* surfaces: white blocks on the pale ground, told apart by tone */
.card { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 22px 24px; }
.card + .card { margin-top: 16px; }
.card h2 { font-size: 1.1rem; font-weight: 700; font-stretch: 106%; letter-spacing: -0.01em; color: var(--cell); margin-bottom: 10px; }
.legend { font-size: 0.88rem; color: var(--ink-2); max-width: 72ch; margin-top: 12px; }
details.tools summary { cursor: pointer; font-size: 1.1rem; font-weight: 700; font-stretch: 106%; color: var(--cell); list-style: none; }
details.tools summary::-webkit-details-marker { display: none; }
details.tools summary::before { content: "+"; display: inline-block; width: 1.1em; color: var(--ink-3); font-weight: 500; }
details.tools[open] summary::before { content: "–"; }
details.tools[open] summary { margin-bottom: 10px; }
/* the one numeral on a page sits in a navy field */
.band { background: var(--cell); color: #fff; border-radius: var(--radius); padding: 36px 28px; }
.band__num { font-size: var(--display); font-weight: 700; font-stretch: 112.5%; letter-spacing: -0.03em; line-height: 1; color: var(--sun); }
.band__text { color: rgba(255, 255, 255, 0.84); max-width: var(--measure); margin-top: 14px; font-size: 1.06rem; }
.band__note { color: rgba(255, 255, 255, 0.64); max-width: var(--measure); margin-top: 10px; font-size: 0.9rem; }
.band a { color: #fff; text-decoration-color: rgba(255, 255, 255, 0.5); }

/* controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px; background: var(--surface); color: var(--cell); border: 1px solid var(--busbar); border-radius: var(--radius); font-size: 0.95rem; font-weight: 600; font-stretch: 104%; line-height: 1.2; cursor: pointer; text-decoration: none; }
.btn:hover { border-color: var(--cell); }
.btn--primary { background: var(--cell); color: #fff; border-color: var(--cell); }
.btn--primary:hover { background: var(--cell-deep); border-color: var(--cell-deep); }
.btn--quiet { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn--quiet:hover { color: var(--cell); border-color: transparent; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.link-grow { position: relative; text-decoration: none; color: var(--cell); font-weight: 600; }
.link-grow::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; background: var(--cell); transform: scaleX(0); transform-origin: left center; }
.link-grow:hover::after, .link-grow:focus-visible::after { transform: scaleX(1); }
.field { display: grid; gap: 3px; font-size: var(--label); color: var(--ink-3); font-stretch: 88%; }
.field input, .field select, .field textarea { font-stretch: 100%; font-size: 0.95rem; color: var(--ink); border: 1px solid var(--busbar); border-radius: var(--radius); padding: 8px 10px; background: var(--surface); }
.field textarea { min-height: 110px; font-family: ui-monospace, Menlo, monospace; font-size: 0.82rem; }
.status { font-size: 0.9rem; color: var(--ink-2); }
.status.is-bad { color: var(--alert); }

/* tables keep their hairlines */
.table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.table th, .table td { text-align: left; padding: 10px 10px; border-bottom: 1px solid var(--busbar-2); vertical-align: middle; }
.table th { color: var(--ink-3); font-weight: 500; font-size: var(--label); font-stretch: 88%; }
.table td.num, .table th.num { text-align: right; }
.table a { text-decoration: none; font-weight: 600; }
.table a:hover { text-decoration: underline; }
.grade { display: inline-block; min-width: 1.6em; text-align: center; font-weight: 700; font-stretch: 112%; }
.grade.g-A { color: var(--cell); } .grade.g-B { color: var(--ink-2); } .grade.g-C { color: var(--ink-3); }
.pair-A { color: var(--pair-a); } .pair-B { color: var(--pair-b); } .pair-C { color: var(--pair-c); }

/* the cell, at three sizes: a drawing, a card, a chip */
.cell-svg { width: 100%; height: auto; display: block; }
.cell-name { fill: #fff; font-weight: 600; font-size: 12px; }
.chipcell { display: inline-grid; justify-items: center; gap: 4px; width: 60px; }
.chipcell .cell-svg { width: 48px; }
.chipcell__id { font-size: 0.72rem; font-stretch: 92%; font-weight: 600; color: var(--cell); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chipcell.is-weak .chipcell__id { color: var(--ink-3); }
.wire { display: inline-block; width: 14px; height: 2px; background: var(--cell); margin-top: 16px; flex: none; }

/* passport */
.passport { display: grid; grid-template-columns: minmax(240px, 320px) 1fr; gap: 32px; align-items: start; }
.passport__visual { display: grid; gap: 16px; }
.passport__qr { max-width: 220px; }
.passport__qr svg { width: 100%; height: auto; display: block; }
.passport__id { font-size: 2.2rem; font-weight: 700; font-stretch: 112.5%; color: var(--cell); letter-spacing: -0.03em; line-height: 1; overflow-wrap: anywhere; }
.passport__grade-line { display: flex; align-items: baseline; gap: 14px; margin: 8px 0 20px; }
.passport__grade { font-size: 3.4rem; font-weight: 700; font-stretch: 112.5%; letter-spacing: -0.03em; line-height: 1; }
.facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 24px; }
.facts div { display: grid; gap: 2px; padding-bottom: 10px; border-bottom: 1px solid var(--busbar-2); }
.facts dt { font-size: var(--label); font-stretch: 88%; color: var(--ink-3); }
.facts dd { font-size: 1.15rem; font-weight: 600; }
.facts dd.small { font-size: 0.9rem; font-weight: 400; color: var(--ink-2); }
.flags { margin-top: 16px; }
.flags li { list-style: none; padding: 8px 12px; border-left: 3px solid var(--pair-a); background: var(--page); margin-top: 6px; font-size: 0.95rem; }

/* printable passport cards (#/print): four to a sheet; the card border is the cut line */
.sheet { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.sheet + .sheet { margin-top: 16px; padding-top: 16px; border-top: 1px dashed var(--busbar); }
.pcard { background: var(--surface); border: 1px solid var(--busbar); border-radius: var(--radius); padding: 16px 18px; display: grid; gap: 12px; align-content: start; break-inside: avoid; page-break-inside: avoid; }
.pcard__top { display: flex; align-items: center; gap: 12px; }
.pcard__top .cell-svg { width: 52px; flex: none; }
.pcard__id { flex: 1; font-size: 1.6rem; font-weight: 700; font-stretch: 112%; color: var(--cell); letter-spacing: -0.01em; line-height: 1; overflow-wrap: anywhere; }
.pcard__grade { font-size: 2.4rem; font-weight: 700; font-stretch: 112%; line-height: 1; }
.pcard__body { display: grid; grid-template-columns: 128px 1fr; gap: 14px; align-items: start; }
.pcard__qr svg { width: 100%; height: auto; display: block; }
.pcard__facts { display: grid; gap: 6px; }
.pcard__facts div { display: grid; padding-bottom: 4px; border-bottom: 1px solid var(--busbar-2); }
.pcard__facts dt { font-size: 0.74rem; font-stretch: 88%; color: var(--ink-3); }
.pcard__facts dd { font-size: 1rem; font-weight: 600; }
.pcard__facts dd.small { font-size: 0.85rem; font-weight: 400; color: var(--ink-2); }
.pcard__foot { border-top: 1px solid var(--busbar-2); padding-top: 8px; }
.pcard__url { font-family: ui-monospace, Menlo, monospace; font-size: 0.72rem; color: var(--ink-3); overflow-wrap: anywhere; }

/* builder */
.pool { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.pool label { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--busbar-2); border-radius: var(--radius); font-size: 0.92rem; cursor: pointer; background: var(--surface); }
.pool label .cell-svg { width: 36px; flex: none; }
.pool label.is-on { border-color: var(--cell); }
.pool input { accent-color: var(--cell); }
.pool__text { display: grid; gap: 1px; min-width: 0; }
.groups { display: grid; gap: 14px; }
.group { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.group__string { display: flex; align-items: flex-start; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 12px 0 18px; }
.stat { padding: 14px 16px; border: 1px solid var(--busbar-2); border-radius: var(--radius); }
.stat b { display: block; font-size: 1.6rem; font-weight: 700; font-stretch: 110%; letter-spacing: -0.02em; color: var(--cell); }
.stat span { font-size: 0.85rem; color: var(--ink-2); }
.verdict { padding: 10px 12px; border-radius: var(--radius); background: var(--page); font-size: 0.95rem; margin-top: 12px; }
.verdict.is-good { border-left: 3px solid var(--pair-c); }
.verdict.is-bad { border-left: 3px solid var(--alert); }

@media (max-width: 760px) {
  .passport { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr; }
  /* a wide table scrolls inside its card instead of stretching the whole page sideways */
  .card { overflow-x: auto; }
  .table { font-size: 0.9rem; }
  .table th, .table td { padding: 8px 7px; white-space: nowrap; }
  .table td.small { white-space: normal; min-width: 14em; }
  /* on a phone the reader has just scanned the card: keep the cell and the QR on one row so the ID and grade show sooner */
  .passport__visual { grid-template-columns: 1fr 1fr; align-items: center; gap: 12px 16px; }
  .passport__visual > p { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .sheet { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .nav { padding: 12px 16px; gap: 12px; }
  .nav { padding: 12px 16px 8px; flex-wrap: wrap; row-gap: 6px; }
  .nav__name { font-size: 1.15rem; white-space: nowrap; }
  .nav__links { gap: 12px; font-size: 0.92rem; }
  .nav__links a { white-space: nowrap; }
  .nav__links { flex-wrap: wrap; row-gap: 4px; }   /* let the links wrap rather than run past the edge */
  .view { padding: 24px var(--gutter) 48px; }
  .card { padding: 16px 14px; }
  .band { padding: 28px 20px; }
}
@page { margin: 12mm; }
@media print {
  .nav, .foot, .no-print { display: none !important; }
  .nav { position: static; }
  body { background: #fff; }
  .view { padding: 0; }
  .card { border: 0; }
  /* passport cards: one sheet per page, two columns and two rows whatever the paper width */
  .sheet, .sheet + .sheet { grid-template-columns: repeat(2, 1fr); gap: 8mm; margin: 0; padding: 0; border: 0; break-after: page; page-break-after: always; }
  .sheet:last-child { break-after: auto; page-break-after: auto; }
  .pcard { background: #fff; border-color: var(--ink-3); }
  .pcard__body { grid-template-columns: 38mm 1fr; }
}

/* passport context: what the page is, and this panel against the others in its run */
.passport-intro { margin-bottom: 16px; }
.batch { list-style: none; padding: 0; display: grid; gap: 8px; margin-top: 4px; max-width: 720px; }
.batch__row { display: grid; grid-template-columns: 5.5em 1fr 3em 1.6em; gap: 10px; align-items: center; font-size: 0.92rem; }
.batch__id { overflow-wrap: anywhere; text-decoration: none; font-weight: 600; }
.batch__row.is-me .batch__id { color: var(--cell); font-weight: 700; }
.batch__pct { text-align: right; color: var(--ink-2); }
.batch__row.is-me .batch__pct { color: var(--ink); font-weight: 600; }
.batch__track { position: relative; height: 12px; background: var(--page); border-radius: var(--radius); }
/* the grade cutoffs at 75% and 90% cross every track */
.batch__track::before, .batch__track::after { content: ""; position: absolute; top: -3px; bottom: -3px; width: 1px; background: var(--ink-3); opacity: 0.6; }
.batch__track::before { left: 75%; }
.batch__track::after { left: 90%; }
.batch__bar { display: block; height: 100%; background: var(--busbar); border-radius: var(--radius); }
.batch__row.is-me .batch__bar { background: var(--cell); }
.batch__scale { font-size: 0.74rem; color: var(--ink-3); margin-top: -4px; }
.batch__bands { display: flex; }
.batch__bands span { text-align: center; }
.batch__note { margin-top: 12px; max-width: 70ch; }
.batch__note b { color: var(--ink); }
@media print {
  /* a printed passport is one page: print viewports are ~725px wide, so undo the phone layout the 760px query applies */
  .passport { grid-template-columns: 52mm 1fr; gap: 6mm; }
  .passport.card, .batch-card { padding: 0; }
  .card + .batch-card { margin-top: 5mm; }
  .passport__visual { grid-template-columns: 1fr; gap: 3mm; }
  .passport__visual > p { grid-column: auto; }
  .facts { grid-template-columns: repeat(2, 1fr); }
  .passport-intro { margin-bottom: 3mm; }
  .batch-card { break-inside: avoid; page-break-inside: avoid; }
  .batch__bar, .batch__track { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}
@media print {
  /* printed passports and cards keep the type metrics they were checked with before the redesign's larger screen type */
  html { font-size: 16px; }
  body { line-height: 1.45; }
  .passport__id { font-size: 1.9rem; }
  .passport__grade { font-size: 3.2rem; }
  .facts { gap: 12px 24px; }
  .facts div { padding-bottom: 8px; }
  .facts dd { font-size: 1.1rem; }
}

/* ---------- from the ui-refresh branch, under this system's tokens: demo labelling, passport navigation, the builder's
   use-and-sizing form, the Impact comparison, grades as badges ---------- */
.tag { display: inline-block; vertical-align: middle; font-size: 0.74rem; font-weight: 600; font-stretch: 95%; padding: 2px 8px; border-radius: var(--radius); background: #f4e7c3; color: #6b4e00; }
.demo { border-left: 3px solid var(--pair-a); }
.demo__note { max-width: 70ch; }
.demo__actions { margin: 12px 0 16px; }
.demo-banner { background: #fbf3dc; border-left: 3px solid var(--pair-a); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 16px; font-size: 0.95rem; color: var(--ink); }
.pnav { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; font-size: 0.92rem; }
.pnav__link { white-space: nowrap; text-decoration: none; font-weight: 600; padding: 6px 10px; border: 1px solid var(--busbar); border-radius: var(--radius); background: var(--surface); }
.pnav__link.is-off { color: var(--ink-3); font-weight: 500; border-style: dashed; }
.pnav__pos { color: var(--ink-2); text-align: center; }
.passport__wiring { margin: -4px 0 18px; padding: 10px 12px; background: var(--page); border-radius: var(--radius); font-size: 0.98rem; }
.passport__section { font-size: 0.95rem; color: var(--cell); margin-bottom: 10px; }
/* grades as badges: the letter reads at a glance, A to C from solid to quiet */
.grade { border-radius: var(--radius); padding: 1px 0; min-width: 1.75em; }
.grade.g-A { background: var(--cell); color: #fff; }
.grade.g-B { background: var(--busbar); color: var(--ink); }
.grade.g-C { background: var(--busbar-2); color: var(--ink-2); }
.passport__grade { padding: 6px 0 4px; min-width: 1.35em; font-size: 2.8rem; }
.passport__grade-line { align-items: center; }
/* the builder: one question, then only the fields that use needs */
.need-card { padding-bottom: 20px; }
.use-form { display: grid; gap: 16px; }
.use-q { font-size: 0.95rem; color: var(--ink); font-weight: 600; gap: 8px; max-width: 460px; font-stretch: 100%; }
.use-q select { font-size: 1rem; font-weight: 500; padding: 9px 11px; }
.use-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px 18px; align-items: start; }
.use-part[hidden], .use-form .field[hidden] { display: none; }
.use-form .field { min-width: 0; }
.use-form .field > select { width: 100%; min-width: 0; max-width: 100%; }
.use-form input[type=text] { max-width: 100%; }
.unit-row { display: flex; align-items: center; gap: 6px; color: var(--ink-2); }
.field-help { display: block; font-size: 0.78rem; color: var(--ink-2); line-height: 1.35; margin-top: 2px; font-stretch: 100%; }
.use-site { border: 1px solid var(--busbar-2); border-radius: var(--radius); padding: 12px 14px 14px; margin: 0; min-width: 0; display: grid; gap: 10px; }
.use-site legend { font-size: 0.9rem; font-weight: 600; color: var(--ink); padding: 0 4px; }
.sizing { margin: 4px 0 4px; }
.sizing summary { cursor: pointer; font-weight: 700; color: var(--cell); padding: 10px 0 6px; }
.sizing ol { margin: 4px 0 0; padding-left: 22px; display: grid; gap: 6px; color: var(--ink-2); font-size: 0.92rem; }
.sizing ol b { color: var(--ink); }
.build-auto { margin: -2px 0 16px; color: var(--ink-2); }
.build-auto b { color: var(--ink); }
details.adjust summary, details.impact-edit summary { cursor: pointer; font-weight: 700; color: var(--cell); }
details.adjust[open] summary { margin-bottom: 6px; }
/* the Impact comparison: the same four panels wired two ways */
.impact-main { border-left: 3px solid var(--pair-a); }
.impact-hero { margin: 14px 0 18px; }
.impact-bars { display: grid; gap: 14px; margin-bottom: 14px; }
.impact-bar { display: grid; grid-template-columns: minmax(0, 15rem) 1fr 5.5rem; gap: 14px; align-items: center; }
.impact-bar__label { font-size: 0.92rem; color: var(--ink-2); }
.impact-bar__track { height: 22px; background: var(--page); border-radius: var(--radius); overflow: hidden; }
.impact-bar__fill { display: block; height: 100%; background: var(--pair-b); border-radius: var(--radius); transition: width 300ms ease-out; }
.impact-bar__fill.is-base { background: var(--busbar); }
.impact-bar > b { text-align: right; font-size: 1.1rem; }
.impact-edit { margin-top: 12px; }
.impact-table input { width: 6.5em; text-align: right; font: inherit; border: 1px solid var(--busbar); border-radius: var(--radius); padding: 4px 6px; background: var(--surface); }
@media (max-width: 760px) {
  /* on a phone the reader has just scanned the card: the ID, grade and numbers first, the cell and QR after */
  .passport > div:not(.passport__visual) { order: 1; }
  .passport__visual { order: 2; padding-top: 16px; border-top: 1px solid var(--busbar-2); }
  .impact-bar { grid-template-columns: 1fr auto; }
  .impact-bar__track { grid-column: 1 / -1; }
  .pnav__pos { font-size: 0.82rem; }
}
@media print {
  .passport__visual { order: 0; padding-top: 0; border-top: 0; }
  .passport > div:not(.passport__visual) { order: 0; }
  .grade { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .pnav, .demo-banner { display: none; }
}

/* ---------- the Impact page (from the bryanchanges branch): why more solar, for businesses and households. Its sections
   are full width like the front page's; the sky layer that branch drew behind them is not taken. ---------- */
body[data-page="impact"] .view { max-width: none; padding: 0; }
.imp-open { min-height: calc(100svh - 64px); display: grid; align-content: center; position: relative; padding-block: clamp(56px, 8vh, 96px) clamp(88px, 12vh, 128px); }
.imp-open__in { display: grid; gap: 28px; }
.imp-head { font-size: clamp(2.6rem, 7vw, 6.4rem); max-width: 12ch; }
.imp-head .line { display: block; }
.imp-open__lede { margin: 0; font-size: clamp(1.1rem, 1.6vw, 1.35rem); max-width: 46ch; }
.imp-cue { position: absolute; left: 0; right: 0; bottom: 28px; text-align: center; transition: opacity 260ms ease; }
.imp-cue.is-gone { opacity: 0; }
.imp-part { padding-block: clamp(72px, 11vw, 150px); }
.imp-part__in { max-width: 900px; }
.imp-part__text { font-size: clamp(1.1rem, 1.5vw, 1.3rem); line-height: 1.55; margin-top: 18px; max-width: 60ch; }
.imp-points { list-style: none; padding: 0; margin: 32px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px 28px; }
.imp-points li { display: flex; gap: 12px; align-items: baseline; font-weight: 600; font-stretch: 104%; }
.imp-points li::before { content: ""; flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--sun); transform: translateY(-1px); }
.imp-sum { padding-block: clamp(64px, 9vw, 128px); }
.imp-sum__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; margin-top: 36px; }
.imp-sum .num-big { font-size: clamp(2.4rem, 4.4vw, 4rem); white-space: nowrap; }
.imp-sum__gain { text-decoration: underline; text-decoration-color: var(--sun); text-decoration-thickness: 6px; text-underline-offset: 10px; }
.imp-sum .tag { margin-left: 4px; }
.imp-sum__note { margin-top: 32px; max-width: 70ch; }
.imp-next { padding-block: clamp(64px, 9vw, 128px) clamp(96px, 12vw, 160px); }
.imp-next__list { padding-left: 1.3em; margin: 24px 0 0; display: grid; gap: 14px; max-width: 64ch; font-size: 1.1rem; line-height: 1.5; }
.imp-next__actions { margin-top: 36px; gap: 12px; }
@media (max-width: 760px) {
  .imp-points, .imp-sum__grid { grid-template-columns: 1fr; }
}

/* Second Use (#/reuse): pick a panel and a site, see what it can run, ask the agent, how the agent is tested */
.reuse__steps { display: grid; gap: 16px; }
.reuse__steps .card + .card { margin-top: 0; }
.reuse__pick { display: flex; flex-wrap: wrap; gap: 16px 32px; align-items: end; }
.reuse__sun { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.reuse__sun legend { font-size: var(--label); color: var(--ink-3); font-stretch: 88%; margin-bottom: 6px; padding: 0; }
.reuse__sun label { cursor: pointer; }
.reuse__sun input { position: absolute; opacity: 0; pointer-events: none; }
.reuse__chip { display: inline-block; padding: 7px 14px; border: 1px solid var(--busbar); border-radius: 999px; font-size: 0.9rem; background: var(--surface); }
.reuse__sun input:checked + .reuse__chip { background: var(--cell); border-color: var(--cell); color: #fff; }
.reuse__h { color: var(--ink-2); }
.reuse__sun input:checked + .reuse__chip .reuse__h { color: rgba(255, 255, 255, 0.75); }
.reuse__sun input:focus-visible + .reuse__chip { outline: 2px solid var(--focus); outline-offset: 2px; }
.reuse__facts { margin: 18px 0 10px; grid-template-columns: repeat(3, 1fr); }
.reuse__answer { font-size: 1.15rem; font-weight: 600; color: var(--cell); margin-bottom: 14px; }
.reuse__runs { list-style: none; padding: 0; display: grid; }
.reuse__runs li { display: grid; grid-template-columns: 1.6em 1fr auto; gap: 10px; align-items: baseline; padding: 9px 0; border-bottom: 1px solid var(--busbar-2); }
.reuse__runs li:last-child { border-bottom: 0; }
.reuse__runs li.is-no { color: var(--ink-3); }
.reuse__runs li.is-yes .reuse__mark { color: var(--pair-c); font-weight: 700; }
.reuse__runs li.is-yes .reuse__dev { font-weight: 600; color: var(--ink); }
.reuse__why { text-align: right; }
.reuse__ask { display: flex; gap: 10px; margin-top: 12px; }
.reuse__q { flex: 1; min-width: 0; font-size: 1rem; padding: 10px 12px; border: 1px solid var(--busbar); border-radius: var(--radius); background: var(--surface); }
#reuse-status { margin-top: 10px; }
#reuse-answer { margin-top: 14px; display: grid; gap: 8px; }
#reuse-answer[hidden] { display: none; }
.reuse__trace { padding-left: 1.3em; color: var(--ink-2); display: grid; gap: 3px; }
.reuse__where { display: inline-block; margin-left: 6px; padding: 0 8px; border-radius: 999px; background: var(--busbar-2); color: var(--cell); font-size: 0.78rem; font-weight: 600; }
.reuse__proof { padding: 10px 12px; border: 1px solid var(--busbar); border-radius: var(--radius); color: var(--ink-2); }
.reuse__proof code { font-size: 0.8rem; color: var(--cell); }
.reuse__scroll { overflow-x: auto; margin-top: 10px; }
.reuse__steps tr.is-fit td { color: var(--cell); font-weight: 600; }
@media (max-width: 760px) {
  .reuse__facts { grid-template-columns: 1fr; }
  .reuse__runs li { grid-template-columns: 1.6em 1fr; }
  .reuse__why { grid-column: 2; text-align: left; }
  .reuse__ask { flex-direction: column; }
  .reuse__steps .table th:first-child, .reuse__steps .table td:first-child { white-space: normal; min-width: 11em; }
}

/* ---------- the nav, restyled: a transparent bar, the Afterglow mark, rounded pills. These rules come after the
   ui-refresh lines above (which stay verbatim) and override them. Only the pills take clicks; the gaps between
   them pass clicks to the page. On hover, motion.js's drawn lines pop out of the pill (.pop, in motion.css). */
.nav { background: transparent; border-bottom: 0; padding: 14px 28px; pointer-events: none; }
.nav > * { pointer-events: auto; }
.nav__name { gap: 10px; padding: 6px 18px 6px 10px; border: 1px solid var(--busbar-2); border-radius: 999px; background: var(--surface); font-size: 1.15rem; letter-spacing: -0.01em; }
.nav__sun { width: 28px; height: 28px; margin-right: 0; border-radius: 0; background: url("../img/afterglow.svg") center / contain no-repeat; box-shadow: none; }
.nav__links { gap: 20px; align-items: center; }
.nav__links a { position: relative; padding: 9px 18px; border: 1px solid var(--busbar); border-radius: 999px; background: var(--surface); color: var(--ink); font-size: 0.95rem; line-height: 1.2; }
.nav__links a:hover, .nav__links a:focus-visible { color: var(--cell); border-color: var(--cell); }
.nav__links a.is-on, .nav__links a.is-on:hover, .nav__links a.is-on:focus-visible { background: var(--cell); border-color: var(--cell); color: #fff; }
@media (max-width: 480px) {
  .nav { padding: 10px 12px; row-gap: 8px; }
  .nav__name { font-size: 1.05rem; padding: 4px 14px 4px 8px; }
  .nav__sun { width: 24px; height: 24px; }
  /* one row of pills that scrolls sideways, edge to edge, rather than three rows (no hover lines on touch) */
  .nav__links { flex: 0 0 calc(100% + 24px); max-width: none; flex-wrap: nowrap; gap: 6px; overflow-x: auto; scrollbar-width: none; margin-inline: -12px; padding: 2px 12px; font-size: 0.88rem; }
  .nav__links::-webkit-scrollbar { display: none; }
  .nav__links a { flex: none; padding: 7px 13px; font-size: 0.88rem; }
}

/* ---------- the footer, on every page: navy, the Afterglow mark and name, the pages, the bench note, and a sun
   setting into the bottom edge of the page ---------- */
.foot { position: relative; overflow: hidden; background: var(--cell); color: rgba(255, 255, 255, 0.72); padding: clamp(56px, 7vw, 96px) 0 0; margin-top: clamp(32px, 5vw, 64px); border-radius: 28px 28px 0 0; }
body[data-page="front"] .foot { margin-top: 0; border-radius: 0; }
.foot__in { position: relative; z-index: 1; max-width: var(--wrap); margin: 0 auto; padding-inline: var(--gutter); }
.foot__grid { display: grid; grid-template-columns: 1fr auto; gap: 32px 64px; align-items: start; }
.foot__brand { display: inline-flex; align-items: center; gap: clamp(10px, 1.4vw, 18px); color: #fff; text-decoration: none; font-size: clamp(2.4rem, 5.5vw, 4.6rem); font-weight: 700; font-stretch: 118%; letter-spacing: -0.03em; line-height: 1; }
.foot__mark { width: 1.1em; height: 1.1em; flex: none; }
.foot__links { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; padding-top: 8px; }
.foot__links a { color: #fff; text-decoration: none; padding: 8px 16px; border: 1px solid rgba(255, 255, 255, 0.28); border-radius: 999px; font-size: 0.92rem; font-weight: 500; }
.foot__links a:hover, .foot__links a:focus-visible { border-color: #fff; background: rgba(255, 255, 255, 0.08); }
.foot__line { margin-top: 28px; font-size: clamp(1.1rem, 1.5vw, 1.3rem); color: #fff; max-width: 40ch; line-height: 1.4; }
.foot__note { margin-top: 16px; font-size: 0.85rem; max-width: var(--measure); line-height: 1.55; }
.foot__base { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 24px; margin-top: 40px; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, 0.16); font-size: 0.8rem; color: rgba(255, 255, 255, 0.6); }
.foot__sun { display: block; width: min(100%, 720px); height: auto; margin: 32px auto 0; }
@media (max-width: 760px) {
  .foot__grid { grid-template-columns: 1fr; }
  .foot__links { flex-direction: row; flex-wrap: wrap; align-items: center; padding-top: 0; }
}
@media (max-width: 480px) {
  .foot { border-radius: 20px 20px 0 0; }
  .foot__links a { padding: 7px 13px; font-size: 0.86rem; }
}
