/* Paradise Islands Story Atlas, v0.2 visual system.
   Color carries meaning everywhere on this page:
   teal  = established area      gold = placement proposed
   pink  = journeys, open decisions and actions
   Everything else stays neutral so those three read instantly. */
:root {
  /* Tokens match the LostSouls.world site (velvet, plum, neon, lagoon, gold, champagne). */
  --bg: #0B0710;
  --panel: #130C19;
  --panel-2: #1A1221;
  --raise: #221830;
  --ink: #F4EDE2;
  --champ: #F4E3C8;
  --soft: #D8CBDB;
  --muted: #AC9CB6;
  --line: #2E2136;
  --line-2: #3E2D49;
  --est: #2FE6D8;
  --prop: #E7C27A;
  --act: #FF2E9A;
  --act-2: #FF8CC6;
  --signal: #E0142C;
  --sans: "Instrument Sans", "Helvetica Neue", Arial, sans-serif;
  --serif: "Bodoni Moda", Didot, "Bodoni 72", Georgia, serif;
  --mono: "Martian Mono", ui-monospace, Menlo, monospace;
  --sign: "Big Shoulders Display", "Arial Narrow", Impact, sans-serif;
  --head: 60px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: radial-gradient(ellipse at 70% -20%, #3a0f33 0, transparent 50%), var(--bg);
  font: 14px/1.55 var(--sans);
  color: var(--ink);
}
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; color: inherit; }
button:disabled { opacity: 0.35; cursor: default; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin-top: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip { position: fixed; top: -70px; left: 15px; z-index: 100; background: var(--ink); color: var(--bg); padding: 12px; }
.skip:focus { top: 12px; }
.eyebrow { font: 500 10px/1.6 var(--mono); letter-spacing: 0.12em; color: var(--muted); margin: 0 0 8px; }
h2 em, h1 em { font-weight: 500; font-style: italic; color: var(--prop); }

/* ---------- Header: one slim bar ---------- */
.masthead {
  position: sticky; top: 0; z-index: 30;
  height: var(--head);
  padding: 0 20px;
  display: flex; align-items: center; gap: 22px;
  border-bottom: 1px solid var(--line);
  background: #0B0710e8;
  backdrop-filter: blur(14px);
}
.brand img { display: block; width: 118px; height: auto; filter: drop-shadow(0 0 14px #ff2e9a2a); }
.decisions {
  border: 1px solid #ff2e9a60; background: #ff2e9a14; color: #FF8CC6;
  border-radius: 999px; padding: 7px 14px; font-size: 12px; white-space: nowrap;
}
.decisions:hover { background: #ff2e9a26; color: #fff; }
.decisions span { margin-left: 6px; }
.masthead nav { display: flex; gap: 18px; font-size: 12px; color: var(--muted); }
.masthead nav a:hover { color: var(--ink); }

/* Soundtrack lives in the header, so it never covers the workspace. */
.sound-dock { display: flex; align-items: center; gap: 10px; padding: 5px 12px 5px 5px; border: 1px solid var(--line); border-radius: 999px; background: #ffffff05; }
.sound-dock > button { width: 32px; height: 32px; flex-shrink: 0; border-radius: 50%; border: 1px solid #ff2e9a80; background: #ff2e9a1a; color: #FF8CC6; font-size: 11px; padding: 0; }
.sound-dock.playing > button { background: var(--act); color: #fff; border-color: var(--act); box-shadow: 0 0 16px #ff2e9a50; }
.sound-info { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.sound-info strong { font: 500 14px var(--serif); }
#audioStatus { margin: 0; font-size: 10px; color: var(--muted); max-width: 150px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wave { display: flex; align-items: center; gap: 2px; height: 18px; }
.wave i { width: 2px; height: 5px; border-radius: 2px; background: #ffffff30; }
.wave i:nth-child(2n) { height: 12px; }
.wave i:nth-child(3n) { height: 16px; }
.playing .wave i { background: var(--act); animation: wave 0.8s ease-in-out infinite alternate; }
.playing .wave i:nth-child(2n) { animation-delay: 0.3s; }
.playing .wave i:nth-child(3n) { animation-delay: 0.55s; }
@keyframes wave { to { height: 4px; opacity: 0.5; } }
.volume input { width: 64px; accent-color: var(--act); }

/* ---------- Atlas shell ---------- */
main { padding: 12px 20px 0; }
.atlas { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--panel); box-shadow: 0 25px 70px #0006; }
.searchbar { display: flex; align-items: center; gap: 16px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--panel-2); }
.search { display: flex; gap: 10px; align-items: center; flex: 1; min-width: 220px; background: #0B0710; border: 1px solid var(--line-2); border-radius: 8px; padding: 8px 12px; }
.search:focus-within { border-color: #ffffff55; }
.search > span { font-size: 20px; line-height: 1; color: var(--muted); }
.search input { min-width: 0; width: 100%; background: transparent; border: 0; outline: none; color: var(--ink); font-size: 13px; }
.search kbd { font: 10px var(--mono); border: 1px solid var(--line-2); border-radius: 4px; padding: 1px 6px; color: var(--muted); }
.searchbar > label:not(.search) { font: 500 10px var(--mono); letter-spacing: 0.06em; color: var(--muted); display: block; }
.searchbar select { display: block; background: transparent; border: 0; max-width: 170px; font: 13px var(--sans); color: var(--ink); padding: 2px 18px 0 0; }
.searchbar option { background: var(--panel); }
.quiet { background: transparent; border: 1px solid var(--line-2); border-radius: 6px; color: var(--soft); padding: 7px 11px; font-size: 12px; white-space: nowrap; }
.quiet:hover { color: var(--ink); border-color: #ffffff55; }

.workspace {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr) 360px;
  height: calc(100dvh - var(--head) - 61px - 26px);
  min-height: 560px;
}
.workspace.focus-map { grid-template-columns: minmax(0, 1fr) 360px; }
.workspace.focus-map .directory { display: none; }

/* ---------- Directory ---------- */
.directory { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); background: var(--panel); }
.directory-tabs, .inspector-tabs { display: flex; border-bottom: 1px solid var(--line); }
.directory-tabs button, .inspector-tabs button { flex: 1; padding: 12px 8px; background: transparent; border: 0; border-bottom: 2px solid transparent; color: var(--muted); font-size: 13px; }
.directory-tabs button:hover, .inspector-tabs button:hover { color: var(--soft); }
.directory-tabs button[aria-selected="true"], .inspector-tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }
.directory-heading { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; font: 10px var(--mono); color: var(--muted); }
.directory-heading button { background: none; border: 1px solid var(--line-2); border-radius: 5px; color: var(--soft); font: 10px var(--mono); padding: 4px 8px; }
.directory-heading button[aria-pressed="true"] { color: var(--ink); border-color: #ffffff60; }
#directoryContent { overflow: auto; flex: 1; min-height: 0; padding: 0 8px 10px; scrollbar-width: thin; scrollbar-color: #3E2D49 transparent; }
.record { display: block; width: 100%; text-align: left; padding: 10px 10px 10px 12px; background: transparent; border: 1px solid transparent; border-left-width: 2px; border-radius: 6px; margin-bottom: 2px; }
.record:hover { background: #ffffff06; }
.record.active { background: #ffffff0a; border-color: var(--line); border-left-color: var(--prop); }
.record.established.active { border-left-color: var(--est); }
.record-line { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; border: 2px solid var(--prop); }
.record.established .status-dot { background: var(--est); border-color: var(--est); }
.record-id { font: 500 11px var(--mono); color: var(--soft); }
.record h3 { font-size: 14px; font-weight: 600; line-height: 1.35; margin: 0 0 2px; }
.record small { display: block; font-size: 11px; color: var(--muted); line-height: 1.45; }
.record .note-flag { color: var(--act); margin-top: 3px; }
.layer-tag { color: #9fc3dd; }
.medium-tag { margin-left: auto; font: 500 9px var(--mono); letter-spacing: 0.05em; color: var(--muted); border: 1px solid var(--line-2); border-radius: 999px; padding: 2px 7px; }
.medium-tag.m-game { border-style: dashed; color: var(--soft); }
.medium-tag.m-shared { color: var(--soft); border-color: #ffffff45; }
.empty, .loading { color: var(--muted); font-size: 13px; padding: 16px; }

.journey-card { background: #ffffff04; border: 1px solid var(--line); border-radius: 8px; margin: 8px 2px; padding: 13px; }
.journey-card.active { border-color: #ff2e9a70; background: #ff2e9a0a; }
.journey-card .eyebrow { margin-bottom: 4px; }
.journey-card h3 { font: 500 19px/1.25 var(--serif); margin: 0 0 8px; }
.journey-card p { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.journey-card details { font-size: 12px; color: var(--soft); margin-bottom: 10px; }
.journey-card summary { cursor: pointer; }
.journey-card details p { margin: 8px 0; }
.journey-card > button { border: 1px solid #ff2e9a60; background: #ff2e9a16; color: #FF8CC6; border-radius: 6px; width: 100%; padding: 8px; font-size: 12px; }
.journey-card > button:hover { background: #ff2e9a2a; color: #fff; }
.stop-chain { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; }
.stop-chain span { font: 10px var(--mono); color: var(--soft); border: 1px solid var(--line-2); border-radius: 999px; padding: 2px 7px 2px 3px; display: inline-flex; align-items: center; gap: 5px; }
.stop-chain b { background: var(--act); color: #fff; border-radius: 999px; min-width: 16px; height: 16px; display: inline-grid; place-items: center; font-size: 9px; }

/* ---------- Map ---------- */
.map-column { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.map-top { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.layers { display: flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 8px; background: #ffffff04; }
.layers button { background: transparent; border: 0; border-radius: 6px; font-size: 12px; padding: 6px 12px; color: var(--muted); }
.layers button[aria-pressed="true"] { color: var(--ink); background: #ffffff14; }
.map-badge { font: 500 10px var(--mono); letter-spacing: 0.06em; color: var(--muted); margin-right: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.live-dot { display: inline-block; width: 6px; height: 6px; background: var(--est); border-radius: 50%; margin-right: 8px; box-shadow: 0 0 8px var(--est); vertical-align: 1px; }
.map-viewport { position: relative; overflow: hidden; flex: 1; min-height: 360px; background: radial-gradient(ellipse at center, #241330, #07040a); touch-action: none; cursor: grab; user-select: none; isolation: isolate; }
.map-viewport.dragging { cursor: grabbing; }
.map-stage { position: absolute; left: 0; top: 0; width: 1536px; height: 1024px; transform-origin: 0 0; }
.map-stage > img { display: block; width: 1536px; height: 1024px; pointer-events: none; }
#markers { position: absolute; inset: 0; pointer-events: none; }

/* Pins: status by fill, medium by border, groups by shape. */
.pin {
  position: absolute; display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; padding: 0;
  border-radius: 50%; border: 2px solid var(--prop);
  background: #120a17ee; color: var(--prop);
  font: 600 11px var(--mono);
  box-shadow: 0 3px 12px #000a;
  pointer-events: auto; cursor: pointer; z-index: 2;
}
.pin.established { background: var(--est); border-color: #b9fff6; color: #04201d; }
.pin.m-game { border-style: dashed; }
.pin.m-shared::after { content: ""; position: absolute; top: -3px; right: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--ink); border: 2px solid #120a17; }
.pin.cluster {
  width: 32px; height: 32px; border-radius: 8px; border: 0;
  background: #f4e3c8f2; color: #1a0f20; font: 700 13px var(--sans);
  box-shadow: 3px 3px 0 -1px #f4e3c88a, 6px 6px 0 -2px #f4e3c845, 0 6px 16px #000a;
}
.pin:hover { z-index: 9; box-shadow: 0 0 0 4px #ffffff30, 0 4px 14px #000a; }
.pin.cluster:hover { box-shadow: 3px 3px 0 -1px #f4e3c88a, 6px 6px 0 -2px #f4e3c845, 0 0 0 4px #ffffff30; }
.pin.selected { z-index: 10; width: 38px; height: 38px; font-size: 13px; background: var(--prop); color: #1a1205; border-color: #fff; box-shadow: 0 0 0 5px #e7c27a40, 0 0 26px #e7c27a66; }
.pin.selected.established { background: var(--est); color: #04201d; box-shadow: 0 0 0 5px #2fe6d840, 0 0 26px #2fe6d866; }
.pin .pin-label {
  display: none; position: absolute; left: calc(100% + 9px); top: 50%; transform: translateY(-50%);
  width: max-content; max-width: 240px; padding: 6px 10px;
  border: 1px solid var(--line-2); border-radius: 6px; background: #0d0812f2;
  text-align: left; font: 500 12px/1.35 var(--sans); color: var(--ink);
  pointer-events: none; box-shadow: 0 4px 14px #0009; white-space: normal;
}
.pin .pin-label b { font: 600 10px var(--mono); color: var(--muted); margin-right: 4px; }
.pin:hover .pin-label, .pin:focus-visible .pin-label, .names-on .pin:not(.cluster) .pin-label, .pin.selected .pin-label { display: block; }
.names-on .pin:not(.selected):not(:hover) .pin-label { background: #0d0812d0; font-size: 11px; padding: 3px 7px; white-space: nowrap; max-width: 170px; overflow: hidden; text-overflow: ellipsis; }

/* Journey mode: everything off-route steps back; stops show their order. */
.journey-on .pin:not(.route-pin) { opacity: 0.25; }
.pin.route-pin { box-shadow: 0 0 0 3px var(--act), 0 4px 14px #000a; }
.pin.cluster.route-pin { box-shadow: 3px 3px 0 -1px #f4e3c88a, 0 0 0 3px var(--act); }
.stop-badge { position: absolute; top: -11px; right: -12px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--act); color: #fff; font: 700 10px/18px var(--mono); text-align: center; box-shadow: 0 2px 6px #0008; }
.pin.current-stop { animation: stop-pulse 1.6s ease-out infinite; }
@keyframes stop-pulse { 0% { box-shadow: 0 0 0 3px var(--act), 0 0 0 3px #ff2e9a80; } 100% { box-shadow: 0 0 0 3px var(--act), 0 0 0 18px #ff2e9a00; } }

.map-legend {
  position: absolute; left: 12px; bottom: 12px; z-index: 9;
  display: flex; flex-wrap: wrap; gap: 6px 14px; max-width: calc(100% - 90px);
  padding: 8px 12px; border: 1px solid var(--line-2); border-radius: 8px;
  background: #0d0812e0; backdrop-filter: blur(8px);
  font-size: 11px; color: var(--soft); pointer-events: none;
}
.map-legend span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.key { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--prop); background: #120a17; }
.key.established { background: var(--est); border-color: #b9fff6; }
.key.game { border-style: dashed; border-color: var(--soft); }
.key.shared { border-color: var(--soft); position: relative; }
.key.shared::after { content: ""; position: absolute; top: -4px; right: -4px; width: 6px; height: 6px; border-radius: 50%; background: var(--ink); }
.key.cluster { border: 0; border-radius: 3px; background: var(--ink); box-shadow: 2px 2px 0 -1px #f4e3c880; }
.key.stop { border-color: var(--act); box-shadow: 0 0 0 2px #ff2e9a50; }
.journey-key { display: none !important; }
.map-viewport:has(.journey-on) .journey-key { display: inline-flex !important; }

.map-controls { position: absolute; right: 12px; bottom: 12px; display: flex; flex-direction: column; z-index: 10; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; box-shadow: 0 4px 20px #0007; }
.map-controls button { background: #130c19f0; border: 0; border-bottom: 1px solid var(--line); width: 38px; height: 36px; font: 19px var(--sans); }
.map-controls button:last-child { font-size: 11px; border: 0; }
.map-controls button:hover { background: #2a1d36; }
.zoom-readout { position: absolute; right: 12px; top: 12px; z-index: 9; font: 10px var(--mono); color: var(--soft); background: #0d0812d0; border-radius: 6px; padding: 6px 9px; }
.map-hint { position: absolute; top: 12px; left: 12px; z-index: 9; font-size: 11px; color: var(--soft); background: #0d0812c0; border-radius: 6px; padding: 5px 9px; pointer-events: none; }
.map-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px solid var(--line); padding: 8px 12px; font: 10px var(--mono); color: var(--muted); }

/* Underground: same status colors, colder world. */
.map-column.under .map-viewport { background: repeating-linear-gradient(0deg, #ffffff04 0 1px, transparent 1px 4px), radial-gradient(ellipse at center, #0a1622, #03060b); }
.map-column.under .layers button[aria-pressed="true"] { background: #9fc3dd22; color: #dcecf7; }
.map-column.under .live-dot { background: #9fc3dd; box-shadow: 0 0 8px #9fc3dd; }
.map-column.under .map-badge { color: #9fc3dd; }
.map-column.under .pin .pin-label { display: none !important; }
#undergroundDiagram svg { display: block; width: 1200px; height: 740px; }
.u-band rect { fill: #ffffff02; stroke: #ffffff0a; }
.u-band:nth-of-type(odd) rect { fill: #ffffff05; }
.u-surface rect { fill: transparent; stroke: none; }
.u-ground { stroke: #7aa37b; stroke-width: 2; }
.u-ground-label { fill: #9fc79f !important; }
.u-node rect { fill: #0b1824; stroke: #3c5568; stroke-width: 1.5; }
.u-context rect { fill: #0b182470; stroke-dasharray: 5 5; }
.u-slot { fill: #050a12; stroke: #ffffff20; }
.u-links path { fill: none; stroke: #6fb3c8; stroke-width: 2.5; opacity: 0.75; }
.u-links-key { stroke: #6fb3c8; stroke-width: 2.5; }
.u-lift { fill: none; stroke: #c7d6e2; stroke-width: 2; stroke-dasharray: 2 6; stroke-linecap: round; }
.u-rail { fill: none; stroke: #c7d6e2; stroke-width: 4; stroke-dasharray: 10 6; }
.u-undecided { fill: none; stroke: #8796a6; stroke-width: 2; stroke-dasharray: 1 7; stroke-linecap: round; }
.diagram-text { font-family: var(--sans); font-weight: 600; fill: #e3ecf1; }
.diagram-label { font-family: var(--mono); fill: #8fa9bb; letter-spacing: 0.04em; }
.diagram-level { font-family: var(--mono); fill: #6b8296; letter-spacing: 0.18em; }
.diagram-note { font-family: var(--sans); fill: #9fc3dd; }

.journey-bar { padding: 10px 12px; display: flex; gap: 7px; align-items: center; border-top: 1px solid #ff2e9a60; background: linear-gradient(90deg, #2a1326, #13131f); }
.journey-bar > div { flex: 1; min-width: 0; }
.journey-bar .eyebrow { color: #FF8CC6; margin-bottom: 2px; display: block; }
.journey-bar strong { font-size: 13px; font-weight: 600; }
.journey-bar button { background: transparent; border: 1px solid #ffffff30; border-radius: 6px; width: 34px; height: 34px; }
.journey-bar button:hover:not(:disabled) { border-color: var(--act); }

/* ---------- Inspector ---------- */
.inspector { border-left: 1px solid var(--line); background: linear-gradient(170deg, #1a1221, #0f0914); overflow: auto; padding: 20px; scrollbar-width: thin; scrollbar-color: #3E2D49 transparent; min-height: 0; }
.inspector h2 { font: 500 27px/1.15 var(--serif); letter-spacing: -0.02em; margin-bottom: 10px; }
.inspector p { color: var(--soft); font-size: 13px; line-height: 1.6; }
.inspector .fine { font-size: 12px; color: var(--muted); }
.location-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.location-top .eyebrow { margin: 0; color: var(--soft); }
.location-top button { background: transparent; border: 1px solid var(--line-2); border-radius: 5px; font-size: 11px; color: var(--soft); padding: 5px 9px; }
.location-top button:hover { color: var(--ink); border-color: #ffffff55; }
.district-line { font: 11px/1.6 var(--mono); color: var(--muted); margin-bottom: 12px; }
.badges { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 4px; }
.badge { font: 500 10px/1.4 var(--mono); padding: 4px 8px; border: 1px solid #e7c27a70; background: #e7c27a12; color: var(--prop); border-radius: 999px; }
.badge.established { border-color: #2fe6d870; color: var(--est); background: #2fe6d812; }
.badge.build { border-color: var(--line-2); background: transparent; color: var(--muted); }
.inspector-tabs { margin: 16px -4px 14px; }
.inspector-tabs button { font-size: 12px; padding: 10px 4px; }
.field-label { font: 500 10px/1.6 var(--mono); color: var(--muted); letter-spacing: 0.12em; margin: 18px 0 6px; }
.proposal { border-left: 2px solid var(--prop); padding-left: 12px; color: var(--ink) !important; }
.scene-group { margin-top: 6px; }
.scene-group + .scene-group { margin-top: 16px; }
.inspector .scene-status { font: 500 10px/1.5 var(--mono); letter-spacing: 0.05em; color: var(--soft); margin: 0 0 2px; padding: 6px 9px; background: #ffffff07; border-radius: 6px; display: flex; justify-content: space-between; }
.scene-status span { color: var(--muted); }
.scene { border-bottom: 1px solid var(--line); padding: 10px 2px; }
.scene strong { display: block; font-size: 13px; font-weight: 600; color: var(--ink); }
.scene-meta { display: block; font: 10px/1.6 var(--mono); color: var(--muted); margin: 3px 0 0; }
.scene .fine { margin: 6px 0 0; }
.scene .source-links { margin: 8px 0 0; }
.source-links { display: flex; flex-wrap: wrap; gap: 5px; margin: 8px 0 14px; }
.source-link { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; font-size: 11px; color: var(--muted); border: 1px solid var(--line-2); border-radius: 6px; padding: 3px 8px 3px 4px; background: #ffffff04; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.source-link b { font: 600 10px var(--mono); color: var(--ink); background: #ffffff12; border-radius: 4px; padding: 1px 5px; }
a.source-link:hover { color: var(--ink); border-color: #ffffff55; text-decoration: none; }
.source-card { display: block; border-bottom: 1px solid var(--line); padding: 12px 0; }
.source-card strong { font-size: 13px; font-weight: 600; display: block; color: var(--ink); }
.source-card small { display: block; font: 10px/1.6 var(--mono); overflow-wrap: anywhere; color: var(--muted); margin-top: 5px; }
.asset-card { border: 1px solid var(--line); border-radius: 8px; padding: 12px; margin: 10px 0; background: #ffffff03; }
.asset-card summary { cursor: pointer; color: var(--ink); font-size: 14px; font-weight: 600; }
.asset-card summary small { font: 10px var(--mono); display: block; color: var(--muted); margin-bottom: 4px; font-weight: 400; }
.asset-card ul, .field-list { margin: 10px 0; padding-left: 18px; font-size: 13px; color: var(--soft); }
.asset-card p { font-size: 13px; }
.review-form label { display: block; font: 500 10px var(--mono); letter-spacing: 0.08em; color: var(--muted); margin: 14px 0 6px; }
.review-form select, .review-form textarea { width: 100%; background: #0B0710; border: 1px solid var(--line-2); border-radius: 6px; color: var(--ink); padding: 10px; font-size: 13px; }
.review-form textarea { resize: vertical; min-height: 160px; line-height: 1.6; }
.review-form small { display: block; color: var(--muted); font-size: 11px; margin: 10px 0; }
.cluster-list button { display: block; text-align: left; width: 100%; padding: 10px 12px; border: 1px solid var(--line); background: #ffffff04; margin: 6px 0; border-radius: 6px; font-size: 13px; }
.cluster-list button:hover { border-color: #ffffff45; }
.cluster-list small { font: 10px var(--mono); color: var(--muted); display: block; }
.content-title { font: 10px var(--mono); color: var(--muted); margin-bottom: 8px; }

/* ---------- Below the atlas ---------- */
.handoff { display: grid; grid-template-columns: 300px 1fr 300px; gap: 40px; padding: 34px 4px 30px; align-items: start; }
.principles { display: grid; gap: 8px; }
.principles a { display: grid; grid-template-columns: 10px 1fr; column-gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; background: #ffffff03; }
.principles a span:last-child { grid-column: 2; color: var(--muted); font-size: 12px; }
.priority-dot { width: 7px; height: 7px; border-radius: 50%; margin-top: 6px; }
.pink { background: var(--act); }
.gold { background: var(--prop); }
.handoff h2 { font: 500 28px/1.2 var(--serif); margin-bottom: 12px; }
.handoff p { font-size: 13px; color: var(--muted); max-width: 640px; }
.handoff-actions { display: flex; flex-direction: column; gap: 8px; }
.button { display: block; border: 1px solid var(--line-2); border-radius: 7px; background: var(--raise); padding: 10px 13px; font-size: 13px; color: var(--ink); text-align: center; }
.button:hover { border-color: #ffffff55; text-decoration: none; }
.handoff-actions > p { font-size: 11px; margin: 3px 0; text-align: center; }
.file-label { cursor: pointer; position: relative; }
.file-label input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.site-footer { padding: 18px 20px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 20px; color: var(--muted); font: 10px/1.7 var(--mono); }
.site-footer a:hover { color: var(--ink); }
.fallback { padding: 20px; }
.error-state { padding: 25px; color: var(--muted); }
.error-state button { margin-top: 12px; }

dialog { max-width: 860px; width: calc(100% - 36px); max-height: 85vh; border: 1px solid #ff2e9a50; border-radius: 12px; background: #130C19; color: var(--ink); padding: 26px; box-shadow: 0 30px 100px #0009; }
dialog::backdrop { background: #03070bd9; backdrop-filter: blur(5px); }
.dialog-heading { display: flex; justify-content: space-between; gap: 20px; }
.dialog-heading h2 { font: 500 30px var(--serif); margin-bottom: 10px; }
.dialog-heading > button { background: transparent; border: 1px solid var(--line-2); border-radius: 50%; width: 36px; height: 36px; font-size: 22px; flex-shrink: 0; }
.dialog-lede { font-size: 13px; color: var(--muted); }
.dialog-lede a { text-decoration: underline; }
.issue-card { border-top: 1px solid var(--line); padding: 16px 0; }
.issue-card h3 { font-size: 16px; font-weight: 600; margin: 6px 0; }
.issue-card p { font-size: 13px; color: var(--soft); margin-bottom: 10px; }
.issue-card .eyebrow { color: var(--ink); margin: 0; }
.issue-card .severity { font: 10px var(--mono); color: var(--act); margin-left: 12px; }
.issue-card .source-links { margin: 0; }
#toast { position: fixed; right: 20px; bottom: 20px; z-index: 100; background: #1a1221; border: 1px solid var(--line-2); border-radius: 8px; padding: 12px 16px; font-size: 13px; max-width: 360px; box-shadow: 0 6px 24px #0009; opacity: 0; transform: translateY(10px); pointer-events: none; transition: 0.2s; }
#toast.visible { opacity: 1; transform: translateY(0); }

/* ---------- Brand layer: LostSouls.world signage, HUD, grain ---------- */
body::after {
  /* Film grain, as on the main site. Decorative only. */
  content: ""; position: fixed; inset: 0; z-index: 60; pointer-events: none; opacity: 0.06; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.masthead { justify-content: flex-start; }
.masthead nav { margin-left: auto; }
.masthead nav a, .masthead nav a:hover { font: 500 10px var(--mono); letter-spacing: 0.14em; text-transform: uppercase; text-decoration: none; }
.masthead nav a:hover { color: var(--act-2); }
.brand img { width: 150px; filter: drop-shadow(0 0 16px #ff2e9a40); }
.decisions { border-radius: 0; font: 500 10px var(--mono); letter-spacing: 0.14em; text-transform: uppercase; padding: 9px 14px; border-color: var(--act); color: var(--act); background: #ff2e9a0d; }
.decisions:hover { background: var(--act); color: #fff; box-shadow: 0 0 22px #ff2e9a55; }
.sound-dock { border-radius: 0; border-color: var(--line-2); background: #130c19cc; }
.sound-dock > button { border-radius: 0; }
.sound-info strong small { font: 10px var(--sans); color: var(--muted); }

.hud {
  display: flex; flex-wrap: wrap; gap: 6px 26px; align-items: center;
  padding: 8px 20px; border-bottom: 1px solid var(--line);
  font: 500 10px var(--mono); letter-spacing: 0.14em; color: var(--muted); background: #0b0710;
}
.hud b { color: var(--ink); font-weight: 500; }
.hud .hud-gold { color: var(--prop); }
.hud .hud-lagoon { color: var(--est); }
.hud .hud-end { margin-left: auto; color: var(--act); }
.rec { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--signal); margin-right: 8px; box-shadow: 0 0 8px var(--signal); animation: rec 1.4s steps(2) infinite; vertical-align: 0; }
@keyframes rec { 50% { opacity: 0.25; } }

.hero {
  position: relative; display: flex; align-items: flex-end; justify-content: space-between; gap: 30px;
  min-height: 150px; margin: 12px 20px 0; padding: 20px 28px; overflow: hidden;
  border: 1px solid var(--line-2);
  background:
    linear-gradient(90deg, #0b0710f0 0%, #0b0710a8 34%, #0b071022 62%, #0b071066 100%),
    linear-gradient(0deg, #0b0710cc 0%, transparent 60%),
    url("/img/paradise-canal.webp") center 58% / cover no-repeat;
}
.hero::before {
  /* Scanlines over the art. */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, #00000026 0 1px, transparent 1px 3px);
}
.hero-copy, .classified { position: relative; }
.hero-kicker { font: 500 10px var(--mono); letter-spacing: 0.32em; color: var(--champ); margin: 0 0 6px; }
.hero-kicker span { color: var(--act); margin: 0 6px; }
.hero h1 {
  position: relative; margin: 0;
  font: 900 clamp(50px, 5.6vw, 88px)/0.86 var(--sign); letter-spacing: 0.02em; text-transform: uppercase;
  color: var(--ink);
  text-shadow: -2px 0 #ff2e9a99, 2px 0 #2fe6d899, 0 0 34px #ff2e9a40;
}
.hero h1::after {
  /* A short glitch slice, echoing "Paradise that glitches". */
  content: attr(data-text); position: absolute; left: 0; top: 0; color: var(--est);
  clip-path: inset(48% 0 38% 0); transform: translateX(4px); opacity: 0.75;
  animation: slice 6s steps(1) infinite;
}
@keyframes slice { 0%, 92%, 100% { opacity: 0; } 93% { opacity: 0.8; transform: translateX(6px); } 95% { opacity: 0.6; transform: translateX(-4px); clip-path: inset(20% 0 66% 0); } }
.hero-line { margin: 6px 0 0; font: italic 400 clamp(19px, 1.7vw, 25px)/1.2 var(--serif); color: var(--champ); }
.hero-line em { color: var(--prop); }
.classified { display: grid; gap: 4px; padding: 12px 16px; border: 1px solid #f4e3c833; background: #0b071066; backdrop-filter: blur(4px); text-align: right; font: 500 11px var(--mono); letter-spacing: 0.3em; color: #f4e3c899; }
.classified .pink { color: var(--act); background: none; }

main { padding-top: 14px; }
.atlas { border-radius: 0; border-color: var(--line-2); }
.searchbar { background: var(--panel); }
.search { border-radius: 0; }
.quiet, .layers, .layers button, .map-controls, .zoom-readout, .map-hint, .map-legend, .journey-bar button, .location-top button, .directory-heading button, .button, .journey-card, .journey-card > button, .record, .medium-tag, .badge, .source-link, .scene-status, .cluster-list button, .asset-card, .principles a, dialog { border-radius: 0 !important; }
.quiet, .button, .journey-card > button, .location-top button, .directory-heading button { font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; }
.quiet:hover, .location-top button:hover, .directory-heading button:hover, .button:hover { border-color: var(--act); color: var(--act-2); }
.journey-card > button:hover { background: var(--act); color: #fff; }
.layers button { font: 500 10px var(--mono); letter-spacing: 0.1em; text-transform: uppercase; }
.layers button[aria-pressed="true"] { background: #ff2e9a1f; color: var(--ink); box-shadow: inset 0 -2px 0 var(--act); }
.directory-tabs button, .inspector-tabs button { font: 500 10px var(--mono); letter-spacing: 0.14em; text-transform: uppercase; }
.directory-tabs button[aria-selected="true"], .inspector-tabs button[aria-selected="true"] { border-bottom-color: var(--act); }
.map-badge { color: var(--champ); }
.journey-card h3, .issue-card h3 { font: italic 500 20px/1.25 var(--serif); color: var(--champ); }
.inspector h2 { color: var(--champ); }
.field-label { color: var(--act-2); }

/* CCTV frame on the map. */
.map-viewport::before, .map-viewport::after {
  content: ""; position: absolute; z-index: 8; width: 26px; height: 26px; pointer-events: none; border: 2px solid #f4e3c8aa;
}
.map-viewport::before { top: 46px; left: 12px; border-right: 0; border-bottom: 0; }
.map-viewport::after { top: 46px; right: 12px; border-left: 0; border-bottom: 0; }
.zoom-readout::before { content: "REC "; color: var(--signal); }

/* District board as the location card header. */
.district-art {
  position: relative; margin: -20px -20px 16px; height: 150px; background: var(--panel-2) center / cover no-repeat;
  border-bottom: 1px solid var(--line-2);
}
.district-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, #0f0914 4%, #0f091480 45%, transparent 75%), repeating-linear-gradient(0deg, #0000001f 0 1px, transparent 1px 3px); }
.district-art figcaption { position: absolute; z-index: 1; left: 20px; right: 20px; bottom: 12px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.district-art.no-art { height: 70px; }
.district-num { font: 500 10px var(--mono); letter-spacing: 0.14em; color: var(--act); }
.district-sign { font: 900 28px/1 var(--sign); letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink); text-shadow: 0 2px 14px #000c; }
.classified-tag { flex-basis: 100%; font: 500 10px var(--mono); letter-spacing: 0.16em; color: #fff; background: var(--signal); padding: 3px 8px; width: max-content; flex-basis: auto; }

.manifest { color: var(--est); }
.manifest b { font-weight: 400; color: var(--ink); }
.caret { display: inline-block; width: 7px; height: 12px; background: var(--est); margin-left: 4px; vertical-align: -2px; animation: rec 1s steps(2) infinite; }
.site-footer { letter-spacing: 0.08em; }

/* ---------- Responsive ---------- */
@media (min-width: 1800px) {
  .workspace { grid-template-columns: 300px minmax(0, 1fr) 400px; }
  .workspace.focus-map { grid-template-columns: minmax(0, 1fr) 400px; }
}
@media (max-width: 1400px) {
  .workspace { grid-template-columns: 240px minmax(0, 1fr) 330px; }
  .workspace.focus-map { grid-template-columns: minmax(0, 1fr) 330px; }
}
@media (max-width: 1150px) {
  .volume, .wave { display: none; }
  .searchbar { gap: 10px; }
  .searchbar select { max-width: 130px; }
  .map-badge { display: none; }
  .map-top .layers { margin-right: auto; }
}
@media (max-width: 920px) {
  :root { --head: 58px; }
  .masthead { gap: 12px; padding: 0 14px; }
  .brand img { width: 96px; }
      #audioStatus { display: none; }
  main { padding: 10px 12px 0; }
  .searchbar { flex-wrap: wrap; }
  .search { flex-basis: 100%; }
  .searchbar > label:not(.search) { flex: 1; }
  .searchbar select { max-width: 100%; width: 100%; }
  .workspace { grid-template-columns: 230px minmax(0, 1fr); height: auto; min-height: 0; }
  .directory, .map-column { height: 600px; }
  .inspector { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--line); padding: 22px; }
  #inspectorContent { max-width: 760px; }
  .workspace.focus-map { grid-template-columns: minmax(0, 1fr); }
  .workspace.focus-map .inspector { grid-column: 1; }
  .handoff { grid-template-columns: 1fr 1fr; }
  .handoff > div:nth-child(2) { grid-column: 1 / -1; grid-row: 1; }
  .site-footer { flex-wrap: wrap; }
}
@media (max-width: 600px) {
  .decisions { padding: 6px 10px; font-size: 11px; }
  .decisions span { display: none; }
    .sound-dock { margin-left: auto; padding: 4px; border: 0; }
  .sound-info { display: none; }
  .searchbar > .quiet { padding: 6px 8px; }
  .search kbd { display: none; }
  .workspace { display: flex; flex-direction: column; }
  .map-column { order: 0; height: 480px; }
  .directory { order: 1; height: 320px; border-right: 0; border-top: 1px solid var(--line); }
  .inspector { order: 2; padding: 20px 16px; }
  .map-legend { font-size: 10px; gap: 4px 10px; padding: 6px 9px; max-width: calc(100% - 70px); }
  .map-legend span:nth-child(5) { display: none; }
  .map-hint { display: none; }
  .pin.selected .pin-label { display: none; }
  .pin.selected:hover .pin-label { display: block; }
  .layers button { padding: 5px 9px; font-size: 11px; }
  .map-top > .quiet { font-size: 11px; padding: 6px 8px; }
  .workspace.focus-map .map-column { height: 560px; }
  .handoff { grid-template-columns: 1fr; gap: 20px; }
  .handoff > div:nth-child(2) { grid-row: auto; }
  .site-footer { font-size: 9px; }
  #toast { left: 14px; right: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .map-stage { will-change: auto; }
}

/* Brand layer responsive */
.layers button, .quiet, .directory-heading button, .location-top button, .location-top .eyebrow, .directory-heading span { white-space: nowrap; }
@media (max-width: 1500px) {
  .layers button, .quiet, .directory-heading button, .location-top button, .directory-tabs button, .inspector-tabs button { letter-spacing: 0.05em; }
  .layers button { padding: 6px 9px; }
  .location-top .eyebrow { font-size: 9px; }
}
@media (max-width: 1250px) {
  .masthead nav { display: none; }
  .decisions { margin-left: auto; }
}
@media (max-width: 1150px) {
  .hud .atlas-stats { display: none; }
  .classified { display: none; }
}
@media (max-width: 920px) {
  .brand img { width: 120px; }
  .hud .hud-end { display: none; }
  .hero { margin: 10px 12px 0; padding: 20px; min-height: 150px; }
}
@media (max-width: 600px) {
  .hud { padding: 6px 14px; gap: 4px 14px; font-size: 9px; }
  .hud span:nth-child(3) { display: none; }
  .hero { min-height: 130px; }
  .hero-kicker { font-size: 9px; letter-spacing: 0.2em; }
  .hero-line { font-size: 18px; }
  .district-art { margin: -20px -16px 14px; height: 120px; }
  .masthead { gap: 8px; padding: 0 12px; }
  .brand img { width: 96px; }
  .decisions { margin-left: auto; padding: 7px 8px; font-size: 9px; letter-spacing: 0.06em; white-space: nowrap; }
  .sound-dock { margin-left: 0; }
}
