:root {
  --bg: #141210;
  --bg2: #1c1916;
  --panel: #221e1a;
  --line: #3a332c;
  --ink: #f3ece1;
  --ink2: #b9ad9c;
  --ink3: #85796a;
  --accent: #ef6a2f;
  --accent2: #ffb35c;
  --good: #7cc08a;
  --bad: #e5604f;
  --accent-ink: #1d0c03;
  --glow: #3a2416;
  --stripe1: #2a2520;
  --stripe2: #25211c;
  --stage: #2a2420;
  --r: 14px;
  --serif: "New York", ui-serif, "Iowan Old Style", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 16px; }
body { overscroll-behavior: none; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent2); }
.hidden { display: none !important; }

/* ---------- layout ---------- */
#app { display: grid; grid-template-columns: 230px 1fr; height: 100vh; height: 100dvh; }
#nav {
  background: var(--bg2); border-right: 1px solid var(--line); padding: calc(18px + var(--safe-t)) 14px 18px;
  display: flex; flex-direction: column; gap: 4px; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 20px; font-family: var(--serif); font-size: 26px; font-weight: 700; letter-spacing: -.01em; }
.brand svg { width: 34px; height: 34px; }
.navbtn {
  display: flex; align-items: center; gap: 12px; width: 100%; border: 0; background: none; padding: 11px 12px; border-radius: 11px;
  color: var(--ink2); font-size: 16px; font-weight: 550; text-align: left;
}
.navbtn svg { width: 22px; height: 22px; flex: none; }
.navbtn.on { background: var(--panel); color: var(--ink); }
.navbtn.on svg { color: var(--accent); }
.navbtn .badge { margin-left: auto; font-size: 12px; background: var(--accent); color: var(--accent-ink); border-radius: 99px; padding: 1px 8px; font-weight: 700; }
.navfoot { margin-top: auto; font-size: 12.5px; color: var(--ink3); padding: 10px 12px; line-height: 1.5; }
main { overflow-y: auto; -webkit-overflow-scrolling: touch; position: relative; }
.view { padding: calc(24px + var(--safe-t)) 28px calc(40px + var(--safe-b)); max-width: 1500px; margin: 0 auto; }

@media (max-width: 900px) {
  #app { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  #nav { order: 2; flex-direction: row; padding: 6px 6px calc(6px + var(--safe-b)); border-right: 0; border-top: 1px solid var(--line); justify-content: space-around; overflow: visible; }
  .brand, .navfoot { display: none; }
  .navbtn { flex-direction: column; gap: 3px; font-size: 11.5px; padding: 6px 4px; width: auto; flex: 1; align-items: center; }
  .navbtn .badge { position: absolute; margin: -4px 0 0 18px; font-size: 10px; padding: 0 6px; }
  .navbtn.on { background: none; }
  .view { padding-left: 18px; padding-right: 18px; }
}

/* ---------- headings & controls ---------- */
h1 { font-family: var(--serif); font-size: 40px; line-height: 1.05; margin: 0; letter-spacing: -.02em; }
h2 { font-family: var(--serif); font-size: 26px; margin: 34px 0 14px; letter-spacing: -.01em; }
h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .09em; color: var(--ink3); margin: 26px 0 10px; font-weight: 650; }
.sub { color: var(--ink2); margin-top: 6px; }
.head { display: flex; align-items: end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.head .grow { flex: 1; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; position: sticky; top: 0; z-index: 5; background: linear-gradient(var(--bg) 82%, transparent); padding: 10px 0 14px; }
.search { flex: 1 1 260px; position: relative; }
.search input { width: 100%; padding-left: 40px; }
.search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 18px; color: var(--ink3); }
input[type=text], input[type=search], input[type=password], input:not([type]), select, textarea {
  background: var(--panel); border: 1px solid var(--line); border-radius: 11px; padding: 11px 13px; outline: none; min-height: 44px;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
select { -webkit-appearance: none; appearance: none; padding-right: 32px; background-image: linear-gradient(45deg, transparent 50%, var(--ink3) 50%), linear-gradient(135deg, var(--ink3) 50%, transparent 50%); background-position: calc(100% - 17px) 19px, calc(100% - 12px) 19px; background-size: 5px 5px; background-repeat: no-repeat; }
textarea { width: 100%; min-height: 80px; resize: vertical; }
.btn { border: 1px solid var(--line); background: var(--panel); border-radius: 11px; padding: 10px 16px; min-height: 44px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn svg { width: 18px; height: 18px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.ghost { background: none; }
.btn.danger { color: var(--bad); }
.btn.small { min-height: 34px; padding: 6px 12px; font-size: 14px; }
.btn:disabled { opacity: .5; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: none; border-radius: 99px; padding: 7px 14px; font-size: 14px; color: var(--ink2); min-height: 36px; display: inline-flex; align-items: center; gap: 6px; }
.chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.dot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; border: 1px solid rgba(255,255,255,.25); flex: none; }
.pill { display: inline-flex; align-items: center; gap: 6px; background: var(--panel); border: 1px solid var(--line); border-radius: 99px; padding: 4px 11px; font-size: 13.5px; color: var(--ink2); }
.muted { color: var(--ink3); }
.empty { text-align: center; color: var(--ink2); padding: 70px 20px; }
.empty h2 { margin-top: 18px; }

/* ---------- shelf grid ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 26px 22px; }
.grid.big { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.card { background: none; border: 0; padding: 0; text-align: left; display: block; width: 100%; }
.sleeve { position: relative; aspect-ratio: 1; margin-right: 14%; }
.sleeve .disc { position: absolute; top: 4%; left: 4%; width: 92%; height: 92%; transition: transform .35s cubic-bezier(.2,.8,.2,1); transform: translateX(14%); }
.sleeve .cover { position: absolute; inset: 0; border-radius: 4px; overflow: hidden; background: var(--panel); box-shadow: 0 8px 22px rgba(0,0,0,.45), 0 1px 0 rgba(255,255,255,.06) inset; }
.sleeve .cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card:active .disc, .card:hover .disc { transform: translateX(26%) rotate(30deg); }
.card .t { margin-top: 10px; font-weight: 650; font-size: 14.5px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .a { color: var(--ink2); font-size: 13.5px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .m { color: var(--ink3); font-size: 12.5px; margin-top: 3px; display: flex; align-items: center; gap: 6px; }
.noimg { width: 100%; height: 100%; display: grid; place-items: center; font-family: var(--serif); font-size: 15px; color: var(--ink3); padding: 10px; text-align: center; background: repeating-linear-gradient(45deg, var(--stripe1) 0 8px, var(--stripe2) 8px 16px); }
.group-h { position: sticky; top: 64px; z-index: 4; background: var(--bg); padding: 8px 0; margin: 30px 0 14px; font-family: var(--serif); font-size: 24px; display: flex; align-items: baseline; gap: 12px; border-bottom: 1px solid var(--line); }
.group-h .n { font-family: var(--sans); font-size: 13px; color: var(--ink3); }

/* list view */
.list { display: flex; flex-direction: column; }
.row { display: grid; grid-template-columns: 56px 1fr auto; gap: 14px; align-items: center; padding: 9px 4px; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; width: 100%; }
.row img, .row .noimg { width: 56px; height: 56px; border-radius: 3px; object-fit: cover; }
.row .t { font-weight: 600; }
.row .a { color: var(--ink2); font-size: 14px; }
.row .r { color: var(--ink3); font-size: 13px; text-align: right; }

/* ---------- sheet (record detail) ---------- */
.scrim { position: fixed; inset: 0; background: rgba(8,6,4,.72); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); z-index: 50; display: flex; align-items: flex-end; justify-content: center; animation: fade .2s; }
.sheet { background: var(--bg2); width: min(1100px, 100%); max-height: 94vh; max-height: 94dvh; border-radius: 22px 22px 0 0; overflow-y: auto; position: relative; animation: up .32s cubic-bezier(.2,.8,.2,1); padding-bottom: var(--safe-b); }
@media (min-width: 901px) { .scrim { align-items: center; } .sheet { border-radius: 22px; max-height: 90vh; } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
.sheet .close { position: sticky; top: 12px; float: right; margin: 12px 12px 0 0; z-index: 3; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255,255,255,.1); display: grid; place-items: center; }
.sheet .close svg { width: 18px; }
.detail { display: grid; grid-template-columns: minmax(300px, 420px) 1fr; gap: 34px; padding: 34px; }
@media (max-width: 820px) { .detail { grid-template-columns: 1fr; padding: 22px; gap: 22px; } }
.hero { position: relative; }
.hero .sleeve { margin-right: 30%; }
.hero .sleeve .disc { transform: translateX(34%) rotate(0); animation: slide .9s .15s cubic-bezier(.2,.8,.2,1) both; }
@keyframes slide { from { transform: translateX(0) rotate(-40deg); } }
.hero .sleeve .disc.spin svg { animation: spin 1.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.colourline { margin-top: 18px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.artist-link { background: none; border: 0; padding: 0; color: var(--accent2); font-size: 19px; font-weight: 600; text-align: left; }
.detail h1 { font-size: 36px; margin: 4px 0 12px; }
.meta { display: flex; flex-wrap: wrap; gap: 7px; }
.section { margin-top: 26px; }
.stream { display: flex; flex-wrap: wrap; gap: 8px; }
.stream a { text-decoration: none; color: var(--ink); }
.tracks { width: 100%; border-collapse: collapse; font-size: 15px; }
.tracks td { padding: 8px 4px; border-bottom: 1px solid var(--line); }
.tracks td:first-child { color: var(--ink3); width: 46px; font-variant-numeric: tabular-nums; }
.tracks td:last-child { color: var(--ink3); text-align: right; font-variant-numeric: tabular-nums; }
.tracks tr.heading td { color: var(--accent2); font-weight: 650; border-bottom: 0; padding-top: 16px; }
.ids { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 14px; }
.ids dt { color: var(--ink3); }
.ids dd { margin: 0; font-family: ui-monospace, Menlo, monospace; font-size: 13px; word-break: break-word; }
.notes-text { color: var(--ink2); line-height: 1.6; white-space: pre-wrap; font-size: 15px; }
.stars { display: inline-flex; gap: 2px; }
.stars button { border: 0; background: none; padding: 4px; color: var(--line); }
.stars button.on { color: var(--accent2); }
.stars svg { width: 24px; height: 24px; }
.field { display: grid; gap: 6px; margin-bottom: 12px; }
.field label { font-size: 13px; color: var(--ink3); font-weight: 600; }
.yours { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; }
.yours .rowx { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.video { aspect-ratio: 16/9; width: 100%; border: 0; border-radius: 12px; background: #000; margin-top: 10px; }
.vlist { display: flex; flex-direction: column; gap: 6px; }
.vlist button { text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: flex; gap: 10px; align-items: center; }
.vlist svg { width: 18px; color: var(--accent); flex: none; }
.gallery { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; }
.gallery img { height: 120px; border-radius: 6px; flex: none; }

/* ---------- add / versions ---------- */
.scanhero { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.bigbtn { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 22px; text-align: left; display: flex; flex-direction: column; gap: 8px; min-height: 140px; position: relative; overflow: hidden; }
.bigbtn svg { width: 34px; height: 34px; color: var(--accent); }
.bigbtn b { font-size: 19px; }
.bigbtn span { color: var(--ink2); font-size: 14.5px; }
.bigbtn input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.lookup { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-top: 16px; }
.lookup form { display: flex; gap: 8px; }
.lookup input { flex: 1; min-width: 0; }
.results { display: flex; flex-direction: column; gap: 10px; }
.result { display: grid; grid-template-columns: 76px 1fr auto; gap: 16px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; text-align: left; width: 100%; }
.result img, .result .noimg { width: 76px; height: 76px; border-radius: 4px; object-fit: cover; }
.result .t { font-weight: 650; }
.result .s { color: var(--ink2); font-size: 14px; margin-top: 3px; }
.result .x { color: var(--ink3); font-size: 13px; margin-top: 3px; }
.owned { font-size: 12px; font-weight: 700; color: var(--good); border: 1px solid var(--good); border-radius: 99px; padding: 2px 8px; }
.version { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.version > button { display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; align-items: center; border: 0; background: none; text-align: left; width: 100%; padding: 12px; }
.version img, .version .noimg { width: 64px; height: 64px; border-radius: 4px; object-fit: cover; }
.version .more { border-top: 1px solid var(--line); padding: 16px; }
.version.open { border-color: var(--accent); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; align-items: center; }

/* ---------- stack ---------- */
.stack { display: flex; flex-direction: column; gap: 10px; }
.stackrow { display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; }
.stackrow img, .stackrow .noimg { width: 64px; height: 64px; border-radius: 4px; object-fit: cover; }
.stackrow.done { opacity: .55; }
.status { font-size: 12px; font-weight: 700; border-radius: 99px; padding: 3px 9px; }
.status.wait { color: var(--ink3); border: 1px solid var(--line); }
.status.match { color: var(--accent2); border: 1px solid var(--accent2); }
.status.ok { color: var(--good); border: 1px solid var(--good); }
.status.none { color: var(--bad); border: 1px solid var(--bad); }

/* ---------- today / stats ---------- */
.anniv { display: grid; grid-template-columns: 220px 1fr; gap: 28px; align-items: center; background: radial-gradient(120% 140% at 0% 0%, var(--glow) 0%, var(--panel) 60%); border: 1px solid var(--line); border-radius: 22px; padding: 26px; }
@media (max-width: 700px) { .anniv { grid-template-columns: 1fr; } }
.anniv .k { color: var(--accent2); font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .1em; }
.anniv h2 { margin: 8px 0 6px; font-size: 32px; }
.hscroll { display: grid; grid-auto-flow: column; grid-auto-columns: 150px; gap: 18px; overflow-x: auto; padding-bottom: 10px; scroll-snap-type: x mandatory; }
.hscroll > * { scroll-snap-align: start; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.stat b { font-family: var(--serif); font-size: 34px; display: block; }
.stat span { color: var(--ink3); font-size: 13px; }
.bars { display: flex; flex-direction: column; gap: 8px; }
.bar { display: grid; grid-template-columns: 140px 1fr 44px; gap: 12px; align-items: center; font-size: 14px; background: none; border: 0; text-align: left; padding: 0; }
.bar .track { height: 12px; background: var(--panel); border-radius: 99px; overflow: hidden; }
.bar .fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent2)); border-radius: 99px; }
.bar .lab { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink2); }
.bar .num { color: var(--ink3); text-align: right; font-variant-numeric: tabular-nums; }
.cols2 { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
@media (max-width: 800px) { .cols2 { grid-template-columns: 1fr; } }
.decades { display: flex; align-items: flex-end; gap: 10px; height: 170px; }
.decades .d { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; font-size: 12.5px; color: var(--ink3); }
.decades .col { width: 100%; background: linear-gradient(var(--accent2), var(--accent)); border-radius: 6px 6px 2px 2px; min-height: 3px; }

/* ---------- settings ---------- */
.card-box { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 22px; max-width: 720px; margin-bottom: 18px; }
.card-box p { color: var(--ink2); line-height: 1.55; }
.progress { height: 8px; background: var(--bg); border-radius: 99px; overflow: hidden; margin-top: 10px; }
.progress div { height: 100%; background: var(--accent); transition: width .4s; }
ol.steps { color: var(--ink2); line-height: 1.7; padding-left: 20px; }

/* ---------- toast & spinner ---------- */
#toast { position: fixed; left: 50%; bottom: calc(90px + var(--safe-b)); transform: translateX(-50%) translateY(20px); background: var(--ink); color: var(--bg); padding: 12px 20px; border-radius: 99px; font-weight: 600; opacity: 0; pointer-events: none; transition: .25s; z-index: 100; max-width: 90vw; text-align: center; }
#toast.show { opacity: 1; transform: translateX(-50%); }
#toast.err { background: var(--bad); color: #fff; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; margin: 30px auto; }
.loading { text-align: center; color: var(--ink3); padding: 30px; }

/* camera */
.cam { position: fixed; inset: 0; background: #000; z-index: 80; display: flex; flex-direction: column; }
.cam video { flex: 1; width: 100%; object-fit: cover; }
.cam .frame { position: absolute; left: 50%; top: 45%; width: min(70vw, 520px); height: 180px; transform: translate(-50%, -50%); border: 3px solid var(--accent); border-radius: 16px; box-shadow: 0 0 0 9999px rgba(0,0,0,.45); }
.cam .bar2 { padding: 16px 16px calc(16px + var(--safe-b)); display: flex; justify-content: space-between; align-items: center; background: #000; color: #fff; gap: 12px; }

/* fixes */
.search input { padding-left: 40px !important; }
.tracks tr.heading td { text-align: left; color: var(--accent2); }
@media (min-width: 821px) { .hero { position: sticky; top: 34px; align-self: start; } }
.sleeve .disc { transform: translateX(20%); }

/* ---------- crate view ---------- */
.crate { position: relative; height: calc((100dvh - 250px) / var(--zoom, 1)); min-height: 440px; overflow: hidden; border-radius: 22px; background: radial-gradient(90% 70% at 50% 38%, var(--stage) 0%, var(--bg) 75%); perspective: 1500px; perspective-origin: 50% 42%; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.crate-floor { position: absolute; left: 0; right: 0; bottom: 0; height: 38%; background: linear-gradient(transparent, rgba(0,0,0,.55)); pointer-events: none; }
.crate-stage { position: absolute; inset: 0; transform-style: preserve-3d; touch-action: none; cursor: grab; }
.crate-stage:active { cursor: grabbing; }
.crate-box { position: absolute; left: 50%; top: 40%; width: var(--W); height: var(--W); margin: calc(var(--W) / -2) 0 0 calc(var(--W) / -2); transform-style: preserve-3d; will-change: transform; }
.cb-face { position: absolute; backface-visibility: hidden; -webkit-backface-visibility: hidden; overflow: hidden; }
.cb-front { inset: 0; transform: translateZ(calc(var(--D) / 2)); border-radius: 2px; background: #1c1916; box-shadow: 0 0 0 1px rgba(255,255,255,.04) inset; }
.cb-front img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.cb-front::after { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, rgba(255,255,255,.14), transparent 35%, transparent 70%, rgba(0,0,0,.18)); pointer-events: none; }
.cb-back { inset: 0; transform: rotateY(180deg) translateZ(calc(var(--D) / 2)); background: #1a1715; }
.cb-spine { top: 0; height: 100%; width: var(--D); left: calc(50% - var(--D) / 2); background: #2a2520; color: #f3ece1; writing-mode: vertical-rl; display: flex; align-items: center; gap: 8px; padding: 12px 0; font-size: calc(var(--D) * .5); font-weight: 650; white-space: nowrap; letter-spacing: .01em; box-shadow: inset 2px 0 0 rgba(255,255,255,.08), inset -2px 0 0 rgba(0,0,0,.25); }
.cb-left { transform: rotateY(-90deg) translateZ(calc(var(--W) / 2)); }
.cb-right { transform: rotateY(90deg) translateZ(calc(var(--W) / 2)); }
.cb-spine .sp-t { opacity: .85; font-weight: 500; overflow: hidden; text-overflow: ellipsis; flex: 1; min-height: 0; }
.cb-spine .sp-dot { opacity: .6; }
.cb-spine .sp-c { opacity: .6; font-weight: 500; font-size: .85em; }
.cb-disc { position: absolute; top: 3%; left: 3%; width: 94%; height: 94%; transform: translateZ(0) translateX(calc(var(--out, 0) * 46%)) rotate(calc(var(--out, 0) * 90deg)); transition: transform .5s cubic-bezier(.2,.8,.2,1); }
.crate-box:not(.is-centre) .cb-disc { transform: translateZ(0); }
.crate-info { position: absolute; left: 0; right: 0; bottom: 58px; text-align: center; pointer-events: none; padding: 0 20px; }
.crate-letter { display: inline-block; min-width: 34px; padding: 3px 10px; border-radius: 99px; background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: 13px; margin-bottom: 10px; }
.crate-title { font-family: var(--serif); font-size: 28px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crate-sub { color: var(--ink2); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crate-scrub { position: absolute; left: 8%; right: 8%; bottom: 18px; width: 84%; accent-color: var(--accent); }
@media (max-width: 900px) { .crate { height: calc(100dvh - 330px); } }

/* ---------- themes ---------- */
[data-theme="amethyst"] { --bg:#120e18; --bg2:#17111f; --panel:#211a2c; --line:#372b48; --ink:#f0eaf8; --ink2:#b9abcc; --ink3:#82749a; --accent:#a77bff; --accent2:#d6b8ff; --accent-ink:#150a26; --glow:#33204f; --stripe1:#251d31; --stripe2:#201a2b; --stage:#2b2040; }
[data-theme="moss"] { --bg:#0c120f; --bg2:#111915; --panel:#17221c; --line:#29392f; --ink:#e7f1e9; --ink2:#a7bcae; --ink3:#6f8878; --accent:#56c98a; --accent2:#b8e6a2; --accent-ink:#05170c; --glow:#173a26; --stripe1:#1a2620; --stripe2:#16211b; --stage:#1a2e23; }
[data-theme="nightshade"] { --bg:#100c15; --bg2:#15101c; --panel:#1e1727; --line:#342a42; --ink:#eee9f5; --ink2:#b4a9c4; --ink3:#7d7290; --accent:#5fe0a0; --accent2:#c3a6ff; --accent-ink:#04170d; --glow:#2c1f45; --stripe1:#231b2d; --stripe2:#1e1727; --stage:#271d38; }
.themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.theme-pick { border: 2px solid var(--line); border-radius: 14px; padding: 0; overflow: hidden; background: none; text-align: left; }
.theme-pick.on { border-color: var(--accent); }
.theme-pick .sw { height: 64px; display: flex; align-items: flex-end; gap: 6px; padding: 10px; }
.theme-pick .sw i { width: 18px; height: 18px; border-radius: 50%; display: block; }
.theme-pick b { display: block; padding: 9px 12px; font-size: 14.5px; }
/* ---------- fonts ---------- */
:root { --zoom: 1; }
main, #nav, .sheet { zoom: var(--zoom); }
.fonts { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.font-pick { border: 2px solid var(--line); background: var(--bg); border-radius: 12px; padding: 10px 8px 8px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.font-pick span { font-size: 28px; line-height: 1.1; }
.font-pick b { font-size: 12px; font-weight: 600; color: var(--ink2); white-space: nowrap; }
.font-pick.on { border-color: var(--accent); }
.font-pick.on b { color: var(--ink); }
.font-preview { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; margin-bottom: 16px; }
.fp-h { font-family: var(--serif); font-size: 30px; font-weight: 700; letter-spacing: -.01em; }
.fp-b { color: var(--ink2); margin-top: 4px; }
