@font-face {
  font-family: "DM Sans";
  src: url("/dm-sans.woff2") format("woff2");
  font-weight: 100 1000;
  font-display: swap;
}
@font-face {
  font-family: "STIX Two Text";
  src: url("/stix-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "STIX Two Text";
  src: url("/stix-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
:root {
  color-scheme: dark;
  --space: #0c0e15;
  --rail: #10121a;
  --panel: #141720;
  --raised: #1b1d29;
  --line: #303240;
  --line-soft: #262833;
  --text: #f1f0f6;
  --muted: #b0b2c1;
  --faint: #9497aa;
  --accent: #c5b2ff;
  --amber: #edc08b;
  --ice: #a5d7d9;
  --sans: "DM Sans", system-ui, sans-serif;
  --display: "STIX Two Text", Georgia, serif;
  --mono: ui-monospace, "SFMono-Regular", Consolas, monospace;
  --rail-width: 216px;
  --gutter: clamp(22px,3vw,54px);
}
*,*::before,*::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--space); color: var(--text); font: 15px/1.55 var(--sans); }
h1,h2,h3,p,figure,dl,dt,dd,pre { margin: 0; }
button,input,textarea,select { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .58; cursor: not-allowed; }
a { color: inherit; text-decoration: none; }
button,a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
[hidden],.hidden { display: none !important; }
::selection { background: #d3c4ff; color: #171323; }
section[id] { scroll-margin-top: 24px; }
#home { scroll-margin-top: 100px; }
.skip { position: fixed; left: 12px; top: 10px; z-index: 100; padding: 8px 16px; background: var(--accent); color: var(--space); transform: translateY(-160%); }
.skip:focus { transform: none; }
button,a,input,select,textarea { touch-action: manipulation; }

/* Navigation */
.rail { position: fixed; z-index: 10; inset: 0 auto 0 0; width: var(--rail-width); display: flex; flex-direction: column; background: var(--rail); border-right: 1px solid var(--line-soft); }
.rail-head { padding: 26px 22px 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 25px; font-weight: 670; line-height: 1; letter-spacing: -.065em; }
.brand-mark { width: 32px; height: 32px; position: relative; display: inline-grid; place-items: center; color: var(--accent); flex: none; }
.brand-mark::before,.brand-mark::after,.brand-mark i { content: ""; position: absolute; width: 12px; height: 31px; border: 1.6px solid currentColor; border-radius: 50%; }
.brand-mark::before { transform: rotate(60deg); }
.brand-mark::after { transform: rotate(-60deg); }
.brand-mark i::after { content: ""; position: absolute; left: 3px; top: 12px; width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.rail-panel { min-height: 0; flex: 1; display: flex; flex-direction: column; overflow-y: auto; }
.rail nav { padding: 0 13px; }
.rail-label,.kicker,.eyebrow,.card-meta,.problem-field,.result-label,.plate-stats,.feed-bar>span,.instrument-bar>span,.notebook-facts dt { font: 550 .68rem/1.5 var(--mono); letter-spacing: .085em; text-transform: uppercase; }
.rail-label { display: block; color: var(--faint); font-size: .62rem; letter-spacing: .15em; }
.rail nav p { margin: 30px 12px 10px; }
.rail nav a { position: relative; display: flex; align-items: center; gap: 13px; min-height: 42px; padding: 8px 13px; margin-block: 3px; border-radius: 5px; color: #b5b6c6; font-size: .89rem; font-weight: 510; transition: color 130ms, background-color 130ms; }
.rail nav a:hover { color: var(--text); background: var(--raised); }
.rail nav a[aria-current] { background: #272336; color: #dfd2ff; }
.rail nav a[aria-current]::before { content: ""; position: absolute; top: 11px; bottom: 11px; left: 0; width: 2px; background: var(--accent); }
.nav-icon { position: relative; display: inline-block; width: 16px; height: 16px; flex: none; }
.nav-icon::before,.nav-icon::after { content: ""; position: absolute; }
.i-observe { border: 1.3px solid currentColor; border-radius: 50%; }
.i-observe::before { width: 6px; height: 6px; inset: 4px; background: currentColor; clip-path: polygon(50% 0,65% 35%,100% 50%,65% 65%,50% 100%,35% 65%,0 50%,35% 35%); }
.i-index { background: linear-gradient(currentColor,currentColor) left 1px top 2px/6px 5px,linear-gradient(currentColor,currentColor) right 1px top 2px/6px 5px,linear-gradient(currentColor,currentColor) left 1px bottom 2px/6px 5px,linear-gradient(currentColor,currentColor) right 1px bottom 2px/6px 5px; background-repeat: no-repeat; }
.i-notes { border: 1.3px solid; border-radius: 2px; width: 14px; margin-right: 2px; }
.i-notes::before { top: 0; bottom: 0; left: 3px; border-left: 1px solid; }
.i-map { transform: rotate(-32deg); }
.i-map::before { inset: 2px -1px; border: 1.3px solid; border-radius: 50%; transform: scaleY(.58); }
.i-map::after { inset: 2px; border: 1px solid; border-radius: 50%; }
.i-lab { border-bottom: 1px solid; }
.i-lab::before { left: 2px; right: 1px; bottom: 3px; height: 10px; background: currentColor; clip-path: polygon(0 90%,26% 47%,44% 68%,73% 0,100% 41%,100% 60%,75% 24%,47% 91%,28% 68%,7% 100%); }
.i-method::before { inset: 2px 1px; background: repeating-linear-gradient(currentColor 0 1px,transparent 1px 5px); }
.rail-foot { margin: auto 21px 0; padding: 21px 1px 24px; border-top: 1px solid var(--line-soft); }
.rail-foot strong { display: flex; gap: 9px; align-items: center; font-size: .91rem; font-weight: 550; margin: 8px 0 3px; }
.rail-foot>span:last-child { font-size: .72rem; color: var(--faint); }
.rail-foot b,.plate-stats b { font-weight: 400; padding-inline: 3px; }
.sol-mark { width: 15px; height: 11px; transform: skewX(-22deg); background: repeating-linear-gradient(var(--ice) 0 2px,transparent 2px 4px); }
.menu-toggle { display: none; }
.page-shell { margin-left: var(--rail-width); min-width: 0; }
.page-shell:focus-visible { outline-offset: -2px; }
.topbar { height: 66px; border-bottom: 1px solid var(--line-soft); display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-inline: var(--gutter); }
.breadcrumb { display: flex; align-items: center; gap: 12px; color: #dfdfea; font-size: .83rem; }
.breadcrumb span { color: var(--faint); }
.breadcrumb b { font-weight: 400; color: #696b7e; }
.sheet { width: 100%; max-width: 1710px; margin-inline: auto; padding: 28px var(--gutter) 0; }

/* Observatory and map */
.overview { overflow: hidden; border: 1px solid #373443; border-radius: 12px; background: #14141f; }
.observatory-window { position: relative; isolation: isolate; display: grid; align-items: center; min-height: clamp(345px,28vw,470px); background: radial-gradient(ellipse at 78% 60%,#211c32,transparent 58%),linear-gradient(110deg,#181923,#101018 72%); }
.observatory-window::before { content: ""; position: absolute; inset: 0; z-index: -1; background-image: radial-gradient(#88809a52 .7px,transparent .9px); background-size: 15px 15px; mask-image: linear-gradient(105deg,transparent 14%,black 65%,transparent); }
.hero-copy { position: relative; z-index: 1; width: 48%; padding: clamp(28px,3.2vw,56px) 0 clamp(32px,3vw,52px) clamp(24px,3.2vw,56px); pointer-events: none; }
.hero-copy .actions { pointer-events: auto; }
.kicker,.eyebrow { display: flex; align-items: center; gap: 9px; color: var(--accent); font-size: .66rem; letter-spacing: .14em; }
.sight { display: inline-grid; place-items: center; width: 13px; height: 13px; border: 1px solid currentColor; border-radius: 50%; position: relative; flex: none; }
.sight::before,.sight::after { content: ""; position: absolute; background: currentColor; }
.sight::before { height: 1px; width: 17px; }
.sight::after { width: 1px; height: 17px; }
h1,h2,h3 { font-weight: 400; }
.hero-copy h1,.notebook-head h1 { font: 400 clamp(3.8rem,5.6vw,6.1rem)/.94 var(--display); letter-spacing: -.062em; }
.hero-copy h1 { margin: 21px 0 15px; }
.hero-copy h1 em { color: #d7c7ff; font-weight: inherit; }
.intro { max-width: 48ch; font-size: clamp(.98rem,1.04vw,1.12rem); line-height: 1.56; color: #c0bfce; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 17px; margin-top: 24px; }
.primary,.quiet-button,.small-button,.wallet,.close,#desktop-play { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 14px; min-height: 39px; font: 600 .84rem/1.25 var(--sans); border-radius: 5px; border: 1px solid #444554; background: #1a1b26; color: var(--text); transition: background-color 140ms, border-color 140ms; }
.primary { background: var(--accent); border-color: var(--accent); color: #1b152a; min-height: 43px; padding-inline: 16px; }
.primary>span { font-size: 1.15rem; font-weight: 430; }
.primary:hover { background: #dfd2ff; border-color: #dfd2ff; }
.quiet-button:hover,.small-button:hover,.wallet:hover,.close:hover,#desktop-play:hover { background: #292935; border-color: #797889; }
.wallet { background: var(--panel); }
.wallet::before { content: ""; width: 14px; height: 11px; border: 1.3px solid; border-radius: 2px; background: linear-gradient(currentColor,currentColor) right 2px center/3px 2px no-repeat; }
.text-link,.atlas-caption a { display: inline-flex; align-items: center; gap: 8px; font-size: .84rem; font-weight: 580; color: #e4e0ed; }
.text-link:hover,.atlas-caption a:hover,.custom-link:hover,.reading a:hover,.page-foot a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 4px; }
.atlas-plate { position: absolute; inset: 0 0 0 46%; overflow: hidden; isolation: isolate; mix-blend-mode: screen; }
.atlas-plate:focus-visible { outline-offset: -7px; }
.atlas-plate img { width: 100%; height: 100%; display: block; object-fit: cover; object-position: 50% 51%; }
.atlas-caption { position: relative; display: flex; flex-wrap: wrap; gap: 9px 16px; align-items: center; padding: 12px clamp(20px,2.2vw,38px); background: #15151f; border-top: 1px solid #34323e; }
.plate-title { display: inline-flex; align-items: center; gap: 10px; color: #dedbe9; font-size: .81rem; font-weight: 560; }
.plate-title .sight { color: var(--amber); width: 10px; height: 10px; }
.plate-title .sight::before { width: 14px; }.plate-title .sight::after { height: 14px; }
.plate-stats { color: var(--faint); text-transform: none; font-weight: 400; letter-spacing: .015em; }
.atlas-caption a { margin-left: auto; font-size: .8rem; color: #d8cded; }
.desk-section { margin-top: clamp(36px,3.7vw,65px); }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 18px; }
.section-heading>div { min-width: 0; }
.section-heading h2,.feed-bar h2 { font: 400 clamp(1.95rem,2.55vw,3rem)/1.1 var(--display); letter-spacing: -.045em; }
.section-heading p,.prime-study p,.reading { color: var(--muted); font-size: .91rem; line-height: 1.55; margin-top: 5px; }
.section-heading>a,.section-heading>button { flex: none; }
.map-instrument,#desktop-view,#workspace { background: #101219; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.instrument-bar,.feed-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 14px; }
.instrument-bar { min-height: 43px; padding: 7px 16px; background: #191a25; border-bottom: 1px solid var(--line); }
.instrument-bar h2,.instrument-bar>span:first-child,.feed-bar h3 { display: inline-flex; gap: 9px; align-items: center; color: #e2deed; font: 560 .84rem/1.4 var(--sans); letter-spacing: 0; text-transform: none; }
.instrument-bar>span { color: var(--faint); }
.map-light { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.instrument-bar button { border: 0; background: transparent; color: var(--muted); padding: 5px 2px; font-size: .78rem; }
.instrument-bar button:hover { color: var(--text); text-decoration: underline; }
#riemann-frame { display: block; width: 100%; height: clamp(430px,62vh,760px); border: 0; background: #040409; }

/* Problem index and experiments */
#problem-register,.cards { display: grid; gap: 14px; grid-template-columns: repeat(3,minmax(0,1fr)); }
.problem-row,.card { display: flex; flex-direction: column; position: relative; min-width: 0; overflow: hidden; color: var(--text); border: 1px solid var(--line); border-radius: 8px; background: var(--panel); text-align: left; transition: background-color 140ms,border-color 140ms; }
.problem-row:hover,.card:hover,.notebook-row:hover { background-color: #1b1d28; border-color: #646075; }
.problem-row { padding: 0 17px 17px; }
.problem-plate { --tint: #222033; display: flex; align-items: center; justify-content: space-between; background: var(--tint); overflow: hidden; border-bottom: 1px solid var(--line-soft); margin: 0 -17px 15px; padding-left: 15px; height: clamp(72px,6vw,105px); }
.problem-plate i { font: italic clamp(1.4rem,1.8vw,2rem)/1 var(--display); color: #cab9ef; white-space: nowrap; }
.problem-plate canvas { display: block; width: 56%; height: auto; object-fit: contain; margin-right: 7px; }
.problem-row[data-problem=goldbach] .problem-plate { --tint: #18282c; }
.problem-row[data-problem=collatz] .problem-plate { --tint: #2b2323; }
.problem-row[data-problem=goldbach] .problem-plate i,.problem-row[data-problem=goldbach] .problem-field { color: var(--ice); }
.problem-row[data-problem=collatz] .problem-plate i,.problem-row[data-problem=collatz] .problem-field { color: var(--amber); }
.problem-field,.card-meta { color: var(--accent); font-size: .61rem; line-height: 1.45; letter-spacing: .085em; }
.problem-row strong,.card-title { display: block; font: 400 clamp(1.25rem,1.65vw,1.8rem)/1.15 var(--display); letter-spacing: -.035em; margin: 6px 0; }
.problem-question,.card-detail { color: var(--muted); font-size: .85rem; line-height: 1.45; }
.problem-field { padding-right: 24px; }
.row-arrow { position: absolute; top: calc(clamp(72px,6vw,105px) + 13px); right: 17px; color: var(--faint); font-size: .9rem; }
#problem-register.all-problems { display: block; border-block: 1px solid var(--line); }
.all-problems .problem-row { display: grid; width: 100%; grid-template-columns: minmax(7rem,.65fr) minmax(9rem,1fr) minmax(0,1.8fr) 18px; align-items: center; gap: 16px; padding: 14px 10px; border: 0; border-bottom: 1px solid var(--line-soft); border-radius: 0; background: transparent; }
.all-problems .problem-row:last-child { border-bottom: 0; }
.all-problems .problem-row:hover { background: var(--panel); }
.all-problems .problem-plate { display: none; }
.all-problems .problem-field { padding: 0; }
.all-problems .problem-row strong { font-size: 1.2rem; margin: 0; }
.all-problems .row-arrow { position: static; }
.custom-link { display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 4px 0; margin-top: 6px; font-size: .81rem; color: var(--muted); border: none; background: transparent; }
.custom-link span { color: var(--accent); }
.card { padding: 0; }
.cover { width: 100%; display: block; aspect-ratio: 3.75; overflow: hidden; }
.cover canvas { display: block; width: 100%; height: 100%; object-fit: cover; }
.card-body { display: block; padding: 14px 17px 17px; }
.card-meta { color: var(--faint); }
.prime-study { margin-top: 16px; display: grid; grid-template-columns: 1fr 1.15fr; gap: 22px; align-items: center; padding: 21px clamp(17px,2.4vw,34px); border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.prime-study figcaption { color: var(--ice); font-size: .82rem; font-weight: 550; }
.board-equation { font: italic clamp(1.9rem,3vw,3.4rem)/1.15 var(--display); margin: 7px 0; }
.board-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 14px; }
.board-controls span { font: .72rem var(--mono); color: var(--faint); }
#prime-board { width: 100%; height: 145px; display: block; }
.proof-process { margin: 0; display: grid; border-top: 1px solid var(--line); }
.proof-process>div { display: grid; grid-template-columns: minmax(160px,.55fr) 1.45fr; gap: 20px; padding: 14px 0; border-bottom: 1px solid var(--line-soft); }
.proof-process dt { font: 400 1.23rem/1.35 var(--display); }
.proof-process dd,.proof-example p { color: var(--muted); font-size: .9rem; }
.proof-example { padding: 15px 18px; margin: 18px 0; background: var(--panel); border: 1px solid var(--line); border-radius: 7px; }
summary { cursor: pointer; }
.proof-example summary { font-weight: 570; }
.proof-example summary span { margin-left: 10px; color: var(--ice); font: .78rem var(--mono); }
.proof-example p,.proof-example pre,.proof-example a { margin-top: 12px; }
.reading { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 17px; font-size: .8rem; }
.reading a,.proof-example a,.agent-entry a,.notebook-links a,#identity>a,dialog a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

/* Directory and individual notebooks */
.feed-bar { padding-block: 9px 13px; border-bottom: 1px solid var(--line); }
.feed-bar>span { color: var(--faint); letter-spacing: .03em; text-transform: none; }
.agent-empty { position: relative; padding: 24px 20px 24px 67px; background: var(--panel); border: 1px solid var(--line-soft); border-radius: 7px; margin-top: 14px; }
.agent-empty::before,.agent-empty::after { position: absolute; content: ""; width: 19px; height: 23px; top: 25px; left: 24px; border: 1px solid #89809e; border-radius: 2px; }
.agent-empty::before { transform: translate(4px,4px); }
.agent-empty::after { background: repeating-linear-gradient(transparent 0 4px,#766c89 4px 5px) 4px 4px/9px 13px no-repeat,var(--panel); }
.agent-empty strong,.notebook-row strong { display: block; font-size: .98rem; font-weight: 590; }
.agent-empty p { color: var(--muted); font-size: .86rem; margin: 4px 0 0; }
.notebook-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; align-items: center; padding: 17px 15px; border-bottom: 1px solid var(--line-soft); }
.notebook-row small { grid-column: 1; color: var(--faint); }
.notebook-row strong { grid-column: 1; }
.notebook-open { grid-column: 2; grid-row: 1 / span 2; color: var(--accent); font-size: .86rem; }
.notebook-row:hover .notebook-open,.agent-entry a:hover { text-decoration: underline; }
.notebook-head { padding: clamp(28px,4.8vw,74px) clamp(20px,3.6vw,54px); border: 1px solid var(--line); border-radius: 11px; background: linear-gradient(105deg,#171823 36%,#191825); }
.notebook-head h1 { font-size: clamp(2.85rem,4.9vw,5.4rem); margin: 21px 0 16px; overflow-wrap: anywhere; }
.notebook-head .intro { max-width: 65ch; }
#identity:not(:empty) { margin: 22px 0; }
.notebook-facts { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px 25px; background: var(--panel); padding: 20px; border: 1px solid var(--line); border-radius: 8px; }
.notebook-facts>div:first-child { grid-column: 1/-1; }
.notebook-facts dt { color: var(--faint); }
.notebook-facts dd { overflow-wrap: anywhere; margin-top: 4px; font-size: .9rem; }
.notebook-links { display: flex; flex-wrap: wrap; gap: 8px 17px; margin: 12px 0; font-size: .85rem; }
.workspace-layout { display: grid; grid-template-columns: minmax(0,1.5fr) minmax(0,1fr); gap: 16px; }
#desktop-state.on-air { color: var(--ice); }
#desktop-video,#desktop-replay { width: 100%; aspect-ratio: 16/9; background: #040409; }
#desktop-video:not([hidden]),#desktop-replay { display: block; }
#desktop-wait { padding: 37px 18px; color: var(--muted); }
#desktop-archive,#desktop-play { margin: 12px; }
#sandbox-id { font-size: .77rem; color: var(--muted); overflow-wrap: anywhere; margin: 9px 14px 0; }
#transcript,.agent-entry pre,.proof-example pre,.result-box pre { padding: 13px; background: #0e1018; color: #dadce8; font: .78rem/1.6 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
#transcript { max-height: 350px; overflow: auto; }
.notebook-feed { margin-top: 30px; }
.agent-entry { display: grid; min-width: 0; gap: 4px; padding: 16px 4px 16px 20px; border-left: 1px solid #484251; position: relative; }
.agent-entry::before { content: ""; position: absolute; top: 22px; left: -4px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.agent-entry time,.agent-entry small { color: var(--faint); font: .73rem/1.55 var(--mono); }
.agent-entry strong { font-weight: 550; overflow-wrap: anywhere; }
.agent-entry details,.agent-entry p { min-width: 0; color: var(--muted); }
.agent-entry a { width: fit-content; overflow-wrap: anywhere; }
#error:not(:empty) { color: var(--amber); margin-top: 12px; }
.page-foot { display: flex; justify-content: space-between; gap: 20px; align-items: center; margin-top: 42px; padding: 18px 0 25px; color: var(--faint); border-top: 1px solid var(--line-soft); font-size: .82rem; }
.page-foot span { font-weight: 630; color: var(--muted); }

/* Wallet, launch review and replayable experiments */
dialog { margin: auto; width: min(580px,calc(100% - 28px)); max-height: min(90dvh,920px); overflow-y: auto; overscroll-behavior: contain; padding: clamp(20px,3vw,32px); color: var(--text); background: #151720; border: 1px solid #494452; border-radius: 12px; box-shadow: 0 22px 80px #0009; }
dialog::backdrop { background: #05060cce; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.close { width: 35px; min-height: 35px; padding: 0; background: transparent; font-size: 1.35rem; font-weight: 400; }
dialog h2 { font: 400 clamp(2.1rem,3.4vw,3rem)/1.08 var(--display); letter-spacing: -.045em; margin: 10px 0; }
dialog p { margin: 12px 0; color: var(--muted); }
dialog .eyebrow { margin: 0; color: var(--accent); }
dialog form,#media-fields { display: grid; gap: 13px; }
dialog form { margin-top: 20px; }
dialog fieldset { display: grid; gap: 10px; margin: 0; padding: 12px 0 3px; min-width: 0; border: 0; border-top: 1px solid var(--line); }
dialog legend { padding: 0 9px 0 0; color: var(--accent); font-size: .76rem; font-weight: 560; }
dialog fieldset>small { margin-top: -5px; }
label { min-width: 0; display: grid; gap: 6px; font-size: .85rem; font-weight: 570; }
input,select,textarea { min-width: 0; width: 100%; padding: 10px 12px; color: var(--text); background: #0f111a; border: 1px solid #575869; border-radius: 5px; font-weight: 430; }
input::placeholder,textarea::placeholder { color: #9293a5; opacity: 1; }
input[type=number] { font-variant-numeric: tabular-nums; }
input[type=file] { padding: 6px; }
::file-selector-button { font: inherit; color: var(--text); background: #292a38; border: 0; border-radius: 3px; margin-right: 8px; padding: 5px 9px; }
textarea { resize: vertical; }
.fields,.token-fields { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 11px; }
.token-fields { grid-template-columns: 1.6fr 1fr; }
.check { display: flex; flex-direction: row; align-items: center; gap: 8px; }
.check input { width: auto; accent-color: var(--accent); }
dialog form>.primary { width: 100%; }
dialog small { color: var(--muted); font-size: .79rem; line-height: 1.5; }
.fee-summary,.notice,.result-box { padding: 14px; border: 1px solid var(--line); border-radius: 6px; background: var(--raised); }
.fee-summary>div { display: flex; justify-content: space-between; gap: 14px; padding: 5px 0; }
.fee-summary span { color: var(--muted); }
.fee-summary strong { text-align: right; }
.result-box,.notice { margin-top: 16px; overflow-wrap: anywhere; }
.result-label { color: var(--ice); }
.result-box h3 { font: 400 1.7rem/1.3 var(--display); }
.result-box details { margin: 12px 0; }
.result-box pre { max-height: 240px; overflow: auto; }
.receipt-links { display: flex; gap: 14px; flex-wrap: wrap; }
.notice+button,.share-output:not(:empty) { margin-top: 10px; }
#form-error:empty,#feedback:empty { display: none; }
#form-error:not(:empty),#feedback:not(:empty) { padding: 10px; background: var(--raised); border-radius: 4px; color: var(--amber); }
#media-fields { gap: 8px; }
#wallet-content button { margin: 3px; }
.wordbreak,code { overflow-wrap: anywhere; }

/* Compact navigation and small workspaces */
@media (min-width:1600px) { :root { --rail-width: 238px; } }
@media (max-width:1160px) and (min-width:851px) {
  :root { --rail-width: 182px; --gutter: 23px; }
  .rail-head { padding-inline: 17px; }.rail nav { padding-inline: 9px; }.brand { font-size: 23px; }
  .rail-foot { margin-inline: 17px; }
  .hero-copy { width: 53%; }.atlas-plate { left: 49%; }
}
@media (max-width:850px) {
  :root { --gutter: clamp(16px,3.6vw,30px); }
  .rail { position: sticky; inset: 0 0 auto; height: 60px; width: 100%; background: #10121a; border: none; border-bottom: 1px solid var(--line); }
  .rail-head { flex: none; height: 60px; padding: 0 var(--gutter); display: flex; align-items: center; justify-content: space-between; }
  .brand { font-size: 23px; gap: 8px; }.brand-mark { transform: scale(.88); }
  .menu-toggle { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 10px; background: transparent; border: 1px solid var(--line); border-radius: 5px; color: var(--text); min-height: 36px; font-size: .82rem; }
  .menu-bars { width: 12px; height: 8px; border-block: 1px solid currentColor; }
  .rail-panel { display: none; flex: none; position: absolute; top: 59px; left: 0; right: 0; max-height: calc(100dvh - 60px); background: var(--rail); border-bottom: 1px solid var(--line); box-shadow: 0 14px 26px #0006; padding: 3px var(--gutter) 15px; }
  .menu-open .rail-panel { display: flex; }
  .rail nav { padding: 0; }
  .rail nav p { margin: 13px 10px 5px; }
  .rail nav a { min-height: 39px; margin: 0; }
  .rail-foot { display: none; }
  .page-shell { margin: 0; }
  .topbar { height: 46px; }
  .topbar .wallet,.topbar>.quiet-button { position: fixed; z-index: 12; top: 12px; right: calc(var(--gutter) + 81px); min-height: 36px; padding-block: 7px; font-size: .78rem; }
  .rail.menu-open + .page-shell .topbar .wallet,.rail.menu-open + .page-shell .topbar>.quiet-button { visibility: hidden; }
  .sheet { padding-top: 17px; }
  section[id] { scroll-margin-top: 73px; }#home { scroll-margin-top: 120px; }
  .hero-copy { width: 51%; }.atlas-plate { left: 48%; }
  .problem-row { padding-inline: 12px; }.problem-plate { margin-inline: -12px; padding-left: 12px; }
  .workspace-layout { grid-template-columns: 1fr; }
}
@media (max-width:630px) {
  body { font-size: 14px; }
  .topbar { height: 38px; }.sheet { padding-top: 12px; }
  .observatory-window { display: flex; flex-direction: column; align-items: stretch; min-height: 0; }
  .hero-copy { width: 100%; padding: 25px 22px 0; }
  .hero-copy h1 { font-size: clamp(3.25rem,10.5vw,4.35rem); margin: 17px 0 12px; }
  .hero-copy h1 br { display: none; }.hero-copy h1 em::before { content: " "; }
  .hero-copy .intro { font-size: .92rem; max-width: 43ch; }
  .hero-copy .actions { margin-top: 17px; gap: 14px; }
  .atlas-plate { display: block; position: relative; inset: auto; width: 100%; height: clamp(160px,49vw,246px); margin-top: 4px; }
  .atlas-plate img { object-fit: contain; transform: scale(1.16); }
  .atlas-caption { display: grid; grid-template-columns: minmax(0,1fr) auto; padding: 10px 15px; gap: 2px 8px; }
  .plate-stats { grid-column: 1; font-size: .61rem; padding-left: 20px; }
  .atlas-caption a { grid-column: 2; grid-row: 1 / span 2; font-size: .76rem; }
  .plate-title { font-size: .77rem; }
  .section-heading { gap: 10px; margin-bottom: 14px; }
  .section-heading h2,.feed-bar h2 { font-size: 1.95rem; }
  .section-heading p { font-size: .84rem; }
  .section-heading .quiet-button,.section-heading>a { font-size: .75rem; }
  #problem-register,.cards { grid-template-columns: 1fr; gap: 9px; }
  .problem-row { display: grid; grid-template-columns: 90px minmax(0,1fr) 12px; gap: 2px 12px; align-items: start; padding: 11px 12px 11px 0; }
  .problem-plate { grid-column: 1; grid-row: 1 / span 3; align-self: stretch; height: auto; min-height: 80px; flex-direction: column; justify-content: center; gap: 6px; margin: -11px 0; padding: 8px 3px; border: 0; border-right: 1px solid var(--line-soft); }
  .problem-plate i { font-size: 1.14rem; }
  .problem-plate canvas { width: 90%; margin: 0; }
  .problem-field,.problem-row strong,.problem-question { grid-column: 2; }
  .problem-field { padding: 0; }
  .problem-row strong { margin: 1px 0; font-size: 1.26rem; }
  .problem-question { font-size: .8rem; }
  .row-arrow { position: static; grid-column: 3; grid-row: 1; }
  .all-problems .problem-row { grid-template-columns: minmax(0,1fr) 16px; gap: 4px; padding: 12px 3px; }
  .all-problems .problem-field,.all-problems .problem-row strong,.all-problems .problem-question { grid-column: 1; }
  .all-problems .row-arrow { grid-column: 2; }
  .card { display: grid; grid-template-columns: 26% minmax(0,1fr); }
  .cover { width: 100%; height: 100%; aspect-ratio: auto; }
  .card-body { padding: 12px 13px; }
  .card-title { margin: 2px 0; }.card-detail { font-size: .81rem; }
  #riemann-frame { height: clamp(390px,60svh,530px); }
  .prime-study { grid-template-columns: 1fr; gap: 2px; }
  #prime-board { height: 115px; }
  .proof-process>div { grid-template-columns: 1fr; gap: 4px; }
  .proof-example summary span { display: block; margin: 3px 0 0 16px; }
  .notebook-facts { grid-template-columns: 1fr; }
  .notebook-row { grid-template-columns: 1fr; }.notebook-open { grid-column: 1; grid-row: auto; width: fit-content; }
  .notebook-head h1 { margin: 16px 0 12px; }
}
@media(max-width:480px) {
  .topbar { height: 49px; }
  .topbar .wallet,.topbar>.quiet-button { position: static; min-height: 35px; }
  .menu-toggle { min-height: 42px; }
}
@media(prefers-reduced-motion:reduce) {
  html { scroll-behavior: auto; }
  *,*::before,*::after { transition-duration: 0s !important; animation-duration: 0s !important; }
}
