:root {
  --bg: #0e0f13;
  --panel: #16181f;
  --panel-2: #1d2029;
  --line: #2a2e3a;
  --text: #eef0f5;
  --muted: #9aa0b0;
  --accent: #ff5a5f;
  --accent-2: #46c2ff;
  /* "living" — a soft mycelial sage used on the Choose page so picking reads
     as something growing, not a fight being won. */
  --living: #8fcaa6;
  --living-soft: rgba(143, 202, 166, .22);
  --radius: 14px;
  --shadow: 0 8px 30px rgba(0,0,0,.35);
}
* { box-sizing: border-box; }
html, body {
  /* Suppress pull-to-refresh in the installed PWA. A reload throws away the
     in-memory decryption key (never persisted, by design — BETA_PLAN §3), so an
     accidental rubber-band refresh would otherwise bounce you to the unlock
     screen. `contain` stops the refresh/overscroll gesture while leaving normal
     inner scrolling intact. */
  overscroll-behavior-y: contain;
}
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: radial-gradient(1200px 600px at 80% -10%, #1a1d27, var(--bg));
  color: var(--text);
  min-height: 100vh;
}
header {
  display: flex; flex-wrap: wrap; gap: 18px;
  align-items: flex-end; justify-content: space-between;
  padding: 28px clamp(16px, 5vw, 64px) 18px;
}
.brand h1 { margin: 0; font-size: clamp(26px, 4vw, 40px); letter-spacing: -.5px; }
.brand p { margin: 6px 0 0; color: var(--muted); }
.controls { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
input[type=date], input[type=search], select {
  background: var(--panel); color: var(--text);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 9px 12px; font-size: 14px;
}
/* M2: iOS Safari auto-zooms when a focused field's font is under 16px. On
   touch devices, lift every text-entry control to the 16px floor so focusing a
   field no longer yanks the layout. (Desktop keeps the tighter 14px.) */
@media (pointer: coarse) {
  input, select, textarea { font-size: 16px; }
}
.tabs { display: flex; background: var(--panel); border-radius: 10px; padding: 4px; }
.tab {
  border: 0; background: transparent; color: var(--muted);
  padding: 8px 16px; border-radius: 8px; cursor: pointer; font-size: 14px;
}
.tab.active { background: var(--accent); color: #fff; }
.view { padding: 8px clamp(16px, 5vw, 64px) 60px; }
.hidden { display: none !important; }

/* DECIDE MODE */
.prompt { text-align: center; color: var(--muted); margin: 8px 0 22px; }
.duel {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px;
  align-items: stretch; max-width: 920px; margin: 0 auto;
}

/* The shared membrane between the two records — a soft living seam with a
   breathing node where they're still joined, replacing the old "VS". */
.membrane {
  position: relative; align-self: stretch;
  width: 40px; display: flex; justify-content: center;
  transition: opacity .7s ease;
}
.membrane .m-line { width: 100%; height: 100%; }
.membrane .m-line path {
  fill: none; stroke: var(--living); stroke-width: 1.1;
  vector-effect: non-scaling-stroke; opacity: .45;
}
.membrane .m-node {
  position: absolute; left: 50%; top: 50%;
  width: 16px; height: 16px; transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, var(--living) 0%, transparent 68%);
  opacity: .7; animation: membrane-breathe 5.5s ease-in-out infinite;
}
@keyframes membrane-breathe {
  0%, 100% { transform: translate(-50%, -50%) scale(.8); opacity: .45; }
  50%      { transform: translate(-50%, -50%) scale(1.15); opacity: .8; }
}
/* Once a choice is made the two have parted — the seam dissolves. */
.membrane.parted { opacity: 0; }
@media (prefers-reduced-motion: reduce) {
  .membrane .m-node { animation: none; }
}

.duel-card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 20px; overflow: hidden; cursor: pointer;
  transition: transform .45s cubic-bezier(.22,.61,.36,1),
              box-shadow .45s ease, border-color .3s ease, opacity .45s ease,
              filter .45s ease;
  display: flex; flex-direction: column;
}
.duel-card:hover {
  transform: translateY(-3px) scale(1.01);
  border-color: var(--living);
  box-shadow: 0 0 0 4px var(--living-soft), 0 14px 36px rgba(0,0,0,.32);
}
/* Mitosis on choice: the chosen cell keeps growing, the other eases back —
   no knockout, just one path quietly continuing. */
.duel-card.chosen {
  transform: scale(1.03);
  border-color: var(--living);
  box-shadow: 0 0 0 5px var(--living-soft), 0 18px 44px rgba(0,0,0,.38);
}
.duel-card.receding {
  transform: scale(.93); opacity: .5; filter: saturate(.6);
}
.duel-card.receding:hover {
  transform: scale(.97); opacity: .85; filter: none;
}
.duel-actions { text-align: center; margin-top: 22px; }
.ghost {
  background: transparent; color: var(--muted);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 9px 16px; cursor: pointer; font-size: 14px;
}
.ghost:hover { color: var(--text); border-color: var(--accent-2); }
.pick {
  max-width: 520px; margin: 28px auto 0; text-align: center;
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow);
  animation: pop .25s ease;
}
@keyframes pop { from { transform: scale(.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }
/* B15: the Choose pick panel's metadata line — the same doors as a browse card's
   .sub (released · country · genres · label · decade), centered to the panel. */
.pick-sub { color: var(--muted); font-size: 13px; }
.pick-sub .dot { opacity: .5; }

/* COVERS */
.cover {
  aspect-ratio: 1/1; width: 100%; background: var(--panel-2);
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 13px; text-align: center; padding: 12px;
  background-size: cover; background-position: center;
}
.cover.placeholder { background: linear-gradient(135deg, #232735, #171a22); }
.meta { padding: 14px 16px; }
.meta .artist { font-weight: 700; }
/* A1: artist names are clickable -> artist-scoped search. Looks like text,
   reveals itself on hover/focus. */
/* U10: "where the doors are." Inline text pulls (artist, genre/label/decade,
   "chosen over") used to be invisible until hovered. They now carry a quiet but
   always-present dotted underline so you can tell at a glance which text is a
   door — without recoloring the text. Hover/focus firms it up (solid underline +
   accent) to confirm. One shared affordance = one consistent "this is a link". */
.artist-link, .pull-link, .beat-link {
  text-decoration: underline dotted;
  text-decoration-color: color-mix(in srgb, var(--accent-2) 60%, transparent);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
.artist-link:hover, .artist-link:focus-visible,
.pull-link:hover, .pull-link:focus-visible,
.beat-link:hover, .beat-link:focus-visible {
  color: var(--accent);
  text-decoration: underline solid;
  text-decoration-color: currentColor;
}
.artist-link {
  font: inherit; color: inherit; font-weight: inherit;
  background: none; border: 0; padding: 0; margin: 0;
  cursor: pointer; text-align: left;
}
.meta .title { color: var(--muted); }
.meta .sub { color: var(--muted); font-size: 12px; margin-top: 6px; }
/* A3: genre / label / decade are pull-threads in the metadata line — each a
   door (U10 gives them their dotted-underline affordance above). */
.pull-link {
  font: inherit; color: inherit; background: none; border: 0;
  padding: 0; margin: 0; cursor: pointer; text-align: left;
}
.meta .sub .dot { opacity: .5; }
.links { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.links a {
  flex: 1; text-align: center; text-decoration: none;
  padding: 8px 10px; border-radius: 8px; font-size: 13px; font-weight: 600;
}
.bc { background: #629aa922; color: #7fc7da; border: 1px solid #629aa944; }
.yt { background: #ff000022; color: #ff6b6b; border: 1px solid #ff000044; }
.am { background: #fa57c122; color: #ff7ad0; border: 1px solid #fa57c144; }
.sp { background: #1db95422; color: #1db954; border: 1px solid #1db95444; }
.qb { background: #00a1f122; color: #4db8ff; border: 1px solid #00a1f144; }
.dg { background: #ffffff14; color: var(--muted); border: 1px solid var(--line); }
.dg:hover { color: var(--text); border-color: var(--accent-2); }
/* U5: streaming services tuck behind a quiet "Listen" door; Discogs
   (provenance) stays a small visible thread beside it. */
.listen-row {
  display: flex; gap: 8px; align-items: flex-start;
  margin-top: 12px; flex-wrap: wrap;
}
/* flex-grow so Listen fills the row on a wide card, but keep the default
   min-width:auto (content size) so it never shrinks under its own summary —
   that shrink is what let the fixed-width Discogs link overlap it on a narrow
   card. With flex-wrap on the row, Discogs now drops to the next line instead. */
.listen { flex: 1 1 auto; }
.listen > summary {
  list-style: none; cursor: pointer; user-select: none; display: inline-block;
  padding: 8px 12px; border-radius: 8px; font-size: 13px; font-weight: 600;
  color: var(--muted); background: var(--panel-2); border: 1px solid var(--line);
}
.listen > summary::-webkit-details-marker { display: none; }
.listen > summary:hover { color: var(--text); border-color: var(--accent-2); }
.listen[open] > summary { color: var(--text); margin-bottom: 8px; }
.listen .links { margin-top: 0; }
/* F16: per-service availability marks in the story door's Listen links. Each
   service link is paired with a small tri-state toggle (○ unknown / ✓ here /
   ✕ not here); your mark also tints the link itself. User-entered only. */
/* Each service link + its toggle is one wrap. Give it a real flex-basis and
   min-width so a row of services WRAPS onto multiple lines instead of squeezing
   to zero (which made the pills overlap and "Apple Music" break to two lines). */
.listen-mark-wrap { flex: 1 1 150px; min-width: 150px; display: flex; gap: 6px; }
.listen-mark-wrap > a { flex: 1; white-space: nowrap; }
.mark-toggle {
  flex: 0 0 auto; width: 30px; border-radius: 8px; cursor: pointer;
  background: var(--panel-2); border: 1px solid var(--line);
  color: var(--muted); font-size: 13px; line-height: 1; padding: 0;
}
.mark-toggle:hover { border-color: var(--accent-2); color: var(--text); }
.mark-toggle.mh { color: var(--living); border-color: var(--living); }
.mark-toggle.mn { color: var(--accent); border-color: var(--accent); }
a.marked-here { box-shadow: inset 0 0 0 1px var(--living); }
a.marked-not { opacity: .5; text-decoration: line-through; }
@media (pointer: coarse) { .mark-toggle { min-height: 44px; width: 44px; } }
/* One-line key for the toggles, shown only inside the open Listen door. */
.mark-legend { width: 100%; margin: 8px 0 0; font-size: 12px; line-height: 1.4; }
.provenance.dg {
  flex: 0 0 auto; text-decoration: none; padding: 8px 10px;
  border-radius: 8px; font-size: 13px; font-weight: 600;
}

/* BROWSE GRID */
.filters {
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  max-width: 1200px; margin: 0 auto 18px;
}
.filters #search { flex: 1; min-width: 200px; }
.count { color: var(--muted); font-size: 14px; }

/* T3: Browse is no longer a destination you filter — it's only ever the result
   of following a thread out of the Forest, returnable via the wander stack. Its
   old top-down controls (search, scope, field, decade, sort, genre chips) are
   hidden; the inputs stay in the DOM so the pull machinery can still drive them.
   Only the result count is kept. */
#browse #search, #browse #fieldFilter, #browse #scope, #browse #onlyDayWrap,
#browse #decadeFilter, #browse #sort, #browse #genreChips,
#browse .filter-note { display: none !important; }

/* FOREST (T3): a wood grown from where you've been. */
.forest-find { max-width: 1100px; margin: 0 auto 22px; text-align: center; }
.forest-find-box { display: flex; gap: 8px; justify-content: center; margin-top: 12px; }
.forest-find-box.hidden { display: none; }
.forest-find-box input { flex: 1; max-width: 460px; }
.forest-find-box button {
  background: var(--panel-2); color: var(--text); border: 1px solid var(--line);
  border-radius: 10px; padding: 9px 16px; cursor: pointer; font-weight: 600;
}
.forest-find-box button:hover { border-color: var(--accent-2); }

#forestBody { max-width: 1200px; margin: 0 auto; }
.forest-seed { margin: 0 auto 40px; }
.forest-seed-via {
  display: inline-block; font-size: 12px; letter-spacing: .4px;
  text-transform: uppercase; color: var(--muted); margin-bottom: 8px;
}
/* The seed: a single, slightly larger card you've already been to — the trunk. */
.forest-seed-card {
  max-width: 320px; border-color: color-mix(in srgb, var(--living) 35%, var(--line));
}
.forest-branches { margin-top: 18px; }
.forest-branch { margin-top: 18px; }
.forest-branch-head {
  font-size: 13px; color: var(--muted); margin-bottom: 10px;
  padding-left: 12px; border-left: 2px solid color-mix(in srgb, var(--living) 45%, transparent);
}
/* Branch albums sit a little smaller than the trunk — saplings off the path. */
.forest-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.forest-none { padding-left: 12px; font-size: 13px; }

.forest-empty {
  max-width: 560px; margin: 40px auto; text-align: center;
  color: var(--muted); line-height: 1.6;
}
.forest-empty-lead { color: var(--text); font-size: 18px; font-weight: 600; margin-bottom: 6px; }
.forest-empty-go {
  margin-top: 18px; background: var(--accent); color: #fff; border: 0;
  border-radius: 10px; padding: 10px 20px; cursor: pointer; font-weight: 600; font-size: 15px;
}
.forest-empty-go:hover { filter: brightness(1.08); }

/* Genre chips (multi-select) */
.chips {
  display: flex; flex-wrap: wrap; gap: 8px;
  max-width: 1200px; margin: 0 auto 18px;
}
.chip {
  background: var(--panel); color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 13px; font-size: 13px; cursor: pointer;
  transition: all .12s ease;
}
.chip:hover { color: var(--text); border-color: var(--accent-2); }
.chip.active {
  background: var(--accent); color: #fff; border-color: var(--accent);
}
.filter-note {
  max-width: 1200px; margin: -8px auto 18px;
  color: var(--muted); font-size: 12px; line-height: 1.4;
}
.grid {
  display: grid; gap: 18px; max-width: 1200px; margin: 0 auto;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; cursor: pointer;
  display: flex; flex-direction: column;
  transition: transform .12s ease, border-color .12s ease;
}
.card:hover { transform: translateY(-3px); border-color: var(--accent-2); }
.empty { text-align: center; color: var(--muted); padding: 60px 0; }
footer {
  text-align: center; color: var(--muted); font-size: 12px;
  padding: 24px; padding-bottom: max(24px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  display: flex; gap: 14px; align-items: center; justify-content: center;
  flex-wrap: wrap;
}
/* Floating "Send feedback" button — small, pinned to the top-left, stays put
   while scrolling. Sits below modals (z 50) so a dialog covers it. */
.feedback-fab {
  position: fixed; z-index: 40;
  top: max(10px, env(safe-area-inset-top));
  left: max(10px, env(safe-area-inset-left));
  background: var(--panel-2); color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 12px; font: inherit; font-size: 12px; cursor: pointer;
  box-shadow: var(--shadow); opacity: .8;
}
.feedback-fab:hover {
  color: var(--text); border-color: var(--accent-2); opacity: 1;
}
/* T4/T5: the single Trail control. Always in the same fixed spot — bottom-right,
   clear of the feedback FAB (top/bottom-left) and a modal's ✕ (top-right) — and
   at z 70 (over the note modal's 60) so it stays reachable above any open
   overlay. Hidden only while the wander map itself is open (it would just
   re-open the thing you're looking at). */
.trail-float {
  position: fixed; z-index: 70; display: inline-flex; align-items: center;
  right: max(14px, env(safe-area-inset-right));
  bottom: max(14px, env(safe-area-inset-bottom));
  background: var(--panel-2); color: var(--text);
  border: 1px solid var(--accent-2); border-radius: 999px;
  padding: 9px 16px; font: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer; box-shadow: var(--shadow);
}
.trail-float:hover { border-color: var(--accent-2); color: var(--accent-2); }
body:has(#wanderMapModal:not(.hidden)) .trail-float { display: none; }
@media (pointer: coarse) { .trail-float { min-height: 44px; } }

/* T6: the session-long history list inside the Trail map. */
.session-history { margin-top: 18px; }
.history-row {
  display: flex; align-items: baseline; gap: 10px;
  padding: 4px 0; border-bottom: 1px solid var(--line);
}
.history-row:last-child { border-bottom: 0; }
.history-step { flex: 1; text-align: left; }
.history-via {
  font-size: 11px; text-transform: uppercase; letter-spacing: .04em;
  flex: 0 0 auto;
}
@media (pointer: coarse) { .history-step { min-height: 44px; } }

/* Feedback modal: the snapshot opt-in row. */
.fb-opt {
  display: flex; align-items: center; gap: 8px;
  color: var(--muted); font-size: 13px; margin: 10px 0 4px;
}
.fb-opt input { accent-color: var(--accent); }

/* fix-art trigger on covers */
.cover { position: relative; }
.fixart {
  position: absolute; top: 8px; right: 8px;
  background: rgba(0,0,0,.6); color: #fff; border: 0;
  border-radius: 8px; padding: 4px 8px; font-size: 11px;
  cursor: pointer; opacity: .85; transition: opacity .12s ease;
}
/* M1: only hide-until-hover on hover-capable pointers. On touch there's no
   hover to reveal it, so the control stays quietly visible instead of being
   stranded at opacity:0 and unreachable. */
@media (hover: hover) {
  .fixart { opacity: 0; }
  .card:hover .fixart, .duel-card:hover .fixart, .pick .fixart { opacity: 1; }
}

/* Journal actions on cards */
.jactions { display: flex; gap: 8px; margin-top: 8px; }
.jbtn {
  flex: 1; background: var(--panel-2); color: var(--muted);
  border: 1px solid var(--line); border-radius: 8px;
  padding: 7px 8px; font-size: 12px; cursor: pointer; font-weight: 600;
}
.jbtn:hover { color: var(--text); border-color: var(--accent-2); }
.jbtn:disabled { color: var(--accent-2); cursor: default; }

/* Browse: search scope controls */
.onlyday {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--muted); font-size: 13px; cursor: pointer; white-space: nowrap;
}
.onlyday input { accent-color: var(--accent); }

/* Collapsible summary: a quiet door you pull open, default closed
   (VISION.md: pull, not push). Used by the Journal and Picks tabs. */
.summary-panel { max-width: 1200px; margin: 0 auto 18px; }
.summary-panel > summary {
  list-style: none; cursor: pointer; width: fit-content;
  color: var(--muted); font-size: 13px;
  padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px;
  user-select: none;
}
.summary-panel > summary::-webkit-details-marker { display: none; }
.summary-panel > summary::before { content: "▸ "; }
.summary-panel[open] > summary { margin-bottom: 14px; }
.summary-panel[open] > summary::before { content: "▾ "; }
.summary-panel > summary:hover { color: var(--text); border-color: var(--accent-2); }

/* Journal: summary strip */
.summary {
  display: grid; gap: 14px;
  grid-template-columns: minmax(180px, .8fr) 1.4fr 1.4fr;
  align-items: stretch;
}
@media (max-width: 820px) {
  /* minmax(0, 1fr), not a bare 1fr: a bare 1fr track is floored at its content's
     min-content, and the stats flex-row reports a min-content wide enough to
     push the whole summary — and with it the page — into horizontal scroll on a
     phone (M3 audit). Pinning the track minimum to 0 lets the panels shrink to
     the viewport. */
  .summary { grid-template-columns: minmax(0, 1fr); }
}
.stats {
  display: flex; gap: 12px; flex-wrap: wrap; align-content: flex-start;
}
.stat {
  flex: 1; min-width: 84px; background: var(--panel-2);
  border: 1px solid var(--line); border-radius: 12px; padding: 14px 12px;
  text-align: center;
}
.statn { font-size: 26px; font-weight: 800; letter-spacing: -.5px; }
.statl { color: var(--muted); font-size: 12px; margin-top: 2px; }
.panel-card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 14px;
}
.panel-card h4 { margin: 0 0 10px; font-size: 13px; color: var(--muted);
  font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
/* genre bars */
.gbars { display: flex; flex-direction: column; gap: 7px; }
.gbar { display: grid; grid-template-columns: 88px 1fr 24px; gap: 8px;
  align-items: center; font-size: 12px; }
.glabel { color: var(--text); overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; }
.gtrack { background: var(--panel-2); border-radius: 999px; height: 8px;
  overflow: hidden; }
.gfill { display: block; height: 100%;
  background: linear-gradient(90deg, var(--accent-2), var(--accent)); }
.gcount { color: var(--muted); text-align: right; }
/* Milestones / explorer (G3/G4) — full-width strip under the summary grid */
.badges-panel { grid-column: 1 / -1; }
.badges { display: flex; flex-wrap: wrap; gap: 8px; }
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 999px; padding: 5px 12px; font-size: 12px;
  color: var(--muted); opacity: .5;
}
.badge.earned { color: var(--text); opacity: 1; border-color: var(--accent); }
.badge-i { font-size: 14px; line-height: 1; }
.explore-line { color: var(--muted); font-size: 12px; margin: 12px 0 0; }

/* Journal: shelf + note badge */
.shelf-card { cursor: pointer; position: relative; }
.shelf-card .meta { position: relative; }
.nbadge {
  display: inline-block; margin-top: 8px;
  background: var(--accent); color: #fff; border-radius: 999px;
  padding: 2px 10px; font-size: 11px; font-weight: 700;
}

/* Journal note items (shown inside the shelf modal) */
.jitem {
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 14px; margin-bottom: 10px;
}
.jnote { margin: 0 0 8px; color: var(--text); white-space: pre-wrap; }
.jdate { color: var(--muted); font-size: 12px; }
.jtag {
  display: inline-block; background: var(--panel-2); color: var(--muted);
  border: 1px solid var(--line); border-radius: 6px;
  padding: 1px 7px; font-size: 11px; margin-left: 4px;
}
.jlinks { display: flex; gap: 14px; align-items: center; font-size: 13px; }
.jlinks a { color: var(--accent-2); text-decoration: none; }
.jedit {
  margin-left: auto; background: transparent; border: 0; cursor: pointer;
  color: var(--muted); font-size: 12px;
}
.jedit:hover { color: var(--accent-2); }
.jdel {
  background: transparent; border: 0; cursor: pointer;
  color: var(--muted); font-size: 12px;
}
.jdel:hover { color: var(--accent); }

/* Undo toast (D3) */
.toast {
  position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 18px; box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 16px; z-index: 80;
  font-size: 14px; color: var(--text); animation: pop .18s ease;
}
.toast-action {
  background: transparent; border: 0; color: var(--accent-2);
  font-weight: 700; cursor: pointer; font-size: 14px; padding: 0;
}
.toast-action:hover { text-decoration: underline; }

/* Note modal fields */
#noteBody {
  width: 100%; background: var(--panel-2); color: var(--text);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px;
  font: inherit; font-size: 14px; resize: vertical; margin: 0 0 10px;
}

/* Write / Preview toggle — one segmented control on every screen size. */
.note-mode {
  display: flex; width: fit-content; gap: 2px; margin: 12px 0 8px;
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 8px; padding: 3px;
}
.note-mode-btn {
  background: none; border: 0; color: var(--muted); cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 600;
  padding: 5px 14px; border-radius: 6px;
}
.note-mode-btn.active { background: var(--accent); color: #fff; }
/* The preview pane stands in for the textarea (same box) so toggling doesn't
   jump the modal; it reuses the rendered-note markdown styling. */
.note-preview {
  width: 100%; min-height: 90px; background: var(--panel-2); color: var(--text);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px;
  margin: 0 0 10px; font-size: 14px; line-height: 1.5;
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.note-preview a { color: var(--accent-2); }
.note-preview strong { color: var(--text); }
.note-preview code {
  background: var(--bg); border: 1px solid var(--line);
  border-radius: 5px; padding: 0 5px; font-size: 12px;
}
.note-fields { display: flex; gap: 8px; }
.note-fields input { flex: 1; }
.note-actions { margin: 14px 0 6px; }
#noteSave {
  background: var(--accent); color: #fff; border: 0; border-radius: 10px;
  padding: 9px 18px; cursor: pointer; font-weight: 600;
}

/* Note markdown body + formatting hint */
.note-hint { font-size: 12px; margin: 0 0 10px; line-height: 1.5; }
.note-hint code, .jnote code {
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 5px; padding: 0 5px; font-size: 12px;
}
.jnote a { color: var(--accent-2); }
.jnote strong { color: var(--text); }

/* Recurring-term chips — still used by the story door (U3) threads. */
.nc-row { display: flex; flex-wrap: wrap; gap: 8px; }
.nc-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 999px; padding: 5px 12px; font-size: 13px;
  color: var(--text); cursor: pointer; text-decoration: none;
}
.nc-chip:hover { border-color: var(--accent-2); }
.conn-count {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 999px; padding: 0 6px; font-size: 10px;
  color: var(--muted); margin-left: 2px;
}

/* Connections (C1): a place to wander — paths & clearings. A small wood grown
   from your own words; you step from clearing to clearing along trails of
   co-occurrence. Mostly still — motion only as a clearing opens. */
.conn-path, .conn-wander { max-width: 760px; margin: 0 auto; }
.conn-path {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px;
  margin-bottom: 18px; font-size: 13px;
}
.conn-path:empty { display: none; }
.crumb {
  background: none; border: 0; padding: 2px 4px; cursor: pointer;
  color: var(--muted); font-size: 13px; border-radius: 6px;
}
.crumb:hover { color: var(--accent-2); }
.crumb:last-child { color: var(--text); }
.crumb-sep { color: var(--line); }

.wander-hint { text-align: center; color: var(--muted); margin: 0 0 18px; }
.ways-in {
  display: flex; flex-wrap: wrap; justify-content: center;
  align-items: baseline; gap: 8px 18px; padding: 8px 0 12px;
}
.way-in {
  background: none; border: 0; padding: 2px 2px; cursor: pointer;
  color: var(--text); line-height: 1.3; opacity: .82;
  border-bottom: 1px solid transparent; transition: color .2s, opacity .2s,
    border-color .2s;
}
.way-in:hover { color: var(--accent-2); opacity: 1; border-color: var(--accent-2); }

.clearing {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px;
}
.clearing-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; margin-bottom: 14px;
}
.clearing-head h3 { margin: 0; color: var(--text); }
.clearing-count { color: var(--muted); font-size: 12px; white-space: nowrap; }
.clearing-notes { display: flex; flex-direction: column; gap: 10px; }
.jctx { color: var(--muted); font-size: 12px; }

.trails { margin-top: 18px; }
.trails-label {
  display: block; color: var(--muted); font-size: 11px;
  text-transform: uppercase; letter-spacing: .08em; margin-bottom: 8px;
}
.trail-row { display: flex; flex-wrap: wrap; gap: 8px; }
.trail {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 999px; padding: 5px 12px; font-size: 13px;
  color: var(--text); cursor: pointer;
  transition: border-color .2s, color .2s;
}
.trail:hover { border-color: var(--accent-2); color: var(--accent-2); }
.trail-shared {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 999px; padding: 0 6px; font-size: 10px; color: var(--muted);
}
.trails-none { margin-top: 18px; }
.link-quiet {
  display: inline-block; margin-top: 18px; background: none; border: 0;
  padding: 0; cursor: pointer; color: var(--accent-2); font-size: 13px;
}
.link-quiet:hover { text-decoration: underline; }

/* Mostly still: a clearing eases in only when you step into it. */
.clearing-in { animation: clearingIn .32s ease both; }
@keyframes clearingIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .clearing-in { animation: none; }
}

/* WANDER TRAILS (T1): doors, not corridors. A quiet breadcrumb that pins the
   root and collapses the middle, so depth never costs legibility. */
.wander-bar {
  max-width: 1100px; margin: 0 auto; padding: 8px 20px;
  display: flex; align-items: center; gap: 8px;
}
.wander-bar.hidden { display: none; }
.wb-crumbs {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px;
  font-size: 13px;
}
.wb-crumbs .crumb {
  background: none; border: 0; padding: 2px 4px; cursor: pointer;
  color: var(--muted); font-size: 13px; border-radius: 6px;
}
.wb-crumbs .crumb:hover { color: var(--accent-2); }
.wb-crumbs .crumb-cur { color: var(--text); cursor: default; }
.wb-crumbs .crumb-home { color: var(--text); font-weight: 600; }
.wb-crumbs .crumb-more { letter-spacing: 1px; }
.wb-map {
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 999px; padding: 3px 12px; margin-left: 6px;
  font-size: 12px; color: var(--muted); cursor: pointer;
}
.wb-map:hover { border-color: var(--accent-2); color: var(--accent-2); }
.wb-back { display: none; }   /* mobile only — see the ≤640px block */

/* The wander map: the session as a small mycelial network — spores joined by
   thin organic filaments. The thread you're on glows; backed-out branches fade
   into the dark. Mostly still (a soft settle-in). Grows downward from the root;
   wide forks scroll horizontally inside the modal. */
.wander-map { margin: 14px 0 4px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.wtree { position: relative; margin: 0 auto; }
.wtree-svg { position: absolute; inset: 0; pointer-events: none; overflow: visible; }
.wmycelium { animation: wgrow .5s ease both; }
@keyframes wgrow { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .wmycelium { animation: none; } }

/* Filaments. */
.wedge { fill: none; stroke: var(--line); stroke-width: 1.2; stroke-linecap: round; }
.wedge.dim { opacity: .4; }
.wedge.lit { stroke: var(--accent-2); stroke-width: 1.6; opacity: .9; filter: url(#wglow); }
/* The segment ahead of where you're standing: still part of the lit trail, but
   dashed so it reads as "forward / retraceable" rather than behind you. */
.wedge.ahead { stroke-dasharray: 4 5; opacity: .7; }
.whair { fill: none; stroke: var(--line); stroke-width: 1; stroke-linecap: round; opacity: .18; }
.whair.lit { stroke: var(--accent-2); opacity: .3; }

/* Spores (the SVG dots). */
.wspore { fill: var(--muted); }
.wspore.dim { fill: var(--line); opacity: .55; }
.wspore.lit { fill: var(--accent-2); filter: url(#wglow); }
.wspore.cur { fill: var(--accent-2); filter: url(#wglow); }
.wspore.ahead { opacity: .8; }

/* Labels (HTML, below each spore) — the clickable target. */
.wnode {
  position: absolute; transform: translate(-50%, -50%);
  width: 138px; height: 70px; padding: 0; padding-top: 30px;
  display: flex; flex-direction: column; align-items: center;
  background: none; border: 0; cursor: pointer; color: var(--muted);
  transition: color .2s, opacity .2s;
}
.wnode .wlabel { font-size: 12px; line-height: 1.25; white-space: nowrap; }
.wnode:hover { color: var(--accent-2); }
.wnode.dim { opacity: .45; }
.wnode.lit { color: var(--text); }
/* Steps ahead of where you're standing: on the trail, tinted with the trail
   colour, but softened so the "you are here" cursor still reads as current. */
.wnode.ahead { color: var(--accent-2); opacity: .82; }
.wnode.cur .wlabel {
  color: var(--accent-2); font-weight: 600;
  text-shadow: 0 0 10px color-mix(in srgb, var(--accent-2) 55%, transparent);
}

/* Saving / listing trails (layer 3). */
.trail-save { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 16px; }
.trail-save h4, .trail-saved-list h4 { margin: 0 0 4px; }
.trail-save-row { display: flex; gap: 8px; margin: 10px 0 4px; }
.trail-save-row input { flex: 1; }
.trail-save-row button {
  background: var(--accent); color: #fff; border: 0; border-radius: 10px;
  padding: 0 16px; cursor: pointer; font-weight: 600; white-space: nowrap;
}
.trail-saved-list { margin-top: 16px; }
.trail-saved {
  display: flex; align-items: center; gap: 10px; padding: 6px 0;
  border-bottom: 1px solid var(--line);
}
.trail-saved:last-child { border-bottom: 0; }
.trail-open { margin-top: 0; flex: 1; text-align: left; }
.trail-del {
  background: none; border: 0; color: var(--muted); cursor: pointer;
  font-size: 14px;
}
.trail-del:hover { color: var(--accent-2); }

/* MODAL */
.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,.6);
  display: flex; align-items: center; justify-content: center; z-index: 50;
  padding: 16px;
}
/* The note editor is the one modal that opens *over* another (the per-album
   notes shelf, or the story door). Lift it so it stacks on top instead of
   rendering behind the modal it was launched from (B6). */
#noteModal { z-index: 60; }
.modal-box {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px; width: min(560px, 100%);
  /* M5: cap to the *visible* viewport. A plain vh doesn't shrink when the
     on-screen keyboard opens, so the box (and its Save button) could end up
     behind the keyboard; dvh tracks the dynamic viewport and keeps the box
     scrollable above it. vh first as a fallback for browsers without dvh. */
  max-height: 86vh; max-height: 86dvh;
  overflow: auto; box-shadow: var(--shadow); position: relative;
}
.modal-box h3 { margin: 0 0 4px; }
/* A2: the artist panel needs room for a catalog grid. */
.modal-box-wide { width: min(920px, 100%); }
#artistCatalog, #labelCatalog {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px; margin: 0;
}
#artistCatalog .empty, #labelCatalog .empty { grid-column: 1 / -1; }
.muted { color: var(--muted); font-size: 13px; }
.modal-close {
  position: absolute; top: 12px; right: 12px; background: transparent;
  border: 0; color: var(--muted); font-size: 16px; cursor: pointer;
}
.art-search, .art-url { display: flex; gap: 8px; margin: 14px 0; }
.art-search input, .art-url input { flex: 1; }
.art-search button, .art-url button {
  background: var(--accent); color: #fff; border: 0; border-radius: 10px;
  padding: 0 16px; cursor: pointer; font-weight: 600;
}
.art-results {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 10px;
}
.art-results .opt { cursor: pointer; border-radius: 10px; overflow: hidden;
  border: 2px solid transparent; }
.art-results .opt:hover { border-color: var(--accent-2); }
.art-results .opt img { width: 100%; display: block; aspect-ratio: 1/1;
  object-fit: cover; }
/* M4: on touch, give the small tap controls a comfortable ~44px target. Gated
   to coarse pointers so the desktop (mouse) sizing stays tight. */
@media (pointer: coarse) {
  /* Pill / block buttons grow to a 44px-tall hit area and centre their label. */
  .tab, .chip, .jbtn, .ghost, .links a, .provenance.dg,
  .listen > summary, .nc-chip, #noteSave, .note-mode-btn,
  .art-search button, .art-url button, .why-actions button,
  .summary-panel > summary {
    min-height: 44px;
    display: inline-flex; align-items: center; justify-content: center;
  }
  /* Small icon / text actions get a 44×44 square so they're tappable without
     hunting — the note edit/delete glyphs, the modal ✕, and the on-cover Fix
     art. */
  .jedit, .jdel, .modal-close, .fixart {
    min-height: 44px; min-width: 44px;
    display: inline-flex; align-items: center; justify-content: center;
  }
}

@media (max-width: 640px) {
  .duel { grid-template-columns: 1fr; }
  /* Stacked vertically, the seam becomes a small horizontal pinch — just the
     breathing node between the two cards, with the line hidden. */
  .membrane { width: auto; height: 26px; }
  .membrane .m-line { display: none; }

  /* M3: the five-tab strip is wider than the phone (≈420px), which dragged the
     whole page into horizontal scroll and, in turn, stretched the journal
     stats/genre panels and pushed fixed modals off-centre. Give the controls
     their own full-width row and let the tab bar scroll horizontally *inside*
     the viewport instead of forcing the page wider than the screen. */
  .controls { width: 100%; }
  .controls .tabs {
    width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .controls .tabs::-webkit-scrollbar { display: none; }
  .tab { flex: 0 0 auto; white-space: nowrap; }
  #datePicker { flex: 1 1 auto; }

  /* M6: at the top-left the Feedback button sat on top of the <h1>. On a narrow
     screen drop it to the bottom-left, clear of the header and above the home
     indicator. */
  .feedback-fab {
    top: auto;
    bottom: max(10px, env(safe-area-inset-bottom));
    left: max(10px, env(safe-area-inset-left));
  }

  /* T1 mobile: the breadcrumb collapses to a single back-pill that opens the
     full trail (the system back button / edge-swipe does the actual popping).
     Honors the safe-area inset like the FAB. */
  .wb-crumbs { display: none; }
  .wb-back {
    display: inline-flex; align-items: center; min-height: 44px;
    padding: 0 14px; border-radius: 999px;
    background: var(--panel-2); border: 1px solid var(--line);
    color: var(--text); font-size: 14px; cursor: pointer;
    margin-left: max(0px, env(safe-area-inset-left));
  }
  .wb-back:hover { border-color: var(--accent-2); }
}

/* --- Pick reasons (G5) ----------------------------------------------------- */
/* Free-text "why this one" capture under the chosen album, and in the edit
   modal — no imposed vocabulary, just your own words (VISION.md). */
.why {
  margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line);
  text-align: left;
}
.why textarea, #pickModalNote {
  width: 100%; box-sizing: border-box; resize: vertical;
}
.why-actions { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.why-actions button {
  background: var(--accent); color: #fff; border: 0; border-radius: 10px;
  padding: 8px 16px; cursor: pointer; font-weight: 600;
  transition: background .15s ease, color .15s ease;
}
/* U11: the "why" box shows its save state. While it differs from what's on disk
   (`.dirty`) the textarea lifts (accent ring) and the button stays a solid
   accent "Save" — "you have unsaved changes". Once it matches (`.clean`) the box
   settles: the ring drops and the button relaxes to a calm sage "Saved ✓", so
   the saved state is visible without re-reading the status line. */
.why textarea { transition: border-color .15s ease, box-shadow .15s ease; }
.why.dirty textarea {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent-2) 22%, transparent);
}
.why.clean .why-actions button {
  background: var(--living-soft); color: var(--living);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--living) 45%, transparent);
}
.danger { color: #c0392b; border-color: #c0392b !important; }
.danger:hover { color: #fff; background: #c0392b; }

/* B16: the album's cover leads its story/detail view — a fixed thumbnail beside
   the title, so opening an album (from Picks or anywhere) shows the artwork. */
.story-head-row { display: flex; gap: 14px; align-items: flex-start; }
.story-head-row .cover {
  width: 88px; min-width: 88px; height: 88px; aspect-ratio: auto;
  border-radius: 10px; flex: 0 0 auto; font-size: 10px; padding: 6px;
}
.story-head-text { min-width: 0; }
.story-head-text h3 { margin: 0 0 4px; }
.story-head-text p { margin: 0; }

/* Story door (U3): sections inside the modal. Chips reuse .nc-row/.nc-chip and
   notes reuse the shelf .jitem styling, so this stays light. */
.story-section { margin-top: 18px; }
.story-section h4 {
  margin: 0 0 6px; font-size: 13px; color: var(--muted);
  font-weight: 600; text-transform: uppercase; letter-spacing: .4px;
}
.story-hint { font-size: 12px; margin: 0 0 10px; }

/* A4: optional artist bio inside the story door. Plain text + a citation; only
   shown after the user opens the bio door. */
.bio-extract { margin: 0 0 8px; line-height: 1.55; }
.bio-cite { font-size: 12px; margin: 0; }

/* Picks tab: patterns panel + history cards. */
.panels {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
/* U8: the pick-specific bits sit in a footer below the shared browse-card
   layout (Listen door + Note/Threads), set off by a quiet rule. */
.pick-foot {
  margin-top: 12px; padding-top: 10px;
  border-top: 1px solid var(--line);
}
.pick-when { font-size: 12px; }
.pick-card .rtags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.rtag {
  background: var(--panel-2); color: var(--accent-2);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 2px 9px; font-size: 11px; font-weight: 600;
}
.rtags.muted { color: var(--muted); font-size: 12px; }
.pnote {
  margin-top: 8px; font-size: 13px; color: var(--text);
  border-left: 2px solid var(--accent-2); padding-left: 8px;
}
.beat { margin-top: 8px; font-size: 12px; }
/* A5: "chosen over" is a door back to the road not taken, not dead text. */
.beat-link {
  font: inherit; color: inherit; background: none; border: 0;
  padding: 0; margin: 0; cursor: pointer; text-align: left;
}
.beat-link:hover, .beat-link:focus-visible {
  color: var(--accent); text-decoration: underline;
}
.pick-card .pick-edit { margin-top: 12px; }

/* ===========================================================================
   H1.2 — the auth / unlock gate (auth-ui.js). A full-screen overlay shown only
   in hosted (Supabase-configured) mode for login, passphrase setup + recovery
   code, unlock, and the lost-passphrase reset. In single-user local mode it is
   never created, so the app looks exactly as before.
   =========================================================================== */
/* Pre-auth: hide the app underneath until boot() decides whether to show the
   gate (hosted) or reveal the app (local). Without this the app HTML paints
   first, so there's a flash of the unlocked page during the async config/auth
   check before the gate overlay mounts. The gate (appended to <body>) is exempt;
   visibility (not display) keeps layout intact so app.js init can still measure. */
body.auth-pending { background: var(--bg); }
body.auth-pending > *:not(#authGate) { visibility: hidden; }

.auth-gate {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background: radial-gradient(1200px 600px at 80% -10%, #1a1d27, var(--bg));
}
.auth-gate.hidden { display: none; }
.auth-card {
  width: 100%; max-width: 420px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 28px 26px;
}
.auth-brand {
  font-size: 22px; font-weight: 700; letter-spacing: -.4px;
  margin-bottom: 18px; color: var(--living);
}
.auth-lead { font-size: 18px; font-weight: 600; margin: 0 0 8px; }
.auth-sub { color: var(--muted); font-size: 14px; line-height: 1.5; margin: 0 0 16px; }
.auth-acct { font-size: 13px; color: var(--muted); margin: 0 0 12px; }
.auth-acct b { color: var(--living); font-weight: 600; }
.auth-sub.muted { font-size: 13px; opacity: .85; }
.auth-sub.error, .auth-status.error { color: var(--accent); }
.auth-form { display: flex; flex-direction: column; gap: 10px; }
.auth-form input {
  background: var(--panel-2); color: var(--text);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 14px; font-size: 16px;
}
.auth-form button, #finishSetup, .auth-card button:not(.ghost):not(.linkish) {
  background: var(--living); color: #0b1410; border: 0;
  border-radius: 10px; padding: 12px 14px; font-size: 15px; font-weight: 600;
  cursor: pointer;
}
.auth-card button:disabled { opacity: .5; cursor: not-allowed; }
.auth-card .ghost {
  background: transparent; color: var(--text);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 9px 14px; font-size: 14px; cursor: pointer;
}
.recovery-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 19px; letter-spacing: 1px; text-align: center;
  background: var(--panel-2); border: 1px dashed var(--living);
  border-radius: 10px; padding: 16px; margin: 4px 0 12px;
  user-select: all; word-break: break-all;
}
.recovery-actions { display: flex; gap: 10px; margin-bottom: 14px; }
.recovery-actions .ghost { flex: 1; }
.auth-ack {
  display: flex; gap: 10px; align-items: flex-start;
  font-size: 14px; color: var(--muted); margin-bottom: 14px; cursor: pointer;
}
.auth-ack input { margin-top: 2px; }
#finishSetup { width: 100%; }
.auth-links { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 14px; }
.linkish {
  background: none; border: 0; color: var(--accent-2);
  font-size: 13px; cursor: pointer; padding: 0;
}
.auth-status { min-height: 18px; font-size: 13px; color: var(--muted); margin: 12px 0 0; }

/* H1.2 — one-time "Import previous journal" button (migrate.js), shown after
   unlock in hosted mode only. Sits bottom-left, out of the way of the Trail and
   Feedback FABs on the right. */
/* "Export my journal" + "Import previous journal" live in the account (☰) menu
   (import used to be a floating FAB that overlapped the feedback button). Quiet
   secondary items above Sign out. */
.acct-export, .acct-import {
  width: 100%; padding: 8px 12px; margin-bottom: 8px; border-radius: 8px;
  cursor: pointer; background: var(--panel-2); color: var(--text);
  border: 1px solid var(--living); font: inherit; font-size: 13px; font-weight: 600;
}
.acct-export:hover, .acct-import:hover { background: var(--living); color: #0b1410; }
.acct-export:disabled, .acct-import:disabled { opacity: .7; cursor: default; }
/* Account menu — small button pinned top-right (clear of the top-left feedback
   FAB and the bottom-right Trail), opening a little Sign-out popover. z-index 45
   sits below modals (50), and the :has() rule hides it whenever a modal is open,
   so it's only present when no "hover page" is up. */
.acct-menu {
  position: fixed; z-index: 45;
  top: max(10px, env(safe-area-inset-top));
  right: max(10px, env(safe-area-inset-right));
}
.acct-btn {
  width: 34px; height: 34px; border-radius: 999px; cursor: pointer;
  background: var(--panel-2); color: var(--muted); border: 1px solid var(--line);
  box-shadow: var(--shadow); font: inherit; font-size: 15px; line-height: 1;
  opacity: .8;
}
.acct-btn:hover { color: var(--text); border-color: var(--accent-2); opacity: 1; }
.acct-pop {
  position: absolute; top: 42px; right: 0; min-width: 210px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow); padding: 12px;
}
.acct-email { margin: 0 0 10px; font-size: 12px; color: var(--muted); line-height: 1.5; }
.acct-email b { color: var(--text); font-weight: 600; word-break: break-all; }
.acct-signout {
  width: 100%; padding: 8px 12px; border-radius: 8px; cursor: pointer;
  background: var(--panel-2); color: var(--text); border: 1px solid var(--accent-2);
  font: inherit; font-size: 13px; font-weight: 600;
}
.acct-signout:hover { background: var(--accent-2); color: #0b1410; }
body:has(.modal:not(.hidden)) .acct-menu { display: none; }
@media (pointer: coarse) { .acct-btn { width: 44px; height: 44px; } }

/* U14 — "The other one" (the road not taken) inside the Choose pick panel.
   The album you didn't pick stays listenable here: a compact card with its
   cover, metadata doors, Listen door and Note/Threads, set apart by a soft
   living seam so it reads as a companion, not a competitor. */
.road-not-taken {
  margin-top: 28px; padding-top: 22px;
  border-top: 1px dashed var(--living-soft);
}
.road-not-taken h3 { margin: 0 0 4px; font-size: 16px; color: var(--living); }
.rnt-hint { margin: 0 0 14px; font-size: 13px; }
.rnt-card { display: flex; gap: 16px; align-items: flex-start; }
.rnt-card .cover {
  flex: 0 0 120px; width: 120px; height: 120px; margin: 0;
}
.rnt-body { flex: 1 1 auto; min-width: 0; }
.rnt-title { margin: 0 0 4px; }
.rnt-body .pick-sub { margin: 0 0 10px; }
/* On a phone the companion stacks: cover above its details. */
@media (max-width: 560px) {
  .rnt-card { flex-direction: column; }
  .rnt-card .cover { flex-basis: auto; width: 100%; height: auto; aspect-ratio: 1 / 1; }
}
