/* Dip Planet ($DIPLANET) — one night at the telescope */
@font-face { font-family: "Epilogue"; src: url("../assets/fonts/Epilogue-ExtraBold.woff2") format("woff2"); font-weight: 800; font-display: swap; }
@font-face { font-family: "Epilogue"; src: url("../assets/fonts/Epilogue-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Wix Madefor Text"; src: url("../assets/fonts/Wix-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Wix Madefor Text"; src: url("../assets/fonts/Wix-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Lilex"; src: url("../assets/fonts/Lilex-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Lilex"; src: url("../assets/fonts/Lilex-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Gelasio"; src: url("../assets/fonts/Gelasio-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Gelasio"; src: url("../assets/fonts/Gelasio-Italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }

:root {
  --night: #070A18; --panel: #0D1430; --panel2: #121B3E; --line: #25305C; --ink: #E8ECF8; --muted: #95A0C6;
  --teal: #5EE0CE; --amber: #FFB547; --rose: #FF6E8A; --lime: #A3E36A; --violet: #8F7CFF;
  --paper: #EEF1F7; --paper-ink: #1A2240; --paper-line: #B9C2D8;
  --head: "Epilogue", "Lilex", system-ui, sans-serif; --body: "Wix Madefor Text", "Lilex", system-ui, sans-serif; --mono: "Lilex", ui-monospace, monospace; --serif: "Gelasio", "Lilex", Georgia, serif;
  --gut: max(16px, calc((100% - 1180px) / 2));
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--ink); font: 400 16.5px/1.6 var(--body); overflow-x: hidden;
  background: linear-gradient(180deg, #3A2456 0, #2A1E52 380px, #141A41 900px, #080C1D 1500px, var(--night) 60%, var(--night) 88%, #1A1438 94%, #4A2A57 97.5%, #C9714F 100%);
}
img { max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-family: var(--head); font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: clamp(36px, 5.2vw, 62px); line-height: 1; margin: 8px 0 14px; }
h3 { font-size: 22px; line-height: 1.2; }
p { margin: 0 0 14px; }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }
.ut { font: 400 14px/1.2 var(--mono); color: var(--muted); margin: 0; display: flex; align-items: baseline; gap: 12px; }
.ut span { font-weight: 600; font-size: 22px; color: var(--amber); letter-spacing: .02em; }
.sec-lede { color: var(--muted); max-width: 760px; }
.night { position: relative; padding: clamp(70px, 9vw, 120px) var(--gut) 0; }
.night::before { content: ""; position: absolute; left: var(--gut); right: var(--gut); top: clamp(34px, 4.5vw, 60px); border-top: 1px dashed rgba(149, 160, 198, .22); }

.btn { display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 6px; padding: 12px 20px; font: 600 15.5px/1 var(--body); text-decoration: none; transition: transform .15s, background .15s; }
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-amber { background: var(--amber); color: #20140A; }
.btn-line { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn-line:hover { box-shadow: inset 0 0 0 1.5px var(--teal); }
.chip { border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 999px; padding: 4px 10px; font-size: 13px; }
.chip:hover { border-color: var(--teal); }

/* stars over the whole night (fade away at dawn) */
main { position: relative; }
main::before { content: ""; position: absolute; inset: -900px 0 0; z-index: -1; pointer-events: none; opacity: .55;
  background-image: radial-gradient(1px 1px at 20px 30px, #fff, transparent), radial-gradient(1px 1px at 140px 90px, #cfe, transparent), radial-gradient(1.4px 1.4px at 260px 40px, #fff, transparent), radial-gradient(1px 1px at 320px 180px, #ffe9c4, transparent), radial-gradient(1px 1px at 90px 220px, #fff, transparent), radial-gradient(1.2px 1.2px at 200px 260px, #dfe7ff, transparent);
  background-size: 360px 300px; -webkit-mask-image: linear-gradient(180deg, transparent, #000 8%, #000 80%, transparent); mask-image: linear-gradient(180deg, transparent, #000 8%, #000 80%, transparent); }

/* ------------------------------------------------------------ dusk */
.dusk { position: relative; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 24px clamp(24px, 4vw, 60px); padding: clamp(40px, 6vw, 80px) var(--gut) 0; align-items: center; }
.dusk::after { content: ""; position: absolute; inset: 0 0 auto; height: 220px; z-index: -1; background: radial-gradient(ellipse at 70% 0, rgba(255, 150, 90, .35), transparent 70%); }
.dusk h1 { font-size: clamp(42px, 6.4vw, 84px); line-height: .98; margin: 18px 0 20px; }
.dusk h1 em { font-style: normal; color: var(--amber); }
.lede { font-size: clamp(16.5px, 1.4vw, 18.5px); max-width: 600px; color: #D8DEF2; }
.lede b { color: var(--teal); font-family: var(--mono); font-weight: 600; }
.dusk-cta { display: flex; gap: 12px; flex-wrap: wrap; margin: 22px 0 16px; }
.dusk-coin { font-size: 14.5px; color: var(--muted); }
.ring-fig { margin: 0; justify-self: center; width: min(470px, 100%); }
#ring { display: block; width: 100%; aspect-ratio: 1; }
.ring-fig figcaption { display: grid; gap: 4px; font-size: 13.5px; color: var(--muted); text-align: center; }
.ring-fig figcaption b { font: 600 20px/1 var(--mono); color: var(--amber); }
.dipnav { grid-column: 1 / -1; margin-top: clamp(20px, 3vw, 40px); }
.dipnav ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); }
.dipnav a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding-bottom: 6px; text-decoration: none; font: 500 14.5px/1.2 var(--head); text-align: center; color: var(--ink); }
.dipnav a::before { content: ""; display: block; width: 100%; height: 46px; margin-bottom: 4px; transition: transform .25s;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 46' preserveAspectRatio='none'%3E%3Cpath d='M0 10 H34 C40 10 40 38 46 38 H54 C60 38 60 10 66 10 H100' fill='none' stroke='%235EE0CE' stroke-width='2.5' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E") center / 100% 100% no-repeat; }
.dipnav a:hover::before, .dipnav a:focus-visible::before { transform: scaleY(1.25); filter: drop-shadow(0 0 6px rgba(94, 224, 206, .6)); }
.dipnav i { font: normal 400 12px/1 var(--mono); color: var(--amber); }

/* ------------------------------------------------------------ the story */
.story-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: clamp(20px, 3vw, 40px); align-items: start; margin-top: 18px; }
.obslog { width: 100%; border-collapse: collapse; font-size: 15px; }
.obslog caption { text-align: left; font: 400 13px/1.3 var(--mono); color: var(--muted); padding-bottom: 10px; }
.obslog th { text-align: left; font: 400 12.5px/1 var(--mono); color: var(--muted); padding: 0 12px 8px 0; border-bottom: 1px solid var(--line); }
.obslog td { padding: 12px 14px 12px 0; border-bottom: 1px solid rgba(37, 48, 92, .7); vertical-align: top; }
.obslog td:first-child { font: 600 14px/1.5 var(--mono); color: var(--amber); white-space: nowrap; width: 128px; }
.obslog b { color: var(--teal); font-weight: 600; }
.obslog tr.next td { color: #fff; }
.obslog tr.next td:first-child { color: var(--lime); }
.lessons { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 22px; }
.lessons h3 { margin-bottom: 16px; }
.lesson { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 12px; margin-bottom: 14px; }
.lesson .n { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font: 800 18px/1 var(--head); color: #20140A; background: var(--amber); }
.lesson b { color: #fff; }
.lessons .src { font-size: 13px; color: var(--muted); margin: 6px 0 0; border-top: 1px dashed var(--line); padding-top: 12px; }

/* ------------------------------------------------------------ the lab */
.lab-grid { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 22px; margin-top: 20px; align-items: start; }
.queue { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.q-h { font: 400 12.5px/1.2 var(--mono); color: var(--muted); margin: 0 0 8px; }
.q-item { display: flex; gap: 10px; align-items: flex-start; padding: 9px 10px; border-radius: 8px; cursor: pointer; border: 1px solid transparent; }
.q-item:has(input:checked) { background: var(--panel2); border-color: var(--teal); }
.q-item input { accent-color: var(--teal); margin-top: 4px; }
.q-item b { display: block; font-size: 15px; }
.q-item i { font-style: normal; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.star-in, .knobs { margin-top: 14px; border-top: 1px dashed var(--line); padding-top: 12px; }
.star-in label { display: grid; grid-template-columns: 54px 78px minmax(0, 1fr); align-items: center; gap: 8px; font-size: 14px; margin-bottom: 6px; }
.star-in input { width: 100%; background: var(--night); color: var(--ink); border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; font: 400 14px var(--mono); }
.star-in span { font-size: 12.5px; color: var(--muted); }
.knobs label { display: grid; grid-template-columns: minmax(0, 1fr) 56px; gap: 4px 8px; font-size: 14px; margin-bottom: 8px; }
.knobs input { grid-column: 1 / -1; grid-row: 2; accent-color: var(--amber); width: 100%; }
.knobs output { font: 400 13.5px var(--mono); color: var(--amber); text-align: right; }
.run { width: 100%; justify-content: center; margin-top: 10px; }
.tries { font: 400 13px/1.4 var(--mono); color: var(--muted); margin: 10px 0 0; }
.tries b { color: var(--amber); font-weight: 600; }
.screens { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.scr { margin: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 12px 8px; min-width: 0; }
.scr:first-child { grid-column: 1 / -1; }
.scr figcaption { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 13.5px; color: var(--muted); margin-bottom: 6px; }
.scr figcaption b { color: var(--ink); font-weight: 600; font-family: var(--head); font-size: 15px; }
.scr canvas { display: block; width: 100%; height: 210px; }
.scr:first-child canvas { height: 190px; }
.cand { grid-column: 1 / -1; background: linear-gradient(90deg, rgba(255, 181, 71, .12), transparent 70%), var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--amber); border-radius: 12px; padding: 14px 16px; }
.cand-h { font: 400 12.5px var(--mono); color: var(--muted); margin: 0 0 6px; }
.cand dl { margin: 0; display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(0, 1.6fr) repeat(4, minmax(0, .8fr)) minmax(0, 1.5fr); gap: 10px; }
.cand dt { font-size: 12.5px; color: var(--muted); }
.cand dd { margin: 0; font: 600 16px/1.25 var(--mono); color: #fff; overflow-wrap: break-word; }
.verdict { margin: 12px 0 0; font: 800 20px/1.2 var(--head); }
.verdict.good { color: var(--lime); } .verdict.warn { color: var(--amber); } .verdict.bad { color: var(--rose); }

/* ------------------------------------------------------------ vet */
.lamps { list-style: none; margin: 20px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 18px; }
.lamps li { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 4px 12px; align-items: start; padding: 12px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
.lamps li.lamp-empty { display: block; color: var(--muted); grid-column: 1 / -1; }
.lamp { width: 18px; height: 18px; border-radius: 50%; margin-top: 3px; background: #333A55; box-shadow: inset 0 0 0 2px rgba(0,0,0,.4); }
.lamp.pass { background: var(--lime); box-shadow: 0 0 12px rgba(163, 227, 106, .7); }
.lamp.warn { background: var(--amber); box-shadow: 0 0 12px rgba(255, 181, 71, .7); }
.lamp.fail { background: var(--rose); box-shadow: 0 0 12px rgba(255, 110, 138, .8); }
.lamps b { font-weight: 600; }
.lamps .val { font: 600 15px var(--mono); color: #fff; }
.lamps .note { grid-column: 2 / -1; font-size: 13.5px; color: var(--muted); }
.lamps .rule { grid-column: 2 / -1; font: 400 12px var(--mono); color: #6E79A3; }
.luck { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 20px; margin-top: 26px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 20px; }
.luck h3 { margin-bottom: 8px; }
.luck p { color: #CDD4EC; font-size: 15px; }
.null-prog { font: 400 13px var(--mono); color: var(--amber); }
#cvNull { display: block; width: 100%; height: 150px; }
.luck-b { border-left: 1px dashed var(--line); padding-left: 20px; }
.lk-h { font: 400 12.5px var(--mono); color: var(--muted); }
.luck-b input { width: 100%; accent-color: var(--amber); }
.lk-k { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; }
.lk-k output { font: 600 26px/1 var(--mono); color: var(--amber); }
.lk-big { font: 800 clamp(40px, 5vw, 64px)/1 var(--head); margin: 16px 0 8px; color: #fff; }
.lk-big.good { color: var(--lime); } .lk-big.warn { color: var(--amber); } .lk-big.bad { color: var(--rose); }
.lk-note { font-size: 14px; color: var(--muted) !important; }

/* ------------------------------------------------------------ seal */
.seal-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 22px; margin-top: 20px; align-items: start; }
.window { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.window label { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14.5px; margin-bottom: 8px; }
.window input { width: 78px; background: var(--night); color: var(--ink); border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; font: 400 14px var(--mono); }
.window span { color: var(--muted); font-size: 13.5px; }
#cvTl { display: block; width: 100%; height: 150px; margin: 8px 0; }
.tl-note { font-size: 13.5px; color: var(--muted); }
.envelope { position: relative; background: #E9DFC8; color: #2A2112; border-radius: 6px; padding: 54px 22px 20px; box-shadow: 0 24px 40px -24px rgba(0,0,0,.9); overflow: hidden; }
.env-flap { position: absolute; inset: 0 0 auto; height: 70px; background: linear-gradient(170deg, #DCCFB2 50%, transparent 50.5%), linear-gradient(190deg, #D7C9AA 50%, transparent 50.5%); }
.envelope.sealed .env-flap::after { content: ""; position: absolute; right: 22px; top: 16px; width: 56px; height: 56px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #E2565E, #9B1E2B 70%); box-shadow: 0 3px 6px rgba(0,0,0,.4); }
.env-h { position: relative; font: 800 20px var(--head); margin: 18px 0 8px; }
.env-empty { color: #6B5B3E; }
.env-body { margin: 0; display: grid; gap: 6px; }
.env-body div { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 10px; font-size: 14px; }
.env-body dt { color: #6B5B3E; }
.env-body dd { margin: 0; font-family: var(--mono); overflow-wrap: anywhere; }
.env-body .hash dd { font-size: 12px; }
.env-act { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; }
.envelope .btn-line { color: #2A2112; box-shadow: inset 0 0 0 1.5px #A8946C; }
.tamper-out { margin: 10px 0 0; font-weight: 600; font-size: 14px; }
.tamper-out.bad { color: #9B1E2B; }
.open { margin-top: 24px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 20px; }
.open h3 { margin-bottom: 6px; }
.open > p { color: #CDD4EC; }
.sky { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 14px; }
.sky label { cursor: pointer; }
.sky input { position: absolute; opacity: 0; }
.sky span { display: inline-block; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); font-size: 14.5px; }
.sky input:checked + span { border-color: var(--teal); background: rgba(94, 224, 206, .12); color: #fff; }
.sky input:focus-visible + span { outline: 2px solid var(--amber); outline-offset: 2px; }
.outcomes { list-style: none; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.outcomes li { padding: 14px; border-radius: 10px; border: 1px solid var(--line); opacity: .45; transition: opacity .3s, transform .3s; }
.outcomes li b { display: block; font: 800 18px var(--head); }
.outcomes li span { font-size: 13px; color: var(--muted); }
.outcomes li.on { opacity: 1; transform: translateY(-3px); border-color: currentColor; }
.outcomes li[data-o="recovered"].on { color: var(--lime); background: rgba(163, 227, 106, .08); }
.outcomes li[data-o="inconsistent"].on { color: var(--amber); background: rgba(255, 181, 71, .08); }
.outcomes li[data-o="excluded"].on { color: var(--rose); background: rgba(255, 110, 138, .08); }
.outcomes li[data-o="insufficient data"].on { color: var(--violet); background: rgba(143, 124, 255, .1); }
.judge-out { margin: 14px 0 0; font-size: 15px; }

/* ------------------------------------------------------------ the chain */
.chain-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); grid-template-areas: "ccd fits" "ccd wheel"; gap: 20px; margin-top: 20px; }
.ccd { grid-area: ccd; margin: 0; }
.ccd-chip { position: relative; height: clamp(420px, 44vw, 600px); background: #0A0F21; border: 10px solid #1B2349; border-right-width: 26px; border-radius: 6px; box-shadow: 0 0 0 1px #3A4680, 0 30px 50px -28px rgba(0,0,0,.9);
  background-image: linear-gradient(rgba(94,224,206,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(94,224,206,.06) 1px, transparent 1px); background-size: 16px 16px; }
.ccd-chip iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }
.ccd-wait { position: absolute; inset: 0; display: grid; place-items: center; font: 400 15px var(--mono); color: var(--muted); z-index: 1; background: #0A0F21; transition: opacity .4s; }
.ccd-wait.off { opacity: 0; pointer-events: none; }
.amp { position: absolute; z-index: 2; font: 600 10px/1 var(--mono); color: #7883B3; letter-spacing: .1em; }
.amp.a1 { left: -6px; top: -16px; } .amp.a2 { right: -18px; bottom: -17px; }
.bias { position: absolute; top: 0; bottom: 0; right: -24px; width: 20px; z-index: 2; background: repeating-linear-gradient(180deg, #232C58 0 3px, #182045 3px 6px); }
.ccd figcaption { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; font: 400 13px var(--mono); color: var(--muted); margin-top: 12px; }
.ccd figcaption a { color: var(--teal); }
.fits { grid-area: fits; background: #0B1026; border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; min-width: 0; transition: box-shadow .3s; }
.fits.ok { box-shadow: 0 0 0 2px var(--teal); }
.fits-h { font: 400 12.5px var(--mono); color: var(--muted); margin: 0 0 8px; }
.cards { margin: 0; font: 400 13px/1.75 var(--mono); color: #C8D0EE; white-space: pre-wrap; overflow-wrap: anywhere; }
.cards .kw { color: var(--teal); }
.cards .v, .cards #caText { color: #fff; }
.cards #stChg.up { color: var(--lime); } .cards #stChg.down { color: var(--rose); }
.fits-act { display: flex; align-items: center; gap: 12px; margin: 10px 0 0; flex-wrap: wrap; }
.fits-act button { border: 0; border-radius: 6px; padding: 9px 14px; background: var(--teal); color: #06221E; font: 600 14px var(--mono); }
.fits-ok { font: 400 13px var(--mono); color: var(--lime); }
.wheel-box { grid-area: wheel; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.wheel { position: relative; list-style: none; margin: 6px auto 0; padding: 0; width: 250px; height: 250px; border-radius: 50%; background: radial-gradient(circle, #0A0F21 0 26px, #1B2349 27px 30px, #141B3C 31px); box-shadow: inset 0 0 0 8px #1B2349, 0 0 0 1px #3A4680; }
.wheel li { position: absolute; left: 50%; top: 50%; width: 92px; height: 92px; margin: -46px 0 0 -46px; }
.wheel .f1 { transform: translate(0, -74px); } .wheel .f2 { transform: translate(74px, 0); } .wheel .f3 { transform: translate(0, 74px); } .wheel .f4 { transform: translate(-74px, 0); }
.wheel a { display: grid; place-items: center; align-content: center; gap: 2px; width: 100%; height: 100%; border-radius: 50%; text-decoration: none; text-align: center; font: 600 11.5px/1.1 var(--body); color: #fff; transition: transform .2s, box-shadow .2s; box-shadow: inset 0 0 0 3px rgba(255,255,255,.15); }
.wheel .f1 a { background: radial-gradient(circle at 35% 30%, rgba(94,224,206,.75), rgba(15,70,64,.95)); }
.wheel .f2 a { background: radial-gradient(circle at 35% 30%, rgba(255,181,71,.75), rgba(95,52,0,.95)); }
.wheel .f3 a { background: radial-gradient(circle at 35% 30%, rgba(143,124,255,.75), rgba(40,26,110,.95)); }
.wheel .f4 a { background: radial-gradient(circle at 35% 30%, rgba(255,110,138,.75), rgba(100,16,38,.95)); }
.wheel a:hover, .wheel a:focus-visible { transform: scale(1.08); box-shadow: inset 0 0 0 3px rgba(255,255,255,.5), 0 0 18px rgba(255,255,255,.3); }
.wheel img { width: 26px; height: 26px; border-radius: 6px; object-fit: contain; background: rgba(255,255,255,.9); padding: 2px; }
.wheel span { max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ------------------------------------------------------------ the proposal */
.form { margin-top: 22px; background: var(--paper); color: var(--paper-ink); border-radius: 4px; padding: clamp(18px, 3vw, 36px); font: 400 17px/1.65 var(--serif); box-shadow: 0 30px 60px -30px rgba(0,0,0,.9); }
.form-top { border: 2px solid var(--paper-ink); padding: 16px 18px; margin-bottom: 18px; }
.f-id { font: 600 12.5px var(--mono); letter-spacing: .04em; color: #4A5578; margin-bottom: 8px; }
.form h3 { font-size: clamp(22px, 2.6vw, 30px); line-height: 1.15; letter-spacing: -0.01em; margin-bottom: 14px; }
.f-meta { margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--paper-line); }
.f-meta div { padding: 10px 12px 2px 0; }
.f-meta dt { font: 600 11.5px var(--mono); color: #4A5578; text-transform: uppercase; letter-spacing: .06em; }
.f-meta dd { margin: 0; font-size: 15px; }
.f-box { border: 1px solid var(--paper-line); border-top: 3px solid var(--paper-ink); padding: 14px 18px 4px; margin-bottom: 16px; }
.f-n { font: 800 15px var(--head); letter-spacing: 0; margin-bottom: 8px; }
.form p { max-width: 74ch; }
.f-table { width: 100%; border-collapse: collapse; font: 400 14px/1.4 var(--mono); margin: 4px 0 16px; }
.f-table caption { text-align: left; font: italic 400 15px var(--serif); padding-bottom: 6px; }
.f-table th { text-align: left; border-bottom: 2px solid var(--paper-ink); padding: 6px 8px 6px 0; font-weight: 600; font-size: 12.5px; }
.f-table td { border-bottom: 1px solid var(--paper-line); padding: 6px 8px 6px 0; }
.f-table td.v-good { color: #2E7D32; font-weight: 600; } .f-table td.v-warn { color: #9A6100; font-weight: 600; } .f-table td.v-bad { color: #B3243F; font-weight: 600; }
.inj { display: grid; grid-template-columns: 64px repeat(4, minmax(0, 1fr)); gap: 6px; margin: 6px 0 4px; font: 400 12.5px var(--mono); }
.inj .hd { display: grid; place-items: center; color: #4A5578; font-weight: 600; }
.inj .cell { position: relative; background: #fff; border: 1px solid var(--paper-line); border-radius: 4px; aspect-ratio: 1.5; min-width: 0; }
.inj .cell canvas { display: block; width: 100%; height: 100%; }
.inj .cell .tag { position: absolute; right: 4px; top: 3px; font: 600 12px var(--mono); }
.inj .cell.ok .tag { color: #2E7D32; } .inj .cell.miss .tag { color: #B3243F; }
.inj .cell.wait { background: repeating-linear-gradient(45deg, #fff 0 6px, #F2F4F9 6px 12px); }
.f-cap { font: italic 400 15px var(--serif); color: #4A5578; }
.f-steps, .f-refs { padding-left: 22px; margin: 0 0 14px; }
.f-steps li, .f-refs li { margin-bottom: 6px; }
.f-refs { font-size: 15px; }

/* ------------------------------------------------------------ the manual (a man page) */
.man { margin-top: 20px; background: #050816; border: 1px solid var(--line); border-radius: 10px; padding: clamp(14px, 2.5vw, 28px); font: 400 14px/1.7 var(--mono); color: #C8D0EE; max-height: 680px; overflow: auto; }
.man .mh { display: flex; justify-content: space-between; color: var(--muted); margin-bottom: 14px; gap: 10px; flex-wrap: wrap; }
.man h4 { margin: 18px 0 4px; font: 600 14px var(--mono); color: var(--amber); }
.man p, .man dl { margin: 0 0 8px 3ch; max-width: 92ch; }
.man p.mh { margin: 0 0 14px; max-width: none; }
.man p.mh:last-child { margin: 22px 0 0; }
.man dt { color: var(--teal); }
.man dd { margin: 0 0 10px 4ch; }
.man code { color: #fff; overflow-wrap: anywhere; }

/* ------------------------------------------------------------ the plate archive */
.plate-grid { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 18px; margin-top: 20px; align-items: start; }
.drawer { list-style: none; margin: 0; padding: 12px; background: #1A1430; border-radius: 10px; box-shadow: inset 0 0 0 1px #3B2F61; display: grid; gap: 8px; max-height: 640px; overflow: auto; }
.drawer button { width: 100%; text-align: left; border: 0; border-radius: 4px; padding: 10px 12px; background: linear-gradient(135deg, rgba(200,214,255,.14), rgba(120,140,200,.06)); color: var(--ink); box-shadow: inset 0 0 0 1px rgba(200,214,255,.18); display: grid; gap: 2px; }
.drawer button.on { box-shadow: inset 0 0 0 2px var(--amber); background: rgba(255,181,71,.12); }
.drawer .fn { font: 600 14px var(--mono); overflow-wrap: anywhere; }
.drawer .fm { font: italic 400 13px var(--serif); color: var(--muted); }
.drawer .fh { font: 400 11px var(--mono); color: #6E79A3; overflow-wrap: anywhere; }
.viewer { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; min-width: 0; }
.vw-h { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--line); margin: 0; font-size: 14px; }
.vw-h b { font-family: var(--mono); }
.vw-h span { color: var(--muted); font: 400 12.5px var(--mono); }
.vw-body { max-height: 600px; overflow: auto; }
.code { margin: 0; padding: 12px 0; font: 400 13px/1.6 var(--mono); counter-reset: ln; }
.code span { display: block; padding: 0 16px 0 0; white-space: pre; }
.code span::before { counter-increment: ln; content: counter(ln); display: inline-block; width: 4.5ch; margin-right: 2ch; text-align: right; color: #4E5A88; }
.md { padding: 16px 22px; font-size: 15.5px; }
.md h1, .md h2, .md h3 { font-size: 22px; margin: 18px 0 8px; letter-spacing: -0.01em; }
.md h1 { font-size: 30px; margin-top: 4px; }
.md code { font: 400 13.5px var(--mono); background: var(--night); padding: 1px 5px; border-radius: 4px; }
.md pre { background: var(--night); padding: 12px; border-radius: 8px; overflow: auto; }
.md pre code { background: none; padding: 0; }
.md table { border-collapse: collapse; font-size: 14px; margin: 8px 0 14px; display: block; overflow-x: auto; }
.md th, .md td { border-bottom: 1px solid var(--line); padding: 6px 10px 6px 0; text-align: left; vertical-align: top; }
.md li { margin-bottom: 4px; }
.get { margin-top: 22px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px 24px; }
.get-h { font: 400 12.5px var(--mono); color: var(--muted); margin: 0 0 8px; grid-column: 1 / -1; }
.get-row { display: flex; flex-wrap: wrap; gap: 10px; grid-column: 1 / -1; }
.cmd { margin: 0; background: #050816; border: 1px solid var(--line); border-radius: 8px; padding: 14px; font: 400 13.5px/1.7 var(--mono); color: var(--teal); white-space: pre-wrap; overflow-wrap: anywhere; }
.verify textarea { width: 100%; background: #050816; color: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 10px; font: 400 13px var(--mono); resize: vertical; }
.verify p { margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ledger-out { font: 400 13.5px var(--mono); }
.ledger-out.ok { color: var(--lime); } .ledger-out.bad { color: var(--rose); }

/* ------------------------------------------------------------ dawn */
.dawn { position: relative; padding: clamp(80px, 10vw, 130px) var(--gut) 34px; text-align: center; }
.dawn .ut { justify-content: center; color: #E9D8E8; }
.dome-wrap { position: relative; width: min(620px, 100%); margin: 20px auto 0; }
.dome { display: block; width: 100%; height: auto; }
.dome .hill { fill: #1A1032; } .dome .tower { fill: #2A1E48; } .dome .cap { fill: #3A2C5E; } .dome .door { fill: #120B24; }
.shutter { list-style: none; margin: 0; padding: 0; position: absolute; left: 50%; top: 9%; width: 30%; transform: translateX(-50%); display: grid; gap: 3px; }
.shutter a { display: block; padding: 6px 4px; background: linear-gradient(180deg, #5B4A88, #43356D); color: #F3E9FF; text-decoration: none; font: 600 clamp(10.5px, 1.6vw, 13.5px)/1.2 var(--body); border-radius: 2px; box-shadow: inset 0 -2px 0 rgba(0,0,0,.25); transition: transform .2s, background .2s; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shutter a:hover, .shutter a:focus-visible { background: linear-gradient(180deg, #FFB547, #E0892E); color: #20140A; transform: translateX(6px); }
.plaque { position: absolute; left: 50%; bottom: 31%; transform: translateX(-50%); margin: 0; padding: 4px 10px; background: linear-gradient(180deg, #E6C77A, #B08932); color: #2A1E08; font: 600 12px var(--mono); border-radius: 3px; white-space: nowrap; }
.dawn-fine { font-size: 13.5px; color: #F7E4DA; max-width: 720px; margin: 20px auto 0; }

/* ------------------------------------------------------------ responsive */
@media (max-width: 1060px) {
  .dusk { grid-template-columns: minmax(0, 1fr); }
  .ring-fig { width: min(400px, 100%); }
  .lab-grid { grid-template-columns: minmax(0, 1fr); }
  .queue { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 16px; }
  .queue .q-h:first-child, .run, .tries { grid-column: 1 / -1; }
  .story-grid, .seal-grid, .luck { grid-template-columns: minmax(0, 1fr); }
  .luck-b { border-left: 0; padding-left: 0; border-top: 1px dashed var(--line); padding-top: 16px; }
  .chain-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "ccd" "fits" "wheel"; }
  .plate-grid { grid-template-columns: minmax(0, 1fr); }
  .drawer { grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: 360px; }
  .cand dl { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .f-table thead { display: none; }
  .f-table, .f-table tbody, .f-table caption { display: block; }
  .f-table tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px 10px; padding: 10px 0; border-bottom: 1px solid var(--paper-line); }
  .f-table td { border: 0; padding: 0; overflow-wrap: anywhere; }
  .f-table td::before { content: attr(data-l); display: block; font-size: 11px; color: #5A6688; }
  .f-table td:first-child, .f-table td:nth-child(6), .f-table td:nth-child(7) { grid-column: 1 / -1; }
  .f-table td:first-child { font-weight: 600; font-size: 15px; }
  .f-table td:first-child::before { display: none; }
  .dipnav ol { grid-template-columns: repeat(4, minmax(0, 1fr)); row-gap: 8px; }
  .dipnav a { font-size: 13px; }
  .queue { grid-template-columns: minmax(0, 1fr); }
  .screens { grid-template-columns: minmax(0, 1fr); }
  .lamps { grid-template-columns: minmax(0, 1fr); }
  .outcomes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .f-meta { grid-template-columns: minmax(0, 1fr); }
  .get { grid-template-columns: minmax(0, 1fr); }
  .obslog td:first-child { width: 92px; white-space: normal; }
  .inj { grid-template-columns: 44px repeat(4, minmax(0, 1fr)); gap: 4px; font-size: 11px; }
  .cand dl { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
  body { font-size: 15.5px; }
  .obslog, .obslog tbody, .obslog tr, .obslog td { display: block; width: auto !important; }
  .obslog thead { display: none; }
  .obslog td { border: 0; padding: 2px 0; }
  .obslog tr { border-bottom: 1px solid var(--line); padding: 10px 0; }
  .drawer { grid-template-columns: minmax(0, 1fr); }
  .wheel { width: 230px; height: 230px; }
  .wheel li { width: 84px; height: 84px; margin: -42px 0 0 -42px; }
  .wheel .f1 { transform: translate(0, -68px); } .wheel .f2 { transform: translate(68px, 0); } .wheel .f3 { transform: translate(0, 68px); } .wheel .f4 { transform: translate(-68px, 0); }
  .dome-wrap { display: flex; flex-direction: column; }
  .shutter { position: static; order: -1; transform: none; width: 62%; margin: 0 auto 10px; }
  .shutter a { padding: 9px 4px; font-size: 14px; }
  .plaque { bottom: calc((100vw - 32px) * .17); }
  .ccd-chip { height: 440px; border-right-width: 18px; }
  .bias { right: -16px; width: 14px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
