/* Crate: My Vinyl Collection
   Monochrome chrome in black or white gradients; the covers supply all the colour. */

@font-face {
  font-family: 'Geist';
  src: url('../fonts/geist-latin-wght-normal.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Geist';
  src: url('../fonts/geist-latin-ext-wght-normal.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Bricolage';
  src: url('../fonts/bricolage-grotesque-latin-standard-normal.woff2') format('woff2');
  font-weight: 200 800;
  font-stretch: 75% 100%;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Bricolage';
  src: url('../fonts/bricolage-grotesque-latin-ext-standard-normal.woff2') format('woff2');
  font-weight: 200 800;
  font-stretch: 75% 100%;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --ui: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Helvetica Neue', sans-serif;
  --display: 'Bricolage', 'Geist', ui-sans-serif, system-ui, sans-serif;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --pad: clamp(16px, 3.2vw, 44px);
  color-scheme: dark;

  /* Black */
  --bg-solid: #000;
  --bg: radial-gradient(120% 70% at 50% -10%, #26272b 0%, #101012 46%, #000 100%);
  --ink: #f6f6f4;
  --ink-2: #a9abb0;
  --ink-3: #6c6e74;
  --line: rgba(255, 255, 255, 0.1);
  --fill: rgba(255, 255, 255, 0.07);
  --fill-2: rgba(255, 255, 255, 0.12);
  --panel: linear-gradient(180deg, #222327 0%, #121214 100%);
  --bar: rgba(8, 8, 9, 0.62);
  --primary: linear-gradient(180deg, #ffffff 0%, #c9cbd0 100%);
  --on-primary: #000;
  --sleeve-shadow: 0 1px 0 rgba(255, 255, 255, 0.08) inset, 0 18px 34px -18px rgba(0, 0, 0, 0.9), 0 2px 6px rgba(0, 0, 0, 0.5);
  --blank-ink: #e9e9e6;
  --blank-0: linear-gradient(145deg, #34353a, #0c0c0d);
  --blank-1: radial-gradient(circle at 28% 18%, #45464c, #0f0f10 72%);
  --blank-2: linear-gradient(205deg, #151517, #3d3e44);
  --blank-3: conic-gradient(from 210deg at 72% 28%, #101011, #3b3c42, #101011);
  --danger: #ff8a80;
  --ambient: 0.5;
}
:root[data-theme='light'] {
  color-scheme: light;
  --bg-solid: #fff;
  --bg: radial-gradient(120% 70% at 50% -10%, #ffffff 0%, #f0f1f3 48%, #d9dbdf 100%);
  --ink: #09090a;
  --ink-2: #55585e;
  --ink-3: #8b8e94;
  --line: rgba(0, 0, 0, 0.1);
  --fill: rgba(0, 0, 0, 0.05);
  --fill-2: rgba(0, 0, 0, 0.09);
  --panel: linear-gradient(180deg, #ffffff 0%, #eeeff1 100%);
  --bar: rgba(255, 255, 255, 0.66);
  --primary: linear-gradient(180deg, #34353a 0%, #000 100%);
  --on-primary: #fff;
  --sleeve-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06), 0 18px 30px -18px rgba(20, 22, 30, 0.55), 0 2px 5px rgba(20, 22, 30, 0.14);
  --blank-ink: #151517;
  --blank-0: linear-gradient(145deg, #ffffff, #c9cbd0);
  --blank-1: radial-gradient(circle at 28% 18%, #ffffff, #cfd1d6 72%);
  --blank-2: linear-gradient(205deg, #d3d5da, #fafafa);
  --blank-3: conic-gradient(from 210deg at 72% 28%, #f4f4f5, #c4c6cc, #f4f4f5);
  --danger: #b3261e;
  --ambient: 0.38;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  font: 400 15px/1.45 var(--ui);
  color: var(--ink);
  background: var(--bg-solid);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
body::before { content: ''; position: fixed; inset: 0; z-index: -2; background: var(--bg); }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; text-underline-offset: 3px; }
h1, h2, h3, p, ol, dl, dd, fieldset { margin: 0; padding: 0; }
fieldset { border: 0; min-width: 0; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; flex: none; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }

/* ---------- ambient cover glow (Crate view) ---------- */
#ambient { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
#ambient i { position: absolute; inset: -12%; background: center / cover no-repeat; filter: blur(70px) saturate(1.25); opacity: 0; transition: opacity 0.7s ease; }
#ambient i.on { opacity: var(--ambient); }
#ambient::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 30%, var(--bg-solid) 96%); }

/* ---------- top bar ---------- */
.bar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 14px;
  padding: calc(var(--safe-t) + 12px) var(--pad) 12px;
  border-bottom: 1px solid var(--line);
}
/* the blur lives on a layer of its own so the bar doesn't trap the phone's fixed dock */
.bar::before { content: ''; position: absolute; inset: 0; z-index: -1; background: var(--bar); -webkit-backdrop-filter: blur(22px) saturate(1.4); backdrop-filter: blur(22px) saturate(1.4); }
.brand { display: flex; align-items: baseline; gap: 9px; text-decoration: none; margin-right: 6px; white-space: nowrap; }
.brand .mark { width: 24px; height: 24px; stroke: none; align-self: center; }
.brand .word { font: 800 27px/1 var(--display); font-stretch: 88%; letter-spacing: -0.035em; }
.brand .count { font-size: 13px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

.search { flex: 1 1 220px; max-width: 440px; display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 999px; background: var(--fill); border: 1px solid transparent; color: var(--ink-3); transition: border-color 0.15s, background 0.15s; }
.search:focus-within { border-color: var(--line); background: var(--fill-2); color: var(--ink); }
.search input[type='search'] { flex: 1; min-width: 0; min-height: 0; padding: 0; background: none; border: 0; border-radius: 0; outline: 0; font-size: 16px; color: var(--ink); }
.search input::placeholder { color: var(--ink-3); }
.search input::-webkit-search-cancel-button { filter: grayscale(1); }

.views { display: flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--fill); margin-left: auto; }
.views button { display: flex; align-items: center; gap: 7px; height: 34px; padding: 0 13px; border-radius: 999px; color: var(--ink-2); font-size: 14px; font-weight: 500; transition: color 0.15s; }
.views button:hover { color: var(--ink); }
.views button[aria-pressed='true'] { background: var(--primary); color: var(--on-primary); }
.views svg { width: 17px; height: 17px; }

.tools { display: flex; gap: 2px; }
.icon { position: relative; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 999px; color: var(--ink-2); transition: background 0.15s, color 0.15s; }
.icon:hover { background: var(--fill); color: var(--ink); }
.dot { position: absolute; top: 8px; right: 8px; width: 7px; height: 7px; border-radius: 50%; background: var(--ink); }
.dot[data-state='syncing'] { animation: pulse 1s ease-in-out infinite; }
.dot[data-state='error'], .dot[data-state='reauth'] { background: var(--danger); }
@keyframes pulse { 50% { opacity: 0.25; } }

.primary, .ghost { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 18px; border-radius: 999px; font-weight: 600; font-size: 15px; text-decoration: none; white-space: nowrap; transition: transform 0.12s, opacity 0.15s, background 0.15s; }
.primary { background: var(--primary); color: var(--on-primary); box-shadow: 0 8px 20px -10px rgba(0, 0, 0, 0.6); }
.ghost { background: var(--fill); color: var(--ink); font-weight: 500; }
.ghost:hover { background: var(--fill-2); }
.primary:active, .ghost:active { transform: scale(0.97); }
.primary:disabled, .ghost:disabled { opacity: 0.45; cursor: default; }
.ghost.danger { color: var(--danger); }
.primary svg { stroke-width: 2; }

/* ---------- main ---------- */
main { padding: clamp(18px, 2.6vw, 34px) var(--pad) calc(var(--safe-b) + 60px); outline: 0; }

.group { display: flex; align-items: baseline; gap: 12px; margin: 38px 0 16px; font: 700 clamp(22px, 2.6vw, 32px)/1.1 var(--display); font-stretch: 90%; letter-spacing: -0.025em; }
.group:first-child { margin-top: 4px; }
.group small { font: 400 14px var(--ui); letter-spacing: 0; color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* ---------- sleeve ---------- */
.sleeve { position: relative; display: block; aspect-ratio: 1; width: 100%; overflow: hidden; border-radius: 3px; box-shadow: var(--sleeve-shadow); container-type: inline-size; background: var(--blank-0); }
.sleeve.v1 { background: var(--blank-1); }
.sleeve.v2 { background: var(--blank-2); }
.sleeve.v3 { background: var(--blank-3); }
.sleeve .blank { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; gap: 0.3em; padding: 9cqi; color: var(--blank-ink); text-align: left; font-size: 9.5cqi; }
.sleeve .blank b { font: 700 1em/1.02 var(--display); font-stretch: 82%; letter-spacing: -0.02em; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.sleeve .blank i { font: 400 0.52em/1.2 var(--ui); opacity: 0.66; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sleeve img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* ---------- gallery ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(var(--tile), 44%), 1fr)); gap: clamp(22px, 2.6vw, 40px) clamp(14px, 2.2vw, 32px); }
.tile { position: relative; display: block; text-align: left; min-width: 0; }
.tile .sleeve { transition: transform 0.28s cubic-bezier(0.2, 0.7, 0.2, 1); z-index: 1; }
/* the record peeks out of its sleeve when you point at it */
.gallery .tile::before {
  content: ''; position: absolute; top: 1.5%; left: 1.5%; width: 97%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, #d9d9d6 0 2%, #1b1b1d 2.4% 15%, transparent 15.4%), conic-gradient(from 30deg, #000 0 8%, #3a3a3d 13%, #000 20% 50%, #323235 63%, #000 70%), #000;
  background-blend-mode: normal, screen, normal;
  box-shadow: 0 6px 16px -6px rgba(0, 0, 0, 0.7);
  transition: transform 0.34s cubic-bezier(0.2, 0.7, 0.2, 1); opacity: 0;
}
@media (hover: hover) {
  .gallery .tile:hover, .gallery .tile:focus-visible { z-index: 3; }
  .gallery .tile:hover::before, .gallery .tile:focus-visible::before { transform: translateX(20%) rotate(40deg); opacity: 1; }
  .gallery .tile:hover .sleeve, .gallery .tile:focus-visible .sleeve { transform: translate(-3%, -2%); }
}
.cap { display: block; margin-top: 11px; min-width: 0; }
.cap b { display: block; font-weight: 600; font-size: 14.5px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cap i { display: block; font-style: normal; font-size: 13.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- wall ---------- */
body[data-view='wall'] main { padding-left: 0; padding-right: 0; padding-top: 0; }
.wall .grid { grid-template-columns: repeat(auto-fill, minmax(min(var(--tile), 30%), 1fr)); gap: 0; }
.wall .group { margin: 30px var(--pad) 14px; }
.wall .group:first-child { margin-top: 22px; }
.wall .sleeve { border-radius: 0; box-shadow: none; }
.wall .cap { position: absolute; inset: auto 0 0; z-index: 2; margin: 0; padding: 34px 10px 9px; background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.82)); color: #fff; opacity: 0; transition: opacity 0.18s; }
.wall .cap i { color: rgba(255, 255, 255, 0.72); }
.wall .tile:hover .cap, .wall .tile:focus-visible .cap { opacity: 1; }
.wall .tile:focus-visible { outline-offset: -3px; z-index: 2; }

/* ---------- list ---------- */
.list { max-width: 1280px; margin: 0 auto; }
.lrow { display: grid; grid-template-columns: 48px minmax(0, 2.2fr) 64px minmax(0, 1.2fr) minmax(0, 1.1fr) 112px; align-items: center; gap: 16px; width: 100%; padding: 8px 10px; border-radius: 12px; text-align: left; font-size: 14px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.lrow > span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lrow .sleeve { border-radius: 2px; overflow: hidden; }
.lrow .sleeve .blank { display: none; }
button.lrow:hover { background: var(--fill); }
.lt b { display: block; color: var(--ink); font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; }
.lt i { display: block; font-style: normal; overflow: hidden; text-overflow: ellipsis; }
.lhead { color: var(--ink-3); font-size: 13px; padding-block: 4px 10px; border-bottom: 1px solid var(--line); border-radius: 0; margin-bottom: 6px; }
.list .group { margin: 30px 10px 10px; }

/* ---------- crate (flip through) ---------- */
body[data-view='crate'] main { padding: 0; }
.flow { --w: min(60vw, 46dvh, 460px); --step: calc(var(--w) * 0.3); display: flex; flex-direction: column; align-items: center; min-height: calc(100dvh - 66px - var(--safe-t)); padding-bottom: calc(var(--safe-b) + 84px); overflow: hidden; }
.flow-track { width: 100%; margin-top: auto; display: flex; align-items: flex-start; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; padding: clamp(18px, 5dvh, 56px) calc(50% - var(--step) / 2) calc(var(--w) * 0.34); outline: 0; overscroll-behavior-x: contain; }
.flow-track::-webkit-scrollbar { display: none; }
.slot { position: relative; flex: 0 0 var(--step); height: var(--w); scroll-snap-align: center; }
.slot .sleeve { will-change: transform; }
.slot .sleeve { position: absolute; top: 0; left: 50%; width: var(--w); margin-left: calc(var(--w) / -2); border-radius: 4px; box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.9), 0 2px 8px rgba(0, 0, 0, 0.4); -webkit-box-reflect: below 5px linear-gradient(transparent 68%, rgba(0, 0, 0, 0.22)); }
.slot .sleeve::after { content: ''; position: absolute; inset: 0; background: var(--bg-solid); opacity: calc(var(--dim, 1) * 0.72 + 0.0); pointer-events: none; }
.flow-info { margin-top: calc(var(--w) * -0.13); padding: 0 24px; text-align: center; max-width: 900px; min-height: 5.6em; }
.flow-info h2 { font: 750 clamp(26px, 4.6vw, 54px)/1.02 var(--display); font-stretch: 84%; letter-spacing: -0.035em; text-wrap: balance; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.flow-info .fa { margin-top: 8px; font-size: clamp(16px, 1.8vw, 20px); color: var(--ink); }
.flow-info .fm { margin-top: 3px; font-size: 14px; color: var(--ink-2); }
.flow-scrub { display: flex; align-items: center; gap: 14px; width: min(560px, 82vw); margin-top: auto; padding-top: 20px; color: var(--ink-3); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.flow-scrub input { flex: 1; }

input[type='range'] { -webkit-appearance: none; appearance: none; height: 28px; background: none; margin: 0; width: 100%; }
input[type='range']::-webkit-slider-runnable-track { height: 3px; border-radius: 3px; background: var(--fill-2); }
input[type='range']::-moz-range-track { height: 3px; border-radius: 3px; background: var(--fill-2); }
input[type='range']::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; margin-top: -8.5px; border-radius: 50%; background: var(--primary); border: 0; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4); }
input[type='range']::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: var(--ink); border: 0; }

/* ---------- empty ---------- */
.empty { display: grid; justify-items: center; text-align: center; gap: 14px; padding: clamp(40px, 12dvh, 120px) 16px; }
.empty h1 { font: 750 clamp(30px, 5vw, 54px)/1.03 var(--display); font-stretch: 84%; letter-spacing: -0.035em; text-wrap: balance; }
.empty p { max-width: 46ch; color: var(--ink-2); font-size: 16px; }
.empty-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 10px; }
.empty-disc { width: min(52vw, 230px); aspect-ratio: 1; border-radius: 50%; margin-bottom: 14px; background: radial-gradient(circle, var(--bg-solid) 0 2.2%, #e9e9e6 2.6% 16%, transparent 16.4%), repeating-radial-gradient(circle, #0b0b0c 0 1.5px, #1a1a1c 1.5px 3px); box-shadow: 0 30px 60px -24px rgba(0, 0, 0, 0.75); position: relative; animation: spin 9s linear infinite; }
.empty-disc::after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from 20deg, transparent 0 8%, rgba(255, 255, 255, 0.2) 13%, transparent 20% 50%, rgba(255, 255, 255, 0.16) 63%, transparent 70%); -webkit-mask: radial-gradient(circle, transparent 17%, #000 17.5%); mask: radial-gradient(circle, transparent 17%, #000 17.5%); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- sheets ---------- */
dialog.sheet { width: min(580px, calc(100vw - 32px)); max-height: min(88dvh, 860px); margin: auto; padding: 26px; border: 1px solid var(--line); border-radius: 24px; background: var(--panel); color: var(--ink); overflow: auto; overscroll-behavior: contain; box-shadow: 0 40px 100px -30px rgba(0, 0, 0, 0.8); }
dialog.sheet.small { width: min(420px, calc(100vw - 32px)); }
dialog.sheet[open] { animation: rise 0.26s cubic-bezier(0.2, 0.8, 0.2, 1); }
dialog::backdrop { background: rgba(0, 0, 0, 0.6); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: fade 0.2s; }
:root[data-theme='light'] dialog::backdrop { background: rgba(60, 62, 70, 0.4); }
@keyframes rise { from { transform: translateY(22px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin: -6px -8px 16px 0; }
.sheet h2 { font: 750 26px/1.1 var(--display); font-stretch: 86%; letter-spacing: -0.03em; }
.sheet h3 { font: 650 17px/1.2 var(--ui); margin-bottom: 8px; }
.sheet p { color: var(--ink-2); }
.hint { font-size: 13.5px; color: var(--ink-3) !important; margin-top: 10px; }
.hint.error, .status.error, .status.reauth { color: var(--danger) !important; }
code { font: inherit; font-size: 13.5px; padding: 3px 7px; border-radius: 6px; background: var(--fill-2); word-break: break-all; user-select: all; -webkit-user-select: all; }

input:not([type]), input[type='text'], input[type='search'], input[type='url'], input[type='password'], input[type='datetime-local'], input[type='file'], textarea {
  width: 100%; min-height: 44px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--fill); font-size: 16px; outline: 0; }
.sheet input:focus, textarea:focus { border-color: var(--ink-2); }
textarea { resize: vertical; display: block; }
.line { display: flex; gap: 8px; margin-top: 12px; }
.line input { flex: 1; min-width: 0; border-radius: 999px; padding-inline: 18px; }
.stack { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.filebtn { cursor: pointer; }
.textlink { display: inline-block; margin-top: 12px; font-size: 14px; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

.tabs, .seg { display: flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--fill); margin-bottom: 16px; }
.tabs button, .seg button { flex: 1; height: 38px; border-radius: 999px; font-weight: 500; font-size: 14.5px; color: var(--ink-2); }
.tabs button[aria-selected='true'], .seg button[aria-pressed='true'] { background: var(--primary); color: var(--on-primary); font-weight: 600; }
.seg { max-width: 260px; margin-bottom: 0; }

/* scanner */
.scanner { position: relative; aspect-ratio: 4 / 3; border-radius: 18px; overflow: hidden; background: #000; }
.scanner video { width: 100%; height: 100%; object-fit: cover; }
.reticle { position: absolute; left: 11%; right: 11%; top: 30%; bottom: 30%; border-radius: 14px; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.42); border: 2px solid rgba(255, 255, 255, 0.9); }
.reticle::after { content: ''; position: absolute; left: 6%; right: 6%; top: 50%; height: 2px; background: #fff; opacity: 0.8; animation: sweep 1.8s ease-in-out infinite alternate; }
@keyframes sweep { from { transform: translateY(-22px); } to { transform: translateY(22px); } }
.scan-status { position: absolute; inset: auto 0 0; padding: 26px 16px 12px; text-align: center; font-size: 14px; color: #fff !important; background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.75)); }
.scanner.off { aspect-ratio: auto; background: var(--fill); }
.scanner.off video, .scanner.off .reticle { display: none; }
.scanner.off .scan-status { position: static; background: none; color: var(--ink-2) !important; padding: 18px; }

.results { margin-top: 14px; display: grid; gap: 2px; }
.hit { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.hit:first-child { border-top: 0; }
.hit .sleeve .blank { display: none; }
.hit b, .hit span, .hit small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hit b { font-weight: 600; }
.hit span { color: var(--ink-2); font-size: 14px; }
.hit small { color: var(--ink-3); font-size: 13px; }
.hit .ghost { min-height: 36px; padding: 0 14px; font-size: 14px; }

.form { display: grid; gap: 12px; }
.field { display: grid; gap: 5px; min-width: 0; }
.field > span, .notes > span, legend { font-size: 13.5px; color: var(--ink-2); }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; position: sticky; bottom: -26px; padding: 12px 0 calc(var(--safe-b) + 4px); background: linear-gradient(180deg, transparent, #121214 40%); }
:root[data-theme='light'] .form-actions { background: linear-gradient(180deg, transparent, #eeeff1 40%); }

#arrangeForm { display: grid; gap: 22px; }
legend { margin-bottom: 8px; }
.choice { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 12px; border-radius: 10px; cursor: pointer; }
.choice:hover { background: var(--fill); }
.choice input { appearance: none; -webkit-appearance: none; width: 18px; height: 18px; margin: 0; border-radius: 50%; border: 1.5px solid var(--ink-3); display: grid; place-items: center; }
.choice input:checked { border-color: var(--ink); }
.choice input:checked::after { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--ink); }

.set { padding: 20px 0; border-top: 1px solid var(--line); }
.set:first-of-type { border-top: 0; padding-top: 0; }
.steps { margin: 12px 0 0 20px; display: grid; gap: 9px; color: var(--ink-2); }
.steps b { color: var(--ink); font-weight: 600; }
.status { margin-top: 10px; color: var(--ink) !important; font-weight: 500; }
.fine { font-size: 13px; color: var(--ink-3) !important; padding-top: 14px; border-top: 1px solid var(--line); }

/* ---------- record detail ---------- */
dialog.detail { width: min(1120px, calc(100vw - 48px)); max-height: min(90dvh, 820px); padding: 0; display: none; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); overflow: hidden; background: var(--bg-solid); }
dialog.detail[open] { display: grid; }
.d-ambient { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.d-ambient img { position: absolute; inset: -20%; width: 140%; height: 140%; object-fit: cover; filter: blur(80px) saturate(1.3); opacity: calc(var(--ambient) + 0.12); }
.d-ambient::after { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 0%, var(--bg-solid) 78%); opacity: 0.86; }
.detail .close { position: absolute; top: 14px; right: 14px; z-index: 3; background: var(--fill); color: var(--ink); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.d-stage { position: relative; display: grid; place-items: center; padding: clamp(24px, 4vw, 56px); padding-right: 12px; min-height: 0; }
.d-pack { position: relative; width: 100%; max-width: 520px; }
.d-pack .sleeve { width: 76%; z-index: 1; border-radius: 4px; box-shadow: 0 40px 70px -34px rgba(0, 0, 0, 0.9), 0 3px 10px rgba(0, 0, 0, 0.35); }
.disc { position: absolute; top: 1%; left: 1%; width: 74%; aspect-ratio: 1; border-radius: 50%; background: repeating-radial-gradient(circle, #0a0a0b 0 1.5px, #19191b 1.5px 3px); box-shadow: 0 20px 40px -18px rgba(0, 0, 0, 0.8); transform: translateX(32%) rotate(24deg); animation: slip 0.9s cubic-bezier(0.2, 0.75, 0.15, 1) both; }
.disc::after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from 20deg, transparent 0 8%, rgba(255, 255, 255, 0.2) 13%, transparent 20% 50%, rgba(255, 255, 255, 0.16) 63%, transparent 70%); }
.disc span { position: absolute; inset: 32%; z-index: 1; border-radius: 50%; background: #d8d8d4 center / cover; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5); }
.disc span::after { content: ''; position: absolute; inset: 44%; border-radius: 50%; background: #050505; }
@keyframes slip { from { transform: translateX(0) rotate(-40deg); } }
.d-body { position: relative; overflow-y: auto; padding: clamp(28px, 4vw, 56px) clamp(22px, 3.4vw, 48px) 28px 20px; min-height: 0; overscroll-behavior: contain; }
.d-body h2 { font: 750 clamp(28px, 3.4vw, 46px)/1.02 var(--display); font-stretch: 84%; letter-spacing: -0.035em; text-wrap: balance; padding-right: 36px; }
.d-artist { margin-top: 10px; font-size: 19px; color: var(--ink) !important; }
.facts { display: grid; gap: 0; margin-top: 26px; border-top: 1px solid var(--line); }
.facts div { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.facts dt { color: var(--ink-3); font-size: 14px; }
.tracks h3, .notes > span { display: block; margin: 28px 0 8px; font: 650 15px var(--ui); color: var(--ink); }
.tracks ol { list-style: none; }
.tracks li { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 10px; padding: 7px 0; font-size: 14.5px; font-variant-numeric: tabular-nums; }
.tracks li span, .tracks li i { color: var(--ink-3); font-style: normal; }
.tracks li b { font-weight: 400; }
.d-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 26px; }
.d-actions .ghost { min-height: 38px; font-size: 14px; padding: 0 15px; }
.d-nav { margin-left: auto; display: flex; }

/* ---------- toasts ---------- */
#toasts { position: fixed; inset: auto auto auto 50%; margin: 0; padding: 0; border: 0; background: none; overflow: visible; left: 50%; bottom: calc(var(--safe-b) + 24px); transform: translateX(-50%); z-index: 100; display: grid; gap: 8px; justify-items: center; width: max-content; max-width: calc(100vw - 32px); }
.toast { display: flex; align-items: center; gap: 14px; padding: 11px 18px; border-radius: 999px; background: var(--primary); color: var(--on-primary); font-weight: 500; font-size: 14.5px; box-shadow: 0 16px 40px -12px rgba(0, 0, 0, 0.6); animation: rise 0.25s cubic-bezier(0.2, 0.8, 0.2, 1); transition: opacity 0.3s; }
.toast.out { opacity: 0; }
.toast button { font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- phone ---------- */
@media (max-width: 820px) {
  .bar { flex-wrap: wrap; gap: 10px 4px; padding-bottom: 10px; }
  .brand { margin-right: auto; }
  .search { order: 5; flex: 1 1 100%; max-width: none; }
  .views { position: fixed; z-index: 30; left: 16px; bottom: calc(var(--safe-b) + 14px); margin: 0; padding: 4px; background: var(--bar); border: 1px solid var(--line); -webkit-backdrop-filter: blur(22px) saturate(1.4); backdrop-filter: blur(22px) saturate(1.4); box-shadow: 0 14px 34px -12px rgba(0, 0, 0, 0.6); }
  .views button { width: 48px; height: 44px; padding: 0; justify-content: center; }
  .views button span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .views svg { width: 20px; height: 20px; }
  #addBtn { position: fixed; z-index: 30; right: 16px; bottom: calc(var(--safe-b) + 14px); width: 54px; height: 54px; padding: 0; box-shadow: 0 14px 34px -10px rgba(0, 0, 0, 0.7); }
  #addBtn span { display: none; }
  #addBtn svg { width: 24px; height: 24px; }
  main { padding-bottom: calc(var(--safe-b) + 96px); }
  #toasts { bottom: calc(var(--safe-b) + 84px); }

  .lrow { grid-template-columns: 52px minmax(0, 1fr) auto; gap: 12px; padding-inline: 4px; }
  .lrow > span:nth-child(n + 4) { display: none; }
  .lhead { display: none; }

  .flow { --w: min(70vw, 42dvh); min-height: calc(100dvh - 118px - var(--safe-t)); padding-bottom: calc(var(--safe-b) + 86px); }
  .flow-scrub { width: calc(100vw - 48px); }

  dialog.sheet, dialog.sheet.small { width: 100%; max-width: 100%; max-height: 92dvh; margin: auto 0 0; border-radius: 24px 24px 0 0; border-width: 1px 0 0; padding: 22px 18px calc(var(--safe-b) + 22px); }
  dialog.sheet[open] { animation-name: slide; }
  @keyframes slide { from { transform: translateY(100%); } }
  dialog.detail { height: 100dvh; max-height: 100dvh; border-radius: 0; border: 0; padding: 0; grid-template-columns: minmax(0, 1fr); grid-auto-rows: max-content; overflow-y: auto; }
  dialog.detail[open] { display: block; }
  .d-ambient { position: fixed; }
  .d-ambient::after { background: linear-gradient(180deg, transparent 0%, var(--bg-solid) 62%); }
  .detail .close { position: fixed; top: calc(var(--safe-t) + 12px); }
  .d-stage { padding: calc(var(--safe-t) + 64px) 22px 8px; }
  .d-pack { max-width: 440px; margin: 0 auto; }
  .d-body { overflow: visible; padding: 22px 22px calc(var(--safe-b) + 32px); }
  .d-body h2 { padding-right: 0; }
  .form-actions { bottom: calc(-22px - var(--safe-b)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
