/* Again By Heart: the page's styles (app.html loads this as app.css?v=…) */
:root{
  --bg:#14120F;
  --panel:#1C1915;
  --ink:#EDE6D6;
  --muted:#9A9184;
  --line: rgba(237,230,214,0.10);
  --audio:#E4A23A;
  --video:#4F76B0;
  --image:#C1573F;
  --text:#7C9070;
  --zipfile:#CCCCCC;
  --serif: "Iowan Old Style","Palatino Linotype", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --sleeve-w: min(340px, 88vw); /* width of the detail panel on wide screens */
  --timeline-h: 88px; /* kept in sync with the real timeline height by the script */
}
*{box-sizing:border-box;}
html,body{ margin:0; padding:0; height:100%; width:100%; }
body{
  background:var(--bg); color:var(--ink);
  font-family:var(--sans);
  overflow:hidden;
  -webkit-tap-highlight-color:transparent;
  -webkit-touch-callout:none; -webkit-user-select:none; user-select:none; /* no text-selection pop-ups while dragging the map */
}

#app{ position:fixed; inset:0; display:none; } /* fixed, not 100vh: phone browser bars change the viewport height */
#graph-container{ position:absolute; inset:0; background:var(--bg); }
#graph-canvas{ position:absolute; inset:0; display:block; touch-action:none; -webkit-touch-callout:none; }

.state-message{
  position:fixed; inset:0; display:flex; align-items:center; justify-content:center;
  background:var(--bg); color:var(--ink); font-size:1.05rem; text-align:center; padding:2rem;
  font-family:var(--sans); transition:opacity .25s ease;
}
.state-message{ flex-direction:column; gap:22px; }
.state-text{ max-width:34em; }
/* The loading lines: each new line is its own element, faded in where the old one faded out
   (in one grid cell, so nothing jumps). Swapping the text inside one element left the old words
   painted on screen in some browsers (Safari, next to the animated heart). */
.state-lines{ display:grid; justify-items:center; align-items:start; min-height:2.6em; }
.state-lines > .state-text{ grid-area:1 / 1; transition:opacity .3s ease; will-change:opacity; transform:translateZ(0); }
.state-lines > .state-text.in{ opacity:0; }
.state-lines > .state-text.out{ opacity:0; }
.state-message.error .loader{ display:none; }

/* ---- the loading heart (one 3.6s loop) ----
   0-18%  outline draws itself      18-28% the circle fills red, a ripple goes out (record button)
   28-40% it sits there, recording   40-56% the record dot swells into the big circle and the heart
          fills with red circles of different shades, popping in all over, in random order
   62-76% two heartbeats, each with a glow     86-98% it all fades; the loop draws again */
.loader{ color:#E0573A; overflow:visible; }
.loader *{ transform-box:fill-box; transform-origin:center; }
.ld-outline path, .ld-ring{ stroke-dasharray:1 1; animation:ld-draw 3.6s cubic-bezier(.6,0,.3,1) infinite both; }
.ld-right{ animation-delay:.08s !important; }
.ld-ring{ animation-delay:.16s !important; }
.ld-rec{ fill:#F0402F; animation:ld-rec 3.6s ease-in-out infinite; }
.ld-ripple{ stroke:#E0573A; opacity:0; animation:ld-ripple 3.6s ease-out infinite; }
.ld-cells circle{ opacity:0; animation:ld-pop 3.6s cubic-bezier(.3,1.5,.5,1) infinite both; animation-delay:var(--d, 0s); }
/* The circles fade out together (as a group), however late each one popped in. */
.ld-fill{ opacity:0; animation:ld-fill 3.6s linear infinite; }
.ld-beatgrp{ transform-origin:50% 55%; animation:ld-beat 3.6s ease-in-out infinite; }
.ld-glow{ fill:#E0573A; filter:blur(2.5px); opacity:0; animation:ld-glow 3.6s ease-out infinite; }
@keyframes ld-draw{
  0%{ stroke-dashoffset:1; opacity:1; }
  18%{ stroke-dashoffset:0; opacity:1; }
  52%{ stroke-dashoffset:0; opacity:1; }
  60%, 100%{ stroke-dashoffset:0; opacity:0; } /* (gone until the loop draws it again) */
}
@keyframes ld-rec{
  0%, 18%{ transform:scale(0); opacity:0; }
  23%{ transform:scale(1.12); opacity:1; }
  26%{ transform:scale(.94); }
  28%{ transform:scale(1); opacity:1; }
  40%{ transform:scale(1); }
  45%{ transform:scale(1.29); } /* (becomes the big circle in the filled heart) */
  85%{ transform:scale(1.29); opacity:1; animation-timing-function:ease-in; }
  97%, 100%{ transform:scale(1.29); opacity:0; }
}
@keyframes ld-ripple{
  0%, 22%{ transform:scale(1); opacity:0; }
  24%{ opacity:.8; }
  36%, 100%{ transform:scale(2.1); opacity:0; }
}
/* each circle starts at 42% plus its own random delay (--d) */
@keyframes ld-pop{
  0%, 42%{ transform:scale(0); opacity:0; }
  43%{ opacity:1; }
  46.5%, 100%{ transform:scale(1); opacity:1; }
}
@keyframes ld-fill{
  0%, 40%{ opacity:0; }
  41%, 85%{ opacity:1; animation-timing-function:ease-in; }
  97%, 100%{ opacity:0; }
}
@keyframes ld-beat{
  0%, 62%{ transform:scale(1); }
  65%{ transform:scale(1.1); }
  68%{ transform:scale(.99); }
  71%{ transform:scale(1.07); }
  76%, 100%{ transform:scale(1); }
}
@keyframes ld-glow{
  0%, 62%{ transform:scale(1); opacity:0; }
  65%{ transform:scale(1.25); opacity:.4; }
  68%{ opacity:.1; }
  71%{ transform:scale(1.3); opacity:.35; }
  80%, 100%{ transform:scale(1.5); opacity:0; }
}
@media (prefers-reduced-motion: reduce){
  .loader *{ animation:none !important; }
  .ld-cells circle, .ld-fill{ opacity:1; }
  .ld-rec{ transform:scale(1.29); }
  .ld-outline, .ld-ripple, .ld-glow{ display:none; }
}

/* ---------- Top bar ---------- */
.topbar{
  position:absolute; top:0; left:0; right:0;
  display:flex; align-items:center; gap:18px;
  padding:14px 18px;
  background:linear-gradient(to bottom, rgba(20,18,15,0.92), rgba(20,18,15,0));
  z-index:5;
  flex-wrap:wrap;
  transition:right .32s cubic-bezier(.2,.8,.2,1);
}
.brand{
  font-family:var(--serif);
  font-size:19px;
  letter-spacing:0.2px;
  display:flex; align-items:baseline; gap:8px;
  white-space:nowrap;
}
.brand{ color:inherit; text-decoration:none; }
.brand:hover .dot{ transform:scale(1.08); }
.brand .dot{ transition:transform .15s ease; }
.brand:focus-visible{ outline:2px solid rgba(237,230,214,0.5); outline-offset:3px; border-radius:6px; }
.brand .dot{ color:#E0573A; display:inline-flex; align-self:center; } /* a heart with a record for its right side */
.brand .dot svg{ display:block; }
.brand small{ color:var(--muted); font-size:12px; font-family:var(--sans); }

.pills{ display:flex; gap:8px; flex-wrap:wrap; }
.pill{
  display:flex; align-items:center; gap:7px;
  padding:6px 12px 6px 9px;
  border-radius:999px;
  border:1px solid var(--line);
  background:var(--panel);
  color:var(--muted);
  font-size:12.5px;
  cursor:pointer;
  user-select:none;
  transition:opacity .15s ease, border-color .15s ease, color .15s ease;
}
.pill .sw{ width:8px; height:8px; border-radius:50%; flex:none; }
.pill.active{ color:var(--ink); border-color:rgba(237,230,214,0.25); }
.pill.dim{ opacity:0.4; }
.layout-toggle{
  padding:6px 14px;
  border-radius:999px;
  border:1px solid var(--line);
  background:var(--panel);
  color:var(--ink);
  font-family:var(--sans);
  font-size:12.5px;
  cursor:pointer;
  user-select:none;
  white-space:nowrap;
  transition:color .15s ease, border-color .15s ease;
  display: none;
}
.layout-toggle:active{ transform:scale(0.97); }
.layout-toggle.active{ color:var(--ink); border-color:rgba(237,230,214,0.25); }
.counts{ margin-left:auto; font-size:12px; color:var(--muted); white-space:nowrap; }
.icon-btn{
  all:unset; display:none; box-sizing:border-box; cursor:pointer; position:relative;
  width:36px; height:36px; border-radius:18px; border:1px solid var(--line); color:var(--ink);
  align-items:center; justify-content:center; flex:none;
}
.icon-btn:active{ background:rgba(237,230,214,0.08); }
.icon-btn.on{ border-color:rgba(237,230,214,0.5); }
.icon-btn.filtered::after{ /* some record types are switched off */
  content:""; position:absolute; top:5px; right:5px; width:7px; height:7px; border-radius:50%; background:#E0573A;
}
.counts b{ color:var(--ink); font-weight:600; }
.c-short{ display:none; }
#view-toggle, #list-toggle, #genres-toggle, #new-toggle, #groups-toggle, #spread-toggle{ display:inline-flex; align-items:center; gap:7px; }
#view-toggle .lt-icon, #list-toggle .lt-icon, #genres-toggle .lt-icon, #new-toggle .lt-icon, #groups-toggle .lt-icon, #spread-toggle .lt-icon{ flex:none; }
#list-toggle.open{ color:var(--ink); border-color:rgba(237,230,214,0.5); }

/* The Spread control: a button that opens a small panel with one slider. */
.spread-wrap{ position:relative; }
#spread-toggle.open{ border-color:rgba(237,230,214,0.5); }
.spread-panel{
  position:absolute; top:calc(100% + 8px); left:0; z-index:8;
  width:230px; padding:12px 14px 10px;
  background:rgba(28,25,21,0.97); border:1px solid var(--line); border-radius:12px;
  box-shadow:0 10px 30px rgba(0,0,0,.5);
}
.spread-panel[hidden]{ display:none; }
.spread-title{ display:flex; justify-content:space-between; font-size:12.5px; color:var(--ink); margin-bottom:4px; }
.spread-value{ color:var(--muted); font-variant-numeric:tabular-nums; }
.spread-ends{ display:flex; justify-content:space-between; font-size:11px; color:var(--muted); }
/* the page-wide range style hides the track (the timeline draws its own), so this one draws its own */
.spread-panel input[type=range]{ height:28px; }
.spread-panel input[type=range]::-webkit-slider-runnable-track{ height:3px; border-radius:2px; background:rgba(237,230,214,0.3); }
.spread-panel input[type=range]::-moz-range-track{ height:3px; border-radius:2px; background:rgba(237,230,214,0.3); }
.spread-panel input[type=range]::-webkit-slider-thumb{ margin-top:-6px; }
/* The challenges toggle only exists when the data has challenges. */
#groups-toggle{ display:none; }
#app.has-groups #groups-toggle{ display:inline-flex; }
/* The Projects (challenge groups) toggle and the Spread control are hidden for now: groups stay on and
   Spread stays at its widest. Delete this rule to bring the controls back. */
#groups-toggle, #app.has-groups #groups-toggle, #spread-wrap{ display:none !important; }

/* Search: type a record id and press Enter. */
.search{
  display:flex; align-items:center; gap:7px; padding:0 6px 0 12px; height:30px; flex:none;
  border-radius:999px; border:1px solid var(--line); background:var(--panel); color:var(--muted);
  transition:border-color .15s ease, color .15s ease;
}
.search:focus-within{ border-color:rgba(237,230,214,0.5); color:var(--ink); }
.search svg{ width:14px; height:14px; flex:none; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; }
.search input{
  width:104px; min-width:0; border:0; outline:0; background:transparent; color:var(--ink);
  font:inherit; font-size:12.5px; -webkit-appearance:none; appearance:none;
  -webkit-user-select:text; user-select:text; transition:width .2s ease;
}
.search input::placeholder{ color:var(--muted); }
/* Username suggestions under the search box */
.suggest{
  position:fixed; z-index:40; min-width:220px; max-width:min(360px, calc(100vw - 16px)); padding:5px;
  background:rgba(24,21,17,0.98); border:1px solid var(--line); border-radius:12px;
  box-shadow:0 14px 34px rgba(0,0,0,.55); font-size:13px;
}
.suggest[hidden]{ display:none; }
.suggest-item{
  display:flex; align-items:center; gap:9px; padding:6px 8px; border-radius:8px; cursor:pointer; color:var(--ink);
}
.suggest-item.on, .suggest-item:hover{ background:rgba(237,230,214,0.09); }
.suggest-item img, .suggest-item .ph{
  width:26px; height:26px; border-radius:4px; object-fit:cover; flex:none; background:#2a261f;
  display:inline-flex; align-items:center; justify-content:center; font-size:12px; color:var(--muted);
}
.suggest-item .nm{ flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.suggest-item .nm mark{ background:none; color:var(--ink); font-weight:600; }
.suggest{ max-height:min(70vh, 520px); overflow-y:auto; overscroll-behavior:contain; touch-action:pan-y; -webkit-overflow-scrolling:touch; }
.suggest-head{ padding:7px 8px 3px; font-size:10.5px; letter-spacing:.06em; text-transform:uppercase; color:var(--muted); }
.suggest-head + .suggest-item{ margin-top:0; }
.suggest-item .ph.tg{ border-radius:50%; color:#E0573A; background:rgba(224,87,58,0.12); }
.suggest-item .ph.grp{ border-radius:50%; color:#C98A9A; background:rgba(201,138,154,0.12); }
.suggest-item .nm small{ display:block; font-size:11.5px; color:var(--muted); overflow:hidden; text-overflow:ellipsis; }
.suggest-item .ct{ color:var(--muted); font-size:11.5px; font-variant-numeric:tabular-nums; }
@media (max-width:640px){ .suggest-item{ padding:9px 8px; } .suggest{ font-size:15px; } }
.search input:focus, .search.has-text input{ width:240px; } /* (room for the whole hint) */
.search input::-webkit-search-cancel-button{ display:none; }
.search button{
  border:0; background:transparent; color:inherit; cursor:pointer; padding:0 6px; height:100%; font:inherit; font-size:12px;
  border-radius:999px; display:none;
}
.search.has-text button{ display:inline-block; color:var(--ink); }
.search.busy{ opacity:.6; pointer-events:none; }
.search.bad{ border-color:#C0392B; animation:search-shake .3s; }
@keyframes search-shake{ 25%{ transform:translateX(-3px); } 75%{ transform:translateX(3px); } }
@media (prefers-reduced-motion: reduce){ .search.bad{ animation:none; } }
/* make room: the subtitle goes while the detail panel is narrowing the top bar */
#app.sleeve-open .brand small{ display:none; }

/* ---------- Timeline / scrubber ---------- */
.timeline{
  position:absolute; left:0; right:0; bottom:0;
  padding:14px 20px 18px;
  background:linear-gradient(to top, rgba(20,18,15,0.95), rgba(20,18,15,0));
  z-index:5;
  display:flex; flex-direction:column; gap:8px;
  transition:right .32s cubic-bezier(.2,.8,.2,1);
}
.timeline-row{ display:flex; align-items:center; gap:14px; }
.playbtn{
  flex:none; width:32px; height:32px; border-radius:50%;
  border:1px solid var(--line); background:var(--panel);
  color:var(--ink); display:flex; align-items:center; justify-content:center;
  cursor:pointer; font-size:12px;
}
.playbtn:active{ transform:scale(0.94); }
.track-wrap{ flex:1; position:relative; height:24px; display:flex; align-items:center; }
.track-bg{
  position:absolute; left:0; right:0; height:3px; top:50%; transform:translateY(-50%);
  background:var(--line); border-radius:2px;
}
.track-fill{
  position:absolute; left:0; height:3px; top:50%; transform:translateY(-50%);
  background:var(--muted); border-radius:2px; opacity:0.55;
}
input[type=range]{
  -webkit-appearance:none; appearance:none;
  position:relative; width:100%; height:24px;
  background:transparent; margin:0; cursor:pointer;
}
input[type=range]::-webkit-slider-thumb{
  -webkit-appearance:none;
  width:14px; height:14px; border-radius:50%;
  background:var(--ink); border:2px solid var(--bg);
  box-shadow:0 0 0 1px rgba(237,230,214,0.4);
  cursor:grab;
}
input[type=range]::-moz-range-thumb{
  width:14px; height:14px; border-radius:50%;
  background:var(--ink); border:2px solid var(--bg);
  box-shadow:0 0 0 1px rgba(237,230,214,0.4); cursor:grab;
}
input[type=range]::-webkit-slider-runnable-track{ background:transparent; }
/* Two sliders on one track: the inputs let clicks through, their handles don't. */
input[type=range].dual{ position:absolute; left:0; right:0; top:0; pointer-events:none; }
input[type=range].dual::-webkit-slider-thumb{ pointer-events:auto; position:relative; z-index:1; }
input[type=range].dual::-moz-range-thumb{ pointer-events:auto; }
input[type=range].dual.end{ z-index:2; }
input[type=range].dual.start{ z-index:1; }
input[type=range].dual.start.on-top{ z-index:3; }
input[type=range].dual.start::-webkit-slider-thumb{ background:var(--bg); border:2px solid var(--ink); box-shadow:none; }
input[type=range].dual.start::-moz-range-thumb{ background:var(--bg); border:2px solid var(--ink); box-shadow:none; }
.current-date .dash{ color:var(--muted); padding:0 3px; }
.datelabels{
  display:flex; justify-content:space-between;
  font-size:11px; color:var(--muted); font-variant-numeric: tabular-nums;
}
.current-date{
  font-family:var(--serif); font-size:13px; color:var(--ink);
  min-width:142px; text-align:right; font-variant-numeric: tabular-nums; white-space:nowrap;
} /* (wide enough for a "Mar 2018–Apr 2022" range, so the track doesn't jump when the range starts) */

/* ---------- Detail panel (sleeve) ---------- */
.sleeve{
  position:absolute; top:0; right:0; bottom:0;
  width:var(--sleeve-w);

  border-left:1px solid var(--line);
  transform:translateX(100%);
  transition:transform .32s cubic-bezier(.2,.8,.2,1);
  z-index:10;
  display:flex; flex-direction:column;
  overflow:hidden;
  backdrop-filter: brightness(0.5) blur(0.5px); 
  -webkit-backdrop-filter: brightness(0.5) blur(0.5px);
}
.sleeve.open{ transform:translateX(0); }
.sleeve-scroll{ overflow-y:auto; flex:1; }
.sleeve-media{
  width:100%; aspect-ratio:1/1;
  display:flex; align-items:center; justify-content:center;
  position:relative; flex:none;
}
audio {
    color-scheme: dark;
    height:30px;
}
.sleeve-media img{ width:100%; height:100%; object-fit:cover; display:block; }
.sleeve-media video{ width:100%; height:100%; object-fit:contain; }
.text-plate{
  width:100%; height:100%; padding:26px;
  display:flex; align-items:center; justify-content:center; text-align:center;
  font-family:var(--serif); font-size:17px; line-height:1.5; color:var(--ink);
  background:
    radial-gradient(circle at 30% 20%, rgba(124,144,112,0.18), transparent 60%),
    #171410;
}
.type-tag{
  position:absolute; top:12px; left:12px;
  padding:4px 10px; border-radius:999px;
  font-size:10.5px; letter-spacing:0.3px;
  background:rgba(20,18,15,0.72); backdrop-filter:blur(4px);
  display:flex; align-items:center; gap:6px;
}
.type-tag .sw{ width:7px; height:7px; border-radius:50%; }
.close-btn{
  position:absolute; top:10px; right:10px; z-index:2;
  width:28px; height:28px; border-radius:50%;
  background:rgba(20,18,15,0.72); backdrop-filter:blur(4px);
  border:none; color:var(--ink); font-size:15px;
  display:flex; align-items:center; justify-content:center; cursor:pointer;
}
/* Picture-disc vinyl: the record's own image is the disc. The disc (picture, grooves,
   label) spins while the audio plays; the gloss stays put, like light on a real record. */
.sleeve-audio-plate{
  position:relative;
  width:100%; height:100%;
}
.vinyl{
  --size: 76%; /* leaves room on the right for the tonearm */
  --label-size: 25%;
  --hole-size: 4px;
  --spin-duration: 2s;

  position:absolute; left:6%; top:14%;
  width:var(--size); aspect-ratio:1/1;
  border-radius:50%;
  box-shadow: 0 4px 20px rgba(0,0,0,.5);
}
.vinyl .disc{
  position:absolute; inset:0;
  border-radius:50%; overflow:hidden;
  background:#1a1a1a center / cover no-repeat; /* the cover image is set inline */
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.1);
  animation: vinyl-spin var(--spin-duration) linear infinite;
  animation-play-state: paused; /* pausing keeps the angle, so it doesn't snap back */
}
.vinyl .disc.spinning{ animation-play-state: running; }
@keyframes vinyl-spin{ to{ transform:rotate(360deg); } }
/* If the person's system asks for less motion, spin much more slowly instead of not at all. */
@media (prefers-reduced-motion: reduce){ .vinyl{ --spin-duration: 12s; } }

/* Vinyl grooves: fine dark and light hairlines, plus a lead-in band by the label, a
   dark outer rim, and a few darker rings like the gaps between tracks. */
.vinyl .disc::before{
  content:""; position:absolute; inset:0; border-radius:50%;
  background:
    radial-gradient(circle closest-side at center,
      transparent 0 25%, rgba(0,0,0,.5) 25% 29%, transparent 29% 44%,
      rgba(0,0,0,.45) 44% 44.8%, transparent 44.8% 62%,
      rgba(0,0,0,.45) 62% 62.8%, transparent 62.8% 80%,
      rgba(0,0,0,.45) 80% 80.8%, transparent 80.8% 95%,
      rgba(0,0,0,.5) 95% 100%),
    repeating-radial-gradient(circle at center,
      rgba(0,0,0,.30) 0px, rgba(0,0,0,.30) 1px,
      rgba(255,255,255,.07) 1px, rgba(255,255,255,.07) 2px,
      transparent 2px, transparent 3px);
  pointer-events:none;
}
/* Light reflection. This sits on the part that does NOT spin, so the highlights stay
   put while the record turns underneath them, which is what makes it read as vinyl. */
.vinyl::after{
  content:""; position:absolute; inset:0; border-radius:50%;
  background:
    conic-gradient(from 20deg at 50% 50%,
      transparent 0deg, rgba(255,255,255,.16) 28deg, transparent 62deg,
      transparent 180deg, rgba(255,255,255,.16) 208deg, transparent 242deg, transparent 360deg),
    radial-gradient(ellipse at 35% 35%, rgba(255,255,255,.15) 0%, transparent 60%);
  pointer-events:none;
}
/* Tonearm: pivots at the top right and swings onto the record while it plays. */
.tonearm{
  position:absolute; inset:0; width:100%; height:100%;
  overflow:visible; pointer-events:none;
  filter: drop-shadow(1.4px 2.4px 2.2px rgba(0,0,0,.55));
}
.tonearm .arm{
  transform-origin: 0 0; /* the pivot */
  transition: transform 0.6s cubic-bezier(.45,.05,.25,1);
}
@media (prefers-reduced-motion: reduce){ .tonearm .arm{ transition-duration:.01s; } }
/* The arm can be picked up and dragged along the record to seek (see the sleeve script). */
.tonearm .arm-hit{ pointer-events:all; cursor:grab; touch-action:none; }
.tonearm.dragging .arm{ transition:none; }
.tonearm.dragging .arm-hit{ cursor:grabbing; }
/* Dragging the record itself scratches it. */
.vinyl .disc{ cursor:grab; touch-action:none; -webkit-user-select:none; user-select:none; -webkit-touch-callout:none; -webkit-tap-highlight-color:transparent; }
.vinyl .disc.scratching{ cursor:grabbing; }

/* Centre label */
.vinyl .label{
  position:absolute; top:50%; left:50%;
  transform:translate(-50%, -50%);
  width:var(--label-size); height:var(--label-size);
  border-radius:50%;
  background:#1a1a1a;
  display:flex; align-items:center; justify-content:center;
  box-shadow: inset 0 0 8px rgba(0,0,0,.6);
}
/* Spindle hole */
.vinyl .label::after{
  content:""; width:var(--hole-size); height:var(--hole-size);
  border-radius:50%; background:#fff;
  box-shadow: inset 0 1px 2px rgba(0,0,0,.4);
}

.sleeve-body{ padding:18px 20px 28px; }
.sleeve-body.no-media{ position:relative; padding-top:56px; }
.sleeve-body.no-media .type-tag{ top:16px; left:20px; border:1px solid var(--line); }
.sleeve-title{ font-family:var(--serif); font-size:21px; line-height:1.3; margin:0 0 6px; }
.title-link, .user-link{ color:inherit; text-decoration:none; }
.title-link:hover .title-text{ text-decoration:underline; text-decoration-color:rgba(237,230,214,0.45); text-underline-offset:4px; }
.heart-link{ float:right; display:block; color:inherit; text-decoration:none; cursor:pointer; }
.heart-link .heart{ float:none; transition:filter .15s ease, transform .15s ease; }
.heart-link:hover .heart{ filter:brightness(1.2); }
.user-link{ display:flex; align-items:center; gap:9px; min-width:0; }
.user-link:hover .sleeve-user b{ text-decoration:underline; text-underline-offset:3px; }
.user-link:hover .avatar{ box-shadow:0 0 0 2px rgba(237,230,214,0.4); }
.user-link.current{ cursor:default; }
.user-link.current:hover .sleeve-user b{ text-decoration:none; }
.user-link.current:hover .avatar{ box-shadow:none; }
.title-link:focus-visible, .user-link:focus-visible{ outline:2px solid var(--audio); outline-offset:3px; border-radius:6px; }
.sleeve-meta-row{ display:flex; align-items:center; gap:9px; margin-bottom:5px; }
.avatar{ width:24px; height:24px; border-radius:50%; flex:none; background:#333; }
.sleeve-user{ font-size:13px; color:var(--muted); }
.sleeve-user b{ color:var(--ink); font-weight:600; }
.sleeve-date{ font-size:12px; color:var(--muted); white-space:nowrap; }
/* ---------- Genres & sounds ---------- */
.genres-panel{
  position:fixed; z-index:30; width:min(440px, calc(100vw - 16px)); max-height:min(72vh, 640px);
  display:flex; flex-direction:column; border-radius:14px; overflow:hidden;
  background:rgba(20,18,15,0.98); border:1px solid var(--line); box-shadow:0 16px 40px rgba(0,0,0,.55);
  font-size:13px; color:var(--ink);
}
.genres-panel[hidden]{ display:none; }
.gp-head{ display:flex; align-items:center; gap:10px; padding:12px 12px 8px 16px; }
.gp-head h2{ margin:0; font:600 17px/1.2 var(--serif); flex:1; }
.gp-head .close-btn{ position:static; flex:none; }
.gp-new{ flex:none; font-size:12.5px; color:var(--ink); text-decoration:none; padding:5px 10px; border-radius:14px; border:1px solid rgba(224,87,58,0.5); }
.gp-new:hover{ background:rgba(224,87,58,0.14); }
@media (min-width:641px){ .gp-new{ display:none; } } /* (computers have the New button in the top bar) */
@media (max-width:640px){ #new-toggle{ display:none !important; } } /* (phones: it's in the Genres panel) */
.gp-voice{ display:flex; gap:4px; margin:0 12px 8px; padding:3px; border-radius:18px; background:rgba(237,230,214,0.05); border:1px solid var(--line); flex:none; }
.gp-voice button{
  all:unset; flex:1; text-align:center; cursor:pointer; height:28px; line-height:28px; border-radius:14px;
  font-size:12.5px; color:var(--muted);
}
.gp-voice button:hover{ color:var(--ink); }
.gp-voice button.on{ background:rgba(224,87,58,0.2); color:var(--ink); box-shadow:inset 0 0 0 1px rgba(224,87,58,0.6); }
.gp-voice button:focus-visible{ outline:2px solid rgba(237,230,214,0.5); outline-offset:1px; }
.gp-filter{
  margin:0 12px 8px; height:32px; padding:0 12px; border-radius:16px; border:1px solid var(--line); flex:none;
  background:var(--panel); color:var(--ink); font:inherit; font-size:14px; outline:none;
}
.gp-filter:focus{ border-color:rgba(237,230,214,0.5); }
.gp-body{ overflow-y:auto; overscroll-behavior:contain; padding:0 12px 14px; }
.gp-sec{ font-size:10.5px; letter-spacing:.06em; text-transform:uppercase; color:var(--muted); margin:12px 4px 6px; }
.gp-chips{ display:flex; flex-wrap:wrap; gap:6px; }
.tag-chip{
  display:inline-flex; align-items:center; gap:6px; height:28px; padding:0 11px; border-radius:14px;
  border:1px solid var(--line); background:rgba(237,230,214,0.04); color:var(--ink); text-decoration:none;
  font-size:12.5px; white-space:nowrap; cursor:pointer;
}
.tag-chip:hover{ border-color:rgba(237,230,214,0.45); background:rgba(237,230,214,0.08); }
.tag-chip.on{ border-color:#E0573A; background:rgba(224,87,58,0.16); }
.tag-chip .n{ color:var(--muted); font-size:11px; font-variant-numeric:tabular-nums; }
.gp-genre{ border-bottom:1px solid rgba(237,230,214,0.06); }
.gp-genre-row{ display:flex; align-items:center; gap:8px; padding:8px 4px; }
.gp-genre-row a{ flex:1; min-width:0; color:var(--ink); text-decoration:none; font-weight:600; font-size:14px; }
.gp-genre-row a:hover{ text-decoration:underline; }
.gp-genre-row a.on{ color:#E0573A; }
.gp-genre-row .n{ color:var(--muted); font-size:11.5px; font-variant-numeric:tabular-nums; }
.gp-more{
  all:unset; cursor:pointer; width:26px; height:26px; border-radius:13px; display:inline-flex; align-items:center; justify-content:center;
  color:var(--muted); transition:transform .2s ease;
}
.gp-more:hover{ color:var(--ink); background:rgba(237,230,214,0.08); }
.gp-genre.open .gp-more{ transform:rotate(180deg); }
.gp-subs{ display:none; padding:0 4px 10px; }
.gp-genre.open .gp-subs{ display:flex; }
.gp-note{ color:var(--muted); padding:16px 4px; }
.layout-toggle.on, #new-toggle[aria-current="page"]{ border-color:rgba(224,87,58,0.6); }
/* chips in the record sleeve */
.sleeve-tags{ display:flex; flex-wrap:wrap; gap:6px; margin:2px 0 14px; }
.sleeve-tags .tag-chip{ height:24px; padding:0 9px; font-size:11.5px; }
.sleeve-tags .tag-chip.g{ border-color:rgba(224,87,58,0.45); }
/* the record's own tags (people's words), and the records that share them */
.sleeve-sec{ display:flex; align-items:baseline; gap:10px; font-size:10.5px; letter-spacing:.06em; text-transform:uppercase; color:var(--muted); margin:0 0 7px; }
.sleeve-sec a{ margin-left:auto; text-transform:none; letter-spacing:0; font-size:12px; color:var(--ink); opacity:.8; text-decoration:none; }
.sleeve-sec a:hover{ opacity:1; text-decoration:underline; }
.sleeve-hashtags{ margin:0 0 16px; }
.sleeve-hashtags .sleeve-tags{ margin:0; }
.tag-chip.h{ color:#D9D2C4; }
.tag-chip.h.shared{ border-color:rgba(237,230,214,0.55); color:var(--ink); background:rgba(237,230,214,0.1); }
.sleeve-hashtags:not(.all) .tag-chip.extra{ display:none; }
.tags-more{ all:unset; cursor:pointer; height:24px; padding:0 9px; border-radius:12px; font-size:11.5px; color:var(--muted); }
.tags-more:hover{ color:var(--ink); background:rgba(237,230,214,0.08); }
.kindred{ margin:0 0 18px; }
.kindred-row{ display:flex; gap:10px; overflow-x:auto; overscroll-behavior-x:contain; scrollbar-width:thin; padding:0 0 6px; }
.kindred-card{ flex:none; width:104px; color:var(--ink); text-decoration:none; font-size:11.5px; line-height:1.3; }
.kindred-card .kc-pic{ display:block; width:104px; height:104px; border-radius:8px; object-fit:cover; background:rgba(237,230,214,0.06); border-bottom:3px solid var(--kc, transparent); box-sizing:border-box; }
.kindred-card .kc-t{ display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; margin-top:5px; font-weight:600; }
.kindred-card .kc-u, .kindred-card .kc-s{ display:block; color:var(--muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.kindred-card:hover .kc-t{ text-decoration:underline; }
.kindred-card.wait .kc-pic{ animation:kc-wait 1.2s ease-in-out infinite alternate; }
@keyframes kc-wait{ from{ opacity:.35; } to{ opacity:.8; } }
.kindred-note{ color:var(--muted); font-size:12.5px; }
@media (max-width:640px){
  .genres-panel{ left:8px !important; right:8px; width:auto; max-height:calc(100dvh - var(--topbar-h, 56px) - 16px); }
  .tag-chip{ height:32px; font-size:13.5px; }
}
.gone-note{
  margin:14px 56px 0 16px; padding:10px 12px; border-radius:10px; font-size:13px; line-height:1.45; /* (clear of the close button) */
  background:rgba(193,87,63,0.16); border:1px solid rgba(193,87,63,0.45); color:var(--ink);
}
.gone-note b{ display:block; font-weight:600; margin-bottom:2px; }
/* A record that's gone from HitRecord: the sleeve shows only the note (no picture, player, text or comments). */
.sleeve.gone .sleeve-scroll > :not(.gone-note){ display:none !important; }
.sleeve.gone .mini-play{ display:none; }
.sleeve.gone .gone-note{ margin-top:22px; }
.sleeve-desc{ font-size:13.5px; line-height:1.6; color:#D9D2C4; margin:0 0 16px; white-space:pre-line; } /* (keeps the description's line breaks) */
.sleeve-desc.clamp{
  display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:4; line-clamp:4; overflow:hidden;
}
.desc-more{
  display:block; background:none; border:0; padding:2px 0; margin:-10px 0 16px; cursor:pointer;
  font:inherit; font-size:12.5px; color:var(--audio);
}
.desc-more[hidden]{ display:none; }
.desc-more:hover{ text-decoration:underline; }
.desc-more:focus-visible{ outline:2px solid var(--audio); outline-offset:2px; border-radius:3px; }
.sleeve-stats{
  display:flex; align-items:center; gap:14px; flex-wrap:wrap; row-gap:4px;
  border-bottom:1px solid var(--line);
  font-size:12.5px; color:var(--muted);
  margin-bottom: 5px;
  padding-bottom: 5px;
}
.heart{ color:#C1573F; }
.lineage-note{ font-size:12px; color:var(--muted); white-space:nowrap; }
.share-btn{
  all:unset; box-sizing:border-box; cursor:pointer; margin-left:auto; display:inline-flex; align-items:center; gap:5px;
  height:24px; padding:0 8px; border-radius:12px; font-size:12px; color:var(--muted);
}
.share-btn:hover{ color:var(--ink); background:rgba(237,230,214,0.08); }
.share-btn:focus-visible{ outline:2px solid var(--audio); outline-offset:1px; }
/* Mini player: the sheet pulled down to a strip (phones). Tap it to open the sheet again. */
.mini{
  display:none; align-items:center; gap:10px; position:absolute; left:0; right:0; top:18px; bottom:0;
  padding:0 10px 0 12px; cursor:pointer; touch-action:pan-y;
}
.mini-cover{ width:44px; height:44px; border-radius:6px; object-fit:cover; flex:none; background:#2a261f; }
.mini-text{ flex:1; min-width:0; line-height:1.25; }
.mini-title{ font-weight:600; font-size:14px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.mini-user{ font-size:12px; color:var(--muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.mini button{
  all:unset; box-sizing:border-box; cursor:pointer; width:44px; height:44px; border-radius:22px; flex:none;
  display:inline-flex; align-items:center; justify-content:center; color:var(--ink);
}
.mini button:active{ background:rgba(237,230,214,0.1); }
.mini .mini-play{ background:var(--ink); color:var(--bg); width:40px; height:40px; }
/* Still playing: the audio / video record that keeps playing while a picture or text record is open */
.np-dock{
  flex:none; position:relative; display:flex; align-items:center; gap:8px; padding:10px 10px 10px 12px;
  border-top:1px solid var(--line); background:rgba(18,16,13,0.94);
}
.np-bar{ position:absolute; left:0; right:0; top:-1px; height:2px; background:rgba(237,230,214,0.08); pointer-events:none; }
.np-bar i{ display:block; height:100%; width:0; background:#E0573A; }
.np-cover{ width:42px; height:42px; border-radius:6px; object-fit:cover; flex:none; background:#2a261f; }
.np-text{ all:unset; cursor:pointer; flex:1; min-width:0; line-height:1.25; }
.np-title{ display:block; font-weight:600; font-size:13.5px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.np-user{ display:block; font-size:12px; color:var(--muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.np-text:hover .np-title{ text-decoration:underline; }
.np-dock .np-btn{
  all:unset; box-sizing:border-box; cursor:pointer; width:38px; height:38px; border-radius:19px; flex:none;
  display:inline-flex; align-items:center; justify-content:center; color:var(--ink);
}
.np-dock .np-btn:hover{ background:rgba(237,230,214,0.1); }
.np-dock .np-play{ background:var(--ink); color:var(--bg); }
.np-dock .np-play:hover{ background:#fff; }
.np-dock .np-stop{ color:var(--muted); width:32px; }
.lineage-rel{
  all:unset; box-sizing:border-box; cursor:pointer; color:var(--muted);
  border-bottom:1px dotted rgba(237,230,214,0.35); transition:color .15s ease, border-color .15s ease;
}
.lineage-rel:hover, .lineage-rel:focus-visible{ color:var(--ink); border-bottom-color:var(--ink); }
.lineage-rel.on{ color:var(--ink); border-bottom:1px solid var(--ink); }
.record-link{
  display:inline-flex; align-items:center; margin-top:18px;
  padding:8px 14px; border-radius:999px;
  border:1px solid var(--line); background:transparent;
  color:var(--ink); font-size:12.5px; text-decoration:none;
  transition:border-color .15s ease, background .15s ease;
}
.record-link:hover{ border-color:rgba(237,230,214,0.4); background:rgba(237,230,214,0.06); }
.resources-link{ margin-left:0; }
.record-link{ vertical-align:top; margin-right:8px; }

/* ---------- Comments ---------- */
.cm{
  margin:26px -6px 0; padding:16px 12px 14px; border-radius:18px;
  background:rgba(20,18,15,0.93); border:1px solid var(--line); /* a calmer surface over the see-through sleeve */
}
.cm-head-row{ display:flex; align-items:baseline; gap:10px; margin-bottom:14px; }
.cm-title{ font-family:var(--serif); font-size:18px; font-weight:600; margin:0; letter-spacing:.01em; }
.cm-count{
  font-size:11.5px; color:var(--muted); padding:2px 8px; border-radius:999px;
  border:1px solid var(--line); font-variant-numeric:tabular-nums;
}
.cm-sort{ font-size:11px; color:var(--muted); letter-spacing:.08em; text-transform:uppercase; }
.cm-list{ display:flex; flex-direction:column; gap:10px; }

.cm-item{
  display:grid; grid-template-columns:34px 1fr; column-gap:11px;
  padding:12px 14px 12px 12px; border-radius:14px;
  background:rgba(237,230,214,0.045); border:1px solid var(--line);
}
.cm-item.cm-featured{
  border-color:rgba(228,162,58,0.38);
  background:linear-gradient(135deg, rgba(228,162,58,0.10), rgba(228,162,58,0.02) 60%);
}
.cm-avatar{
  width:34px; height:34px; border-radius:50%; overflow:hidden; flex:none;
  display:flex; align-items:center; justify-content:center;
  font-family:var(--serif); font-size:15px; font-weight:600; color:#14120F;
  box-shadow:0 0 0 1.5px rgba(237,230,214,0.16);
}
.cm-avatar img{ width:100%; height:100%; object-fit:cover; display:block; }
.cm-main{ min-width:0; }
.cm-meta{ display:flex; flex-wrap:wrap; align-items:center; gap:2px 7px; line-height:1.35; }
.cm-user{ font-size:13px; font-weight:600; color:var(--ink); }
.cm-role{ font-size:11px; font-style:italic; color:var(--muted); }
.cm-time{ font-size:11.5px; color:var(--muted); }
.cm-when, .cm-user-link, .cm-avatar-link{ color:inherit; text-decoration:none; }
.cm-avatar-link{ display:block; flex:none; align-self:flex-start; }
.cm-user-link:hover .cm-user{ text-decoration:underline; }
.cm-clickable{ cursor:pointer; }
.cm-clickable:hover{ background:rgba(237,230,214,0.04); }
.cm-clickable .cm-text{ cursor:inherit; }
.cm-when:hover .cm-time{ color:var(--ink); text-decoration:underline; }
.cm-badge{
  font-size:10px; letter-spacing:.08em; text-transform:uppercase; color:var(--audio);
  border:1px solid rgba(228,162,58,0.45); border-radius:999px; padding:1px 7px;
}
.cm-replying{ font-size:11.5px; color:var(--muted); margin-top:2px; }
.cm-text{
  margin-top:6px; font-size:13.5px; line-height:1.6; color:#D9D2C4;
  overflow-wrap:anywhere; -webkit-user-select:text; user-select:text; -webkit-touch-callout:default;
}
.cm-text p{ margin:0 0 .6em; }
.cm-text > :last-child{ margin-bottom:0; }
.cm-text a{ color:var(--audio); text-decoration:underline; text-decoration-color:rgba(228,162,58,.4); text-underline-offset:2px; }
.cm-text blockquote{ margin:.5em 0; padding-left:10px; border-left:2px solid var(--line); color:var(--muted); }
.cm-text ul, .cm-text ol{ margin:.4em 0; padding-left:1.3em; }
.cm-text code, .cm-text pre{ font-family:ui-monospace,Menlo,Consolas,monospace; font-size:12.5px; background:rgba(0,0,0,.3); border-radius:4px; }
.cm-text code{ padding:1px 4px; }
.cm-text pre{ padding:8px 10px; overflow-x:auto; }
.cm-text.clamp{
  max-height:9.6em; overflow:hidden;
  -webkit-mask-image:linear-gradient(#000 65%, transparent); mask-image:linear-gradient(#000 65%, transparent);
}
.cm-link-btn{
  background:none; border:0; padding:4px 0; margin:2px 0 0; cursor:pointer;
  font:inherit; font-size:12px; color:var(--audio);
}
.cm-link-btn:hover{ text-decoration:underline; }

.cm-replies{ margin-top:10px; display:flex; flex-direction:column; gap:10px; }
.cm-item.cm-reply{
  grid-template-columns:26px 1fr; column-gap:9px; padding:0 0 0 12px; background:none; border:0; border-radius:0;
  border-left:2px solid var(--line);
}
.cm-item.cm-reply .cm-avatar{ width:26px; height:26px; font-size:12px; }
.cm-item.cm-reply .cm-text{ font-size:13px; }

.cm-more-btn{
  align-self:center; margin-top:6px; padding:9px 18px; border-radius:999px; cursor:pointer;
  border:1px solid var(--line); background:transparent; color:var(--ink); font:inherit; font-size:12.5px;
  transition:border-color .15s ease, background .15s ease;
}
.cm-more-btn:hover:not(:disabled){ border-color:rgba(237,230,214,0.4); background:rgba(237,230,214,0.06); }
.cm-more-btn:disabled{ opacity:.6; cursor:default; }

.cm-empty, .cm-error{
  text-align:center; padding:22px 14px; border-radius:14px; border:1px dashed var(--line);
  color:var(--muted); font-size:13px; line-height:1.6;
}
.cm-empty a{ color:inherit; text-decoration:underline; text-decoration-color:rgba(237,230,214,0.4); text-underline-offset:2px; }
.cm-empty a:hover{ color:var(--ink); text-decoration-color:var(--ink); }
.cm-empty q{ display:block; font-family:var(--serif); font-size:15px; font-style:italic; color:var(--ink); margin-bottom:2px; quotes:"“" "”"; }
.cm-error .cm-link-btn{ margin:0 6px; }

.cm-skel{ display:grid; grid-template-columns:34px 1fr; gap:11px; padding:12px; border-radius:14px; border:1px solid var(--line); }
.cm-skel i{ display:block; border-radius:6px; background:rgba(237,230,214,0.07); }
.cm-skel .dot{ width:34px; height:34px; border-radius:50%; }
.cm-skel .l{ height:10px; margin:6px 0 9px; }
.cm-skel .l:nth-child(2){ width:92%; } .cm-skel .l:nth-child(3){ width:64%; }
.cm-skel .l:first-child{ width:38%; }
.cm-skel .dot, .cm-skel .l{ animation:cm-shimmer 1.3s ease-in-out infinite; }
@keyframes cm-shimmer{ 50%{ opacity:.45; } }

@keyframes cm-in{ from{ opacity:0; transform:translateY(8px); } }
.cm-item.cm-new{ animation:cm-in .45s cubic-bezier(.2,.7,.3,1) both; animation-delay:calc(var(--i, 0) * 45ms); }
@media (prefers-reduced-motion: reduce){ .cm-item.cm-new, .cm-skel .dot, .cm-skel .l{ animation:none; } }
@media (max-width:640px){ .cm-item{ padding:11px 12px 11px 11px; } .cm-more-btn{ padding:11px 20px; } }

/* ---------- Full-screen image viewer ---------- */
.sleeve-media img.zoomable{ cursor:zoom-in; }
.img-expand{
  position:absolute; right:12px; bottom:12px; width:38px; height:38px; border-radius:50%;
  display:flex; align-items:center; justify-content:center; padding:0; cursor:pointer;
  border:1px solid rgba(237,230,214,0.25); background:rgba(20,18,15,0.62); color:var(--ink);
  backdrop-filter:blur(6px); -webkit-backdrop-filter:blur(6px);
  transition:background .15s ease, transform .15s ease;
}
.img-expand:hover{ background:rgba(20,18,15,0.85); transform:scale(1.06); }
.img-expand svg, .lb .lb-btns button svg, .lb a.lb-btn svg{ width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
.img-hd{
  position:absolute; left:0; right:0; bottom:0; height:2px; overflow:hidden; background:rgba(237,230,214,0.08);
}
.img-hd::after{ content:""; position:absolute; inset:0 auto 0 -40%; width:40%; background:var(--image); animation:img-hd 1.1s ease-in-out infinite; }
@keyframes img-hd{ to{ left:100%; } }

.lb{
  position:fixed; inset:0; z-index:200; display:flex; flex-direction:column;
  background:#080706; color:var(--ink); font-family:var(--sans);
  opacity:0; transition:opacity .22s ease; -webkit-user-select:none; user-select:none;
}
.lb[hidden]{ display:none; }
.lb.open{ opacity:1; }
.lb-stage{ position:absolute; inset:0; overflow:hidden; touch-action:none; cursor:grab; }
.lb-stage.grabbing{ cursor:grabbing; }
.lb-stage.zoomed{ cursor:grab; }
.lb-img{
  position:absolute; left:0; top:0; transform-origin:0 0; max-width:none; user-select:none; -webkit-user-drag:none;
  box-shadow:0 10px 60px rgba(0,0,0,.6); will-change:transform;
}
.lb-img.anim{ transition:transform .24s cubic-bezier(.2,.8,.2,1); }
.lb-top{
  position:absolute; left:0; right:0; top:0; z-index:2; display:flex; align-items:center; gap:12px;
  padding:calc(12px + env(safe-area-inset-top)) calc(14px + env(safe-area-inset-right)) 28px calc(16px + env(safe-area-inset-left));
  background:linear-gradient(rgba(8,7,6,0.85), transparent);
  transition:opacity .3s ease, transform .3s ease;
}
.lb-cap{ min-width:0; flex:1; }
.lb-title{ display:block; font-family:var(--serif); font-size:17px; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.lb-by{ display:block; font-size:12px; color:var(--muted); margin-top:1px; }
.lb-btns{ display:flex; gap:8px; flex:none; }
.lb .lb-btns button, .lb a.lb-btn{
  width:40px; height:40px; border-radius:50%; padding:0; cursor:pointer; text-decoration:none;
  display:inline-flex; align-items:center; justify-content:center;
  border:1px solid rgba(237,230,214,0.22); background:rgba(28,25,21,0.7); color:var(--ink);
  font:inherit; font-size:20px; line-height:1;
  transition:background .15s ease, border-color .15s ease;
}
.lb .lb-btns button:hover, .lb a.lb-btn:hover{ background:rgba(237,230,214,0.14); border-color:rgba(237,230,214,0.45); }
.lb .lb-btns button:focus-visible, .lb a.lb-btn:focus-visible{ outline:2px solid var(--audio); outline-offset:2px; }
.lb-bottom{
  position:absolute; left:0; right:0; bottom:0; z-index:2; display:flex; justify-content:center;
  padding:28px 16px calc(14px + env(safe-area-inset-bottom)); pointer-events:none;
  background:linear-gradient(transparent, rgba(8,7,6,0.7));
  transition:opacity .3s ease, transform .3s ease;
}
.lb-note{
  font-size:12px; color:var(--muted); padding:6px 12px; border-radius:999px;
  background:rgba(28,25,21,0.7); border:1px solid var(--line);
}
.lb-note.busy::before{
  content:""; display:inline-block; width:10px; height:10px; margin-right:8px; vertical-align:-1px;
  border:2px solid rgba(237,230,214,0.25); border-top-color:var(--ink); border-radius:50%; animation:lb-spin .8s linear infinite;
}
@keyframes lb-spin{ to{ transform:rotate(360deg); } }
/* Swipe up (or the ⓘ button / I key): the record's description and comments slide up over the image. */
.lb-info{
  position:absolute; z-index:3; left:50%; bottom:0; width:min(640px, 100%); max-height:72%;
  transform:translate(-50%, 104%); transition:transform .3s cubic-bezier(.2,.8,.2,1);
  display:flex; flex-direction:column; border-radius:16px 16px 0 0;
  /* See-through, with the photo blurred and dimmed behind the text: the picture stays visible, the text readable. */
  background:rgba(14,12,10,0.58); border:1px solid rgba(237,230,214,0.12); border-bottom:0; box-shadow:0 -14px 40px rgba(0,0,0,.35);
  -webkit-backdrop-filter:blur(16px) saturate(1.2) brightness(0.8); backdrop-filter:blur(16px) saturate(1.2) brightness(0.8);
  -webkit-user-select:text; user-select:text;
}
.lb-info-scroll{ text-shadow:0 1px 2px rgba(0,0,0,.55); } /* (an extra edge for text over bright parts of a photo) */
.lb-info .cm{ background:rgba(20,18,15,0.35); border-color:rgba(237,230,214,0.10); }
.lb-info .cm-item{ background:rgba(20,18,15,0.30); }
.lb-info .lb-info-desc{ color:#E6DFD1; }
/* Browsers without blur: a darker panel instead, so the text still reads. */
@supports not ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))){
  .lb-info{ background:rgba(14,12,10,0.86); }
}
.lb.info-open .lb-info{ transform:translate(-50%, 0); }
.lb.info-open .lb-bottom{ opacity:0; }
.lb-info-grab{ flex:none; height:22px; display:flex; align-items:center; justify-content:center; cursor:pointer; touch-action:none; }
.lb-info-grab::before{ content:""; width:40px; height:4px; border-radius:2px; background:rgba(237,230,214,0.3); }
.lb-info-scroll{ overflow-y:auto; overscroll-behavior:contain; padding:2px 18px calc(18px + env(safe-area-inset-bottom)); }
.lb-info-head{ display:flex; align-items:flex-start; gap:12px; margin-bottom:10px; }
.lb-info-head h2{ margin:0; font:600 19px/1.3 var(--serif); flex:1; min-width:0; }
.lb-info-hearts{ flex:none; font-size:13px; color:var(--muted); padding-top:3px; white-space:nowrap; }
.lb-info-hearts b{ color:#E0573A; font-weight:600; }
.lb-info-by{ font-size:12.5px; color:var(--muted); margin:-4px 0 12px; }
.lb-info-by a{ color:var(--ink); text-decoration:none; }
.lb-info-by a:hover{ text-decoration:underline; }
.lb-info-lineage{ margin:-2px 0 14px; font-size:13px; }
.lb-info-lineage .lineage-note{ font-size:13px; }
.lb-info-desc{ font-size:14px; line-height:1.6; color:#D9D2C4; white-space:pre-wrap; margin:0 0 18px; overflow-wrap:anywhere; }
.lb-info-desc:empty{ display:none; }
@media (prefers-reduced-motion: reduce){ .lb-info{ transition:none; } }
.lb.idle .lb-top{ opacity:0; transform:translateY(-8px); pointer-events:none; }
.lb.idle .lb-bottom{ opacity:0; transform:translateY(8px); }
.lb.idle .lb-stage{ cursor:none; }
.lb-zoomread{ font-size:12px; color:var(--muted); font-variant-numeric:tabular-nums; align-self:center; min-width:42px; text-align:right; }
@media (prefers-reduced-motion: reduce){ .lb, .lb-img.anim, .lb-top, .lb-bottom{ transition:none; } .img-hd::after{ animation:none; } }
@media (max-width:640px){ .lb-title{ font-size:15px; } .lb-btns{ gap:6px; } .lb .lb-btns button, .lb a.lb-btn{ width:38px; height:38px; } .lb-zoomread{ display:none; } .lb-btn.lb-zoombtn{ display:none !important; } }

.toast{
  position:absolute; left:50%; bottom:78px; transform:translateX(-50%);
  max-width:86vw; padding:8px 14px; border-radius:999px; text-align:center;
  background:rgba(28,25,21,0.94); border:1px solid var(--line);
  color:var(--ink); font-size:12.5px; z-index:14; /* (above the list panel) */
  opacity:0; pointer-events:none; transition:opacity .2s ease;
}
.toast.show{ opacity:1; }
/* The People map (?people=) */
#people-view{ position:absolute; inset:0; background:var(--bg); }
#people-view canvas{ display:block; touch-action:none; cursor:grab; }
#app.people-mode #graph-container, #app.people-mode .pills, #app.people-mode #view-toggle, #app.people-mode #list-toggle,
#app.people-mode #groups-toggle, #app.people-mode #spread-wrap, #app.people-mode .counts, #app.people-mode #filter-btn,
#app.people-mode .timeline, #app.people-mode .listpanel, #app.people-mode .hint{ display:none !important; }
#app.people-mode .sleeve{ bottom:0; }
.pc-rel{ margin:0 0 16px; color:var(--ink); }
.people-bar{ transition:opacity .8s ease; }
.new-bar{ transition:opacity .8s ease; }
.new-bar.fade-away{ opacity:0; pointer-events:none; }
.new-bar{ flex-direction:column; align-items:stretch; border-radius:18px; padding:6px 6px 6px 14px; white-space:normal; }
.new-bar .nb-line{ display:flex; align-items:center; gap:4px; flex-wrap:wrap; }
.new-bar .rb-ico{ color:#F0A08A; }
.new-bar .pb-link{ all:unset; cursor:pointer; height:26px; padding:0 9px; border-radius:13px; display:inline-flex; align-items:center; font-size:12px; color:var(--ink); }
.new-bar .pb-link:hover{ background:rgba(237,230,214,0.1); }
.new-bar .pb-link.on{ background:rgba(237,230,214,0.14); font-weight:600; }
.new-bar .rb-x{ all:unset; cursor:pointer; width:28px; height:28px; display:inline-flex; align-items:center; justify-content:center; border-radius:14px; color:var(--muted); margin-left:auto; }
.new-bar .rb-x:hover{ background:rgba(237,230,214,0.1); }
.new-bar .nb-note{ color:var(--muted); font-size:12px; padding:0 0 4px; }
.new-bar .nb-who{ display:flex; flex-wrap:wrap; gap:2px 10px; font-size:12px; padding:2px 8px 4px 0; }
.new-bar .nb-who .nb-lab{ color:var(--muted); }
.new-bar .nb-who a{ color:var(--ink); text-decoration:none; }
.new-bar .nb-who a:hover{ text-decoration:underline; }
@media (max-width:640px){ .new-bar .nb-who{ display:none; } }
.people-bar.fade-away{ opacity:0; pointer-events:none; }
.people-bar .pb-link{ all:unset; cursor:pointer; height:28px; padding:0 10px; border-radius:14px; display:inline-flex; align-items:center; font-size:12px; color:var(--ink); }
.people-bar .pb-link:hover{ background:rgba(237,230,214,0.1); }
.person-card{ padding-top:22px; }
.pc-head{ display:flex; align-items:center; gap:14px; margin:0 0 12px; }
.pc-head .sleeve-title{ margin:0 0 4px; }
.pc-av{ border-radius:50%; object-fit:cover; flex:none; background:#2A251E; display:inline-flex; align-items:center; justify-content:center; color:var(--muted); font-weight:600; }
.pc-sub{ font-size:12.5px; color:var(--muted); }
.pc-center{ text-align:center; margin:0 0 14px; line-height:1.5; }
.pc-acts{ display:flex; flex-wrap:wrap; gap:6px; margin:0 0 16px; }
.pc-btn{ all:unset; box-sizing:border-box; cursor:pointer; height:28px; padding:0 11px; border-radius:14px; border:1px solid var(--line);
  display:inline-flex; align-items:center; font-size:12px; color:var(--ink); }
.pc-btn:hover{ background:rgba(237,230,214,0.08); }
.pc-btn:disabled{ opacity:.6; cursor:default; }
.pc-with{ all:unset; box-sizing:border-box; cursor:pointer; display:block; width:100%; padding:9px 12px; margin:0 0 16px; border-radius:10px;
  background:rgba(228,162,58,0.1); border:1px solid rgba(228,162,58,0.35); color:var(--ink); font-size:12.5px; }
.pc-with:hover{ background:rgba(228,162,58,0.18); }
.pc-list{ display:flex; flex-direction:column; gap:2px; margin:0 0 16px; }
.pc-row{ all:unset; box-sizing:border-box; cursor:pointer; display:flex; align-items:center; gap:10px; padding:5px 8px; border-radius:8px; font-size:13px; }
.pc-row:hover{ background:rgba(237,230,214,0.07); }
.pc-row .pc-name{ flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-weight:600; }
.pc-row .pc-ct{ color:var(--muted); font-size:12px; white-space:nowrap; }
.pc-note{ color:var(--muted); font-size:12.5px; }
.pc-pair{ display:flex; align-items:flex-start; justify-content:center; gap:16px; margin:4px 0 10px; }
.pc-who{ all:unset; cursor:pointer; display:flex; flex-direction:column; align-items:center; gap:6px; max-width:40%; font-weight:600; font-size:13px; text-align:center; overflow-wrap:anywhere; }
.pc-who:hover span{ text-decoration:underline; }
.pc-arrows{ color:var(--audio); font-size:22px; margin-top:10px; }
.pc-recs{ display:flex; flex-direction:column; gap:4px; margin:0 0 18px; }
.pc-rec{ display:flex; gap:10px; align-items:center; padding:6px; border-radius:8px; color:var(--ink); text-decoration:none; }
.pc-rec:hover{ background:rgba(237,230,214,0.07); }
.pc-rec .pr-pic{ width:44px; height:44px; border-radius:6px; object-fit:cover; flex:none; background:#2A251E; border-bottom:3px solid var(--kc, transparent); box-sizing:border-box; }
.pc-rec .pr-txt{ min-width:0; display:flex; flex-direction:column; gap:2px; }
.pc-rec .pr-title{ font-weight:600; font-size:13px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.pc-rec .pr-sub{ color:var(--muted); font-size:11.5px; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.people-link{ display:inline-flex; align-items:center; justify-content:center; width:26px; height:26px; border-radius:13px; color:var(--muted); flex:none; }
.people-link:hover{ color:var(--ink); background:rgba(237,230,214,0.08); }

/* Tag lens: a record tag lit up on the map */
.top-bars{
  position:fixed; left:50%; top:70px; transform:translateX(-50%); z-index:16;
  display:flex; flex-direction:column; align-items:center; gap:6px; pointer-events:none; max-width:calc(100vw - 16px);
}
.top-bars > *{ pointer-events:auto; }
.lens-bar, .radio-bar{
  display:flex; align-items:center; gap:4px; max-width:calc(100vw - 16px); padding:5px 5px 5px 12px;
  border-radius:999px; background:rgba(28,25,21,0.96); border:1px solid rgba(224,87,58,0.55);
  box-shadow:0 8px 24px rgba(0,0,0,.45); font-size:12.5px; color:var(--ink); white-space:nowrap;
}
.lens-bar[hidden], .radio-bar[hidden]{ display:none; }
.radio-bar{ border-color:rgba(228,162,58,0.6); }
.radio-bar .rb-ico{ color:var(--audio); display:inline-flex; margin-right:6px; }
.radio-bar .rb-name{ font-weight:600; }
.radio-bar .rb-pos{ color:var(--muted); margin:0 6px; font-variant-numeric:tabular-nums; }
.radio-bar .rb-now{ max-width:28vw; overflow:hidden; text-overflow:ellipsis; color:var(--ink); opacity:.85; margin-right:4px; }
.radio-bar button{ all:unset; box-sizing:border-box; cursor:pointer; height:28px; min-width:28px; padding:0 8px; border-radius:14px;
  display:inline-flex; align-items:center; justify-content:center; color:var(--ink); font-size:12px; }
.radio-bar button:hover{ background:rgba(237,230,214,0.1); }
.radio-bar .rb-x{ color:var(--muted); }
.radio-btn{
  all:unset; box-sizing:border-box; cursor:pointer; display:inline-flex; align-items:center; gap:5px;
  height:24px; padding:0 9px; border-radius:12px; font-size:12px; color:var(--audio); border:1px solid rgba(228,162,58,0.4);
}
.radio-btn:hover{ background:rgba(228,162,58,0.12); }
.radio-btn.on{ background:rgba(228,162,58,0.18); }
.radio-btn.busy{ opacity:.6; pointer-events:none; animation:kc-wait 0.9s ease-in-out infinite alternate; }
.stats-actions{ margin-left:auto; display:inline-flex; align-items:center; gap:4px; }
.stats-actions .share-btn{ margin-left:0; }
.lens-bar .lb-tag{ font-weight:600; color:#F0A08A; overflow:hidden; text-overflow:ellipsis; max-width:34vw; }
.lens-bar .lb-count{ color:var(--muted); margin:0 6px 0 2px; }
.lens-bar button, .lens-bar a{
  all:unset; box-sizing:border-box; cursor:pointer; height:28px; padding:0 10px; border-radius:14px;
  display:inline-flex; align-items:center; color:var(--ink); font-size:12px;
}
.lens-bar button:hover, .lens-bar a:hover{ background:rgba(237,230,214,0.1); }
.lens-bar .lb-x{ width:28px; padding:0; justify-content:center; color:var(--muted); }
.tag-chip.h.lensed{ border-color:#E0573A; background:rgba(224,87,58,0.16); color:var(--ink); }
tr.row.lens td:first-child{ box-shadow:inset 3px 0 0 #E0573A; }
#app.sleeve-open .top-bars{ left:calc((100% - var(--sleeve-w)) / 2); } /* (over the map, not the sleeve) */
@media (max-width:640px){
  .top-bars, #app.sleeve-open .top-bars{ left:50%; top:62px; }
  .lens-bar, .radio-bar{ font-size:12px; }
  .radio-bar .rb-now{ display:none; }
  .lens-bar .lb-count .long{ display:none; }
}
.hint{
  position:absolute; left:20px; bottom:70px;
  font-size:11.5px; color:var(--muted); z-index:4;
  pointer-events:none;
}

/* ---------- List view: its own panel, so the record sleeve can be open beside it ---------- */
.listpanel{
  position:absolute; z-index:6;
  top:calc(var(--topbar-h, 64px) + 4px); left:12px; bottom:calc(var(--timeline-h) + 8px);
  width:min(470px, 38vw);
  display:flex; flex-direction:column; overflow:hidden;
  background:rgba(20,18,15,0.9); backdrop-filter:blur(6px); -webkit-backdrop-filter:blur(6px);
  border:1px solid var(--line); border-radius:14px; box-shadow:0 12px 36px rgba(0,0,0,.45);
  transform:translateX(calc(-100% - 20px)); opacity:0; pointer-events:none;
  transition:transform .3s cubic-bezier(.2,.8,.2,1), opacity .2s ease;
}
.listpanel.open{ transform:none; opacity:1; pointer-events:auto; }
#app.list-open .hint{ opacity:0; }
.list-panel{ display:flex; flex-direction:column; height:100%; min-height:0; }
.list-head{ padding:12px 10px 8px 16px; display:flex; align-items:center; gap:10px; border-bottom:1px solid var(--line); }
.list-head .close-btn{ position:static; flex:none; }
.list-step{ margin-left:auto; display:flex; align-items:center; gap:4px; }
.list-step button{
  all:unset; box-sizing:border-box; cursor:pointer; height:28px; padding:0 10px; border-radius:14px;
  border:1px solid var(--line); color:var(--ink); font-size:12px; display:inline-flex; align-items:center; gap:4px;
}
.list-step button:hover{ border-color:rgba(237,230,214,0.45); background:rgba(237,230,214,0.06); }
.list-step button:disabled{ opacity:.35; cursor:default; }
.list-step button.list-pos{
  all:unset; box-sizing:border-box; cursor:pointer; font-size:11.5px; color:var(--muted); font-variant-numeric:tabular-nums;
  min-width:48px; text-align:right; text-decoration:underline dotted rgba(237,230,214,0.35); text-underline-offset:3px;
}
.list-step button.list-pos:hover{ color:var(--ink); text-decoration-color:currentColor; background:none; border:0; }
.list-step button.list-pos:empty{ display:none; }
.list-head h2{ margin:0; font:600 17px/1.2 var(--serif); }
.list-head .list-count{ font-size:12px; color:var(--muted); }
.list-scroll{ overflow:auto; flex:1; overscroll-behavior:contain; padding-bottom:12px; }
table.rl{ width:100%; border-collapse:collapse; font-size:12.5px; table-layout:fixed; }
table.rl th{
  position:sticky; top:0; z-index:1; text-align:left; font-weight:500; font-size:10.5px; letter-spacing:.06em; text-transform:uppercase;
  color:var(--muted); background:rgba(20,18,15,0.96); border-bottom:1px solid var(--line); padding:0;
}
table.rl th button{ all:unset; box-sizing:border-box; width:100%; padding:8px 6px; cursor:pointer; display:flex; align-items:center; gap:3px; white-space:nowrap; }
table.rl th button:hover, table.rl th[aria-sort] button{ color:var(--ink); }
table.rl th .arrow{ font-size:9px; opacity:.9; }
table.rl th.num button{ justify-content:flex-end; }
table.rl th:last-child button, table.rl td:last-child{ padding-right:16px; }
table.rl td{ padding:7px 6px; border-bottom:1px solid rgba(237,230,214,0.06); vertical-align:middle; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
table.rl td.num{ text-align:right; font-variant-numeric:tabular-nums; color:var(--muted); }
table.rl td.when{ color:var(--muted); font-size:11.5px; }
table.rl td.ttl{ font-weight:500; }
table.rl tr.row{ cursor:pointer; --c:#999; }
table.rl tr.row td:first-child{ box-shadow:inset 3px 0 0 var(--c); padding-left:12px; }
table.rl tr.row:hover td, table.rl tr.row:focus-visible td{ background:color-mix(in srgb, var(--c) 14%, transparent); outline:none; }
table.rl tr.row.sel td{ background:color-mix(in srgb, var(--c) 24%, transparent); }
/* the row the timeline is on (marked, not opened) */
table.rl tr.row.tl td{ background:color-mix(in srgb, var(--c) 16%, transparent); box-shadow:inset 0 1px 0 color-mix(in srgb, var(--c) 55%, transparent), inset 0 -1px 0 color-mix(in srgb, var(--c) 55%, transparent); }
table.rl tr.row.tl td:first-child{ box-shadow:inset 3px 0 0 var(--c), inset 0 1px 0 color-mix(in srgb, var(--c) 55%, transparent), inset 0 -1px 0 color-mix(in srgb, var(--c) 55%, transparent); }
table.rl .sw{ display:inline-block; width:8px; height:8px; border-radius:50%; background:var(--c); margin-right:7px; vertical-align:baseline; }
table.rl td.av{ padding-left:2px; padding-right:2px; text-align:center; }
/* avatar = a square record sleeve; cover = a round record peeking out over its right edge */
table.rl .sleeve-stack{ position:relative; display:inline-flex; align-items:center; vertical-align:middle; }
table.rl .sleeve-stack .who{ border-radius:0; width:24px; height:24px; } /* square, like a record jacket */
table.rl .disc-thumb{
  position:relative; margin-left:-9px; width:24px; height:24px; border-radius:50%; overflow:hidden; flex:none;
  background:#111; box-shadow:0 0 0 1.5px #14120f, -2px 0 4px rgba(0,0,0,.45);
}
table.rl .disc-thumb::after{ /* the spindle hole */
  content:""; position:absolute; left:50%; top:50%; width:4px; height:4px; margin:-2px 0 0 -2px;
  border-radius:50%; background:#14120f; box-shadow:0 0 0 1px rgba(237,230,214,.25);
}
table.rl .cover-thumb{ width:100%; height:100%; object-fit:cover; display:block; }
table.rl .who{
  display:inline-flex; align-items:center; justify-content:center; width:22px; height:22px; border-radius:50%;
  overflow:hidden; background:#3a352d; color:var(--ink); font-size:11px; font-weight:600; vertical-align:middle;
}
table.rl .who img{ width:100%; height:100%; object-fit:cover; display:block; }
table.rl tr.row.off td{ color:var(--muted); }
table.rl tr.row.off td.ttl{ font-weight:400; }
table.rl tr.row.off .sw{ background:transparent; box-shadow:inset 0 0 0 1.5px var(--c); }
.list-pager-wrap{ padding-bottom:6px; }
.pager-per{ display:flex; align-items:center; justify-content:center; gap:6px; font-size:12px; color:var(--muted); padding:6px 0 4px; }
.pager-per select{
  font:inherit; color:var(--ink); background:var(--panel); border:1px solid var(--line); border-radius:8px; padding:3px 6px;
}
.list-pager{
  display:flex; align-items:center; justify-content:center; gap:6px; padding:12px 8px 4px;
  font-size:12px; color:var(--muted); font-variant-numeric:tabular-nums;
}
.list-pager button{
  all:unset; box-sizing:border-box; cursor:pointer; min-width:32px; height:30px; border-radius:15px;
  border:1px solid var(--line); color:var(--ink); display:inline-flex; align-items:center; justify-content:center; font-size:15px;
}
.list-pager button:hover{ border-color:rgba(237,230,214,0.45); background:rgba(237,230,214,0.06); }
.list-pager button:disabled{ opacity:.3; cursor:default; }
.list-pager .pager-info{ padding:0 6px; text-align:center; }
.list-empty{ padding:30px 18px; color:var(--muted); font-size:13px; }
@media (max-width: 760px){
  table.rl{ font-size:12px; }
  table.rl td.when{ font-size:11px; }
  table.rl td{ padding:11px 4px; } /* rows about 44px: comfortable to tap */
  table.rl col.c-date{ width:74px !important; }
  table.rl col.c-likes{ width:34px !important; }
  table.rl col.c-resources{ width:32px !important; }
  table.rl col.c-remixes{ width:38px !important; }
  table.rl .who{ width:20px; height:20px; }
  table.rl col.c-user{ width:46px !important; }
  table.rl .sleeve-stack .who, table.rl .disc-thumb{ width:22px; height:22px; }
  /* Phones: no Res / Rem columns (more room for the title) */
  table.rl col.c-comments{ width:48px !important; }
  table.rl .sw{ margin-right:5px; }
}
/* Phones only (the same width as the bottom-sheet layout; between that and 760px the list is still
   the desktop side panel, it just has the narrower columns above). */
@media (max-width: 640px){
  /* Phones: the list sits at the top. With no record open it takes most of the screen (all of it
     when nothing is on the map yet); with a record open it shrinks to its header bar, so the map
     and the record sheet get the room. Tapping the header shows the rows again. */
  .listpanel{
    left:8px; right:8px; width:auto; bottom:auto;
    height:calc(100dvh - var(--topbar-h, 90px) - var(--timeline-h) - 12px - 30dvh);
    transform:translateY(-12px);
    transition:transform .3s cubic-bezier(.2,.8,.2,1), opacity .2s ease, height .25s ease;
  }
  #app.list-open.map-empty:not(.sleeve-open) .listpanel{ height:calc(100dvh - var(--topbar-h, 90px) - var(--timeline-h) - 14px); }
  #app.list-open.sleeve-open .listpanel{ height:auto; }
  #app.list-open.sleeve-open .listpanel .list-scroll{ display:none; }
  #app.list-open.sleeve-open.list-peek .listpanel{ height:min(46dvh, calc(100dvh - var(--topbar-h, 90px) - var(--timeline-h) - 20px)); z-index:12; }
  #app.list-open.sleeve-open.list-peek .listpanel .list-scroll{ display:block; }
  #app.list-open{ --sheet-h: min(52dvh, 460px); } /* (on #app, so the handle's own height wins) */
  /* With a record open, the timeline steps out of the way (it slides back when the record closes):
     the sheet, list and toasts use the freed space, because --timeline-h is 0 while it's hidden. */
  #app.sleeve-open{ --timeline-h: 0px; }
  #app.sleeve-open .timeline{ transform:translateY(100%); opacity:0; pointer-events:none; }
  .timeline{ transition:right .32s cubic-bezier(.2,.8,.2,1), transform .3s cubic-bezier(.2,.8,.2,1), opacity .2s ease; }
  #app.sleeve-open .sleeve{ padding-bottom:env(safe-area-inset-bottom, 0px); }
  #app.list-open.sleeve-open .toast{ bottom:calc(min(52dvh, 460px) + 10px); } /* just above the sheet, clear of the list */
  #app.list-open.sleeve-open.list-peek .toast{ bottom:calc(16px + env(safe-area-inset-bottom, 0px)); } /* (list opened out: clear of its rows) */
  .list-head{ padding:6px 6px 6px 10px; gap:4px; }
  .list-head h2{ font-size:15px; }
  .list-count{ white-space:nowrap; font-size:11.5px; }
  .list-pos{ min-width:0; }
  .list-step button{ height:36px; min-width:36px; padding:0 8px; justify-content:center; font-size:15px; }
  .list-step .lbl{ display:none; }
  #app.sleeve-open .list-title .chev{ display:inline-block; } /* (only when there are rows to show) */
}
.list-title{ all:unset; cursor:default; display:flex; align-items:baseline; gap:8px; min-width:0; }
.list-title .chev{ display:none; font-size:11px; color:var(--muted); transition:transform .2s ease; }
#app.sleeve-open .list-title{ cursor:pointer; }
#app.list-peek .list-title .chev{ transform:rotate(180deg); }

/* ---------- Detail panel vs the top bar and timeline ---------- */
/* While the panel is open, the top bar and timeline stop at its left edge, so the record
   counts and the date label stay visible instead of sliding underneath it. */
#app.sleeve-open .topbar,
#app.sleeve-open .timeline{ right:var(--sleeve-w); }
.toast{ transition:opacity .2s ease, left .32s cubic-bezier(.2,.8,.2,1); }
#app.sleeve-open .toast{ left:calc((100% - var(--sleeve-w)) / 2); }
.sleeve{ -webkit-user-select:text; user-select:text; }
.sleeve-scroll{ overscroll-behavior:contain; }
.sheet-grab{ display:none; }

/* ---------- Phones ---------- */
@media (max-width:640px){
  /* Top bar: brand + counts on one row, type filters + layout toggle on the next. */
  .topbar{ gap:8px 10px; padding:calc(8px + env(safe-area-inset-top)) 12px 10px; }
  .brand{ order:1; flex:1 1 auto; min-width:0; font-size:17px; }
  .brand small{ display:none; }
  .counts{ order:2; margin-left:0; }
  .c-long{ display:none; }
  .c-short{ display:inline; }
  #app.list-open .counts{ display:none; } /* (the list header already shows the count) */
  .spread-wrap{ order:3; }
  .search{ order:3; flex:1 1 130px; height:36px; padding:0 4px 0 13px; }
  .search input{ width:100%; font-size:16px; } /* 16px stops iOS zooming in on focus */
  .search input:focus{ width:100%; }
  .search button{ font-size:14px; padding:0 10px; }
  .spread-panel{ left:auto; right:0; width:min(260px, calc(100vw - 24px)); }
  .spread-panel input[type=range]{ height:36px; }
  .spread-panel input[type=range]::-webkit-slider-thumb{ margin-top:-9.5px; }
  .layout-toggle{ order:3; height:34px; width:34px; padding:0; justify-content:center; font-size:15px; }
  .layout-toggle .lt-label{ display:none; }
  .topbar{ gap:6px; }
  .icon-btn{ width:34px; height:34px; }
  .brand{ font-size:16px; }
  .brand-name{ min-width:0; overflow:hidden; text-overflow:ellipsis; } /* (a narrow phone shortens the name, never overlaps the buttons) */
  /* One row: brand, counts, then icon buttons. Search opens over the row; the type filters
     open as a small panel under it. */
  .topbar{ flex-wrap:nowrap; position:absolute; }
  .icon-btn{ display:inline-flex; order:3; }
  #search-btn{ order:2; }
  .search{ display:none; }
  #app.search-open .search{
    display:flex; position:absolute; z-index:8; left:12px; right:12px; top:calc(8px + env(safe-area-inset-top)); height:36px;
    background:var(--bg); box-shadow:0 0 0 6px var(--bg);
  }
  .pills{ display:none; }
  #app.filters-open .pills{
    display:flex; flex-wrap:wrap; gap:8px; position:absolute; z-index:8; right:12px; top:calc(100% + 4px);
    width:min(300px, calc(100vw - 24px)); padding:10px; border-radius:14px;
    background:rgba(20,18,15,0.97); border:1px solid var(--line); box-shadow:0 12px 30px rgba(0,0,0,.5);
  }
  .pill{ flex:none; height:38px; padding:0 13px 0 11px; font-size:14px; }

  /* Timeline: bigger touch targets, and no min/max date row. */
  .timeline{ padding:10px 14px calc(12px + env(safe-area-inset-bottom)); gap:0; }
  .datelabels{ display:none; }
  .playbtn{ width:40px; height:40px; font-size:14px; }
  .track-wrap{ height:40px; }
  input[type=range]{ height:40px; }
  input[type=range]::-webkit-slider-thumb{ width:22px; height:22px; }
  input[type=range]::-moz-range-thumb{ width:22px; height:22px; }
  .current-date{ min-width:112px; font-size:12px; } .current-date .dash{ padding:0 1px; }

  /* The detail panel becomes a bottom sheet that sits just above the timeline, so the
     map stays visible above it and the timeline stays usable. */
  .sleeve{
    top:auto; left:0; right:0; bottom:var(--timeline-h);
    width:auto;
    height:min(60vh, 560px); height:min(60dvh, 560px);
    height:var(--sheet-h, min(60dvh, 560px)); /* the handle can resize it */
    max-height:calc(100vh - var(--timeline-h) - 90px); max-height:calc(100dvh - var(--timeline-h) - 90px);
    min-height:64px;
    border-left:none; border-top:1px solid var(--line);
    border-radius:18px 18px 0 0;
    box-shadow:0 -10px 30px rgba(0,0,0,.45);
    transform:translateY(calc(100% + var(--timeline-h)));
  }
  .sleeve.open{ transform:translateY(0); }
  .sleeve-scroll{ padding-top:14px; }
  #app.sleeve-open .topbar,
  #app.sleeve-open .timeline{ right:0; }
  #app.sleeve-open .toast{ left:50%; }
  .sheet-grab{ display:block; position:absolute; top:0; left:0; right:0; height:30px; z-index:3; touch-action:none; }
  .sheet-grab::before{
    content:""; position:absolute; top:8px; left:50%; width:40px; height:4px; margin-left:-20px;
    border-radius:2px; background:rgba(237,230,214,.32);
  }
  .close-btn{ width:36px; height:36px; top:12px; right:12px; font-size:17px; z-index:4; }

  /* The sheet snaps to three heights: a mini player, half the screen, or (nearly) all of it. */
  .sleeve{ transition:transform .32s cubic-bezier(.2,.8,.2,1), height .28s cubic-bezier(.2,.8,.2,1); }
  .sleeve-scroll{ touch-action:pan-y; } /* sideways swipes change the record (handled in script) */
  #app.sheet-peek .sleeve-scroll, #app.sheet-peek .sleeve > .close-btn{ display:none; }
  #app.sheet-peek .mini{ display:flex; }
  /* pulled down while something keeps playing: the strip is that record's player */
  #app.sheet-peek .sleeve.has-dock .mini{ display:none; }
  #app.sheet-peek .np-dock{ position:absolute; left:0; right:0; top:18px; bottom:0; border-top:none; background:none; }
  #app.sheet-peek .np-bar{ top:auto; bottom:0; }
  #app.sheet-full .sleeve{ border-radius:0; }
  #app.sheet-full .listpanel{ visibility:hidden; } /* (reading mode: the sheet has the whole screen) */
  #app.filters-open .topbar, #app.search-open .topbar{ z-index:15; } /* (above the list and the sheet) */
  .sleeve-scroll.enter-from-right{ animation:enter-r .28s cubic-bezier(.2,.8,.2,1); }
  .sleeve-scroll.enter-from-left{ animation:enter-l .28s cubic-bezier(.2,.8,.2,1); }
  @keyframes enter-r{ from{ transform:translateX(40%); opacity:0; } to{ transform:none; opacity:1; } }
  @keyframes enter-l{ from{ transform:translateX(-40%); opacity:0; } to{ transform:none; opacity:1; } }
  @media (prefers-reduced-motion: reduce){ .sleeve-scroll.enter-from-right, .sleeve-scroll.enter-from-left{ animation:none; } }
  /* A square media area sized to leave room for the text below it. */
  .sleeve-media{ width:min(100%, 36vh); width:min(100%, 36dvh); margin:0 auto; }
  .record-link{ padding:11px 16px; font-size:13.5px; }

  /* A short hint that fades out (the script swaps the wording for touch screens). */
  .hint{
    left:14px; right:14px; bottom:calc(var(--timeline-h) + 10px);
    text-align:center; transition:opacity .6s ease;
  }
  .hint.fade, #app.sleeve-open .hint{ opacity:0; }
  .toast{ bottom:calc(var(--timeline-h) + 14px); }
  #app.sleeve-open .toast{ bottom:calc(var(--timeline-h) + min(60vh, 560px) + 12px); bottom:calc(var(--timeline-h) + min(60dvh, 560px) + 12px); }
}
.heart {
    width: 20px;
    height: 20px;
    background: red;
    position: relative;
    transform: rotate(-45deg);
    margin: 7.5px;

    display: flex;
    align-items: center;
    justify-content: center;

    color: white;
    font-size: 10px;
    font-weight: bold;
    float:right;
}

.heart::before,
.heart::after {
    content: "";
    width: 20px;
    height: 20px;
    background: red;
    border-radius: 50%;
    position: absolute;
}

.heart::before {
    top: -10px;
    left: 0;
}

.heart::after {
    left: 10px;
    top: 0;
}

.heart span {
    transform: rotate(45deg);
    position: relative;
    z-index: 2;
    font-size: 10px;
    color: white;
    padding-bottom: 7px;
}

/* ---------- Phones turned sideways (wide but short) ----------
   One slim top bar (search and type filters fold into buttons, as on phones held upright),
   a slim timeline, the list down the left side at full height, the record panel on the right. */
@media (max-height:500px) and (min-width:641px){
  .topbar{ flex-wrap:nowrap; gap:8px; padding:calc(6px + env(safe-area-inset-top)) calc(10px + env(safe-area-inset-right)) 6px calc(12px + env(safe-area-inset-left)); }
  .brand{ font-size:16px; flex:none; }
  .brand small{ display:none; }
  .counts{ margin-left:auto; }
  #app.list-open .counts{ display:none; } /* (the list header already shows the count) */
  #app.list-open #search-btn{ margin-left:auto; }
  .layout-toggle .lt-label{ display:none; }
  .icon-btn{ display:inline-flex; width:34px; height:34px; }
  .layout-toggle{ height:34px; }
  .search{ display:none; }
  #app.search-open .search{
    display:flex; position:absolute; z-index:8; top:calc(6px + env(safe-area-inset-top)); height:34px;
    left:calc(12px + env(safe-area-inset-left)); width:min(380px, 60vw);
    background:var(--bg); box-shadow:0 0 0 6px var(--bg);
  }
  .search input, .search input:focus{ width:100%; font-size:16px; }
  .pills{ display:none; }
  #app.filters-open .pills{
    display:flex; flex-wrap:wrap; gap:8px; position:absolute; z-index:8; right:12px; top:calc(100% + 4px);
    width:min(300px, 60vw); padding:10px; border-radius:14px;
    background:rgba(20,18,15,0.97); border:1px solid var(--line); box-shadow:0 12px 30px rgba(0,0,0,.5);
  }
  #app.filters-open .topbar, #app.search-open .topbar{ z-index:15; }

  .timeline{ padding:4px calc(14px + env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom, 0px)) calc(14px + env(safe-area-inset-left)); gap:2px; }
  .datelabels{ display:none; }

  :root{ --sleeve-w: min(380px, 46vw); }
  .sleeve{ padding-right:env(safe-area-inset-right); }
  .listpanel{
    top:calc(var(--topbar-h, 46px) + 2px); bottom:calc(var(--timeline-h) + 4px);
    left:calc(8px + env(safe-area-inset-left)); width:min(400px, 46vw);
  }
  #app.sleeve-open .listpanel{ width:min(400px, calc(100vw - var(--sleeve-w) - 24px - env(safe-area-inset-left))); }
  .list-head{ padding:4px 6px 4px 12px; }
  .list-head h2{ font-size:15px; }
  .list-step button{ height:32px; min-width:32px; justify-content:center; }
  .list-step .lbl{ display:none; }
  table.rl td{ padding:9px 5px; }
}
/* ---------- Big screens: use the room ----------
   The list and record panels grow with the screen (the map keeps the middle), the type and spacing
   step up a little, and the list adds people's names beside their avatars. Very wide screens
   (ultra-wides, a window across two monitors) get the widest panels; the map takes everything
   between them, and the record panel's reading width is capped so lines don't run on forever. */
table.rl.with-names td.av{ text-align:left; padding-left:8px; }
table.rl .who-name{
  display:inline-block; vertical-align:middle; margin-left:14px; max-width:calc(100% - 50px);
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--muted); font-size:12px;
}
@media (min-width:1440px) and (min-height:501px){
  :root{ --sleeve-w: 380px; }
  .listpanel{ width:clamp(470px, 32vw, 560px); }
}
@media (min-width:1800px) and (min-height:501px){
  :root{ --sleeve-w: 430px; }
  .listpanel{ width:clamp(560px, 33vw, 660px); left:16px; }
  table.rl{ font-size:13.5px; }
  table.rl td{ padding:9px 7px; }
  table.rl td.when{ font-size:12.5px; }
  table.rl col.c-date{ width:90px !important; } /* (room for "Apr 2022" at the bigger size) */
  table.rl .sleeve-stack .who{ width:28px; height:28px; }
  .sleeve-body{ padding:22px 26px 32px; }
  .sleeve-desc{ font-size:14.5px; }
}
@media (min-width:2400px) and (min-height:501px){
  :root{ --sleeve-w: 500px; }
  .listpanel{ width:clamp(660px, 30vw, 780px); left:20px; }
  table.rl{ font-size:14.5px; }
  table.rl .who-name{ font-size:13px; }
}
/* Ultra-wide or spanning monitors (wider than 21:9): still wider panels, since the map has plenty. */
@media (min-aspect-ratio: 21/9) and (min-width:2200px) and (min-height:501px){
  :root{ --sleeve-w: 540px; }
  .listpanel{ width:clamp(700px, 24vw, 860px); }
}
@media (min-width:1800px){ .sleeve-body > *{ max-width:62ch; } } /* (comfortable line length) */


/* The heart's timeline (People map): ▶, a slider through the years, who was there by then */
.heart-time{ gap:8px; padding:4px 12px 4px 4px; }
.heart-time .ht-play{ all:unset; box-sizing:border-box; cursor:pointer; width:30px; height:30px; border-radius:15px; display:inline-flex; align-items:center; justify-content:center; background:#E0573A; color:#fff; font-size:11px; letter-spacing:-1px; flex:none; }
.heart-time .ht-play:hover{ background:#ef6a4e; }
.heart-time .ht-range{ width:min(260px, 46vw); -webkit-appearance:none; appearance:none; height:22px; background:transparent; cursor:pointer; }
.heart-time .ht-range::-webkit-slider-runnable-track{ height:4px; border-radius:2px; background:rgba(237,230,214,0.22); }
.heart-time .ht-range::-moz-range-track{ height:4px; border-radius:2px; background:rgba(237,230,214,0.22); }
.heart-time .ht-range::-webkit-slider-thumb{ -webkit-appearance:none; width:16px; height:16px; margin-top:-6px; border-radius:50%; background:#EDE6D6; border:3px solid #E0573A; }
.heart-time .ht-range::-moz-range-thumb{ width:12px; height:12px; border-radius:50%; background:#EDE6D6; border:3px solid #E0573A; }
.heart-time .ht-when{ min-width:150px; color:var(--ink); font-size:12.5px; font-variant-numeric:tabular-nums; }
@media (max-width:640px){
  .heart-time .ht-range{ width:42vw; }
  .heart-time .ht-when{ min-width:0; font-size:12px; }
}
