/* Zhen page CSS. The palette and type exactly as start.mjs dealt them (the board's heat palette via start.mjs brand, funnel), then only
   what sits inside a visual: the checker window, the verdict, the case browser, the small card panels and
   the API window. Everything else is the kit's system. */
:root {
  --p-bg: #f4f4f5; --p-surface: #e4e4e5; --p-ink: #000000; --p-muted: #515151;
  --p-accent: #ff5b32; --p-accent-ink: #000000; --p-action: #ff5b32; --p-action-ink: #000000;
  --p-inv-bg: #000000; --p-inv-surface: #141414; --p-inv-ink: #f4f4f5; --p-inv-muted: #a3a3a3;
  --p-inv-accent: #ff5b32; --p-inv-accent-ink: #000000; --p-inv-action: #ff5b32; --p-inv-action-ink: #000000;
  --font-display: "Funnel Display", system-ui, sans-serif;
  --font-text: "Funnel Sans", system-ui, sans-serif;
  --font-mono: "DM Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --display-weight: 400;
  --display-tracking: -0.03em;
  --display-tracking-xl: -0.04em;
  --ly-scale: 0.98;
  /* the board's heat scale: white smoke, peach, coral, red orange, firebrick, black. Each hue has one job:
     red orange is the one accent (the main button, the copies bar), coral marks "closer look", firebrick marks
     an issue. Colour is never the only signal: every state also carries its word. */
  --heat-1: #ffb957; --heat-2: #ff8c40; --heat-3: #ff5b32; --heat-4: #b31d00; --heat-5: #000000;
  --sev-danger: #b31d00;
  /* the lit frame, the card panels and the closing slab: a datasheet grid on white smoke; the ground accent stays
     grey so the kit's lit corner never reads as an orange glow */
  --ground-bg: #eaeaeb; --ground-surface: #ffffff; --ground-ink: #000000; --ground-muted: #515151; --ground-accent: #c9c9cc;
}
/* links and the focus ring stay black: red orange is under 3:1 on white smoke */
:focus-visible { outline-color: var(--ink) !important; }
.ui { --fx-bg: #ffffff; --fx-surface: #f4f4f5; --fx-ink: #000000; --fx-muted: #55555b; --fx-accent: #ff5b32; }
.hero--centred .hero__window {
  background-color: var(--ground-bg);
  background-image: linear-gradient(rgb(0 0 0 / .045) 1px, transparent 1px), linear-gradient(90deg, rgb(0 0 0 / .045) 1px, transparent 1px);
  background-size: 32px 32px; }
.hero--centred .hero__lead { color: var(--ink); }

/* ---------------------------------------------------------------- the checker window in the hero */
.hero--centred .hero__window > .ck { position: absolute; z-index: 1; left: 50%; top: var(--s-6); bottom: 0; width: min(880px, calc(100% - 2 * var(--s-6))); transform: translateX(-50%); }
.ck { display: flex; flex-direction: column; text-align: left; background: var(--u-bg); border: 1px solid var(--u-border); border-bottom: 0; border-radius: var(--u-r) var(--u-r) 0 0; box-shadow: var(--u-shadow); overflow: hidden; }
.ck__bar { display: flex; align-items: center; gap: var(--s-3); min-height: 48px; padding: var(--s-2) var(--s-3) var(--s-2) var(--s-4); border-bottom: 1px solid var(--u-line); font: 400 13px/1 var(--font-text); color: var(--u-muted); flex: none; }
.ck__crumb i { font-style: normal; opacity: .5; margin: 0 2px; }
.ck__crumb b { font-weight: 500; color: var(--u-ink); }
.ck__form { padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--u-line); flex: none; }
.ck__label { font: 500 13px/1 var(--font-text); color: var(--u-ink); }
.ck__row { display: flex; gap: var(--s-2); }
.ck__row input { flex: 1; min-width: 0; height: 44px; padding: 0 var(--s-4); border: 1px solid var(--u-border); border-radius: var(--r-sm); background: var(--u-fill); color: var(--u-ink); font: 400 16px/1 var(--font-mono); }
.ck__row input:focus-visible { outline: 2px solid var(--action); outline-offset: 1px; }
.ck__row .btn { flex: none; }
.ck__error { margin: var(--s-2) 0 0; color: var(--sev-danger); font-size: 14px; }
.ck__chips { display: flex; gap: var(--s-2); margin-left: auto; }
@media (max-width: 767px) { .ck__bar { flex-wrap: wrap; } .ck__bar .ui-dots { display: none; } .ck__chips { margin-left: 0; flex-wrap: wrap; } }
.ck__chip { min-height: 28px; padding: 0 var(--s-3); border: 1px solid var(--u-border); border-radius: 99px; background: transparent; color: var(--u-ink); font: 500 13px/1 var(--font-text); cursor: pointer; transition: border-color var(--dur, .2s) var(--ease), background-color var(--dur, .2s) var(--ease), transform .16s var(--ease); }
@media (hover: hover) and (pointer: fine) { .ck__chip:hover { border-color: var(--u-line-2); background: var(--u-fill); transform: translateY(-1px); } }
.ck__chip:active { transform: scale(.97); }
.ck__result { flex: 1 1 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--u-line-2) transparent; padding: var(--s-4) var(--s-4) 96px; }

/* ---------------------------------------------------------------- one verdict */
.vd { display: grid; gap: var(--s-3); color: var(--u-ink); }
.vd__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-2) var(--s-4); }
.vd__subject { display: grid; gap: 2px; min-width: 0; }
.vd__subject strong { font: 500 var(--t-lead)/1.3 var(--font-text); }
.vd__subject span { font: 400 13px/1.4 var(--font-mono); color: var(--u-muted); overflow-wrap: anywhere; }
.vd__level { display: inline-flex; align-items: center; gap: var(--s-2); height: 28px; padding: 0 var(--s-3) 0 var(--s-2); border-radius: var(--r-sm); font: 500 13px/1 var(--font-text); background: var(--u-fill-2); color: var(--u-ink); }
/* the signature: a five-step heat scale, filled up to how hot the verdict is */
.heat { display: inline-flex; gap: 2px; }
.heat i { width: 4px; height: 12px; border-radius: 1px; background: var(--u-fill-3); }
.heat[data-n="1"] i:nth-child(1), .heat[data-n="3"] i:nth-child(1), .heat[data-n="5"] i:nth-child(1) { background: var(--heat-1); }
.heat[data-n="3"] i:nth-child(2), .heat[data-n="5"] i:nth-child(2) { background: var(--heat-2); }
.heat[data-n="3"] i:nth-child(3), .heat[data-n="5"] i:nth-child(3) { background: var(--heat-3); }
.heat[data-n="5"] i:nth-child(4) { background: var(--heat-4); }
.heat[data-n="5"] i:nth-child(5) { background: var(--heat-5); }
.vd__list { list-style: none; margin: 0; padding: 0; display: grid; }
.vd__row { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: var(--s-3); padding: var(--s-3) 0; border-top: 1px solid var(--u-line);
  animation: vd-in .3s cubic-bezier(.16, 1, .3, 1) both; animation-delay: calc(var(--i, 0) * 40ms); }
@keyframes vd-in { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { .vd__row { animation: none; } }
.vd__sev { align-self: start; margin-top: 2px; font: 500 13px/20px var(--font-text); color: var(--u-muted); }
.vd__row[data-sev="danger"] .vd__sev { color: var(--sev-danger); }
.vd__row[data-sev="caution"] .vd__sev { color: var(--u-ink); }
.vd__title { margin: 0; font: 500 16px/1.45 var(--font-text); }
.vd__area { display: inline-block; margin-right: var(--s-2); font: 500 13px/1 var(--font-text); color: var(--u-muted); }
.vd__detail { margin: var(--s-1) 0 0; font: 400 15px/1.55 var(--font-text); color: var(--u-text-2); overflow-wrap: anywhere; }
.vd__foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s-2); padding-top: var(--s-3); border-top: 1px solid var(--u-line); font: 400 13px/1.4 var(--font-mono); color: var(--u-muted); }

/* ---------------------------------------------------------------- the case browser (app-frame recipe) */
.app.ui { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); margin-top: var(--s-7); background: var(--u-bg); border: 1px solid var(--u-border); border-radius: var(--u-r); box-shadow: var(--u-shadow); }
.app > .app__pane { position: relative; min-width: 0; min-height: 0; overflow: hidden; }
.app > .app__pane + .app__pane { border-left: 1px solid var(--u-line); }
.app > .app__pane > .ui-panel { width: 100%; height: 100%; border: 0; border-radius: 0; box-shadow: none; }
.app > .app__pane::after { content: ""; position: absolute; inset: auto 0 0 0; height: 48px; background: linear-gradient(transparent, var(--u-bg)); pointer-events: none; }
.cb__rows { list-style: none; margin: 0; padding: var(--s-2); display: grid; gap: 2px; overflow-y: auto; }
.app .ui-win__main { overflow-y: auto; }
.cb__row { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px var(--s-3); padding: var(--s-2) var(--s-3); min-height: 44px; border: 0; border-radius: var(--u-r2); background: transparent; color: var(--u-ink); text-align: left; cursor: pointer; transition: background-color .16s var(--ease); }
@media (hover: hover) and (pointer: fine) { .cb__row:hover { background: var(--u-fill); } }
.cb__row[data-on] { background: var(--u-fill-2); }
.cb__name { font: 500 14px/1.35 var(--font-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cb__q { grid-column: 1; font: 400 13px/1.35 var(--font-mono); color: var(--u-muted); }
.cb__st { grid-column: 2; grid-row: 1 / span 2; align-self: center; display: inline-flex; align-items: center; gap: var(--s-2); font: 500 13px/1 var(--font-text); }
.cb__st[data-level="danger"] { color: var(--u-ink); }
.cb__st[data-level="caution"] { color: var(--u-ink); }
.cb__st[data-level="clear"] { color: var(--u-muted); }
.cb__open { height: 100%; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--u-line-2) transparent; padding: var(--s-5) var(--s-6) 80px; }
.cb__pick { display: none; }
/* under 1024 the list pane would be cut mid row, so a picker takes its place */
@media (max-width: 1023px) {
  .app.ui { grid-template-rows: minmax(0, 1fr) !important; }
  .app > .app__pane--list { display: none; }
  .app > .app__pane + .app__pane { border-top: 0 !important; }
  .cb__pick { display: block; width: 100%; height: 44px; margin-bottom: var(--s-4); padding: 0 var(--s-3); border: 1px solid var(--u-border); border-radius: var(--r-sm); background: var(--u-fill); color: var(--u-ink); font: 500 16px/1 var(--font-text); }
}
@media (min-width: 1024px) and (max-width: 1279px) { .app.ui { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); } .app .ui-win__side { display: none; } .app .ui-win__body { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 1023px) {
  .app.ui { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .app > .app__pane--list { max-height: 252px; }
  .app > .app__pane--list::after { display: none; }
  .app .ui-win__side { display: none; }
  .app .ui-win__body { grid-template-columns: minmax(0, 1fr); }
  .app > .app__pane + .app__pane { border-left: 0; border-top: 1px solid var(--u-line); }
  .cb__open { padding: var(--s-4) var(--s-4) 56px; }
}
@media (max-width: 639px) {
  .app.ui { grid-template-rows: minmax(0, 1fr); }
  .app > .app__pane--list { display: none; }
  .app > .app__pane + .app__pane { border-top: 0; }
  .cb__pick { display: block; width: 100%; height: 44px; margin-bottom: var(--s-4); padding: 0 var(--s-3); border: 1px solid var(--u-border); border-radius: var(--r-sm); background: var(--u-fill); color: var(--u-ink); font: 500 16px/1 var(--font-text); }
}

/* ---------------------------------------------------------------- the four card panels */
#checks .panel { --p-h: 300px; }
#checks .stage > .mini-host { --fit-max: 440px; --ax: max(24px, 50% - 220px); --ay: 40px; --ay-sm: 24px; }
.mini { width: 100%; padding: var(--s-4); display: grid; gap: 0; font: 400 14px/1.4 var(--font-text); color: var(--u-ink); }
.mini__h { margin: 0 0 var(--s-2); font: 500 13px/1.3 var(--font-text); color: var(--u-muted); }
.mini__row { display: grid; grid-template-columns: minmax(84px, auto) minmax(0, 1fr) auto; align-items: center; gap: var(--s-3); padding: var(--s-3) 0; border-top: 1px solid var(--u-line); }
.mini__row b { font: 500 13px/1 var(--font-mono); }
.mini__row span { color: var(--u-muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini__row em { font: 500 13px/1 var(--font-text); font-style: normal; padding: var(--s-1) var(--s-2); border-radius: var(--r-sm); background: var(--u-fill-2); }
.mini__row em[data-tone="danger"] { color: #ffffff; background: var(--heat-4); }
.mini__row em[data-tone="clear"] { color: var(--u-ink); background: var(--u-bg); box-shadow: inset 0 0 0 1px var(--u-line-2); }
.mini__twin { display: grid; gap: 4px; padding: 12px 0; border-top: 1px solid var(--u-line); }
.mini__twin b { font: 500 14px/1.3 var(--font-text); }
.mini__twin span { font-size: 13px; color: var(--u-muted); }
.mini__twin code { font: 400 13px/1 var(--font-mono); color: var(--u-ink); }
.mini__twin code[data-same] { background: var(--heat-1); padding: 2px var(--s-1); border-radius: 4px; }
@media (max-width: 639px) { #checks .panel { --p-h: 156px; } }
/* tablet: the cards stay two up, so each screen of the section holds its two cards */
@media (min-width: 640px) and (max-width: 1023px) { #checks .grid > .card { grid-column: auto / span 6; } #checks .panel { --p-h: 50svh; } }

/* ---------------------------------------------------------------- the statement moment */
.statement__head { max-width: none; }
.statement__head .mo-lt__type { font-size: clamp(44px, 9vw, 96px); line-height: 1; letter-spacing: var(--display-tracking-xl); max-width: 14ch; }
.statement__head p { max-width: 52ch; }

#copies .wrap { display: grid; align-content: start; gap: var(--s-9); }
.share { display: grid; gap: var(--s-4); }
.share__bar { height: clamp(96px, 22svh, 240px); border-radius: var(--r-md); background: var(--p-surface); overflow: hidden; }
.share__bar i { display: block; height: 100%; background: var(--heat-3); border-radius: var(--r-md) 0 0 var(--r-md); }
.share__legend { display: flex; justify-content: space-between; gap: var(--s-4); flex-wrap: wrap; font-size: 16px; color: var(--muted); }
.share__legend b { font: 500 var(--t-lead)/1 var(--font-text); color: var(--ink); margin-right: var(--s-1); }
@media (max-width: 639px) { .share__bar { height: 56px; } }

/* ---------------------------------------------------------------- the API window on the dark band */
.code-win { background: var(--u-bg); border: 1px solid var(--u-border); border-radius: var(--u-r); overflow: hidden; --fx-bg: #141414; --fx-ink: #f4f4f5; --fx-muted: #a3a3a3; }
.code-win pre { margin: 0; padding: var(--s-5); white-space: pre-wrap; overflow-wrap: anywhere; font: 400 14px/1.75 var(--font-mono); color: var(--u-text-2); }
.code-win .c-dim { color: var(--u-muted); }
.code-win .c-str { color: var(--heat-1); }
.code-win .c-key { color: #ffffff; }

/* ---------------------------------------------------------------- the close's word */
.close__word { font-family: var(--font-display); line-height: 1; }

/* phone: the checker window fills its frame and the verdict rows stack */
@media (max-width: 639px) { .hero--centred .hero__window > .ck { top: var(--s-3); left: var(--s-3); right: var(--s-3); width: auto; transform: none; } .ck__result { padding: var(--s-3) var(--s-3) 64px; } .vd__row { grid-template-columns: minmax(0, 1fr); gap: 2px; } }

/* phone: the closing word is decoration (aria-hidden), so the close and footer keep to one screen */
@media (max-width: 639px) { .close__word { display: none; } #api .code-win .ck__bar { display: none; } .code-win pre { padding: var(--s-4); }
  /* five open answers run past one phone screen; the last (not affiliated) is also in the footer line */
  .faq > .faq__item:nth-child(5) { display: none; } }

/* tablet, held upright: the API window and the open answers take more of the tall screen so the gaps
   between these sections match the rest of the page */
@media (min-width: 640px) and (max-width: 1023px) {
  .code-win { min-height: 40svh; }
  .code-win pre { font-size: 15px; }
  .faq > .faq__item { padding: 3svh 0; }
}

/* phone: the example chips would push the verdict out of the hero window; the case browser below holds the
   same real cases */
@media (max-width: 639px) { .ck__chips { display: none; } }

/* ---------------------------------------------------------------- app pages: /check and each subject's verdict page */
.ck__chip { display: inline-flex; align-items: center; text-decoration: none; }
/* app pages size to their content: the kit's one-section-per-screen heights are for the landing page */
main.vp > .section { height: auto; min-height: 0; }
main.vp > .section > .wrap { height: auto; }
main.vp > .vp__top { padding: calc(var(--nav-h, 72px) + var(--s-7)) 0 var(--s-8); }
.vp__crumbs ol { list-style: none; margin: 0 0 var(--s-5); padding: 0; display: flex; flex-wrap: wrap; gap: var(--s-2); font: 400 13px/1.4 var(--font-text); color: var(--muted); }
.vp__crumbs li + li::before { content: "/"; margin-right: var(--s-2); opacity: .5; }
.vp__crumbs a { color: var(--muted); text-decoration: none; }
.vp__crumbs a:hover { color: var(--ink); }
.vp__crumbs [aria-current] { color: var(--ink); }
.vp__head { display: grid; gap: var(--s-2); margin-bottom: var(--s-6); max-width: 60rem; }
.vp__head h1 { margin: 0; font: var(--display-weight) clamp(2rem, 1.2rem + 3vw, 3.5rem)/1.05 var(--font-display); letter-spacing: var(--display-tracking); overflow-wrap: anywhere; }
.vp__sub { margin: 0; font: 400 14px/1.5 var(--font-mono); color: var(--muted); }
.vp__body { align-items: start; }
.vp__card { padding: var(--s-5) var(--s-6); background: var(--u-bg); border: 1px solid var(--u-border); border-radius: var(--u-r); box-shadow: var(--u-shadow); }
.vp__empty { display: grid; gap: var(--s-2); }
.vp__side { display: grid; gap: var(--s-5); }
.vp__facts { margin: 0; display: grid; border-top: 1px solid var(--line); }
.vp__facts > div { display: grid; grid-template-columns: minmax(0, 9rem) minmax(0, 1fr); gap: var(--s-3); padding: var(--s-3) 0; border-bottom: 1px solid var(--line); }
.vp__facts dt { font: 400 13px/1.5 var(--font-text); color: var(--muted); }
.vp__facts dd { margin: 0; font: 400 14px/1.5 var(--font-mono); color: var(--ink); overflow-wrap: anywhere; }
.vp__addr { color: var(--ink); text-decoration: underline; text-decoration-color: color-mix(in oklab, var(--ink) 30%, transparent); text-underline-offset: 3px; }
.vp__addr:hover { text-decoration-color: var(--ink); }
.vp__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3) var(--s-5); }
.vp__check { max-width: 880px; }
.vp__check .ck { border-bottom: 1px solid var(--u-border); border-radius: var(--u-r); }
.vp__check .ck__form { border-bottom: 0; }
main.vp > .vp__more { padding: 0 0 var(--s-9); }
.vp__more-head { display: grid; gap: var(--s-2); margin-bottom: var(--s-4); max-width: 44rem; }
.vp__more-head h2 { margin: 0; font: var(--display-weight) var(--t-h3)/1.2 var(--font-display); letter-spacing: var(--display-tracking); }
.vp__more-head p { margin: 0; }
.vp__list { list-style: none; margin: 0; padding: var(--s-2); display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); gap: 2px; background: var(--u-bg); border: 1px solid var(--u-border); border-radius: var(--u-r); }
.vp__list a { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px var(--s-3); min-height: 44px; padding: var(--s-2) var(--s-3); border-radius: var(--u-r2); color: var(--u-ink); text-decoration: none; transition: background-color .16s var(--ease); }
.vp__list-label { font: 500 14px/1.35 var(--font-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vp__list-sub { grid-column: 1; font: 400 13px/1.35 var(--font-mono); color: var(--u-muted); }
.vp__list em { grid-column: 2; grid-row: 1 / span 2; align-self: center; font: 500 12px/1.3 var(--font-text); font-style: normal; color: var(--u-muted); text-align: right; max-width: 11rem; }
@media (hover: hover) and (pointer: fine) { .vp__list a:hover { background: var(--u-fill); } }
.vp__pager { display: flex; justify-content: space-between; align-items: center; gap: var(--s-4); margin-top: var(--s-4); font: 400 14px/1.4 var(--font-text); color: var(--muted); }
.vp__pager a { color: var(--ink); }
.cb__more { display: inline-block; margin-top: var(--s-4); }
.footer--slim { padding-block: var(--s-8) var(--s-6); }
@media (max-width: 1023px) { .vp__body > .span-8, .vp__body > .span-4 { grid-column: 1 / -1; } }
@media (max-width: 639px) { .vp__card { padding: var(--s-4); } .vp__facts > div { grid-template-columns: minmax(0, 1fr); gap: 2px; } }
.vp__note { font: 400 12px/1.4 var(--font-text); color: var(--muted); }
.ck--preview .ck__bar { justify-content: flex-start; }
.ck__open { margin-left: auto; font: 500 13px/1 var(--font-text); color: var(--u-ink); text-decoration: underline; text-decoration-color: color-mix(in oklab, var(--u-ink) 30%, transparent); text-underline-offset: 3px; white-space: nowrap; }
.ck__open:hover { text-decoration-color: var(--u-ink); }
