/* Turns Tabled — the listening room.
   The 3D room is the picture; the interface stays quiet on top of it. */

:root {
  --night: #13100d;
  --panel: #1b1814;
  --panel-2: #23201b;
  --text: #f0eae0;
  --text-2: #bdb3a4;
  --text-3: #877e71;
  --line: rgba(240, 234, 224, 0.12);
  --line-2: rgba(240, 234, 224, 0.22);
  --live: #9fbf8c;
  --warn: #e0866a;

  --font: 'Archivo', 'Helvetica Neue', Arial, sans-serif;
  --mono: 'IBM Plex Mono', Consolas, monospace;
  --pad: clamp(16px, 3vw, 44px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--night);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body[data-view='crate'] { overflow: hidden; }
/* the wall + ledge pages are lit like the room */
body:not([data-view='crate']) {
  background:
    radial-gradient(ellipse 70% 60% at 10% 0%, rgba(255, 196, 130, 0.22), transparent 70%),
    linear-gradient(180deg, rgba(28, 22, 16, 0.5), rgba(19, 16, 13, 0.78) 70%),
    url('/textures/wall_diff.jpg') center top / 900px repeat,
    var(--night);
  background-attachment: fixed;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 1.5px solid var(--text); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
svg { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
code { font-family: var(--mono); font-size: 0.9em; color: var(--text); }
a { color: inherit; }

/* ---------- controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 18px; border-radius: 2px;
  border: 1px solid var(--line-2); background: transparent; color: var(--text);
  font-weight: 500; letter-spacing: 0.01em; white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}
.btn:hover { background: rgba(240, 234, 224, 0.06); border-color: rgba(240, 234, 224, 0.4); }
.btn-solid { background: var(--text); color: var(--night); border-color: var(--text); }
.btn-solid:hover { background: #fff; border-color: #fff; }
.btn-small { height: 32px; padding: 0 12px; font-size: 13px; }
.btn[disabled] { opacity: 0.45; pointer-events: none; }
.text-btn { border: 0; background: none; padding: 6px 2px; color: var(--text); font-weight: 500; border-bottom: 1px solid var(--line-2); }
.text-btn:hover { border-bottom-color: var(--text); }
.text-btn[disabled] { opacity: 0.5; }
.icon-btn {
  position: relative; display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--line-2); background: rgba(19, 16, 13, 0.35); color: var(--text);
  transition: background 0.15s, border-color 0.15s;
}
.icon-btn:hover { border-color: rgba(240, 234, 224, 0.5); background: rgba(19, 16, 13, 0.6); }
.icon-btn svg { width: 18px; height: 18px; }
#sound-btn .mute { display: none; }
#sound-btn[aria-pressed='false'] .wave { display: none; }
#sound-btn[aria-pressed='false'] .mute { display: inline; }
#sound-btn[aria-pressed='false'] { color: var(--text-3); }
.sync-dot { position: absolute; top: 2px; right: 2px; width: 8px; height: 8px; border-radius: 50%; background: var(--live); animation: breathe 1.6s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: 0.3; } }
.textlink { border: 0; background: none; padding: 0; color: inherit; text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 4px; }
.textlink:hover { text-decoration-color: currentColor; }

/* ---------- top: header + filters ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  padding-bottom: 30px;
  background: linear-gradient(180deg, rgba(14, 11, 9, 0.92) 0%, rgba(14, 11, 9, 0.78) 55%, rgba(14, 11, 9, 0) 100%);
}
body:not([data-view='crate']) .top { background: rgba(17, 14, 11, 0.92); border-bottom: 1px solid var(--line); backdrop-filter: blur(8px); }
.topbar { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; padding: 20px var(--pad) 6px; }
.wordmark {
  margin-right: auto; text-decoration: none; color: var(--text);
  font-weight: 750; font-stretch: 78%; font-size: 23px; letter-spacing: -0.01em;
}
.view-switch { display: flex; gap: 22px; }
.view-switch button {
  border: 0; background: none; padding: 4px 0; color: var(--text-3); font-weight: 500; font-size: 15px;
  border-bottom: 1px solid transparent;
}
.view-switch button:hover { color: var(--text-2); }
.view-switch button[aria-pressed='true'] { color: var(--text); border-bottom-color: var(--text); }
.tools { display: flex; align-items: center; gap: 18px; }
.search { display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--line-2); padding: 4px 0; }
.search:focus-within { border-bottom-color: var(--text); }
.search svg { width: 16px; height: 16px; color: var(--text-3); }
.search input { border: 0; background: none; outline: none; width: clamp(120px, 15vw, 220px); color: var(--text); }
.search input::placeholder { color: var(--text-3); }
.sort select, .styles select {
  appearance: none; border: 0; background: transparent; color: var(--text-2); padding: 4px 18px 4px 0; cursor: pointer; outline: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23bdb3a4' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right center; background-size: 12px;
}
.sort select:hover, .styles select:hover { color: var(--text); }
select option { background: var(--panel); color: var(--text); }

.filters { display: flex; align-items: baseline; gap: 22px; padding: 10px var(--pad) 0; }
.sections { display: flex; gap: 20px; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent); }
.sections::-webkit-scrollbar { display: none; }
.section {
  flex: none; border: 0; background: none; padding: 2px 0; color: var(--text-3); font-size: 14px; font-weight: 500;
  border-bottom: 1px solid transparent;
}
.section:hover { color: var(--text-2); }
.section[aria-pressed='true'] { color: var(--text); border-bottom-color: var(--text); }
.section sup { font-family: var(--mono); font-size: 10px; margin-left: 3px; color: var(--text-3); }
.styles { flex: none; font-size: 14px; }
.styles:empty { display: none; }

main { position: relative; }

/* ---------- crate view: the room fills the screen ---------- */
.view-crate { position: fixed; inset: 0; z-index: 0; }
.stage { position: absolute; inset: 0; outline: none; touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab; }
.room-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.stage::after { /* lens vignette */
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 75% 70% at 50% 45%, transparent 55%, rgba(8, 6, 4, 0.55) 100%);
}
.caption {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 5;
  display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 10px 24px;
  padding: 90px var(--pad) 22px;
  background: linear-gradient(0deg, rgba(12, 9, 7, 0.9) 0%, rgba(12, 9, 7, 0.6) 55%, rgba(12, 9, 7, 0) 100%);
  pointer-events: none;
}
.caption > * { pointer-events: auto; }
.now { min-width: 0; cursor: pointer; user-select: none; }
.sc-artist { font-size: 16px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-title {
  font-size: clamp(28px, 3.6vw, 48px); font-weight: 800; font-stretch: 76%; line-height: 1.02; letter-spacing: -0.015em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 2px 0 6px;
}
.sc-meta { display: flex; flex-wrap: wrap; gap: 4px 18px; font-family: var(--mono); font-size: 12.5px; color: var(--text-3); }
.sc-meta .hl { color: var(--live); }
.sc-meta .want { color: var(--warn); }
.sc-pos { font-family: var(--mono); font-size: 12.5px; color: var(--text-3); }
.dig-nav { display: flex; gap: 8px; align-items: center; }
.scrubber { grid-column: 1 / -1; }
.scrubber input[type='range'] { width: 100%; margin: 6px 0 0; appearance: none; height: 18px; background: transparent; cursor: pointer; }
.scrubber input[type='range']::-webkit-slider-runnable-track { height: 1px; background: var(--line-2); }
.scrubber input[type='range']::-moz-range-track { height: 1px; background: var(--line-2); }
.scrubber input[type='range']::-webkit-slider-thumb { appearance: none; width: 12px; height: 12px; margin-top: -5.5px; border-radius: 50%; background: var(--text); border: 0; }
.scrubber input[type='range']::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--text); border: 0; }
.letters { display: flex; justify-content: space-between; }
.letters button { border: 0; background: none; padding: 2px; font-family: var(--mono); font-size: 11px; color: var(--text-3); }
.letters button:hover { color: var(--text); }
.letters button.on { color: var(--text); text-decoration: underline; text-underline-offset: 4px; }
.letters button[disabled] { opacity: 0.25; pointer-events: none; }

/* what's on the turntable */
.deck-bar {
  position: absolute; z-index: 6; right: var(--pad); top: 128px;
  display: flex; align-items: center; gap: 12px; max-width: min(460px, calc(100vw - 2 * var(--pad)));
  padding: 10px 12px 10px 14px; background: rgba(14, 11, 9, 0.72); border: 1px solid var(--line); border-radius: 2px;
  backdrop-filter: blur(6px);
}
.deck-bar .db-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); }
.deck-bar .db-dot.on { background: var(--live); animation: breathe 1.8s ease-in-out infinite; }
.deck-bar .db-text { min-width: 0; display: grid; line-height: 1.25; }
.deck-bar .db-text span { font-size: 11.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.deck-bar .db-text b { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.deck-bar .btn { flex: none; }
.deck-bar .db-title { cursor: pointer; }

/* 2D fallback crate (no WebGL) */
.sleeves { position: absolute; left: 50%; top: 46%; width: min(40vh, 70vw); height: min(40vh, 70vw); transform: translate(-50%, -50%); perspective: 1400px; transform-style: preserve-3d; }
.sleeve { position: absolute; inset: 0; transform-origin: 50% 100%; transition: transform 0.4s ease, opacity 0.3s, filter 0.4s; cursor: pointer; }
.sleeve .face, .sleeve .back { position: absolute; inset: 0; backface-visibility: hidden; }
.sleeve .back { transform: rotateY(180deg); background: #2a2520; }
.sleeve img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- artwork (wall, lists, detail) ---------- */
.poly { position: relative; width: 100%; height: 100%; overflow: hidden; background: #0d0b09; }
.poly img { width: 100%; height: 100%; object-fit: cover; display: block; }
.poly::after { /* clear outer sleeve catching the light */
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(122deg, rgba(255, 255, 255, 0) 30%, rgba(255, 255, 255, 0.09) 38%, rgba(255, 255, 255, 0) 46%);
}
.stickers { display: none; }
.blank-sleeve {
  width: 100%; height: 100%; position: relative; container-type: inline-size;
  background: hsl(var(--h) 10% 78%);
  background-image: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.05) 0 1px, transparent 1px 3px);
}
.blank-sleeve::before {
  content: ''; position: absolute; left: 50%; top: 50%; width: 38%; height: 38%; transform: translate(-50%, -50%); border-radius: 50%;
  background: radial-gradient(circle, hsl(var(--h) 30% 70%) 0 35%, #161616 36%);
}
.blank-sleeve .bs-text { position: absolute; left: 7%; right: 7%; bottom: 6%; color: #1b1917; font-weight: 700; font-size: 7cqi; line-height: 1.1; }
.blank-sleeve .bs-text small { display: block; font-weight: 400; font-size: 5.5cqi; }

/* ---------- wall: sleeves on walnut picture ledges ---------- */
.view-wall, .view-stats { padding: 26px var(--pad) 70px; }
.wall { --tile: clamp(130px, 14vw, 200px); display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--tile), 1fr)); gap: 58px 28px; }
.tile { position: relative; border: 0; padding: 0; background: none; text-align: left; color: var(--text); content-visibility: auto; contain-intrinsic-size: 200px 270px; }
.tile-art {
  aspect-ratio: 1; position: relative; transform: perspective(900px) rotateX(4deg); transform-origin: 50% 100%;
  box-shadow: 0 2px 2px rgba(0, 0, 0, 0.4), 0 18px 26px -14px rgba(0, 0, 0, 0.85);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.tile-shelf { position: relative; }
.tile-shelf::after { /* the walnut picture ledge it stands on */
  content: ''; position: absolute; left: -15px; right: -15px; top: 100%; height: 13px; z-index: 1;
  background: linear-gradient(180deg, rgba(255, 228, 196, 0.55) 0 2px, rgba(255, 220, 180, 0.12) 3px, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, 0.35)), url('/textures/walnut_diff.jpg') center / 420px;
  box-shadow: 0 14px 16px -8px rgba(0, 0, 0, 0.8);
}
.tile:hover .tile-art, .tile:focus-visible .tile-art { transform: perspective(900px) rotateX(0deg) translateY(-6px); box-shadow: 0 4px 4px rgba(0, 0, 0, 0.35), 0 30px 34px -16px rgba(0, 0, 0, 0.9); }
.tile-cap { margin-top: 20px; }
.tile-cap b { display: block; font-weight: 600; font-size: 14px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-cap span { display: block; font-size: 13px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wall-letter { grid-column: 1 / -1; margin: 6px 0 -34px; font-weight: 300; font-size: 44px; font-stretch: 80%; color: var(--text-2); line-height: 1; }
.wall-letter .tape { all: unset; }
.wall-empty { grid-column: 1 / -1; color: var(--text-2); }

/* ---------- cards: welcome + settings ---------- */
.taped { position: relative; background: var(--panel); border: 1px solid var(--line); padding: 36px 36px 30px; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.8); }
.taped h2 { font-weight: 800; font-stretch: 78%; font-size: 34px; line-height: 1.05; letter-spacing: -0.01em; margin: 0 0 14px; }
.taped p { margin: 0 0 12px; color: var(--text-2); }
.taped ol { padding-left: 20px; margin: 0 0 20px; color: var(--text-2); }
.taped li { margin-bottom: 6px; }
.taped li b, .taped p b { color: var(--text); font-weight: 600; }
.taped a { text-decoration-color: var(--line-2); text-underline-offset: 4px; }
.taped a:hover { text-decoration-color: currentColor; }
.taped .row { display: flex; gap: 10px; flex-wrap: wrap; }
.empty { position: relative; z-index: 2; display: grid; place-items: center; min-height: 70vh; padding: 40px var(--pad); }
.empty .taped { max-width: 580px; }
.fineprint { font-size: 12.5px !important; color: var(--text-3) !important; margin-top: 20px !important; }

/* ---------- dialogs ---------- */
dialog { border: 0; padding: 0; background: transparent; color: var(--text); max-width: none; max-height: none; }
dialog::backdrop { background: rgba(8, 6, 4, 0.72); backdrop-filter: blur(6px); }
dialog[open] { animation: dlg-in 0.28s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes dlg-in { from { opacity: 0; transform: translateY(12px); } }
.close-x {
  position: absolute; top: 14px; right: 16px; z-index: 4; display: flex; gap: 6px; align-items: center;
  border: 0; background: none; padding: 6px; color: var(--text-3); font-size: 13px;
}
.close-x:hover { color: var(--text); }
.close-x svg { width: 16px; height: 16px; }

/* ---------- detail ---------- */
.detail { width: min(1180px, calc(100vw - 24px)); margin: auto; }
.counter {
  position: relative; display: grid; grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  background: var(--panel); border: 1px solid var(--line); max-height: calc(100dvh - 32px); overflow: hidden;
  box-shadow: 0 40px 90px -20px rgba(0, 0, 0, 0.9);
}
.c-left {
  position: relative; display: flex; flex-direction: column; gap: 26px; padding: 40px 36px 32px; overflow: hidden auto; min-width: 0;
  background: radial-gradient(ellipse 80% 60% at 30% 20%, rgba(255, 190, 120, 0.09), transparent 70%), #16130f;
  max-height: calc(100dvh - 34px);
}
.pulled { position: relative; width: min(80%, 400px); aspect-ratio: 1 / 1; flex: none; }
.pulled .sleeve-front { position: absolute; inset: 0; z-index: 2; box-shadow: 0 2px 3px rgba(0, 0, 0, 0.4), 0 30px 40px -18px rgba(0, 0, 0, 0.9); }
.spin-wrap { position: absolute; inset: 0; transform: translateX(32%); animation: slide-out 0.9s cubic-bezier(0.2, 0.75, 0.25, 1) 0.1s backwards; }
@keyframes slide-out { from { transform: translateX(0); } }
.vinyl {
  position: absolute; top: 2%; left: 2%; width: 96%; height: 96%; border-radius: 50%;
  background: repeating-radial-gradient(circle, #111 0 1px, #1a1a1a 1px 2px, #131313 2px 3px), #101010;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.6);
}
.vinyl::before { content: ''; position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from 30deg, transparent 0 8%, rgba(255, 255, 255, 0.12) 12%, transparent 17% 52%, rgba(255, 255, 255, 0.08) 61%, transparent 66%); }
.vinyl .label { position: absolute; left: 50%; top: 50%; width: 34%; height: 34%; margin: -17% 0 0 -17%; border-radius: 50%; background-size: cover; background-position: center; background-color: #ccc; display: grid; place-items: center; }
.vinyl .label::after { content: ''; width: 8%; height: 8%; border-radius: 50%; background: #16130f; }
.vinyl.spinning { animation: spin 1.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.cover-actions { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; font-size: 13px; color: var(--text-2); }
.cover-src { font-family: var(--mono); font-size: 11.5px; color: var(--text-3); }

.plays { border-top: 1px solid var(--line); padding-top: 18px; }
.plays-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.plays-count { font-size: 15px; color: var(--text-2); }
.plays-count b { color: var(--text); font-weight: 600; }
.plays-head .btn { margin-left: auto; }
.play-list { list-style: none; margin: 12px 0 0; padding: 0; max-height: 140px; overflow: auto; font-family: var(--mono); font-size: 12px; }
.play-list li { display: flex; justify-content: space-between; align-items: center; padding: 5px 0; border-top: 1px solid var(--line); color: var(--text-3); }
.play-list button { border: 0; background: none; color: var(--text-3); padding: 0 2px; font-family: var(--mono); font-size: 11.5px; }
.play-list button:hover { color: var(--warn); }
.want-card { border-top: 1px solid var(--line); padding-top: 18px; color: var(--text-2); }
.want-card b { display: block; color: var(--warn); font-weight: 600; margin-bottom: 2px; }

.sleeve-back { position: relative; min-width: 0; overflow-y: auto; overscroll-behavior: contain; padding: 58px 40px 32px; max-height: calc(100dvh - 34px); }
.sb-top { display: flex; justify-content: space-between; gap: 16px; font-family: var(--mono); font-size: 12px; color: var(--text-3); margin-bottom: 26px; }
.sb-artist { font-size: 18px; color: var(--text-2); margin: 0; }
.sb-title { font-size: clamp(34px, 3.6vw, 54px); font-weight: 800; font-stretch: 74%; line-height: 0.98; letter-spacing: -0.02em; margin: 4px 0 12px; }
.sb-genre { font-size: 13.5px; color: var(--text-3); margin: 0 0 26px; }
.value { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 18px; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: 26px; }
.value b { font-size: 26px; font-weight: 700; font-stretch: 85%; }
.value span { font-size: 13px; color: var(--text-3); }
.sides { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px 34px; margin: 0 0 26px; }
.side h4 { margin: 0 0 8px; font-size: 12px; font-weight: 600; color: var(--text-3); letter-spacing: 0.02em; }
.side ol { list-style: none; margin: 0; padding: 0; }
.side li { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; padding: 5px 0; border-top: 1px solid var(--line); font-size: 14.5px; line-height: 1.3; }
.side li .pos { font-family: var(--mono); font-size: 11.5px; color: var(--text-3); padding-top: 2px; }
.side li .dur { font-family: var(--mono); font-size: 11.5px; color: var(--text-3); padding-top: 2px; }
.side li .t-art { display: block; font-size: 12.5px; color: var(--text-3); }
.side li.heading { display: block; color: var(--text-2); font-size: 12.5px; font-weight: 600; padding-top: 12px; border-top: 0; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px 22px; margin: 0 0 26px; }
.facts dt { font-size: 12px; color: var(--text-3); }
.facts dd { margin: 2px 0 0; font-size: 14.5px; overflow-wrap: anywhere; }
.mono { font-family: var(--mono); font-size: 13px; }
.grade-stk { font-family: var(--mono); font-size: 13px; }
.notes { margin: 0 0 26px; }
.notes .n-head { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-3); margin-bottom: 6px; }
.notes textarea {
  width: 100%; min-height: 84px; resize: vertical; border: 1px solid var(--line); background: rgba(0, 0, 0, 0.18);
  color: var(--text); padding: 10px 12px; line-height: 1.55; outline: none; border-radius: 2px;
}
.notes textarea:focus { border-color: var(--line-2); }
.notes textarea::placeholder { color: var(--text-3); }
.discogs-note { font-size: 13.5px; color: var(--text-2); margin: 0 0 10px; white-space: pre-wrap; }
.saved { opacity: 0; transition: opacity 0.3s; color: var(--live); }
.saved.on { opacity: 1; }
.market { font-size: 13px; color: var(--text-3); margin: 0 0 22px; }
.sb-section-title { font-size: 12px; font-weight: 600; color: var(--text-3); margin: 0 0 6px; }
.small-print { font-size: 13px; line-height: 1.6; color: var(--text-2); margin: 0 0 20px; }
.small-print b { color: var(--text); font-weight: 600; }
.release-notes { font-size: 13px; color: var(--text-2); white-space: pre-wrap; max-height: 160px; overflow: auto; margin-bottom: 20px; }
.sb-foot { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 16px; }
.sb-foot .links { display: flex; gap: 22px; flex-wrap: wrap; font-size: 14px; }
.sb-foot .links a { text-decoration-color: var(--line-2); text-underline-offset: 4px; }
.sb-foot .links a:hover { text-decoration-color: currentColor; }
.nav-hint { font-family: var(--mono); font-size: 11.5px; color: var(--text-3); }
.muted { color: var(--text-3); font-size: 14px; }
.skeleton { height: 12px; margin: 10px 0; background: linear-gradient(90deg, var(--line), rgba(240, 234, 224, 0.06), var(--line)); background-size: 200% 100%; animation: shimmer 1.3s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- settings ---------- */
.settings { width: min(560px, calc(100vw - 24px)); margin: auto; }
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field label { font-size: 13px; color: var(--text-2); }
.field input { height: 44px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 2px; background: rgba(0, 0, 0, 0.25); font-family: var(--mono); font-size: 14px; outline: none; }
.field input:focus { border-color: var(--text); }
.connected-as { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 12px 0; margin-bottom: 16px; font-size: 14.5px; }
.connected-as .ok { width: 8px; height: 8px; border-radius: 50%; background: var(--live); font-size: 0; }
.connected-as button { margin-left: auto; }
.progress { margin: 16px 0 6px; }
.progress-bar { height: 2px; background: var(--line); overflow: hidden; }
.progress-bar span { display: block; height: 100%; background: var(--text); transition: width 0.4s; }
.progress-text { font-size: 13px; color: var(--text-3); margin: 8px 0 0; }
.error-text { color: var(--warn); font-size: 14px; margin: 10px 0 0; }

/* ---------- collection (stats) ---------- */
.report { max-width: 1100px; margin: 0 auto; }
.report-lede { font-size: clamp(22px, 2.6vw, 34px); line-height: 1.3; font-weight: 300; color: var(--text-2); max-width: 900px; margin: 10px 0 46px; }
.report-lede b { color: var(--text); font-weight: 600; }
.report-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 50px 56px; }
.report-grid .wide { grid-column: 1 / -1; }
.report h3 { font-size: 13px; font-weight: 600; color: var(--text-3); margin: 0 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.bar-row {
  display: grid; grid-template-columns: minmax(90px, 30%) 1fr 40px; align-items: center; gap: 14px; width: 100%;
  border: 0; background: none; padding: 6px 0; text-align: left; color: var(--text); font-size: 14px;
}
button.bar-row:hover .bl { text-decoration: underline; text-underline-offset: 4px; }
.bar-row .bl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-row .bt { height: 4px; background: var(--line); }
.bar-row .bt i { display: block; height: 100%; background: var(--text-2); }
.bar-row .bv { font-family: var(--mono); font-size: 12px; color: var(--text-3); text-align: right; }
.decades { display: flex; align-items: flex-end; gap: 10px; height: 170px; }
.decade { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 8px; border: 0; background: none; padding: 0; color: var(--text); }
.decade i { width: 100%; max-width: 44px; background: var(--text-2); display: block; min-height: 1px; transition: background 0.15s; }
.decade:hover i { background: var(--text); }
.decade b { font-family: var(--mono); font-size: 11.5px; font-weight: 400; color: var(--text-3); }
.decade span { font-family: var(--mono); font-size: 11.5px; color: var(--text-3); }
.rec-list { list-style: none; margin: 0; padding: 0; }
.rec-list button { display: grid; grid-template-columns: 46px 1fr auto; gap: 14px; align-items: center; width: 100%; border: 0; background: none; padding: 7px 0; text-align: left; color: var(--text); border-bottom: 1px solid var(--line); }
.rec-list button:hover b { text-decoration: underline; text-underline-offset: 4px; }
.rec-list .thumb { width: 46px; height: 46px; box-shadow: 0 6px 10px -4px rgba(0, 0, 0, 0.7); }
.rec-list b { display: block; font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rec-list span { display: block; font-size: 13px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rec-list .val { font-family: var(--mono); font-size: 12px; color: var(--text-3); }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 120px; z-index: 200; transform: translate(-50%, 10px);
  background: var(--text); color: var(--night); padding: 9px 16px; border-radius: 2px; font-weight: 500; font-size: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; max-width: calc(100vw - 32px);
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- smaller screens ---------- */
@media (max-width: 980px) {
  .counter { grid-template-columns: 1fr; overflow-y: auto; }
  .c-left, .sleeve-back { max-height: none; overflow: visible; }
  .c-left { padding: 44px 20px 10px; }
  .pulled { width: min(66%, 320px); }
  .sleeve-back { padding: 20px 20px 26px; }
  .report-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .topbar { gap: 12px 18px; padding-top: 14px; }
  .tools { width: 100%; gap: 10px 16px; flex-wrap: wrap; }
  .search { flex: 1 1 100%; order: -1; }
  .search input { width: 100%; }
  .sort { margin-right: auto; }
  .text-btn { white-space: nowrap; }
  .filters { flex-wrap: wrap; gap: 6px 18px; }
  .caption { padding-bottom: 16px; }
  .dig-nav { display: none; }
  .deck-bar { top: 178px; left: var(--pad); right: var(--pad); max-width: none; }
  .wall { gap: 46px 18px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
