/* theme.css — Dialogue 2.0 design system.
 *
 * Pico CSS (vendor/pico.min.css) supplies consistent component defaults; this file
 * bends Pico to ONE calm, editorial identity and defines the shared chrome (header,
 * identity bar, cards, buttons, fields, tabs, toast) so every page reads the same.
 *
 * Aesthetic: a warm paper ground, generous air, a single confident teal accent
 * (amber used sparingly), Fraunces for display, DM Sans for body, DM Mono for meta.
 * De-stressed = hairline borders over boxes, whitespace over shadows, one accent.
 *
 * Load order in every page:  fonts  →  pico.min.css  →  theme.css
 */

/* ── brand tokens ─────────────────────────────────────────────────────────── */
:root{
  --paper:#f2ece0;          /* warm light oat — the wall you walked in from */
  --surface:#faf6ee;        /* card / raised surface (warm white) */
  --surface-2:#ece5d6;      /* inset / hover wash */
  --ink:#211f19;            /* near-black, warm */
  --ink-2:#6b675c;          /* secondary text */
  --ink-3:#9a9485;          /* faint / meta */
  --line:rgba(33,31,25,.10);   /* hairline */
  --line-2:rgba(33,31,25,.16); /* slightly stronger hairline */
  --teal:#0f9e88;  --teal-dk:#0b7e6e;  --teal-lt:#def2ee;   /* cool-diner aqua-teal */
  --amber:#d98a2b; --amber-lt:#f7ead2;
  --new:var(--teal); --new-bg:var(--teal-lt);   /* the single "new to you" accent — reused on every surface */
  --red:#e0584a;  --red-lt:#fbe6e2;
  --surface-3:#e4dccb;
  --r:14px;   /* card radius */
  --rs:9px;   /* control radius */
  --shadow:0 12px 30px -20px rgba(33,31,25,.28);
  /* the transit board (the map panel) — a cool, bright "counter" inset in the warm page */
  --board:#e9e8e0;            /* medium-light cool panel */
  --board-2:#f3f2ec;          /* brighter centre of the board */
  --board-edge:rgba(33,31,25,.12);
  --board-ink:#262419;        /* label text on the board */
  --board-ink-2:#7d7868;      /* muted label text on the board */
  --font-display:'IBM Plex Mono', ui-monospace, monospace;   /* signage / headings */
  --font-body:'DM Sans', system-ui, -apple-system, sans-serif;
  --font-mono:'DM Mono', ui-monospace, monospace;

  /* legacy aliases so any not-yet-migrated page CSS keeps resolving */
  --bg:var(--paper); --text:var(--ink); --text-2:var(--ink-2); --text-3:var(--ink-3);
  --border:var(--line); --border-md:var(--line-2);
  --teal-bg:var(--teal-lt); --amber-bg:var(--amber-lt);
}

/* ── bend Pico to the identity (match Pico's light-theme selector so we win) ── */
:root:not([data-theme=dark]){
  --pico-font-family-sans-serif:var(--font-body);
  --pico-font-family:var(--font-body);
  --pico-font-family-monospace:var(--font-mono);
  --pico-line-height:1.55;
  --pico-font-weight:400;
  --pico-border-radius:var(--rs);
  --pico-spacing:1.1rem;
  --pico-block-spacing-vertical:clamp(1.5rem,4vw,2.4rem);
  --pico-typography-spacing-vertical:0.9rem;
  --pico-background-color:var(--paper);
  --pico-color:var(--ink);
  --pico-muted-color:var(--ink-2);
  --pico-muted-border-color:var(--line);
  --pico-border-color:var(--line);
  --pico-primary:var(--teal);
  --pico-primary-background:var(--teal);
  --pico-primary-hover:var(--teal-dk);
  --pico-primary-hover-background:var(--teal-dk);
  --pico-primary-border:var(--teal);
  --pico-primary-focus:rgba(15,158,136,.26);
  --pico-primary-underline:rgba(15,158,136,.42);
  --pico-h1-color:var(--ink); --pico-h2-color:var(--ink); --pico-h3-color:var(--ink);
  --pico-h4-color:var(--ink); --pico-h5-color:var(--ink); --pico-h6-color:var(--ink);
  --pico-card-background-color:var(--surface);
  --pico-card-border-color:var(--line);
  --pico-card-box-shadow:none;
  --pico-card-sectioning-background-color:var(--surface);
  --pico-form-element-background-color:#fff;
  --pico-form-element-border-color:var(--line-2);
  --pico-form-element-active-border-color:var(--teal);
  --pico-form-element-focus-color:rgba(15,158,136,.22);
  --pico-form-element-placeholder-color:var(--ink-3);
  --pico-switch-checked-background-color:var(--teal);
}

/* ── base ─────────────────────────────────────────────────────────────────── */
*,*::before,*::after{ box-sizing:border-box; margin:0; padding:0; }
body{ background:var(--paper); color:var(--ink); -webkit-font-smoothing:antialiased; }
h1,h2,h3,.display{ font-family:var(--font-display); font-weight:600; letter-spacing:-.02em; line-height:1.14; }
h1{ font-optical-sizing:auto; }
.mono{ font-family:var(--font-mono); }
::selection{ background:var(--teal-lt); }
/* our custom controls manage their own spacing — neutralize Pico's default form margins */
.btn,.btn-g,.tab,.inp,.ta,.search-inp{ margin-bottom:0; }

/* page shell */
.wrap{ max-width:880px; margin:0 auto; padding:1.6rem 1.1rem 4rem; }

/* ── header: logo · centered search · links ──────────────────────────────── */
.hdr{ display:grid; grid-template-columns:1fr minmax(0,460px) 1fr; align-items:center;
  gap:14px; padding-bottom:1.1rem; margin-bottom:1.4rem; border-bottom:1px solid var(--line); }
.hdr-left{ justify-self:start; display:flex; align-items:baseline; gap:11px; min-width:0; }
.hdr-right{ justify-self:end; display:flex; align-items:center; gap:14px; font-size:13px;
  color:var(--ink-2); white-space:nowrap; }
.hdr-right a{ color:var(--ink-2); text-decoration:none; font-weight:500; }
.hdr-right a:hover{ color:var(--teal); }
/* identity bar in the shared topbar — one definition (was duplicated in every page's <style>) */
.ident{ display:inline-flex; align-items:center; gap:10px; font-size:13px; margin-left:14px; }
.ident .you{ color:var(--teal-dk); font-weight:600; }
.lk{ background:none; border:none; color:var(--text-2); cursor:pointer; font:inherit; text-decoration:underline; padding:0; }
.signin-btn{ background:var(--teal); color:#fff; border:none; border-radius:var(--rs); padding:6px 13px; font-size:13px; font-weight:600; cursor:pointer; font-family:inherit; }
.logo{ font-family:var(--font-display); font-size:22px; font-weight:600; letter-spacing:-.02em; color:var(--ink); }
.logo a{ color:var(--ink); text-decoration:none; }
.logo span{ color:var(--teal); font-style:italic; }
.tagline{ font-size:12.5px; color:var(--ink-3); }
.search-form{ display:flex; width:100%; margin:0; }
.search-inp{ flex:1; min-width:0; border:1px solid var(--line-2); border-radius:99px;
  background:var(--surface); padding:9px 18px; font-size:14px; font-family:inherit;
  color:var(--ink); outline:none; transition:border-color .15s, box-shadow .15s; }
.search-inp::placeholder{ color:var(--ink-3); }
.search-inp:focus{ border-color:var(--teal); box-shadow:0 0 0 4px rgba(15,158,136,.12); }
@media(max-width:720px){
  .hdr{ grid-template-columns:1fr auto; grid-template-areas:'l r' 's s'; row-gap:12px; }
  .hdr-left{ grid-area:l } .hdr-right{ grid-area:r } .search-form{ grid-area:s }
  /* the right cluster gained a bell + ⚙ + Feedback — let it wrap instead of overflowing the screen */
  .hdr-right{ flex-wrap:wrap; justify-content:flex-end; white-space:normal; gap:8px 12px; }
  /* trim the generous desktop side padding so content fits a phone */
  .topbar-inner, .shell, .context{ padding-left:14px; padding-right:14px; }
}

/* ── identity: quiet, not a boxed bar ────────────────────────────────────── */
.ident-bar{ display:flex; align-items:center; gap:10px; margin-bottom:1.6rem;
  font-size:13px; color:var(--ink-2); }
.ident-bar .lbl{ font-family:var(--font-mono); font-size:11px; color:var(--ink-3);
  text-transform:uppercase; letter-spacing:.08em; }
.ident-pill{ display:inline-flex; align-items:center; gap:7px; color:var(--ink);
  font-weight:500; }
.ident-pill::before{ content:''; width:7px; height:7px; border-radius:50%;
  background:var(--teal); box-shadow:0 0 0 3px var(--teal-lt); }
.ident-bar .sp{ flex:1 }

/* ── buttons ──────────────────────────────────────────────────────────────── */
.btn{ background:var(--teal); color:#fff; border:1px solid var(--teal); border-radius:var(--rs);
  padding:9px 18px; font-size:14px; font-weight:500; font-family:var(--font-body);
  cursor:pointer; transition:background .15s; }
.btn:hover{ background:var(--teal-dk); border-color:var(--teal-dk); }
.btn:disabled{ opacity:.45; cursor:not-allowed; }
.btn-g{ background:transparent; color:var(--ink-2); border:1px solid var(--line-2);
  border-radius:var(--rs); padding:8px 14px; font-size:13px; font-family:var(--font-body);
  cursor:pointer; transition:background .15s, color .15s, border-color .15s; }
.btn-g:hover{ background:var(--surface-2); color:var(--ink); border-color:var(--line-2); }

/* ── cards & fields ──────────────────────────────────────────────────────── */
.card{ background:var(--surface); border:1px solid var(--line); border-radius:var(--r);
  padding:1.5rem 1.6rem; margin-bottom:1.4rem; }
.card h2{ font-family:var(--font-display); font-size:21px; font-weight:600; margin:0 0 .35rem; }
.card .hint{ font-size:13.5px; color:var(--ink-2); margin-bottom:1.2rem; line-height:1.6; }
.field{ margin-bottom:1rem; }
.field label{ display:block; font-family:var(--font-mono); font-size:11px; color:var(--ink-2);
  text-transform:uppercase; letter-spacing:.06em; margin-bottom:.4rem; }
.inp,.ta{ width:100%; border:1px solid var(--line-2); border-radius:var(--rs);
  background:#fff; padding:10px 13px; font-size:14px; font-family:var(--font-body);
  color:var(--ink); outline:none; transition:border-color .15s, box-shadow .15s; }
.inp::placeholder,.ta::placeholder{ color:var(--ink-3); }
.inp:focus,.ta:focus{ border-color:var(--teal); box-shadow:0 0 0 4px rgba(15,158,136,.12); }
.ta{ min-height:88px; resize:vertical; line-height:1.55; }
.err{ color:var(--red); font-size:12.5px; min-height:1.1em; margin-top:.45rem; }

/* ── section header + tabs ───────────────────────────────────────────────── */
.section-hd{ display:flex; align-items:center; gap:12px; margin:2.2rem 2px 1.1rem; }
.section-hd h3{ font-family:var(--font-display); font-size:17px; font-weight:600; }
.section-hd .sp{ flex:1 }
.tabs{ display:flex; gap:6px; }
.tab{ font-size:12.5px; font-weight:500; border:1px solid var(--line-2); background:transparent;
  color:var(--ink-2); border-radius:99px; padding:5px 14px; cursor:pointer; font-family:var(--font-body);
  transition:background .15s, color .15s, border-color .15s; }
.tab:hover{ color:var(--ink); }
.tab.active{ background:var(--ink); color:var(--paper); border-color:var(--ink); }

/* ── directory cards ─────────────────────────────────────────────────────── */
.col-card{ display:block; background:var(--surface); border:1px solid var(--line);
  border-radius:var(--r); padding:1.15rem 1.3rem; margin-bottom:.7rem; text-decoration:none;
  color:inherit; transition:border-color .15s, box-shadow .15s, transform .15s; }
.col-card:hover{ border-color:var(--line-2); box-shadow:var(--shadow); transform:translateY(-1px); }
.col-top{ display:flex; align-items:baseline; gap:10px; margin-bottom:.4rem; flex-wrap:wrap; }
.col-title{ font-family:var(--font-display); font-size:18px; font-weight:600; letter-spacing:-.01em; }
.col-mine{ font-family:var(--font-mono); font-size:10px; background:var(--amber-lt); color:var(--amber);
  border-radius:99px; padding:2px 9px; font-weight:500; text-transform:uppercase; letter-spacing:.05em; }
.col-meta{ font-family:var(--font-mono); font-size:11px; color:var(--ink-3); margin-left:auto; }
.col-subject{ font-size:13.5px; color:var(--ink-2); line-height:1.55;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }

/* ── misc ────────────────────────────────────────────────────────────────── */
.empty{ padding:2.4rem; text-align:center; color:var(--ink-3); font-size:14px;
  border:1px dashed var(--line-2); border-radius:var(--r); }
.toast{ position:fixed; bottom:26px; left:50%; transform:translateX(-50%); background:var(--ink);
  color:var(--paper); padding:10px 22px; border-radius:99px; font-size:13px; opacity:0;
  transition:opacity .2s; pointer-events:none; z-index:60; box-shadow:var(--shadow); }
.toast.show{ opacity:1; }

/* ══ canonical app shell (the "Stage"): sticky bar · main · contextual rail ══ */

/* overlay safety — any full-cover modal that isn't .show is fully inert (fixes the
   click-capture regression and keeps rebuilt markup safe) */
.cite-modal:not(.show), .auth-modal:not(.show), .modal-backdrop:not(.show){
  display:none !important; pointer-events:none !important; }
.cite-box, .auth-box, .modal{ pointer-events:auto; }

/* sticky top bar (full-bleed; wraps the existing logo · search · nav grid) */
.topbar{ position:sticky; top:0; z-index:30; background:rgba(247,246,241,.85);
  backdrop-filter:saturate(1.4) blur(10px); border-bottom:1px solid var(--line); }
.topbar-inner{ max-width:1320px; margin:0 auto; padding:11px 24px; }
.topbar-inner.hdr{ padding-bottom:11px; margin-bottom:0; border-bottom:none; }
.kbd{ font-family:var(--font-mono); font-size:11px; color:var(--ink-3); border:1px solid var(--line-2);
  border-radius:6px; padding:1px 6px; margin-left:8px; white-space:nowrap; }

/* slim collection-context line + round icon buttons (replace boxed bars) */
.context{ max-width:1320px; margin:0 auto; padding:14px 24px 0; display:flex; align-items:center;
  gap:12px; flex-wrap:wrap; }
.ctx-kicker{ font-family:var(--font-mono); font-size:10.5px; letter-spacing:.1em; text-transform:uppercase;
  color:var(--teal-dk); display:inline-flex; align-items:center; gap:6px; white-space:nowrap; }
.ctx-title{ font-family:var(--font-display); font-size:17px; font-weight:600; }
.ctx-by{ font-size:12.5px; color:var(--ink-3); }
.ctx-sp{ flex:1; }
.iconbtn{ width:34px; height:34px; border-radius:50%; border:1px solid var(--line-2); background:var(--surface);
  color:var(--ink-2); display:inline-grid; place-items:center; font-size:14px; cursor:pointer; transition:all .15s; }
.iconbtn:hover{ color:var(--teal); border-color:var(--teal); background:var(--teal-lt); }

/* the Stage grid: main + (optional) sticky right rail */
.shell{ max-width:1320px; margin:0 auto; padding:18px 24px 80px; display:grid;
  grid-template-columns:minmax(0,1fr); gap:30px; align-items:start; }
.shell.has-rail{ grid-template-columns:minmax(0,1fr) 360px; }
@media(max-width:980px){ .shell.has-rail{ grid-template-columns:1fr; } .rail{ position:static !important; } }
.shell-main{ min-width:0; }
.rail{ position:sticky; top:78px; display:flex; flex-direction:column; gap:16px; min-width:0; }

/* collapsible section frame — one mechanism for transcript/refs/pages/owner/flags */
.frame{ background:var(--surface); border:1px solid var(--line); border-radius:var(--r); overflow:hidden; margin-bottom:16px; }
.frame-hd{ display:flex; align-items:center; gap:9px; padding:13px 18px; cursor:pointer; }
.frame-hd h2,.frame-hd h3,.frame-hd h4{ font-family:var(--font-display); font-size:15px; margin:0; }
.frame-hd .sub{ font-size:12px; color:var(--ink-3); font-weight:400; font-family:var(--font-body); }
.frame-hd .sp{ flex:1; }
.frame-hd .toggle{ font-family:var(--font-mono); font-size:11px; color:var(--ink-3); background:none; border:none; cursor:pointer; }
.frame-body{ border-top:1px solid var(--line); }
.frame.collapsed > .frame-body{ display:none; }
.frame.collapsed .frame-hd .toggle::after{ content:'▸ show'; }
.frame:not(.collapsed) .frame-hd .toggle::after{ content:'▾ hide'; }

/* ══ throughline navigator (rail widget; reused on player · collection · graph) ══ */
.next{ background:var(--surface); border:1px solid var(--line); border-radius:var(--r); overflow:hidden; }
.next-hd{ padding:13px 16px 11px; border-bottom:1px solid var(--line); }
.next-hd .lab{ font-family:var(--font-mono); font-size:10.5px; letter-spacing:.1em; text-transform:uppercase; color:var(--ink-3); }
.next-hd h3{ font-family:var(--font-display); font-size:17px; margin-top:2px; }
.next-hd .at{ font-size:12.5px; color:var(--ink-2); margin-top:3px; }
.next-sec{ padding:13px 16px; }
.line-card{ display:block; width:100%; text-align:left; border:1px solid var(--line); border-radius:var(--rs);
  background:var(--surface); padding:11px 13px; margin-bottom:9px; cursor:pointer; transition:all .12s; color:var(--ink); }
.line-card:last-child{ margin-bottom:0; }
.line-card:hover{ border-color:var(--teal); background:var(--teal-lt); }
.line-card .nm{ font-family:var(--font-display); font-size:14.5px; font-weight:600; line-height:1.25; color:var(--ink); }
.line-card .meta{ display:flex; align-items:center; gap:8px; margin-top:6px; font-family:var(--font-mono); font-size:10.5px; color:var(--ink-3); }
.line-card .here{ color:var(--teal-dk); font-weight:500; }
.tag{ font-family:var(--font-mono); font-size:9px; letter-spacing:.06em; text-transform:uppercase; border-radius:99px; padding:2px 8px; font-weight:500; }
.tag.page{ background:var(--teal-lt); color:var(--teal-dk); }
.tag.trail{ background:var(--amber-lt); color:var(--amber); }
.trail-back{ font-family:var(--font-mono); font-size:11px; color:var(--ink-2); background:none; border:none; margin-bottom:8px; padding:0; cursor:pointer; }
.trail-back:hover{ color:var(--teal); }
.trail-hd{ font-family:var(--font-display); font-size:16px; font-weight:600; line-height:1.2; }
.trail-note{ font-family:var(--font-mono); font-size:10.5px; color:var(--ink-3); margin:3px 0 12px; }
.stop{ position:relative; padding:9px 0 9px 16px; border-left:2px solid var(--line); margin-left:5px; cursor:pointer; }
.stop:hover{ background:var(--surface-2); }
.stop.cur{ border-left-color:var(--teal); background:linear-gradient(90deg,var(--teal-lt),transparent 80%); }
.stop .dotn{ position:absolute; left:-6px; top:13px; width:10px; height:10px; border-radius:50%; background:var(--surface-3); border:2px solid var(--surface); }
.stop.cur .dotn{ background:var(--teal); }
.stop .s-who{ font-weight:600; font-size:12.5px; }
.stop .s-where{ font-family:var(--font-mono); font-size:10.5px; color:var(--ink-3); }
.stop .s-where .away{ color:var(--amber); }
.stop .s-txt{ font-size:13px; line-height:1.5; color:var(--ink); margin-top:2px; }
.trail-nav{ display:flex; gap:8px; margin-top:13px; }
.trail-nav button{ flex:1; border:1px solid var(--line-2); background:var(--surface); border-radius:var(--rs); padding:9px; font-size:12.5px; font-family:var(--font-body); color:var(--ink); cursor:pointer; }
.trail-nav button:hover:not(:disabled){ border-color:var(--teal); background:var(--teal-lt); color:var(--teal-dk); }
.trail-nav button:disabled{ opacity:.4; cursor:default; }
.trail-nav .primary{ background:var(--teal); color:#fff; border-color:var(--teal); font-weight:500; }
.trail-nav .primary:hover:not(:disabled){ background:var(--teal-dk); color:#fff; }

/* minimized state (default) + minimize affordance — keep the rail calm until asked */
.next-mini{ display:flex; align-items:center; gap:10px; width:100%; text-align:left; background:var(--surface);
  border:1px solid var(--line); border-radius:var(--r); padding:11px 14px; cursor:pointer; font-family:var(--font-body); }
.next-mini:hover{ border-color:var(--teal); }
.next-mini .lab{ font-family:var(--font-mono); font-size:10px; letter-spacing:.1em; text-transform:uppercase; color:var(--ink-3); }
.next-mini .mini-n{ font-family:var(--font-display); font-size:14px; font-weight:600; color:var(--ink); }
.next-mini .mini-show{ margin-left:auto; font-family:var(--font-mono); font-size:11px; color:var(--teal-dk); }
.next-min{ border:none; background:none; color:var(--ink-3); font-size:18px; line-height:1; cursor:pointer; padding:0 2px; float:right; }
.next-min:hover{ color:var(--ink); }
.trail-top{ display:flex; align-items:center; justify-content:space-between; }
.trail-end{ font-family:var(--font-mono); font-size:11px; color:var(--ink-3); margin-top:13px; padding:9px; text-align:center; }

/* ══ transit map legend (the colour key for the channels; home + collection) ══ */
.tm-legend{ position:absolute; left:12px; top:12px; max-width:240px; background:rgba(247,246,241,.93);
  backdrop-filter:blur(4px); border:1px solid var(--line); border-radius:var(--rs); padding:9px 11px; box-shadow:var(--shadow); }
.tm-leg-hd{ font-family:var(--font-mono); font-size:9.5px; letter-spacing:.1em; text-transform:uppercase; color:var(--ink-3); margin-bottom:6px; }
.tm-leg{ display:flex; align-items:center; gap:9px; width:100%; text-align:left; background:none; border:none; padding:3px 4px; border-radius:6px; cursor:pointer; font-family:inherit; }
.tm-leg:hover{ background:var(--teal-lt); }
.tm-swatch{ width:22px; height:6px; border-radius:3px; flex-shrink:0; box-shadow:0 0 0 1px rgba(28,27,23,.06); }
.tm-name{ font-size:12.5px; color:var(--ink); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.tm-leg.active{ background:var(--teal-lt); }
.tm-leg.active .tm-name{ font-weight:600; }
.tm-empty{ font-size:12px; color:var(--ink-3); }

/* ══ transit map — the Underground-style SVG diagram (home + collection) ══
   DC grammar (bold trunks, white-ringed interchanges, terminus bullets, a district wash)
   in the paper / teal / Fraunces system. Colours come from JS (the line palette); this is
   the chrome around them. */
.tm-svg{ display:block; width:100%; height:100%; cursor:grab; touch-action:none; -webkit-user-select:none; user-select:none; }
.tm-svg:active{ cursor:grabbing; }
/* the orienting district wash — minimal non-data ink */
.tm-zone{ fill:rgba(15,158,136,.045); stroke:rgba(15,158,136,.13); stroke-width:1.25; }
/* line ribbons */
.tm-line{ transition:opacity .18s ease; }
.tm-line.dim{ opacity:.12; }
/* stations */
.tm-spine{ stroke:#cdccc6; }   /* base trunk through a collection's talks — coloured throughlines lay over it */
.tm-st{ transition:opacity .18s ease; }
.tm-st.dim{ opacity:.12; }
.tm-bar{ fill:var(--surface); stroke:var(--ink); stroke-width:2; }           /* interchange connector */
.tm-ring{ fill:var(--surface); stroke:var(--ink); }                          /* interchange ring (DC) */
.tm-tick{ fill:var(--surface); stroke:var(--ink); stroke-width:1.5; }        /* single-stop tick */
.tm-dot{ stroke:var(--surface); stroke-width:1.5; }                          /* single-stop / terminus bullet */
.tm-st.seen .tm-bar{ stroke:#cdccc6; }
.tm-st.seen .tm-ring{ stroke:#cdccc6; }
.tm-st.seen .tm-tick{ stroke:#cdccc6; }
.tm-label{ font-family:var(--font-display); font-weight:600; fill:var(--ink); paint-order:stroke; }
.tm-st.seen .tm-label{ fill:var(--ink-3); }
.tm-label-bg{ fill:var(--paper); opacity:.95; }
.tm-st.seen .tm-label-bg{ opacity:.6; }
/* "new to you" — the one --new accent, on the map: a bright ring; a visited talk with new */
/* activity keeps its label bright so it still pops. */
.tm-new{ fill:none; stroke:var(--ink); stroke-width:2; stroke-dasharray:3 3; }   /* "new to you" — a neutral dashed ring (non-hue, distinct by pattern not colour) */
.tm-st.is-new .tm-label{ fill:var(--ink); }
.tm-st.is-new .tm-label-bg{ opacity:.95; }
.tm-hit{ fill:transparent; cursor:pointer; }
/* "you are here" — pulsing, labelled amber marker (the talk minimap's current location) */
.tm-focal-glow{ fill:var(--amber); opacity:.14; }
.tm-focal{ fill:none; stroke:var(--amber); stroke-width:3.5; opacity:.95; }
.tm-focal-pulse{ fill:none; stroke:var(--amber); stroke-width:3; transform-box:fill-box; transform-origin:center; animation:tm-pulse 1.8s ease-out infinite; }
@keyframes tm-pulse{ 0%{ transform:scale(.7); opacity:.6; } 100%{ transform:scale(2.2); opacity:0; } }
.tm-here{ font-family:var(--font-mono); font-size:9px; letter-spacing:.14em; text-transform:uppercase; font-weight:500; fill:var(--amber); paint-order:stroke; stroke:var(--paper); stroke-width:3px; }
.tm-st.focal .tm-label{ fill:var(--amber-dk,#9a6a12); font-weight:600; }
@media (prefers-reduced-motion: reduce){ .tm-focal-pulse{ animation:none; opacity:0; } }

/* collapsible map card — the legend lives with the map; one toggle minimises both */
.tm-collapsed{ display:none !important; }
.map-min{ margin-left:auto; display:inline-flex; align-items:center; gap:6px; background:none; border:1px solid var(--line-2);
  border-radius:99px; padding:3px 11px; font-family:var(--font-mono); font-size:10.5px; letter-spacing:.04em;
  color:var(--ink-2); cursor:pointer; flex:none; }
.map-min:hover{ background:var(--surface-2); color:var(--ink); }
.map-min .mm-chev{ transition:transform .18s ease; display:inline-block; }
.map-min.is-min .mm-chev{ transform:rotate(-90deg); }
/* a header row for maps that didn't already have one (collection) */
.map-hd2{ display:flex; align-items:center; gap:10px; margin:2px 2px 9px; }
.map-hd2 .map-h2t{ font-family:var(--font-mono); font-size:10.5px; letter-spacing:.1em; text-transform:uppercase; color:var(--ink-3); }

/* ══════════════════════════════════════════════════════════════════════════
   LIGHT PASTEL-NEON BOARD — a cool, bright diner counter, daylit. Beck's metro
   fundamentals kept; soft pastel-neon glow (not dark cyberpunk). Overrides the
   tm-* styling above. Glow = a gentle drop-shadow in each element's own `color`.
   ══════════════════════════════════════════════════════════════════════════ */
.tm-svg{
  background-color:var(--board);
  background-image:
    radial-gradient(rgba(33,31,25,.05) 1px, transparent 1.5px),
    radial-gradient(125% 120% at 50% -4%, var(--board-2), transparent 64%);
  background-size:23px 23px, 100% 100%;
}
/* signature: a thin '90s tri-colour accent rule along the top of the board */
.gwrap::before,.col-map-wrap::before,.talkmap-wrap::before{
  content:''; position:absolute; top:0; left:0; right:0; height:3px; z-index:3;
  background:linear-gradient(90deg, #0f9e88 0%, #5a8df0 34%, #9a7be8 64%, #f3705c 100%);
  opacity:.85;
}
.tm-zone{ fill:rgba(15,158,136,.04); stroke:rgba(33,31,25,.05); }          /* faint inset */

/* lines = soft pastel-neon tubes (a gentle halo in their own colour) */
.tm-line{ filter:drop-shadow(0 0 2.5px) drop-shadow(0 0 1px); }
.tm-line.dim{ opacity:.16; filter:none; }

/* stations = chrome (cream rim, dark core); single dots glow softly in the line colour */
.tm-ring{ fill:var(--surface); stroke:var(--ink); filter:drop-shadow(0 1px 1.5px rgba(33,31,25,.16)); }
.tm-dot{ stroke:var(--surface); stroke-width:1.5; filter:drop-shadow(0 0 2.5px); }
.tm-tick{ fill:var(--surface); stroke:var(--line-2); }
.tm-st.seen .tm-ring{ stroke:#b9b2a2; filter:none; }
.tm-st.seen .tm-dot{ filter:none; }

/* labels: warm ink on a paper backing (sans for legibility) */
.tm-label{ fill:var(--ink); font-family:var(--font-body); font-weight:600; }
.tm-label-bg{ fill:var(--paper); opacity:.9; }
.tm-st.seen .tm-label{ fill:var(--ink-3); }
.tm-st.seen .tm-label-bg{ opacity:.6; }

/* zones: soft pools of colour; collection names in colour on a paper pill (mono signage) */
.tm-zonegrp{ opacity:.16; }
.tm-zonelabel{ filter:none; font-weight:700; }
.tm-zonelabel-bg{ fill:var(--paper); opacity:.84; }

/* "you are here" — a warm amber flag (distinct from every line colour) */
.tm-focal-glow{ fill:#f2a13e; opacity:.2; }
.tm-focal{ stroke:#ef9a3c; color:#ef9a3c; filter:drop-shadow(0 0 3px); }
.tm-focal-pulse{ stroke:#ef9a3c; }
.tm-here{ fill:#b9710f; stroke:var(--paper); stroke-width:3px; paint-order:stroke; }

/* patina pools behind a station: teal DEPTH (load-bearing, long-term) + amber BLOOM (recent activity
   + anonymous live-presence warmth). Two channels replace the old single mark-count "heat". */
/* PATINA — NON-hue channels (hue is reserved for rails; this stays legible for colour-vision
   deficiency): DEPTH = size + a dark neutral rim on the strongest; BLOOM = a hue-free "ping" that
   pulses (motion = live). */
.tm-ping{ fill:none; stroke:var(--ink-2); stroke-width:2; opacity:.5; transform-box:fill-box; transform-origin:center; }
.tm-ping.live{ animation:tm-ping 1.8s ease-out infinite; }
@keyframes tm-ping{ 0%{ transform:scale(.62); opacity:.6; } 70%{ opacity:.13; } 100%{ transform:scale(1.75); opacity:0; } }
@media (prefers-reduced-motion: reduce){ .tm-ping.live{ animation:none; opacity:.5; } }
.tm-dot.tm-deep{ stroke:var(--ink); stroke-width:2.5; }
.tm-ring.tm-deep{ stroke:var(--ink); }
/* legend: palette toggle + patina key glyphs */
.tm-palbtn{ display:inline-flex; align-items:center; gap:5px; font-family:var(--font-mono); font-size:10.5px; letter-spacing:.03em; color:var(--ink-2); background:var(--surface-2); border:1px solid var(--line-2); border-radius:99px; padding:3px 10px; cursor:pointer; margin-bottom:9px; }
.tm-palbtn:hover{ background:var(--surface-3); color:var(--ink); }
.tm-railsw{ flex-shrink:0; vertical-align:middle; }   /* legend mini-rail (colour + dash) */
.tm-leg-note{ flex-basis:100%; font-family:var(--font-mono); font-size:10px; font-style:italic; color:var(--ink-3); margin:3px 2px 1px; }
.tm-key{ width:16px; height:16px; flex-shrink:0; display:inline-block; }
.tm-key-size{ width:13px; height:13px; background:var(--ink-2); border-radius:50%; box-shadow:0 0 0 3px var(--surface-2); }
.tm-key-width{ height:8px; background:var(--ink-2); border-radius:4px; align-self:center; }   /* a thick rail stub */
.tm-key-ping{ background:none; border:2px solid var(--ink-2); border-radius:50%; }
/* + promoted "minor stations" (sub-discussions that grew critical) */
.tm-spur{ stroke:#d98a2b; stroke-width:1.5; opacity:.5; }
.tm-minor-dot{ fill:var(--amber); stroke:var(--surface); stroke-width:1.5; filter:drop-shadow(0 0 2px #e8a13a); }
.tm-minor-bg{ fill:var(--paper); opacity:.9; }
.tm-minor-label{ font-family:var(--font-mono); fill:var(--ink-2); }

/* live presence — a cool pulsing ring on a station someone is watching right now */
.tm-livepulse{ position:absolute; width:16px; height:16px; transform:translate(-50%,-50%); pointer-events:none; z-index:4; }
.tm-livepulse::before{ content:''; position:absolute; inset:0; border-radius:50%; border:2px solid var(--teal); transform-origin:center; animation:tm-live 1.7s ease-out infinite; }
.tm-livepulse::after{ content:''; position:absolute; inset:5px; border-radius:50%; background:var(--teal); box-shadow:0 0 6px var(--teal); }
@keyframes tm-live{ 0%{ transform:scale(.5); opacity:.75; } 100%{ transform:scale(2.7); opacity:0; } }
@media (prefers-reduced-motion: reduce){ .tm-livepulse::before{ animation:none; opacity:.4; transform:scale(1.4); } }

/* ══ zoom transition between scales (system → collection → talk) ══
   Cross-document View Transitions: the map box morphs from one scale's place/size to the
   next, so moving between pages reads as zooming the same map. No-ops where unsupported. */
@view-transition { navigation: auto; }
.scalemap{ view-transition-name: scalemap; }
::view-transition-group(scalemap){ animation-duration:.42s; animation-timing-function:cubic-bezier(.4,0,.2,1); }
::view-transition-old(root),::view-transition-new(root){ animation-duration:.28s; }
@media (prefers-reduced-motion: reduce){ @view-transition { navigation: none; } }
/* collection zones (system scale) — translucent territories, Frankfurt fare-zone style.
   Opacity lives on the GROUP so a zone's own overlapping shapes read as one flat blob;
   different zones still blend where collections share talks. */
.tm-zonegrp{ opacity:.13; }
.tm-zonegrp.dim{ opacity:.03; }
.tm-zonelabel-bg{ fill:var(--paper); opacity:.84; }
.tm-zonelabel{ font-family:var(--font-display); font-weight:600; font-size:13.5px; letter-spacing:.01em; opacity:.95; }
.tm-zonelabel.dim{ opacity:.12; }
