/* atlas.css — one paper-coloured system for both pages.
   The palette is the renderer's palette: these variables are the same OKLCH
   values as `C` in assets/js/trace-renderers.js, so the page chrome and the
   diagrams inside it are literally the same colours. Change one, change both. */

:root {
  --paper: oklch(0.977 0.008 85);
  --panel: oklch(0.99 0.006 85);
  --ink: oklch(0.26 0.015 60);
  --body: oklch(0.34 0.014 65);
  --mute: oklch(0.50 0.014 70);
  --rule: oklch(0.885 0.012 80);
  --faint: oklch(0.80 0.015 78);
  --blue: oklch(0.47 0.075 250);
  --blue-soft: oklch(0.94 0.03 250);
  --clay: oklch(0.545 0.105 42);
  --clay-soft: oklch(0.965 0.022 45);

  --serif: 'Spectral', Georgia, 'Times New Roman', serif;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --shell: 1180px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  -webkit-font-smoothing: antialiased;
  text-wrap: pretty;
}

a { color: var(--blue); text-decoration: none; border-bottom: 1px solid oklch(0.86 0.04 250); }
a:hover { color: var(--clay); border-bottom-color: oklch(0.82 0.08 42); }

.shell { max-width: var(--shell); margin: 0 auto; padding: 72px 48px 120px; }

/* ---------- micro type ---------- */

.eyebrow, .chip, .btn, .field, .rowlabel, .tag, .pill, .stat b, .frame-tag {
  font-family: var(--mono);
}

.eyebrow {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: baseline;
  font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--mute);
}
.eyebrow .sep { color: var(--rule); }
.eyebrow .hot { color: var(--clay); }

h1 { font-size: clamp(40px, 6.4vw, 70px); line-height: 1.02; font-weight: 600;
     letter-spacing: -0.022em; margin: 20px 0 0; }
h2 { font-size: 27px; font-weight: 600; letter-spacing: -0.012em; margin: 0 0 14px; }
h3 { font-size: 19px; font-weight: 600; margin: 0 0 8px; }

.lede { max-width: 700px; font-size: 21px; line-height: 1.55; color: oklch(0.40 0.014 65);
        margin: 22px 0 0; }
.prose { font-size: 16.5px; line-height: 1.68; color: var(--body); }
.prose em { color: var(--ink); font-style: italic; }

.inline-code {
  font-family: var(--mono); font-size: .86em; color: var(--ink);
  background: var(--paper); border: 1px solid var(--rule); padding: 1px 5px;
}
.panel.trap .inline-code { background: oklch(0.985 0.012 45); border-color: oklch(0.9 0.04 42); }

header.masthead { border-bottom: 1px solid var(--rule); padding-bottom: 40px; }

/* ---------- controls ---------- */

/* Scrolls with the page. It was sticky when it held two rows of chips; at
   six rows it covered a third of the screen and cards slid under it. */
.toolbar {
  border-bottom: 1px solid var(--rule);
  margin: 0 -48px; padding: 4px 48px 16px;
}
.searchrow { display: flex; gap: 14px; align-items: center; }

.field {
  flex: 1; min-width: 0;
  font-size: 15px; color: var(--ink);
  background: var(--panel); border: 1px solid var(--rule); border-radius: 0;
  padding: 11px 14px;
}
.field:focus { outline: none; border-color: var(--clay); background: var(--paper); }
.field::placeholder { color: var(--faint); }

.kbd {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em;
  color: var(--mute); border: 1px solid var(--rule); background: var(--panel);
  padding: 4px 7px; white-space: nowrap;
}

.facets { display: flex; flex-wrap: wrap; gap: 22px; margin-top: 13px; align-items: flex-start; }
.facet { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.facet > .rowlabel { font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
                     color: var(--faint); margin-right: 2px; }

.chip {
  font-size: 11.5px; letter-spacing: .04em; color: var(--body);
  background: var(--panel); border: 1px solid var(--rule);
  padding: 5px 10px; cursor: pointer; user-select: none;
}
.chip:hover { border-color: var(--faint); color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--clay-soft); border-color: var(--clay); color: var(--clay); }
.chip .n { color: var(--faint); margin-left: 6px; }
.chip[aria-pressed="true"] .n { color: var(--clay); opacity: .7; }

.btn {
  font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--body); background: var(--panel);
  border: 1px solid var(--rule); padding: 8px 13px; cursor: pointer;
}
.btn:hover { border-color: var(--clay); color: var(--clay); }
.btn[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn:disabled { opacity: .35; cursor: default; }
.btn:disabled:hover { border-color: var(--rule); color: var(--body); }

.count { font-family: var(--mono); font-size: 11.5px; letter-spacing: .1em;
         color: var(--mute); text-transform: uppercase; }

/* ---------- card grid ---------- */

.grid { display: grid; gap: 20px; margin-top: 34px;
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }


/* The family row is 33 chips; give it a touch more breathing room than the
   short rows so it reads as a block rather than a run-on. */
.facet { row-gap: 7px; }

.card {
  position: relative;
  border: 1px solid var(--rule); background: var(--panel);
  transition: border-color .12s ease, transform .12s ease;
}
.card:hover { border-color: var(--clay); transform: translateY(-2px); }
.card:hover .card-title { color: var(--clay); }
.card-link { display: flex; flex-direction: column; height: 100%;
             color: inherit; border-bottom: none; }
.card-link:hover { color: inherit; }



.card-art {
  height: 158px; display: flex; align-items: center; justify-content: center;
  padding: 14px 16px; border-bottom: 1px solid var(--rule);
  background: var(--paper); overflow: hidden;
}
.card-art > svg { max-height: 130px; min-width: 0; }
.card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 9px; flex: 1; }
.grid > .card { display: block; }
.card-title { font-size: 20px; font-weight: 600; line-height: 1.2; letter-spacing: -0.01em; }
.card-insight { font-size: 14px; line-height: 1.55; color: var(--body); flex: 1; }
.card-foot { display: flex; gap: 10px; flex-wrap: wrap; align-items: baseline;
             font-family: var(--mono); font-size: 10.5px; letter-spacing: .09em;
             text-transform: uppercase; color: var(--mute); }

.pill {
  font-size: 10px; letter-spacing: .12em; text-transform: uppercase;
  padding: 3px 7px; border: 1px solid var(--rule); color: var(--mute);
}
.pill.easy { color: var(--blue); border-color: oklch(0.86 0.04 250); }
.pill.medium { color: var(--clay); border-color: oklch(0.86 0.06 42); }
.pill.hard { color: var(--paper); background: var(--clay); border-color: var(--clay); }

.listtag {
  font-family: var(--mono); font-size: 9px; letter-spacing: .1em;
  padding: 2px 5px; border: 1px solid var(--rule); color: var(--mute);
}
.listtag.b75 { color: var(--clay); border-color: oklch(0.86 0.06 42); background: var(--clay-soft); }
.listtag.nc150 { color: var(--blue); border-color: oklch(0.88 0.035 250); background: var(--blue-soft); }

.empty { border: 1px dashed var(--rule); padding: 56px; text-align: center; color: var(--mute);
         margin-top: 34px; }

/* ---------- problem page ---------- */

.player { margin-top: 40px; border: 1px solid var(--rule); background: var(--panel); }
.stage { padding: 30px 28px 22px; background: var(--paper); border-bottom: 1px solid var(--rule);
         min-height: 300px; display: flex; align-items: center; justify-content: center; }
/* A flex item will not shrink below its intrinsic width without this, so a
   wide diagram would push the whole page sideways on a narrow screen. The
   renderer's own max-width still stops it scaling past 1:1. */
.stage > svg { display: block; min-width: 0; }

.legendbar { display: flex; flex-wrap: wrap; gap: 16px; padding: 11px 28px;
             border-bottom: 1px solid var(--rule); font-family: var(--mono);
             font-size: 10.5px; letter-spacing: .07em; color: var(--mute); }
.legendbar .swatch { display: inline-block; width: 20px; height: 12px; margin-right: 7px;
                     vertical-align: -1px; }
/* Only the mark keys stay on one line; the legend sentence must be free to
   wrap, or it forces the whole page wider than the screen. */
.legendbar .markkey { white-space: nowrap; }
.legendbar .legendtext { color: var(--mute); flex: 1 1 260px; min-width: 0; }

.narration { padding: 22px 28px 24px; display: grid; gap: 16px;
             grid-template-columns: minmax(0, 1fr) minmax(230px, 320px); }
.frame-tag { font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase;
             color: var(--clay); }
.frame-head { font-size: 21px; font-weight: 600; line-height: 1.3; margin: 8px 0 10px;
              letter-spacing: -0.008em; }
.frame-note { font-size: 15.5px; line-height: 1.62; color: var(--body); }
.frame-answer { margin-top: 14px; display: inline-block; font-family: var(--mono);
                font-size: 12.5px; letter-spacing: .06em; color: var(--clay);
                border: 1px solid var(--clay); background: var(--clay-soft); padding: 7px 12px; }

.readout { display: flex; flex-direction: column; gap: 9px; align-content: start; }
.readout-row { display: flex; gap: 9px; align-items: baseline; }
.rowlabel { font-size: 9.5px; letter-spacing: .13em; text-transform: uppercase;
            color: var(--faint); min-width: 78px; text-align: right; padding-top: 3px; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.val { font-family: var(--mono); font-size: 11.5px; padding: 3px 7px;
       border: 1px solid var(--rule); background: var(--paper); color: var(--body); }
.val.blue { border-color: oklch(0.86 0.04 250); background: var(--blue-soft); color: var(--blue); }
.val.clay { border-color: oklch(0.86 0.06 42); background: var(--clay-soft); color: var(--clay); }

.transport { display: flex; gap: 10px; align-items: center; padding: 13px 28px;
             border-top: 1px solid var(--rule); flex-wrap: wrap; }
.scrub { flex: 1; min-width: 160px; accent-color: var(--clay); }
.ticks { display: flex; gap: 3px; flex: 1; min-width: 160px; }
.tick { flex: 1; height: 22px; border: 1px solid var(--rule); background: var(--paper);
        cursor: pointer; padding: 0; }
.tick:hover { border-color: var(--faint); }
.tick[aria-current="true"] { background: var(--clay); border-color: var(--clay); }
.tick.done { background: var(--clay-soft); border-color: oklch(0.86 0.06 42); }

.panels { display: grid; gap: 20px; margin-top: 42px;
          grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.panel { border: 1px solid var(--rule); background: var(--panel); padding: 22px 24px; }
.panel.trap { background: var(--clay-soft); border-color: oklch(0.88 0.05 42); }
.panel h3 { font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em;
            text-transform: uppercase; color: var(--mute); margin-bottom: 12px; }
.panel.trap h3 { color: var(--clay); }
.panel p { margin: 0; font-size: 15.5px; line-height: 1.62; color: var(--body); }
.panel ul { margin: 0; padding-left: 18px; font-size: 15px; line-height: 1.62; color: var(--body); }
.panel li { margin-bottom: 7px; }
.panel li:last-child { margin-bottom: 0; }

.bigmetric { font-family: var(--mono); font-size: 19px; color: var(--ink); letter-spacing: -0.01em; }
.metric-row { display: flex; gap: 26px; flex-wrap: wrap; margin-bottom: 12px; }
.metric small { display: block; font-family: var(--mono); font-size: 9.5px;
                letter-spacing: .14em; text-transform: uppercase; color: var(--faint);
                margin-bottom: 4px; }

.section { margin-top: 60px; }
.section > .eyebrow { margin-bottom: 10px; gap: 9px; }
.section > h2 { margin-bottom: 20px; }

/* ---------- explainer sections ---------- */

.splitcols { display: grid; gap: 26px; grid-template-columns: minmax(0, 1fr) minmax(0, 0.92fr);
             align-items: start; }
.splitcols.wide { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }

pre.code.example { font-size: 12.5px; line-height: 1.75; padding: 20px 22px; }

.bignum { display: flex; gap: 20px; align-items: flex-start; margin-top: 24px; border: 1px solid oklch(0.88 0.05 42);
          background: var(--clay-soft); padding: 20px 22px; }
.bignum-value { font-family: var(--mono); font-size: 30px; line-height: 1.15; color: var(--clay);
                flex: 0 1 auto; min-width: 0; }
.bignum-value.long { font-size: 20px; line-height: 1.35; }
/* Beside a figure the column is narrow: stack the number over the prose
   rather than letting a long cost expression wrap to four lines. */
.splitcols .bignum { flex-direction: column; gap: 10px; }
.splitcols .bignum-value.long { font-size: 22px; }
.bignum p { margin: 0; font-size: 15px; }

.figures { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 26px; }
.figure { flex: 1 1 320px; max-width: 760px; margin: 0; border: 1px solid var(--rule); background: var(--panel); }
.figure-art { padding: 22px 18px; background: var(--paper); border-bottom: 1px solid var(--rule);
              display: flex; align-items: center; justify-content: center; overflow-x: auto; }
.figure-art > svg { min-width: 0; }
.figure figcaption { padding: 12px 16px; font-size: 13px; line-height: 1.6; color: var(--mute); }
.figure figcaption b { color: var(--ink); font-family: var(--mono); font-size: 11px;
                       letter-spacing: .08em; display: block; margin-bottom: 5px; font-weight: 500; }

.panel.good { border-color: oklch(0.88 0.05 42); background: var(--clay-soft); }
.panel.good h3 { color: var(--clay); }
.bigmetric.bad { color: var(--clay); }

.framings { display: grid; gap: 0; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
            border: 1px solid var(--rule); }
.framing { padding: 22px 24px; background: var(--panel); border-right: 1px solid var(--rule); }
.framing:last-child { border-right: none; }
.framing.prefer { background: var(--clay-soft); }
.framing.prefer .rowlabel { color: var(--clay); }
.framing h3 { margin: 10px 0 12px; font-size: 17.5px; line-height: 1.3; }
.framing ul { margin: 0; padding-left: 17px; font-size: 14.5px; line-height: 1.6; color: var(--body); }
.framing li { margin-bottom: 8px; }
.framing-note { margin: 14px 0 0; font-family: var(--mono); font-size: 11.5px;
                line-height: 1.6; color: var(--mute); }

.pitfalls { display: grid; gap: 14px 26px; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); }
.pitfall { border-left: 2px solid var(--clay); padding: 3px 0 3px 15px; }
.pitfall b { font-size: 16px; font-weight: 600; }
.pitfall p { margin: 5px 0 0; font-size: 14.5px; line-height: 1.58; color: var(--body); }

.callouts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 13px; }
.callouts li { display: flex; gap: 11px; font-size: 14.5px; line-height: 1.58; color: var(--body); }
.callout-no { font-size: 15px; color: var(--clay); flex: none; line-height: 1.5; }
.codeline { display: block; }
.codeline.lit { background: var(--clay-soft); box-shadow: -8px 0 0 var(--clay-soft), 8px 0 0 var(--clay-soft); }

.variants li { margin-bottom: 10px; }
.variant-title { font-weight: 600; }
.variant-refs { font-family: var(--mono); font-size: 11.5px; color: var(--faint); }
.variant-refs a { color: var(--mute); border-bottom-color: var(--rule); }
.variant-refs a:hover { color: var(--clay); }
.variant-flag {
  font-family: var(--mono); font-size: 9px; letter-spacing: .12em;
  text-transform: uppercase; padding: 2px 6px; margin-left: 7px;
  border: 1px solid var(--rule); color: var(--mute); white-space: nowrap;
}
.variant-flag.in { color: var(--clay); border-color: oklch(0.86 0.06 42);
                   background: var(--clay-soft); }
.variant-flag.paid { color: var(--faint); }
.variant-flag.b75 { color: var(--clay); border-color: oklch(0.86 0.06 42); background: var(--clay-soft); }
.variant-flag.nc150 { color: var(--blue); border-color: oklch(0.88 0.035 250); background: var(--blue-soft); }

.tag.list { letter-spacing: .1em; text-transform: uppercase; font-size: 10px; }
.tag.list.b75 { color: var(--clay); border-color: oklch(0.86 0.06 42); background: var(--clay-soft); }
.tag.list.nc150 { color: var(--blue); border-color: oklch(0.88 0.035 250); background: var(--blue-soft); }

.factline { margin-top: 54px; padding-top: 22px; border-top: 1px solid var(--rule);
            display: flex; flex-wrap: wrap; gap: 10px 44px; font-family: var(--mono);
            font-size: 11.5px; letter-spacing: .06em; color: var(--body); }
.factline .rowlabel { min-width: 0; text-align: left; margin-right: 12px; }

pre.code {
  margin: 0; border: 1px solid var(--rule); background: var(--panel);
  padding: 24px 26px; font-family: var(--mono); font-size: 13.5px; line-height: 1.85;
  color: var(--ink); overflow-x: auto; tab-size: 4;
}
.code-head { display: flex; justify-content: space-between; align-items: baseline;
             gap: 14px; margin-bottom: 12px; flex-wrap: wrap; }

.linkrow { display: flex; flex-wrap: wrap; gap: 10px; }
.linkcard { flex: 1 1 260px; border: 1px solid var(--rule); background: var(--panel);
            padding: 15px 17px; border-bottom: 1px solid var(--rule); }
a.linkcard:hover { border-color: var(--clay); }
.linkcard .rowlabel { text-align: left; min-width: 0; display: block; margin-bottom: 5px; }
.linkcard b { font-weight: 600; font-size: 16.5px; }


.pager { display: flex; justify-content: space-between; gap: 20px; margin-top: 54px;
         padding-top: 24px; border-top: 1px solid var(--rule); font-family: var(--mono);
         font-size: 11.5px; letter-spacing: .06em; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }
.tag { font-size: 11.5px; letter-spacing: .05em; color: var(--body);
       border: 1px solid var(--rule); background: var(--panel); padding: 6px 11px; }

.stat { display: flex; gap: 26px; flex-wrap: wrap; margin-top: 26px;
        font-family: var(--mono); font-size: 11.5px; letter-spacing: .1em;
        text-transform: uppercase; color: var(--mute); }
.stat b { color: var(--ink); font-weight: 500; }

.notice { border: 1px solid var(--clay); background: var(--clay-soft); padding: 26px 28px;
          margin-top: 40px; }
.notice code { font-family: var(--mono); font-size: 13px; background: var(--paper);
               border: 1px solid var(--rule); padding: 2px 6px; }

footer.foot { margin-top: 80px; padding-top: 24px; border-top: 1px solid var(--rule);
              font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em;
              text-transform: uppercase; color: var(--faint);
              display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }

@media (max-width: 760px) {
  .shell { padding: 44px 20px 80px; }
  .toolbar { margin: 0 -20px; padding: 14px 20px 12px; }
  .narration { grid-template-columns: 1fr; }
  .splitcols, .splitcols.wide { grid-template-columns: 1fr; }
  .bignum { flex-direction: column; gap: 10px; }
  .framing { border-right: none; border-bottom: 1px solid var(--rule); }
  .stage { padding: 20px 14px; }
  .rowlabel { min-width: 62px; }
}

@media print {
  .toolbar, .transport, .pager, .btn { display: none; }
  .card, .panel, .player { break-inside: avoid; }
}

/* ---- concept cards ------------------------------------------------------
   Authored illustrations from the video library. They get a heavier frame
   and a stated caption because they are the one thing on the page that was
   drawn rather than derived, and that has to be legible at a glance. */
.claycards { display: flex; flex-direction: column; gap: 22px; margin-top: 26px; }
.claycard { margin: 0; border: 1px solid var(--rule); background: var(--panel); }
.claycard a { display: block; border-bottom: none; line-height: 0; }
.claycard img {
  display: block; width: 100%; height: auto;
  border-bottom: 1px solid var(--rule);
}
.claycard figcaption {
  padding: 12px 16px; font-size: 13px; line-height: 1.6; color: var(--mute);
}
.claycard figcaption b {
  color: var(--clay); font-family: var(--mono); font-size: 11px;
  letter-spacing: .08em; text-transform: uppercase;
}

/* Taxonomy words link into the filtered index. They keep the flat look of the
   text they replaced — the affordance is the hover, not a permanent underline,
   because on a page this dense a row of blue links reads as noise. */
.eyebrow a { color: inherit; border-bottom: 1px solid transparent; }
.eyebrow a:hover { color: var(--clay); border-bottom-color: oklch(0.82 0.08 42); }
.eyebrow a.hot { color: var(--clay); }
.eyebrow a.hot:hover { border-bottom-color: oklch(0.82 0.08 42); }
a.tag { border-bottom: none; text-decoration: none; }
a.tag:hover { border-color: var(--clay); color: var(--clay); }
a.tag.list:hover { border-color: currentColor; }
a.tag.video:hover { border-color: oklch(0.55 0.19 25); color: oklch(0.55 0.19 25); }
.tag.technique { color: var(--blue); border-color: oklch(0.88 0.035 250); }
a.tag.technique:hover { border-color: var(--blue); }
/* A page about a premium problem: the reader should know before clicking. */
.tag.paid { color: var(--clay); border-color: oklch(0.86 0.06 42); background: var(--clay-soft); }

/* ---- zen mode -----------------------------------------------------------
   The button is always present; the `zen` class only lands while the page
   actually owns the screen, so the layout can never be left stripped with no
   way back. Chrome the *page* owns goes; nothing the page is *about* goes. */
.zenbtn {
  position: fixed; right: 18px; bottom: 18px; z-index: 20;
  width: 34px; height: 34px; line-height: 1; font-size: 15px;
  color: var(--mute); background: var(--panel);
  border: 1px solid var(--rule); border-radius: 0; cursor: pointer;
  opacity: .45; transition: opacity .15s, border-color .15s, color .15s;
}
.zenbtn:hover { opacity: 1; color: var(--clay); border-color: var(--clay); }

.zen .shell { max-width: 1500px; padding-top: 40px; padding-bottom: 60px; }
/* The back-link on a problem page and the masthead eyebrow on the index —
   both are the first .eyebrow inside .shell, and neither is content. */
.zen .shell > .eyebrow:first-child,
.zen .masthead .eyebrow,
.zen .foot { display: none; }
.zen .zenbtn { opacity: .2; }

/* An element that can take the whole screen carries its own button. */
.player, .claycard { position: relative; }
.fsbtn {
  position: absolute; top: 8px; right: 8px; z-index: 5;
  width: 28px; height: 28px; line-height: 1; font-size: 13px;
  color: var(--mute); background: var(--panel);
  border: 1px solid var(--rule); cursor: pointer;
  opacity: .35; transition: opacity .15s, color .15s, border-color .15s;
}
.player:hover .fsbtn, .claycard:hover .fsbtn, .fsbtn:focus-visible { opacity: .9; }
.fsbtn:hover { opacity: 1; color: var(--clay); border-color: var(--clay); }

/* Fullscreen surfaces get the paper background — without it the browser
   paints the backdrop black and the diagrams float in a void. */
.player.blown, .claycard.blown {
  background: var(--paper); padding: 28px 40px;
  display: flex; flex-direction: column; justify-content: center;
}
.player.blown .stage { flex: 0 1 auto; overflow: visible; }
.player.blown .stage > svg { width: 100%; height: auto; max-height: 66vh; }
.player.blown .fsbtn, .claycard.blown .fsbtn { opacity: .5; }
.claycard.blown img { max-height: 88vh; width: auto; margin: 0 auto; }
.claycard.blown figcaption { max-width: 900px; margin: 0 auto; }
/* The one collapsed facet. Reads as a chip so the row keeps its rhythm, but
   muted, because it is a control rather than a filter. */
.chip.more { color: var(--mute); border-style: dashed; }
.chip.more:hover { color: var(--clay); border-color: var(--clay); }

/* ---- the code, full screen ----------------------------------------------
   Long listings and their callouts are the one thing on a problem page that
   genuinely wants the whole display. The control sits in the header beside
   Copy rather than floating, because that corner is already taken. */
.codeblock { position: relative; }


/* ---- code card controls -------------------------------------------------
   Icons inside the card, revealed on hover, the way a docs site does it —
   the header above keeps only the provenance line, which is a claim worth
   reading rather than a control. */
.codewrap { position: relative; min-width: 0; }
.codetools {
  position: absolute; top: 10px; right: 12px; z-index: 3;
  display: flex; gap: 6px;
  /* Always present. Hover-to-reveal hides the control from anyone who does
     not already know it is there, and does nothing at all on a touch screen.
     Low contrast is enough to keep it out of the way. */
  opacity: .38; transition: opacity .15s;
}
.codewrap:hover .codetools, .codetools:focus-within { opacity: 1; }
.icon-btn {
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; padding: 0; cursor: pointer;
  color: var(--mute); background: var(--panel);
  border: 1px solid var(--rule); border-radius: 0;
  transition: color .15s, border-color .15s;
}
.icon-btn:hover { color: var(--clay); border-color: var(--clay); }
.icon-btn.done { color: var(--blue); border-color: var(--blue); }

/* Centred on the screen rather than pinned to the top-left. `margin: auto` on
   the child does the centring instead of `align-items`, because centred flex
   items get their overflow clipped at the top — with a listing taller than the
   viewport that would hide the first lines with no way to scroll back. */
.codewrap.blown {
  background: var(--paper); padding: 40px; overflow: auto;
  display: flex;
}
.codewrap.blown .code {
  margin: auto;
  max-width: min(1000px, 100%);
  font-size: 15.5px; line-height: 1.78;
}
.codewrap.blown .codetools { opacity: .6; top: 16px; right: 20px; }

/* An element blown up to fill the viewport. A fixed overlay rather than the
   Fullscreen API: no undismissable browser warning, and with the window
   already fullscreen it covers exactly the same pixels. */
.blown {
  position: fixed; inset: 0; z-index: 60;
  max-width: none; margin: 0; border: none;
}
body.blown-open { overflow: hidden; }
/* Zen is on — say so, since on a narrow window the layout change alone is
   easy to miss. */
.zen .zenbtn { opacity: .9; color: var(--clay); border-color: var(--clay); }
