/*
  Styles for all pages: shared tokens and controls, then the editor, then the player.
  Colours are CSS variables on :root, with a dark set for devices in dark mode.
*/
:root {
  /* Must match APP_VERSION in the pages' version check (a stale cached stylesheet reloads). */
  --app-version: v123;
  --bg: #f6f5f2;
  --panel: #ffffff;
  --text: #1c1b19;
  --muted: #6b6860;
  --line: #e3e0d8;
  --accent: #2f6fdf;
  --accent-text: #ffffff;
  --danger: #c2372b;
  --ok: #1f8a4c;
  --radius: 10px;
  --r-btn: 8px; /* corners of buttons and boxes; Studio uses squarer ones */
  --r-input: 7px;
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
  color-scheme: light dark;
  accent-color: var(--accent); /* sliders, tick boxes and radio buttons in the scheme's colour */
  /* Chart series (statistics): blue, orange, aqua — checked for colour-blind separation. */
  --series-1: #2a78d6; --series-2: #eb6834; --series-3: #1baf7a;
}
@media (prefers-color-scheme: dark) { :root { --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; } }
:root[data-theme="studio"], :root[data-theme="night"] { --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; }
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #151514;
    --panel: #1f1f1d;
    --text: #ecebe6;
    --muted: #a09d94;
    --line: #34332f;
    --accent: #5b93f5;
    --shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
  }
}

/*
  Colour schemes (a walk's "Colour scheme", set on <html data-theme="…">). Each has a light
  set and a dark set for devices in dark mode; Studio (the default) and Night are always dark.
  Classic is the :root set above.
*/
:root[data-theme="forest"] { --bg: #f2f5f0; --panel: #ffffff; --text: #1d2a20; --muted: #5d6b60; --line: #dce5d7; --accent: #2e7d4f; --accent-text: #fff; }
:root[data-theme="terracotta"] { --bg: #f8f2ec; --panel: #fffcf9; --text: #2c1f19; --muted: #7b665b; --line: #eadbcf; --accent: #c2552c; --accent-text: #fff; }
:root[data-theme="dusk"] { --bg: #f4f2f9; --panel: #ffffff; --text: #221d30; --muted: #6b6482; --line: #e1dcee; --accent: #6a4fc4; --accent-text: #fff; }
/*
  Studio (the default): a dark, neutral charcoal like audio / video tools (Wwise, DaVinci
  Resolve): grey panels on a near-black background, soft light-grey text, thin borders, squarer
  corners, and one warm orange accent for what's active. Always dark.
*/
:root[data-theme="studio"] {
  --bg: #1a1b1d; --panel: #25272a; --text: #d6d6d4; --muted: #8e9196; --line: #383b40;
  --accent: #e8893a; --accent-text: #1a0f05; --danger: #e0564a; --ok: #4fb87a;
  --r-btn: 4px; --r-input: 3px; --radius: 6px;
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.6); color-scheme: dark;
}
:root[data-theme="studio"] input, :root[data-theme="studio"] textarea, :root[data-theme="studio"] select { background: #141517; }
:root[data-theme="studio"] h3 { color: #a2a5aa; letter-spacing: 0.08em; }
/* Active toggles and segments: lit, not filled (as in Wwise / Resolve toolbars). */
:root[data-theme="studio"] .toggle[aria-pressed="true"] { background: #32353a; border-color: #4a4e55; }
:root[data-theme="studio"] .seg button.on { background: #32353a; color: var(--accent); border-color: #4a4e55; }
:root[data-theme="studio"] .leaflet-bar a { background: var(--panel); color: var(--text); border-color: var(--line); }
:root[data-theme="night"] {
  --bg: #0e1116; --panel: #171b22; --text: #e9e6df; --muted: #9aa1ab; --line: #2a303a;
  --accent: #f0a93a; --accent-text: #1b1305; --shadow: 0 6px 24px rgba(0, 0, 0, 0.55); color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="forest"] { --bg: #111713; --panel: #19211b; --text: #e3ece4; --muted: #98aa9b; --line: #2b3a2f; --accent: #5cbf83; --accent-text: #0c1a10; }
  :root[data-theme="terracotta"] { --bg: #191310; --panel: #231b17; --text: #f1e5dc; --muted: #b39b8d; --line: #3b2d26; --accent: #e57c50; --accent-text: #1e0f08; }
  :root[data-theme="dusk"] { --bg: #14121b; --panel: #1d1a27; --text: #ebe7f6; --muted: #a39bbd; --line: #332d45; --accent: #9c85ef; --accent-text: #150f28; }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5em; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.hidden { display: none !important; }

button, .btn {
  font: inherit;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  padding: 0.5em 0.9em;
  border-radius: var(--r-btn);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
}
button:hover, .btn:hover { border-color: var(--muted); }
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
button.danger { color: var(--danger); }
button.active { outline: 2px solid var(--accent); outline-offset: 1px; }
button:disabled { opacity: 0.5; cursor: default; }
button.big { padding: 0.8em 1.4em; font-size: 1.05rem; font-weight: 600; }

input, textarea, select {
  font: inherit;
  width: 100%;
  padding: 0.45em 0.6em;
  border: 1px solid var(--line);
  border-radius: var(--r-input);
  background: var(--bg);
  color: var(--text);
}
input[type="checkbox"], input[type="radio"] { width: auto; }
input[type="range"] { padding: 0; }
input[type="color"] { padding: 0; height: 2.2em; width: 3.5em; }
label { display: block; margin: 0.6em 0 0.2em; font-size: 0.85rem; color: var(--muted); }
label.check { display: flex; align-items: center; gap: 0.5em; color: var(--text); font-size: 0.95rem; }
.row { display: flex; gap: 0.6em; align-items: center; flex-wrap: wrap; }
.row > .grow { flex: 1; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 0.8em; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
}
.error { color: var(--danger); min-height: 1.2em; font-size: 0.9rem; }

/* ---------- landing ---------- */
.page { max-width: 720px; margin: 0 auto; padding: 2rem 1rem; }
.walk-list { display: grid; gap: 0.8rem; margin-top: 1rem; }
.walk-list a.card { display: block; color: inherit; text-decoration: none; }
.walk-list a.card:hover { border-color: var(--accent); }

/* ---------- editor ---------- */
/*
  Editor layout: a grid with an always-visible top bar, the project panel (left), the map,
  and the properties dock — either a right-hand column (.dock-right) or a band below the
  map (.dock-bottom). .no-project and .no-props hide those panels; the map takes the room.
*/
.editor {
  /* Panel widths shrink on smaller screens so the map always keeps most of the room. */
  --sbw: clamp(250px, 22vw, 340px); --rw: 0px; --bh: 0px;
  display: grid; height: 100vh;
  grid-template-columns: var(--sbw) minmax(0, 1fr) var(--rw);
  grid-template-rows: auto minmax(0, 1fr) var(--bh);
  grid-template-areas: "top top top" "side map right" "side bottom bottom";
}
.editor.dock-right { --rw: clamp(290px, 25vw, 380px); }
.editor.dock-bottom { --bh: 40vh; }
.editor.no-props { --rw: 0px; --bh: 0px; }
.editor.no-props #props { display: none; }
.editor.no-project { --sbw: 0px; }
.editor.no-project .sidebar { display: none; }
.editor .ed-topbar { grid-area: top; }
.editor .sidebar { grid-area: side; }
.editor .map-wrap { grid-area: map; min-height: 0; }
.editor.dock-right #props { grid-area: right; border-left: 1px solid var(--line); }
.editor.dock-bottom #props { grid-area: bottom; border-top: 1px solid var(--line); }

.ed-topbar {
  display: flex; align-items: center; gap: 6px; padding: 6px 10px;
  background: var(--panel); border-bottom: 1px solid var(--line); min-width: 0; z-index: 1100;
}
.ed-topbar .title { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ed-topbar button { padding: 0.3em 0.7em; font-size: 0.88rem; }
.tb-sep { width: 1px; align-self: stretch; background: var(--line); margin: 0 4px; }
.toggle { display: inline-flex; align-items: center; gap: 0.35em; }
.toggle[aria-pressed="true"] { background: color-mix(in srgb, var(--accent) 16%, var(--panel)); border-color: var(--accent); color: var(--text); }
.toggle[aria-pressed="false"] { color: var(--muted); }
.toggle .tg-icon { color: var(--accent); }
.seg { display: inline-flex; }
.seg button { border-radius: 0; margin: 0; }
.seg button:first-child { border-radius: var(--r-btn) 0 0 var(--r-btn); }
.seg button:last-child { border-radius: 0 var(--r-btn) var(--r-btn) 0; border-left-width: 0; }
.seg button.on { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.seg button:disabled { opacity: 0.45; }

.sidebar { overflow-y: auto; border-right: 1px solid var(--line); background: var(--panel); min-height: 0; }
.sidebar section { padding: 1rem; border-bottom: 1px solid var(--line); }
.sidebar header { padding: 0.8rem 1rem; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 0.5em; }
.sidebar header .title { font-weight: 600; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map { height: 100%; width: 100%; }
.map-wrap { position: relative; }
.map-top {
  position: absolute; top: 10px; left: 10px; right: 10px; z-index: 950;
  display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; pointer-events: none;
}
.map-top > * { pointer-events: auto; }
.map-menus {
  display: flex; gap: 6px; align-items: flex-start; background: var(--panel); padding: 6px;
  border-radius: 10px; box-shadow: var(--shadow);
}
.map-menus select { max-width: 220px; padding: 0.35em 0.5em; }
.layer-menu { position: relative; }
.layers-panel {
  position: absolute; top: calc(100% + 6px); left: 0; width: 270px; max-height: 60vh; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 8px 10px;
}
.layers-panel .check { margin: 0.2em 0; font-size: 0.9rem; }
.layers-panel .layer-head { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-top: 0.6em; }
.layers-panel .swatch { display: inline-block; vertical-align: middle; margin-right: 4px; }
.map-tools {
  margin-left: auto; margin-right: auto;
  background: var(--panel); padding: 6px; border-radius: 10px; box-shadow: var(--shadow);
  display: flex; gap: 6px; flex-wrap: nowrap; justify-content: center; overflow-x: auto; max-width: 100%;
}
/* POI sound objects: a pin at the spot (always clickable, whatever the zoom) */
.poi-pin {
  width: 22px; height: 22px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.45);
}
.poi-pin.selected { outline: 3px solid var(--accent); outline-offset: 1px; }
.poi-pin.invisible { opacity: 0.55; border-style: dashed; }
.map-hint {
  position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 500;
  background: rgba(20, 20, 20, 0.85); color: #fff; padding: 6px 12px; border-radius: 8px; font-size: 0.9rem;
}
.list { list-style: none; margin: 0; padding: 0; }
.list li {
  display: flex; align-items: center; gap: 0.5em; padding: 0.45em 0.5em; border-radius: 7px; cursor: pointer;
}
.list li:hover { background: var(--bg); }
.list li.selected { background: color-mix(in srgb, var(--accent) 15%, transparent); }
.list .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.swatch { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.pill { font-size: 0.75rem; padding: 0.1em 0.5em; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); }
.pill.on { color: var(--ok); border-color: var(--ok); }
.progress { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.progress > div { height: 100%; background: var(--accent); width: 0; transition: width 0.2s; }
/* Edit handles on the selected object: corners (white), centre (dark, moves it all),
   radius (square, drag sideways to resize), and the small "add a point here" dots. */
.edit-handle { box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45); }
.edit-handle:hover { transform: scale(1.25); }
.vertex-handle { background: #fff; border: 2px solid #222; border-radius: 50%; cursor: move; }
.center-handle { background: #222; border: 3px solid #fff; border-radius: 50%; cursor: move; }
.radius-handle { background: #fff; border: 2px solid #222; border-radius: 4px; cursor: ew-resize; }
.mid-handle { background: rgba(255, 255, 255, 0.75); border: 1px solid #222; border-radius: 50%; cursor: copy; box-shadow: none; }

.projects { max-width: 820px; margin: 0 auto; padding: 2rem 1rem; }
.projects .card { display: flex; align-items: center; gap: 1rem; margin-bottom: 0.6rem; }
.auth { max-width: 380px; margin: 10vh auto; }

/* Narrow screens: the project panel and the dock overlay the map instead of sharing the width. */
@media (max-width: 800px) {
  .editor, .editor.dock-right, .editor.dock-bottom { --sbw: 0px; --rw: 0px; --bh: 45vh; grid-template-areas: "top top top" "map map map" "bottom bottom bottom"; }
  .editor.no-props { --bh: 0px; }
  .editor .sidebar {
    grid-area: map; z-index: 1050; width: min(88vw, 340px); box-shadow: var(--shadow);
  }
  .editor.dock-right #props, .editor.dock-bottom #props { grid-area: bottom; border-left: 0; border-top: 1px solid var(--line); }
  .ed-topbar .seg { display: none; }
  .ed-topbar .toggle { font-size: 0; gap: 0; }
  .ed-topbar .toggle .tg-icon { font-size: 1rem; }
  /* (Version 107) A phone: the bar wraps onto a second row instead of making the page wider than the screen. */
  .ed-topbar { flex-wrap: wrap; row-gap: 4px; }
  .ed-topbar button, .ed-topbar .live-btn { white-space: nowrap; }
  .ed-topbar .title { flex-basis: 100%; order: 10; }
}

/* ---------- player ---------- */
.player { position: fixed; inset: 0; display: flex; flex-direction: column; }
.player .map { flex: 1; }
.player .topbar {
  position: absolute; top: 0; left: 0; right: 0; z-index: 600; padding: 10px 12px;
  padding-top: max(10px, env(safe-area-inset-top));
  display: flex; gap: 8px; align-items: center; pointer-events: none;
}
.player .topbar > * { pointer-events: auto; }
.player .topbar .title {
  flex: 1; background: var(--panel); padding: 8px 12px; border-radius: 10px; box-shadow: var(--shadow);
  font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 600;
  background: var(--panel); border-radius: 16px 16px 0 0; box-shadow: var(--shadow);
  padding: 14px 16px; padding-bottom: max(14px, env(safe-area-inset-bottom));
  max-height: 60vh; overflow-y: auto;
}
.now-playing { list-style: none; padding: 0; margin: 0.4em 0; }
.now-playing li { display: flex; align-items: center; gap: 0.6em; padding: 0.25em 0; }
.meter { width: 70px; height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; flex: none; }
.meter > div { height: 100%; background: var(--ok); transition: width 0.4s; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); display: inline-block; }
.status-dot.good { background: var(--ok); }
.status-dot.poor { background: #d99a1c; }
.status-dot.bad { background: var(--danger); }
/* The traveller's position: a vivid magenta dot in a white ring with a dark edge, the same in every
   colour scheme, so it stands out from sound objects (blue by default), paths (orange), the map and satellite. */
:root { --you: #ff1f8f; }
.you-dot {
  position: relative; width: 18px; height: 18px; border-radius: 50%; background: var(--you);
  border: 3px solid #fff; box-shadow: 0 0 0 1.5px rgba(0, 0, 0, 0.55), 0 1px 6px rgba(0, 0, 0, 0.45);
}
/* It pulses: two rings, half a beat apart, in the same magenta. */
.you-dot::before, .you-dot::after, .pin-pulse::before, .pin-pulse::after {
  content: ''; position: absolute; left: 50%; top: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px;
  border-radius: 50%; background: var(--you); opacity: 0; pointer-events: none;
  animation: you-pulse 2s ease-out infinite;
}
.you-dot::after, .pin-pulse::after { animation-delay: 1s; }
@keyframes you-pulse { 0% { transform: scale(1); opacity: 0.55; } 100% { transform: scale(4); opacity: 0; } }
.pin-wrap { position: relative; width: 34px; height: 44px; }
.pin-pulse { position: absolute; left: 17px; top: 42px; width: 0; height: 0; }
@media (prefers-reduced-motion: reduce) {
  .you-dot::before, .you-dot::after, .pin-pulse::before, .pin-pulse::after { animation-duration: 4s; }
}
.sim-banner { background: #d99a1c; color: #111; padding: 6px 10px; border-radius: 8px; font-size: 0.85rem; }

/* Player: "listen from a pin" banner and the 🎧 pin marker */
.explore-banner { background: color-mix(in srgb, var(--accent) 18%, var(--panel)); padding: 6px 10px; border-radius: 8px; font-size: 0.85rem; }
.listen-pin {
  width: 34px; height: 34px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  background: #d9480f; border: 3px solid #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  display: flex; align-items: center; justify-content: center;
}
.listen-pin span { transform: rotate(45deg); font-size: 15px; line-height: 1; }
/* Player: keep the layer switcher clear of the title bar */
.player .leaflet-top.leaflet-right { top: calc(max(10px, env(safe-area-inset-top)) + 48px); }

/* Editor: map-style checklist rows */
.layer-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0 0.6em; margin: 0.35em 0; }
.layer-row .layer-note { flex-basis: 100%; margin-left: 1.9em; }
.layer-row label.check { margin: 0; }

/* ---------- path + flags ---------- */
.route-arrow { font-size: 11px; line-height: 14px; text-align: center; text-shadow: 0 0 2px #fff, 0 0 2px #fff; }
.route-end { font: 600 11px/22px system-ui, sans-serif; text-align: center; border-radius: 11px; color: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.35); border: 2px solid #fff; }
.route-end.start { background: #1f8a4c; }
.route-end.finish { background: #1c1b19; background-image: repeating-conic-gradient(#1c1b19 0 25%, #555 0 50%); background-size: 8px 8px; }
.flag-pin { position: relative; width: 28px; height: 36px; }
.flag-pin::before { content: ''; position: absolute; left: 3px; top: 2px; width: 2px; height: 32px; background: #1c1b19; }
.flag-pin span {
  position: absolute; left: 5px; top: 2px; min-width: 20px; height: 18px; padding: 0 4px;
  background: #c2255c; color: #fff; font: 700 11px/18px system-ui, sans-serif; text-align: center;
  border-radius: 0 4px 4px 0; box-shadow: 0 1px 3px rgba(0,0,0,.35);
}
.flag-pin.selected span { outline: 2px solid var(--accent); outline-offset: 1px; }
.flag-desc { margin-top: 0.3em; white-space: pre-line; }
/* Player: ◐ map-shading button */
.player .topbar #shade-btn { width: 40px; height: 40px; padding: 0; box-shadow: var(--shadow); }

/* ---------- editor: properties dock ---------- */
.props { overflow-y: auto; min-height: 0; min-width: 0; background: var(--panel); padding: 12px 14px 14px; }
.props-empty { padding: 1rem 0.2rem; }
.props-empty h2 { font-size: 1rem; }
.props:has(> div:not(.props-empty):not(.props-grip):not(.hidden)) .props-empty { display: none; }
/* In the bottom dock the settings flow into side-by-side columns. */
.pgroup { min-width: 0; }
.dock-bottom .pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 0 22px; align-items: start; }
.dock-bottom .pgrid > .pgroup { margin-top: 0; }
.node-nav {
  display: flex; align-items: center; gap: 6px; margin: 0.3em 0 0.4em; padding: 4px 6px;
  border-radius: 8px; background: color-mix(in srgb, var(--accent) 10%, var(--panel)); font-size: 0.88rem;
}
.node-list li { gap: 0.4em; }
.node-list .node-num {
  flex: none; min-width: 20px; height: 20px; border-radius: 50%; color: #fff; font: 700 11px/20px system-ui, sans-serif; text-align: center;
}
.path-nodes { list-style: none; margin: 0 0 0.3em 1.3em; padding: 0; }
.path-nodes li { padding: 0.25em 0.5em; font-size: 0.9rem; }
.node-marker { font: 700 10px/18px system-ui, sans-serif; color: #fff; text-align: center; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.4); }
.node-marker { cursor: pointer; }
.node-marker.editable { cursor: move; }
.node-marker.selected { outline: 3px solid var(--accent); outline-offset: 1px; }

/* Colour-scheme swatches in the project panel */
.theme-swatches { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.theme-swatch {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 2px; font-size: 0.72rem;
  background: none; border: 2px solid transparent; border-radius: 10px; cursor: pointer; color: var(--text);
}
.theme-swatch[aria-checked="true"] { border-color: var(--accent); }
.theme-swatch .chips3 { display: flex; width: 44px; height: 30px; border-radius: 8px; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }
.theme-swatch .chips3 i { flex: 1; }
.props-head { display: flex; align-items: center; gap: 0.5em; margin-bottom: 0.2em; }
.props-head h2 { margin: 0; font-size: 1rem; }
.props button.icon { padding: 0.2em 0.55em; }
.props input[type=range] { width: 100%; }
.flag-num { background: #c2255c; color: #fff; font: 700 12px/20px system-ui, sans-serif; min-width: 20px; text-align: center; border-radius: 4px; padding: 0 4px; }


/* No focus box around a zone after clicking it; keep the editor toolbar on one line;
   centre the shading button's icon */
.leaflet-interactive:focus { outline: none; }
.map-tools { flex-wrap: nowrap; }
.map-tools button { white-space: nowrap; }
.player .topbar #shade-btn { display: flex; align-items: center; justify-content: center; font-size: 1.1rem; }
.player .topbar #shade-btn.hidden { display: none; }

/* Player: weather line and the simulator's time / weather controls */
.weather-line { margin: 8px 0 0; }
.sim-controls { margin-top: 10px; padding: 8px 10px; border: 1px dashed #d99a1c; border-radius: 8px; }
.sim-controls input, .sim-controls select { padding: 0.25em 0.4em; }

/* ---------- editor: when it plays ---------- */
.when { margin-top: 0.9em; padding-top: 0.7em; border-top: 1px solid var(--line); }
.when-summary { margin: 0.3em 0 0.5em; font-weight: 600; font-size: 0.9rem; }
.when details { margin-top: 0.6em; }
.when summary { cursor: pointer; font-size: 0.9rem; }
.when .small-btn { font-size: 0.85rem; padding: 0.25em 0.6em; margin-top: 0.3em; }
.win { border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; margin: 0.4em 0; }
.win .edge { display: flex; gap: 4px; align-items: center; margin-top: 4px; font-size: 0.85rem; }
.win .edge > span { width: 2.6em; color: var(--muted); }
.win .edge select { flex: 1; min-width: 0; }
.win .edge input[type=number] { width: 4.6em; }
.win .edge input[type=time] { width: 6.5em; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.chip { font-size: 0.8rem; padding: 0.2em 0.55em; border-radius: 99px; border: 1px solid var(--line); background: var(--bg); cursor: pointer; user-select: none; }
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.chip.ghost { border-style: dashed; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 0.6em; }
.cond-icon { font-size: 0.8rem; }

/* Editor: the "Before / after sunrise or sunset" sentence control */
.primary-soft { border-color: var(--accent); color: var(--accent); }
.sun-timer { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 0.88rem; }
.sun-timer input[type=number] { width: 4.4em; flex: none; padding: 0.25em 0.4em; }
.sun-timer select { width: auto; flex: none; padding: 0.25em 0.3em; }
.when input[type=date] { min-width: 0; width: 100%; }

/* ---------- editor: zone pop-up sub-sections ---------- */
.props .sub { margin-top: 0.9em; padding-top: 0.6em; border-top: 1px solid var(--line); }
.props .sub h3 { margin: 0 0 0.3em; }
.props .indent { margin-left: 1.9em; font-size: 0.88rem; gap: 0.35em; }
.props .grid3 input { min-width: 0; width: 100%; }
.atten-graph { height: 34px; margin-top: 6px; border-radius: 6px; background: var(--bg); position: relative; overflow: hidden; }
.atten-graph svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.group-badge { font-size: 0.7rem; padding: 0 0.4em; border-radius: 4px; border: 1px solid var(--line); color: var(--muted); }

/* ---------- player: debug panel ---------- */
.player .topbar #debug-btn { width: 40px; height: 40px; padding: 0; box-shadow: var(--shadow); display: flex; align-items: center; justify-content: center; }
.debug-panel {
  position: absolute; z-index: 650; left: 10px; right: 10px; top: calc(max(10px, env(safe-area-inset-top)) + 50px);
  max-height: 42vh; overflow-y: auto; padding: 8px 10px;
  background: color-mix(in srgb, var(--panel) 94%, transparent); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow);
  font: 12px/1.35 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.dbg-head { color: var(--muted); margin-bottom: 4px; }
.dbg-title { font-weight: 700; margin: 6px 0 2px; font-family: system-ui, sans-serif; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.dbg-empty { color: var(--muted); }
.dbg-item { margin: 4px 0 6px; }
.dbg-row { display: flex; align-items: center; gap: 6px; }
.dbg-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.dbg-tags span { font-size: 10px; padding: 0 5px; margin-left: 3px; border-radius: 4px; background: var(--bg); border: 1px solid var(--line); }
.dbg-bar { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; margin: 3px 0 2px; }
.dbg-bar > div { height: 100%; transition: width 0.25s linear; }
.dbg-meta { color: var(--muted); gap: 10px; }
.dbg-silent { display: flex; align-items: center; gap: 6px; margin: 2px 0; }
.dbg-silent .dbg-name { flex: 0 1 auto; max-width: 40%; font-weight: 500; }

/* ---------- accounts: top bar, sign-in panes, My account, Administration ---------- */
.topnav {
  display: flex; align-items: center; gap: 0.4em; padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--line); background: var(--panel); position: sticky; top: 0; z-index: 10;
}
.topnav .brand { margin-right: 0.8em; }
.topnav button.active { border-color: var(--accent); color: var(--accent); }
.badge { display: inline-block; min-width: 1.4em; padding: 0 0.4em; border-radius: 99px; background: var(--danger); color: #fff; font-size: 0.75rem; line-height: 1.4em; text-align: center; }
.pill.warn { color: #b25e00; border-color: #d99a1c; }
.warn-text { color: #b25e00; }
.ok-text { color: var(--ok); }
.auth .auth-pane input { width: 100%; }
.card.acct { margin-bottom: 1rem; display: block; }
.card.acct h2 { margin: 0 0 0.3em; font-size: 1.05rem; }
.card.acct input, .card.acct textarea { width: 100%; }
.danger-zone { border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); }
.admin-box { margin-top: 0.8em; padding: 0.6em 0.8em; border: 1px dashed #d99a1c; border-radius: 8px; }
.admin-box input { width: 100%; }
.owner-banner { padding: 0.5rem 1rem; background: color-mix(in srgb, #d99a1c 25%, var(--panel)); font-size: 0.85rem; border-bottom: 1px solid var(--line); }
.projects.admin { max-width: 1100px; }
.stats { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 0.6rem; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 0.5rem 0.8rem; min-width: 6.5rem; }
.stat strong { display: block; font-size: 1.3rem; }
.stat span { font-size: 0.8rem; color: var(--muted); }
.tabs { display: flex; gap: 0.3rem; margin: 0.8rem 0; border-bottom: 1px solid var(--line); }
.tabs button { border-radius: 8px 8px 0 0; border-bottom: 0; }
.tabs button.active { background: var(--panel); border-color: var(--accent); color: var(--accent); }
.table { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; margin: 0.6rem 0; font-size: 0.9rem; }
.table th, .table td { text-align: left; padding: 0.45rem 0.6rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.table tr[data-user] { cursor: pointer; }
.table tr[data-user]:hover, .table tr.selected { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.table input[data-note] { width: 100%; min-width: 8em; }
.nowrap { white-space: nowrap; }
#admin-user, #admin-new { display: block; margin-top: 1rem; }
#admin-new summary { cursor: pointer; }
#admin-user h3 { margin-top: 1.2em; }
.copy-row { display: flex; gap: 0.4em; margin-top: 0.5em; }
.copy-row input { flex: 1; font-size: 0.8rem; }
.card.message { display: block; margin-bottom: 0.6rem; }
.card.message.unread { border-left: 4px solid var(--accent); }
@media (max-width: 800px) {
  .table { display: block; overflow-x: auto; }
  .topnav { flex-wrap: wrap; }
}

/* ---------- home page map of live walks ---------- */
.home-map { height: 45vh; min-height: 260px; border-radius: 12px; border: 1px solid var(--line); margin: 1rem 0; }
.walk-list .by { font-size: 0.85rem; color: var(--muted); }

/* The Properties switch glows when something is selected while the dock is off. */
.toggle.attn { animation: attn 1.2s ease-in-out 3; border-color: var(--accent); }
@keyframes attn { 50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 35%, transparent); } }

/* Player: pulsing ring on the path node to head for next (colour = the path's colour). */
.node-pulse { position: relative; width: 22px; height: 22px; }
/* The halo: a soft glow that breathes, under the rings. */
.node-pulse s {
  position: absolute; inset: -18px; border-radius: 50%; text-decoration: none;
  background: radial-gradient(circle, currentColor 0%, transparent 70%); opacity: 0.35;
  animation: node-halo 1.8s ease-in-out infinite;
}
@keyframes node-halo { 50% { opacity: 0.6; transform: scale(1.15); } }
.node-pulse b { position: absolute; inset: 4px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 2px #fff; }
.node-pulse i {
  position: absolute; inset: 0; border-radius: 50%; border: 3px solid currentColor;
  animation: node-pulse 1.8s ease-out infinite;
}
.node-pulse i + i { animation-delay: 0.9s; }
@keyframes node-pulse { from { transform: scale(0.6); opacity: 0.95; } to { transform: scale(3.2); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .node-pulse i { animation-duration: 4s; } }
@media (max-width: 800px) {
  .map-tools { justify-content: flex-start; padding: 4px; gap: 4px; margin-left: 0; }
  .map-menus select { max-width: 150px; }
  .map-tools button { padding: 0.3em 0.55em; font-size: 0.85rem; }
}

/* Editor: Listen mode — the visitor token and the listen bar over the map */
.visitor-token { position: relative; width: 34px; height: 34px; cursor: grab; }
.visitor-token b {
  position: absolute; inset: 0; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 400; border: 3px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,.4);
  background: conic-gradient(from 20deg, #ff4d6d, #ffb703, #3ddc97, #3a86ff, #b5179e, #ff4d6d);
}
.visitor-token i {
  position: absolute; inset: 0; border-radius: 50%; border: 3px solid #ff4d6d; opacity: 0;
  animation: visitor-pulse 1.8s ease-out infinite;
}
.visitor-token i + i { border-color: #3a86ff; animation-delay: 0.9s; }
@keyframes visitor-pulse { 0% { transform: scale(1); opacity: 0.9; } 100% { transform: scale(2.6); opacity: 0; } }
.listen-bar {
  position: absolute; left: 12px; bottom: 28px; z-index: 900; width: min(360px, calc(100% - 24px));
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow);
  padding: 10px 12px; max-height: min(45%, calc(100% - var(--map-top-h, 70px) - 36px)); overflow-y: auto;
}
.listen-bar .row { gap: 6px; }
.listen-bar button { padding: 0.25em 0.6em; font-size: 0.85rem; }
.listen-badge { font-weight: 600; white-space: nowrap; }
.listen-bar .now-playing li { cursor: pointer; }
.editor.listening .map-hint { bottom: auto; top: var(--map-top-h, 64px); }
.pin-wrap .listen-pin { position: relative; }

/* "When it plays": one labelled row each for days, times and moon */
.when-row { display: flex; gap: 8px; align-items: flex-start; margin-top: 0.6em; }
.when-label { flex: none; width: 3.6em; font-size: 0.8rem; font-weight: 600; color: var(--muted); padding-top: 0.45em; }
.when-row .chips { margin-top: 0; }
.when-row .grow { flex: 1; min-width: 0; }
.win.clock .row { gap: 6px; font-size: 0.9rem; }
.win.clock input[type=time] { width: 7em; }

/* The map's top bar: tool labels give way to icons when the map is narrow (each keeps its tooltip). */
.map-wrap { container-type: inline-size; }
@container (max-width: 960px) {
  .map-tools .lbl { display: none; }
  .map-tools button { min-width: 38px; }
  .map-menus select { max-width: 170px; }
}

/* The top bar's visibility badge is a button that jumps to "Visible to travellers". */
.pill-button { cursor: pointer; background: none; font: inherit; font-size: 0.75rem; }
.ed-topbar .pill-button { padding: 0.15em 0.6em; }

/* Listen mode: the Map state panel */
.ms-toggle { display: flex; gap: 6px; width: 100%; margin-top: 6px; text-align: left; font-size: 0.85rem; }
.ms-toggle .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ms-toggle.set { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--panel)); }
.ms-panel { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 6px; }
.ms-sec { margin: 0.5em 0; }
.ms-h { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 600; margin-bottom: 3px; }
.ms-panel .row { flex-wrap: wrap; gap: 4px; align-items: center; }
.ms-panel input[type=date], .ms-panel input[type=time] { width: auto; }
.ms-avail { list-style: none; margin: 0; padding: 0; }
.ms-avail li { padding: 2px 0; }
.listen-bar.ms-open { max-height: calc(100% - var(--map-top-h, 70px) - 36px); width: min(400px, calc(100% - 24px)); }
.ms-panel select, .ms-panel input[type=number] { width: auto; }
.ms-panel .row > * { flex: none; }
#layers-btn { white-space: nowrap; }
.listen-bar.ms-open { max-height: calc(100% - var(--map-top-h, 120px) - 36px); }

/* Player: the current-state widget under the title */
.state-widget {
  position: absolute; z-index: 620; left: 12px; top: calc(max(10px, env(safe-area-inset-top)) + 50px);
  max-width: min(330px, calc(100% - 80px));
}
#state-btn {
  background: var(--panel); box-shadow: var(--shadow); border-radius: 10px; padding: 6px 10px;
  font-size: 0.88rem; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis;
}
.state-sim { font-size: 0.7rem; background: #d99a1c; color: #111; border-radius: 4px; padding: 0 4px; }
.state-card {
  margin-top: 6px; background: var(--panel); border-radius: 12px; box-shadow: var(--shadow);
  padding: 10px 12px; font-size: 0.88rem; max-height: 45vh; overflow-y: auto;
}
.state-row { display: flex; gap: 8px; padding: 2px 0; }
.state-label { flex: none; width: 6.6em; color: var(--muted); font-size: 0.8rem; padding-top: 1px; }
.state-note { margin: 0 0 6px; font-size: 0.8rem; background: color-mix(in srgb, #d99a1c 25%, var(--panel)); border-radius: 6px; padding: 3px 6px; }
/* Swatches share the panel width evenly, however narrow it is. */
.theme-swatches { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
.theme-swatch { min-width: 0; padding: 6px 0; }
.theme-swatch .chips3 { width: 100%; max-width: 44px; }
/* Daily times: room for "05:00 PM" in 12-hour locales; wraps tidily when narrow. */
.win.clock .row { flex-wrap: wrap; }
.win.clock input[type=time] { width: auto; min-width: 8.2em; flex: none; }

/* Player: the pop-up on a zone with "When it plays" conditions */
.zone-info .leaflet-popup-content { margin: 10px 12px; font-size: 0.9rem; line-height: 1.4; }
.zone-info-now { margin-top: 6px; color: #7a4a00; }
.zone-info-now.ok { color: #1f7a45; }

/* Player: which way the traveller faces (a small wedge on their dot), for 3D sound */
.you-cone {
  position: absolute; left: 50%; top: 50%; width: 0; height: 0; margin-left: -9px; margin-top: -30px;
  border-left: 9px solid transparent; border-right: 9px solid transparent; border-bottom: 22px solid var(--you);
  opacity: 0.55; transform-origin: 9px 30px; pointer-events: none;
}

/* Editor Listen mode: which way the visitor faces */
.visitor-arrow {
  position: absolute; left: 50%; top: 50%; width: 0; height: 0; margin-left: -8px; margin-top: -34px; z-index: 1;
  border-left: 8px solid transparent; border-right: 8px solid transparent; border-bottom: 14px solid #3a86ff;
  transform-origin: 8px 34px; pointer-events: none; filter: drop-shadow(0 0 1px #fff);
}
.listen-facing { min-width: 4.6em; text-align: center; font-variant-numeric: tabular-nums; }
#listen-3d-row { gap: 4px; flex-wrap: wrap; margin-bottom: 4px; }

/* Editor: a sound object's list of files and its container settings */
.file-list li { gap: 0.35em; padding: 0.25em 0.4em; cursor: default; }
.file-list .num { color: var(--muted); min-width: 1.4em; font-size: 0.85rem; }
.file-list button { padding: 0.1em 0.45em; font-size: 0.85rem; }
.file-list li[draggable] { cursor: grab; }
.file-list .grip { color: var(--muted); cursor: grab; font-size: 0.9rem; line-height: 1; user-select: none; }
.file-list li.dragging { opacity: 0.45; }
.file-list li.drop-before { box-shadow: inset 0 2px 0 var(--accent); }
.file-list li.drop-after { box-shadow: inset 0 -2px 0 var(--accent); }
.gap-fields { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 0.3em; }
.gap-part { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.gap-fields input { width: 4.6em; }
.gap-fields select { width: auto; }
#z-plays { max-width: 100%; }
.gap-pm { font-weight: 700; color: var(--muted); }
#z-add-file { margin-top: 4px; }
.container-box { margin-top: 0.6em; padding: 0.5em 0.6em; border: 1px solid var(--line); border-radius: 8px; }
.gap-sliders, .vary-sliders { display: grid; grid-template-columns: auto 1fr; gap: 2px 8px; align-items: center; }
.gap-sliders input, .vary-sliders input { width: 100%; }

.container-box .box-title { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 600; margin-bottom: 0.3em; }
#z-prewait { width: 100%; }

/* Panic: stop every sound and reset them (player and Listen mode). */
button.panic {
  border-color: var(--danger);
  color: var(--danger);
  font-weight: 600;
}
button.panic:hover {
  background: var(--danger);
  color: #fff;
}

/* Buses in the Project panel: one row per bus. */
.bus-row {
  border: 1px solid var(--line, #ddd);
  border-radius: 8px;
  padding: 6px 8px;
  margin: 6px 0;
}
.bus-row .row { gap: 4px 10px; flex-wrap: wrap; align-items: center; margin: 3px 0; }
.bus-row label { display: inline-flex; gap: 4px; align-items: center; margin: 0; font-size: 0.85rem; white-space: nowrap; }
.bus-row input[type="text"] { flex: 1; min-width: 7em; width: auto; }
.bus-row input[type="number"] { width: 4.2em; padding: 2px 4px; margin: 0; }
.bus-ducks { margin: 2px 0 4px; display: grid; gap: 2px; }
.bus-row label.duck-row { display: grid; grid-template-columns: 5.5em 1fr 7.5em; gap: 6px; align-items: center; white-space: normal; }
.duck-name { overflow: hidden; text-overflow: ellipsis; }
.duck-val { color: var(--muted); font-variant-numeric: tabular-nums; }
.listen-buses { margin: 0.2em 0; }

/* Popups: messages, pictures and videos shown while the traveller is inside a sound object. */
.popup-stack {
  position: absolute;
  top: 58px;
  right: 10px;
  z-index: 1100;
  width: min(380px, calc(100% - 20px));
  max-height: calc(100% - 200px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.popup-stack.in-editor { top: var(--map-top-h, 70px); max-height: calc(100% - var(--map-top-h, 70px) - 20px); }
.popup-card {
  position: relative;
  background: var(--panel, #fff);
  color: var(--text);
  border-radius: 12px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
  padding: 12px 14px;
  /* Comes in quickly: a fade with a small drift and a touch of scale (Version 95); goes the same way
     (popup.js adds .popup-leaving, and the cards below close the gap smoothly). */
  animation: popup-in 0.24s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  transform-origin: top center;
  transition: opacity 0.18s ease-in, transform 0.18s ease-in, height 0.22s ease 0.08s, padding 0.22s ease 0.08s, margin 0.22s ease 0.08s;
}
@keyframes popup-in { from { opacity: 0; transform: translateY(-10px) scale(0.97); } to { opacity: 1; transform: none; } }
.popup-card.popup-leaving { opacity: 0; transform: translateY(-6px) scale(0.97); overflow: hidden; pointer-events: none; }
.popup-card.popup-leaving.popup-collapse { height: 0 !important; padding-top: 0; padding-bottom: 0; margin-bottom: -8px; box-shadow: none; }
/* A picture fades in once it has loaded, instead of popping in. */
.popup-media img { opacity: 0; transition: opacity 0.3s ease; }
.popup-media img.loaded { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .popup-card { animation: popup-fade 0.15s ease-out both; transition: opacity 0.15s ease; }
  .popup-card.popup-leaving { transform: none; }
  @keyframes popup-fade { from { opacity: 0; } to { opacity: 1; } }
}
.popup-card h3 { margin: 0 2em 0.4em 0; font-size: 1.05rem; text-transform: none; letter-spacing: normal; color: var(--text); }
.popup-close {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 1;
  /* The ✕ is drawn (an SVG) and centred in its round button, whatever the font. */
  display: grid;
  place-items: center;
  box-sizing: border-box;
  width: 30px;
  height: 30px;
  min-width: 0;
  min-height: 0;
  padding: 0;
  margin: 0;
  border-radius: 50%;
  line-height: 0;
  background: color-mix(in srgb, var(--panel, #fff) 82%, transparent);
  border: 1px solid color-mix(in srgb, var(--text, #222) 18%, transparent);
  color: var(--text);
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.15s ease;
}
.popup-close svg { display: block; width: 12px; height: 12px; }
.popup-close:hover, .popup-close:focus-visible { background: color-mix(in srgb, var(--text, #222) 14%, var(--panel, #fff)); }
.popup-close:active { transform: scale(0.92); }
.popup-media img, .popup-media video { display: block; width: 100%; max-height: 50vh; object-fit: contain; border-radius: 8px; background: #000; }
.popup-media + .popup-text { margin-top: 0.6em; }
.popup-embed { position: relative; padding-top: 56.25%; margin-top: 4px; }
.popup-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: 8px; }
.popup-text { margin: 0; white-space: normal; overflow-wrap: anywhere; }
.popup-link { display: inline-block; margin-top: 0.6em; }
@media (max-width: 600px) {
  .popup-stack { left: 10px; right: 10px; width: auto; }
}

/* Drag and drop (editor-dragdrop.js) */
.drop-over { outline: 3px dashed var(--accent, #5b4bd6); outline-offset: -3px; background-image: linear-gradient(color-mix(in srgb, var(--accent, #5b4bd6) 8%, transparent), color-mix(in srgb, var(--accent, #5b4bd6) 8%, transparent)); }
path.drop-zone { stroke-width: 6px; stroke-dasharray: 8 5; fill-opacity: 0.45; }
.poi-pin.drop-zone, .leaflet-marker-icon.drop-zone { transform-origin: center; filter: drop-shadow(0 0 6px var(--accent, #5b4bd6)); }
#audio-list li[draggable], #media-list li[draggable], #objmedia-list li[draggable] { cursor: grab; }
#media-list .thumb { width: 28px; height: 28px; object-fit: cover; border-radius: 4px; flex: none; display: inline-flex; align-items: center; justify-content: center; }
.drop-tip { margin: 0.6em 0 0; }
.drop-toast {
  position: absolute; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 1200;
  background: var(--panel); color: var(--text); border-radius: 10px; box-shadow: var(--shadow);
  padding: 8px 14px; max-width: min(520px, calc(100% - 24px)); font-size: 0.9rem;
}
.drop-toast.bad { color: var(--danger); }

/* Project panel tabs: Walk and Media */
.side-tabs { display: flex; gap: 4px; padding: 8px 12px 0; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--panel); z-index: 5; }
.side-tabs button {
  flex: 1; border: 1px solid transparent; border-bottom: none; border-radius: 8px 8px 0 0; background: none;
  padding: 7px 10px; font-weight: 600; color: var(--muted); margin-bottom: -1px;
}
.side-tabs button[aria-selected="true"] { background: var(--panel); color: var(--text); border-color: var(--line); border-bottom: 1px solid var(--panel); }
.tab-count { display: inline-block; min-width: 1.4em; padding: 0 0.4em; border-radius: 99px; background: var(--line); color: var(--text); font-size: 0.75rem; font-weight: 600; }
.tab-count:empty { display: none; }

/* Media tab: thumbnails of pictures and videos */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.media-tile { position: relative; margin: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--bg); cursor: grab; }
.media-tile .tile-thumb { position: relative; aspect-ratio: 4 / 3; background: #000; display: flex; align-items: center; justify-content: center; }
.media-tile .tile-thumb a { display: block; width: 100%; height: 100%; }
.media-tile img, .media-tile video { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-tile .tile-play { position: absolute; inset: 0; margin: auto; width: 38px; height: 38px; border-radius: 50%; padding: 0; background: rgba(0, 0, 0, 0.55); color: #fff; border: 2px solid #fff; }
.media-tile figcaption { padding: 4px 6px 5px; display: flex; flex-direction: column; min-width: 0; }
.media-tile figcaption .name { font-size: 0.8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.media-tile .tile-actions { position: absolute; top: 4px; right: 4px; display: flex; gap: 3px; opacity: 0; transition: opacity 0.15s; }
.media-tile:hover .tile-actions, .media-tile:focus-within .tile-actions { opacity: 1; }
.media-tile .tile-actions button { width: 26px; height: 26px; padding: 0; border-radius: 6px; background: var(--panel); font-size: 0.8rem; }
@media (hover: none) { .media-tile .tile-actions { opacity: 1; } }
#upload-error:empty { display: none; }
#audio-list li, #objmedia-list li { gap: 6px; }
#audio-list .name-wrap, #objmedia-list .name-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
#audio-list .name-wrap .name, #objmedia-list .name-wrap .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#audio-list li, #objmedia-list li { gap: 4px; }
#audio-list li button, #objmedia-list li button { width: 26px; height: 28px; padding: 0; flex: none; font-size: 0.8rem; }
/* While files are dragged over the Project panel (either tab): say what dropping does. */
#ed-sidebar.drop-over::before {
  content: '⬇ Drop to upload to Media';
  position: sticky; top: 0; z-index: 10; display: block;
  padding: 10px 12px; text-align: center; font-weight: 600;
  background: var(--accent); color: var(--accent-text);
}

/* Guidance along paths (guide.js): the compass bar and the 🧭 button */
.compass-bar {
  position: absolute; z-index: 1050; left: 50%; transform: translateX(-50%);
  top: calc(max(10px, env(safe-area-inset-top)) + 110px);
  width: min(460px, calc(100% - 24px));
  display: flex; align-items: stretch; gap: 4px;
  background: var(--panel); color: var(--text); border-radius: 12px; box-shadow: var(--shadow, 0 6px 24px rgba(0,0,0,.25));
  padding: 4px 4px 4px 0;
}
.compass-bar.in-editor { top: var(--map-top-h, 70px); width: min(420px, calc(100% - 330px)); }
/* On narrow screens, leave the right-hand column for the map's buttons (layers, compass). */
@media (max-width: 600px) {
  .compass-bar:not(.in-editor) { left: 12px; transform: none; width: calc(100% - 80px); }
}
.cbar-track {
  position: relative; flex: 1; height: 58px; overflow: hidden;
  /* the ends fade out, like a strip curving away */
  -webkit-mask-image: linear-gradient(to right, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 12%, #000 88%, transparent);
}
.cbar-scale { position: absolute; left: 0; top: 0; height: 100%; transition: transform 0.25s ease-out; }
.cbar-tick { position: absolute; top: 5px; width: 1px; height: 7px; background: var(--muted); }
.cbar-word { position: absolute; top: 1px; transform: translateX(-50%); font-size: 0.78rem; font-weight: 700; color: var(--muted); letter-spacing: 0.02em; }
.cbar-word.north { color: #d33a2c; }
.cbar-mid { position: absolute; left: 50%; top: 0; transform: translateX(-50%); width: 0; height: 0; border: 6px solid transparent; border-top-color: var(--text); }
.cbar-dots { position: absolute; inset: 0; }
.cbar-dot { position: absolute; top: 20px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 1px; transition: left 0.25s ease-out; }
.cbar-dot i { width: 14px; height: 14px; border-radius: 50%; background: var(--dot); box-shadow: 0 0 0 2px var(--panel), 0 0 0 3px var(--dot); }
.cbar-dot.main i { width: 18px; height: 18px; }
.cbar-dot b { font-size: 0.8rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* A node off to the side or behind: at the edge, pointing the way to turn. */
.cbar-dot.edge i { border-radius: 3px; clip-path: polygon(0 50%, 100% 0, 100% 100%); box-shadow: none; }
.cbar-dot.edge.right i { clip-path: polygon(100% 50%, 0 0, 0 100%); }
.cbar-close { flex: none; align-self: center; width: 30px; height: 30px; padding: 0; border-radius: 50%; }
#guide-btn.off { opacity: 0.55; }
#guide-btn[aria-pressed="true"] { background: var(--accent); color: var(--accent-text); }


/* The compass button (maprotate.js): north up, or the map turns with the traveller */
.map-compass {
  width: 44px; height: 44px; padding: 0; border-radius: 50%;
  background: var(--panel); border: 1px solid var(--line); box-shadow: 0 1px 5px rgba(0, 0, 0, 0.25);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.map-compass svg { width: 28px; height: 28px; transition: rotate 0.3s ease; }
.map-compass .n { fill: #d33a2c; }
.map-compass .s { fill: var(--muted); }
.map-compass.active { background: var(--accent); border-color: var(--accent); }
.map-compass.active .s { fill: var(--accent-text); }
/* The map's content turns smoothly; labels and pins are turned back upright. */
.leaflet-map-pane { transition: rotate 0.3s linear; }
.leaflet-dragging .leaflet-map-pane, .leaflet-zoom-anim .leaflet-map-pane { transition: none; }
.map-rotated .route-end, .map-rotated .flag-pin, .map-rotated .poi-pin, .map-rotated .pin-wrap,
.map-rotated .leaflet-popup-content-wrapper { rotate: var(--unrotate); }
.map-rotated .poi-pin { transform-origin: 50% 118%; }
.map-rotated .flag-pin { transform-origin: 14% 94%; }
.map-rotated .pin-wrap { transform-origin: 50% 95%; }

/* The waveform editor (editor-wave.js) */
.wave-dlg {
  width: min(900px, calc(100vw - 24px)); max-height: calc(100vh - 24px); overflow: auto;
  border: none; border-radius: 14px; padding: 14px 16px; background: var(--panel); color: var(--text);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}
.wave-dlg::backdrop { background: rgba(0, 0, 0, 0.45); }
.wv-wrap { position: relative; }
#wv-canvas { width: 100%; height: 160px; display: block; border-radius: 8px; border: 1px solid var(--line); touch-action: none; }
.wv-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; margin: 0; }
.wv-play { margin: 8px 0; gap: 10px; align-items: center; }
#wv-time { font-variant-numeric: tabular-nums; }
.wv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.wv-box { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.wv-box h3 { margin: 0 0 6px; font-size: 0.95rem; }
.wv-box .row { gap: 6px; flex-wrap: wrap; align-items: center; }
.wv-box label { margin: 0; }
.wv-box input[type="number"] { width: 5.5em; }
.wv-box p { margin: 0.4em 0 0; }
.cover-thumb { width: 44px; height: 33px; object-fit: cover; border-radius: 4px; border: 1px solid var(--line); flex: none; }

/* The list of sound walks (player-walks.js): a panel on the left */
.walks-panel {
  position: absolute; z-index: 1300; top: 0; left: 0; bottom: 0; width: min(360px, 88%);
  background: var(--panel); color: var(--text); box-shadow: 4px 0 24px rgba(0, 0, 0, 0.25);
  display: flex; flex-direction: column; padding-top: env(safe-area-inset-top);
  animation: walks-in 0.2s ease-out;
}
@keyframes walks-in { from { transform: translateX(-100%); } }
.walks-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 12px 4px 16px; }
.walks-head h2 { margin: 0; font-size: 1.15rem; }
.walks-tabs { display: flex; gap: 4px; padding: 6px 12px; border-bottom: 1px solid var(--line); }
.walks-tabs button { flex: 1; border-radius: 99px; padding: 6px 8px; font-weight: 600; background: none; border: 1px solid var(--line); color: var(--muted); }
.walks-tabs button[aria-selected="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.walks-list { list-style: none; margin: 0; padding: 6px 8px; overflow-y: auto; flex: 1; }
.walk-item { width: 100%; display: flex; gap: 10px; align-items: center; text-align: left; padding: 8px; border-radius: 10px; border: 1px solid transparent; background: none; color: inherit; }
.walk-item:hover { background: var(--bg); }
.walk-item.current { border-color: var(--accent); }
.walk-item img, .walk-thumb { width: 56px; height: 42px; border-radius: 6px; object-fit: cover; flex: none; }
.walk-thumb { display: inline-flex; align-items: center; justify-content: center; background: var(--bg); font-size: 1.3rem; color: var(--muted); }
.walk-words { display: flex; flex-direction: column; min-width: 0; }
.walk-words strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.walks-empty { padding: 0 16px; }
.player .topbar .title { cursor: pointer; }

/* The intro screen: the walk's title picture and caption */
.intro-screen {
  position: absolute; inset: 0; z-index: 1400; display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, 0.55); padding: 16px;
}
.intro-card {
  position: relative; width: min(480px, 100%); max-height: 100%; overflow-y: auto;
  background: var(--panel); color: var(--text); border-radius: 16px; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
  animation: popup-in 0.25s ease-out;
}
.intro-card img { display: block; width: 100%; max-height: 55vh; object-fit: cover; }
.intro-text { padding: 14px 18px 18px; }
.intro-text h2 { margin: 0 0 2px; }
.intro-text p { margin: 0.4em 0; white-space: pre-line; }
.intro-text .primary { margin-top: 0.6em; }
.intro-close {
  position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; padding: 0; border-radius: 50%;
  background: rgba(0, 0, 0, 0.55); color: #fff; border: none; font-size: 1rem; z-index: 1;
}

/* The map of all sound walks (/walks, player-walks.js) */
.player.overview #state-widget, .player.overview #debug-btn, .player.overview #guide-btn,
.player.overview #shade-btn, .player.overview #recenter, .player.overview #guide-bar { display: none !important; }
.player.overview .sheet > :not(#overview-sheet) { display: none !important; }
.player.overview .topbar .title { cursor: default; }
.walk-label {
  display: inline-block; white-space: nowrap; transform: translate(-50%, -130%);
  background: var(--panel); color: var(--text); font-weight: 600; font-size: 0.85rem;
  padding: 3px 9px; border-radius: 99px; box-shadow: 0 1px 5px rgba(0, 0, 0, 0.3); cursor: pointer;
}
.walk-pop img { display: block; width: 100%; max-height: 120px; object-fit: cover; border-radius: 6px; margin-bottom: 6px; }
.walk-pop .btn { display: inline-block; margin-top: 8px; color: var(--accent-text); }
.walks-back { display: flex; flex-direction: column; gap: 2px; padding: 4px 16px 8px; }
.walks-back .btn { align-self: flex-start; }
/* "Near me": the distance slider, and its circle on the map */
.walks-radius { padding: 8px 16px 4px; border-bottom: 1px solid var(--line); }
.walks-radius label { display: block; margin: 0 0 2px; color: var(--text); }
.walks-radius input[type="range"] { width: 100%; }
.walks-radius p { margin: 2px 0 0; }
.walks-radius p:empty { display: none; }
path.walks-radius-circle { stroke: var(--accent); }

/* Undo / redo (editor-history.js) */
.ed-topbar .icon-btn { width: 34px; padding: 4px 0; font-size: 1.1rem; }
.ed-topbar .icon-btn:disabled { opacity: 0.35; }

/* Duplicate, copy and paste settings (editor-copy.js) */
.z-actions { gap: 6px; flex-wrap: wrap; margin: 4px 0 6px; }
.paste-dlg { width: min(460px, calc(100vw - 24px)); border: none; border-radius: 14px; padding: 16px 18px; background: var(--panel); color: var(--text); box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35); }
.paste-dlg::backdrop { background: rgba(0, 0, 0, 0.45); }
.paste-dlg label.check { margin: 0.35em 0; }

/* Stem sets (stems.js): the Project panel's list, the sound object's "Plays", Listen mode's faders */
.stemset { border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; margin: 6px 0; }
.stemset .row { gap: 6px 10px; flex-wrap: wrap; align-items: center; margin: 3px 0; }
.stemset label { display: inline-flex; gap: 4px; align-items: center; margin: 0; font-size: 0.85rem; white-space: nowrap; }
.stemset input[type="text"] { flex: 1; min-width: 7em; width: auto; }
.stemset input[type="number"] { width: 4.5em; padding: 2px 4px; margin: 0; }
.stemset select { width: auto; }
.stem-list { list-style: none; padding: 0; margin: 4px 0; }
.stem-list li { display: flex; gap: 4px; align-items: center; margin: 3px 0; }
.stem-list li input[type="text"] { width: 6.5em; flex: none; }
.stem-list li select { flex: 1; min-width: 0; }
#zone-panel.is-stem .not-stem { display: none !important; }
.listen-stems { display: flex; flex-direction: column; gap: 6px; margin: 4px 0; }
.stem-faders { display: flex; gap: 6px; align-items: flex-end; flex-wrap: wrap; }
.stem-fader { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 44px; }
.stem-track { position: relative; width: 10px; height: 44px; border-radius: 5px; background: var(--line); overflow: hidden; }
.stem-track i { position: absolute; left: 0; right: 0; bottom: 0; background: var(--ok, #2f9e44); transition: height 0.3s; }
.stem-name { font-size: 0.7rem; max-width: 44px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }


/* Cue sounds (entry / exit) in the sound object panel */
.cue-row { display: flex; align-items: center; gap: 8px; margin-top: 0.4em; }
.cue-row label { margin: 0; min-width: 4.5em; }
.cue-row select { flex: 1; min-width: 0; }
.cue-opts { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 0.2em 0 0 0.5em; }
.cue-opts label { display: inline-flex; align-items: center; gap: 4px; margin: 0; }
.cue-opts input[type="range"] { width: 90px; }
.cue-opts input[type="number"] { width: 4.5em; padding: 2px 4px; margin: 0; }
.cue-opts select { width: auto; padding: 2px 4px; margin: 0; }
.cue-opts label { flex-wrap: wrap; }

/* Saving (editor-save.js): Save, Save as…, Revert and the status beside them */
.save-status { font-size: 0.8rem; color: var(--muted); white-space: nowrap; }
.save-status.unsaved { color: #b25e00; font-weight: 600; }

/* Access codes, QR code and statistics (editor-access.js) */
.acc-make { gap: 6px; flex-wrap: wrap; align-items: center; }
.acc-make input[type="number"], .acc-make input[type="date"] { padding: 2px 4px; margin: 0; }
.acc-table-wrap { max-height: 260px; overflow: auto; border: 1px solid var(--line); border-radius: var(--r-input); }
.acc-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
.acc-table th, .acc-table td { text-align: left; padding: 3px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.acc-table th { position: sticky; top: 0; background: var(--panel); color: var(--muted); font-weight: 600; }
.acc-actions { text-align: right; }
.acc-actions button { padding: 1px 6px; margin-left: 2px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: 0.04em; }
.qr-img { width: 104px; height: 104px; background: #fff; padding: 4px; border-radius: var(--r-input); flex: none; }
.st-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 0.6em 0; }
.st-tile { border: 1px solid var(--line); border-radius: var(--r-input); padding: 6px; text-align: center; }
.st-num { font-size: 1.25rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.st-label { font-size: 0.72rem; color: var(--muted); }
.st-chart { position: relative; }
.st-chart svg { display: block; width: 100%; height: auto; }
.st-legend { display: flex; gap: 12px; font-size: 0.75rem; color: var(--muted); margin-bottom: 2px; }
.st-legend i, .st-tip i { display: inline-block; width: 10px; height: 3px; border-radius: 2px; margin-right: 5px; vertical-align: middle; }
.st-grid { stroke: var(--line); stroke-width: 1; }
.st-axis { fill: var(--muted); font-size: 10px; }
.st-cross { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.st-tip { position: absolute; top: 18px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-input); padding: 5px 8px; font-size: 0.75rem; box-shadow: var(--shadow); pointer-events: none; min-width: 110px; }
.st-tip div { display: flex; align-items: center; gap: 2px; }
.st-tip b { margin-left: auto; padding-left: 10px; font-variant-numeric: tabular-nums; }
.st-chart svg .hidden { display: none; }

/* The traveller's page: the code screen, and the coordinates at the bottom edge of the map */
.lock-form { margin-top: 0.8em; }
.lock-form label { display: block; font-weight: 600; margin-bottom: 4px; }
.lock-form input { text-transform: uppercase; letter-spacing: 0.08em; }
.gps-widget {
  position: absolute; left: 50%; transform: translateX(-50%); z-index: 590; bottom: 40vh;
  display: flex; align-items: center; gap: 2px; max-width: calc(100% - 20px);
  background: color-mix(in srgb, var(--panel) 92%, transparent); border: 1px solid var(--line);
  border-radius: 99px; box-shadow: var(--shadow); padding: 2px 4px 2px 10px;
}
.gps-copy { border: 0; background: none; padding: 3px 4px; font-size: 0.78rem; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.gps-copy .muted { margin-left: 6px; }
.gps-x { border: 0; background: none; padding: 2px 6px; color: var(--muted); font-size: 0.8rem; }
.gps-widget.stale .gps-copy { color: var(--muted); }
/* The fade perimeter's handle (editor.js bandHandles): a diamond on the dashed inner line */
.band-handle { background: none; border: 0; cursor: move; }
.band-handle::after { content: ''; position: absolute; inset: 2px; background: #fff; border: 2px solid #222; border-radius: 2px; transform: rotate(45deg); }

/* Discovery (player.js): the list in the top margin, the pop-up, and the look of the areas */
.disc-widget { position: absolute; z-index: 615; left: 12px; top: calc(max(10px, env(safe-area-inset-top)) + 92px); max-width: min(300px, calc(100% - 80px)); }
#disc-btn { background: var(--panel); box-shadow: var(--shadow); border-radius: 10px; padding: 5px 10px; font-size: 0.85rem; white-space: nowrap; }
.disc-list { list-style: none; margin: 6px 0 0; padding: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); max-height: 50vh; overflow-y: auto; min-width: 220px; }
.disc-list li { margin: 0; }
.disc-list button, .disc-list .disc-unknown { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 8px; border: 0; background: none; color: var(--text); font-size: 0.88rem; text-align: left; border-radius: 6px; }
.disc-list button:hover { background: var(--bg); }
.disc-list .disc-unknown { color: var(--muted); font-style: italic; }
.disc-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; border: 1px dashed var(--muted); }
.disc-list button .disc-dot { border: 0; }
.disc-ok { margin-left: auto; color: #f5b301; text-shadow: 0 0 4px rgba(245, 179, 1, 0.5); }
.disc-toast {
  position: absolute; z-index: 1250; left: 50%; top: calc(max(10px, env(safe-area-inset-top)) + 130px);
  transform: translateX(-50%); display: flex; align-items: center; gap: 10px; pointer-events: none;
  background: var(--panel); color: var(--text); border: 1px solid var(--accent); border-radius: 99px;
  padding: 8px 18px 8px 10px; box-shadow: var(--shadow); font-weight: 600; width: max-content; max-width: calc(100vw - 32px); opacity: 0;
}
.disc-toast.show { animation: disc-toast 2.85s ease-in-out forwards; }
.disc-toast.show .disc-star { animation: disc-star 1.2s ease-out; }
.disc-star { color: #f5b301; font-size: 1.5rem; line-height: 1; display: inline-block; text-shadow: 0 0 8px rgba(245, 179, 1, 0.6); }
@keyframes disc-toast { 0% { opacity: 0; transform: translate(-50%, -8px); } 14% { opacity: 1; transform: translate(-50%, 0); } 84% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; transform: translate(-50%, -6px); } }
@keyframes disc-star { 0% { transform: scale(0.2) rotate(-180deg); } 60% { transform: scale(1.35) rotate(15deg); } 100% { transform: scale(1) rotate(0); } }
.disc-check { width: 24px; height: 24px; color: #f5b301; font-size: 22px; line-height: 1; display: flex; align-items: center; justify-content: center; text-shadow: 0 0 6px rgba(245, 179, 1, 0.7), 0 0 2px rgba(0, 0, 0, 0.6); }
path.zone-playing { animation: zone-playing 1.6s ease-in-out infinite; }
@keyframes zone-playing { 50% { fill-opacity: 0.5; stroke-width: 4; } }
.player.overview .disc-widget { display: none !important; }
@media (prefers-reduced-motion: reduce) { .disc-toast.show, .disc-toast.show .disc-star, path.zone-playing { animation: none; } .disc-toast.show { opacity: 1; } }

/* The sound walks drawer (player-walks.js): level 1 (the walks) and level 2 (one walk) */
.walks-scrim { position: absolute; inset: 0; z-index: 1290; background: rgba(0, 0, 0, 0.45); animation: scrim-in 0.2s ease-out; }
@keyframes scrim-in { from { opacity: 0; } }
.wp-level { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.walks-sort { display: flex; align-items: center; gap: 6px; padding: 4px 16px 8px; }
.walks-sort button { border-radius: 99px; padding: 4px 12px; font-size: 0.85rem; background: none; border: 1px solid var(--line); color: var(--muted); }
.walks-sort button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
.walks-group { padding: 10px 8px 2px; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 700; }
.walk-go { margin-left: auto; color: var(--muted); font-size: 1.4rem; line-height: 1; padding-left: 6px; }
.walks-foot { padding: 8px 16px 12px; border-top: 1px solid var(--line); }
.walks-foot a { color: var(--accent); text-decoration: none; font-weight: 600; }
.wp-back { background: none; border: 0; padding: 6px 4px; color: var(--accent); font-weight: 600; }
.wp-scroll { flex: 1; overflow-y: auto; padding: 0 16px 12px; min-height: 0; }
.wp-img { display: block; width: calc(100% + 32px); margin: 0 -16px 12px; max-height: 38vh; object-fit: cover; }
.wp-scroll h2 { margin: 0 0 2px; font-size: 1.3rem; }
.wp-scroll p { margin: 0.3em 0; }
.wp-scroll p:empty { display: none; }
.wp-caption { font-style: italic; white-space: pre-line; }
.wp-desc { white-space: pre-line; line-height: 1.5; margin-top: 0.6em; }
.wp-actions { display: flex; gap: 8px; padding: 10px 16px; padding-bottom: max(10px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--panel); }
.wp-actions .primary { flex: 1; justify-content: center; }
path.walk-outline { cursor: pointer; }

/* The editor's Inbox (editor-inbox.js) */
.ib-filters { gap: 8px; flex-wrap: wrap; margin: 0.6em 0 1em; }
.ib-filters select { width: auto; }
.ib-list { display: flex; flex-direction: column; gap: 10px; }
.ib-list .card.ib-item { display: block; padding: 10px 12px; margin: 0; }
.ib-item.ib-new { border-left: 3px solid var(--accent); }
.ib-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ib-head .pill { margin-left: 4px; }
.ib-del { margin-left: auto; }
.ib-stars { color: #f5b301; letter-spacing: 1px; }
.ib-off { color: var(--line); }
.ib-text { white-space: pre-line; margin: 0.5em 0; }
.ib-show { gap: 8px; align-items: center; margin-top: 4px; }
.ib-show .seg button { padding: 3px 10px; font-size: 0.82rem; }

/* Ratings, reviews, feedback and sharing on the traveller's page (player-social.js) */
.rate-btn {
  position: absolute; left: 12px; bottom: 40vh; z-index: 595; border-radius: 99px; padding: 5px 12px;
  background: color-mix(in srgb, var(--panel) 92%, transparent); border: 1px solid var(--line);
  box-shadow: var(--shadow); font-size: 0.85rem; color: var(--text); white-space: nowrap;
}
.rate-btn::first-letter { color: #f5b301; }
@media (max-width: 560px) {
  /* Narrow: the coordinates move to the right so the Rate button keeps the left */
  .gps-widget { left: auto; right: 10px; transform: none; max-width: calc(100% - 170px); }
}
.rate-offer {
  position: absolute; left: 50%; transform: translateX(-50%); z-index: 1240; top: calc(max(10px, env(safe-area-inset-top)) + 130px);
  display: flex; align-items: center; gap: 10px; background: var(--panel); border: 1px solid var(--accent);
  border-radius: 99px; padding: 6px 6px 6px 16px; box-shadow: var(--shadow); width: max-content; max-width: calc(100vw - 32px);
  animation: rate-offer-in 0.4s ease-out;
}
.rate-offer { top: calc(max(10px, env(safe-area-inset-top)) + 190px); } /* below the discovery pop-up */
.wp-actions .primary { white-space: nowrap; padding-inline: 10px; }
.rate-offer .icon { border: 0; background: none; color: var(--muted); padding: 4px 8px; }
@keyframes rate-offer-in { from { opacity: 0; transform: translate(-50%, -8px); } to { opacity: 1; transform: translate(-50%, 0); } }
.dlg { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(0, 0, 0, 0.45); }
.dlg-card {
  position: relative; width: min(440px, 100%); max-height: calc(100vh - 32px); overflow-y: auto;
  background: var(--panel); color: var(--text); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 18px 16px;
  display: flex; flex-direction: column; gap: 6px;
}
.dlg-card h2 { margin: 0 2em 0 0; font-size: 1.15rem; }
.dlg-card textarea, .dlg-card input { width: 100%; box-sizing: border-box; }
.dlg-card label { margin-top: 6px; font-weight: 600; }
.dlg-card p { margin: 2px 0; }
.dlg-x { position: absolute; top: 8px; right: 8px; border: 0; background: none; color: var(--muted); font-size: 1.1rem; padding: 4px 8px; }
.dlg-count { text-align: right; }
.stars-pick { display: flex; gap: 4px; margin-top: 6px; }
.stars-pick button { border: 0; background: none; font-size: 2.2rem; line-height: 1; padding: 0 2px; color: var(--line); cursor: pointer; transition: transform 0.1s; }
.stars-pick button.on { color: #f5b301; }
.stars-pick button:hover { transform: scale(1.12); }
.reviews-sum { font-size: 1rem; }
.reviews-sum .ib-stars { font-size: 1.2rem; }
.reviews-list { list-style: none; margin: 4px 0 8px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.reviews-list li { border-top: 1px solid var(--line); padding-top: 8px; }
.reviews-list .rv-head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.reviews-list .rv-text { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.share-link { display: flex; gap: 6px; }
.share-link input { flex: 1; min-width: 0; }
.share-ways { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.share-ways .btn, .share-ways button { flex: 1; text-align: center; text-decoration: none; }
.share-qr { width: 180px; height: 180px; align-self: center; background: #fff; padding: 8px; border-radius: 6px; }
.wp-rating { border: 0; background: none; padding: 2px 0; color: var(--text); text-align: left; font-size: 0.92rem; cursor: pointer; }
.wp-rating .ib-stars { margin-right: 4px; }
.wp-rating u { color: var(--accent); text-decoration: none; margin-left: 6px; }
.wp-you { margin-top: 14px; }
.wp-you label { display: block; margin-bottom: 3px; }
.wp-you input { width: 100%; box-sizing: border-box; }
.linkish { border: 0; background: none; color: var(--accent); padding: 6px 0; text-align: left; cursor: pointer; }
.wp-icon { display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 52px; padding: 4px 6px; font-size: 0.7rem; border-radius: var(--r-btn); }
.wp-icon span { font-size: 1.05rem; line-height: 1.1; }
.walk-stars { color: #f5b301; }
/* A focus area's badge on the editor's map (editor.js renderFocusLayer) */
.focus-badge { display: flex; align-items: center; justify-content: center; font-size: 15px; line-height: 1; color: #fff; background: rgba(20, 20, 24, 0.85); border-radius: 50%; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5); pointer-events: none; }

/* The listening log (editor-log.js) */
.lg-table td { vertical-align: top; }
.lg-sounds summary { cursor: pointer; }
.lg-sounds[open] { max-width: 28em; }

/* Live: travellers now, and replay (editor-live.js; administrator) */
.live-badge { background: var(--ok); }
.live-view { display: flex; flex-direction: column; height: calc(100vh - 54px); height: calc(100dvh - 54px); }
.live-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--panel); }
.live-replay { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.live-replay input[type="range"] { width: min(360px, 40vw); }
.lv-clock { font-variant-numeric: tabular-nums; min-width: 6.5em; }
.live-body { flex: 1; display: grid; grid-template-columns: 1fr minmax(260px, 340px); min-height: 0; }
.live-map { min-height: 300px; }
.live-panel { border-left: 1px solid var(--line); background: var(--panel); overflow-y: auto; padding: 10px; }
.lv-tiles { grid-template-columns: repeat(3, 1fr); margin-top: 0; }
.lv-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.lv-card { border: 1px solid var(--line); border-radius: var(--r-input); padding: 8px 10px; cursor: pointer; }
.lv-card.on { border-color: var(--accent); }
.lv-card.dim { opacity: 0.55; }
.lv-head { display: flex; align-items: center; gap: 6px; }
.lv-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.lv-now { margin-top: 4px; }
.lv-heard summary { cursor: pointer; color: var(--muted); }
.lv-tip { font-weight: 600; font-size: 0.8rem; padding: 1px 6px; }
.lv-walk-label { font-size: 0.75rem; color: #333; font-weight: 600; white-space: nowrap; text-shadow: 0 0 3px #fff, 0 0 3px #fff; pointer-events: none; }
@media (max-width: 800px) {
  .live-body { grid-template-columns: 1fr; grid-template-rows: 55vh auto; }
  .live-panel { border-left: 0; border-top: 1px solid var(--line); }
}
.live-notice { border-left: 3px solid var(--line); padding-left: 8px; }
/* Overview tab: the title image's preview */
.cover-preview { display: block; width: 100%; max-height: 180px; object-fit: cover; border-radius: var(--r-input); border: 1px solid var(--line); margin-top: 6px; }
/* "☰ Go to ▾" in the editor's top bar (editor-nav.js) */
.ed-menu-wrap { position: relative; }
.ed-menu { position: absolute; top: calc(100% + 4px); left: 0; z-index: 1200; min-width: 260px; max-height: 70vh; overflow-y: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 4px; display: flex; flex-direction: column; }
.ed-menu button { border: 0; background: none; text-align: left; padding: 7px 10px; border-radius: var(--r-btn); color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ed-menu button:hover, .ed-menu button:focus-visible { background: color-mix(in srgb, var(--accent) 16%, var(--panel)); }
.ed-menu-head { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); padding: 8px 10px 3px; }
.ed-menu-note { padding: 4px 10px 8px; display: block; }
/* Satellite imagery (maplayers.js): its opacity slider and the Mapbox logo */
.sat-slider { background: var(--panel); padding: 4px 8px; border-radius: 8px; }
.sat-slider label { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 0.9rem; }
.sat-slider input { width: 110px; }
.mapbox-logo { display: inline-flex; align-items: center; height: 20px; padding: 0 4px; font: 700 12px/1 system-ui, sans-serif; color: #fff; text-shadow: 0 0 2px #000, 0 0 3px #000; text-decoration: none; }
.mapbox-logo img { height: 20px; display: block; }
.sat-opacity { display: flex; align-items: center; gap: 6px; margin: 2px 0 0 1.6em; }
.sat-opacity input { flex: 1; min-width: 0; }
.space-badge { font-size: 13px; background: rgba(20, 20, 24, 0.7); }
/* Schedule rows (editor.js renderSchedule) */
.sched-box { margin: 0 0 0.3em 1em; font-size: 0.85rem; }
.sched-box input, .sched-box select { width: auto; }
/* Terms for creators (dialog in the editor, and the /terms page) */
.terms-points { margin: 0.3em 0 0.5em 1.1em; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.upload-rights { margin: 0.4em 0 0; }
.terms h2 { font-size: 1.05rem; margin-top: 1.4em; }
.terms li { margin: 0.2em 0; }
/* A stem area's tick boxes (editor.js renderZoneStem) */
.stem-pick { margin: 0.3em 0 0; }
.stem-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.stem-table th { font-weight: 600; color: var(--muted); text-align: center; padding: 2px 4px; font-size: 0.75rem; }
.stem-table th:first-child, .stem-table td:first-child { text-align: left; }
.stem-table td { padding: 2px 4px; border-top: 1px solid var(--line); text-align: center; }
.stem-table input { margin: 0; }
/* The traveller's bottom panel can be folded to one bar (player.js syncSheetBar) */
.sheet-bar { position: relative; display: flex; align-items: center; gap: 8px; margin: -10px -16px 4px; padding: 10px 16px 4px; min-height: 30px; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
.sheet-grip { position: absolute; left: 50%; top: 6px; width: 40px; height: 5px; margin-left: -20px; border-radius: 3px; background: var(--line); pointer-events: none; }
.sheet.dragging { transition: none !important; }
.sheet.settling { transition: transform 0.2s ease-out; }
.sheet-toggle { border: 0; background: none; color: var(--muted); padding: 2px 4px; font-size: 0.85rem; }
.sheet-bar #sheet-mini { margin-left: auto; }
.sheet.folded > :not(.sheet-bar):not(#error) { display: none !important; }
.sheet.folded { padding-top: 8px; padding-bottom: max(8px, env(safe-area-inset-bottom)); }
.sheet.folded .sheet-bar { margin: -8px -16px 0; padding-top: 12px; }
.sheet #error:empty { display: none; }

/* The welcome page (index.html), from the "Waypoint-Signal Welcome" design: a field notebook
   at night. Ink #ece6d6 on #18191d, a signal orange, a condensed wordmark, typewriter text and
   hand-lettered labels in the drawing. The same in every colour scheme. Fonts: /fonts. */
@font-face { font-family: 'Big Shoulders Display'; font-weight: 800; font-display: swap; src: url('/fonts/big-shoulders-display-latin-800-normal.woff2') format('woff2'); }
@font-face { font-family: 'Special Elite'; font-weight: 400; font-display: swap; src: url('/fonts/special-elite-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Architects Daughter'; font-weight: 400; font-display: swap; src: url('/fonts/architects-daughter-latin-400-normal.woff2') format('woff2'); }
.ws-body { --ws-bg: #18191d; --ws-panel: #26272c; --ws-ink: #ece6d6; --ws-soft: #b8b3a8; --ws-muted: #a9a49a; --ws-signal: #e8590c; --ws-button: #c2410c;
  margin: 0; min-height: 100vh; min-height: 100dvh; background: var(--ws-bg); color: var(--ws-ink); font-family: 'Special Elite', 'Courier New', Courier, monospace; }
.wp { max-width: 480px; min-height: 100vh; min-height: 100dvh; margin: 0 auto; display: flex; flex-direction: column; }
.ws-strip { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: max(14px, env(safe-area-inset-top)) 24px 0; font-size: 12px; letter-spacing: 0.12em; color: var(--ws-muted); }
.ws-strip-on { display: flex; align-items: center; gap: 8px; }
.ws-strip-on i { width: 8px; height: 8px; border-radius: 50%; background: var(--ws-signal); animation: ws-blink 1.6s ease-in-out infinite; }
@keyframes ws-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }
.ws-art { flex: 1 1 auto; display: flex; align-items: center; justify-content: center; min-height: 0; padding-top: 6px; }
.ws-art-svg { display: block; width: 100%; height: auto; max-height: 56vh; overflow: visible; }
.ws-sheet { background: var(--ws-panel); border-radius: 24px 24px 0 0; padding: 24px 24px max(22px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 14px; }
.ws-welcome { margin: 0; font-size: 13px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ws-muted); }
.ws-name { margin: -6px 0 0; font-family: 'Big Shoulders Display', 'Arial Narrow', sans-serif; font-size: clamp(42px, 13vw, 56px); line-height: 0.95; font-weight: 800; letter-spacing: 0.01em; text-transform: uppercase; color: var(--ws-ink); }
.ws-name span { color: var(--ws-signal); }
.ws-tag { margin: 0 0 4px; font-size: 16px; line-height: 1.5; color: var(--ws-soft); }
.ws-actions { display: flex; flex-direction: column; gap: 12px; }
.ws-begin, .ws-dashed { display: flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; box-sizing: border-box; border-radius: 6px; cursor: pointer; }
.ws-begin { min-height: 52px; border: 2px solid var(--ws-ink); background: var(--ws-button); color: #fff; box-shadow: 4px 4px 0 var(--ws-ink); font-family: 'Big Shoulders Display', 'Arial Narrow', sans-serif; font-size: 22px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; margin-right: 4px; transition: transform 0.08s, box-shadow 0.08s; }
.ws-begin:hover { color: #fff; background: #d14d12; }
.ws-begin:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ws-ink); }
.ws-dashed { min-height: 48px; border: 1.5px dashed #8f8a80; background: transparent; color: var(--ws-ink); font-family: 'Special Elite', 'Courier New', monospace; font-size: 15px; letter-spacing: 0.06em; padding: 0 12px; }
.ws-dashed:hover { color: var(--ws-ink); border-color: var(--ws-ink); background: rgba(236, 230, 214, 0.04); }
.ws-begin:focus-visible, .ws-dashed:focus-visible { outline: 2px solid var(--ws-signal); outline-offset: 3px; }
.ws-how { display: flex; flex-direction: column; gap: 14px; padding-top: 4px; }
.ws-how[hidden] { display: none; }
.ws-about p { margin: 0 0 0.8em; font-size: 1.0625rem; line-height: 1.65; color: var(--ws-soft); }
.ws-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ws-steps li { display: flex; gap: 14px; align-items: flex-start; border: 1.5px dashed #5c5952; border-radius: 6px; padding: 12px 14px; }
.ws-steps strong { display: block; margin-bottom: 3px; font-family: 'Big Shoulders Display', 'Arial Narrow', sans-serif; font-weight: 800; font-size: 19px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ws-ink); }
.ws-steps span:not(.ws-step-n) { color: var(--ws-soft); font-size: 0.9688rem; line-height: 1.5; }
.ws-step-n { flex: none; width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid var(--ws-signal); color: var(--ws-signal); display: flex; align-items: center; justify-content: center; font-family: 'Architects Daughter', cursive; font-size: 16px; }
.ws-notes { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 12px; font-size: 12px; color: var(--ws-muted); }
.ws-notes span { display: flex; align-items: center; gap: 8px; }
.ws-small { margin: -4px 0 0; font-size: 0.8125rem; color: var(--ws-muted); }
.ws-link { color: var(--ws-ink); text-decoration: underline; text-underline-offset: 3px; }
.ws-link:hover { color: var(--ws-signal); }
@media (min-width: 481px) { .ws-sheet { border-radius: 24px; margin-bottom: 24px; } }
@media (prefers-reduced-motion: reduce) { .ws-strip-on i { animation: none; } .ws-begin { transition: none; } }

/* LIVE (editor): like a studio's "on air" light. Unlit for a walk that isn't published; lit
   red, glowing, while travellers can find and play it; amber while it's published but kept
   from travellers (hidden by the administrator, or the owner's account locked). */
.live-btn { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px 5px 10px; border-radius: 6px; border: 2px solid #55534f; background: #2a2a28; color: #8a8782; font-weight: 800; letter-spacing: 0.16em; font-size: 0.85rem; line-height: 1; cursor: pointer; text-transform: uppercase; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05); transition: background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s; flex: none; }
.live-btn:hover { border-color: #8a8782; color: #b9b5ae; }
.live-lamp { width: 10px; height: 10px; border-radius: 50%; background: #4a4845; box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.6); flex: none; transition: background 0.2s, box-shadow 0.2s; }
.live-btn.lit { background: #d62a20; border-color: #ff6a5c; color: #fff; text-shadow: 0 0 6px rgba(255, 255, 255, 0.75), 0 0 14px rgba(255, 120, 100, 0.8); box-shadow: 0 0 0 3px rgba(214, 42, 32, 0.25), 0 0 18px rgba(255, 60, 40, 0.55); }
.live-btn.lit:hover { background: #e33328; color: #fff; }
.live-btn.lit .live-lamp { background: #fff; box-shadow: 0 0 6px 2px rgba(255, 255, 255, 0.9), 0 0 14px 4px rgba(255, 90, 70, 0.8); animation: live-pulse 1.8s ease-in-out infinite; }
@keyframes live-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }
.live-btn.blocked { background: #3a2c12; border-color: #d99a1c; color: #f2c66b; }
.live-btn.blocked .live-lamp { background: #f2b230; box-shadow: 0 0 6px 1px rgba(242, 178, 48, 0.7); }
.live-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.live-big { font-size: 1.35rem; padding: 12px 22px 12px 18px; gap: 12px; border-width: 3px; border-radius: 10px; }
.live-big .live-lamp { width: 16px; height: 16px; }
.live-small { font-size: 0.75rem; padding: 4px 9px 4px 8px; gap: 6px; }
.live-small .live-lamp { width: 8px; height: 8px; }
.live-box { display: flex; align-items: center; gap: 14px; margin: 0.2em 0 1em; }
.live-box p { margin: 0; flex: 1; min-width: 0; }
@media (prefers-reduced-motion: reduce) { .live-btn.lit .live-lamp { animation: none; } }

/* Several objects selected (editor-select.js): dashed white outlines, the box, and the bar */
.sel-outline.over { filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.5)); }
.map.box-select, .map.box-select .leaflet-interactive { cursor: crosshair !important; }
.sel-bar {
  position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 960;
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: center;
  background: var(--panel); border: 2px solid var(--accent); border-radius: 10px; box-shadow: var(--shadow);
  padding: 6px 8px; max-width: calc(100% - 24px);
}
.sel-what { font-weight: 600; font-size: 0.9rem; padding: 0 4px; white-space: nowrap; }
/* Toasts and hints go above the bar while it shows. */
.sel-bar:not(.hidden) ~ .drop-toast, .sel-bar:not(.hidden) ~ .map-hint { bottom: 104px; }
.sel-bar button { padding: 0.35em 0.7em; }
#tool-select[aria-pressed="true"] { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }

/* Home / About / Everything near me, under the list of walks and the map of all walks */
.walks-nav { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 10px 16px 14px; border-top: 1px solid var(--line); margin-top: 6px; }
.walks-nav a { color: var(--accent); text-decoration: none; font-weight: 600; font-size: 0.92rem; }
.walks-nav a:hover { text-decoration: underline; }
#overview-sheet .walks-nav { padding: 8px 0 0; margin-top: 8px; }
/* Everything near me (/nearby): no offline download, no rating (the walks change as you go) */
.player.nearby-mode #offline-row, .player.nearby-mode #rate-btn, .player.nearby-mode #rate-offer { display: none !important; }

/* About (about.html): the welcome page's look, as a readable page */
.about { padding: 0 0 max(28px, env(safe-area-inset-bottom)); }
.about-strip a { color: var(--ws-muted); letter-spacing: 0.06em; text-decoration: none; }
.about-strip a:hover { color: var(--ws-ink); }
.about-head { padding: 26px 24px 8px; display: flex; flex-direction: column; gap: 10px; }
.about-body { padding: 4px 24px 8px; font-size: 1.0625rem; line-height: 1.7; color: var(--ws-soft); }
.about-body h2 { margin: 1.5em 0 0.4em; font-family: 'Big Shoulders Display', 'Arial Narrow', sans-serif; font-weight: 800; font-size: 1.625rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ws-ink); }
.about-body p { margin: 0 0 0.9em; }
.about-body strong { color: var(--ws-ink); }
.about-body ul { margin: 0 0 1em; padding-left: 1.2em; }
.about-body li { margin: 0 0 0.65em; }
.about-body li::marker { color: var(--ws-signal); }
.about-lead { font-size: 1.1875rem; color: var(--ws-ink); }
.about-small { font-size: 0.875rem; color: var(--ws-muted); }
.about-go { padding: 10px 24px 0; }

/* Fade curves: a small picture of each curve beside its menu (editor.js curvePic) */
.curve-row { flex-wrap: wrap; gap: 6px; align-items: center; }
.curve-pic { display: inline-flex; }
.curve-pic svg { display: block; overflow: visible; }
.curve-pic path { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.curve-pic path.axis { stroke: var(--line); stroke-width: 1; }
.about-version { margin: 18px 24px 0; font-size: 12px; letter-spacing: 0.08em; color: var(--ws-muted); }
/* The version at the foot of the editor's Go to menu and My account */
.ed-menu-version, .acct-version { font-size: 0.75rem; color: var(--muted); padding: 6px 12px 4px; }
.sat-trouble { position: absolute; left: 50%; top: 70px; transform: translateX(-50%); z-index: 1300; max-width: min(420px, calc(100% - 24px)); background: var(--panel); color: var(--danger); border: 1px solid var(--danger); border-radius: 10px; box-shadow: var(--shadow); padding: 8px 12px; font-size: 0.88rem; }

/* ---- The traveller's map layout (walk.html): the top margin, the right edge, the bottom margin.
   --sheet-h (player.js) is the bottom drawer's height, so what sits "at the bottom" sits above it. */
.player { --top-h: calc(max(10px, env(safe-area-inset-top)) + 54px); }
/* Top: ☰ · title · map status */
.player .topbar { align-items: center; }
.player .topbar .title { min-width: 0; }
.player .topbar .state-widget { position: relative; left: auto; top: auto; z-index: auto; flex: 0 1 auto; max-width: 46%; }
.player .topbar #state-btn { height: 40px; display: flex; align-items: center; }
.player .topbar .state-card { position: absolute; right: 0; top: calc(100% + 6px); width: min(330px, calc(100vw - 24px)); margin: 0; z-index: 1250; }
/* The compass band: centred, just below the top margin (clear of the right edge's buttons on a phone) */
.player .compass-bar:not(.in-editor) { top: var(--top-h); }
@media (max-width: 600px) {
  .player .compass-bar:not(.in-editor) { left: 12px; right: 64px; width: auto; transform: none; }
}
/* Right edge, top to bottom */
.rail { position: absolute; right: 10px; top: var(--top-h); z-index: 640; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; pointer-events: none; }
.rail > * { pointer-events: auto; margin: 0 !important; }
.rail-btn { width: 44px; height: 44px; padding: 0; border-radius: 50%; background: var(--panel); border: 1px solid var(--line); box-shadow: 0 1px 5px rgba(0, 0, 0, 0.25); display: flex; align-items: center; justify-content: center; font-size: 1.1rem; }
.rail-btn.hidden { display: none; }
.rail-btn[aria-pressed="true"], .rail-btn.active { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.rail .leaflet-control { clear: none; float: none; }
.rail .leaflet-control-layers { border-radius: 22px; }
.rail .leaflet-control-layers-toggle { width: 44px; height: 44px; background-size: 22px; }
.player.overview .rail { display: none; }
/* GPS details: a small card beside its 📍 button */
.player .gps-widget { left: auto; right: 64px; bottom: auto; transform: none; max-width: calc(100% - 140px); }
/* Popups: below the top margin, clear of the right edge */
.player .popup-stack { top: var(--top-h); right: 64px; width: min(380px, calc(100% - 86px)); }
/* Bottom margin, just above the drawer: Rate this walk (left), Discovery (right); the map's
   credits and the Mapbox logo also stay above the drawer */
.player .leaflet-bottom.leaflet-right { bottom: var(--sheet-h, 0px); }
.player .leaflet-bottom.leaflet-left { bottom: calc(var(--sheet-h, 0px) + var(--credits-h, 0px)); }
.player .leaflet-control-attribution { font-size: 10px; line-height: 1.35; }
.player .rate-btn { bottom: calc(var(--sheet-h, 0px) + var(--credits-h, 18px) + var(--logo-h, 0px) + 8px) !important; top: auto; }
.player .disc-widget { left: auto; right: 10px; top: auto; bottom: calc(var(--sheet-h, 0px) + var(--credits-h, 18px) + var(--logo-h, 0px) + 8px); display: flex; flex-direction: column-reverse; align-items: flex-end; max-width: min(300px, calc(100% - 170px)); }
.player .disc-widget.hidden { display: none; }
.player .disc-list { margin: 0 0 6px; max-height: 45vh; }
.player .disc-toast { top: var(--top-h); }

/* The drawer's levels (player-walks.js slideTo): side by side; choosing slides left, ← slides right */
.walks-panel { overflow: hidden; }
/* Slick: the level going away drifts left, a little smaller and dimmer (it seems to sink
   back), while the next slides in from the right over it, casting a soft shadow. */
.walks-panel { --slide-ease: cubic-bezier(0.22, 0.8, 0.2, 1); --slide-time: 0.46s; }
.walks-panel .wp-level { position: absolute; inset: env(safe-area-inset-top) 0 0 0; background: var(--panel); z-index: 2; box-shadow: -14px 0 28px rgba(0, 0, 0, 0.18); transition: transform var(--slide-time) var(--slide-ease), opacity var(--slide-time) var(--slide-ease), filter var(--slide-time) var(--slide-ease), visibility 0s linear 0s; }
.walks-panel .wp-level.off-left { transform: translateX(-32%) scale(0.95); opacity: 0; filter: brightness(0.7); visibility: hidden; z-index: 1; box-shadow: none; transition: transform var(--slide-time) var(--slide-ease), opacity var(--slide-time) ease, filter var(--slide-time) var(--slide-ease), visibility 0s linear var(--slide-time); }
.walks-panel .wp-level.off-right { transform: translateX(104%); visibility: hidden; z-index: 3; transition: transform var(--slide-time) var(--slide-ease), visibility 0s linear var(--slide-time); }
/* The contents of the level coming in follow it, one after another. */
.wp-level.entering .wp-menu-item, .wp-level.entering .walks-list > li, .wp-level.entering .wp-scroll > *, .wp-level.entering .wp-actions { animation: wp-rise 0.5s var(--slide-ease) both; }
.wp-level.entering .wp-menu-item:nth-child(2), .wp-level.entering .walks-list > li:nth-child(2), .wp-level.entering .wp-scroll > :nth-child(2) { animation-delay: 0.05s; }
.wp-level.entering .wp-menu-item:nth-child(3), .wp-level.entering .walks-list > li:nth-child(3), .wp-level.entering .wp-scroll > :nth-child(3) { animation-delay: 0.1s; }
.wp-level.entering .wp-menu-item:nth-child(4), .wp-level.entering .walks-list > li:nth-child(4), .wp-level.entering .wp-scroll > :nth-child(4) { animation-delay: 0.15s; }
.wp-level.entering .wp-menu-item:nth-child(n+5), .wp-level.entering .walks-list > li:nth-child(n+5), .wp-level.entering .wp-scroll > :nth-child(n+5) { animation-delay: 0.2s; }
.wp-level.entering .wp-actions { animation-delay: 0.22s; }
@keyframes wp-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.wp-level.entering .wp-img { animation: wp-photo-in 0.7s var(--slide-ease) both; }
@keyframes wp-photo-in { from { opacity: 0; transform: scale(1.06); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .wp-level.entering * { animation: none !important; } }
.walks-panel.no-slide .wp-level { transition: none !important; }
@media (prefers-reduced-motion: reduce) { .walks-panel .wp-level { transition: none !important; } }
.wp-level-title { margin: 0; padding: 0 16px 4px; font-size: 1.15rem; }
.wp-brand { font-family: 'Big Shoulders Display', 'Arial Narrow', sans-serif; font-weight: 800; font-size: 1.6rem; letter-spacing: 0.02em; text-transform: uppercase; line-height: 1; }
.wp-brand span { color: var(--accent); }
.wp-tagline { margin: 0 16px 10px; color: var(--muted); font-size: 0.9rem; }
.wp-menu { display: flex; flex-direction: column; gap: 2px; padding: 4px 8px; overflow-y: auto; }
.wp-menu-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 10px; border: 0; border-radius: 10px; background: none; color: var(--text); text-decoration: none; text-align: left; font: inherit; cursor: pointer; }
.wp-menu-item:hover, .wp-menu-item:focus-visible { background: var(--bg); }
.wp-menu-item.hidden { display: none; }
.wp-menu-ico { flex: none; width: 34px; height: 34px; border-radius: 50%; background: color-mix(in srgb, var(--accent) 16%, transparent); display: flex; align-items: center; justify-content: center; font-size: 1rem; }
.wp-menu-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.wp-menu-txt small { color: var(--muted); font-size: 0.8rem; }
.wp-menu-go { color: var(--muted); font-size: 1.3rem; }
.ws-about-text { font-size: 1.0625rem; line-height: 1.65; color: var(--ws-soft); }
.ws-about-text p { margin: 0 0 0.8em; }
.ws-about-text strong { color: var(--ws-ink); }
.ws-about-text ul { margin: 0 0 0.9em; padding-left: 1.2em; }
.ws-about-text li { margin: 0 0 0.45em; }
.ws-about-text li::marker { color: var(--ws-signal); }
.ws-credit { border-top: 1.5px dashed #5c5952; padding-top: 0.8em; }
.player .rate-offer { left: 12px; right: 64px; transform: none; width: auto; max-width: none; justify-content: space-between; top: calc(var(--top-h) + 64px); }
.player .sat-trouble { top: calc(var(--top-h) + 4px); left: 12px; right: 64px; transform: none; max-width: none; }
.player .rate-offer { animation-name: rate-offer-down; }
@keyframes rate-offer-down { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
/* The toolkit (🛠, top right): closed, just the button; open, a panel of tools with their names */
.player .map { position: relative; z-index: 0; } /* the map's own controls stay under the drawer and the toolkit */
.tools { pointer-events: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 6px; display: flex; flex-direction: column; gap: 4px; max-height: calc(100vh - var(--top-h) - var(--sheet-h, 0px) - 112px); overflow-y: auto; transform-origin: top right; animation: tools-open 0.18s ease-out; }
.tools.hidden { display: none; }
@keyframes tools-open { from { opacity: 0; transform: scale(0.92) translateY(-6px); } to { opacity: 1; transform: none; } }
.tool-row { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 2px 2px 2px 8px; }
.tool-row:has(> .rail-btn.hidden), .tool-row[data-slot]:not(:has(> .leaflet-control)) { display: none; }
.tool-label { font-size: 0.85rem; color: var(--text); white-space: nowrap; }
.tool-row .rail-btn { width: 40px; height: 40px; font-size: 1rem; flex: none; box-shadow: none; }
.tool-row .map-compass { width: 40px; height: 40px; box-shadow: none; }
.tool-row .leaflet-control { margin: 0 !important; }
.tool-row .leaflet-control-layers { border-radius: 20px; box-shadow: none; border: 1px solid var(--line); }
.tool-row .leaflet-control-layers-toggle { width: 40px; height: 40px; }
.tool-wide { justify-content: stretch; }
.tool-wide .leaflet-control { width: 100%; }
.tools-btn[aria-expanded="true"] { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
/* Hidden from the toolkit: the map status and the discovery list */
.player.no-status .topbar .state-widget { display: none !important; }
.player.no-disc .disc-widget { display: none !important; }
/* Phone: the map status keeps all of itself (time · moon · weather · temperature); the title
   gives way (it ends in "…"). */
.player .topbar .state-widget { flex: 0 0 auto; max-width: 64%; }
@media (max-width: 480px) {
  .player .topbar #state-btn { font-size: 0.82rem; padding-left: 8px; padding-right: 8px; gap: 3px; white-space: nowrap; }
  .player .topbar .title { padding: 8px 10px; }
}
/* The walk page's buttons fit a phone: the main button takes what's left. */
.wp-actions .primary { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.wp-actions .wp-icon { flex: 0 1 64px; min-width: 52px; }
@media (max-width: 400px) { .wp-actions { gap: 6px; padding-inline: 12px; } .wp-actions .primary { font-size: 1rem; } }
@media (max-width: 400px) { .wp-actions .wp-icon { flex: 0 0 54px; min-width: 0; padding: 4px 2px; font-size: 0.72rem; } .wp-actions .primary { padding-inline: 6px; } }
/* A stem set's Beat sync tick box: its note wraps in the narrow panel */
.stemset .stem-sync { display: block; white-space: normal; margin: 0.3em 0; line-height: 1.35; }

/* ---- The editor's panels in sections (editor-sections.js): a header per group of settings
   that opens and closes it, with a one-line summary and a dot when settings are in use. */
.psec-tools { display: flex; justify-content: flex-end; gap: 12px; margin: 0.1em 0 0.3em; }
.sidebar .psec-tools { padding: 0.6rem 1rem 0; margin: 0; }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent); font-size: 0.8rem; cursor: pointer; box-shadow: none; }
.link-btn:hover { text-decoration: underline; }
.psec { border-top: 1px solid var(--line); }
.props .psec { margin-top: 0; }
.props .psecs > .psec:first-child { border-top: 0; }
.psec-head { margin: 0; font-size: 0.95rem; }
.psec-fixed { padding: 0.55em 0 0.2em; font-weight: 700; }
.psec-btn { display: grid; grid-template-columns: 1.1em auto auto 1fr; grid-template-areas: "chev title dot ." ". sum sum sum"; align-items: center; column-gap: 6px; width: 100%; text-align: left; background: none; border: 0; border-radius: 6px; padding: 0.55em 0.2em; color: inherit; font: inherit; font-weight: 700; cursor: pointer; box-shadow: none; }
.psec-btn:hover { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.psec-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.psec-chev { grid-area: chev; color: var(--muted); transition: transform 0.18s ease; display: inline-block; }
.psec.open > .psec-head .psec-chev { transform: rotate(90deg); }
.psec-title { grid-area: title; }
.psec-dot { grid-area: dot; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.psec-dot[hidden] { display: none; }
.psec-sum { grid-area: sum; font-weight: 400; font-size: 0.78rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.psec-sum:empty { display: none; }
.psec.open > .psec-head .psec-sum { display: none; } /* (open: the settings themselves show) */
.psec-body { padding: 0 0 0.8em; }
.psec:not(.open):not([data-always]) > .psec-body { display: none; }
.psec.open > .psec-body { animation: psec-in 0.18s ease-out; }
@keyframes psec-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .psec.open > .psec-body { animation: none; } .psec-chev { transition: none; } }
.psec-sub { margin: 0.9em 0 0.3em; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 600; }
.psec-body > .psec-sub:first-child, .psec-body > .sub:first-child > .psec-sub:first-child { margin-top: 0.2em; }
.props .psec-body .sub { margin-top: 0.7em; padding-top: 0.5em; }
.props .psec-body > .sub:first-child { border-top: 0; margin-top: 0; padding-top: 0; }
/* The sidebar's sections: the header carries the padding */
.sidebar section.psec { padding: 0 1rem; }
.sidebar .psec-btn { padding: 0.75em 0.2em; }
/* "Not used here" lines, shown only for a sound object that plays a stem */
.stem-only { display: none; }
#zone-panel.is-stem .stem-only { display: block; }

/* ---- The editor's coordinates box (editor-coords.js): bottom-left of the map */
.coords-box { display: flex; align-items: center; gap: 2px; background: var(--panel); color: var(--text); padding: 3px 4px 3px 8px; border-radius: 8px; box-shadow: var(--shadow); position: relative; }
.coords-label { margin: 0; color: var(--muted); font-size: 1rem; cursor: help; }
.coords-box input { width: 13.5em; border: 1px solid transparent; background: transparent; color: inherit; font: 500 0.85rem/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; padding: 4px 5px; border-radius: 5px; }
.coords-box input:hover { border-color: var(--line); }
.coords-box input:focus { border-color: var(--accent); background: var(--bg, transparent); outline: none; }
.coords-btn { background: none; border: 0; box-shadow: none; padding: 3px 6px; color: var(--muted); font-size: 0.95rem; cursor: pointer; border-radius: 5px; }
.coords-btn:hover { color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.coords-msg { position: absolute; left: 0; bottom: calc(100% + 6px); white-space: nowrap; font-size: 0.78rem; background: var(--panel); padding: 3px 8px; border-radius: 6px; box-shadow: var(--shadow); pointer-events: none; }
.coords-msg:empty { display: none; }
.coords-box.bad .coords-msg { color: var(--danger, #c0392b); }
.coords-box.bad input { border-color: var(--danger, #c0392b); animation: coords-shake 0.3s; }
@keyframes coords-shake { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
/* A + at the middle of the map while the box is in use */
.coords-cross { position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; z-index: 450; pointer-events: none; }
.coords-cross::before, .coords-cross::after { content: ''; position: absolute; background: var(--accent); box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.8); }
.coords-cross::before { left: 10px; top: 0; width: 2px; height: 22px; }
.coords-cross::after { top: 10px; left: 0; height: 2px; width: 22px; }
.coords-cross.hidden { display: none; }
/* The place moved to pulses for a moment */
.coords-pulse { stroke: var(--accent); stroke-width: 3; fill: var(--accent); fill-opacity: 0.15; animation: coords-pulse 1.2s ease-out 2; transform-box: fill-box; transform-origin: center; }
@keyframes coords-pulse { from { opacity: 1; transform: scale(0.4); } to { opacity: 0; transform: scale(1.6); } }
@media (prefers-reduced-motion: reduce) { .coords-pulse, .coords-box.bad input { animation: none; } }
@media (max-width: 600px) { .coords-box input { width: 10.5em; font-size: 0.78rem; } }

/* ---- The Waypoint-Signal banner (banner.js): along the top of the editor and the traveller's
   page, in the welcome page's colours whatever the walk's colour scheme. As tall as the bar
   beneath it: the editor's top bar, or the traveller's top row. */
:root { --wp-banner-h: 48px; } /* (the editor's top bar is about 48 px) */
.wp-banner { --wp-ink: #ece6d6; --wp-soft: #a9a49a; --wp-signal: #e8590c; box-sizing: border-box; height: var(--wp-banner-h); flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 14px; background: #18191d; color: var(--wp-ink); border-bottom: 1px solid #2c2d33; position: relative; z-index: 700; }
.wp-banner:empty { display: none; }
.wp-banner-home { display: flex; align-items: center; gap: 9px; background: none; border: 0; box-shadow: none; padding: 4px 6px 4px 2px; margin: 0; color: inherit; cursor: pointer; border-radius: 8px; min-width: 0; }
.wp-banner-home:hover { background: rgba(255, 255, 255, 0.06); }
.wp-banner-home:hover .wp-banner-mark { transform: rotate(-4deg); }
.wp-banner-home:focus-visible { outline: 2px solid var(--wp-signal); outline-offset: 2px; }
.wp-banner-mark { width: 28px; height: 28px; flex: none; color: var(--wp-ink); transition: transform 0.2s ease; overflow: visible; }
.wp-banner-name { font-family: 'Big Shoulders Display', 'Arial Narrow', sans-serif; font-weight: 800; font-size: 22px; line-height: 1; letter-spacing: 0.02em; text-transform: uppercase; white-space: nowrap; }
.wp-banner-name span { color: var(--wp-signal); }
.wp-banner-ver { font-family: 'Special Elite', ui-monospace, monospace; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--wp-soft); white-space: nowrap; }
@media (max-width: 380px) { .wp-banner-ver-word { display: none; } .wp-banner-name { font-size: 20px; } }
/* The editor: the banner, then the editor below it (the editor fills the rest of the window) */
.editor { height: calc(100vh - var(--wp-banner-h)); height: calc(100dvh - var(--wp-banner-h)); }
/* The traveller's page: the banner takes the top (and the phone's notch area); the top row of
   widgets, the compass band and the tools sit below it */
.player { --wp-banner-h: calc(50px + env(safe-area-inset-top)); --top-h: calc(var(--wp-banner-h) + 64px); }
.player .wp-banner { padding-top: env(safe-area-inset-top); padding-left: max(14px, env(safe-area-inset-left)); padding-right: max(14px, env(safe-area-inset-right)); }
.player .topbar { top: var(--wp-banner-h); padding-top: 10px; }
/* "Back to the welcome page?" */
.wp-leave { max-width: min(380px, calc(100vw - 32px)); border: 1px solid var(--line); border-radius: 14px; background: var(--panel); color: var(--text); padding: 18px 18px 14px; box-shadow: var(--shadow); }
.wp-leave::backdrop { background: rgba(0, 0, 0, 0.45); }
.wp-leave[open] { animation: tools-open 0.18s ease-out; }
.wp-leave h2 { margin: 0 0 0.4em; font-size: 1.05rem; }
.wp-leave-note { margin: 0 0 0.6em; color: var(--muted); font-size: 0.9rem; line-height: 1.45; }
.wp-leave-buttons { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin-top: 0.8em; }
/* (Its symbols can't be text-selected by a drag across the map; the coordinates themselves can.) */
.coords-box { user-select: none; -webkit-user-select: none; }
.coords-box input { user-select: text; -webkit-user-select: text; }
/* "Enjoyed it? Rate" sits just above the ★ Rate button (bottom left), clear of the toolkit and
   the GPS card up top */
.player .rate-offer { top: auto; right: auto; left: 12px; width: min(340px, calc(100% - 24px)); bottom: calc(var(--sheet-h, 0px) + var(--credits-h, 0px) + var(--logo-h, 0px) + 64px); animation-name: rate-offer-up; z-index: 650; }
@keyframes rate-offer-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---- The traveller's layout (layout 2, Version 71) -------------------------------------
   Top: the banner, then ☰ · title · map status, then (when on) the compass bar, full width.
   Upper left, below those: ◎ Discovered (its list drops down).
   Bottom, just above the drawer: ★ Rate (left) and the 🛠 toolbox (right), which ride up
   with the drawer and open upward. --below-top is where things under the top start. */
.player { --below-top: var(--top-h); }
.player:has(#guide-bar:not(.hidden)) { --below-top: calc(var(--top-h) + 50px); }
/* The compass bar: full width and thin. Compass marks along the bottom, the guidance point
   above them, its distance above that. */
.player .compass-bar:not(.in-editor) { left: 0; right: 0; width: auto; transform: none; border-radius: 0; top: calc(var(--top-h) - 4px); padding: 0 2px 0 0; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18); }
.player .compass-bar .cbar-track { height: 46px; -webkit-mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent); mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent); }
.player .compass-bar .cbar-tick { top: auto; bottom: 3px; height: 6px; }
.player .compass-bar .cbar-word { top: auto; bottom: 1px; font-size: 0.7rem; }
.player .compass-bar .cbar-mid { top: auto; bottom: 0; border: 5px solid transparent; border-bottom-color: var(--text); }
.player .compass-bar .cbar-dot { top: 1px; flex-direction: column-reverse; gap: 0; }
.player .compass-bar .cbar-dot b { font-size: 0.72rem; line-height: 1.1; }
.player .compass-bar .cbar-dot i { width: 12px; height: 12px; }
.player .compass-bar .cbar-dot.main i { width: 14px; height: 14px; }
.player .compass-bar .cbar-close { width: 24px; height: 24px; font-size: 0.75rem; }
/* ◎ Discovered: upper left, below the compass bar (or the top row); its list drops down */
.player .disc-widget { right: auto; left: 12px; bottom: auto; top: var(--below-top); flex-direction: column; align-items: flex-start; max-width: min(320px, calc(100% - 24px)); }
.player .disc-widget .disc-list { margin: 6px 0 0; max-height: min(50vh, calc(100dvh - var(--below-top) - var(--sheet-h, 0px) - 120px)); }
/* Pop-ups and messages start below Discovery */
.player .popup-stack { top: calc(var(--below-top) + 52px); right: 12px; width: min(380px, calc(100% - 24px)); }
.player .disc-toast { top: calc(var(--below-top) + 52px); }
.player .sat-trouble { top: calc(var(--below-top) + 52px); right: 12px; }
/* The toolbox: bottom right, just above the drawer, opening upward */
.player .rail { top: auto; bottom: calc(var(--sheet-h, 0px) + var(--credits-h, 0px) + var(--logo-h, 0px) + 8px); flex-direction: column-reverse; z-index: 660; }
.player .tools { transform-origin: bottom right; animation-name: tools-up; max-height: calc(100dvh - var(--below-top) - var(--sheet-h, 0px) - var(--credits-h, 0px) - var(--logo-h, 0px) - 84px); }
@keyframes tools-up { from { opacity: 0; transform: translateY(6px) scale(0.97); } to { opacity: 1; transform: none; } }
/* Little room above it (e.g. the drawer open): the tools as a compact grid of icons, shown over
   the compass bar until closed (player.js fitTools) */
.player.short-tools .rail { z-index: 1100; }
.player.short-tools .tools { display: grid; grid-template-columns: repeat(5, 44px); gap: 6px; padding: 8px; max-height: none; }
.player.short-tools .tool-row { padding: 0; justify-content: center; }
.player.short-tools .tool-label { display: none; }
.player.short-tools .tool-row[data-slot="satellite"] { grid-column: 1 / -1; }
/* (compact: the icons sit to the left of 🛠, bottom-aligned with it, so they stay clear of the top) */
.player.short-tools .rail { flex-direction: row-reverse; align-items: flex-end; }
.player.short-tools .tools { transform-origin: bottom right; }
/* The GPS card (asked for) stays above the one-off "Enjoyed it?" prompt where they meet */
.player .gps-widget { z-index: 670; }
/* The banner above every screen but the welcome page: on pages that scroll (About, Terms) it
   stays at the top; on the traveller's page the ☰ drawer, its dimmed backdrop and the intro and
   access-code screens start below it. */
body > .wp-banner { position: sticky; top: 0; }
.player .walks-panel, .player .walks-scrim, .player .intro-screen { top: var(--wp-banner-h); }
.player .walks-panel { padding-top: 0; }
.player .walks-panel .wp-level { top: 0; } /* (the banner already covers the phone's notch area) */
body:has(> .wp-banner) { height: auto; min-height: 100%; } /* (so the banner can stay at the top as these pages scroll) */
/* The receiver (About) and the name (welcome page) are two buttons side by side */
.wp-banner-brand { display: flex; align-items: center; gap: 2px; min-width: 0; }
.wp-banner-about { display: flex; align-items: center; background: none; border: 0; box-shadow: none; padding: 4px; margin: 0; color: var(--wp-ink); cursor: pointer; border-radius: 8px; }
.wp-banner-about:hover { background: rgba(255, 255, 255, 0.06); }
.wp-banner-about:hover .wp-banner-mark { transform: rotate(-4deg); }
.wp-banner-about:focus-visible { outline: 2px solid var(--wp-signal); outline-offset: 2px; }
.wp-banner-home { padding-left: 4px; }
/* Deleting a walk (editor.js confirmDeleteWalk) */
button.danger-soft { color: var(--danger); background: transparent; }
button.danger-soft:hover { background: color-mix(in srgb, var(--danger) 10%, transparent); }
.del-dlg { width: min(440px, calc(100vw - 24px)); border: none; border-radius: 14px; padding: 16px 18px; background: var(--panel); color: var(--text); box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35); }
.del-dlg::backdrop { background: rgba(0, 0, 0, 0.45); }
.del-dlg h2 { font-size: 1.05rem; }
.del-list { margin: 0.2em 0 0.6em; padding-left: 1.2em; line-height: 1.5; }
.del-dlg input { width: 100%; box-sizing: border-box; margin-top: 4px; }
.del-dlg button.danger:not(:disabled) { background: var(--danger); color: #fff; border-color: var(--danger); }
#del-live { color: var(--danger); font-weight: 600; }
/* Beside 🛠 the GPS card can be narrow: its text wraps (two lines at most) rather than being cut */
.player .gps-widget .gps-copy { white-space: normal; text-overflow: clip; text-align: left; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.player .gps-widget .gps-copy .muted { margin-left: 0; }
/* What the traveller opens sits above the compass bar, pop-ups and the other widgets while
   open (the one opened last in front: player.js resolveCollisions). Closed again, back in place. */
.player .topbar:not(:has(.state-card:not(.hidden))) { z-index: 600 !important; }
.player .disc-widget:not(:has(.disc-list:not(.hidden))) { z-index: 615 !important; }
.player .rail:not(:has(#tools:not(.hidden))) { z-index: 660 !important; }
.player.short-tools .rail:not(:has(#tools:not(.hidden))) { z-index: 1100 !important; }

/* A moving sound object's dot (player and editor): a soft pulse so it reads as alive. */
.mover-dot { animation: mover-pulse 2.4s ease-in-out infinite; }
@keyframes mover-pulse { 0%, 100% { stroke-width: 2; stroke-opacity: 1; } 50% { stroke-width: 7; stroke-opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { .mover-dot { animation: none; } }

/* The Undo button in the editor's note after deleting (editor-delete.js). */
.drop-toast .toast-undo { margin-left: 0.4em; font-weight: 600; }

/* Sub-groups inside a panel section (editor-sections.js): "On the traveller's map", Popup,
   Movement, More, Entry and exit sounds, Beacon. A summary line; a dot when settings are in use. */
details.psub { margin: 0.7em 0 0.2em; border: 1px solid var(--line, rgba(127,127,127,0.25)); border-radius: 8px; padding: 0.35em 0.6em; }
details.psub[open] { padding-bottom: 0.6em; }
details.psub > summary { cursor: pointer; list-style: none; display: flex; align-items: baseline; gap: 0.35em; font-weight: 600; font-size: 0.9rem; }
details.psub > summary::-webkit-details-marker { display: none; }
details.psub > summary::before { content: '▸'; color: var(--muted); font-size: 0.8em; transition: transform 0.15s; display: inline-block; }
details.psub[open] > summary::before { transform: rotate(90deg); }
details.psub > summary .psub-sum { font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
details.psub.used > summary .psub-title::after { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-left: 0.35em; vertical-align: middle; }
details.psub details.psub { margin-top: 0.6em; }
details.psub.hidden { display: none; }

/* Simple / Full (editor.js applyPanelMode): Simple hides rarely needed settings not in use */
.psec-tools .seg { display: inline-flex; border: 1px solid var(--line, rgba(127,127,127,0.35)); border-radius: 6px; overflow: hidden; margin-right: auto; }
.psec-tools .seg-btn { border: 0; border-radius: 0; background: transparent; padding: 2px 10px; font-size: 0.8rem; color: var(--muted); }
.psec-tools .seg-btn[aria-pressed="true"] { background: var(--accent); color: #fff; }
#zone-panel.simple .adv:not(.adv-used) { display: none !important; }
.cond-add { display: flex; flex-wrap: wrap; gap: 6px; margin: 0.5em 0 0.2em; }
.cond-add[hidden] { display: none; }

#zone-panel.is-point .not-point { display: none; }

/* Walking in, to scale: entry sound, delay, main sound (editor.js renderCueTimeline) */
.cue-timeline { margin: 0.5em 0 0.2em; }
.cue-timeline svg { width: 100%; height: auto; display: block; overflow: visible; }

/* Channel muting (traveller's 🛠): a chip per channel, tap to mute or unmute */
.chan-list { flex-wrap: wrap; justify-content: flex-end; gap: 6px; padding: 2px 4px 6px 8px; max-width: 260px; }
.chan-chip { border: 1px solid var(--line, rgba(127,127,127,0.35)); border-radius: 999px; padding: 4px 10px; font-size: 0.85rem; background: var(--panel); color: var(--text); }
.chan-chip.off { opacity: 0.6; text-decoration: line-through; }
#chan-btn.some-muted { position: relative; }
#chan-btn.some-muted::after { content: ''; position: absolute; top: 5px; right: 5px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger, #d9480f); }
.player.short-tools .chan-list:not(.hidden) { display: flex; }
.player.short-tools .chan-list { grid-column: 1 / -1; }

/* Sound Container (editor Basics): the list menus, and Play × N ± M on each clip */
.list-row { gap: 6px; margin-top: 0.35em; flex-wrap: wrap; }
.list-row select { flex: 1; min-width: 8em; }
.file-list .clip-rep { display: inline-flex; align-items: center; gap: 1px; font-size: 0.78rem; color: var(--muted); white-space: nowrap; }
.file-list .clip-rep input { width: 2.6em; padding: 1px 2px; font-size: 0.8rem; text-align: center; }
.file-list.no-reps .clip-rep { display: none; }
/* (the clip's name keeps a line of its own; its controls wrap below in a narrow panel) */
.file-list li { flex-wrap: wrap; }
.file-list li .name { flex: 1 1 calc(100% - 3.5em); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-list li .clip-rep { margin-left: 2.6em; margin-right: auto; }
/* 🎲 Random per clip: the button lights up when in use; its settings open under the clip */
.file-list .clip-rand-btn.inherit { border-style: dashed; border-color: var(--accent, #2f6fdf); }
#z-all-rand-btn.on { background: var(--accent, #2f6fdf); color: #fff; border-color: transparent; }
.file-list .clip-rand-btn.on { background: var(--accent, #2f6fdf); color: #fff; border-color: transparent; }
.file-list .clip-rand { flex: 1 1 100%; margin: 0.3em 0 0.2em 0.4em; padding: 0.4em 0.5em; border-left: 2px solid var(--accent, #2f6fdf); background: var(--panel2, rgba(127,127,127,0.06)); }
.file-list .clip-rand .row { gap: 4px; align-items: center; margin: 0.15em 0; flex-wrap: wrap; }
.file-list .clip-rand input { width: 4.4em; padding: 1px 3px; font-size: 0.82rem; }
.file-list .clip-rand-label { min-width: 4.2em; }
.file-list .clip-rand-note { margin: 0.25em 0 0; font-size: 0.75rem; line-height: 1.35; }

/* Object media (Project panel): a group per sound object, A–Z */
details.objmedia { border-bottom: 1px solid var(--line, rgba(127,127,127,0.2)); padding: 0.3em 0; }
details.objmedia > summary { cursor: pointer; display: flex; align-items: center; gap: 0.45em; list-style: none; }
details.objmedia > summary::-webkit-details-marker { display: none; }
details.objmedia > summary::before { content: '▸'; color: var(--muted); font-size: 0.8em; transition: transform 0.15s; }
details.objmedia[open] > summary::before { transform: rotate(90deg); }
details.objmedia .swatch { width: 10px; height: 10px; border-radius: 50%; flex: none; }
details.objmedia .objmedia-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
details.objmedia .objmedia-show { margin-left: auto; }
details.objmedia > .list { margin: 0.3em 0 0.2em 1.2em; }
/* (four tabs: they share the width and stay on one line each) */
.side-tabs { gap: 6px; padding: 8px 8px 0; }
.side-tabs button { flex: 1 1 auto; min-width: 0; padding: 6px 4px; font-size: 0.8rem; line-height: 1.15; white-space: normal; }
/* (French words are longer) */
[data-ui-lang="fr"] .side-tabs button { font-size: 0.74rem; padding: 6px 2px; }

/* A swarm's sound points (player and editor) */
.swarm-dot { transition: none; }

/* MIDI sounds (the 〰 window's 🎹 MIDI box) */
.wv-midi .row { gap: 6px; align-items: center; margin: 0.2em 0; flex-wrap: wrap; }
.wv-midi-tracks { display: grid; gap: 2px 10px; grid-template-columns: repeat(auto-fill, minmax(12em, 1fr)); margin-top: 0.2em; }
.wv-midi-tracks label { display: flex; gap: 5px; align-items: baseline; margin: 0; font-weight: normal; }
.wv-midi-tracks .muted { font-size: 0.85em; }
.midi-tag { font-size: 0.75rem; padding: 0 5px; border-radius: 4px; background: var(--accent, #2f6fdf); color: #fff; margin-left: 4px; }
.wv-midi { grid-column: span 2; min-width: 0; }
.wv-midi select { max-width: 100%; min-width: 0; }
@media (max-width: 700px) { .wv-midi { grid-column: auto; } }

/* Feature switches (src/features.js): <html class="no-reviews …"> hides class="f-reviews" … */
.no-nearby .f-nearby, .no-walksmap .f-walksmap, .no-selector .f-selector, .no-reviews .f-reviews,
.no-feedback .f-feedback, .no-mosaic .f-mosaic, .no-live .f-live, .no-logs .f-logs, .no-inbox .f-inbox, .no-tracking .f-tracking { display: none !important; }
.no-logs-only { display: none; }
.no-logs .no-logs-only { display: inline; }
.powered-by { opacity: 0.75; }
/* Administration → Site (editor-site.js) */
.site-thumb { max-height: 40px; max-width: 120px; background: repeating-conic-gradient(#8883 0% 25%, transparent 0% 50%) 50% / 12px 12px; border-radius: 4px; }
.site-features { list-style: none; padding: 0; margin: 0.3em 0; }
.site-features li { padding: 2px 0; }
.site-features li.off { opacity: 0.6; }
.site-features li.on span { color: var(--ok, #4fb87a); }
.site-features code { font-size: 0.8em; opacity: 0.7; }
.wp-banner-icon { object-fit: contain; }

/* The Title Page (player-title.js): a scrollable popup before Start walk */
.title-page { align-items: flex-start; overflow: hidden; }
.tp-card { max-height: calc(100% - 8px); overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.tp-card .intro-text h2 { font-size: 1.5rem; line-height: 1.2; padding-right: 30px; }
.tp-card img + .intro-text h2 { padding-right: 0; }
.tp-voice { display: flex; gap: 12px; align-items: center; margin: 0.8em 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.tp-play { flex: none; width: 48px; height: 48px; border-radius: 50%; padding: 0 0 0 2px; font-size: 1.15rem; display: flex; align-items: center; justify-content: center; line-height: 1; letter-spacing: -2px; background: var(--accent); color: var(--accent-text); border: none; }
.tp-voice-main { flex: 1; min-width: 0; }
.tp-voice-head { display: flex; justify-content: space-between; gap: 8px; }
.tp-voice input[type=range] { width: 100%; margin: 4px 0 0; }
.tp-voice-hint { margin: 2px 0 0 !important; }
.tp-intro p { white-space: normal; }
.tp-info, .tp-credits dl { margin: 0.8em 0; display: grid; gap: 6px; }
.tp-info > div, .tp-credits dl > div { display: grid; grid-template-columns: minmax(7em, 32%) 1fr; gap: 8px; }
.tp-info dt, .tp-credits dt { color: var(--muted); font-size: 0.9em; }
.tp-info dd, .tp-credits dd { margin: 0; white-space: pre-line; }
.tp-credits { border-top: 1px solid var(--line); margin-top: 0.8em; padding-top: 0.4em; }
.tp-credits h3 { margin: 0.4em 0 0.2em; font-size: 0.85rem; }
.tp-go { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 1em; position: sticky; bottom: -18px; padding: 10px 0 12px; background: var(--panel); }
.tp-go .primary { flex: 1 1 12em; }
#title-page-btn.tp-playing::after, #title-page-btn2.tp-playing::after { content: ' 🔊'; }

/* The sound-object panel's tabs (editor-tabs.js) */
.ztabs { display: flex; gap: 2px; margin: 0.2em 0 0.4em; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 3; background: var(--panel); }
.ztabs [role="tab"] { flex: 1 1 0; min-width: 0; line-height: 1.15; text-align: center; background: none; border: 0; border-bottom: 2px solid transparent; border-radius: 6px 6px 0 0; padding: 0.5em 0.4em 0.45em; color: var(--muted); font: inherit; font-weight: 600; font-size: 0.88rem; box-shadow: none; white-space: normal; display: inline-flex; align-items: center; justify-content: center; gap: 5px; }
.ztabs [role="tab"]:hover { color: var(--text); background: color-mix(in srgb, var(--accent) 7%, transparent); }
.ztabs [role="tab"][aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.ztab-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.ztab-dot[hidden] { display: none; }
#zone-panel[data-ztab="main"] .psec[data-ztab] { display: none; }
#zone-panel[data-ztab="mix"] .psecs > .psec:not([data-ztab="mix"]),
#zone-panel[data-ztab="when"] .psecs > .psec:not([data-ztab="when"]) { display: none; }
#zone-panel:not([data-ztab="main"]) .psec[data-ztab] { border-top: 0; grid-column: 1 / -1; }
#zone-panel:not([data-ztab="main"]) .psec[data-ztab] > .psec-head { display: none; }
#zone-panel:not([data-ztab="main"]) .psec[data-ztab] > .psec-body { display: block !important; }
#zone-panel:not([data-ztab="main"]) .psec-tools [data-psec-all] { visibility: hidden; }
kbd { display: inline-block; min-width: 1.4em; padding: 0 4px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; font: 600 0.78em/1.5 ui-monospace, monospace; text-align: center; color: var(--text); background: var(--bg); }
#zone-panel[data-ztab="all"] .psec[data-ztab] { display: block; }

/* Terms of Use (terms-notice.js): the first-visit notice and the agreement before the first walk */
.terms-notice { position: fixed; left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom)); z-index: 3000; display: flex; gap: 10px; align-items: center; max-width: 640px; margin: 0 auto; padding: 10px 12px; border-radius: 12px; background: #18191d; color: #ece6d6; border: 1px solid #3a3b42; box-shadow: 0 8px 30px rgba(0,0,0,0.45); font-size: 0.85rem; line-height: 1.35; }
.terms-notice p { margin: 0; flex: 1; }
.terms-notice a { color: inherit; text-decoration: underline; }
.terms-notice button { flex: none; }
.terms-ask { position: fixed; inset: 0; z-index: 3100; background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center; padding: 16px; }
.terms-ask-card { width: min(460px, 100%); max-height: 100%; overflow-y: auto; background: var(--panel); color: var(--text); border-radius: 16px; padding: 16px 18px; box-shadow: 0 12px 40px rgba(0,0,0,0.45); }
.terms-ask-card h2 { margin: 0 0 0.4em; }
.terms-ask-card ul { padding-left: 1.1em; margin: 0.4em 0; }
.terms-ask-card li { margin: 0.35em 0; }
.terms-ask-go { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 0.8em; }
.terms-ask-go .primary { flex: 1 1 12em; }
.terms-key { border-left: 3px solid var(--accent); padding: 0.2em 0.9em; background: color-mix(in srgb, var(--accent) 8%, transparent); border-radius: 0 8px 8px 0; }
.terms-line { margin: 0.5em 0 0; }
.wp-powered { padding: 0 16px 8px; }

/* Layers of a sound object (Version 93: editor-objlayers.js) */
.layer-strip { margin: 0.2em 0 0.5em; }
.layer-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.layer-chip { font: inherit; font-size: 0.85em; padding: 0.25em 0.7em; border-radius: 999px; border: 1px solid var(--line, #555); background: transparent; color: inherit; cursor: pointer; }
.layer-chip.on { background: var(--accent, #e8590c); border-color: var(--accent, #e8590c); color: #fff; }
.layer-chip.empty:not(.on) { opacity: 0.65; font-style: italic; }
.layer-chip.add { border-style: dashed; opacity: 0.85; }
.layer-strip #z-layer-tools { margin-top: 0.35em; gap: 6px; align-items: center; }
.layer-hidden { display: none !important; }
.layer-badge { font-size: 0.75em; opacity: 0.8; margin-left: 0.3em; }

/* Open-source credits (/open-source, Version 94) */
.open-source .table-wrap { overflow-x: auto; }
.oss-table { border-collapse: collapse; width: 100%; font-size: 0.9em; }
.oss-table th, .oss-table td { text-align: left; padding: 0.3em 0.6em 0.3em 0; border-bottom: 1px solid var(--line, rgba(128,128,128,0.3)); vertical-align: top; }
.oss-table td:nth-child(2), .oss-table td:nth-child(3) { white-space: nowrap; }

/* Languages and translations (Version 95: editor-langs.js) */
.lang-list { display: flex; flex-wrap: wrap; gap: 4px; margin: 0.35em 0; }
.lang-chip { display: inline-flex; align-items: center; gap: 0.3em; font-size: 0.85em; padding: 0.15em 0.3em 0.15em 0.65em; border-radius: 999px; border: 1px solid var(--line, #555); }
.lang-chip .muted { font-size: 0.9em; }
.lang-chip button { font: inherit; background: none; border: 0; color: inherit; cursor: pointer; opacity: 0.7; padding: 0 0.3em; }
.tr-dlg { width: min(980px, 96vw); max-height: 92vh; padding: 0.8em 1em 1em; border: 1px solid var(--line, #555); border-radius: 8px; background: var(--panel, #22252b); color: inherit; }
.tr-dlg::backdrop { background: rgba(0, 0, 0, 0.45); }
.tr-bar { gap: 8px; flex-wrap: wrap; align-items: center; }
.tr-list { overflow-y: auto; max-height: calc(92vh - 9em); }
.tr-group { margin: 0.9em 0 0.3em; font-size: 0.8em; letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.75; }
.tr-row { display: grid; grid-template-columns: minmax(8em, 11em) 1fr 1fr; gap: 8px; align-items: start; padding: 0.35em 0; border-bottom: 1px solid var(--line, rgba(128,128,128,0.25)); }
.tr-row .tr-orig { font-size: 0.9em; opacity: 0.8; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 8em; overflow: auto; }
.tr-row textarea, .tr-row input, .tr-row select { width: 100%; box-sizing: border-box; }
.tr-row.done .tr-label::before { content: '✓ '; color: var(--accent, #e8590c); }
@media (max-width: 700px) { .tr-row { grid-template-columns: 1fr; } }
/* The walk's language, for travellers (Version 95: player-langs.js) */
.tp-langs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0.4em 0 0.6em; }
.tp-lang { font: inherit; font-size: 0.85em; padding: 0.3em 0.8em; border-radius: 999px; border: 1px solid currentColor; background: transparent; color: inherit; opacity: 0.75; cursor: pointer; }
.tp-lang.on { opacity: 1; background: var(--accent, #e8590c); border-color: var(--accent, #e8590c); color: #fff; }
.walk-lang { display: inline-flex; align-items: center; gap: 0.3em; font-size: 0.9em; }
.walk-lang select { width: auto; }

/* The interface's language (Version 95: i18n.js, banner.js) */
.wp-banner-right { display: inline-flex; align-items: center; gap: 0.6em; }
.wp-banner-lang { font: inherit; font-size: 0.75em; letter-spacing: 0.08em; padding: 0.15em 0.5em; border: 1px solid currentColor; border-radius: 4px; background: transparent; color: inherit; opacity: 0.8; cursor: pointer; }
.wp-banner-lang:hover { opacity: 1; }

/* ------------------------------------------------------------------ accessibility (Version 96) */
/* Display options (display.js): text size, high contrast, less motion */
body { font-size: 0.9375rem; }
html.wp-text-l { font-size: 112.5%; }
html.wp-text-xl { font-size: 128%; }
:root.wp-contrast, :root.wp-contrast[data-theme] {
  --bg: #000; --panel: #000; --text: #fff; --muted: #e8e8e8; --line: #fff;
  --accent: #ffd400; --accent-text: #000; --danger: #ff6b5e; --ok: #59e08a; color-scheme: dark;
}
html.wp-contrast a { color: #ffd400; text-decoration: underline; }
html.wp-contrast button, html.wp-contrast .btn, html.wp-contrast input, html.wp-contrast select, html.wp-contrast textarea { border-color: #fff !important; }
html.wp-contrast :focus-visible { outline: 3px solid #ffd400 !important; outline-offset: 2px; }
html.wp-contrast .muted { color: #e8e8e8 !important; }
html.wp-calm *, html.wp-calm *::before, html.wp-calm *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
.wp-banner-aa { font: inherit; font-size: 0.8em; font-weight: 700; padding: 0.1em 0.45em; margin-left: 0.5em; border: 1px solid currentColor; border-radius: 4px; background: transparent; color: inherit; opacity: 0.8; cursor: pointer; margin-right: 0.4em; }
.wp-banner-aa:hover { opacity: 1; }
dialog.wp-display-dlg { width: min(420px, calc(100% - 32px)); box-sizing: border-box; background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 18px 14px; }
dialog.wp-display-dlg::backdrop { background: rgba(0, 0, 0, 0.45); }
dialog.wp-display-dlg h2 { margin: 0 2em 0.6em 0; font-size: 1.15rem; }
dialog.wp-display-dlg fieldset { border: 0; padding: 0; margin: 0 0 0.6em; }
dialog.wp-display-dlg legend { font-weight: 600; margin-bottom: 0.3em; }
dialog.wp-display-dlg .check { display: flex; gap: 0.5em; align-items: baseline; margin: 0.45em 0; }
dialog.wp-display-dlg #wp-display-transcripts { margin-top: 0.5em; }

/* Captions (player-captions.js): just above the panel, while a walk plays */
.caption-bar { position: absolute; left: 12px; right: 12px; bottom: calc(var(--sheet-h, 0px) + var(--credits-h, 18px) + var(--logo-h, 0px) + 54px); z-index: 670; max-height: 9.5em; overflow-y: auto; background: rgba(0, 0, 0, 0.82); color: #fff; border-radius: 10px; padding: 0.55em 0.8em; font-size: 1.05rem; line-height: 1.4; box-shadow: var(--shadow); white-space: pre-line; }
.caption-bar .cap-who { display: block; font-size: 0.78em; opacity: 0.8; font-weight: 600; letter-spacing: 0.02em; }
.caption-bar .cap-line + .cap-line { margin-top: 0.4em; }
html.wp-contrast .caption-bar { background: #000; border: 2px solid #fff; }
.cc-btn[aria-pressed="true"] { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.tp-caption-line { white-space: pre-line; background: rgba(0, 0, 0, 0.06); border-radius: 6px; padding: 0.4em 0.6em; margin: 0.4em 0 0; }
.transcript-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.8em; }
.transcript-list h3 { margin: 0 0 0.2em; font-size: 0.95rem; }
.transcript-list p { white-space: pre-line; margin: 0; }
.transcript-list .tr-time { color: var(--muted); font-variant-numeric: tabular-nums; margin-right: 0.4em; }

/* Route access: the editor's box, and what travellers see */
.ra-grid { display: grid; grid-template-columns: auto 1fr; gap: 0.35em 0.6em; align-items: center; }
.ra-grid label { margin: 0; }
.ra-ticks { display: flex; flex-direction: column; gap: 0.15em; margin: 0.4em 0; }
.access-note { margin-top: 0.35em; }
.tp-access { list-style: none; margin: 0.3em 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.2em; }
.tp-access li { display: flex; gap: 0.5em; }
.tp-access-notes { margin: 0.4em 0 0; padding-left: 1.2em; }
.wl-stepfree { margin-left: 0.3em; }

/* Walk it from anywhere (player-tour.js) */
.tour-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius); }
.tour-bar .tour-text { flex: 1 1 12em; }
.tour-bar .seg button { padding: 4px 9px; }
.nowrap { white-space: nowrap; }
.walks-stepfree { margin: 0.3em 0; display: flex; gap: 0.4em; align-items: center; }

/* Shared edges and snapping (Version 97: editor-edges.js, editor-snap.js) */
#tool-snap[aria-pressed="true"] { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.edge-list { display: flex; flex-direction: column; gap: 0.5em; }
.edge-row { border-left: 3px solid #9b59d0; padding-left: 0.5em; }
.edge-name { font-size: 0.9em; margin-bottom: 0.2em; }

/* Brands for single walks (Version 99: src/walkbrands.js) */
.tp-presented { margin-top: 1em; padding-top: 0.8em; border-top: 1px solid var(--line); }
.tp-presented p { margin: 0.4em 0 0; }
.presented-head { display: flex; align-items: center; gap: 0.6em; font-weight: 600; }
.presented-logo { height: 36px; width: auto; max-width: 140px; object-fit: contain; }
.wp-presented { margin: 0.2em 0 0.6em; font-size: 0.9em; }
.wp-presented .presented-logo { height: 24px; }
.wl-brand { display: inline-flex; align-items: center; gap: 0.3em; font-size: 0.75em; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 0.05em 0.5em; margin: 0.15em 0; width: fit-content; }
.wl-brand img { height: 1.2em; width: auto; max-width: 3em; object-fit: contain; }
.brand-table img { height: 28px; width: auto; max-width: 80px; object-fit: contain; vertical-align: middle; }

/* (Version 100: the welcome, About and What is this? pages' reading text is a little bigger, in rem so Aa's text size scales it too.) */

/* Forms in the administrator's area (Site, Brands): one field to a line, room to breathe */
.projects .card.form-card { display: block; max-width: 760px; padding: 1.2rem 1.4rem 1.4rem; margin-bottom: 1rem; }
.form-card .form-title { margin: 0 0 0.4rem; font-size: 1.2rem; text-transform: none; letter-spacing: 0; }
.form-card .form-sec { margin: 1.6rem 0 0.6rem; padding-top: 1rem; border-top: 1px solid var(--line); font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.form-card .form-sec:first-of-type, .form-card .form-title + .form-sec { margin-top: 0.6rem; padding-top: 0; border-top: 0; }
.form-card .field { margin: 0 0 1rem; }
.form-card .field > label { display: block; margin: 0 0 0.35rem; font-weight: 600; }
.form-card .field input:not([type="color"]):not([type="checkbox"]), .form-card .field textarea { width: 100%; box-sizing: border-box; padding: 0.55em 0.7em; }
.form-card .hint { margin: 0.35rem 0 0; font-size: 0.85rem; color: var(--muted); }
.form-card > .hint { margin: -0.4rem 0 1rem; }
.form-card .field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.form-card .field-pair .field { margin-bottom: 0.6rem; }
.form-card .nowrap-row { display: flex; flex-wrap: nowrap; align-items: center; gap: 0.6rem; }
.form-card .colour-pick { width: 3.2em; height: 2.4em; padding: 0; flex: none; }
.form-card .colour-text { flex: 1; min-width: 0; max-width: 20em; }
.form-card .image-field { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.8rem 0; border-bottom: 1px solid var(--line); }
.form-card .image-field:last-of-type { border-bottom: 0; }
.form-card .image-field .hint { margin-top: 0.15rem; }
.form-card .image-tools { display: flex; align-items: center; gap: 0.5rem; flex: none; }
.form-card .image-tools .btn { margin: 0; color: var(--text); }
.form-card .form-more { margin: 1.2rem 0 0; }
.form-card .form-more summary { cursor: pointer; }
.form-card .code-area { width: 100%; box-sizing: border-box; margin-top: 0.6rem; font-family: ui-monospace, monospace; font-size: 0.85em; }
.form-card .form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.8rem; margin-top: 1.4rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.form-card .form-actions .grow { flex: 1; }
@media (max-width: 600px) {
  .form-card .field-pair { grid-template-columns: 1fr; }
  .form-card .image-field { flex-direction: column; align-items: flex-start; }
}
.page.terms { font-size: 1.0625rem; line-height: 1.6; }

/* The properties drawer on a phone (Version 101: editor-drawer.js) */
.props-grip { display: none; }
@media (max-width: 800px) {
  .editor.props-drawer #props { padding-top: 0; transition: none; }
  .editor.props-drawer .props-grip { display: flex; align-items: center; justify-content: center; gap: 8px; position: sticky; top: 0; z-index: 5; margin: 0 -14px 6px; height: 30px; background: var(--panel); border-bottom: 1px solid var(--line); cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
  .editor.props-drawer .props-grip-bar { width: 44px; height: 5px; border-radius: 3px; background: var(--muted); opacity: 0.6; }
  .editor.props-drawer .props-grip-word { font-size: 0.8rem; color: var(--muted); }
  .editor.props-drawer.props-dragging .props-grip { cursor: grabbing; }
  .editor.props-drawer #props { border-radius: 14px 14px 0 0; box-shadow: 0 -6px 18px rgba(0, 0, 0, 0.25); position: relative; z-index: 1000; }
  .editor.props-drawer.props-peek #props { overflow: hidden; }
}

/* ---------- QR / NFC stops and map images (Version 102) ---------- */
.stop-card { border: 2px solid var(--accent); border-radius: 12px; padding: 10px 12px; margin: 0 0 12px; background: color-mix(in srgb, var(--accent) 10%, var(--panel)); }
.stop-card-label { font-weight: 600; color: var(--accent); }
.stop-card-name { font-size: 1.15rem; font-weight: 600; margin: 2px 0 8px; }
/* A map image that hides the street map: just the picture, the sound objects and the traveller. */
.sw-hide-base { background: #efece4 !important; }
.sw-hide-base .leaflet-tile-pane, .sw-hide-base .leaflet-satellitePane-pane, .sw-hide-base .leaflet-shadePane-pane { visibility: hidden; }
.sw-map-image { image-rendering: auto; }
/* The editor: map images list and the alignment handles */
.ov-item { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin: 8px 0; display: grid; gap: 6px; }
.ov-item .row { gap: 8px; align-items: center; flex-wrap: wrap; }
.ov-item input[type="text"] { flex: 1; min-width: 8em; }
.ov-item.aligning { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 30%, transparent); }
.ov-handle { width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; background: #fff; border: 3px solid #e0452b; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4); cursor: grab; }
.ov-handle.ov-scale { border-radius: 3px; border-color: #1f6feb; }
.ov-handle.ov-move { width: 26px; height: 26px; margin: -13px 0 0 -13px; background: #1f6feb; border-color: #fff; color: #fff; font-size: 15px; line-height: 20px; text-align: center; cursor: move; }
.stop-row { display: flex; gap: 6px; align-items: center; margin: 4px 0; }
.stop-row input { width: 9em; }
.stop-row .stop-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.btn.disabled { pointer-events: none; opacity: 0.5; }

/* ---------- Administration → Move walks (Version 103) ---------- */
.tx-list { max-height: 22em; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px; margin: 0.4em 0 0.8em; }
.tx-row { display: flex; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); margin: 0; }
.tx-row:last-child { border-bottom: 0; }
.tx-row .grow { flex: 1; min-width: 0; }

/* ---------- The editor: where you are (Version 104: editor-whereami.js) ---------- */
#tool-locate[aria-pressed="true"] { background: #1f6feb; color: #fff; border-color: #1f6feb; }
.ed-me { position: relative; width: 22px; height: 22px; }
.ed-me-dot { position: absolute; left: 4px; top: 4px; width: 14px; height: 14px; border-radius: 50%; background: #1f6feb; border: 3px solid #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25), 0 1px 4px rgba(0, 0, 0, 0.4); box-sizing: border-box; }
.ed-me-pulse { position: absolute; left: -9px; top: -9px; width: 40px; height: 40px; border-radius: 50%; background: rgba(31, 111, 235, 0.35); animation: ed-me-pulse 1.8s ease-out infinite; }
@keyframes ed-me-pulse { from { transform: scale(0.4); opacity: 0.9; } to { transform: scale(1.4); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .ed-me-pulse { animation: none; opacity: 0.4; } }

/* ---------- Rooms of sounds (Version 106: editor-room.js) ---------- */
.room-pt { position: absolute; left: -9px; top: -9px; width: 18px; height: 18px; border-radius: 50%; background: var(--c, #5c3d99); color: #fff; border: 2px solid #fff; font: 600 10px/14px system-ui, sans-serif; text-align: center; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.45); opacity: 0.85; }
.room-pt.sel { left: -12px; top: -12px; width: 24px; height: 24px; font-size: 12px; line-height: 20px; opacity: 1; cursor: grab; }
.room-pt.lit { box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.85), 0 0 0 7px var(--c, #5c3d99); }
.room-table { width: 100%; border-collapse: collapse; margin-top: 0.5em; }
.room-table th { text-align: left; font-weight: 600; color: var(--muted); padding: 2px 4px; }
.room-table td { padding: 3px 4px; border-top: 1px solid var(--line); }
.room-table tr.lit td { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.room-table select { width: 100%; }
.room-num { display: inline-block; width: 20px; height: 20px; border-radius: 50%; background: var(--c, #5c3d99); color: #fff; font-size: 11px; font-weight: 600; text-align: center; line-height: 20px; }
.room-row { flex-wrap: wrap; gap: 6px; }

/* ---------- NFC tags (Version 107: editor-nfc.js) ---------- */
/* The list: one card per tag (the panel is narrow): serial and status, what it opens, where it is. */
.nfc-table-wrap { margin-top: 0.5em; }
.nfc-table, .nfc-table tbody { display: block; width: 100%; }
.nfc-table thead { display: none; }
.nfc-table tr { display: grid; grid-template-columns: 1fr auto auto; gap: 4px 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.nfc-table td { display: block; padding: 0; border: 0; }
.nfc-table td:nth-child(2), .nfc-table td:nth-child(3) { grid-column: 1 / -1; }
.nfc-table td:nth-child(2) { order: 3; }
.nfc-table td:nth-child(3) { order: 4; }
.nfc-table input, .nfc-table select { width: 100%; box-sizing: border-box; }
.nfc-serial { font-family: ui-monospace, Menlo, monospace; font-size: 0.75rem; word-break: break-all; }
.nfc-status { font-size: 0.8rem; text-align: right; }
.nfc-dlg input[type="checkbox"] { width: auto; margin-top: 0; }
.nfc-dlg select { width: 100%; }
.nfc-wait { display: flex; gap: 10px; align-items: center; margin: 0.8em 0; padding: 10px; border-radius: 10px; background: color-mix(in srgb, var(--accent) 12%, var(--panel)); }
.nfc-pulse { width: 14px; height: 14px; border-radius: 50%; background: var(--accent); animation: ed-me-pulse 1.4s ease-out infinite; flex: none; }
#nfc-listen[aria-pressed="true"] { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }

/* ---------- Floors (Version 108: player-floors.js, editor-floors.js) ---------- */
.floor-ctl { display: flex; flex-direction: column; background: var(--panel); overflow: hidden; }
.floor-ctl button { min-width: 40px; min-height: 34px; padding: 4px 8px; border: 0; border-bottom: 1px solid var(--line); background: var(--panel); color: var(--text); font: 600 13px/1.1 system-ui, sans-serif; cursor: pointer; }
.floor-ctl button:last-child { border-bottom: 0; }
.floor-ctl button[aria-checked="true"] { background: var(--accent); color: var(--accent-text); }
.floor-list .floor-row { display: flex; gap: 6px; align-items: center; margin: 4px 0; }
.floor-list .floor-row input[type="text"] { flex: 1; min-width: 6em; }

.player .player-floors { position: absolute; right: 12px; top: calc(var(--below-top, 70px) + 8px); z-index: 640; border-radius: 10px; box-shadow: var(--shadow); border: 1px solid var(--line); }

/* ---------- The editor's tool band, more compact (Version 109): no scroll bar ---------- */
.map-tools { gap: 3px; padding: 4px; }
.map-tools button { padding: 0.28em 0.5em; font-size: 0.82rem; }
.map-tools button .ico { font-size: 0.95rem; }
@container (max-width: 1240px) {
  .map-tools .lbl { display: none; }
  .map-tools button { min-width: 32px; padding: 0.28em 0.4em; }
}
/* A phone: the tools wrap onto a second row instead of scrolling sideways. */
@media (max-width: 800px) {
  .map-tools { flex-wrap: wrap; overflow-x: visible; gap: 2px; }
  .map-tools button { min-width: 30px; padding: 0.25em 0.35em; }
}

/* Dragging a selection (Version 110: editor-select.js) */
.sel-moving, .sel-moving * { cursor: grabbing !important; }

/* ---- Categories of walks (Version 111: src/walkbrands.js, player-walks.js) ---- */
.walks-cats { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px 8px; }
.cat-chip { display: inline-flex; align-items: center; gap: 0.4em; border-radius: 99px; padding: 4px 11px; font-size: 0.82rem; background: none; border: 1px solid var(--line); color: var(--muted); }
.cat-chip-dot { width: 0.7em; height: 0.7em; border-radius: 50%; background: var(--cat, var(--accent)); flex: none; }
.cat-chip[aria-pressed="true"] { background: var(--cat, var(--accent)); border-color: var(--cat, var(--accent)); color: #fff; font-weight: 600; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35); }
.cat-chip[aria-pressed="true"] .cat-chip-dot { background: #fff; }
.walks-cat-intro { margin: 0 16px 10px; padding: 10px 12px; border-radius: 10px; border-left: 4px solid var(--cat, var(--accent)); background: color-mix(in srgb, var(--cat, var(--accent)) 10%, transparent); }
.walks-cat-intro p { margin: 0.4em 0 0; }
.cat-intro-head { display: flex; align-items: center; gap: 10px; }
.cat-intro-head strong { display: block; font-size: 1.05rem; }
.cat-intro-head span { display: block; color: var(--muted); }
.cat-intro-icon { width: 40px; height: 40px; border-radius: 9px; flex: none; }
.cat-intro-link { display: inline-block; margin-top: 0.4em; }
.walk-item.in-cat { border-left: 3px solid var(--cat, var(--accent)); }
.wl-cat { display: inline-flex; align-items: center; gap: 0.35em; font-size: 0.75em; font-weight: 600; color: var(--cat, var(--accent)); margin: 0.15em 0; width: fit-content; }
.wl-cat img { height: 1.3em; width: 1.3em; border-radius: 3px; }
.wp-cat { margin: 0.2em 0; }
.wp-cat .wl-cat { font-size: 0.85em; }
.wp-cats { margin-top: 12px; }
.wp-cats-title { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 0 0 4px; padding: 0 4px; }
.wp-cat-item .wp-menu-ico img { width: 1.6em; height: 1.6em; border-radius: 5px; display: block; }
.wp-cat-item { border-left: 3px solid var(--cat, var(--accent)); }
.wp-cat-item.current { background: color-mix(in srgb, var(--cat, var(--accent)) 12%, transparent); }
.walk-label.in-cat { box-shadow: inset 4px 0 0 var(--cat, var(--accent)), 0 1px 5px rgba(0, 0, 0, 0.3); padding-left: 12px; }
.presented-cat { display: flex; align-items: center; gap: 0.4em; margin: 0.4em 0 0; }
.presented-cat img { width: 1.4em; height: 1.4em; border-radius: 4px; }
.cat-dot { display: inline-block; width: 0.75em; height: 0.75em; border-radius: 50%; margin-right: 0.4em; vertical-align: middle; }
.cat-field select { max-width: 100%; }
.ws-cats { margin-top: 18px; }
.ws-cats-title { font-family: 'Special Elite', 'Courier New', monospace; font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; color: #8f8a80; margin: 0 0 8px; text-align: center; }
.ws-cats-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 8px; }
.ws-cat { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 6px; border: 1.5px solid color-mix(in srgb, var(--cat) 55%, transparent); border-left-width: 5px; border-left-color: var(--cat); text-decoration: none; color: var(--ws-ink, inherit); }
.ws-cat:hover { background: color-mix(in srgb, var(--cat) 10%, transparent); }
.ws-cat img, .ws-cat-ico { width: 38px; height: 38px; border-radius: 8px; flex: none; display: grid; place-items: center; }
.ws-cat strong { display: block; font-size: 15px; }
.ws-cat small { display: block; font-size: 12px; opacity: 0.75; }

/* ---- Fade cues and devamp (Version 112: editor-cues.js) ---- */
.cue-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 6px; }
.cue-item { border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 8px; padding: 6px 8px; display: flex; flex-direction: column; gap: 4px; }
.cue-item .row { gap: 6px; align-items: center; flex-wrap: wrap; }
.cue-item select { width: auto; }
.cue-words { margin: 0; }
.chip-x { border: none; background: none; padding: 0 0 0 0.2em; font-size: 0.85em; color: inherit; cursor: pointer; }
#z-devamp-chips .chip { cursor: default; }

/* ---- "by Waypoint-Signal" after a category's name in the banner (Version 113) ---- */
.wp-banner-lockup { display: flex; align-items: baseline; gap: 0.55em; min-width: 0; }
.wp-banner-lockup .wp-banner-name { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.wp-banner-by { flex: none; white-space: nowrap; font-family: 'Special Elite', ui-monospace, monospace; font-size: 12px; letter-spacing: 0.06em; color: var(--wp-soft); text-transform: none; }
.wp-banner-by-name { font-family: 'Big Shoulders Display', 'Arial Narrow', sans-serif; font-weight: 800; font-size: 14px; letter-spacing: 0.03em; text-transform: uppercase; color: var(--wp-ink); }
.wp-banner-by-name span { color: var(--wp-signal); }
.wp-banner.has-by .wp-banner-brand { flex: 1 1 auto; min-width: 0; }
.wp-banner.has-by .wp-banner-home { min-width: 0; text-align: left; }
.wp-banner.has-by .wp-banner-right { flex: none; }
/* A phone: the name above, "by Waypoint-Signal" under it, both within the bar. */
@media (max-width: 640px) {
  .wp-banner-lockup { flex-direction: column; align-items: flex-start; gap: 1px; }
  .wp-banner.has-by .wp-banner-name { font-size: 18px; max-width: 100%; }
  .wp-banner-by { font-size: 10px; line-height: 1.1; }
  .wp-banner-by-name { font-size: 11.5px; }
  .wp-banner.has-by .wp-banner-ver-word { display: none; }
}
@media (max-width: 400px) {
  .wp-banner.has-by .wp-banner-name { font-size: 16px; }
  .wp-banner.has-by .wp-banner-ver { display: none; } /* (the version is on the About page) */
  .wp-banner.has-by { gap: 8px; }
}
@media (max-width: 640px) { .wp-banner.has-by .wp-banner-name .brand-logo { height: 20px; max-height: 20px; max-width: 100%; } }
@media (max-width: 345px) {
  .wp-banner.has-by { gap: 6px; }
  .player .wp-banner.has-by { padding-left: max(10px, env(safe-area-inset-left)); padding-right: max(10px, env(safe-area-inset-right)); }
  .wp-banner.has-by .wp-banner-name { font-size: 14px; letter-spacing: 0; }
  .wp-banner.has-by .wp-banner-aa { margin-left: 0; margin-right: 0.2em; }
}

/* ---- Tool names on or off (Version 113: editor-toollabels.js) ---- */
.ed-topbar .labels-btn { font-family: Georgia, serif; font-weight: 700; font-size: 1rem; }
.ed-topbar .labels-btn small { font-size: 0.72em; }
.ed-topbar .labels-btn[aria-pressed="true"] { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.tool-labels-on .map-tools .lbl { display: inline; }
.tool-labels-on .map-tools { flex-wrap: wrap; overflow-x: visible; }
.tool-labels-off .map-tools .lbl { display: none; }
.tool-labels-off .map-tools button { min-width: 32px; }

/* ---- The fleet (Version 114: editor-fleet.js) ---- */
.fleet-dot { display: inline-block; width: 0.7em; height: 0.7em; border-radius: 50%; background: #9a958b; vertical-align: middle; flex: none; }
.fleet-dot.on { background: #2e9d57; box-shadow: 0 0 0 3px rgba(46, 157, 87, 0.2); }
.fleet-phrase { letter-spacing: 0.04em; }
.fleet-head { display: flex; align-items: center; gap: 10px; margin: 1.2em 0 0.4em; flex-wrap: wrap; }
.fleet-alert { background: color-mix(in srgb, var(--accent) 14%, transparent); border-left: 4px solid var(--accent); padding: 8px 12px; border-radius: 8px; }
.fleet-steps { margin: 0.5em 0 0; padding-left: 1.3em; }
.fleet-servers { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); gap: 12px; margin: 10px 0 16px; }
.fleet-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--panel); display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.fleet-card.offline { opacity: 0.85; border-style: dashed; }
.fleet-card p { margin: 0; }
.fleet-card-head { display: flex; align-items: flex-start; gap: 10px; }
.fleet-card-head .fleet-dot { margin-top: 0.45em; }
.fleet-card-head .grow { min-width: 0; overflow-wrap: anywhere; }
.fleet-ver { font-size: 0.8rem; white-space: nowrap; border: 1px solid var(--line); border-radius: 99px; padding: 0.1em 0.6em; }
.fleet-ver.behind { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.fleet-stats { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 0.85rem; color: var(--muted); }
.fleet-stats strong { color: var(--text); }
.fleet-card .form-actions { flex-wrap: wrap; gap: 6px; margin: 4px 0 0; }
.fleet-settings { border-top: 1px solid var(--line); padding-top: 6px; }
.fleet-feats { display: flex; flex-direction: column; gap: 2px; margin-bottom: 6px; }
.fleet-cmds { margin: 4px 0 0; padding-left: 1.1em; color: var(--muted); }
.fleet-releases table { margin-top: 8px; }
@media (max-width: 600px) { .fleet-card-head { flex-wrap: wrap; } }
/* The administration's tabs wrap on a narrow screen (Version 114: seven of them now). */
@media (max-width: 700px) { .tabs { flex-wrap: wrap; } .tabs button { flex: 1 1 auto; } }
.fleet-rename { padding: 0 0.35em; min-width: 0; font-size: 0.8rem; vertical-align: 1px; }
.fleet-leave-ask { border: 1px solid var(--danger, #c0392b); border-radius: 8px; padding: 6px 10px; background: color-mix(in srgb, var(--danger, #c0392b) 8%, transparent); }
.fleet-leave-ask .form-actions { margin: 4px 0 0; }
.fleet-leave-note { color: var(--accent); }

/* ---- How editors join (Version 116: editor-joining.js) ---- */
.ed-policy .check { display: flex; gap: 0.5em; align-items: flex-start; }
.ed-policy .check.muted { opacity: 0.55; }
.ed-waiting-list { list-style: none; padding: 0; margin: 0.4em 0; }
.ed-waiting-list li { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 0; border-bottom: 1px solid var(--line); }
.pending-note { background: color-mix(in srgb, var(--accent) 14%, transparent); border-left: 4px solid var(--accent); padding: 8px 12px; border-radius: 8px; }
.fleet-request { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }

/* ---- Conversations (Version 117: editor-conversations.js, conversation.html) ---- */
.conv { margin: 0.6em 0 1.2em; }
.conv-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.conv-new { margin: 6px 0; display: flex; flex-direction: column; gap: 4px; }
.conv-wrap { display: grid; grid-template-columns: minmax(220px, 340px) 1fr; gap: 12px; align-items: start; }
.conv:not(.has-open) .conv-wrap { grid-template-columns: 1fr; }
.conv-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 10px; max-height: 60vh; overflow: auto; }
.conv-list li + li { border-top: 1px solid var(--line); }
.conv-item { display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left; background: none; border: 0; border-radius: 0; padding: 8px 10px; color: inherit; }
.conv-item:hover { background: var(--bg); }
.conv-item.current { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.conv-item strong { font-weight: 500; }
.conv-item.unread strong { font-weight: 700; }
.conv-dot { display: inline-block; width: 0.55em; height: 0.55em; border-radius: 50%; background: var(--accent); margin-right: 0.4em; vertical-align: 1px; }
.conv-preview { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-empty { padding: 10px; }
.conv-thread { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-width: 0; }
.conv-head { display: flex; gap: 8px; align-items: flex-start; }
.conv-back { display: none; }
.conv-msgs { list-style: none; margin: 10px 0; padding: 0; display: flex; flex-direction: column; gap: 8px; max-height: 50vh; overflow: auto; }
.conv-msg { max-width: 85%; align-self: flex-start; background: var(--bg); border: 1px solid var(--line); border-radius: 12px 12px 12px 3px; padding: 6px 10px; }
.conv-msg.mine { align-self: flex-end; background: color-mix(in srgb, var(--accent) 14%, var(--panel)); border-radius: 12px 12px 3px 12px; }
.conv-body { overflow-wrap: anywhere; }
.conv-reply textarea { width: 100%; }
.conv-actions { margin-top: 6px; }
@media (max-width: 760px) {
  .conv.has-open .conv-wrap { grid-template-columns: 1fr; }
  .conv.has-open .conv-list { display: none; }
  .conv-back { display: inline-block; }
}
.ib-reviews-h { font-size: 1.1rem; margin: 1em 0 0.2em; }
.about-contact { margin: 2em 0 1em; }
.about-contact form, .conv-page .conv-reply { display: flex; flex-direction: column; gap: 6px; max-width: 34em; }
.about-contact .ws-begin, .conv-page .ws-begin { align-self: flex-start; padding: 0 1.4em; }
.conv-page .conv-msgs { max-height: none; }
.conv-page .conv-msg { max-width: 92%; }
.conv-subject { font-size: clamp(1.6rem, 6vw, 2.4rem); }
.conv .conv-item { text-align: left; align-items: flex-start; justify-content: flex-start; }
.conv .conv-item > span { width: 100%; }

/* ---- Share a walk (Version 118) ---- */
.share-dlg { max-width: min(30rem, calc(100vw - 32px)); }
.share-dlg .check { display: block; margin-top: 0.6em; }
.share-dlg .check input { margin-right: 0.4em; }
/* Your walks: each walk's buttons wrap under it on a phone. */
@media (max-width: 700px) {
  #project-list .card { flex-wrap: wrap; }
  #project-list .card > .grow { flex: 1 1 100% !important; }
}

/* PREVIEW (Version 119): invite only, beside LIVE; lit blue */
.live-btn.preview-btn.pv-lit { background: #1f5fbf; border-color: #6ea8ff; color: #fff; text-shadow: 0 0 6px rgba(255, 255, 255, 0.6); box-shadow: 0 0 0 3px rgba(31, 95, 191, 0.25), 0 0 14px rgba(80, 140, 255, 0.45); }
.live-btn.preview-btn.pv-lit:hover { background: #2a6bd0; color: #fff; }
.live-btn.preview-btn.pv-lit .live-lamp { background: #fff; box-shadow: 0 0 6px 2px rgba(255, 255, 255, 0.9); }
.live-btn.preview-btn { letter-spacing: 0.08em; }
.live-box { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.live-box #p-visibility-note { flex-basis: 100%; }
.pill.preview { color: #2a6bd0; border-color: #6ea8ff; }
.preview-badge { display: inline-block; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; padding: 0.1em 0.5em; border-radius: 99px; background: #1f5fbf; color: #fff; vertical-align: middle; }
.share-preview { margin: 0.4em 0; }
@media (max-width: 700px) { .ed-topbar .preview-btn .live-word { letter-spacing: 0; } .ed-topbar .preview-btn { padding: 5px 8px; } }
/* Overview: PREVIEW and LIVE side by side (Version 119) */
.live-box .live-big { font-size: 1.05rem; padding: 10px 14px 10px 12px; gap: 9px; }
.live-box .live-big .live-lamp { width: 13px; height: 13px; }

/* ================= Layout pass (Version 120): phones, tablets and wide screens ================= */
/* Your walks and Administration: more room on a wide screen; each walk's buttons wrap under its
   title whenever they don't fit beside it (not only on a phone). */
.projects { max-width: 960px; }
.projects.admin { max-width: 1240px; }
#project-list .card { flex-wrap: wrap; row-gap: 0.6rem; }
#project-list .card > .grow { flex: 1 1 100% !important; min-width: 0; }
#project-list .card > [data-open] { margin-left: auto; }
/* My account: a tick box keeps its own size (not the full width of the card). */
.card.acct input[type="checkbox"], .card.acct input[type="radio"] { width: auto; flex: none; }
.card.acct label.check { align-items: flex-start; }
.card.acct label.check input { margin-top: 0.2em; }
/* Conversations: the title and its button wrap rather than squeeze. */
.conv-bar { flex-wrap: wrap; row-gap: 6px; }
.conv-bar .conv-title { flex: 1 1 auto; }
/* Tables too wide for a phone: a card per row (editor-fit.js adds .stacked). */
.table.stacked, .acc-table.stacked { display: block; overflow: visible; border: 0; background: none; }
.table.stacked > thead, .acc-table.stacked > thead { display: none; }
.table.stacked > tbody, .acc-table.stacked > tbody { display: block; }
.table.stacked > tbody > tr, .acc-table.stacked > tbody > tr { display: block; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 0.45rem 0.2rem; margin-bottom: 0.5rem; }
.table.stacked > tbody > tr > td, .acc-table.stacked > tbody > tr > td { display: block; position: relative; border: 0; padding: 0.2rem 0.6rem; width: auto; min-width: 0; overflow-wrap: anywhere; }
.table.stacked > tbody > tr > td[data-label]:not([data-label=""]), .acc-table.stacked > tbody > tr > td[data-label]:not([data-label=""]) { padding-left: calc(7.2em + 1.1rem); min-height: 1.6em; }
.table.stacked > tbody > tr > td[data-label]:not([data-label=""])::before, .acc-table.stacked > tbody > tr > td[data-label]:not([data-label=""])::before { content: attr(data-label); position: absolute; left: 0.6rem; top: 0.35rem; width: 7.2em; font-size: 0.7rem; line-height: 1.25; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.table.stacked > tbody > tr > td:empty { display: none; }
.table.stacked td select, .table.stacked td input:not([type="checkbox"]) { width: 100%; max-width: 100%; min-width: 0; }
/* The project panel's tabs: each word whole. */
.side-tabs button { min-width: min-content; }
.side-tabs { gap: 3px; }

@media (max-width: 700px) {
  /* The editor's top menu: one row that scrolls sideways (the name and the account's name give
     way; the page you're on is kept in view). */
  .topnav { flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; padding: 0.45rem 0.6rem; gap: 0.3em;
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 22px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 22px), transparent); }
  .topnav::-webkit-scrollbar { display: none; }
  .topnav .brand, .topnav #me-email, .topnav .grow { display: none; }
  .topnav button { flex: none; white-space: nowrap; padding: 0.35em 0.7em; }
  .topnav #logout { margin-right: 14px; }
  /* Pages: a little less padding, so nested cards keep their width. */
  .projects { padding: 1.2rem 0.75rem; }
  .projects h1 { margin-top: 0.2em; }
  .card { padding: 0.8rem; }
  .card .card { padding: 0.65rem; }
  .projects .card.form-card { padding: 0.9rem; }
  /* Administration: the counters in a tidy grid. */
  .stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 0.4rem; }
  .stat { min-width: 0; padding: 0.4rem 0.6rem; }
  .stat strong { font-size: 1.1rem; }
  .stat span { font-size: 0.72rem; line-height: 1.2; display: block; }
}
/* Listen mode on a narrow map: the compass bar the full width; the panel shorter, clear of the
   zoom buttons and the coordinates box, without the keyboard help. */
@container (max-width: 600px) {
  .compass-bar.in-editor { width: auto; left: 8px; right: 8px; transform: none; }
  .listen-bar { left: 8px; width: calc(100% - 60px); max-height: min(38%, calc(100% - var(--map-top-h, 70px) - 70px)); padding: 8px 10px; }
  .listen-bar > p.small.muted:first-of-type { display: none; }
  /* (The drawing tools give way while listening: ■ Stop ends Listen mode.) */
  .editor.listening .map-tools { display: none; }
  .popup-stack.in-editor { max-height: 30%; }
}
/* Listen mode: the panel sits above the coordinates box. */
.listen-bar { bottom: 56px; max-height: min(40%, calc(100% - var(--map-top-h, 70px) - 64px)); }
/* Menus off the top bar never run off the screen. */
.ed-menu, .layers-panel { max-width: calc(100vw - 16px); }

/* Player */
/* The walk's panel on a wide screen: a readable width, centred (the map shows either side). */
@media (min-width: 1000px) {
  .player .sheet { width: min(100%, 880px); margin: 0 auto; }
}
/* The simulator's weather list keeps room for its words. */
#sim-wx { min-width: 8.5em; }
/* Walks panel: the step-free tick box lines up with the rest. */
.walks-stepfree { padding-left: 12px; }
/* A very narrow phone: the map status leaves out the moon (it's in the details), so the walk's
   title has more room. */
@media (max-width: 400px) { .player .topbar #state-btn .st-moon { display: none; } }
/* The compass band: a dot waiting at an edge keeps its distance inside the band. */
.cbar-dot.edge.left { transform: translateX(-7px); align-items: flex-start; }
.cbar-dot.edge.right { transform: translateX(calc(-100% + 7px)); align-items: flex-end; }
/* The Go to menu: a long walk name ends in "…" inside the menu. */
.ed-menu button { display: block; min-width: 0; max-width: 100%; flex: none; }
/* The Layers list opens over the tool band below it. */
.map-menus { position: relative; z-index: 3; }
/* Phones: buttons big enough for a finger (at least about 32 px). */
@media (max-width: 700px) {
  .wp-banner-aa, .wp-banner-lang { min-height: 32px; min-width: 32px; padding-left: 0.35em; padding-right: 0.35em; }
  .wp-banner-aa { margin-left: 0.3em; margin-right: 0.3em; }
  .ed-topbar #tg-project, .ed-topbar #tg-props { min-width: 30px; min-height: 32px; padding-left: 4px; padding-right: 4px; }
  #sheet-toggle { min-height: 32px; padding: 4px 8px; }
  .player .compass-bar .cbar-close { width: 30px; height: 30px; }
  .live-btn.live-small { min-height: 32px; }
  .ws-link { display: inline-block; padding-top: 6px; padding-bottom: 6px; }
  .coords-btn { min-width: 30px; }
  .small-btn { min-height: 30px; }
  .chip-x { min-width: 24px; min-height: 24px; }
}
/* Phones: the Go to and Layers menus are fixed just below their button (editor-fit.js places them). */
@media (max-width: 700px) { .ed-menu, .layers-panel { position: fixed; z-index: 1300; } }
@media (max-width: 700px) { .ed-topbar .tb-sep { display: none; } }

/* ================= Sound containers (Version 121) ================= */
#zone-panel.is-container .not-container { display: none !important; }
.container-only { display: none; }
#zone-panel.is-container .container-only { display: block; }
.container-note { margin: 0.3em 0 0.4em; padding: 0.5em 0.7em; border: 1px dashed var(--accent); border-radius: 8px; }
.gap-in-list { margin: 0.2em 0 0.4em; }
/* The Sound containers tab */
.side-tabs { flex-wrap: wrap; row-gap: 3px; }
.sc-card { border: 1px solid var(--line); border-radius: 10px; margin: 0 0 0.6em; background: var(--panel); }
.sc-card > summary { cursor: pointer; padding: 0.55em 0.6em; display: flex; flex-wrap: wrap; gap: 0.35em; align-items: baseline; }
.sc-card > .sc-body { padding: 0 0.6em 0.6em; }
.sc-ico { color: var(--accent); font-weight: 700; width: 1.1em; text-align: center; flex: none; }
.sc-row { display: grid; grid-template-columns: 6.2em minmax(0, 1fr); gap: 0.4em; align-items: center; margin: 0.3em 0; }
.sc-row label { margin: 0; }
.sc-row select, .sc-row input:not(.sc-num) { width: 100%; min-width: 0; }
.sc-inline { display: inline-flex; align-items: center; gap: 0.3em; }
.sc-num { width: 3.2em; }
.sc-body input[type="number"] { -moz-appearance: textfield; appearance: textfield; padding-left: 4px; padding-right: 4px; }
.sc-body input[type="number"]::-webkit-inner-spin-button, .sc-body input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.sc-delay { display: flex; flex-wrap: wrap; gap: 0.3em; align-items: center; margin: 0.35em 0; }
.sc-delay .sc-lbl { flex: 1 1 100%; color: var(--muted); }
.sc-delay input { width: 3.6em; }
.sc-delay select { width: auto; }
.sc-items { list-style: none; margin: 0.4em 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.sc-items .sc-clip { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25em 0.35em; padding: 3px 4px; border-radius: 6px; background: color-mix(in srgb, var(--text) 4%, transparent); }
.sc-clip .sc-name { flex: 1 1 7em; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.9rem; }
.sc-times { display: inline-flex; align-items: center; gap: 0.2em; }
.sc-times input { width: 2.6em; padding: 2px 3px; }
.sc-tools { display: inline-flex; gap: 2px; flex: none; margin-left: auto; }
.sc-tools .icon { padding: 2px 5px; font-size: 0.75rem; }
.sc-group { display: block; border-left: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); padding-left: 6px; }
.sc-group.sc-lists { border-left-color: color-mix(in srgb, var(--accent) 90%, transparent); }
.sc-group > details > summary { cursor: pointer; padding: 3px 0; display: flex; flex-wrap: wrap; gap: 0.2em 0.35em; align-items: center; }
.sc-group > details > summary .sc-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-group > details > summary .sc-sum { flex: 1 1 100%; padding-left: 1.45em; }
.sc-group .sc-body { padding: 0.2em 0 0.3em; }
.sc-group .sc-row { grid-template-columns: minmax(0, 1fr); gap: 0.15em; }
.sc-group .sc-group { padding-left: 4px; }
.sc-add { margin-top: 0.3em; gap: 0.4em; }
.sc-add-clip { max-width: 100%; }
.sc-words { margin: 0.3em 0 0; }
.sc-empty { padding: 2px 4px; }

/* ================= Sound mosaics (Version 122) ================= */
body.mo-open { overflow: hidden; }
.mo-ed { position: fixed; inset: 0; z-index: 3000; background: var(--bg); display: flex; flex-direction: column; }
.mo-ed.hidden { display: none; }
.mo-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 10px; border-bottom: 1px solid var(--line); background: var(--panel); }
.mo-bar button, .mo-bar select { white-space: nowrap; }
.mo-sep { width: 1px; align-self: stretch; background: var(--line); margin: 0 2px; }
.mo-fold-label { margin: 0; display: inline-flex; align-items: center; gap: 4px; }
.mo-fold-label input { width: 3.6em; }
.mo-main { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 300px; }
.mo-canvas { position: relative; min-width: 0; min-height: 0; background: radial-gradient(circle, color-mix(in srgb, var(--text) 10%, transparent) 1px, transparent 1px) 0 0 / 22px 22px; }
#mo-svg { width: 100%; height: 100%; display: block; touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab; }
#mo-svg:active { cursor: grabbing; }
.mo-empty { position: absolute; left: 50%; top: 45%; transform: translate(-50%, -50%); text-align: center; max-width: 80%; pointer-events: none; }
.mo-insp { border-left: 1px solid var(--line); background: var(--panel); padding: 10px 12px; overflow-y: auto; }
.mo-insp h3 { margin: 0.1em 0 0.4em; }
.mo-insp select, .mo-insp input:not([type="checkbox"]):not([type="number"]) { width: 100%; }
.mo-delay { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.mo-delay input { width: 4.2em; }
.mo-delay select { width: auto !important; }
.mo-cell rect { fill: var(--panel); stroke: var(--line); stroke-width: 1.5; }
.mo-cell { cursor: move; }
.mo-cell.silent rect { stroke-dasharray: 4 3; fill: color-mix(in srgb, var(--panel) 70%, transparent); }
.mo-cell.start rect { stroke: var(--ok, #3a3); stroke-width: 2.5; }
.mo-cell.on rect { stroke: var(--accent); stroke-width: 3; }
.mo-cell.been rect { fill: color-mix(in srgb, var(--accent) 14%, var(--panel)); }
.mo-cell.now rect { fill: color-mix(in srgb, var(--accent) 45%, var(--panel)); stroke: var(--accent); stroke-width: 3; }
.mo-name { font-size: 13px; font-weight: 600; fill: var(--text); pointer-events: none; }
.mo-sub { font-size: 11px; fill: var(--muted); pointer-events: none; }
.mo-port { fill: var(--accent); stroke: var(--panel); stroke-width: 2; cursor: crosshair; }
.mo-port:hover { r: 9; }
.mo-link .mo-line { stroke: color-mix(in srgb, var(--text) 55%, transparent); stroke-width: 2; fill: none; }
.mo-link marker path, #mo-svg marker path { fill: color-mix(in srgb, var(--text) 70%, transparent); }
.mo-link.close .mo-line { stroke-dasharray: 7 4; }
.mo-link.on .mo-line { stroke: var(--accent); stroke-width: 3; }
.mo-link .mo-hit { stroke: transparent; stroke-width: 16; fill: none; cursor: pointer; }
.mo-lw { font-size: 11px; fill: var(--muted); pointer-events: none; }
.mo-drag-line { stroke: var(--accent); stroke-width: 2; stroke-dasharray: 5 4; pointer-events: none; }
.mo-gen-dlg { width: min(860px, calc(100vw - 24px)); max-height: calc(100vh - 24px); overflow-y: auto; }
.mg-grid { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 16px; }
.mg-pool { max-height: 140px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px; }
.mg-preview { width: 100%; aspect-ratio: 1; background: var(--panel); border-radius: 12px; border: 1px solid var(--line); }
.mg-preview line { stroke: color-mix(in srgb, var(--text) 50%, transparent); stroke-width: 3; }
.mg-preview line.one { stroke: var(--accent); }
.mg-preview circle { fill: var(--panel); stroke: var(--text); stroke-width: 3; }
.mg-preview circle.full { fill: var(--accent); }
@media (max-width: 760px) {
  .mo-main { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) minmax(140px, 42%); }
  .mo-insp { border-left: 0; border-top: 1px solid var(--line); }
  .mg-grid { grid-template-columns: minmax(0, 1fr); }
  .mg-side { order: -1; max-width: 260px; margin: 0 auto; }
  .mo-bar { gap: 4px; padding: 6px; }
  .mo-sep, #mo-count { display: none; }
}
.mo-bar select { width: auto; max-width: 15em; }
.mo-bar .mo-fold-label input { width: 3.6em; padding: 4px; }

/* ================= The piano roll (Version 123) ================= */
.pr-ed { position: fixed; inset: 0; z-index: 3100; background: var(--bg); display: flex; flex-direction: column; }
.pr-ed.hidden { display: none; }
.pr-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 7px 10px; background: var(--panel); border-bottom: 1px solid var(--line); }
.pr-tools label { margin: 0; display: inline-flex; align-items: center; gap: 4px; color: var(--text); font-size: 0.85rem; }
.pr-tools select, .pr-tools input[type="number"] { width: auto; padding: 3px 5px; }
.pr-tools input[type="number"] { width: 4em; }
.pr-sep { width: 1px; align-self: stretch; background: var(--line); }
.pr-help { margin: 4px 10px; }
.pr-scroll { flex: 1; overflow: auto; min-height: 0; }
#pr-svg { display: block; touch-action: none; user-select: none; -webkit-user-select: none; }
.pr-row { fill: color-mix(in srgb, var(--panel) 92%, var(--text)); }
.pr-row.blk { fill: var(--panel); }
.pr-row.c { fill: color-mix(in srgb, var(--panel) 84%, var(--text)); }
.pr-key { fill: #e9e7e2; stroke: #999; stroke-width: 0.5; cursor: pointer; }
.pr-key.blk { fill: #2a2a2a; }
.pr-kname { font-size: 10px; fill: #333; pointer-events: none; }
.pr-step { stroke: color-mix(in srgb, var(--text) 8%, transparent); }
.pr-beat { stroke: color-mix(in srgb, var(--text) 20%, transparent); }
.pr-barline { stroke: color-mix(in srgb, var(--text) 45%, transparent); stroke-width: 1.5; }
.pr-end { stroke: var(--accent); stroke-width: 2; }
.pr-note rect:first-child { fill: var(--accent); stroke: color-mix(in srgb, var(--accent) 60%, #000); cursor: move; }
.pr-note.on rect:first-child { fill: #fff; stroke: var(--accent); stroke-width: 2; }
.pr-edge { fill: transparent; cursor: ew-resize; }
.pr-head { stroke: #ff3b6b; stroke-width: 2; pointer-events: none; }
.mo-roll rect { fill: var(--accent); }
@media (max-width: 760px) { .pr-tools { gap: 4px 8px; padding: 5px 6px; } .pr-sep { display: none; } }
