/* ============================================================
   Aeola v12 — "Mesh": warm charcoal ground, a soft multi-hue
   gradient wash, glassy translucent chrome. Same functionality
   as v11 end to end — this pass only changes how it looks and
   how interaction feels underfoot (motion, glow, glass).
   ============================================================ */
:root {
  /* "Night instrument panel" — a dark glass cockpit / EFIS display,
     not a paper sectional chart: same navigation vocabulary (isogons,
     contours, bearings), rendered as thin glowing lines on black
     glass instead of ink on cream, to keep the calm, night-flight
     character the room already had. */
  color-scheme: dark;
  --accent: 110, 214, 160;   /* instrument-panel phosphor green — primary */
  --accent2: 224, 168, 84;   /* caution amber — secondary glow, recording state */
  --paper: 226, 236, 230;
  --glass: rgba(180, 210, 195, 0.10);
  --glass-strong: rgba(180, 210, 195, 0.16);
  --glass-line: rgba(180, 210, 195, 0.30);
  --panel-bg: rgba(8, 12, 13, 0.74);
}
@media (prefers-reduced-motion: reduce) {
  .tagline, .hint p { animation: none; opacity: 1; }
  .wm-l.wm-locked { animation: none; }
  .node-panel, .snapshot-panel, .reveal-toggle .switch, .toast, .help-backdrop, .help-modal { transition-duration: 0.01ms !important; }
  .rel-detail { animation: none; }
  .snap-chip.chip-new { animation: none; box-shadow: 0 0 0 2px rgba(var(--accent2), 0.4); }
}
* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  user-select: none;
}
input, textarea {
  -webkit-user-select: text;
  user-select: text;
}
html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #0f1519;
}
body {
  font-family: -apple-system, "Segoe UI", system-ui, Helvetica, Arial, sans-serif;
}
canvas {
  display: block;
  width: 100vw;
  height: 100vh;
  touch-action: none;
  cursor: crosshair;
}
.overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 22px 22px 18px;
}
.top {
  text-align: center;
}
/* ── The opening title: a film's first frame rather than a logo. It only
   exists before the first touch, so it can afford to be large. title.js
   drives three custom properties per letter while it tunes in:
   --wm-a (the letter's own brightness, which beats), --wm-dx (how far its
   green twin sways) and --wm-g (how visible the twin still is). */
.title {
  margin-top: clamp(4px, 6vh, 64px);
  transition: opacity 1.4s ease;
}
.title.hidden { opacity: 0; }
.wordmark {
  display: flex;
  justify-content: center;
  gap: 0.36em;
  margin: 0;
  /* the gap sits between letters only, so no trailing-tracking offset */
  font-family: -apple-system, "SF Pro Display", "Segoe UI", system-ui, sans-serif;
  font-weight: 200;
  font-size: clamp(38px, min(8.5vw, 11vh), 88px);
  line-height: 1;
  color: rgb(var(--paper));
}
.wm-l {
  position: relative;
  display: inline-block;
  opacity: var(--wm-a, 0);
  text-shadow: 0 0 calc(0.35em) rgba(var(--accent), 0.28);
}
/* The twin: the same letter in the room's green, a little out of tune. */
.wm-l::after {
  content: attr(data-l);
  position: absolute;
  inset: 0;
  color: rgb(var(--accent));
  opacity: var(--wm-g, 0);
  transform: translateX(var(--wm-dx, 0));
  text-shadow: 0 0 0.3em rgba(var(--accent), 0.6);
  mix-blend-mode: screen;
  pointer-events: none;
}
/* The moment a pair agrees: one soft bloom, then the steady glow. */
.wm-l.wm-locked { animation: wmLock 1.3s cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes wmLock {
  0% { text-shadow: 0 0 0.12em rgba(var(--accent), 0.95), 0 0 0.6em rgba(var(--accent), 0.55); }
  100% { text-shadow: 0 0 0.35em rgba(var(--accent), 0.28); }
}
.wm-string {
  position: relative;
  width: min(78vw, 5.6em);
  font-size: clamp(38px, min(8.5vw, 11vh), 88px); /* so em matches the wordmark */
  height: 24px;
  margin: 0.14em auto 0;
}
.wm-string svg { display: block; width: 100%; height: 100%; overflow: visible; }
/* The amber lamp at the string's end: lights once the word is in tune. */
.wm-lamp {
  position: absolute;
  right: -2px;
  top: 50%;
  width: 6px;
  height: 6px;
  margin-top: -3px;
  border-radius: 50%;
  background: rgb(var(--accent2));
  box-shadow: 0 0 10px 1px rgba(var(--accent2), 0.7);
  opacity: 0;
  transition: opacity 1.2s ease;
}
.title.in-tune .wm-lamp { opacity: 1; animation: dotPulse 4.5s ease-in-out 1.2s infinite; }
@keyframes dotPulse {
  0%, 100% { opacity: 0.65; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.25); }
}
.tagline {
  margin: 14px auto 0;
  max-width: 34em;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.06em;
  color: rgba(var(--paper), 0.62);
  opacity: 0;
  text-wrap: balance;
  animation: titleRise 1.6s cubic-bezier(0.16, 1, 0.3, 1) 2.6s forwards;
}
@keyframes titleRise {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* The intro text: one gesture per line, room to breathe between them. */
.hint {
  margin: clamp(22px, 5vh, 44px) auto 0;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12.5px;
  line-height: 1.6;
  letter-spacing: 0.01em;
  color: rgba(220, 218, 230, 0.74);
  transition: opacity 1.4s ease;
  max-width: 34em;
}
.hint p {
  margin: 0 0 0.85em;
  text-wrap: balance;
  opacity: 0;
  animation: titleRise 1.2s ease forwards;
}
.hint p:nth-child(1) { animation-delay: 3.0s; }
.hint p:nth-child(2) { animation-delay: 3.25s; }
.hint p:nth-child(3) { animation-delay: 3.5s; }
.hint p:nth-child(4) { animation-delay: 3.75s; }
.hint p:nth-child(5) { animation-delay: 4.0s; }
.hint.hidden { opacity: 0; }
html:not(.touch) .touch-only { display: none; }
.reveal-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 10.5px;
  letter-spacing: 0.02em;
  color: rgba(220, 218, 230, 0.92);
  cursor: pointer;
  user-select: none;
  background: var(--glass);
  border: 1px solid var(--glass-line);
  border-radius: 999px;
  padding: 7px 12px 7px 14px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: color 0.2s ease, background 0.2s ease, transform 0.15s ease;
}
.reveal-toggle:hover { color: rgba(var(--paper), 0.92); background: var(--glass-strong); }
.reveal-toggle:active { transform: scale(0.97); }
.switch {
  width: 30px;
  height: 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  position: relative;
  transition: background 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  flex: none;
}
.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(240, 238, 245, 0.9);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), background 0.35s ease;
}
.reveal-toggle.on .switch {
  background: rgba(var(--accent), 0.55);
  box-shadow: 0 0 12px rgba(var(--accent), 0.45);
}
.reveal-toggle.on .switch::after { transform: translateX(12px); background: #fff; }
@keyframes recPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 80, 80, 0.35); }
  50% { box-shadow: 0 0 0 6px rgba(255, 80, 80, 0); }
}
@keyframes driftPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(var(--accent2), 0.3); }
  50% { box-shadow: 0 0 10px 2px rgba(var(--accent2), 0.25); }
}

.node-panel {
  position: fixed;
  width: 220px;
  max-height: calc(100vh - 24px);
  overflow-y: auto;
  padding: 32px 16px 16px;
  background: var(--panel-bg);
  border: 1px solid var(--glass-line);
  border-radius: 20px;
  box-shadow: 0 20px 56px -12px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  color: rgba(240, 238, 245, 0.88);
  z-index: 30;
  opacity: 0;
  transform: scale(0.96) translateY(6px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
.node-panel.visible { opacity: 1; transform: scale(1) translateY(0); pointer-events: auto; }
.node-panel .panel-row { margin-bottom: 11px; }
.node-panel .panel-row:last-child { margin-bottom: 0; }
.node-panel .panel-label {
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(220, 218, 230, 0.83);
  margin-bottom: 6px;
}
.node-panel .pill-group { display: flex; gap: 6px; flex-wrap: wrap; }
.node-panel .pill {
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 10.5px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}
.node-panel .pill:hover { background: rgba(255, 255, 255, 0.13); }
.node-panel .pill:active { transform: scale(0.95); }
.node-panel .pill.active {
  background: rgba(var(--accent), 0.35);
  border-color: rgba(var(--accent), 0.65);
  color: #fff;
}
.node-panel input[type="range"] {
  width: 100%;
  accent-color: rgb(var(--accent));
}
.node-panel .close-btn {
  position: absolute;
  top: 8px;
  right: 10px;
  background: none;
  border: none;
  color: rgba(220, 218, 230, 0.9);
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  padding: 2px 4px;
  transition: color 0.2s ease;
}
.node-panel .close-btn:hover { color: rgba(var(--paper), 0.95); }
.node-panel .reveal-toggle { width: 100%; justify-content: space-between; padding-right: 14px; background: none; border: none; backdrop-filter: none; padding-left: 0; }
.node-panel .panel-title {
  display: none;
  font-size: 10px;
  letter-spacing: 0.04em;
  color: rgba(var(--accent), 0.95);
  margin: -14px 0 10px 0;
}
.node-panel .panel-title.visible { display: block; }

#weatherPanel { left: 22px; bottom: 70px; }

.shutter { position: fixed; inset: 0; pointer-events: none; z-index: 45; }
.shutter-blade {
  position: absolute; left: 0; right: 0; height: 52%;
  background: linear-gradient(180deg, #0d0c12 0%, #1c1a26 100%);
  backdrop-filter: blur(2px);
  transition: transform 0.32s cubic-bezier(0.6, 0, 0.2, 1);
}
.shutter-blade.top { top: 0; transform: translateY(-100%); }
.shutter-blade.bottom { bottom: 0; transform: translateY(100%); }
.shutter.closing .shutter-blade.top { transform: translateY(0); }
.shutter.closing .shutter-blade.bottom { transform: translateY(0); }

.snapshot-panel {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 320px;
  max-width: 86vw;
  padding: 26px 22px 20px;
  background: rgba(17, 16, 23, 0.78);
  border-left: 1px solid var(--glass-line);
  box-shadow: -24px 0 60px rgba(0, 0, 0, 0.45), inset 1px 0 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  color: rgba(240, 238, 245, 0.88);
  z-index: 40;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
}
.snapshot-panel.visible { transform: translateX(0); }
.snapshot-panel .close-btn {
  position: absolute; top: 14px; right: 16px;
  background: none; border: none;
  color: rgba(220, 218, 230, 0.9);
  cursor: pointer; font-size: 16px; line-height: 1; padding: 2px 4px;
  transition: color 0.2s ease;
}
.snapshot-panel .close-btn:hover { color: rgba(var(--paper), 0.95); }
.snapshot-panel h2 {
  font-family: -apple-system, "Segoe UI", system-ui, sans-serif;
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -0.01em;
  margin: 0 0 2px;
  color: rgba(var(--paper), 0.95);
}
.snapshot-panel .snap-time {
  font-size: 10.5px;
  color: rgba(220, 218, 230, 0.77);
  margin-bottom: 18px;
}
.snapshot-panel .snap-section { margin-bottom: 18px; }
.snapshot-panel .snap-label {
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(220, 218, 230, 0.8);
  margin-bottom: 8px;
}
.snapshot-panel .snap-chip {
  display: inline-block;
  padding: 5px 10px;
  margin: 0 6px 6px 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--glass-line);
  font-size: 11px;
}
.snapshot-panel .snap-line {
  font-size: 12px;
  line-height: 1.55;
  color: rgba(230, 228, 238, 0.75);
  margin-bottom: 6px;
}
.snapshot-panel .rel-new { position: relative; padding-left: 12px; }
.snapshot-panel .rel-new::before {
  content: "";
  position: absolute; left: 0; top: 7px;
  width: 5px; height: 5px; border-radius: 50%;
  background: rgb(var(--accent2));
  box-shadow: 0 0 6px 1px rgba(var(--accent2), 0.6);
}
.snapshot-panel .rel-detail {
  font-size: 11px;
  color: rgba(220, 218, 230, 0.9);
  font-style: italic;
  margin: -3px 0 8px 12px;
}
/* Only the genuine open-it-just-now moment animates. The panel rebuilds
   itself from scratch every 500ms while open (to stay "live"), which
   recreates this element even when nothing actually changed — without
   this split, an already-open detail replayed its fade-in on every
   rebuild, reading as a synchronized blink rather than a single open. */
.snapshot-panel .rel-detail.rel-detail-enter {
  animation: relDetailIn 0.2s ease;
}
@keyframes relDetailIn {
  from { opacity: 0; transform: translateY(-3px); }
  to { opacity: 1; transform: translateY(0); }
}
.snapshot-panel .snap-chip.chip-new {
  border: 1px solid rgba(var(--accent2), 0.7);
  box-shadow: 0 0 0 0 rgba(var(--accent2), 0.5);
  animation: chipNewGlow 1.8s ease-in-out 1;
}
@keyframes chipNewGlow {
  0% { box-shadow: 0 0 0 0 rgba(var(--accent2), 0.55); }
  50% { box-shadow: 0 0 8px 2px rgba(var(--accent2), 0.45); }
  100% { box-shadow: 0 0 0 0 rgba(var(--accent2), 0); }
}
.snapshot-panel .snap-empty {
  font-size: 12px;
  line-height: 1.6;
  color: rgba(220, 218, 230, 0.83);
}
.snapshot-panel .save-row {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}
.snapshot-panel .save-row input {
  flex: 1;
  min-width: 0;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--glass-line);
  border-radius: 10px;
  padding: 7px 9px;
  color: rgba(240, 238, 245, 0.92);
  font-family: inherit;
  font-size: 11px;
}
.snapshot-panel .save-row input::placeholder { color: rgba(220, 218, 230, 0.9); }
.snapshot-panel .save-btn {
  background: rgba(var(--accent), 0.35);
  border: 1px solid rgba(var(--accent), 0.55);
  color: #fff;
  border-radius: 10px;
  padding: 7px 12px;
  font-family: inherit;
  font-size: 11px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}
.snapshot-panel .save-btn:hover { background: rgba(var(--accent), 0.5); }
.snapshot-panel .save-btn:active { transform: scale(0.96); }
#fieldPanel .remove-btn {
  background: rgba(255, 90, 90, 0.16);
  border: 1px solid rgba(255, 90, 90, 0.4);
  color: rgba(255, 210, 210, 0.95);
  border-radius: 10px;
  padding: 7px 12px;
  font-family: inherit;
  font-size: 11px;
  cursor: pointer;
  width: 100%;
  transition: background 0.2s ease, transform 0.15s ease;
}
#fieldPanel .remove-btn:hover { background: rgba(255, 90, 90, 0.28); }
#fieldPanel .remove-btn:active { transform: scale(0.97); }
.snapshot-panel .saved-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 4px;
  margin: 0 -4px;
  border-top: 1px solid var(--glass-line);
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.snapshot-panel .saved-item:hover { background: rgba(255, 255, 255, 0.05); }
.snapshot-panel .saved-item:first-of-type { border-top: none; }
.snapshot-panel .saved-meta { font-size: 10px; color: rgba(220, 218, 230, 0.77); margin-top: 2px; }
.snapshot-panel .saved-name { font-size: 12px; color: rgba(240, 238, 245, 0.88); }
.snapshot-panel .saved-actions { display: flex; align-items: center; gap: 2px; flex: none; }
.snapshot-panel .saved-share {
  background: none; border: none; cursor: pointer;
  color: rgba(220, 218, 230, 0.73);
  font-size: 12px; padding: 2px 4px; flex: none;
  white-space: nowrap;
  transition: color 0.15s ease;
}
.snapshot-panel .saved-share:hover { color: rgb(var(--accent2)); }
.snapshot-panel .saved-del {
  background: none; border: none; cursor: pointer;
  color: rgba(220, 218, 230, 0.73);
  font-size: 13px; padding: 2px 4px; flex: none;
  transition: color 0.15s ease;
}
.snapshot-panel .saved-del:hover { color: rgba(255, 140, 140, 0.85); }
.snapshot-panel .snap-chip-row { display: inline-flex; align-items: center; gap: 2px; margin: 0 6px 6px 0; }
.snapshot-panel .snap-chip-row .snap-chip { margin: 0; }
.snapshot-panel .nudge-btn {
  background: none; border: none; cursor: pointer;
  color: rgba(220, 218, 230, 0.9); font-size: 11px; padding: 2px 5px;
  font-family: inherit; transition: color 0.15s ease;
}
.snapshot-panel .nudge-btn:hover { color: rgba(240, 238, 245, 0.92); }
.toast {
  position: fixed; bottom: 78px; left: 50%; z-index: 50;
  max-width: 86vw; text-align: center;
  background: var(--panel-bg);
  border: 1px solid var(--glass-line);
  border-radius: 999px;
  padding: 9px 18px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 11.5px;
  color: rgba(var(--paper), 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }

.help-backdrop {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(8, 7, 11, 0.55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.help-backdrop.visible { opacity: 1; pointer-events: auto; }
.help-modal {
  position: relative;
  width: 380px; max-width: 100%;
  /* The help text grew with the synchroscope and north — scroll inside
     the card rather than let it spill past the top of the screen. */
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  box-sizing: border-box;
  background: var(--panel-bg);
  border: 1px solid var(--glass-line);
  border-radius: 20px;
  padding: 28px 22px 22px;
  box-shadow: 0 20px 56px -12px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  color: rgba(240, 238, 245, 0.88);
  transform: scale(0.96) translateY(6px);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
.help-backdrop.visible .help-modal { transform: scale(1) translateY(0); }
.help-modal .close-btn {
  position: absolute; top: 8px; right: 10px;
  background: none; border: none;
  color: rgba(220, 218, 230, 0.9);
  cursor: pointer; font-size: 15px; line-height: 1; padding: 2px 4px;
  transition: color 0.2s ease;
}
.help-modal .close-btn:hover { color: rgba(var(--paper), 0.95); }
.help-modal-title {
  font-family: -apple-system, "Segoe UI", system-ui, sans-serif;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.01em;
  margin-bottom: 14px;
  color: rgba(var(--paper), 0.92);
}
.help-list { margin: 0; padding: 0 0 0 18px; }
.help-list li {
  font-size: 12px;
  line-height: 1.6;
  margin-bottom: 10px;
  color: rgba(230, 228, 238, 0.82);
}
.help-list li:last-child { margin-bottom: 0; }
.help-list b { color: rgba(var(--accent), 0.95); font-weight: 500; }
.help-credit {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--glass-line);
  font-size: 10px;
  letter-spacing: 0.04em;
  color: rgba(220, 228, 224, 0.75);
}
.wheel-canvas {
  display: block; width: 200px; height: 200px; margin: 6px auto 16px;
}

/* ============================================================
   Mobile — one hamburger icon and the room, everything else waits
   to be asked for. Combined with a single width breakpoint below
   700px is deliberate: it also gives a narrow desktop window (not
   just a phone) the same decluttered layout, which is the actual
   failure mode this whole pass is fixing.
   ============================================================ */
@media (max-width: 700px) {

  /* Contextual panels (note/field/weather) anchor to the bottom edge
     instead of chasing the tapped point — a popover pinned under your
     fingertip gets covered by your own hand; a sheet in a fixed,
     predictable spot doesn't. */
  .node-panel {
    left: 0 !important; right: 0 !important; top: auto !important; bottom: 0 !important;
    width: 100% !important;
    max-width: 100vw;
    max-height: 75vh;
    border-radius: 20px 20px 0 0;
    transform: translateY(100%);
  }
  .node-panel.visible { transform: translateY(0); }

  /* Snapshot becomes a full sheet, not a sliver beside the canvas —
     320px (or even 86vw) still reads as "the canvas is still there,
     cramped" on a phone; it should read as its own screen. */
  .snapshot-panel { width: 100vw; max-width: 100vw; }

  /* Touch targets: several controls in here were sized for a mouse
     pointer (13px nudge arrows, a 15px share icon). Pad up to a real
     44px hit area without inflating the glyphs themselves. */
  .snapshot-panel .nudge-btn { padding: 10px 12px; font-size: 13px; }
  .snapshot-panel .saved-share, .snapshot-panel .saved-del { padding: 10px; font-size: 15px; }
  .snapshot-panel .snap-line[title*="Tap to hear"] { padding: 8px 0; }
  .node-panel .pill { padding: 9px 13px; }
  .node-panel .close-btn, .snapshot-panel .close-btn { font-size: 20px; padding: 8px; }
}

/* ============================================================
   v22 — readable at normal brightness, a phone dock, first-run intro
   ============================================================ */

/* No space bar on a touch screen: hide help that talks about it. */
.touch .desktop-only { display: none; }


/* Play/pause glyph on drift — green, because it starts something. SVG, not
   a ▶ character, which iOS would render as a coloured emoji. */
.btn-icon { width: 9px; height: 9px; margin-right: 7px; vertical-align: -1px; fill: rgb(var(--accent)); flex: none; }

.help-intro {
  display: block; margin: 16px 0 0; padding: 0;
  background: none; border: none; cursor: pointer;
  font: inherit; font-size: 11.5px;
  color: rgba(var(--accent), 0.95);
  text-decoration: underline; text-underline-offset: 3px;
}

.coach {
  position: fixed; left: 50%; bottom: 112px; z-index: 55;
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 16px;
  width: max-content; max-width: min(460px, calc(100vw - 32px));
  padding: 12px 14px 12px 18px;
  background: rgba(10, 15, 18, 0.9);
  border: 1px solid rgba(var(--accent), 0.5);
  border-radius: 14px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 13px; line-height: 1.45;
  color: rgba(var(--paper), 0.96);
  box-shadow: 0 12px 40px -12px rgba(0, 0, 0, 0.7), 0 0 26px -8px rgba(var(--accent), 0.45);
  pointer-events: auto;
  animation: coachIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.coach[hidden] { display: none; }
.coach-text.swap { animation: coachTextIn 0.45s ease; }
.coach-skip {
  flex: none; padding: 4px 2px;
  background: none; border: none; cursor: pointer;
  font: inherit; font-size: 11.5px;
  color: rgba(220, 218, 230, 0.75);
}
.coach-skip:hover { color: rgba(var(--paper), 1); }
@keyframes coachIn { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes coachTextIn { from { opacity: 0; } to { opacity: 1; } }
/* The button the intro is talking about breathes a green ring. */
.coach-target { animation: coachPulse 1.6s ease-in-out infinite !important; }
@keyframes coachPulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(var(--accent), 0.8), 0 0 10px 0 rgba(var(--accent), 0.3); }
  50% { box-shadow: 0 0 0 2px rgba(var(--accent), 1), 0 0 24px 5px rgba(var(--accent), 0.55); }
}

@media (max-width: 700px) {

  .hint { font-size: 12.5px; padding: 0 8px; }
  .tagline { font-size: 12.5px; padding: 0 12px; }


  .coach { bottom: calc(86px + env(safe-area-inset-bottom, 0px)); font-size: 13.5px; }
}

/* ============================================================
   v23 — one menu for every screen, grouped by intent
   ============================================================ */

/* The dock: ▶ drift bottom left, lock all bottom right — on every screen. */
.mobile-dock {
  display: flex; justify-content: space-between; gap: 12px;
  position: fixed; left: 18px; right: 18px; z-index: 20;
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  pointer-events: none;
}
.dock-btn {
  pointer-events: auto;
  display: flex; align-items: center;
  min-height: 44px; padding: 10px 18px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12.5px;
  letter-spacing: 0.02em;
  color: rgba(var(--paper), 0.94);
  background: rgba(20, 28, 32, 0.78);
  border: 1px solid var(--glass-line);
  border-radius: 999px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  cursor: pointer;
  animation: coachTextIn 0.6s ease;
}
.dock-btn[hidden] { display: none; }
.dock-btn:active { transform: scale(0.97); }
#dockLockBtn { margin-left: auto; }
.dock-btn.drifting { border-color: rgba(var(--accent), 0.6); }

@media (min-width: 701px) {
  .mobile-dock { left: 24px; right: 24px; bottom: 22px; }
}

/* Menu button — top right, everywhere. */
.menu-open {
  position: fixed; z-index: 45;
  top: calc(18px + env(safe-area-inset-top, 0px)); right: 18px;
  width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(20, 28, 32, 0.78);
  border: 1px solid var(--glass-line);
  border-radius: 50%;
  color: rgba(var(--paper), 0.92);
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: background 0.2s ease, transform 0.15s ease;
}
.menu-open:hover { background: rgba(32, 42, 48, 0.9); }
.menu-open:active { transform: scale(0.94); }
.menu-open svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
body:has(.snapshot-panel.visible) .menu-open,
body:has(.help-backdrop.visible) .menu-open,
body:has(.menu.visible) .menu-open { display: none; }

.menu-shade {
  position: fixed; inset: 0; z-index: 58;
  background: rgba(3, 6, 8, 0.45);
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s ease;
}
.menu-shade.visible { opacity: 1; pointer-events: auto; }

.menu {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 60;
  width: min(360px, 90vw);
  padding: calc(20px + env(safe-area-inset-top, 0px)) 18px calc(16px + env(safe-area-inset-bottom, 0px));
  overflow-y: auto; overscroll-behavior: contain;
  background: rgba(11, 16, 19, 0.96);
  border-left: 1px solid var(--glass-line);
  box-shadow: -24px 0 60px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  transform: translateX(100%);
  visibility: hidden;
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1), visibility 0s linear 0.32s;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  color: rgba(var(--paper), 0.94);
}
.menu.visible { transform: translateX(0); visibility: visible; transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1), visibility 0s; }
/* The × sits beside the first heading rather than on a row of its own. */
.menu-head { position: absolute; top: calc(6px + env(safe-area-inset-top, 0px)); right: 12px; }
.menu-x {
  width: 42px; height: 42px;
  background: none; border: none; cursor: pointer;
  font-size: 24px; line-height: 1; color: rgba(var(--paper), 0.8);
}
.menu-x:hover { color: rgba(var(--paper), 1); }

.menu-group { padding: 13px 0 8px; border-top: 1px solid rgba(180, 210, 195, 0.12); }
.menu-group:first-of-type { border-top: none; padding-top: 0; }
.menu-label {
  margin: 0 0 4px; font-size: 10.5px; font-weight: 500; line-height: 20px;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: rgba(var(--accent), 0.85);
}

/* A labelled row: title left, control right. */
.menu-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 46px;
}
.row-title { font-size: 13px; color: rgba(var(--paper), 0.92); white-space: nowrap; }

/* Segmented control: every option on show, the chosen one lit. */
.seg {
  display: inline-flex; padding: 2px; gap: 2px;
  background: rgba(180, 210, 195, 0.08);
  border: 1px solid rgba(180, 210, 195, 0.2);
  border-radius: 10px;
}
.seg button {
  min-height: 32px; padding: 0 11px;
  background: none; border: none; border-radius: 8px; cursor: pointer;
  font: inherit; font-size: 12px; color: rgba(220, 218, 230, 0.78);
  transition: background 0.2s ease, color 0.2s ease;
}
.seg button:hover { color: rgba(var(--paper), 1); }
.seg button.on {
  background: rgba(var(--accent), 0.2);
  color: rgba(var(--paper), 1);
  box-shadow: inset 0 0 0 1px rgba(var(--accent), 0.55);
}

/* A row that does something: icon, title, one-line explanation, › if it opens more. */
.menu-item {
  display: flex; align-items: center; gap: 12px; width: 100%;
  min-height: 48px; padding: 5px 4px 5px 0;
  background: none; border: none; border-radius: 10px; cursor: pointer;
  font: inherit; text-align: left; color: inherit;
}
.menu-item:hover .item-title { color: rgba(var(--paper), 1); }
.menu-item:disabled { cursor: default; opacity: 0.7; }
.item-icon { width: 20px; height: 20px; flex: none; fill: none; stroke: rgba(var(--accent), 0.9); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.item-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.item-title { font-size: 13px; color: rgba(var(--paper), 0.94); }
.item-sub { font-size: 11px; color: rgba(220, 218, 230, 0.66); }
.item-chev { width: 10px; height: 10px; flex: none; fill: none; stroke: rgba(220, 218, 230, 0.55); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
/* Recording in progress: the row's icon turns caution-red and pulses. */
.menu-item.recording .item-icon { stroke: rgb(255, 110, 110); animation: recIcon 1.1s ease-in-out infinite; }
.menu-item.recording .item-title { color: rgb(255, 150, 150); }
@keyframes recIcon { 50% { opacity: 0.4; } }

/* Chips: like a segmented control, but each one switches on and off by itself. */
.seg.chips button.on { background: rgba(var(--accent), 0.2); }

/* Clearing can't be undone: a quiet line at the very end, asking twice. */
.menu-clear {
  display: block; width: 100%; margin-top: 4px; padding: 12px 0 4px;
  border: none; border-top: 1px solid rgba(180, 210, 195, 0.12);
  background: none; cursor: pointer; text-align: left;
  font: inherit; font-size: 12.5px; color: rgba(255, 140, 140, 0.8);
}
.menu-clear:hover { color: rgba(255, 150, 150, 1); }
.menu-clear.armed { color: rgb(255, 120, 120); font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  .menu, .menu-shade { transition-duration: 0.01ms !important; }
  .menu-item.recording .item-icon { animation: none; }
}

/* Help card footer: credits on the left, Feedback on the lower right. */
.help-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--glass-line); }
.help-foot .help-credit { margin: 0; padding: 0; border: none; }
.help-feedback {
  flex: none; font-size: 12px; font-weight: 600;
  color: rgba(var(--accent), 0.95); text-decoration: none;
  padding: 4px 0;
}
.help-feedback:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ============================================================
   v24 — panels speak the menu's language on every screen
   (desktop had fallen behind: narrow cards, wrapping pills, 9px labels)
   ============================================================ */
.node-panel { width: 316px; padding: 44px 18px 18px; border-radius: 18px; background: rgba(11, 16, 19, 0.94); }
.node-panel .close-btn { top: 10px; right: 10px; width: 36px; height: 36px; font-size: 20px; }
.node-panel .panel-title, .node-panel .panel-title.visible {
  position: absolute; top: 18px; left: 18px; right: 52px;
  font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; line-height: 1.4;
  color: rgba(var(--accent), 0.9);
}
.node-panel .panel-row { margin-bottom: 14px; }
.node-panel .panel-label {
  font-size: 12.5px; letter-spacing: 0; text-transform: none;
  color: rgba(var(--paper), 0.9); margin-bottom: 7px;
}
/* Label left, slider right, one line per setting. */
.node-panel .panel-row:has(input[type="range"]) {
  display: grid; grid-template-columns: 78px 1fr; align-items: center; gap: 10px; margin-bottom: 10px;
}
.node-panel .panel-row:has(input[type="range"]) .panel-label { margin: 0; }
.node-panel input[type="range"] { width: 100%; margin: 0; }
/* On/off rows: title left, switch right, like the menu. */
.node-panel .reveal-toggle { font-size: 12.5px; color: rgba(var(--paper), 0.92); padding: 4px 0; min-height: 36px; }
/* Timbre and tonal colour: segmented controls, every option on one line. */
.node-panel .pill-group {
  display: flex; flex-wrap: nowrap; gap: 2px; padding: 2px;
  background: rgba(180, 210, 195, 0.08);
  border: 1px solid rgba(180, 210, 195, 0.2);
  border-radius: 10px;
}
.node-panel .pill {
  flex: 1 1 auto; min-height: 34px; padding: 0 6px;
  display: flex; align-items: center; justify-content: center;
  background: none; border: none; border-radius: 8px;
  font-size: 12px; white-space: nowrap;
  color: rgba(220, 218, 230, 0.8);
  box-shadow: none;
}
.node-panel .pill:hover { background: rgba(180, 210, 195, 0.08); color: rgba(var(--paper), 1); }
.node-panel .pill.active {
  background: rgba(var(--accent), 0.2);
  color: rgba(var(--paper), 1);
  box-shadow: inset 0 0 0 1px rgba(var(--accent), 0.55);
}
.node-panel .remove-btn { width: 100%; min-height: 40px; border-radius: 10px; font-size: 12.5px; }

/* Snapshot: the ▲▼ nudges become real, hittable buttons. */
.snapshot-panel .snap-chip-row { gap: 6px; margin: 0 10px 8px 0; }
.snapshot-panel .nudge-btn {
  width: 28px; height: 28px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: rgba(180, 210, 195, 0.08);
  border: 1px solid rgba(180, 210, 195, 0.22);
  font-size: 10px; color: rgba(var(--paper), 0.85);
}
.snapshot-panel .nudge-btn:hover { background: rgba(var(--accent), 0.18); color: rgba(var(--paper), 1); }

@media (max-width: 700px) {
  .node-panel { width: 100% !important; padding: 48px 20px calc(20px + env(safe-area-inset-bottom, 0px)); }
  .node-panel .pill { padding: 0 6px; min-height: 40px; font-size: 12.5px; }
  .snapshot-panel .nudge-btn { width: 36px; height: 36px; font-size: 12px; }
}

/* Lower right of the help card: Support above Feedback. Quiet, never on the canvas. */
.help-links { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.help-support {
  font-size: 12px; font-weight: 600; text-decoration: none;
  color: rgba(var(--accent2), 0.95);
  padding: 2px 0;
}
.help-support:hover { text-decoration: underline; text-underline-offset: 3px; }
.help-source { font-size: 11px; text-decoration: none; color: rgba(220, 218, 230, 0.75); padding: 2px 0; }
.help-source:hover { text-decoration: underline; text-underline-offset: 3px; color: rgba(var(--paper), 1); }

/* An honest question in the help card: one tap says "I'd want the app". */
.help-ask { display: flex; align-items: center; gap: 12px; margin-top: 14px; font-size: 11.5px; line-height: 1.45; color: rgba(220, 218, 230, 0.8); }
.help-ask-btn {
  flex: none; min-height: 34px; padding: 0 12px;
  background: rgba(var(--accent), 0.14); border: 1px solid rgba(var(--accent), 0.45); border-radius: 999px;
  font: inherit; font-size: 11.5px; color: rgba(var(--paper), 0.95); cursor: pointer;
}
.help-ask-btn:disabled { cursor: default; background: none; border-color: transparent; color: rgba(var(--accent), 0.95); }

/* A sign-off above the footer: why the code is open, in Eno's words. */
.help-epigraph { margin: 18px 0 0; padding: 0 0 0 12px; border-left: 2px solid rgba(var(--accent), 0.45); font-size: 11.5px; line-height: 1.55; font-style: italic; color: rgba(220, 218, 230, 0.85); }
.help-epigraph cite { display: block; margin-top: 4px; font-size: 10.5px; font-style: normal; color: rgba(220, 218, 230, 0.65); }
.help-epigraph cite i { font-style: italic; }

/* Desktop: a wider help card, so the text breathes instead of running long
   and narrow. Phones keep the full-width card. */
@media (min-width: 701px) {
  .help-modal { width: 500px; }
}
.help-paper { margin: 10px 0 0; font-size: 11.5px; color: rgba(220, 218, 230, 0.8); }
.help-paper a { color: rgba(var(--accent), 0.95); text-underline-offset: 3px; }
