/* Style: "Lantern Night, quieter" (Robson, 14 Oct 2026). Indigo night for the header and for the cards over the
   world, lantern gold for what's active, light pages for reading. The 3D world itself is untouched. */
:root {
  --paper: #f5f3ee;
  --paper-2: #ebe8f0;
  --card: #fbfaf7;
  --ink: #1d2142;
  --ink-2: #4c5175;
  --ink-3: #686c8c;
  --rule: #dcd8e2;
  --accent: #2b3274;
  --accent-soft: #e6e5f0;
  --general: #8c8ea6;
  --crit: #8a6216;
  --crit-soft: #f4e8cc;
  --ok: #3f6b45;
  --night: #191c36;
  --night-2: #252b55;
  --night-rule: #3d4377;
  --lantern: #f2b544;
  --lantern-ink: #8a6216;
  --serif: 'Alegreya', 'Iowan Old Style', Georgia, serif;
  --sans: 'Alegreya Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --display: 'Cormorant', 'Cormorant Garamond', Georgia, serif;
  --radius: 10px;
  --shadow: 0 12px 34px rgba(16, 18, 40, 0.22);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #14172e;
    --paper-2: #1f2447;
    --card: #1c2142;
    --ink: #f1eadb;
    --ink-2: #c9c4da;
    --ink-3: #a29db8;
    --rule: #343b70;
    --accent: #f2b544;
    --accent-soft: #3a3420;
    --general: #8a87a6;
    --crit: #e8b766;
    --crit-soft: #3a2f19;
    --ok: #8fbf92;
    --lantern-ink: #f2b544;
    --shadow: 0 12px 34px rgba(0, 0, 0, 0.5);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.6 var(--serif);
  -webkit-font-smoothing: antialiased;
  padding-bottom: env(safe-area-inset-bottom);
}
button { font: inherit; color: inherit; }
a { color: var(--accent); }
main { max-width: 680px; margin: 0 auto; padding: 8px 20px calc(120px + env(safe-area-inset-bottom)); outline: none; }

/* ---------- top bar ---------- */
.bar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) 20px 10px;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--rule);
}
.brand { display: flex; align-items: center; gap: 8px; font: 600 19px/1 var(--serif); letter-spacing: .01em; color: var(--ink); text-decoration: none; }
.brand svg { width: 24px; height: 24px; color: var(--accent); }
.mode { font: 500 12px/1 var(--sans); color: var(--ink-2); background: var(--paper-2); border: 1px solid var(--rule); padding: 6px 10px; border-radius: 99px; }

/* ---------- labels & small type ---------- */
.eyebrow { font: 600 11.5px/1.3 var(--sans); letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 8px; }
.muted { color: var(--ink-2); }
.small { font: 400 13.5px/1.5 var(--sans); }

/* ---------- home ---------- */
.hero { padding: 40px 0 12px; }
.hero h1 { font: 500 clamp(30px, 7vw, 40px)/1.12 var(--serif); letter-spacing: -.01em; margin: 0 0 12px; }
.hero p { margin: 0; color: var(--ink-2); max-width: 34em; }
.search { position: relative; margin: 28px 0 8px; }
.search input {
  width: 100%; font: 400 17px/1 var(--sans); color: var(--ink);
  padding: 16px 16px 16px 46px; border-radius: var(--radius);
  border: 1px solid var(--rule); background: var(--card);
  box-shadow: 0 1px 0 rgba(0,0,0,.03);
  -webkit-appearance: none; appearance: none;
}
.search input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.search svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--ink-3); }
.results { list-style: none; margin: 8px 0 0; padding: 0; }
.results li + li { border-top: 1px solid var(--rule); }
.result {
  display: flex; gap: 14px; align-items: flex-start; width: 100%; text-align: left;
  padding: 14px 4px; background: none; border: 0; cursor: pointer;
}
.result:hover .result-title, .result:focus-visible .result-title { color: var(--accent); }
.result-title { font: 500 18px/1.3 var(--serif); }
.result-desc { font: 400 13.5px/1.4 var(--sans); color: var(--ink-2); margin-top: 3px; }
.kind { flex: none; margin-top: 3px; font: 600 10.5px/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; padding: 5px 7px; border-radius: 6px; background: var(--paper-2); color: var(--ink-2); border: 1px solid var(--rule); }
.section-label { margin: 40px 0 6px; }
.empty { padding: 18px 4px; color: var(--ink-2); font: 400 14.5px/1.5 var(--sans); }

.how { margin-top: 44px; display: grid; gap: 14px; }
.how-step { display: grid; grid-template-columns: 30px 1fr; gap: 12px; align-items: start; font: 400 14.5px/1.5 var(--sans); color: var(--ink-2); }
.how-step b { color: var(--ink); font-weight: 600; }
.how-num { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font: 600 12px/1 var(--sans); color: var(--accent); border: 1px solid var(--accent); }

/* ---------- building ---------- */
.building { padding: 48px 0; }
.building h2 { font: 500 28px/1.2 var(--serif); margin: 0 0 4px; }
.stages { list-style: none; padding: 0; margin: 28px 0; display: grid; gap: 14px; font: 400 15px/1.4 var(--sans); }
.stages li { display: flex; gap: 12px; align-items: center; color: var(--ink-3); }
.stages li.active { color: var(--ink); }
.stages li.done { color: var(--ink-2); }
.dot { flex: none; width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid currentColor; display: grid; place-items: center; }
.active .dot { border-color: var(--accent); border-top-color: transparent; animation: spin .9s linear infinite; }
.done .dot { background: var(--ok); border-color: var(--ok); }
.done .dot::after { content: ''; width: 5px; height: 9px; border: solid var(--paper); border-width: 0 2px 2px 0; transform: translateY(-1px) rotate(45deg); }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .active .dot { animation: none; border-top-color: var(--accent); } }
.error { padding: 16px; border-radius: var(--radius); background: var(--accent-soft); color: var(--ink); font: 400 14.5px/1.5 var(--sans); }

/* ---------- guide ---------- */
.work-head { padding: 34px 0 6px; }
.work-head h1 { font: 500 clamp(32px, 8vw, 44px)/1.08 var(--serif); letter-spacing: -.015em; margin: 0; }
.work-meta { margin-top: 10px; font: 400 14px/1.5 var(--sans); color: var(--ink-2); }
.work-meta .orig { font-style: italic; font-family: var(--serif); font-size: 16px; }

.grounding {
  margin: 22px 0 6px; padding: 14px 16px; border-radius: var(--radius);
  background: var(--card); border: 1px solid var(--rule);
  font: 400 13.5px/1.5 var(--sans); color: var(--ink-2);
}
.meter { display: flex; height: 6px; border-radius: 3px; overflow: hidden; background: var(--rule); margin: 10px 0 8px; }
.meter span { background: var(--accent); }
.grounding strong { color: var(--ink); font-weight: 600; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 6px; }
.legend i { display: inline-block; width: 12px; height: 3px; vertical-align: middle; margin-right: 6px; border-radius: 2px; }
.legend .l-src { background: var(--accent); }
.legend .l-gen { background: repeating-linear-gradient(90deg, var(--general) 0 3px, transparent 3px 5px); }

.tabs { display: flex; gap: 4px; margin: 24px 0 4px; border-bottom: 1px solid var(--rule); position: sticky; top: var(--bar-h, 45px); background: var(--paper); z-index: 4; }
.tab { background: none; border: 0; padding: 12px 12px 11px; font: 500 14.5px/1 var(--sans); color: var(--ink-3); border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }

.overview { font-size: 20px; line-height: 1.5; margin: 26px 0 8px; }
.coverage { font: italic 400 15px/1.55 var(--serif); color: var(--ink-2); margin: 0 0 8px; }

.guide-section { margin-top: 38px; }
.guide-section h2 { font: 500 24px/1.25 var(--serif); margin: 0 0 14px; }
.para { position: relative; margin: 0 0 18px; padding-left: 16px; }
.para::before { content: ''; position: absolute; left: 0; top: 6px; bottom: 6px; width: 2px; border-radius: 2px; background: var(--accent); opacity: .7; }
.para.basis-general::before { background: repeating-linear-gradient(180deg, var(--general) 0 4px, transparent 4px 7px); opacity: 1; }
.para p { margin: 0; }
.para-note { display: block; margin-top: 6px; font: 400 12px/1.4 var(--sans); color: var(--ink-3); }

.cite {
  display: inline-block; vertical-align: 2px; margin-left: 2px;
  font: 600 11px/1 var(--sans); color: var(--accent); background: var(--accent-soft);
  border: 0; border-radius: 5px; padding: 3px 5px; cursor: pointer;
}
.cite:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.term {
  font: inherit; background: none; border: 0; padding: 0; cursor: pointer; color: inherit;
  text-decoration: underline dotted var(--accent); text-decoration-thickness: 1.5px; text-underline-offset: 3px;
}
.term:hover, .term:focus-visible { color: var(--accent); outline: none; }

.list { list-style: none; padding: 0; margin: 0; }
.list li { position: relative; padding: 0 0 0 26px; margin: 0 0 14px; }
.list li::before { content: ''; position: absolute; left: 4px; top: 11px; width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--accent); }
.questions li::before { content: '?'; border: 0; top: 0; left: 2px; width: auto; height: auto; font: italic 600 19px/1.4 var(--serif); color: var(--accent); }

.glossary { display: grid; gap: 2px; }
.gloss-item { text-align: left; width: 100%; padding: 12px 0; background: none; border: 0; border-bottom: 1px solid var(--rule); cursor: pointer; }
.gloss-item b { font: 500 17px/1.3 var(--serif); display: block; }
.gloss-item span { font: 400 13.5px/1.45 var(--sans); color: var(--ink-2); }
.gloss-item:hover b { color: var(--accent); }

.reading-item { padding: 14px 0; border-bottom: 1px solid var(--rule); }

/* ---------- sources ---------- */
.source { padding: 16px 0; border-bottom: 1px solid var(--rule); scroll-margin-top: 120px; }
.source-id { font: 600 11px/1 var(--sans); color: var(--accent); background: var(--accent-soft); padding: 3px 6px; border-radius: 5px; margin-right: 6px; }
.source-title { font: 500 17px/1.35 var(--serif); }
.source-meta { font: 400 13px/1.5 var(--sans); color: var(--ink-2); margin-top: 4px; }
.source-links { display: flex; gap: 14px; margin-top: 6px; font: 500 13px/1.4 var(--sans); }
.badge { display: inline-block; font: 600 10.5px/1 var(--sans); letter-spacing: .04em; text-transform: uppercase; padding: 4px 6px; border-radius: 5px; margin: 6px 6px 0 0; border: 1px solid var(--rule); color: var(--ink-2); }
.badge.cited { color: var(--ok); border-color: currentColor; }
.badge.dim { opacity: .7; }
.abstract { font: 400 14px/1.55 var(--serif); color: var(--ink-2); margin-top: 8px; }
details summary { cursor: pointer; font: 500 13px/1.4 var(--sans); color: var(--ink-2); margin-top: 6px; }
.filter-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 18px 0 4px; }
.chip { font: 500 13px/1 var(--sans); padding: 8px 12px; border-radius: 99px; border: 1px solid var(--rule); background: var(--card); cursor: pointer; color: var(--ink-2); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.footer-meta { margin-top: 44px; padding-top: 16px; border-top: 1px solid var(--rule); font: 400 12.5px/1.6 var(--sans); color: var(--ink-3); height: auto; max-height: none; overflow: visible; overflow-x: auto; overflow-wrap: anywhere; }
.linkish { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; text-decoration: underline; font: inherit; }

/* ---------- bottom sheet ---------- */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(20, 14, 6, .35); z-index: 20; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 21;
  max-width: 640px; margin: 0 auto; max-height: 82vh; overflow: auto;
  background: var(--card); border-radius: 18px 18px 0 0; box-shadow: var(--shadow);
  padding: 10px 22px calc(28px + env(safe-area-inset-bottom));
  animation: rise .22s ease-out;
}
@media (min-width: 760px) { .sheet { bottom: 24px; border-radius: 18px; } }
@keyframes rise { from { transform: translateY(24px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .sheet { animation: none; } }
.sheet-grip { width: 38px; height: 5px; border-radius: 3px; background: var(--rule); margin: 0 auto 10px; }
.sheet-close { position: absolute; top: 10px; right: 12px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--paper-2); font-size: 22px; line-height: 1; cursor: pointer; color: var(--ink-2); }
.sheet h3 { font: 500 26px/1.2 var(--serif); margin: 8px 44px 14px 0; }
.sheet-block { padding: 14px 0; border-top: 1px solid var(--rule); }
.sheet-block:first-of-type { border-top: 0; padding-top: 0; }
.sheet-block p { margin: 0; }
.wiki { display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: start; }
.wiki img { width: 76px; height: 76px; object-fit: cover; border-radius: 8px; }
.wiki-title { font: 600 14px/1.4 var(--sans); margin-bottom: 4px; }
.alts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.skeleton { height: 12px; border-radius: 6px; background: var(--paper-2); margin: 8px 0; }
.skeleton.w80 { width: 80%; } .skeleton.w60 { width: 60%; }

.define-pill {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 15;
  max-width: calc(100vw - 32px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font: 600 14px/1 var(--sans); color: var(--paper); background: var(--ink);
  border: 0; border-radius: 99px; padding: 13px 18px; box-shadow: var(--shadow); cursor: pointer;
}
button.mode { cursor: pointer; }
.key-input { width: 100%; margin-top: 12px; font: 400 15px/1 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--ink); padding: 12px 14px; border-radius: 10px; border: 1px solid var(--rule); background: var(--paper); }
.key-input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

/* criticism tier */
.meter .m-crit { background: var(--crit); }
.legend .l-crit { background: var(--crit); }
.para.basis-criticism::before { background: var(--crit); opacity: .85; }
.cite.crit { color: var(--crit); background: var(--crit-soft); }
.badge.crit { color: var(--crit); border-color: currentColor; }
.source-id.crit { color: var(--crit); background: var(--crit-soft); }
.footer-actions { display: flex; flex-wrap: wrap; gap: 8px; }
a.chip { text-decoration: none; display: inline-block; }
.gen-details { display: grid; grid-template-columns: minmax(110px, 30%) 1fr; gap: 8px 14px; margin: 10px 0 12px; font: 400 13px/1.5 var(--sans); color: var(--ink-2); }
.gen-details dt { color: var(--ink-3); font-weight: 500; }
.gen-details > * { min-width: 0; } /* let grid cells shrink and wrap instead of spilling out */
.gen-details dd { margin: 0; overflow-wrap: anywhere; word-break: break-word; }
.gen-details strong { color: var(--ink); }
@media (max-width: 560px) { .gen-details { grid-template-columns: 1fr; gap: 2px; } .gen-details dd { margin-bottom: 8px; } }

/* posters and covers */
.result { align-items: center; }
.thumb { flex: none; width: 46px; height: 68px; object-fit: cover; border-radius: 5px; background: var(--paper-2); border: 1px solid var(--rule); }
.thumb-empty, .poster.thumb-empty { display: grid; place-items: center; font-size: 20px; color: var(--ink-3); }
.result .kind { display: inline-block; margin: 0 0 4px; }
.poster { flex: none; width: 92px; height: 136px; object-fit: cover; border-radius: 8px; border: 1px solid var(--rule); background: var(--paper-2); box-shadow: 0 4px 16px rgba(40, 28, 10, .15); }
.work-head.has-poster { display: flex; gap: 18px; align-items: flex-end; }
.work-head.has-poster h1 { font-size: clamp(28px, 7vw, 40px); }

/* confirmation page */
.confirm { padding: 32px 0; }
.confirm h1 { font: 500 clamp(28px, 7vw, 38px)/1.1 var(--serif); margin: 0 0 6px; }
.confirm-top { display: flex; gap: 20px; align-items: flex-start; margin-top: 8px; }
.poster-lg { width: 140px; height: 208px; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 14px 0 0; font: 400 14px/1.45 var(--sans); }
.facts dt { color: var(--ink-3); }
.facts dd { margin: 0; color: var(--ink); }
.confirm-summary { margin-top: 24px; padding: 16px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--rule); }
.confirm-summary > p:nth-child(2) { margin: 0 0 10px; }
.confirm-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 24px 0 10px; }
.btn-primary { font: 600 16px/1 var(--sans); color: var(--paper); background: var(--accent); border: 0; border-radius: 99px; padding: 14px 22px; cursor: pointer; }
.btn-primary:hover { filter: brightness(1.08); }
@media (max-width: 520px) { .confirm-top { flex-direction: column; } .poster-lg { width: 120px; height: 178px; } }
.spoiler-note { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--rule); color: var(--ink-2); }
.spoiler-note.warn { color: var(--accent); font-weight: 500; }

/* scholarship strength on the confirmation page */
.strength-box { margin-top: 20px; padding: 16px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--rule); }
.strength-head { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.strength-badge { font: 700 13px/1 var(--sans); letter-spacing: .04em; text-transform: uppercase; padding: 6px 10px; border-radius: 99px; border: 1.5px solid currentColor; }
.strength-bars { display: inline-flex; gap: 4px; }
.strength-bars i { width: 26px; height: 7px; border-radius: 4px; background: var(--rule); }
.lvl-strong { color: var(--ok); } .strength-bars i.on.lvl-strong { background: var(--ok); }
.lvl-moderate { color: var(--accent); } .strength-bars i.on.lvl-moderate { background: var(--accent); }
.lvl-thin, .lvl-none { color: var(--crit); } .strength-bars i.on.lvl-thin { background: var(--crit); }
.small-facts { font-size: 13px; margin-top: 10px; }
.mini-sources { list-style: none; padding: 0; margin: 6px 0 0; }
.mini-sources li { padding: 6px 0; border-bottom: 1px solid var(--rule); font-size: 14px; line-height: 1.4; }
.mini-sources .source-title { font-size: 15px; }
.mini-sources .source-meta { font-size: 12.5px; }
.coverage-inline { margin-top: 10px; font: italic 400 14px/1.5 var(--serif); color: var(--ink-2); }
.overview.hook { margin: 22px 0 6px; }
.grounding.compact { padding: 12px 14px; }
.grounding-line { font: 400 13.5px/1.5 var(--sans); color: var(--ink-2); }
.grounding.compact .meter { margin: 8px 0 4px; height: 5px; }
.about-sources summary { margin-top: 6px; }
.about-sources p { margin: 8px 0 0; }
.grounding.compact .spoiler-note { border-top: 0; padding-top: 0; margin-top: 6px; }

/* skimmable highlights and channel labels */
mark.hl { background: none; color: inherit; font-weight: 650; padding: 0; } /* key lines: bold, for skimming */
:root { --hl: #f3dfa4; }
@media (prefers-color-scheme: dark) { :root { --hl: #5a4a1f; } }
.channel { display: inline-block; font: 600 10.5px/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); border: 1px solid currentColor; border-radius: 5px; padding: 3px 6px; margin: 0 0 6px; }
.list li .channel { margin: 0 8px 0 0; vertical-align: 2px; }

/* after tab */
.after .reflect-q { margin: 18px 0 0; }
.after .q { font: 500 17px/1.4 var(--serif); margin: 0 0 8px; }
.after textarea { width: 100%; font: 400 15px/1.5 var(--sans); color: var(--ink); background: var(--card); border: 1px solid var(--rule); border-radius: 10px; padding: 10px 12px; resize: vertical; }
.after textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.after-h { font: 500 19px/1.3 var(--serif); margin: 28px 0 8px; }
.reflect-tip { padding: 10px 0; border-bottom: 1px solid var(--rule); }
.reflect-tip p { margin: 0 0 8px; }
.tri { display: flex; gap: 6px; }
.reflection { padding: 14px 0; border-top: 1px solid var(--rule); }
.reflection .answer { margin: 0 0 10px; white-space: pre-wrap; }
.reflection .fb { margin: 0 0 12px; font-size: 15px; }

/* quick ratings (After tab) */
.rate { padding: 10px 0; border-bottom: 1px solid var(--rule); }
.rate-q { margin: 0 0 8px; font-size: 15px; }
.tri.scale { flex-wrap: wrap; }
.tri.scale .chip { min-width: 38px; text-align: center; padding: 8px 0; }
.scale-ends { display: flex; justify-content: space-between; max-width: 214px; font-size: 12px; color: var(--ink-3); margin-top: 4px; }
.rate-more { margin: 12px 0 0; }
.how-landmark { margin: 10px 0 4px; } .how-landmark summary { cursor: pointer; font-size: 14px; color: var(--accent); }
.how-landmark ul { margin: 8px 0 4px; padding-left: 18px; } .how-landmark li { margin: 3px 0; line-height: 1.45; }
.rate-more summary { cursor: pointer; font-size: 15px; }
.rate-more .tri.scale .chip { min-width: 34px; }
#r-spoiled-what { margin-top: 10px; }

/* your data (home) */
.your-data { margin-top: 28px; }
.your-data p { margin: 0; }

/* confirmation page: what the reader wants to know */
.interest-box { margin: 22px 0 4px; }
.interest-box label { display: block; }
.interest-box .optional { text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--ink-3); margin-left: 6px; }
.interest-box textarea { width: 100%; font: 400 15px/1.5 var(--sans); color: var(--ink); background: var(--card); border: 1px solid var(--rule); border-radius: 10px; padding: 10px 12px; resize: vertical; margin: 4px 0 2px; }
.interest-box textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.interest-box p { margin: 4px 0 0; }
.asked-quote { font-style: italic; color: var(--ink-2); margin: -4px 0 12px; }

/* ---------- Journeys: shelf ---------- */
.shelf { margin-top: 28px; }
.shelf-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.shelf-list { list-style: none; margin: 8px 0 0; padding: 0; }
.shelf-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--rule); }
.shelf-main { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; color: inherit; text-decoration: none; }
.shelf-main > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.shelf-main .result-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shelf-actions { display: flex; gap: 6px; flex-shrink: 0; }
.shelf-resting { margin-top: 10px; }
.shelf-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; font: 400 13px/1.4 var(--sans); }
.shelf-bar .sb-status { color: var(--ink-2); }
.progress-inputs { display: flex; flex-wrap: wrap; gap: 10px; }
.progress-inputs .num { display: flex; flex-direction: column; gap: 4px; font: 500 12px/1.2 var(--sans); color: var(--ink-3); }
.progress-inputs .num input[type=number] { width: 84px; font: 400 16px/1.2 var(--sans); padding: 8px; border: 1px solid var(--rule); border-radius: 8px; background: var(--card); color: var(--ink); }
.progress-inputs .num.wide { flex: 1; min-width: 220px; }

/* ---------- Journeys: After tab ---------- */
.after[data-mode="abandoned"] .finish-only { display: none; }
.after:not([data-mode="abandoned"]) .abandon-only { display: none; }
.tri.wrap { flex-wrap: wrap; }
.status-ask { margin: 14px 0 0; }
.mood-row .chip { text-transform: none; }
.after textarea.insights { min-height: 110px; font-size: 16px; }
.idea-input { width: 100%; font: 400 15px/1.5 var(--sans); color: var(--ink); background: var(--card); border: 1px solid var(--rule); border-radius: 10px; padding: 10px 12px; margin-top: 8px; }
.theme-chips { flex-wrap: wrap; }
.theme-chips .chip { text-align: left; line-height: 1.25; }
.mood-tag { display: inline-block; font: 500 12px/1 var(--sans); padding: 5px 8px; border-radius: 99px; background: var(--rule); color: var(--ink-2); }
.reflection .insight { font-style: italic; }

/* ---------- Journeys: what next ---------- */
.whatnext { margin-top: 26px; padding: 18px; border: 1px solid var(--rule); border-radius: 14px; background: var(--card); }
.paths { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
@media (max-width: 520px) { .paths { grid-template-columns: 1fr; } }
.path-card { position: relative; text-align: left; display: flex; flex-direction: column; gap: 4px; padding: 12px 12px 12px 14px; border: 1px solid var(--rule); border-left: 4px solid var(--path); border-radius: 10px; background: var(--paper); cursor: pointer; font: 400 13px/1.35 var(--sans); color: var(--ink-2); }
.path-card b { font: 600 15px/1.2 var(--sans); color: var(--ink); }
.path-card[aria-pressed="true"] { border-color: var(--path); box-shadow: 0 0 0 2px var(--path) inset; }
.path-arrow { position: absolute; top: 8px; right: 10px; font-size: 18px; color: var(--path); }
.wn-items { list-style: none; padding: 0; margin: 14px 0 0; }
.wn-item { display: grid; grid-template-columns: 26px 1fr auto; gap: 10px; align-items: start; padding: 12px 0; border-top: 1px solid var(--rule); }
.wn-item.chosen { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.wn-kind { font-size: 18px; line-height: 1.4; }
.wn-reason { margin: 4px 0 0; font: 400 14px/1.45 var(--sans); color: var(--ink-2); }
.idea-chip { display: inline-block; font: 600 11px/1 var(--sans); letter-spacing: .04em; text-transform: uppercase; color: var(--path); border: 1px solid currentColor; border-radius: 5px; padding: 3px 6px; margin-bottom: 6px; }

/* ---------- Journeys: the flat map ---------- */
.map-page h1 { font: 500 28px/1.2 var(--serif); margin: 0 0 6px; }
.map-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 12px; }
.map-switch { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.map-switch .chip[aria-pressed="true"] { background: var(--path); border-color: var(--path); color: #fff; }
.map-wrap { margin-top: 14px; display: flex; justify-content: center; }
.map-wrap canvas { border-radius: 12px; border: 1px solid var(--rule); touch-action: none; cursor: grab; }
.map-card { margin-top: 12px; padding: 14px 16px; border: 1px solid var(--rule); border-radius: 12px; background: var(--card); }
.map-card h3 { margin: 0 0 4px; font: 500 20px/1.25 var(--serif); }
.map-legend { margin-top: 10px; }

/* ---------- Journeys: the 3D world ---------- */
.world { position: relative; width: 100%; }
.world-canvas { display: block; width: 100%; border-radius: 12px; border: 1px solid var(--rule); image-rendering: pixelated; touch-action: none; cursor: grab; }
.world-labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; border-radius: 12px; }
.wl { position: absolute; left: 0; top: 0; white-space: nowrap; font: 600 11px/1.2 var(--sans); color: #2a241c; text-shadow: 0 0 3px rgba(255, 248, 235, .95), 0 0 6px rgba(255, 248, 235, .8); letter-spacing: .02em; }
.wl-region { font: 600 10.5px/1.2 var(--sans); text-transform: uppercase; letter-spacing: .1em; color: #5d4b33; }
.wl-path { font-weight: 700; color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .6); }
.wl-cairn { font-weight: 500; }
.scene-overlay { position: fixed; inset: 0; z-index: 60; display: grid; grid-template-columns: 1fr 360px; background: var(--paper); }
.scene-stage { position: relative; overflow: hidden; }
.scene-canvas { width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
.scene-hint { position: absolute; left: 16px; bottom: 12px; margin: 0; color: var(--ink-3); }
.scene-panel { position: relative; overflow-y: auto; padding: 22px 22px 28px; border-left: 1px solid var(--rule); background: var(--paper); }
.pe-row { display: grid; grid-template-columns: 9.5em 1fr; align-items: center; gap: 10px; margin: 7px 0; font: 400 13.5px/1.3 var(--sans); color: var(--ink-2); }
.pe-row select, .pe-row input { width: 100%; min-width: 0; padding: 6px 8px; border: 1px solid var(--rule); border-radius: 8px; background: var(--card); color: var(--ink); font: inherit; }
@media (max-width: 420px) { .pe-row { grid-template-columns: 1fr; gap: 4px; } }
.scene-panel h2 { margin: 2px 0 4px; font: 500 28px/1.15 var(--serif); }
.scene-close { position: absolute; top: 14px; right: 14px; }
.scene-label { position: absolute; left: 0; top: 0; pointer-events: none; text-align: center; white-space: nowrap; font: 600 12px/1.25 var(--sans); color: #2a241c; text-shadow: 0 0 3px rgba(255, 248, 235, .95), 0 0 6px rgba(255, 248, 235, .8); }
.scene-label span { display: block; font-weight: 500; font-size: 10.5px; color: var(--ink-3); text-transform: lowercase; }
button.scene-label { pointer-events: auto; cursor: pointer; background: rgba(255, 250, 240, .96); border: 2px solid var(--rule); border-radius: 999px; padding: 6px 13px; text-shadow: none; font-size: 13.5px; box-shadow: 0 3px 10px rgba(40, 28, 10, .2); }
button.scene-label:hover { transform-origin: center; filter: brightness(1.04); box-shadow: 0 4px 14px rgba(40, 28, 10, .3); }
.scene-thread.scene-deepen { border-color: #2e7060; } .scene-thread.scene-bridge { border-color: #9a6b12; } .scene-thread.scene-venture { border-color: #6b40a1; }
body.scene-open { overflow: hidden; }
@media (max-width: 760px) { .scene-overlay { grid-template-columns: 1fr; grid-template-rows: 55vh 1fr; } .scene-panel { border-left: 0; border-top: 1px solid var(--rule); } }
.guess-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin: 12px 0; }
.guess-tile { margin: 0; border: 1px solid var(--rule); border-radius: 12px; overflow: hidden; background: var(--paper); }
.guess-img { aspect-ratio: 1; background: var(--rule) center / cover no-repeat; }
.guess-tile figcaption { display: flex; flex-direction: column; gap: 4px; padding: 8px 10px 10px; font: 500 13px/1.3 var(--sans); }
.guess-tile figcaption b { font: 600 15px/1.25 var(--serif); }
.guess-q { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; font: 600 12px/1.3 var(--sans); color: var(--ink-2); }
.wn-reception { margin: 2px 0 0; font: 500 11.5px/1.3 var(--sans); color: var(--ink-3); }
.wl-sign { font-size: 10.5px; font-weight: 600; padding-left: 9px; }
.wl-sign::before { content: ''; position: absolute; left: 0; top: 4px; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.wl-sign.wl-deepen::before { background: #2e7060; } .wl-sign.wl-bridge::before { background: #9a6b12; } .wl-sign.wl-venture::before { background: #6b40a1; }
.world-controls { position: absolute; right: 8px; bottom: 8px; display: flex; gap: 6px; }
.world-controls .chip { padding: 7px 10px; background: color-mix(in srgb, var(--card) 88%, transparent); }
/* labels follow the world's own time of day, not the page's light or dark mode */
.world.night .wl { color: #f3ead9; text-shadow: 0 0 3px rgba(0, 0, 0, .9), 0 0 6px rgba(0, 0, 0, .7); } .world.night .wl-region { color: #e2cfa8; }
.world-clock { position: absolute; top: 10px; right: 10px; z-index: 2; padding: 4px 10px; border-radius: 999px; font: 500 12px/1.4 var(--sans); color: #2a241c; background: rgba(255, 250, 240, .72); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); pointer-events: auto; font-variant-numeric: tabular-nums; }
.world.night .world-clock { color: #f3ead9; background: rgba(20, 18, 32, .55); }
.world.fill .world-clock .wc-day { display: none; }
#map-view .chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ---------- Journeys: the traveller ---------- */
.work-head { position: relative; }
.vignette-slot { width: 104px; height: 104px; flex-shrink: 0; cursor: pointer; margin-left: auto; }
.shelf-row { display: flex; align-items: center; gap: 8px; }
.shelf-row .shelf-bar { flex: 1; min-width: 0; }
.work-head .vignette-slot { width: 84px; height: 84px; margin-top: 6px; }
.vignette-canvas { width: 100%; height: 100%; display: block; }
.after-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.trav-sheet { display: grid; grid-template-columns: 190px 1fr; gap: 16px; align-items: start; }
@media (max-width: 460px) { .trav-sheet { grid-template-columns: 1fr; } }
.trav-preview { width: 190px; height: 240px; border-radius: 12px; background: var(--paper); border: 1px solid var(--rule); position: sticky; top: 0; }
@media (max-width: 460px) { .trav-preview { width: 100%; height: 220px; position: static; } }
.trav-row { display: grid; grid-template-columns: 74px 1fr; gap: 8px; align-items: center; margin: 0 0 8px; }
.trav-label { font: 500 12px/1.2 var(--sans); color: var(--ink-3); }
.chip.swatch { width: 28px; height: 28px; padding: 0; background: var(--sw); border: 2px solid var(--rule); }
.chip.swatch[aria-pressed="true"] { border-color: var(--ink); box-shadow: 0 0 0 2px var(--card) inset; background: var(--sw); }

/* ---------- walk mode ---------- */
.world.fill { height: 100%; }
.world.fill .world-canvas { border-radius: 0; border: 0; }
.world-banner { position: absolute; left: 0; right: 0; top: 18%; text-align: center; pointer-events: none; opacity: 0; color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .55), 0 0 14px rgba(0, 0, 0, .35); }
.world-banner span { display: block; font: 600 11px/1.4 var(--sans); letter-spacing: .18em; text-transform: uppercase; }
.world-banner b { display: block; font: 500 26px/1.15 var(--serif); letter-spacing: .02em; }
.world-banner i { display: block; margin-top: 4px; font: italic 400 14px/1.3 var(--serif); opacity: .9; }
/* Arriving at one of your works: a slower, larger title that fades in, holds, and fades out. */
.world-banner.entering { animation: entering 6.5s ease-in-out forwards; top: 14%; }
.world-banner.entering b { font-size: 34px; }
@keyframes entering { 0% { opacity: 0; transform: translateY(6px); letter-spacing: .08em; } 30% { opacity: 1; transform: none; letter-spacing: .02em; } 75% { opacity: 1; } 100% { opacity: 0; } }
.world-banner.show { animation: banner 3.2s ease-out forwards; }
@keyframes banner { 0% { opacity: 0; transform: translateY(6px); } 15% { opacity: 1; transform: none; } 75% { opacity: 1; } 100% { opacity: 0; } }
.world.hq .world-canvas { image-rendering: auto; }
.demo-banner { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin: 0 0 14px; padding: 10px 14px; border-radius: 12px; background: var(--card); border: 1px dashed var(--accent); font-size: 14px; }
.world-toast { position: absolute; left: 12px; right: 12px; top: 48px; margin: 0 auto; max-width: 420px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; padding: 10px 12px; border-radius: 12px; background: var(--card); color: var(--ink); border: 1px solid var(--rule); font-size: 14px; box-shadow: 0 4px 18px rgba(0,0,0,.12); z-index: 3; }
.world-toast[hidden] { display: none; }
.near-btn span { font-weight: 700; margin-right: 4px; letter-spacing: .02em; }
.world-near { position: absolute; left: 50%; bottom: 58px; transform: translateX(-50%); }
/* A note, read at its lantern while walking */
.world-note { position: absolute; left: 50%; top: 40%; width: min(320px, calc(100% - 32px)); transform: translate(-50%, calc(-100% - 12px)); padding: 11px 14px 9px; border-radius: 10px; background: color-mix(in srgb, var(--card) 96%, transparent); color: var(--ink); box-shadow: 0 6px 24px rgba(40, 28, 10, .28); border-top: 3px solid #f0c860; opacity: 0; max-height: 52%; overflow: auto; z-index: 4; }
.world-note.show { animation: note-in .45s ease-out forwards; }
@keyframes note-in { from { opacity: 0; } to { opacity: 1; } }
.world-note-head { display: flex; justify-content: space-between; font: 600 10.5px/1.4 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.world-note-q { margin: 6px 0 0; font: 500 13px/1.35 var(--sans); color: var(--ink-2); }
.world-note-text { margin: 6px 0 8px; font: 400 16px/1.45 var(--serif); white-space: pre-wrap; }
.world-note-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; font: 400 12px/1.3 var(--sans); color: var(--ink-3); }
.world-note-foot .chip { flex: none; padding: 3px 10px; font-size: 12px; }
.world-compose { position: absolute; left: 50%; bottom: 64px; transform: translateX(-50%); width: min(420px, calc(100% - 24px)); padding: 12px 14px; border-radius: 12px; background: var(--card); color: var(--ink); box-shadow: 0 8px 30px rgba(40, 28, 10, .3); z-index: 5; }
.world-compose textarea { width: 100%; box-sizing: border-box; margin: 8px 0; padding: 8px 10px; border: 1px solid var(--rule); border-radius: 8px; background: var(--paper); color: var(--ink); font: 400 15px/1.45 var(--serif); resize: vertical; }
.wc-actions { display: flex; align-items: center; gap: 8px; }
.world-near { display: flex; gap: 8px; }
@media (prefers-color-scheme: dark) { .world-note { background: color-mix(in srgb, #221d18 94%, transparent); color: #f1ebe0; } .world-note-q { color: #cfc6b8; } }
/* Full screen, and the sound panel */
.world.full { position: fixed; inset: 0; z-index: 50; width: 100vw; height: 100vh; height: 100dvh; background: #10131a; }
.world.full .world-canvas { border-radius: 0; border: 0; }
.world.full .world-controls { right: max(10px, env(safe-area-inset-right)); bottom: max(10px, env(safe-area-inset-bottom)); }
body.world-full-open { overflow: hidden; }
.map-card { position: relative; }
.card-close { position: absolute; top: 8px; right: 8px; padding: 2px 9px; font-size: 13px; }
body.world-full-open .map-card:not([hidden]) { position: fixed; z-index: 55; left: max(14px, env(safe-area-inset-left)); bottom: 64px; width: min(380px, calc(100vw - 28px)); max-height: 60vh; overflow-y: auto; margin: 0; box-shadow: var(--shadow); }
.world-controls .chip.muted { opacity: .55; text-decoration: line-through; }
.world-sound { position: absolute; right: 8px; bottom: 50px; width: 230px; padding: 12px 14px 10px; border-radius: 10px; background: color-mix(in srgb, var(--card) 96%, transparent); box-shadow: 0 6px 22px rgba(40, 28, 10, .25); color: var(--ink); z-index: 3; }
.ws-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 6px 0; font: 400 13px/1.3 var(--sans); }
.ws-row input[type=range] { width: 110px; }
.ws-row:first-child { justify-content: flex-start; font-weight: 600; }
.ws-note { margin: 8px 0 0; font: 400 11.5px/1.35 var(--sans); color: var(--ink-3); }
.world-near .chip { background: color-mix(in srgb, var(--card) 92%, transparent); box-shadow: 0 2px 10px rgba(0, 0, 0, .18); }
.world-stick { position: absolute; left: 16px; bottom: 16px; width: 112px; height: 112px; border-radius: 50%; background: rgba(255, 255, 255, .22); border: 2px solid rgba(255, 255, 255, .55); touch-action: none; display: grid; place-items: center; }
.world-stick[hidden] { display: none; }
.world-stick-knob { width: 46px; height: 46px; border-radius: 50%; background: rgba(255, 255, 255, .85); box-shadow: 0 2px 8px rgba(0, 0, 0, .25); pointer-events: none; }
.world .walk-btn[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.world-canvas:focus { outline: none; }

/* ---------- the world at the centre: home layouts ---------- */
main.home-wide { max-width: 1280px; }
.home-grid { display: grid; grid-template-columns: minmax(360px, 460px) minmax(0, 1fr); gap: 32px; align-items: start; }
.home-world { position: sticky; top: calc(var(--bar-h, 56px) + 12px); height: calc(100vh - var(--bar-h, 56px) - 28px); border-radius: 16px; overflow: hidden; border: 1px solid var(--rule); background: var(--card); }
.home-world.tablet { position: relative; top: 0; height: 56vh; min-height: 340px; margin: 4px 0 22px; }
.home-world.no-world { display: none; }
.hw { position: absolute; inset: 0; }
.hw .world-canvas { height: 100%; }
.hw-overlay { position: absolute; left: 14px; top: 12px; right: 14px; pointer-events: none; text-shadow: 0 0 6px rgba(255, 248, 235, .9); }
.hw-overlay p { margin: 0 0 4px; }
.hw-overlay .eyebrow { color: #4a3e2c; }
.hw-actions { display: flex; gap: 8px; margin-top: 6px; pointer-events: auto; }
.hw-actions .chip, .landing-actions .chip { background: color-mix(in srgb, var(--card) 90%, transparent); }
.home-world .map-card, .landing .map-card { position: absolute; left: 12px; right: 12px; bottom: 58px; max-height: 55%; overflow: auto; margin: 0; box-shadow: 0 6px 24px rgba(0, 0, 0, .18); z-index: 3; }
@media (prefers-color-scheme: dark) { .hw-overlay { text-shadow: 0 0 6px rgba(0, 0, 0, .9); } .hw-overlay .eyebrow { color: #e2cfa8; } }
.phone-world-links { display: flex; gap: 8px; margin: 6px 0 4px; }
/* phones: the world is the landing screen */
main.landing-mode { padding: 0; max-width: none; }
.landing { position: relative; height: calc(100dvh - var(--bar-h, 56px)); overflow: hidden; }
.landing .world-controls { top: 10px; bottom: auto; }
.landing .world-clock { top: 58px; }
.hw[data-night] ~ .hw-overlay { color: #f3ead9; text-shadow: 0 0 6px rgba(0, 0, 0, .8); } .hw[data-night] ~ .hw-overlay .eyebrow { color: #e2cfa8; }
.landing-panel { position: absolute; left: 12px; right: 12px; bottom: calc(14px + env(safe-area-inset-bottom)); padding: 16px 18px; border-radius: 16px; background: color-mix(in srgb, var(--card) 92%, transparent); box-shadow: 0 8px 30px rgba(0, 0, 0, .18); backdrop-filter: blur(6px); }
.landing-panel .eyebrow { margin: 0; }
.landing-stats { font: 500 20px/1.3 var(--serif); margin: 4px 0 8px; }
.landing-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 8px; }
.landing:has(.world.walking) .landing-panel { top: calc(10px + env(safe-area-inset-top)); bottom: auto; padding: 10px 12px; } /* walking on the landing: a slim bar at the top, out of the way of the stick */
.landing:has(.world.walking) .landing-panel .eyebrow, .landing:has(.world.walking) .landing-panel #hw-stats, .landing:has(.world.walking) .landing-panel #hw-empty { display: none; }
.landing:has(.world.walking) .landing-actions { margin: 0; }
.landing:has(.world.walking) .world-compass { top: auto; bottom: calc(150px + env(safe-area-inset-bottom)); } /* above the stick */
/* quick add */
.add-page h1 { font: 500 30px/1.2 var(--serif); margin: 0 0 8px; }
.add-form .rate-q { margin: 14px 0 6px; }
.add-form .tri.scale { flex-wrap: wrap; }
.map-card > .eyebrow { padding-right: 34px; }
.world-writing { margin-top: 10px; padding-left: 10px; border-left: 2px solid var(--rule); }

/* A primer or your reflections over the world: the same pages, drawn in the overlay */
.work-overlay { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; background: rgba(16, 14, 12, .45); padding: max(14px, env(safe-area-inset-top)) 14px max(14px, env(safe-area-inset-bottom)); }
.wo-frame { position: relative; display: flex; flex-direction: column; width: min(980px, 100%); height: min(92vh, 100%); border-radius: 14px; overflow: hidden; background: var(--paper); box-shadow: 0 18px 60px rgba(0, 0, 0, .35); }
.wo-top { display: flex; justify-content: flex-end; padding: 10px 12px 6px; border-bottom: 1px solid var(--rule); background: var(--paper); }
.wo-close { background: var(--card); }
.wo-scroll { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.wo-app { max-width: 680px; margin: 0 auto; padding: 8px 20px 80px; }
.wo-app .tabs { top: 0; }
body.overlay-open { overflow: hidden; }
.work-overlay ~ .sheet-backdrop, .work-overlay ~ .sheet { z-index: 80; }
body.overlay-open .sheet-backdrop { z-index: 80; } body.overlay-open .sheet { z-index: 81; } body.overlay-open .define-pill { z-index: 82; }
@media (max-width: 600px) { .work-overlay { padding: 0; } .wo-frame { height: 100%; border-radius: 0; } .wo-top { padding-top: max(10px, env(safe-area-inset-top)); } }

/* The compass: the map's two axes instead of north, south, east and west */
.world-compass { position: absolute; left: 24px; top: 12px; width: 108px; pointer-events: none; z-index: 3; --yaw: 0rad; }
.wc-dial { position: relative; width: 108px; height: 108px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--card) 90%, transparent) 0 70%, color-mix(in srgb, var(--card) 72%, transparent) 71% 100%); box-shadow: 0 2px 10px rgba(0, 0, 0, .22), inset 0 0 0 1.5px rgba(122, 46, 42, .35); transform: rotate(var(--yaw)); }
.wcl { position: absolute; left: 50%; top: 50%; width: 64px; height: 14px; margin: -7px 0 0 -32px; text-align: center; font: 700 9px/14px var(--sans); white-space: nowrap; color: var(--ink-2); }
.wcl-n { transform: translateY(-42px) rotate(calc(-1 * var(--yaw))); color: #6b40a1; }
.wcl-s { transform: translateY(42px) rotate(calc(-1 * var(--yaw))); color: #2e7060; }
.wcl-e { transform: translateX(38px) rotate(calc(-1 * var(--yaw))); color: #9a5b12; }
.wcl-w { transform: translateX(-38px) rotate(calc(-1 * var(--yaw))); color: #2a5d8a; }
.wc-needle { position: absolute; left: 49px; top: 32px; width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-bottom: 22px solid #b5452f; filter: drop-shadow(0 1px 1px rgba(0,0,0,.3)); }
.wc-needle::after { content: ''; position: absolute; left: -5px; top: 22px; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 20px solid color-mix(in srgb, var(--ink-3) 70%, transparent); }
.wc-land { margin: 5px 0 0; width: 160px; font: 600 10.5px/1.2 var(--sans); letter-spacing: .06em; text-transform: uppercase; color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .6); }
.world.fill .world-compass, .landing .world-compass { transform: scale(.8); transform-origin: top left; }

/* Starting a work: three ways in */
.start-options { display: grid; gap: 10px; margin: 8px 0 6px; }
.start-opt { display: block; text-align: left; padding: 12px 14px; border: 1px solid var(--rule); border-radius: 12px; background: var(--card); color: var(--ink); cursor: pointer; font: inherit; }
.start-opt b { display: block; font: 600 15px/1.3 var(--sans); }
.start-opt span { display: block; margin-top: 3px; font: 400 13px/1.4 var(--sans); color: var(--ink-2); }
.start-opt.primary { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.start-opt:hover { background: var(--paper-2); }
/* The After tab, built around the map */
.after-intro { margin: 4px 0 16px; padding: 0; background: none; font: 400 14px/1.5 var(--sans); color: var(--ink-2); } /* plain text: a box made it look like somewhere to type */
.place-grid { display: grid; grid-template-columns: 1fr minmax(220px, 300px); gap: 16px; align-items: start; }
.place-preview { margin: 0; }
.place-preview canvas { width: 100%; aspect-ratio: 1 / 1; border-radius: 12px; display: block; background: #dfe8f1; }
@media (max-width: 720px) { .place-grid { grid-template-columns: 1fr; } .place-preview { max-width: 320px; } }
.save-row { flex-wrap: wrap; }
.fb-box { margin: 12px 0; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--rule); background: var(--card); }
.fb-item { margin: 10px 0; }
.fb-item p { margin: 3px 0; }
.again-box { margin: 18px 0 8px; }
.place-badge { margin: 8px 0 0; color: var(--ink-2); }
.world-note-fb summary { cursor: pointer; font: 500 12px/1.4 var(--sans); color: var(--ink-3); margin-bottom: 6px; }
.world-note-fb p { font: 400 14px/1.45 var(--serif); margin: 0 0 8px; }
/* Home: the whole cycle; starting your world; the welcome */
.hero-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.how-primers summary { cursor: pointer; margin: 10px 0 4px; font: 500 13px/1.4 var(--sans); color: var(--ink-2); }
.start-prompts { margin: 10px 0 6px; padding-left: 22px; font: 400 15px/1.6 var(--sans); }
.start-prompts li.done { color: var(--ok); }
.start-prompts li.done::after { content: ' ✓'; }
.start-done { margin: 14px 0; padding: 14px 16px; border-radius: 12px; background: var(--paper-2); border: 1px solid var(--rule); }
.welcome-panel { max-width: 460px; }
.welcome-lead { font: 400 16px/1.45 var(--serif); margin: 4px 0 10px; }

a.btn-primary { text-decoration: none; display: inline-block; }
.world-near .chip { white-space: nowrap; }
.world-near .near-btn { max-width: min(60vw, 320px); overflow: hidden; text-overflow: ellipsis; }
.welcome .landing-panel { max-height: 46%; overflow-y: auto; }
.home-world .world-compass { left: auto; right: 12px; }

/* ---------- Round 4: menu, Works, the After catalogue, the map filling the screen ---------- */
.menu { display: flex; gap: 4px; margin-right: auto; margin-left: 14px; }
.menu a { font: 500 14px/1 var(--sans); color: var(--ink-2); text-decoration: none; padding: 7px 10px; border-radius: 99px; }
.menu a:hover { background: var(--paper-2); }
.menu a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }
@media (max-width: 460px) { .brand-name { display: none; } .menu { margin-left: 6px; } .menu a { padding: 7px 8px; } .mode { padding: 6px 8px; } }
body.world-full-open .bar { display: none; } /* full screen: nothing over the world */

.page-head { padding: 28px 0 4px; }
.page-head h1 { font: 500 clamp(26px, 6vw, 34px)/1.15 var(--serif); margin: 0 0 8px; }
.page-head p { color: var(--ink-2); margin: 0 0 6px; }
.how-steps { margin-top: 14px; }
.term-sample { color: var(--accent); text-decoration: underline dotted; }
.works-filters { margin: 10px 0 4px; }
.works-filters .chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.works-filters .chip:disabled { opacity: .45; cursor: default; }
.works-item { align-items: flex-start; }
.works-item .shelf-main { align-items: flex-start; }
.works-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.works-badges .badge { margin: 4px 0 0; }
.works-place { font: 500 12.5px/1.2 var(--sans); margin-top: 4px; }
.works-origin { display: block; margin-top: 4px; white-space: normal; }
@media (max-width: 560px) { .works-item { flex-wrap: wrap; } .works-item .shelf-actions { width: 100%; justify-content: flex-end; flex-wrap: wrap; } }
.wn-actions { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }

/* The After tab: a catalogue of viewings, then the form for this one */
.catalogue:empty { display: none; }
.catalogue { margin: 6px 0 18px; }
.viewing { margin: 12px 0; padding: 12px 16px 6px; border: 1px solid var(--rule); border-radius: 12px; background: var(--card); }
.viewing > header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.viewing h4 { margin: 0; font: 600 16px/1.3 var(--sans); }
.viewing .reflection { padding: 10px 0; }
.viewing .reflection:first-of-type { border-top: 0; }
.viewing.compact { padding: 10px 12px 4px; margin: 8px 0; }
.viewing.compact .answer { font-size: 15px; }
.after-add { margin-top: 10px; padding-top: 6px; border-top: 2px solid var(--rule); scroll-margin-top: calc(var(--bar-h, 50px) + 54px); }
.add-h { font: 500 22px/1.25 var(--serif); margin: 18px 0 6px; }
.add-which { font: 500 14px/1 var(--sans); color: var(--ink-3); }
.scene-log { margin-top: 18px; padding-top: 6px; border-top: 1px solid var(--rule); }

/* The map page: a slim toolbar, then the world filling the rest of the screen */
main.map-mode { max-width: none; padding: 0; }
.map-screen { display: flex; flex-direction: column; height: calc(100vh - var(--bar-h, 50px)); height: calc(100dvh - var(--bar-h, 50px)); }
.map-page.full .demo-banner { margin: 8px 12px 0; }
.map-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 8px max(12px, env(safe-area-inset-left)); }
.map-bar .eyebrow { margin: 0 6px 0 0; }
.map-bar .map-tools { margin-left: auto; }
.map-bar .chip { padding: 6px 10px; font-size: 12.5px; }
@media (max-width: 640px) { .map-bar .map-tools { margin-left: 0; flex-wrap: wrap; max-width: 100%; } .map-bar .map-tools .chip { flex: none; } } /* phones: the map's tools wrap onto a second row rather than running off the screen */
.map-stage { position: relative; flex: 1; min-height: 280px; }
.map-stage .map-wrap { position: absolute; inset: 0; margin: 0; align-items: center; }
.map-stage .world, .map-stage .world-canvas { height: 100%; }
.map-stage .world-canvas { border-radius: 0; border-left: 0; border-right: 0; }
.map-stage .map-card:not([hidden]) { position: absolute; left: 12px; bottom: 58px; width: min(380px, calc(100% - 24px)); max-height: 62%; overflow-y: auto; margin: 0; box-shadow: var(--shadow); z-index: 4; }
.map-below { max-width: 680px; margin: 0 auto; padding: 10px 20px 40px; }

/* Thread labels: where each path you followed goes, and where it came from */
.wl-thread { font: 600 11px/1.2 var(--sans); color: #fff; padding: 3px 8px; border-radius: 99px; background: #6f5a3e; text-shadow: none; box-shadow: 0 1px 4px rgba(0, 0, 0, .3); }
.wl-thread.wl-deepen { background: #2e7060; } .wl-thread.wl-bridge { background: #9a6b12; } .wl-thread.wl-venture { background: #6b40a1; }

/* Lantern pager */
.world-note-pager { display: inline-flex; align-items: center; gap: 4px; }
.world-note-pager button { border: 1px solid var(--rule); background: var(--card); color: var(--ink); border-radius: 99px; width: 24px; height: 24px; padding: 0; line-height: 1; font-size: 15px; cursor: pointer; }

/* The camera (while walking) and the controls help */
.world-controls .wc-camera { display: none; }
.world.walking .world-controls .wc-camera { display: inline-flex; align-items: center; justify-content: center; }
.world.photo .world-controls, .world.photo .world-stick, .world.photo .world-labels, .world.photo .world-compass, .world.photo .world-near, .world.photo .world-note,
.world.photo .world-banner, .world.photo .world-sound, .world.photo .world-help, .world.photo .world-toast, .world.photo .world-compose { display: none !important; }
.landing:has(.world.photo) .landing-panel, body:has(.world.photo) .map-card { display: none !important; }
.world-photo { position: absolute; inset: 0; pointer-events: none; z-index: 7; }
.world-photo[hidden] { display: none; }
.wp-grid::before, .wp-grid::after { content: ''; position: absolute; pointer-events: none; border: 0 solid rgba(255, 255, 255, .38); }
.wp-grid::before { top: 0; bottom: 0; left: 33.333%; right: 33.333%; border-left-width: 1px; border-right-width: 1px; }
.wp-grid::after { left: 0; right: 0; top: 33.333%; bottom: 33.333%; border-top-width: 1px; border-bottom-width: 1px; }
.wp-hint { position: absolute; top: calc(12px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); margin: 0; max-width: calc(100% - 32px); padding: 6px 12px; border-radius: 999px; background: rgba(20, 18, 15, .55); color: #fff; font: 500 12px/1.3 var(--sans); text-align: center; }
.wp-bar { position: absolute; left: 0; right: 0; bottom: calc(14px + env(safe-area-inset-bottom)); display: flex; align-items: center; justify-content: center; gap: 16px; padding: 0 16px; pointer-events: none; }
.wp-bar > * { pointer-events: auto; }
.wp-zoom { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 999px; background: rgba(20, 18, 15, .55); color: #fff; font: 500 12px var(--sans); }
.wp-zoom input { width: min(30vw, 180px); accent-color: #fff; }
.wp-shutter { width: 64px; height: 64px; flex: none; display: grid; place-items: center; padding: 0; border: 4px solid #fff; border-radius: 50%; background: rgba(255, 255, 255, .22); box-shadow: 0 2px 12px rgba(0, 0, 0, .3); cursor: pointer; }
.wp-shutter i { display: block; width: 44px; height: 44px; border-radius: 50%; background: #fff; transition: transform .08s; }
.wp-shutter:active i { transform: scale(.88); }
.wp-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.world-photo.flash .wp-flash { animation: wp-flash .45s ease-out; }
@keyframes wp-flash { from { opacity: .85; } to { opacity: 0; } }
@media (max-width: 520px) { .wp-bar { gap: 10px; } .wp-zoom span { display: none; } }
.world-help { position: absolute; right: 8px; bottom: 50px; width: min(360px, calc(100% - 16px)); max-height: calc(100% - 70px); overflow-y: auto; padding: 12px 16px 8px; border-radius: 12px; background: color-mix(in srgb, var(--card) 97%, transparent); color: var(--ink); box-shadow: 0 6px 24px rgba(40, 28, 10, .28); z-index: 6; font: 400 13px/1.45 var(--sans); }
.world-help ul { margin: 0 0 8px; padding-left: 18px; }
.world-help li { margin: 2px 0; }
.wh-h { margin: 8px 0 2px; font-weight: 600; }
.wh-close { position: absolute; top: 8px; right: 8px; padding: 2px 9px; font-size: 12px; }
.world-help kbd { font: 600 11px/1 var(--sans); padding: 2px 5px; border: 1px solid var(--rule); border-bottom-width: 2px; border-radius: 4px; background: var(--paper); }
.world-controls { flex-wrap: wrap; justify-content: flex-end; max-width: calc(100% - 16px); }
.scene-panel textarea { width: 100%; box-sizing: border-box; }
.map-card .source-links { flex-wrap: wrap; }
.map-card .chip { white-space: nowrap; }
@media (max-width: 520px) { /* phones: the world's buttons stack up the right-hand edge, clear of the walking stick and Revisit */
  .world-controls { flex-direction: column-reverse; flex-wrap: nowrap; align-items: flex-end; gap: 5px; max-width: none; }
  .world-controls .chip { padding: 6px 9px; }
  .world-help, .world-sound { right: 52px; bottom: 8px; width: auto; left: 8px; max-height: calc(100% - 16px); }
}

/* The compass, larger and easier to read */
.world-compass { width: 144px; }
.wc-dial { width: 144px; height: 144px; }
.wcl { width: auto; height: 18px; margin: 0; padding: 0 6px; font: 700 11.5px/18px var(--sans); border-radius: 9px; background: color-mix(in srgb, var(--card) 88%, transparent); }
.wcl-n { transform: translate(-50%, -50%) translateY(-50px) rotate(calc(-1 * var(--yaw))); }
.wcl-s { transform: translate(-50%, -50%) translateY(50px) rotate(calc(-1 * var(--yaw))); }
.wcl-e { transform: translate(-50%, -50%) translateX(44px) rotate(calc(-1 * var(--yaw))); }
.wcl-w { transform: translate(-50%, -50%) translateX(-44px) rotate(calc(-1 * var(--yaw))); }
.wc-needle { left: 66px; top: 46px; border-left-width: 6px; border-right-width: 6px; border-bottom-width: 26px; }
.wc-needle::after { left: -6px; top: 26px; border-left-width: 6px; border-right-width: 6px; border-top-width: 24px; }
.wc-land { width: 200px; font-size: 12.5px; }
.world.fill .world-compass { transform: none; }
.landing .world-compass, .home-world .world-compass { transform: scale(.85); }
.home-world .world-compass { transform-origin: top right; }
@media (max-width: 520px) { .world.fill .world-compass, .landing .world-compass { transform: scale(.8); transform-origin: top left; } }
/* Home: the three starting buttons, all the same size, text centred */
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.hero-actions > a { flex: 0 0 220px; max-width: 100%; height: 46px; padding: 0 14px; display: inline-flex; align-items: center; justify-content: center; text-align: center; box-sizing: border-box; border-radius: 99px; font: 600 14.5px/1.15 var(--sans); white-space: nowrap; }
.hero-actions > a.chip { color: var(--ink); background: var(--card); border: 1px solid var(--rule); }
.hero-actions > a.btn-primary { border: 1px solid var(--accent); }
@media (max-width: 480px) { .hero-actions > a { flex: 1 1 100%; } }

/* ---------- online: sign-in, account, admin (website only) ---------- */
body.gated .menu { display: none; }
.mode[aria-current] { color: var(--ink); border-color: var(--ink); }
.gate { max-width: 34rem; margin: 0 auto; padding: 48px 0 24px; }
.gate h1 { font: 500 clamp(28px, 6.5vw, 38px)/1.14 var(--serif); letter-spacing: -.01em; margin: 0 0 12px; }
.gate-form { display: grid; gap: 10px; margin: 22px 0 6px; }
.gate-form .key-input { margin-top: 0; font-family: var(--sans); }
.gate-form .btn-primary, .gate-form .chip { justify-self: start; }
.gate-form[hidden] { display: none; }
.gate-or { margin: 14px 0 8px; }
.gate-google { padding: 12px 16px; font-size: 14px; }
.gate-error { color: var(--accent); }
.gate-foot { margin-top: 36px; }
.acct { max-width: 40rem; }
.acct-block { padding: 18px 0; border-top: 1px solid var(--rule); }
.acct-block:first-child { border-top: 0; padding-top: 4px; }
.acct-check { display: flex; gap: 10px; align-items: flex-start; font: 400 14px/1.5 var(--sans); margin: 8px 0; cursor: pointer; }
.acct-check input { margin-top: 4px; flex: none; width: 17px; height: 17px; accent-color: var(--accent); }
.acct-delete summary { cursor: pointer; color: var(--ink-2); }
.small-input { display: inline-block; width: 9em; margin: 4px 6px; padding: 7px 10px; font-size: 14px; }
.meter { height: 8px; border-radius: 99px; background: var(--paper-2); border: 1px solid var(--rule); overflow: hidden; margin: 4px 0 8px; }
.meter span { display: block; height: 100%; background: var(--accent); }
.admin-block { padding: 20px 0; border-top: 1px solid var(--rule); }
.admin-block:first-child { border-top: 0; padding-top: 4px; }
.admin-block h2 { font: 600 18px/1.3 var(--serif); margin: 0 0 8px; }
.admin-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin: 6px 0 14px; }
.admin-stats div { background: var(--card); border: 1px solid var(--rule); border-radius: 12px; padding: 10px 12px; }
.admin-stats b { display: block; font: 600 22px/1.2 var(--sans); }
.admin-stats span { font: 400 12.5px/1.3 var(--sans); color: var(--ink-2); }
.admin-form { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; font: 400 13.5px/1.4 var(--sans); }
.admin-form label { display: flex; flex-direction: column; gap: 4px; }
.admin-form .acct-check { flex-direction: row; flex-basis: 100%; }
.admin input:not([type=checkbox]), .admin select, .admin textarea { font: 400 13.5px/1.2 var(--sans); color: var(--ink); background: var(--paper); border: 1px solid var(--rule); border-radius: 8px; padding: 6px 8px; max-width: 100%; }
.admin input[type=number] { width: 7.5em; }
.admin .admin-wide { flex: 1 1 18em; }
.admin-row-actions { margin: 6px 0 10px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.admin-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.admin-table { border-collapse: collapse; width: 100%; font: 400 13.5px/1.35 var(--sans); }
.admin-table th { text-align: left; font-weight: 600; color: var(--ink-2); padding: 6px 8px; border-bottom: 1px solid var(--rule); white-space: nowrap; }
.admin-table td { padding: 8px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.admin-table td .chip { padding: 6px 10px; font-size: 12.5px; margin: 2px 0; }
.admin-table input[data-f=model], .admin-table input[data-f=label] { width: 11em; }
.admin-table input[data-f^=price] { width: 5.5em; }
.admin-table input[data-f=long_threshold] { width: 7em; }
.admin-codes { width: 100%; font: 400 13px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }
.admin-details { margin-top: 10px; }
.admin-details summary { cursor: pointer; }
main.wide-page { max-width: 1120px; }
main.wide-page .page-head, main.wide-page .admin-block > p.small { max-width: 680px; }
.admin-table td:first-child { min-width: 12em; }

/* The feedback button (website only): an envelope, with its word on wider screens. */
.feedback-btn { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.feedback-btn[hidden] { display: none; }
.feedback-btn svg { width: 15px; height: 15px; }
@media (max-width: 600px) { .feedback-btn span { display: none; } .feedback-btn { padding: 5px 8px; } }
.feedback-sheet .btn-primary { display: inline-block; text-decoration: none; margin: 4px 10px 6px 0; }
.feedback-sheet code { font-size: 14px; }

/* Waiting for slow AI work: a running clock and what to expect. */
.wait-note { display: flex; gap: 10px; align-items: baseline; font: 400 14px/1.5 var(--sans); color: var(--ink-2); background: var(--card); border: 1px solid var(--rule); border-radius: 12px; padding: 10px 12px; margin: 10px 0 14px; }
.wait-clock { font: 600 14px/1 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--accent); min-width: 3.2em; }

/* The After tab's three buttons: the same size, side by side where there's room. */
.save-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 0 6px; }
.save-row.three { grid-template-columns: repeat(3, 1fr); }
.save-row .save-btn { width: 100%; min-height: 48px; padding: 10px 14px; border-radius: 99px; font: 600 14.5px/1.25 var(--sans); text-align: center; display: inline-flex; align-items: center; justify-content: center; }
.save-row .chip.save-btn { color: var(--ink); background: var(--card); border: 1px solid var(--rule); }
.save-row .save-btn:disabled { opacity: .5; cursor: default; }
@media (max-width: 620px) { .save-row, .save-row.three { grid-template-columns: 1fr; } }
.save-note { margin-top: 2px; }
.again-box:empty { display: none; }
.again-box { margin: 4px 0 18px; }

/* ---------- Fitting the world on every screen (8 Oct 2026) ---------- */
/* iPhone and iPad zoom in on any text box with text under 16px, and stay zoomed, which cut pages off at the right
   (the sign-in box did it first). Text boxes on touch screens are 16px, so that never happens. */
@media (pointer: coarse) { input:not([type=checkbox]):not([type=radio]):not([type=range]), textarea, select { font-size: 16px !important; } }
/* Full screen: the world's buttons sit along the bottom only (on the welcome page they also had a top, which
   stretched them into tall stripes on the iPad). */
.world.full .world-controls { top: auto; align-items: flex-end; }
/* The compass shrinks from its own corner, so it never slides up under the top bar or off the edge, and stays
   clear of the notch and rounded corners. */
.landing .world-compass { transform-origin: top left; }
.world-compass { left: max(24px, calc(env(safe-area-inset-left) + 10px)); }
.world.full .world-compass { top: max(12px, calc(env(safe-area-inset-top) + 8px)); }
.world.full .world-stick { left: max(16px, calc(env(safe-area-inset-left) + 10px)); bottom: max(16px, calc(env(safe-area-inset-bottom) + 10px)); }
/* The map page scrolls as one page: its top bar scrolls away with it instead of sliding over the world. */
body:has(main.map-mode) .bar { position: relative; }
/* Safari on iPhone draws its toolbar over the bottom of the page, so in portrait the stick and the world's buttons
   sit above it. (Added to the page as a class only in Safari on an iPhone, not when saved to the home screen.) */
@media (orientation: portrait) {
  .ios-phone-browser .world.full .world-controls, .ios-phone-browser .map-stage .world-controls { bottom: calc(env(safe-area-inset-bottom) + 70px); }
  .ios-phone-browser .world .world-stick { bottom: calc(env(safe-area-inset-bottom) + 70px); }
  .ios-phone-browser .world-help, .ios-phone-browser .world-sound { bottom: calc(env(safe-area-inset-bottom) + 70px); }
  .ios-phone-browser .landing-panel { bottom: calc(env(safe-area-inset-bottom) + 70px); }
  .ios-phone-browser .wp-bar { bottom: calc(env(safe-area-inset-bottom) + 70px); }
  .ios-phone-browser .landing:has(.world.walking) .world-compass { bottom: calc(env(safe-area-inset-bottom) + 220px); }
}
/* Phones in portrait: the compass fills the top-left corner, so the tour's titles start below it rather than over it. */
@media (max-width: 520px) and (orientation: portrait) {
  .world-banner, .world-banner.entering { top: calc(env(safe-area-inset-top) + 150px); padding: 0 16px; }
  .world-banner.entering b { font-size: 28px; }
}
.map-wildlife { margin: 0 0 8px; color: var(--ink-2); line-height: 1.5; }

/* A shared map (#/m/…): the world fills the screen below the bar, with an invitation over its corner. */
.shared-map { position: relative; }
.shared-stage { position: relative; height: calc(100dvh - 50px); min-height: 360px; }
.shared-stage .map-wrap { position: absolute; inset: 0; }
.share-cta { position: absolute; left: 12px; bottom: calc(14px + env(safe-area-inset-bottom)); width: min(420px, calc(100% - 24px)); padding: 14px 16px; border-radius: 14px; background: color-mix(in srgb, var(--card) 94%, transparent); box-shadow: 0 8px 28px rgba(0, 0, 0, .2); z-index: 8; }
.share-cta .eyebrow { margin: 0 0 4px; }
.share-cta p { margin: 0 0 10px; }
.share-cta-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.share-cta.small-cta #sm-who { display: none; }
.share-cta.small-cta { width: auto; }
body:has(.shared-map .world.walking) .share-cta { top: calc(10px + env(safe-area-inset-top)); bottom: auto; } /* out of the way of the stick */
body:has(.shared-map .world.photo) .share-cta { display: none; }
@media (max-width: 520px) { .share-cta { padding: 10px 12px; } .share-cta #sm-who { font-size: 13px; } }
.share-link { display: flex; gap: 8px; align-items: center; margin: 8px 0; }
.share-link input { flex: 1; min-width: 0; }
.gate-ask { margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--rule); }
.gate-ask p { margin: 0 0 8px; }

/* Spoilers: blurred until tapped (messages marked as spoilers, and others' writing on a shared map). */
.spoiler { filter: blur(5px); cursor: pointer; user-select: none; border-radius: 4px; transition: filter .25s; background: color-mix(in srgb, var(--ink-3) 12%, transparent); }
.spoiler.shown { filter: none; cursor: auto; user-select: text; background: none; }
.spoiler:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.world-note-text.spoiler:not(.shown) { min-height: 2.6em; }

/* Conversations: the header button (with how many are unread), the list and a conversation. */
.convos-btn { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; position: relative; margin-right: 6px; }
.convos-btn[hidden] { display: none; }
.convos-btn svg { width: 15px; height: 15px; }
.convos-badge { display: inline-block; min-width: 17px; padding: 2px 5px; border-radius: 99px; background: var(--accent); color: var(--card); font: 600 10.5px/13px var(--sans); text-align: center; }
.convos-badge[hidden] { display: none; }
@media (max-width: 600px) { .convos-btn span { display: none; } .convos-btn { padding: 5px 8px; } }
.convos, .thread { max-width: 720px; }
.convo-list { list-style: none; margin: 0; padding: 0; }
.convo-row { display: grid; gap: 3px; padding: 12px 14px; margin-bottom: 8px; border: 1px solid var(--rule); border-radius: 12px; background: var(--card); color: var(--ink); text-decoration: none; }
.convo-row:hover { border-color: var(--ink-3); }
.convo-row.unread { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.convo-top { display: flex; justify-content: space-between; gap: 10px; font: 500 16px/1.3 var(--serif); }
.convo-when, .convo-with { font: 400 12.5px/1.4 var(--sans); color: var(--ink-3); }
.convo-new { color: var(--accent); font-weight: 600; }
.convo-last { font: 400 14.5px/1.45 var(--serif); color: var(--ink-2); }
.msgs { list-style: none; margin: 0 0 18px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 85%; align-self: flex-start; padding: 10px 14px; border-radius: 14px 14px 14px 4px; background: var(--card); border: 1px solid var(--rule); }
.msg.mine { align-self: flex-end; border-radius: 14px 14px 4px 14px; background: var(--accent-soft); border-color: transparent; }
.msg-text { margin: 0 0 4px; font: 400 16px/1.5 var(--serif); white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-meta { font: 400 12px/1.3 var(--sans); color: var(--ink-3); }
.msg-compose { margin: 8px 0 14px; }
.msg-compose textarea, .ll-text { width: 100%; box-sizing: border-box; min-height: 96px; resize: vertical; }
.thread-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--rule); }
.th-report { margin: 0; }
.th-report summary { list-style: none; cursor: pointer; display: inline-flex; }
.th-report summary::-webkit-details-marker { display: none; }
.th-report[open] { flex-basis: 100%; }
.th-report p { margin: 8px 0; }

/* The admin page: a task's row changed but not saved. */
.admin-table tr.admin-dirty td { background: color-mix(in srgb, var(--accent) 9%, transparent); }
.admin-unsaved { color: var(--accent); margin: 0 0 6px; min-height: 1em; }
.admin-report { padding: 10px 12px; margin-bottom: 10px; border: 1px solid var(--rule); border-radius: 10px; }
.admin-report ol { margin: 6px 0 8px; padding-left: 20px; }
.spoiler-hint { margin: -4px 0 8px; font: 500 11.5px/1.3 var(--sans); color: var(--ink-3); }
.share-cta.small-cta #ex-tour, .share-cta.small-cta .share-cta-actions a.chip { display: none; } /* shrunk: just the invitation and About */

/* The After tab: editing what you wrote, and the buttons once a viewing is saved. */
.reflection-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0 4px; }
.edit-form { padding: 12px 14px; border: 1px solid var(--rule); border-radius: 12px; background: var(--card); }
.edit-form textarea, .edit-text { width: 100%; box-sizing: border-box; }
.world-writing .edit-text { margin: 6px 0; }
.fb.stale summary { color: var(--ink-3); }
.after-done { margin-top: 18px; }
.after-done .save-row { margin-top: 0; }
.fb.report { margin: 10px 0; padding: 10px 12px; border: 1px solid var(--rule); border-radius: 10px; background: var(--paper-2); }
.fb.report summary { cursor: pointer; font: 500 14px/1.4 var(--sans); }
.fb.report .fb-item { margin: 10px 0 0; padding-top: 10px; border-top: 1px solid var(--rule); }
.fb-you { margin: 0 0 6px; font: italic 400 15px/1.45 var(--serif); color: var(--ink-2); }
.fb-reply { margin: 0; font: 400 15.5px/1.5 var(--serif); }


/* ======================================================================================
   "Lantern Night, quieter" (14 Oct 2026): the parts that change beyond the colours above.
   ====================================================================================== */
/* Night surfaces: the header and every card that sits over the world take the night colours (the same
   variables, redefined), so everything inside them follows without separate rules. */
.bar, .world-note, .world-near, .world-controls, .map-stage .map-card, .home-world .map-card, .landing .map-card,
.shared-stage .map-card, .landing-panel, .share-cta, .hw-overlay, .world-compose, .map-bar {
  --paper: #191c36; --paper-2: #252b55; --card: #1c2142; --ink: #f1eadb; --ink-2: #c9c4da; --ink-3: #a9a4c0;
  --rule: #3d4377; --accent: #f2b544; --accent-soft: #3a3420; --lantern-ink: #f2b544; --crit: #e8b766;
  color: var(--ink);
}
.bar { background: var(--night); border-bottom: 0; backdrop-filter: none; -webkit-backdrop-filter: none; }
.brand { font: 600 25px/1 var(--display); letter-spacing: .02em; color: #f1eadb; }
.brand svg { color: var(--lantern); }
.menu a { color: #c9c4da; border-radius: 8px; font-weight: 500; }
.menu a:hover { background: var(--night-2); }
.menu a[aria-current="page"] { color: var(--night); background: var(--lantern); }
.mode { background: transparent; border-color: var(--night-rule); color: #f1eadb; border-radius: 8px; }
.mode[aria-current] { border-color: var(--lantern); color: var(--lantern); }
.convos-badge { background: var(--lantern); color: var(--night); }
.map-bar { background: var(--night-2); color: var(--ink); border-bottom: 0; }

/* Shapes: softly rounded rectangles instead of pills. */
.chip { border-radius: 8px; }
.btn-primary { border-radius: 10px; background: var(--accent); color: var(--paper); }
.night-btn, .bar .chip { border-radius: 8px; }

/* Display type for titles (Cormorant needs a little more size and weight than the old serif). */
.hero h1, .work-head h1, .confirm h1, .page-head h1, .gate h1, .add-page h1, .map-page h1 { font-family: var(--display); font-weight: 600; letter-spacing: 0; }
.hero h1 { font-size: clamp(36px, 8vw, 50px); line-height: 1.02; }
.work-head h1 { font-size: clamp(38px, 9vw, 56px); line-height: 1; }
.work-head.has-poster h1 { font-size: clamp(34px, 8vw, 50px); }
.confirm h1, .gate h1 { font-size: clamp(34px, 7.5vw, 46px); line-height: 1.04; }
.page-head h1 { font-size: clamp(32px, 7vw, 42px); line-height: 1.06; }
.add-page h1, .map-page h1 { font-size: 36px; line-height: 1.08; }
.guide-section h2, .building h2, .scene-panel h2 { font-family: var(--display); font-weight: 600; font-size: 30px; line-height: 1.1; }
.sheet h3, .map-card h3 { font-family: var(--display); font-weight: 600; font-size: 30px; line-height: 1.08; }
.map-card h3 { font-size: 26px; }
.eyebrow { letter-spacing: .14em; }

/* Cards over the world: night with a lantern edge. */
.world-note { background: color-mix(in srgb, var(--night) 96%, transparent); border-top-color: var(--lantern); box-shadow: 0 10px 30px rgba(10, 12, 30, .4); }
.world-near .chip, .world-controls .chip { background: color-mix(in srgb, var(--night) 92%, transparent); color: #f1eadb; border-color: var(--night-rule); }
.world-controls .chip[aria-pressed="true"], .world-near .near-note { background: var(--lantern); color: var(--night); border-color: var(--lantern); }
.map-stage .map-card:not([hidden]), .home-world .map-card, .landing .map-card, .shared-stage .map-card { border-color: var(--night-rule); box-shadow: 0 12px 30px rgba(10, 12, 30, .35); }
.landing-panel, .share-cta { background: color-mix(in srgb, var(--night) 95%, transparent); }
