/* styles.css — the two sites' one stylesheet. Colours and type come only from brand/tokens.css (screens.md S7);
   a hex here is a bug and test/build.test.mjs fails on one. Anatomy: header rendered once with reserved
   heights (S2), one title first (S3), small-capital labels for chapters, tables inside cards, 44px targets. */
*, *::before, *::after { box-sizing: border-box; }
/* the scrollbar's space is always reserved, so a short page and a long page put the header in the same place
   (screens.md S2: nothing moves unless the reader moved it) */
html { -webkit-text-size-adjust: 100%; scrollbar-gutter: stable; }
@supports not (scrollbar-gutter: stable) { html { overflow-y: scroll; } }
body { margin: 0; background: var(--bx-ground); color: var(--bx-text); font-family: var(--bx-font-body); font-size: 16px; line-height: 1.55; }
a { color: var(--bx-blue-ink); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--bx-heading); }
code, .mono { font-family: var(--bx-font-mono); font-size: 0.92em; }
p { margin: 0 0 12px; }
ul { margin: 0 0 12px; padding-left: 20px; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--bx-card); color: var(--bx-heading); padding: 10px 14px; border-radius: var(--bx-radius); z-index: 10; }
.skip:focus { left: 8px; }

/* the header: one band, rendered by the layout, heights reserved */
.band { background: var(--bx-navy); color: var(--bx-on-navy); }
.band-inner { max-width: 1260px; margin: 0 auto; padding: 0 16px; min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.home { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; color: var(--bx-on-navy); text-decoration: none; }
.lockup { height: 30px; width: auto; display: block; }
.home-text { font-family: var(--bx-font-display); font-weight: 700; font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--bx-on-navy-green); }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; flex-wrap: wrap; }
.nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; color: var(--bx-on-navy); text-decoration: none; font-weight: 600; border-bottom: 3px solid transparent; }
.nav a:hover { color: var(--bx-on-navy-blue); }
.nav a[aria-current="page"] { border-bottom-color: var(--bx-green); }

/* the page */
.main { max-width: 1000px; margin: 0 auto; padding: 28px 16px 48px; }
.main-wide { max-width: 1260px; }
.page-title { font-family: var(--bx-font-display); font-weight: 800; font-size: 30px; line-height: 1.15; letter-spacing: -0.01em; color: var(--bx-heading); margin: 0 0 20px; }
.site-www .page-title { font-size: 34px; max-width: 900px; margin-bottom: 16px; }
.lede { font-size: 19px; line-height: 1.5; max-width: 760px; margin-bottom: 36px; }
.lede-small { color: var(--bx-text-soft); max-width: 760px; margin-bottom: 20px; }
.chapter { margin: 0 0 36px; }
.chapter h2 { font-family: var(--bx-font-display); font-weight: 700; font-size: 22px; color: var(--bx-heading); margin: 0 0 16px; }
.aside { color: var(--bx-text-soft); margin-top: 8px; }
.label { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--bx-text-soft); margin: 0 0 6px; }

/* cards, borderless white with the shadow */
.card { background: var(--bx-card); border-radius: var(--bx-radius); box-shadow: var(--bx-shadow); padding: 20px 22px; margin: 0 0 20px; }
.card-title { font-family: var(--bx-font-display); font-weight: 700; font-size: 19px; color: var(--bx-heading); margin: 0 0 12px; }
.sub { font-family: var(--bx-font-display); font-weight: 700; font-size: 15px; color: var(--bx-heading); margin: 20px 0 8px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.grid-2 .card, .grid-3 .card { margin: 0; }
@media (max-width: 860px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* tables inside cards: a header rule and row rules, never grid lines */
.table-wrap { overflow-x: auto; margin: 0 -6px; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; vertical-align: top; padding: 10px 6px; border-bottom: 1px solid var(--bx-rule-soft); }
thead th { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--bx-text-soft); border-bottom: 2px solid var(--bx-rule); }
tbody tr:last-child td { border-bottom: 0; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
details.why { margin-top: 4px; }
details.why summary { cursor: pointer; color: var(--bx-blue-ink); font-size: 14px; min-height: 24px; }
details.why p { margin: 6px 0 0; color: var(--bx-text-soft); font-size: 14px; }

/* status chips: a pale tint behind heavy text, one colour per meaning */
.chip { display: inline-block; padding: 2px 10px; border-radius: var(--bx-radius-pill); font-size: 12px; font-weight: 700; line-height: 20px; white-space: nowrap; }
.chip-good { background: var(--bx-green-tint); color: var(--bx-green-ink); }
.chip-progress { background: var(--bx-blue-tint); color: var(--bx-blue-ink); }
.chip-decide { background: var(--bx-amber-tint); color: var(--bx-amber-ink); }
.chip-wrong { background: var(--bx-red-tint); color: var(--bx-red-ink); }
.chip-quiet, .chip-plain { background: var(--bx-sunk); color: var(--bx-text-soft); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }

/* the number the reader came for */
.big { margin: 0 0 20px; }
.big-number { font-family: var(--bx-font-display); font-weight: 800; font-size: 48px; line-height: 1; color: var(--bx-heading); }
.big-caption { font-size: 17px; color: var(--bx-text-soft); }

/* actions: 44px targets */
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 20px; border-radius: var(--bx-radius-pill); font-weight: 600; text-decoration: none; }
.button-primary { background: var(--bx-navy); color: var(--bx-on-navy); }
.button-primary:hover { background: var(--bx-blue-ink); color: var(--bx-on-navy); }
.actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin: 8px 0 8px; }
.quiet-link { display: inline-flex; align-items: center; min-height: 44px; }
.meta { color: var(--bx-text-soft); font-size: 14px; margin: 0 0 6px; }
.note { color: var(--bx-amber-ink); font-size: 14px; margin: 0; }

/* empty states are good news with a next step */
.empty { background: var(--bx-green-tint); color: var(--bx-green-ink); border-radius: var(--bx-radius); padding: 12px 14px; font-weight: 600; margin: 0; }
.empty-next { font-weight: 400; }

/* the footer */
.foot { border-top: 1px solid var(--bx-rule); }
.foot-inner { max-width: 1260px; margin: 0 auto; padding: 20px 16px; color: var(--bx-text-soft); font-size: 14px; }
.foot p { margin: 0; }

@media print { body { background: none; color: black; } .band, .foot, .skip { display: none; } .card { box-shadow: none; border: 1px solid var(--bx-rule); } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

figure.board { margin: 8px 0 0; }
figure.board img { display: block; width: 100%; height: auto; border-radius: 10px; }

/* the feedback flag: one button, one field (screens.md S8), fixed bottom-right, 44px target */
.flag { position: fixed; right: 16px; bottom: 16px; z-index: 5; max-width: calc(100vw - 32px); }
.flag-button { list-style: none; cursor: pointer; display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border-radius: var(--bx-radius-pill); background: var(--bx-navy); color: var(--bx-on-navy); font-weight: 600; box-shadow: var(--bx-shadow); float: right; }
.flag-button::-webkit-details-marker { display: none; }
.flag[open] .flag-button { background: var(--bx-blue-ink); }
.flag-form { clear: both; margin-top: 10px; width: 360px; max-width: calc(100vw - 32px); background: var(--bx-card); border-radius: var(--bx-radius); box-shadow: var(--bx-shadow); padding: 16px 18px; }
.flag-form label { display: block; font-weight: 600; color: var(--bx-heading); margin-bottom: 6px; }
.flag-form textarea { width: 100%; box-sizing: border-box; font: inherit; padding: 10px 12px; border: 1px solid var(--bx-rule); border-radius: 10px; background: var(--bx-sunk); color: var(--bx-text); resize: vertical; min-height: 96px; }
.flag-form textarea:focus { outline: 2px solid var(--bx-blue); outline-offset: 1px; }
.flag-honey { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.flag-actions { margin: 12px 0 8px; }
.flag-result { min-height: 24px; font-weight: 600; margin: 0 0 6px; }
.flag-result[data-tone="good"] { color: var(--bx-green-ink); }
.flag-result[data-tone="wrong"] { color: var(--bx-red-ink); }
.flag-result[data-tone="progress"] { color: var(--bx-blue-ink); }
.flag-form .meta { margin: 0; }
.site-plain .main { max-width: 640px; }
@media print { .flag { display: none; } }
