:root {
  --bg: #f6f5f2;
  --surface: #ffffff;
  --ink: #18181b;
  --muted: #71717a;
  --line: #e7e5e0;
  --soft: #eceae5;
  --accent: #e8705a; /* TRMNL coral */
  --accent-soft: #fdf0ec;
  --error: #c2410c;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --side-w: clamp(300px, 24vw, 380px); /* both sidebars: the stage keeps one size */
  --ease: cubic-bezier(.2, .7, .2, 1);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  height: 100vh;
  overflow: hidden; /* only the panes scroll */
  display: grid;
  grid-template-rows: auto minmax(0, 1fr); /* the workspace takes what's left, never more */
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}
code { font: 12.5px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--soft); padding: 2px 6px; border-radius: 6px; word-break: break-all; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- Top bar ---- */
.topbar { position: relative; z-index: 20; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; padding: 14px 20px; }
.start-controls { display: flex; align-items: center; gap: 6px; }
.start-controls .brand { margin-right: 14px; }
.center-controls { display: flex; align-items: center; gap: 10px; }
.end-controls { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
/* One blackletter wordmark; ".news" in the same face, on the same baseline. */
.brand { font: 400 26px/1 "UnifrakturMaguntia", serif; color: var(--ink); text-decoration: none; white-space: nowrap; }
.brand span { font: inherit; color: var(--muted); }
.brand--big { display: block; font-size: 38px; margin: 0 0 6px; }
.status { font-size: 13px; color: var(--muted); max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-right: 4px; }
.status.error, .error { color: var(--error); }

/* ---- Buttons ---- */
.pill { font: 600 13px/1 var(--sans); border-radius: 999px; padding: 10px 16px; border: 1px solid transparent; cursor: pointer; white-space: nowrap; transition: background .15s, color .15s, box-shadow .15s; }
.pill--primary { background: var(--accent); color: #fff; }
.pill--primary:hover { background: #df5f48; }
.pill--ghost { background: transparent; color: var(--ink); }
.pill--ghost:hover, .pill--ghost[aria-expanded="true"] { background: var(--soft); }
.pill--small { padding: 7px 12px; font-size: 12px; background: var(--soft); color: var(--ink); }
.pill--small:hover { background: #e2e0da; }
.pill--block { width: 100%; padding: 12px 16px; }
.pill:disabled { opacity: .55; cursor: progress; }
.icon-btn { width: 32px; height: 32px; border-radius: 999px; border: 0; background: transparent; font: 400 20px/1 var(--sans); color: var(--muted); cursor: pointer; }
.icon-btn--back { display: grid; place-items: center; margin-left: -8px; flex: none; }
.pane-title { margin: 0; font: 600 17px/1.3 var(--sans); }
.outlet-why { text-decoration: underline dotted; text-underline-offset: 3px; cursor: help; }
.pane--right .pane-head { justify-content: flex-start; gap: 6px; margin-bottom: 4px; }
/* The subtitle sits right under the title; no fade over it. */
.pane--right .pane-head::after { display: none; }
.icon-btn:hover { background: var(--soft); color: var(--ink); }

.pill-select { width: auto; border-radius: 999px; padding: 9px 34px 9px 14px; font: 600 13px var(--sans); }

/* Segmented control */
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--soft); border-radius: 999px; }
.seg button, .seg label span { display: block; font: 600 12px/1 var(--sans); border: 0; background: transparent; color: var(--muted); padding: 8px 14px; border-radius: 999px; cursor: pointer; }
.seg button[aria-pressed="true"], .seg label input:checked + span { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgb(0 0 0 / .1); }
.seg label input { position: absolute; opacity: 0; pointer-events: none; }
.seg--full { display: flex; }
.seg--full label { flex: 1; text-align: center; }
.seg label input:focus-visible + span { outline: 2px solid var(--accent); }

/* ---- Workspace: panes push the stage, never cover it ---- */
/* Exactly one sidebar is visible: settings on the left, or the clicked
   area's panel on the right. Opening the right one slides everything
   leftwards; the stage keeps its size, so the device never rescales. */
.workspace { position: relative; min-height: 0; overflow: hidden; }
.pane, .stage { position: absolute; top: 0; bottom: 0; transition: transform .38s var(--ease); }
.pane { width: var(--side-w); min-height: 0; }
/* Left: News, with the clicked area's settings sliding over it. Right: Connect, always. */
.pane--left, .pane--right { left: 0; }
.pane--right { z-index: 3; background: var(--bg); transform: translateX(-100%); }
.pane--connect { right: 0; }
.stage { left: var(--side-w); width: calc(100% - 2 * var(--side-w)); }
body.right-open .pane--right { transform: none; }
.pane-inner { height: 100%; overflow-y: auto; padding: 0 22px 32px; scrollbar-width: none; }
.pane-inner::-webkit-scrollbar { display: none; } /* scrolls, without a visible bar */
/* Sticky title: opaque, flush with the top of the scroll area, and a soft
   fade below so scrolled content slips under it cleanly. */
.pane-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; margin: 0 -22px 18px; padding: 14px 22px 12px; background: var(--bg); }
.pane-head::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 14px; background: linear-gradient(var(--bg), transparent); pointer-events: none; }
.pane-head h2 { margin: 0; font: 600 17px/1.3 var(--sans); }
.pane--right section:not(.active), .pane--left [data-tab-panel]:not(.active) { display: none; }
.pane-subhead { margin: 26px 0 6px; font: 600 17px/1.3 var(--sans); }


/* Switch */
.switch { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 16px; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch-track { position: relative; flex: none; width: 36px; height: 22px; margin-top: 1px; border-radius: 999px; background: #d9d6cf; transition: background .2s; }
.switch-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 999px; background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / .2); transition: transform .2s var(--ease); }
.switch input:checked + .switch-track { background: var(--accent); }
.switch input:checked + .switch-track::after { transform: translateX(14px); }
.switch input:focus-visible + .switch-track { box-shadow: 0 0 0 3px var(--accent-soft); }
.switch-text b { display: block; font: 600 13px/1.3 var(--sans); }
.switch-text small { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); line-height: 1.4; }

/* ---- Stage and device (the preview itself stays as TRMNL renders it) ---- */
.stage { min-width: 0; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 8px 24px 24px; }
.stage-bar { display: flex; justify-content: space-between; align-items: center; gap: 8px; max-width: 100%; }
/* Narrow screens: the three controls share the row instead of overflowing it. */
@media (max-width: 520px) {
  .stage-bar { gap: 4px; width: calc(100vw - 32px) !important; }
  .stage-bar .pill-select { padding: 8px 26px 8px 10px; font-size: 12px; background-position: right 8px center; }
  .stage-bar .seg button { padding: 7px 9px; }
}
.stage-hint { margin: 4px 0 0; padding: 6px 13px; border-radius: 999px; background: var(--soft); color: var(--muted); font: 600 12.5px/1 var(--sans); }

.device { position: relative; border-radius: 22px; padding: 26px 26px 34px; }
.device-svg { position: absolute; inset: 0; overflow: visible; pointer-events: none; }
.device--og { border-radius: 18px; padding: 30px 30px 38px; }
.device--x { border-radius: 26px; padding: 22px 22px 40px; }
.device-screen { position: relative; z-index: 1; overflow: hidden; background: #fff; }
/* A faint warm paper tone and edge shading, so the screen reads as e-ink
   rather than a monitor. Clicks pass through to the preview. */
.eink { position: absolute; inset: 0; pointer-events: none; background: #f2efe6; mix-blend-mode: multiply; border-radius: inherit; box-shadow: inset 0 2px 4px rgb(40 30 20 / .22), inset 0 0 1px rgb(40 30 20 / .3); }
.device-screen iframe { position: absolute; top: 0; left: 0; border: 0; transform-origin: 0 0; background: #fff; }
/* ---- Forms ---- */
section { padding-bottom: 8px; }
.label { display: block; margin-bottom: 6px; font: 500 12px/1.3 var(--sans); color: var(--muted); }
.hint { margin: 0 0 14px; font-size: 13px; color: var(--muted); }
.field { display: block; margin-bottom: 16px; }
.spaced { margin-top: 20px; }

input, select { width: 100%; font: 14px var(--sans); color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type="radio"], input[type="checkbox"] { width: auto; accent-color: var(--accent); }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%2371717a' stroke-width='1.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 34px; }

.affix { display: flex; align-items: center; gap: 8px; font: 400 20px/1 "UnifrakturMaguntia", serif; }
.affix input { text-align: center; font: 600 15px var(--sans); }

.results { list-style: none; margin: 6px 0 0; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.results:empty { display: none; }
.results li { padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.results li:hover, .results li:focus { background: var(--soft); outline: none; }

/* Option cards (tone, top-left number, slot mode) */
/* Two columns while the cards fit, else one. */
.options { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px; margin-bottom: 16px; }
.options--stack { grid-template-columns: 1fr; }
.option { position: relative; display: block; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; cursor: pointer; transition: border-color .15s, background .15s; }
.option:hover { border-color: #d6d3cc; }
.option input { position: absolute; opacity: 0; pointer-events: none; }
.option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.option:has(input:focus-visible) { box-shadow: 0 0 0 3px var(--accent-soft); }
.option b { display: block; font: 600 13px/1.3 var(--sans); }
/* Cards with an icon: icon in its own column, title and text beside it. */
.option:has(> .icon) { display: grid; grid-template-columns: 16px minmax(0, 1fr); column-gap: 10px; }
.option > .icon { grid-row: 1 / span 3; align-self: start; margin-top: 1px; }
.option:has(> .icon) > :not(.icon):not(input) { grid-column: 2; }
.option .icon svg, .topic .icon svg { width: 16px; height: 16px; }
.topic-head > .icon { margin-top: 1px; }
.option span { display: block; margin-top: 4px; font-size: 13px; }
.option small { display: block; margin-top: 4px; font-size: 12px; color: var(--muted); line-height: 1.4; }

.lede b { font-weight: 600; color: var(--ink); }
.lede { margin: -6px 0 22px; line-height: 1.5; font-size: 13px; color: var(--muted); }
.underline { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.icon { display: inline-grid; place-items: center; flex: none; color: var(--accent); }


/* Editions */
/* An edition: one rounded box, its time above its name, then × */
.edition { display: grid; grid-template-columns: minmax(0, 1fr) 32px; gap: 6px; align-items: center; margin-bottom: 8px; }
.edition-field { display: flex; flex-direction: column; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; transition: border-color .15s, box-shadow .15s; }
.edition-field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.edition-field input { border: 0; border-radius: 12px; background: transparent; box-shadow: none !important; }
.edition-field input[type="time"] { padding-bottom: 8px; font-weight: 600; font-variant-numeric: tabular-nums; }
.edition-field input:not([type]) { padding-top: 8px; border-top: 1px solid var(--line); border-radius: 0 0 12px 12px; }

/* News: one card per outlet, its sections as chips */
.news { display: grid; gap: 8px; margin-bottom: 16px; }
.news-list { display: grid; gap: 8px; }
.outlet { padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.outlet-head { display: flex; align-items: flex-start; gap: 10px; }
.outlet-mark { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--accent); color: #fff; font: 700 11.5px/1 var(--sans); letter-spacing: .02em; }
.outlet-logo { display: block; width: 19px; height: 19px; background: #fff; -webkit-mask: var(--logo) center / contain no-repeat; mask: var(--logo) center / contain no-repeat; }
.outlet-text { min-width: 0; }
.outlet-title { display: flex; align-items: center; gap: 8px; min-height: 30px; }
.outlet-title b { font: 600 13.5px/1.3 var(--sans); }
.outlet-text:has(.outlet-note) .outlet-title { min-height: 0; }
.outlet-label { margin: 12px 0 0; }
.outlet[hidden] { display: none; }
/* Search and language filter as one field, split by a thin rule. */
.news-tools { display: flex; align-items: stretch; margin-bottom: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; transition: border-color .15s, box-shadow .15s; }
.news-tools:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.news-tools input, .news-tools select { border: 0; background-color: transparent; border-radius: 12px; }
.news-tools input:focus, .news-tools select:focus { border: 0; box-shadow: none; }
.news-tools .lang-field { border-left: 1px solid var(--line); }
.search-field { position: relative; flex: 1; min-width: 0; }
.search-field svg { position: absolute; left: 13px; top: 50%; translate: 0 -50%; color: var(--muted); pointer-events: none; }
.search-field input { padding-left: 38px; }
.lang-field { position: relative; flex: none; max-width: 42%; }
.lang-field svg { position: absolute; left: 12px; top: 50%; translate: 0 -50%; color: var(--muted); pointer-events: none; }
.news-langs { width: auto; max-width: 100%; padding-left: 36px; }
.tag { flex: none; padding: 2px 6px; border-radius: 6px; background: var(--soft); color: var(--muted); font: 600 10px/1.3 var(--sans); letter-spacing: .04em; }
.topic-text b .tag { margin-left: 8px; vertical-align: 1px; }
.outlet-note { display: block; margin-top: 2px; font-size: 12px; line-height: 1.4; color: var(--muted); }
.secs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.sec { display: inline-flex; align-items: center; gap: 5px; padding: 6px 11px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); font: 500 12.5px/1.2 var(--sans); cursor: pointer; transition: background .15s, border-color .15s; }
.sec:hover { border-color: #d6d3cc; }
.sec[aria-pressed="true"] { padding-left: 8px; border-color: var(--accent); background: var(--accent-soft); }
.sec[aria-pressed="true"]:hover { border-color: var(--accent); }
.sec-icon { color: var(--accent); }
.sec:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.sec-icon svg { width: 13px; height: 13px; }
.news-more { display: flex; align-items: center; gap: 10px; width: 100%; margin: 10px 0 2px; padding: 4px 0; border: 0; background: none; color: var(--muted); font: 500 12px/1 var(--sans); cursor: pointer; }
.news-more::before, .news-more::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.news-more:hover { color: var(--ink); }
.news-more-icon { order: 1; color: inherit; transition: transform .2s var(--ease); }
.news-more-icon svg { width: 14px; height: 14px; }
.news-more[aria-expanded="true"] .news-more-icon { transform: rotate(180deg); }
.news-more::after { order: 2; }

/* Topic cards (first-visit setup) */
.topics { display: grid; gap: 8px; margin-bottom: 16px; }
.topic { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; cursor: pointer; transition: border-color .15s, transform .15s, box-shadow .15s; }
.topic:hover { border-color: #d6d3cc; transform: translateY(-1px); }
.topic.on { border-color: var(--accent); }
.topic-head { display: flex; align-items: flex-start; gap: 10px; width: 100%; padding: 12px 14px; background: none; border: 0; text-align: left; font: inherit; color: inherit; cursor: pointer; border-radius: 14px; }
.topic-head:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.topic-text { flex: 1; min-width: 0; }
.topic-text b { display: block; font: 600 13.5px/1.3 var(--sans); }
.topic-text small { display: block; margin-top: 2px; font-size: 12px; line-height: 1.4; color: var(--muted); }
/* Added topics get a coral check; others a faint empty ring. */
.topic-mark { flex: none; width: 20px; height: 20px; margin-top: 1px; border-radius: 999px; border: 1.5px solid #d6d3cc; transition: background .15s, border-color .15s; }
.topic.on .topic-mark { border-color: var(--accent); background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12'%3E%3Cpath d='M2.5 6.2l2.4 2.4 4.6-5' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center no-repeat; }
.topic-body { padding: 0 14px 12px 40px; }
.topic-body .label { margin-bottom: 6px; }
.link-btn { align-self: flex-start; }
.link-btn { font: 500 12px var(--sans); background: none; border: 0; padding: 0; color: var(--muted); cursor: pointer; }
.link-btn:hover { color: var(--ink); }

/* Left pane: steps */
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.steps li { position: relative; padding: 0 0 22px 38px; counter-increment: step; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 999px; background: var(--soft); font: 600 12px var(--sans); }
.steps h3 { margin: 2px 0 4px; font: 600 14px/1.3 var(--sans); }
.steps p { margin: 0 0 10px; color: var(--muted); }
.copy-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.copy-row code { flex: 1; padding: 8px 10px; }
.link-box { display: block; margin: 8px 0; padding: 10px 12px; word-break: break-all; }
/* Fixed width, so "Copied" doesn't nudge anything. */
.copy-btn { min-width: 104px; margin-bottom: 10px; }

/* Sign in */
dialog { border: 0; border-radius: 20px; padding: 28px; width: min(380px, calc(100% - 32px)); background: var(--surface); box-shadow: 0 30px 80px -20px rgb(0 0 0 / .35); }
dialog::backdrop { background: rgb(24 24 27 / .35); backdrop-filter: blur(2px); }
dialog input { margin-bottom: 10px; }

/* Narrow screens: device on top, settings scroll below; clicked-area
   settings come up as a bottom sheet. */
@media (max-width: 900px) {
  .topbar { grid-template-columns: 1fr auto; row-gap: 10px; padding: 10px 12px; }
  .center-controls { grid-column: 1 / -1; grid-row: 2; justify-content: center; flex-wrap: wrap; }
  .end-controls { gap: 4px; }
  .end-controls .pill { padding: 8px 12px; }
  .status { display: none; }
  .device, .device--og, .device--x { border-radius: 14px; padding: 9px 9px 18px; }
    .stage-hint { font-size: 11.5px; padding: 6px 12px; }
  .workspace { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: 42vh minmax(0, 1fr); }
  .stage, .pane--left, body.right-open .stage, body.right-open .pane--left { position: static; width: auto; transform: none; }
  .stage { grid-row: 1; padding: 4px 12px 8px; }
  .pane--left { grid-row: 2; min-height: 0; }
  .pane--right { position: fixed; z-index: 30; top: auto; width: auto; left: 0; right: 0; bottom: 0; height: 62vh; background: var(--bg); border-radius: 20px 20px 0 0; box-shadow: 0 -20px 40px -20px rgb(0 0 0 / .3); transform: translateY(100%); transition: transform .3s var(--ease); }
  body.right-open .pane--right { transform: none; }
}

/* ---- Motion: quiet, short, and off when the system asks for less ---- */
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.pane section.active, .pane [data-tab-panel].active { animation: rise .28s var(--ease); }
.results li, .topic, .option { transition: border-color .15s, background .15s, transform .15s; }
.option:hover, .topic:hover { transform: translateY(-1px); }
.pill, .seg button, .icon-btn { transition: background .15s, color .15s, box-shadow .2s, transform .12s; }
.pill:active, .seg button:active, .icon-btn:active { transform: scale(.97); }
.pill--primary:hover { box-shadow: 0 6px 16px -6px rgb(232 112 90 / .6); }
/* The device appears with a short, slight rise; it never zooms. */
@keyframes device-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.device { animation: device-in .22s var(--ease); }
.device-screen iframe { transition: opacity .25s ease; }
.device-screen iframe.loading { opacity: .35; }
.status { transition: opacity .2s; }
.status:empty { opacity: 0; }
dialog[open] { animation: rise .3s var(--ease); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---- Sign-in page ---- */
body.signed-out > .topbar, body.signed-out > .workspace { display: none; }
.login { position: fixed; inset: 0; display: grid; place-items: center; padding: 16px; background: var(--bg); }
.login-card { width: min(380px, 100%); padding: 32px 28px 24px; background: var(--surface); border-radius: 24px; box-shadow: 0 30px 80px -30px rgb(0 0 0 / .25); animation: rise .3s var(--ease); }
.login-card .brand--big { margin-bottom: 4px; }
.login-lede { margin: 0 0 24px; color: var(--muted); font-size: 14px; }
.login-foot { margin: 14px 0 0; text-align: center; }
.link { padding: 0; border: 0; background: none; font: inherit; color: var(--accent); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* ---- About ---- */
dialog.about { width: min(560px, calc(100% - 32px)); max-height: min(720px, calc(100% - 48px)); padding: 0; overflow: hidden; display: none; }
dialog.about[open] { display: flex; flex-direction: column; }
.about-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 8px; }
.about-head h2 { margin: 0; font: 600 18px/1.3 var(--sans); }
.about-body { padding: 4px 24px 24px; overflow-y: auto; scrollbar-width: none; font-size: 14px; line-height: 1.55; }
.about-body::-webkit-scrollbar { display: none; }
.about-body:focus { outline: none; }
.about-body p { margin: 0 0 12px; }
.about-body p:last-child { margin-bottom: 0; }
/* The trmnl.news wordmark inline, in its own blackletter. */
.wordmark { font: 400 1.15em/1 "UnifrakturMaguntia", serif; color: var(--ink); white-space: nowrap; }
.wordmark span { font: inherit; color: var(--muted); }
.wordmark--plain span { color: inherit; }
.about-foot { margin-top: 18px !important; font-size: 13px; }

/* ---- The tiniest screens: a note instead of the editor ---- */
.desktop-only { display: none; }
@media (max-width: 319px) {
  body > :not(.desktop-only):not(dialog):not(script) { display: none !important; }
  .desktop-only { display: grid; place-content: center; gap: 10px; min-height: 100dvh; padding: 24px; text-align: center; color: var(--muted); font-size: 15px; line-height: 1.5; }
  .desktop-only p { margin: 0; max-width: 320px; }
  .desktop-only .brand--big { margin: 0 auto; }
}

/* ---- Preview trouble: a calm note on the screen when there's no preview yet ---- */
.screen-note { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; margin: 0; padding: 24px; text-align: center; font-size: 13px; color: var(--muted); }

/* ---- First visit: one question per screen ---- */
/* The guide alone, centred, in place of the editor: no device beside it. */
.onboard { display: none; }
body.onboarding .onboard { display: flex; flex-direction: column; left: 0; right: 0; width: min(560px, 100%); margin: 0 auto; padding: 0 28px 24px 32px; }
body.onboarding #left, body.onboarding #panel, body.onboarding #connect,
body.onboarding .stage { display: none; }
/* The top bar keeps its height: its buttons hide but hold their place. */
body.onboarding .end-controls, body.onboarding .start-controls .pill { visibility: hidden; }

.ob-top { display: flex; align-items: center; gap: 12px; padding: 18px 0 26px; }
.ob-dots { display: flex; gap: 6px; }
.ob-dots span { width: 6px; height: 6px; border-radius: 999px; background: #d6d3cc; transition: width .25s var(--ease), background .25s; }
.ob-dots .done { background: #f0b6a9; }
.ob-dots .on { width: 18px; background: var(--accent); }
.ob-count { font: 500 12px/1 var(--sans); color: var(--muted); }
/* Only the step's content scrolls; side padding keeps focus rings and hover lifts unclipped. */
.ob-body { flex: 1; min-height: 0; overflow-y: auto; margin: 0 -8px; padding: 4px 8px 8px; scrollbar-width: none; }
.ob-body::-webkit-scrollbar { display: none; }
.ob-title { margin: 0 0 8px; font: 600 26px/1.2 var(--sans); letter-spacing: -.015em; }
.ob-title:focus { outline: none; }
.ob-lede { margin: 0 0 26px; font-size: 14.5px; line-height: 1.55; color: var(--muted); }
.ob-text { margin: 0 0 14px; font-size: 14.5px; line-height: 1.6; }
.ob-text b { font-weight: 600; }
.ob-note { margin: 4px 0 0; font-size: 13px; line-height: 1.5; color: var(--muted); }
/* Why Continue is off: just above the buttons, so it never scrolls out of view. */
.ob-why { margin: 0; padding-top: 12px; }
.ob-why:empty { display: none; }
.ob-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 18px; }
.ob-nav { display: flex; gap: 8px; }
.ob-nav .pill { padding: 11px 20px; font-size: 13.5px; }
#ob-next:disabled { cursor: not-allowed; box-shadow: none; }
#ob-skip { font-size: 13px; align-self: center; }

/* Steps fade in with a short slide, from the side you're moving towards. */
@keyframes ob-in { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: none; } }
@keyframes ob-in-back { from { opacity: 0; transform: translateX(-12px); } to { opacity: 1; transform: none; } }
.ob-step { animation: ob-in .26s var(--ease); }
.ob-step--back { animation-name: ob-in-back; }

/* Device cards: each drawn at its rough proportions and relative size. */
.ob-devices { gap: 12px; }
.ob-device { padding: 20px 18px 18px; }
.ob-device b { font-size: 15px; }
.ob-shape { display: flex; align-items: flex-end; height: 96px; margin-bottom: 18px; }
.ob-shape > span { display: block; height: 100%; padding: 7px 7px 11px; border-radius: 9px; background: #ebe9e3; box-shadow: inset 0 0 0 1px rgb(40 35 30 / .08); }
.ob-shape > span::after { content: ""; display: block; height: 100%; border-radius: 2px; background: #fff; box-shadow: inset 0 0 0 1px rgb(40 35 30 / .1); }
.ob-shape--x > span { aspect-ratio: 1084 / 834; }
.ob-shape--og > span { height: 72%; aspect-ratio: 860 / 548; border-radius: 7px; }
.ob-device:has(input:checked) .ob-shape > span { background: #f6d9d1; }
.ob-device .ob-shape--pages { display: flex; gap: 6px; }
.ob-shape--pages > span { margin: 0; height: 62%; aspect-ratio: 1084 / 834; border-radius: 7px; }

/* "The ___ Times", large. */
.ob-affix { gap: 12px; font-size: 34px; }
.ob-affix input { padding: 12px 14px; font-size: 18px; }

.ob-place { display: flex; align-items: center; gap: 8px; margin: 10px 2px 0; font-size: 13.5px; }
.ob-place:empty { display: none; }
.ob-place span { color: var(--muted); }
.ob-place .icon svg { width: 16px; height: 16px; }

/* Topics: compact, two to a row, icon and name. */
.ob-topics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ob-topics .topic-head { height: 100%; align-items: center; padding: 12px; }
.ob-topics .topic-head > .icon { margin-top: 0; }
.ob-topics .topic-head .topic-mark { width: 18px; height: 18px; margin-top: 0; }

/* Favourite outlets: one column, name, language and what each brings. */
.ob-outlets { display: grid; gap: 8px; }
.ob-outlets .topic-head { align-items: center; gap: 12px; padding: 11px 14px; }
.ob-outlets .topic-text { flex: 1; }

.ob-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 10px; }

/* About: the quiet way back into setup. */
.link--quiet { margin-left: 16px; color: var(--muted); }
.link--quiet:hover { color: var(--ink); }

/* Narrow screens: Connect sits under the settings. */
@media (max-width: 900px) {
  .pane--connect { position: static; width: auto; grid-row: 3; }
  .workspace { grid-template-rows: 42vh auto auto; overflow-y: auto; }
}

#connect-open, #connect-close { display: none; }
@media (min-width: 901px) and (max-width: 1180px) {
  #connect-open, #connect-close { display: inline-grid; }
  #connect-open { display: inline-block; }
  .stage { width: calc(100% - var(--side-w)); }
  .pane--connect { z-index: 4; background: var(--bg); transform: translateX(100%); }
  body.connect-open .pane--connect { transform: none; box-shadow: -20px 0 40px -24px rgb(0 0 0 / .3); }
}

/* Right column: its title, as a lone pressed segment */
.seg--title { margin: 0; }
.seg--title span { display: block; font: 600 12px/1 var(--sans); padding: 8px 14px; border-radius: 999px; background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgb(0 0 0 / .1); }

/* Settings: a block apiece */
/* Like Connect's steps: an icon, a bold title, a line on what it does, then the controls. */
.sblock { display: grid; grid-template-columns: 26px minmax(0, 1fr); column-gap: 12px; padding-bottom: 30px; }
.sblock-icon { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 999px; background: var(--soft); color: var(--accent); }
.sblock-body h3 { margin: 2px 0 4px; font: 600 14px/1.3 var(--sans); }
.sblock-body h3 label { cursor: inherit; }
.sblock-body > p { margin: 0 0 12px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.sblock-body .switch { margin-top: 2px; }
/* A heading only: the list below runs full width. */
.sblock--head { padding-bottom: 6px; }
.corner-city .link { font-weight: 600; }
.settings-block { scroll-margin-top: 70px; }

/* Top bar: what's missing from the setup */
.issues-wrap { position: relative; }
.issues { display: inline-flex; align-items: center; gap: 8px; background: var(--accent-soft); border: 1px solid var(--accent); color: var(--ink); animation: issues-in .4s var(--ease); }
.issues:hover { background: #fbe3dc; }
.issues[hidden] { display: none; }
.issues-icon { color: var(--accent); animation: issues-nudge 3s ease-in-out infinite; transform-origin: 50% 80%; }
.issues-pop { position: absolute; top: calc(100% + 8px); right: 0; z-index: 40; width: 300px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 16px 40px -16px rgb(0 0 0 / .25); animation: rise .2s var(--ease); }
.issues-pop ul { list-style: none; margin: 0; padding: 0; }
.issues-pop li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 10px 12px; font-size: 13px; line-height: 1.4; }
.issues-pop li + li { border-top: 1px solid var(--line); }
.issues-pop .link { flex: none; font-weight: 600; text-decoration: none; }
.issues-pop .link:hover { text-decoration: underline; }
@keyframes issues-in { from { opacity: 0; transform: translateY(-4px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes issues-nudge { 0%, 80%, 100% { transform: none; } 85% { transform: rotate(-10deg); } 90% { transform: rotate(8deg); } 95% { transform: rotate(-4deg); } }
@media (prefers-reduced-motion: reduce) { .issues, .issues-icon, .issues-pop { animation: none; } }

/* About and Setup guide, in the top bar beside the wordmark. */
.bar-pill { display: inline-flex; align-items: center; gap: 6px; }
.start-controls .pill--ghost, #plugin-link { background: var(--soft); }
.start-controls .pill--ghost:hover, #plugin-link:hover { background: #e2e0da; }
#plugin-link { color: var(--ink); text-decoration: none; }
.bar-pill svg { color: var(--muted); }

/* ---- Hero: first visit, before the guide ---- */
/* Three screens with today's paper fill the page; one line of copy and one
   button underneath. It stands in for the workspace; the top bar keeps only
   the wordmark. */
.hero { display: none; }
body.hero-on .hero { display: grid; grid-template-rows: minmax(0, 1fr) auto; min-height: 0; padding: 0 clamp(28px, 4vw, 64px) clamp(28px, 5vh, 56px); }
body.hero-on .workspace { display: none; }
body.hero-on .end-controls, body.hero-on .start-controls .pill { visibility: hidden; }

.hero-art { container-type: size; display: grid; place-items: center; min-height: 0; }
/* As large as the space allows, at the composition's own proportions. */
.hero-stage { position: relative; width: min(100cqw, 205cqh, 1500px); aspect-ratio: 2.05; perspective: 2400px; }
.hero-dev { position: absolute; animation: hero-in .7s var(--ease) both; }
.hero-stage.waiting .hero-dev { visibility: hidden; animation: none; }
.hero-dev--left { left: 1%; top: 6%; width: 37%; z-index: 1; animation-delay: .12s; }
.hero-dev--center { left: 27%; top: 3%; width: 47%; z-index: 2; }
.hero-dev--right { left: 62%; top: 40%; width: 37%; z-index: 3; animation-delay: .22s; }
.hero-device { position: relative; transform-origin: 50% 60%; }
.hero-device--light { box-shadow: 0 50px 70px -40px rgb(60 45 30 / .45), 0 18px 30px -18px rgb(60 45 30 / .25); }
.hero-device--dark { box-shadow: 0 50px 70px -40px rgb(20 15 10 / .55), 0 18px 30px -18px rgb(20 15 10 / .35); }
.hero-dev--left .hero-device { transform: rotateY(16deg) rotateX(3deg) rotateZ(-1.5deg); }
.hero-dev--center .hero-device { transform: rotateX(4deg) rotateZ(.6deg); }
.hero-dev--right .hero-device { transform: rotateY(-14deg) rotateX(3deg) rotateZ(1.2deg); }
.hero-device .device-screen { pointer-events: none; }
.hero-device iframe { position: absolute; top: 0; left: 0; border: 0; transform-origin: 0 0; background: #fff; opacity: 0; transition: opacity .6s ease; }
.hero-device iframe.ready { opacity: 1; }
/* Until the page arrives: a sketch of one, masthead and columns. */
.hero-sketch { position: absolute; inset: 0; display: grid; grid-template-rows: auto auto 1fr; gap: 6%; padding: 5% 6%; background: #fff; }
.hero-device .device-screen { container-type: inline-size; }
.hero-sketch b { justify-self: center; font: 400 6.5cqw/1 "UnifrakturMaguntia", serif; color: #222; white-space: nowrap; }
.hero-sketch i { height: 2px; border-block: 1px solid #222; }
.hero-sketch span { background: repeating-linear-gradient(#e6e4df 0 6%, transparent 6% 11%) left / 62% 100% no-repeat, repeating-linear-gradient(#e6e4df 0 6%, transparent 6% 11%) right / 32% 100% no-repeat; }

@keyframes hero-in { from { opacity: 0; translate: 0 14px; } to { opacity: 1; translate: none; } }

.hero-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 40px; padding-top: clamp(16px, 3vh, 32px); }
.hero-copy { max-width: 620px; }
.hero-title { margin: 0 0 12px; font: 400 clamp(38px, 4.4vw, 64px)/1.02 "Newsreader", Georgia, serif; letter-spacing: -.02em; }
.hero-lede { margin: 0; max-width: 520px; font-size: 15px; line-height: 1.55; color: var(--muted); }
.hero-actions { display: flex; align-items: center; gap: 22px; flex: none; }
.hero-cta { padding: 15px 26px; font-size: 15px; }
.hero-title .nowrap { white-space: nowrap; }

/* A quiet emphasis: underlined, not bold. */
.hl { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }

/* A pill with a leading icon, e.g. "+ Add an edition". */
.icon-pill { display: inline-flex; align-items: center; gap: 6px; }

/* ---- Phones: one view at a time, a tab bar, sheets ---- */
/* Everything below is for screens up to 760px; wider ones never see it.
   app.js ("Phones") adds the tab bar and the list of areas under the paper,
   and marks the view on show with body.m-news (Sources), m-settings or
   m-connect (none: the paper). The clicked area's settings come up as a sheet. */
.m-tabs, .m-areas, .share-btn { display: none; }
@media (max-width: 760px) {
  :root { --m-gutter: 16px; --m-bar: calc(62px + env(safe-area-inset-bottom)); }
  body { height: 100dvh; }
  /* 16px and up: iOS doesn't zoom into a field on focus. */
  input, select { font-size: 16px; }

  /* Top bar: the wordmark, then About, the guide and any issues, as icons. */
  .topbar { display: flex; align-items: center; gap: 4px; padding: calc(8px + env(safe-area-inset-top)) max(var(--m-gutter), env(safe-area-inset-right)) 8px max(var(--m-gutter), env(safe-area-inset-left)); }
  .start-controls { flex: 1; min-width: 0; gap: 6px; }
  .start-controls .brand { margin-right: auto; font-size: 25px; }
  .center-controls, .status, #connect-open { display: none !important; }
  .bar-pill { justify-content: center; width: 44px; height: 44px; padding: 0; gap: 0; font-size: 0; }
  .bar-pill svg { width: 18px; height: 18px; color: var(--ink); }
  .end-controls { gap: 6px; }
  .end-controls:has(.issues[hidden]) { display: none; }
  .issues { min-height: 44px; padding: 0 14px; }
  .issues-pop { position: fixed; top: calc(64px + env(safe-area-inset-top)); left: var(--m-gutter); right: var(--m-gutter); width: auto; }
  .issues-pop li { align-items: center; }
  .issues-pop .link { padding: 12px 0; }

  /* Touch: 44px targets, nothing that needs a hover. */
  .pill { min-height: 44px; }
  .pill--small { min-height: 44px; padding: 10px 16px; font-size: 13px; }
  .icon-btn { width: 44px; height: 44px; }
  .seg button, .seg label span { min-height: 42px; padding: 0 14px; display: grid; place-items: center; font-size: 13px; }
  .sec { min-height: 44px; padding: 8px 14px; font-size: 14px; }
  .sec[aria-pressed="true"] { padding-left: 11px; }
  .secs { gap: 8px; }
  .results li { padding: 12px; }
  .news-tools input, .news-tools select { min-height: 46px; }
  .switch { padding: 14px; }
  .option { padding: 14px; }
  .options:not(.options--stack) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .edition { grid-template-columns: minmax(0, 1fr) 44px; }
  .option:hover, .topic:hover { transform: none; }

  /* The views fill the space between the top bar and the tab bar. */
  .workspace { display: block; overflow: hidden; }
  #stage, #left, #connect { position: absolute; top: 0; right: 0; bottom: var(--m-bar); left: 0; width: auto; transform: none; box-shadow: none; display: none; }
  body:not(.m-news):not(.m-settings):not(.m-connect) #stage { display: flex; }
  body.m-news #left, body.m-settings #left, body.m-connect #connect { display: block; }
  body.onboarding #stage, body.onboarding #left, body.onboarding #connect { display: none !important; }
  .pane-inner { padding: 0 max(var(--m-gutter), env(safe-area-inset-right)) 32px max(var(--m-gutter), env(safe-area-inset-left)); }
  .pane-head { margin: 0 calc(-1 * var(--m-gutter)) 14px; padding: 12px var(--m-gutter) 10px; }
  #left .pane-inner, #connect .pane-inner { max-width: 600px; margin: 0 auto; } /* small tablets: a readable column */
  /* News and Settings: the tab bar picks; the head shows which, like Connect's title. */
  #left .seg--full { display: inline-flex; }
  #left .seg [aria-selected="false"] { display: none; }
  #left .seg button { cursor: default; }
  .hint, .ob-note, .sblock-body > p { font-size: 14px; }

  /* Paper: the page scaled to the width, its parts listed below it. */
  #stage { justify-content: flex-start; gap: 12px; padding: 12px max(var(--m-gutter), env(safe-area-inset-right)) 24px max(var(--m-gutter), env(safe-area-inset-left)); overflow-x: hidden; overflow-y: auto; scrollbar-width: none; }
  #stage-bar { flex: none; flex-wrap: wrap; justify-content: center; gap: 6px; width: 100% !important; }
  .stage-bar .pill-select { min-height: 48px; padding: 8px 32px 8px 14px; font-size: 16px; background-position: right 12px center; }
  .stage-bar .seg button { padding: 0 14px; }
  .device { flex: none; }
  .stage-hint { flex: none; margin: 0; padding: 7px 13px; font-size: 12.5px; text-align: center; }
  .m-areas { display: grid; gap: 8px; flex: none; width: 100%; margin-top: 8px; }
  .m-areas-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 48px; margin-bottom: 2px; }
  .m-areas-head .label { margin: 0 2px; }
  #page-select { display: none; }
  /* No Preview/Setup switch: the list below names the parts instead. */
  .stage-bar .seg:has([data-mode]) { display: none; }
  .m-area { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 58px; padding: 10px 12px 10px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; font: inherit; color: inherit; text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: border-color .15s, background .15s; }
  .m-area:active { background: var(--soft); }
  .m-area[aria-current="true"] { border-color: var(--accent); background: var(--accent-soft); }
  .m-area:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
  .m-area .icon svg { width: 18px; height: 18px; }
  .m-area-text { flex: 1; min-width: 0; }
  .m-area-text b { display: block; font: 600 14px/1.3 var(--sans); }
  .m-area-text small { display: block; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--muted); }
  .m-area .m-chev { color: #b5b2ab; transform: rotate(-90deg); }
  .m-area .m-chev svg { width: 18px; height: 18px; }

  /* A clicked area's settings: a sheet from the bottom, the page still in view above it. */
  #panel { position: fixed; z-index: 40; top: auto; right: 0; bottom: 0; left: 0; width: auto; height: auto; max-height: var(--sheet-max, 70dvh); display: flex; flex-direction: column; background: var(--bg); border-radius: 20px 20px 0 0; box-shadow: 0 -10px 40px -12px rgb(0 0 0 / .28); transform: translateY(105%); transition: transform .32s var(--ease), visibility 0s linear .32s; visibility: hidden; }
  body.right-open #panel { transform: none; visibility: visible; transition: transform .32s var(--ease); }
  #panel::before { content: ""; flex: none; width: 36px; height: 4px; margin: 8px auto 0; border-radius: 999px; background: #d6d3cc; }
  #panel .pane-inner { height: auto; min-height: 0; flex: 1 1 auto; padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
  #panel .pane-head { padding-top: 4px; }
  #panel .pane-head h2 { flex: 1; }
  #panel .icon-btn--back { order: 2; margin: 0 -10px 0 0; background: var(--soft); color: var(--ink); }
  #panel .icon-btn--back svg { transform: rotate(-90deg); } /* points down: closes */

  /* Connect: the link, and one big button to copy it. */
  .link-box { max-height: 6.2em; overflow: hidden; -webkit-mask-image: linear-gradient(#000 55%, transparent); mask-image: linear-gradient(#000 55%, transparent); }
  .link-box.is-open { max-height: none; -webkit-mask-image: none; mask-image: none; }
  .seg--title span { display: grid; place-items: center; min-height: 42px; padding: 0 14px; font-size: 13px; }
  .copy-btn { display: block; width: 100%; min-height: 50px; background: var(--accent); color: #fff; font-size: 15px; }
  .copy-btn:hover { background: #df5f48; }
  /* With the phone's share sheet: two buttons side by side. */
  .copy-btn:has(+ .share-btn) { display: inline-block; width: calc(50% - 4px); margin-right: 8px; vertical-align: top; }
  .share-btn { display: inline-block; width: calc(50% - 4px); min-height: 50px; margin-bottom: 10px; font-size: 15px; vertical-align: top; }

  /* The tab bar: Paper, News, Settings, Connect. */
  .m-tabs { position: fixed; z-index: 30; right: 0; bottom: 0; left: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); height: var(--m-bar); padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); background: rgb(246 245 242 / .94); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-top: 1px solid var(--line); }
  body.hero-on .m-tabs, body.onboarding .m-tabs { display: none; }
  .m-tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-width: 0; border: 0; background: none; color: var(--muted); font: 600 11px/1 var(--sans); cursor: pointer; -webkit-tap-highlight-color: transparent; }
  .m-tab .icon { width: 54px; height: 30px; border-radius: 999px; color: inherit; transition: background .2s, color .2s; }
  .m-tab .icon svg { width: 20px; height: 20px; }
  .m-tab[aria-current="page"] { color: var(--ink); }
  .m-tab[aria-current="page"] .icon { background: var(--accent-soft); color: var(--accent); }
  .m-tab:focus-visible { outline: none; }
  .m-tab:focus-visible .icon { box-shadow: 0 0 0 2px var(--accent); }

  /* Setup guide: the same steps, a gutter wide, its buttons in reach. */
  body.onboarding #onboard { width: 100%; padding: 0 max(var(--m-gutter), env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom)) max(var(--m-gutter), env(safe-area-inset-left)); }
  .ob-top { padding: 8px 0 18px; }
  .ob-title { font-size: 24px; }
  .ob-lede { margin-bottom: 20px; font-size: 15px; }
  .ob-foot { padding-top: 12px; }
  .ob-nav .pill { min-height: 48px; padding: 0 20px; font-size: 14px; }
  #ob-skip { min-height: 44px; font-size: 14px; }
  .ob-fields { grid-template-columns: minmax(0, 1fr); }
  .ob-affix { gap: 8px; font-size: 28px; }
  .ob-device { padding: 16px 14px 14px; }
  .ob-shape { height: 72px; margin-bottom: 14px; }
  .ob-topics .topic-head, .ob-outlets .topic-head { min-height: 52px; }

  /* Hero: the three screens, closer together, then the copy and one button. */
  body.hero-on .hero { overflow: hidden; padding: 4px max(var(--m-gutter), env(safe-area-inset-right)) calc(20px + env(safe-area-inset-bottom)) max(var(--m-gutter), env(safe-area-inset-left)); }
  .hero-stage { width: min(100cqw, 100cqh * 1.05, 520px); aspect-ratio: 1.05; perspective: 1400px; }
  .hero-dev--left { left: 0; top: 4%; width: 58%; }
  .hero-dev--center { left: 9%; top: 22%; width: 82%; }
  .hero-dev--right { left: 46%; top: 60%; width: 54%; }
  .hero-foot { flex-direction: column; align-items: stretch; gap: 20px; padding-top: 12px; }
  .hero-title { font-size: clamp(32px, 9.6vw, 48px); }
  .hero-actions { display: block; }
  .hero-cta { width: 100%; min-height: 52px; }

  /* About and Terms: nearly the whole screen. */
  dialog.about { width: calc(100% - 24px); max-height: calc(100dvh - 48px); }
  .about-head { padding: 14px 14px 6px 20px; }
  .about-body { padding: 4px 20px 22px; }
}
