/* The world (/world). Tokens come from tokens.css; spec in docs/09-design-system.md. */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ----- globe ----- */
.map { position: fixed; inset: 0; }
.map canvas:focus-visible { outline: none; }
.mapboxgl-ctrl-bottom-left { left: var(--s2); bottom: var(--s2); }
.mapboxgl-ctrl-attrib.mapboxgl-compact { background: transparent; }
/* attribution as one quiet line, bottom centre under the Sidequests pill */
.mapboxgl-ctrl-bottom-right { right: auto; left: 50%; bottom: 0; transform: translateX(-50%); }
.mapboxgl-ctrl-bottom-right .mapboxgl-ctrl-attrib { margin: 0; padding: 1px 8px; background: rgba(238, 241, 236, 0.7); border-radius: 6px 6px 0 0; }
.mapboxgl-ctrl-bottom-right .mapboxgl-ctrl-attrib, .mapboxgl-ctrl-bottom-right .mapboxgl-ctrl-attrib a { font-size: 10px; color: var(--ink-3); }

/* ----- buttons ----- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 44px; padding: 0 var(--s5);
  border-radius: var(--r-control);
  font-weight: 500; font-size: 15px;
  transition: transform var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease);
}
.btn:active { transform: scale(0.98); }
.btn-secondary { background: transparent; border: 1px solid rgba(38, 54, 64, 0.22); }
.btn-secondary:hover { background: var(--white); }
.btn-sm { height: 36px; padding: 0 14px; }

/* ----- top bar ----- */
.bar, .hint, .corner, .globe-fallback, .small-screen { z-index: 2; }
.bar {
  position: fixed; top: 0; left: 0; right: 0; height: var(--bar-h);
  display: flex; align-items: center; padding: 0 var(--edge);
  pointer-events: none;
}
.bar > * { pointer-events: auto; }
.logo {
  font-family: var(--font-display); font-size: 24px; letter-spacing: var(--track-logo);
  line-height: 1; color: var(--ink); text-decoration: none;
}
.search { position: absolute; top: 16px; left: calc(50% - 218px); width: 360px; }
.search input {
  width: 100%; height: 40px; padding: 0 14px;
  background: var(--white); border: 1px solid var(--hairline); border-radius: var(--r-control);
  font-size: 14px; outline: none;
  transition: border-color var(--t-fast) var(--ease);
}
.search input::placeholder { color: var(--ink-3); }
.search input::-webkit-search-cancel-button { display: none; }
.search input:focus-visible { border-color: var(--accent); outline: none; }
.search-results {
  position: absolute; top: 48px; left: 0; right: 0; margin: 0; padding: var(--s2);
  list-style: none; background: var(--white); border-radius: 14px; box-shadow: var(--shadow);
}
.search-row {
  display: grid; grid-template-columns: 1fr auto; column-gap: var(--s3); row-gap: 2px;
  padding: 10px var(--s3); border-radius: var(--r-row); cursor: pointer;
}
.search-row[aria-selected="true"], .search-row:hover { background: var(--surface); }
.search-title { font-weight: 500; font-size: 14px; }
.search-place { grid-column: 1; font-size: 13px; color: var(--ink-2); }
.search-coords { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-size: 11px; color: var(--ink-3); white-space: pre; }
.search-empty { padding: 10px var(--s3); font-size: 14px; color: var(--ink-2); }

.bar .btn-secondary { background: var(--surface-2); }
.bar .btn-secondary:hover { background: var(--white); }
.bar-right { margin-left: auto; display: flex; align-items: center; gap: var(--s6); }
.questlog-btn {
  display: inline-flex; align-items: baseline; gap: 10px; height: 36px; align-items: center;
  padding: 0; border: 0; background: none; font-weight: 500; font-size: 15px;
}
.questlog-count { font-size: 11px; color: var(--ink-3); }

/* ----- first-time hint ----- */
.hint {
  position: fixed; top: 50%; left: calc(50% + 100px); transform: translate(-50%, calc(-50% + 6px));
  display: inline-flex; align-items: center; gap: var(--s2);
  height: 36px; padding: 0 var(--s4); border-radius: 999px;
  background: var(--ink); color: var(--paper); font-size: 13px; font-weight: 500;
  opacity: 0; pointer-events: none;
  transition: opacity var(--t-enter) var(--ease), transform var(--t-enter) var(--ease);
}
.hint.is-on { opacity: 1; transform: translate(-50%, -50%); }

/* ----- bottom right: sound and zoom ----- */
.corner { position: fixed; right: var(--edge); bottom: var(--edge); display: flex; align-items: flex-end; gap: 14px; }
.chip {
  height: 32px; padding: 0 var(--s3); border: 0; border-radius: 999px;
  background: var(--white); font-size: 11px; color: var(--ink-2);
  box-shadow: 0 1px 2px rgba(18, 19, 16, 0.06);
  transition: transform var(--t-fast) var(--ease);
}
.chip:active { transform: scale(0.98); }
.chip[aria-pressed="false"] { color: var(--ink-3); }
.zoom {
  display: flex; flex-direction: column; width: 40px;
  background: var(--white); border-radius: var(--r-control); overflow: hidden;
  box-shadow: 0 1px 2px rgba(18, 19, 16, 0.06);
}
.zoom button {
  display: grid; place-items: center; width: 40px; height: 39px; border: 0; background: none; color: var(--ink);
  transition: background-color var(--t-fast) var(--ease);
}
.zoom button:hover { background: var(--surface); }
.zoom button:focus-visible { outline-offset: -2px; }
.zoom button + button { border-top: 1px solid var(--hairline-soft); }

/* ----- fallbacks ----- */
.globe-fallback {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); margin: 0;
  font-family: var(--font-mono); font-size: 13px; color: var(--ink-2);
}
.small-screen { display: none; }
@media (max-width: 1023px) {
  .small-screen {
    display: block; position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); margin: 0;
    padding: 10px var(--s4); border-radius: 999px; background: var(--white); box-shadow: var(--shadow-sm);
    font-size: 13px; color: var(--ink-2); white-space: nowrap;
  }
  .search { left: auto; right: 220px; width: min(360px, 40vw); }
}

@media (prefers-reduced-motion: reduce) {
  .hint, .hint.is-on { transform: translate(-50%, -50%); }
}

/* ===== slice 2: range panel, In reach, pins ===== */
.panel {
  background: var(--white); border-radius: var(--r-card); box-shadow: var(--shadow);
}
.range-panel, .in-reach, .tooltip, .veil { z-index: 2; }

.range-panel {
  position: fixed; left: var(--edge); bottom: var(--edge); width: 384px; padding: var(--s5);
}
.field-label, .upto label { display: block; font-size: 13px; color: var(--ink-3); }
.from-field {
  position: relative; display: flex; align-items: center; margin-top: var(--s2);
  height: 44px; border: 1px solid var(--hairline); border-radius: var(--r-control); background: var(--white);
  transition: border-color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease);
}
.from-field:focus-within { border-color: var(--accent); box-shadow: inset 0 0 0 0.5px var(--accent); }
.range-panel:not(.has-start) .from-field { border-color: var(--accent); }
.range-panel.has-start .from-field:not(:focus-within) { background: var(--surface-2); border-color: var(--hairline-soft); }
.from-field input {
  flex: 1; min-width: 0; height: 100%; padding: 0 14px; border: 0; background: none; outline: none; font-size: 15px;
}
.from-field input::placeholder { color: var(--ink-3); }
.from-action {
  flex: none; height: 100%; padding: 0 14px; border: 0; background: none; font-size: 13px; font-weight: 500; color: var(--ink-2);
}
.from-action:hover { color: var(--ink); }

.suggestions {
  position: absolute; left: 0; right: 0; bottom: calc(100% + 10px); margin: 0; padding: var(--s2) 0; list-style: none;
}
.suggestions li {
  display: flex; justify-content: space-between; align-items: center; height: 44px; padding: 0 var(--s5);
  font-size: 14px; cursor: pointer;
}
.suggestions li .mono { font-size: 11px; color: var(--ink-3); white-space: pre; }
.suggestions li[aria-selected="true"], .suggestions li:hover { background: var(--surface); }
.suggestions .suggest-empty { color: var(--ink-2); cursor: default; }

.segmented {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-top: var(--s4); padding: 4px;
  height: 40px; border-radius: var(--r-control); background: var(--surface-2);
}
.segmented button {
  border: 0; border-radius: 7px; background: none; font-size: 14px; color: var(--ink-2);
  transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.segmented button:hover { color: var(--ink); }
.segmented button[aria-checked="true"] { background: var(--white); color: var(--ink); font-weight: 500; box-shadow: 0 1px 2px rgba(18, 19, 16, 0.08); }

.upto { display: flex; justify-content: space-between; align-items: baseline; margin-top: var(--s5); }
.upto output { font-size: 13px; font-weight: 500; color: var(--ink); }
.slider {
  --fill: 57%;
  -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 20px; margin: 10px 0 0; background: none;
}
.slider::-webkit-slider-runnable-track {
  height: 3px; border-radius: 2px; background: linear-gradient(to right, var(--accent) var(--fill), var(--surface-2) var(--fill));
}
.slider::-moz-range-track { height: 3px; border-radius: 2px; background: var(--surface-2); }
.slider::-moz-range-progress { height: 3px; border-radius: 2px; background: var(--accent); }
.slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px; margin-top: -6.5px; border-radius: 50%; background: var(--ink);
  border: 2px solid var(--white); box-shadow: 0 1px 3px rgba(18, 19, 16, 0.25);
}
.slider::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--ink); border: 2px solid var(--white); }
.slider:focus-visible { outline: none; }
.slider:focus-visible::-webkit-slider-thumb { outline: 2px solid var(--accent); outline-offset: 2px; }
.scale { display: flex; justify-content: space-between; margin-top: 6px; font-size: 10px; color: var(--ink-3); }
.range-foot {
  margin: var(--s5) 0 0; padding-top: var(--s5); border-top: 1px solid var(--hairline-soft);
  font-size: 12px; color: var(--ink-2);
}

/* In reach */
.in-reach {
  position: fixed; top: 88px; right: var(--edge); width: 340px; max-height: calc(100vh - 88px - 200px); overflow: auto; padding: var(--s2);
}
.reach-head { display: flex; justify-content: space-between; align-items: baseline; padding: 10px var(--s3) var(--s2); }
.reach-head h2 { margin: 0; font-size: 15px; font-weight: 600; }
.reach-head .mono { font-size: 12px; color: var(--ink-3); }
.reach-rows { margin: 0; padding: 0; list-style: none; }
.reach-row {
  display: grid; grid-template-columns: 48px 1fr auto; align-items: center; gap: 10px;
  width: 100%; height: 64px; padding: 8px var(--s2); border: 1px solid transparent; border-radius: var(--r-row);
  background: none; text-align: left;
  transition: background-color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.reach-row:hover, .reach-row:focus-visible, .reach-row.is-selected { background: var(--white); border-color: var(--hairline); }
.reach-rows:hover .reach-row:not(:hover) { background: none; border-color: transparent; }
.reach-row:hover { background: var(--surface); }
.reach-thumb { width: 48px; height: 48px; border-radius: 6px; object-fit: cover; }
.reach-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.reach-title { font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reach-place { font-size: 12px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reach-time { font-size: 11px; color: var(--ink-2); }
.reach-empty { padding: var(--s3); font-size: 13px; color: var(--ink-2); }
.reach-foot {
  display: flex; justify-content: space-between; width: calc(100% - 16px); margin: var(--s2) var(--s2) var(--s1);
  padding: 12px var(--s1) 6px; border: 0; border-top: 1px solid var(--hairline-soft); background: none; text-align: left;
  font-size: 13px; color: var(--ink-3);
}
.reach-foot .reach-time { color: var(--ink-3); }
.reach-foot:hover { color: var(--ink-2); }

/* photos */
.photo { display: block; background: var(--ice-dust); }
.photo.is-missing { display: block; background: var(--ice-dust); }

/* start marker (HTML marker on the map) */
.start-marker { position: relative; width: 28px; height: 28px; pointer-events: none; }
.start-ring { position: absolute; inset: 0; border-radius: 50%; background: rgba(38, 54, 64, 0.14); display: grid; place-items: center; }
.start-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ink); }
.start-label {
  position: absolute; right: calc(100% + 4px); top: 50%; transform: translateY(-50%);
  font-size: 13px; font-weight: 600; color: var(--ink); white-space: nowrap;
  text-shadow: 0 0 3px var(--paper), 0 0 3px var(--paper);
}

/* pin tooltip */
.tooltip {
  position: fixed; left: 0; top: 0; display: inline-flex; align-items: center; gap: 10px;
  height: 32px; padding: 0 12px; border-radius: 6px; background: var(--ink); color: var(--paper); pointer-events: none;
  white-space: nowrap;
}
.tt-title { font-size: 13px; font-weight: 600; }
.tt-time { font-size: 11px; color: rgba(238, 241, 236, 0.65); }

/* reduced-motion camera crossfade */
.veil { position: fixed; inset: 0; background: var(--paper); opacity: 0; pointer-events: none; transition: opacity 100ms linear; }
.veil.is-on { opacity: 1; }

/* ===== slice 3: fly in, floating card, pager, menu ===== */
.preview, .pager, .card-link, .back-chip, .menu-wrap { z-index: 3; }
.btn-primary { background: var(--ink); color: var(--paper); border: 0; }
.btn-primary:hover { background: var(--ink-deep); }

/* while a sidequest is in focus, the range UI steps back */
.range-panel, .in-reach, .menu-wrap, .hint { transition: opacity var(--t-enter) var(--ease), visibility 0s linear 0s; }
body.is-focused .range-panel, body.is-focused .in-reach, body.is-focused .menu-wrap,
body.is-panel .range-panel, body.is-panel .in-reach, body.is-panel .menu-wrap {
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity var(--t-enter) var(--ease), visibility 0s linear var(--t-enter);
}

.preview { position: fixed; left: 0; top: 0; width: 400px; perspective: 1200px; }
.card {
  --rx: 0deg; --ry: 0deg;
  overflow: hidden; border-radius: var(--r-card); background: var(--white); box-shadow: var(--shadow);
  transform: translateY(12px) rotateX(var(--rx)) rotateY(var(--ry)); opacity: 0;
  transition: transform var(--t-enter) var(--ease), opacity var(--t-enter) var(--ease);
  transform-style: preserve-3d; will-change: transform;
}
.preview.is-on .card { transform: translateY(0) rotateX(var(--rx)) rotateY(var(--ry)); opacity: 1; }
.card-photo { height: 260px; background: var(--ice-dust); }
.card-img { width: 100%; height: 260px; object-fit: cover; }
.card-chip {
  position: absolute; left: 16px; top: 16px; height: 28px; padding: 0 10px; display: inline-flex; align-items: center;
  border-radius: 999px; background: rgba(27, 39, 48, 0.72); color: var(--paper); font-size: 11px;
}
.card-body { padding: var(--s6); }
.card-coords { margin: 0; font-size: 11px; color: var(--ink-3); white-space: pre; }
.card-title {
  margin: 14px 0 0; font-family: var(--font-display); font-weight: 400; font-size: 27px; line-height: 1.05; letter-spacing: -0.02em;
}
.card-tagline { margin: 8px 0 0; font-size: 15px; line-height: 1.45; color: var(--ink-2); }
.card-facts { display: flex; gap: 20px; margin: 18px 0 0; padding-bottom: 16px; border-bottom: 1px solid var(--hairline-soft); }
.card-facts dt { font-size: 12px; color: var(--ink-3); }
.card-facts dd { margin: 4px 0 0; font-size: 14px; }
.card-facts dd.is-muted { color: var(--ink-3); }
.card-actions { display: grid; grid-template-columns: 1fr auto; gap: var(--s2); margin-top: 16px; }
.card-actions .btn-secondary { min-width: 72px; }

.card-link { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; opacity: 0; transition: opacity var(--t-enter) var(--ease); }
.card-link.is-on { opacity: 1; }
.card-link line { stroke: rgba(38, 54, 64, 0.45); stroke-width: 1; stroke-dasharray: 3 4; }

.pager {
  position: fixed; left: 0; top: 0; display: flex; align-items: center; gap: var(--s2); height: 40px; padding: 0 4px;
  border-radius: var(--r-control); background: var(--white); box-shadow: 0 1px 2px rgba(18, 19, 16, 0.06);
  opacity: 0; transition: opacity var(--t-enter) var(--ease);
}
.pager.is-on { opacity: 1; }
.pager button {
  width: 28px; height: 28px; border: 0; border-radius: 7px; background: var(--surface-2); font-size: 18px; line-height: 1; color: var(--ink);
}
.pager button:hover { background: var(--surface); }
.pager-text { padding: 0 6px; font-size: 12px; color: var(--ink-2); }

.back-chip {
  position: fixed; left: var(--edge); top: 92px; display: inline-flex; align-items: center; gap: 10px;
  height: 36px; padding: 0 14px; border: 0; border-radius: var(--r-row); background: var(--white); font-size: 15px;
  box-shadow: 0 1px 2px rgba(18, 19, 16, 0.06);
}
.back-chip .mono { font-size: 11px; color: var(--ink-3); }

.menu-wrap { position: fixed; left: 50%; bottom: var(--edge); transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; }
.pill {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 18px; border: 0; border-radius: 999px;
  background: var(--white); font-size: 14px; font-weight: 500; box-shadow: 0 1px 2px rgba(18, 19, 16, 0.08);
}
.pill svg { color: var(--ink-2); transition: transform var(--t-fast) var(--ease); }
.pill[aria-expanded="true"] svg { transform: rotate(180deg); }
.quest-menu {
  width: 340px; max-height: 60vh; overflow: auto; margin: 0 0 var(--s2); padding: var(--s2); list-style: none;
}
.quest-menu button {
  display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 10px; width: 100%; padding: 6px var(--s2);
  border: 0; border-radius: var(--r-row); background: none; text-align: left;
}
.quest-menu button:hover, .quest-menu button:focus-visible { background: var(--surface); }
.quest-menu .reach-thumb { width: 40px; height: 40px; }

/* ===== slice 4: sidequest panel ===== */
.dim { position: fixed; inset: 0; z-index: 5; background: var(--dim); opacity: 0; transition: opacity var(--t-enter) var(--ease); }
.dim.is-on { opacity: 1; }
.bar { z-index: 6; }
body.is-panel .preview, body.is-panel .pager, body.is-panel .card-link, body.is-panel .back-chip { opacity: 0 !important; pointer-events: none; }

.quest-panel {
  position: fixed; z-index: 6; left: var(--edge); right: var(--edge); top: 88px; bottom: 24px; max-height: 788px;
  display: grid; grid-template-columns: 620px 1fr; gap: 40px; padding: 16px 0 0 16px;
  background: var(--white); border-radius: var(--r-panel); box-shadow: var(--shadow); outline: none;
  opacity: 0; transform: scale(0.98);
  transition: opacity 280ms var(--ease), transform 280ms var(--ease);
}
.quest-panel.is-on { opacity: 1; transform: none; }
.qp-gallery { display: grid; grid-template-rows: 1fr 120px; gap: 8px; min-height: 0; padding-bottom: 16px; }
.qp-main { position: relative; overflow: hidden; border-radius: 12px; background: var(--ice-dust); min-height: 0; }
.qp-layer { position: absolute; inset: 0; transition: opacity 300ms var(--ease); }
.qp-layer.is-entering { opacity: 0; }
.qp-img { width: 100%; height: 100%; object-fit: cover; }
.qp-thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.qp-thumbs button { padding: 0; border: 0; border-radius: 8px; overflow: hidden; background: var(--ice-dust); transition: opacity var(--t-fast) var(--ease); }
.qp-thumbs button:hover { opacity: 0.85; }
.qp-thumb { width: 100%; height: 120px; object-fit: cover; }

.qp-side { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.qp-scroll { flex: 1; overflow: auto; padding: 14px 47px 24px 0; scrollbar-width: thin; }
.qp-head { display: flex; justify-content: space-between; align-items: flex-start; }
.qp-meta { margin: 12px 0 0; font-size: 12px; color: var(--ink-2); white-space: pre; }
.qp-close {
  display: grid; place-items: center; width: 40px; height: 40px; margin-right: -23px; border: 0; border-radius: 50%;
  background: var(--surface-2); color: var(--ink); flex: none;
}
.qp-close:hover { background: var(--ice-dust); }
.qp-title { margin: 12px 0 0; font-family: var(--font-display); font-weight: 400; font-size: 46px; line-height: 1; letter-spacing: -0.03em; }
.qp-tagline { margin: 12px 0 0; font-size: 17px; line-height: 1.45; color: var(--ink-2); }
.qp-facts {
  display: grid; grid-template-columns: repeat(4, 1fr); margin: 22px 0 0; border: 1px solid var(--hairline-soft); border-radius: 12px;
}
.qp-facts > div { padding: 14px 16px; }
.qp-facts > div + div { border-left: 1px solid var(--hairline-soft); }
.qp-facts dt { font-size: 12px; color: var(--ink-3); }
.qp-facts dd { margin: 6px 0 0; font-size: 14px; }
.qp-facts dd.is-muted { color: var(--ink-3); }
.qp-h { margin: 23px 0 0; font-size: 16px; font-weight: 600; outline: none; }
.qp-story { margin: 14px 0 0; max-width: 65ch; font-size: 16px; line-height: 1.55; color: var(--ink-2); }
.qp-clips-head { display: flex; justify-content: space-between; align-items: baseline; }
.qp-clips-count { font-size: 12px; color: var(--ink-3); }
.qp-clips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 12px 0 0; padding: 0; list-style: none; }
.clip { position: relative; height: 196px; overflow: hidden; border-radius: 10px; background: var(--ice-dust); }
.clip-img { width: 100%; height: 100%; object-fit: cover; }
.clip::after { content: ""; position: absolute; inset: 40% 0 0; background: linear-gradient(to bottom, rgba(18, 19, 16, 0), rgba(18, 19, 16, 0.55)); }
.clip-meta { position: absolute; z-index: 1; left: 12px; right: 12px; bottom: 12px; display: flex; flex-direction: column; gap: 4px; color: var(--white); }
.clip-meta .mono { font-size: 11px; color: rgba(255, 255, 255, 0.8); }
.clip-handle { font-size: 13px; font-weight: 500; }
.qp-how { padding-bottom: 8px; }
.qp-note { margin: 12px 0 0; font-size: 14px; color: var(--ink-2); }
.qp-routes, .qp-legs { margin: 12px 0 0; padding: 0; list-style: none; }
.qp-routes li { display: grid; grid-template-columns: 72px 72px 1fr; gap: 12px; padding: 10px 0; border-top: 1px solid var(--hairline-soft); font-size: 14px; }
.qp-routes .mono { font-size: 13px; }
.qp-mode-note { color: var(--ink-2); }
.qp-legs li { padding: 10px 0; border-top: 1px solid var(--hairline-soft); font-size: 15px; }
.qp-actions {
  flex: none; display: flex; align-items: center; gap: var(--s2); height: 88px; margin-left: -15px; margin-right: 27px; padding: 0 20px 0 35px;
  border-top: 1px solid var(--hairline-soft);
}
.qp-actions .btn { height: 48px; }
.qp-position { margin-left: auto; font-size: 12px; color: var(--ink-3); }

/* ===== slice 5: quest log drawer, sign in ===== */
.btn-quiet { background: var(--surface-2); border: 1px solid rgba(38, 54, 64, 0.16); color: var(--ink); }
.btn-quiet:hover { background: var(--surface); }
.btn-quiet:disabled { opacity: 0.5; cursor: default; }
.btn-block { width: 100%; height: 48px; }
.link-btn { border: 0; background: none; padding: 0; font-size: 13px; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; }
.link-btn:hover { color: var(--ink); }
.avatar {
  width: 32px; height: 32px; border: 0; border-radius: 50%; background: var(--white); color: var(--ink);
  font-size: 13px; font-weight: 600; box-shadow: inset 0 0 0 1px var(--hairline);
}
.questlog-btn[aria-expanded="true"] { color: var(--ink); text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 1px; }

.quest-log {
  position: fixed; z-index: 4; top: 64px; right: 24px; bottom: 24px; width: 440px; max-height: 812px;
  display: flex; flex-direction: column; padding: 24px;
  background: var(--white); border-radius: var(--r-panel); box-shadow: var(--shadow);
  transform: translateX(24px); opacity: 0; transition: transform var(--t-enter) var(--ease), opacity var(--t-enter) var(--ease);
}
.quest-log.is-on { transform: none; opacity: 1; }
body.is-log .in-reach, body.is-log .range-panel, body.is-log .menu-wrap { opacity: 0; visibility: hidden; pointer-events: none; }
.log-head { display: flex; justify-content: space-between; align-items: center; }
.log-head h2 { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: 28px; letter-spacing: -0.02em; }
.log-head .qp-close { margin-right: 0; }
.log-chips { display: flex; gap: 6px; margin-top: 20px; }
.chip-filter {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border: 1px solid var(--hairline); border-radius: 999px;
  background: var(--white); font-size: 13px; color: var(--ink);
}
.chip-filter .mono { font-size: 11px; color: var(--ink-3); }
.chip-filter[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.chip-filter[aria-pressed="true"] .mono { color: rgba(238, 241, 236, 0.7); }
.log-rows { flex: 1; min-height: 0; overflow: auto; margin: 20px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 12px; }
.log-row {
  display: grid; grid-template-columns: 104px 1fr; gap: 16px; align-items: center; width: 100%; padding: 12px;
  border: 1px solid transparent; border-radius: 12px; background: var(--surface-2); text-align: left;
  transition: background-color var(--t-fast) var(--ease);
}
.log-row.is-reach { background: var(--white); border-color: var(--hairline); }
.log-row:hover { background: var(--surface); }
.log-thumb { width: 104px; height: 104px; border-radius: 8px; object-fit: cover; }
.log-text { display: flex; flex-direction: column; min-width: 0; }
.log-coords { font-size: 11px; color: var(--ink-3); white-space: pre; }
.log-title { margin-top: 8px; font-size: 16px; font-weight: 600; }
.log-place { margin-top: 4px; font-size: 13px; color: var(--ink-2); }
.log-line { margin-top: 8px; font-size: 11px; color: var(--ink-2); }
.log-empty { padding: 16px 4px; font-size: 14px; color: var(--ink-2); }
.log-note { margin-top: 16px; padding: 16px; border: 1px solid var(--hairline); border-radius: 12px; }
.log-note p { margin: 0; font-size: 13px; line-height: 1.45; color: var(--ink-2); }
.log-note-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; }

.dim-top { z-index: 7; }
.signin {
  position: fixed; z-index: 8; left: 50%; top: 50%; width: 440px; padding: 32px;
  background: var(--white); border-radius: var(--r-panel); box-shadow: var(--shadow);
  opacity: 0; transform: translate(-50%, calc(-50% + 20px)) scale(0.98); transition: opacity 280ms var(--ease), transform 280ms var(--ease);
}
.signin.is-on { opacity: 1; transform: translate(-50%, calc(-50% + 20px)); } /* W6 sits a little below centre */
.signin-close {
  position: absolute; top: 16px; right: 16px; width: 32px; height: 32px; display: grid; place-items: center;
  border: 0; border-radius: 50%; background: none; color: var(--ink-3);
}
.signin-close:hover { background: var(--surface-2); color: var(--ink); }
.signin-head { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.signin-thumb { flex: none; width: 64px; height: 64px; border-radius: 8px; overflow: hidden; background: var(--ice-dust); }
.signin-img { width: 64px; height: 64px; object-fit: cover; }
.signin-head h2 { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: 28px; line-height: 1.05; letter-spacing: -0.02em; }
.signin-sub { margin: 4px 0 0; font-size: 14px; color: var(--ink-2); }
.signin .btn-block + .btn-block { margin-top: 8px; }
.signin-or { display: flex; align-items: center; gap: 16px; margin: 24px 0; font-size: 12px; color: var(--ink-3); }
.signin-or::before, .signin-or::after { content: ""; flex: 1; height: 1px; background: var(--hairline-soft); }
.signin form label { display: block; font-size: 12px; color: var(--ink-2); }
.signin form input {
  display: block; width: 100%; height: 48px; margin: 8px 0 24px; padding: 0 14px;
  border: 1px solid var(--hairline); border-radius: var(--r-control); font-size: 15px; outline: none;
}
.signin form input:focus-visible { border-color: var(--accent); }
.signin form input[aria-invalid="true"] { border-color: var(--ink); }
.signin-error { margin: -16px 0 16px; font-size: 13px; color: var(--ink); }
.signin-fine { margin: 24px 0 0; font-size: 12px; color: var(--ink-3); }

/* ===== slice 6: intro, atmosphere ===== */
.intro {
  position: fixed; inset: 0; z-index: 9; display: grid; place-items: center;
  background: rgba(238, 241, 236, 0.78); opacity: 0; transition: opacity 600ms var(--ease);
}
.intro.is-on { opacity: 1; }
.intro-inner { max-width: 520px; padding: 0 var(--s6); text-align: center; }
.intro-logo { margin: 0; font-family: var(--font-display); font-size: 28px; letter-spacing: var(--track-logo); }
.intro-title {
  margin: 28px 0 0; font-family: var(--font-display); font-weight: 400; font-size: 46px; line-height: 1; letter-spacing: -0.03em;
}
.intro-sub { margin: 18px auto 0; max-width: 40ch; font-size: 17px; line-height: 1.5; color: var(--ink-2); }
.intro-actions { display: flex; justify-content: center; gap: var(--s2); margin-top: 32px; }
.intro-actions .btn { height: 48px; }

.atmos { position: fixed; inset: 0; z-index: 1; overflow: hidden; pointer-events: none; transition: opacity 600ms var(--ease); }
.atmos span {
  position: absolute; top: 0; left: 0; width: 720px; height: 420px; border-radius: 50%;
  background: var(--ink); opacity: 0.04; filter: blur(70px); will-change: transform;
  animation: drift linear infinite;
}
/* about 8 px/s: (100vw + 1440px) over ~360 s */
.atmos span:nth-child(1) { top: 8%; animation-duration: 360s; animation-delay: -40s; }
.atmos span:nth-child(2) { top: 46%; width: 900px; height: 520px; animation-duration: 400s; animation-delay: -220s; }
.atmos span:nth-child(3) { top: 70%; width: 560px; animation-duration: 330s; animation-delay: -130s; }
@keyframes drift {
  from { transform: translateX(-900px); }
  to { transform: translateX(calc(100vw + 200px)); }
}
body.is-close .atmos { opacity: 0; }
@media (prefers-reduced-motion: reduce) {
  .atmos { display: none; }
  .card { transition-duration: 120ms; }
}

/* "Start from here" (right-click on the globe) */
.start-here {
  position: fixed; left: 0; top: 0; z-index: 3; display: flex; flex-direction: column; gap: 4px; min-width: 200px; padding: 6px;
  border-radius: var(--r-control);
}
.start-here button {
  height: 36px; padding: 0 12px; border: 0; border-radius: 7px; background: var(--ink); color: var(--paper);
  font-size: 14px; font-weight: 500; text-align: left;
}
.start-here button:hover { background: var(--ink-deep); }
.here-label { padding: 2px 8px 4px; font-size: 11px; color: var(--ink-3); }

/* ===== style G on the terrain (docs/08, Zoom levels): light pins, labels and line, drifting cloud ===== */
.pin-pulse, .ground-label { position: fixed; left: 0; top: 0; z-index: 2; pointer-events: none; }
/* On the terrain the pin is drawn here, not by the map: map circles sit at sea level, under the mountains. */
.pin-pulse span { position: absolute; border-radius: 50%; }
.pulse-ring {
  left: -60px; top: -60px; width: 120px; height: 120px;
  border: 1px solid rgba(255, 255, 255, 0.45); background: rgba(255, 255, 255, 0.06);
  animation: pin-pulse 2.6s var(--ease) infinite;
}
.pulse-halo { left: -22px; top: -22px; width: 44px; height: 44px; border: 1px solid rgba(255, 255, 255, 0.7); background: rgba(255, 255, 255, 0.16); }
.pulse-dot {
  left: -8px; top: -8px; width: 16px; height: 16px; background: var(--accent);
  box-shadow: 0 0 0 3px var(--white), 0 1px 6px rgba(18, 19, 16, 0.35);
}
@keyframes pin-pulse {
  0% { transform: scale(0.55); opacity: 0; }
  30% { opacity: 1; }
  100% { transform: scale(1); opacity: 0; }
}
.ground-label { display: flex; flex-direction: column; gap: 6px; color: var(--white); text-shadow: 0 1px 2px rgba(18, 19, 16, 0.45), 0 0 14px rgba(18, 19, 16, 0.35); }
.ground-coords { font-size: 12px; white-space: pre; }
.ground-place { font-family: var(--font-display); font-size: 26px; line-height: 1; letter-spacing: -0.02em; white-space: nowrap; }
body.is-terrain .card-link line { stroke: rgba(255, 255, 255, 0.85); stroke-dasharray: 4 4; }
body:not(.is-terrain) .pin-pulse, body:not(.is-terrain) .ground-label { display: none; }

/* 3–5 large blurred white cloud shapes drifting over the terrain, under the interface */
.terrain-clouds { position: fixed; inset: 0; z-index: 1; overflow: hidden; pointer-events: none; opacity: 0; transition: opacity 900ms var(--ease); }
body.is-terrain .terrain-clouds { opacity: 1; }
.terrain-clouds span {
  position: absolute; border-radius: 50%; will-change: transform;
  background: radial-gradient(closest-side, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0.85) 35%, rgba(255, 255, 255, 0) 100%);
  filter: blur(18px);
  animation: cloud-drift linear infinite alternate;
}
/* framing the view like W3: heavier at the edges, open in the middle */
.terrain-clouds span:nth-child(1) { left: -14vw; top: -18vh; width: 52vw; height: 62vh; opacity: 0.55; animation-duration: 70s; }
.terrain-clouds span:nth-child(2) { right: -16vw; top: -6vh; width: 46vw; height: 70vh; opacity: 0.5; animation-duration: 90s; animation-delay: -30s; }
.terrain-clouds span:nth-child(3) { left: -8vw; bottom: -26vh; width: 58vw; height: 56vh; opacity: 0.45; animation-duration: 80s; animation-delay: -12s; }
.terrain-clouds span:nth-child(4) { right: -10vw; bottom: -24vh; width: 48vw; height: 54vh; opacity: 0.35; animation-duration: 100s; animation-delay: -55s; }
@keyframes cloud-drift {
  from { transform: translate3d(-3vw, 0, 0); }
  to { transform: translate3d(4vw, -2vh, 0); }
}

/* W4 on the terrain: a 62 % Paper wash with a 12 px blur behind the sidequest panel */
body.is-terrain .dim { background: rgba(238, 241, 236, 0.62); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }

@media (prefers-reduced-motion: reduce) {
  .terrain-clouds { display: none; }
  .pulse-ring { animation: none; transform: none; opacity: 1; }
}

/* the start marker steps back on the terrain (W3) */
.start-marker { transition: opacity var(--t-enter) var(--ease); }
body.is-terrain .start-marker { opacity: 0; }
