/* Midnight Grain — warm record-shop theme */
:root {
  --bg: #f6efe2;
  --paper: #fffaf1;
  --paper-2: #f9f2e4;
  --ink: #2b211a;
  --ink-2: #5b4a3c;
  --muted: #8a7a68;
  --line: #e6d8c0;
  --line-2: #d8c6a8;
  --accent: #b4532a;
  --accent-ink: #fff8ec;
  --accent-soft: #f3dccd;
  --mustard: #d9a441;
  --groove: #4a3b30;
  --ok: #4f6d2f;
  --ok-soft: #e3ebd2;
  --out: #8e2c2c;
  --out-soft: #f2d9d4;
  --hold: #a5650b;
  --hold-soft: #f7e6c6;
  --off: #6f655b;
  --off-soft: #e9e2d8;
  --shadow: 0 1px 2px rgb(60 40 20 / .06), 0 6px 18px rgb(60 40 20 / .07);
  --radius: 14px;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1f1813;
    --paper: #2a211b;
    --paper-2: #32281f;
    --ink: #f3e8d6;
    --ink-2: #d6c5ad;
    --muted: #a8977f;
    --line: #3e3228;
    --line-2: #514233;
    --accent: #e0774a;
    --accent-ink: #1f1813;
    --accent-soft: #4a2c1d;
    --groove: #6a5646;
    --ok: #a9c97c;
    --ok-soft: #2f3a22;
    --out: #ef8f84;
    --out-soft: #47241f;
    --hold: #f0b955;
    --hold-soft: #463413;
    --off: #b9ad9f;
    --off-soft: #3a322b;
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 6px 18px rgb(0 0 0 / .25);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
body { overflow-x: clip; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 var(--sans);
  min-height: 100vh;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-underline-offset: 2px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.15; margin: 0 0 .4em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.7rem, 4vw, 2.3rem); }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.08rem; }
p { margin: 0 0 1em; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ---- top bar ---- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top, 0px);
}
.topbar-inner {
  max-width: 1180px; margin: 0 auto; padding: 10px 20px;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-family: var(--serif); font-weight: 700; font-size: 1.2rem; }
.brand-disc { width: 30px; height: 30px; color: var(--ink); transition: transform .6s; }
.brand:hover .brand-disc { transform: rotate(200deg); }
.nav { display: flex; gap: 4px; margin-left: auto; align-items: center; flex-wrap: wrap; }
.nav a, .nav button.linklike {
  color: var(--ink-2); text-decoration: none; padding: 7px 12px; border-radius: 999px; font-weight: 500; font-size: .93rem;
  position: relative; display: inline-flex; align-items: center; gap: 6px;
}
.nav a:hover { background: var(--paper-2); color: var(--ink); }
.nav a.active { background: var(--ink); color: var(--bg); }
.badge-count {
  background: var(--accent); color: var(--accent-ink); border-radius: 999px; font-size: .7rem; font-weight: 700;
  min-width: 18px; height: 18px; padding: 0 5px; display: inline-flex; align-items: center; justify-content: center;
}
@media (max-width: 720px) {
  .topbar-inner { padding: 8px 16px; gap: 6px; }
  .nav {
    margin-left: 0; width: 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px;
    scroll-padding-inline: 16px; -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
  }
  .nav.at-end { -webkit-mask-image: none; mask-image: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { white-space: nowrap; padding: 6px 11px; flex: 0 0 auto; }
  .nav::after { content: ""; flex: 0 0 12px; }
}

/* ---- layout ---- */
.page { max-width: 1180px; margin: 0 auto; padding: 28px 20px 80px; outline: none; }
@media (max-width: 720px) { .page { padding: 20px 16px 64px; } }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head p { color: var(--muted); margin: 0; }
.loading { color: var(--muted); padding: 60px 0; text-align: center; font-family: var(--serif); font-size: 1.1rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.stack > * + * { margin-top: 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 18px; }
.section { margin-top: 34px; }
.section-title { display: flex; align-items: baseline; gap: 6px 10px; margin-bottom: 12px; flex-wrap: wrap; }
.section-title .check { white-space: nowrap; }
/* Keep content scrolled into view clear of the sticky top bar. */
#results, #form-area { scroll-margin-top: 76px; }
@media (max-width: 720px) { #results, #form-area { scroll-margin-top: 104px; } }
.section-title h2 { margin: 0; }

.card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
}
.card.narrow { max-width: 440px; margin: 20px auto; }
.card h2 { margin-bottom: 6px; }

.banner {
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  background: var(--hold-soft); color: var(--ink); border: 1px solid color-mix(in srgb, var(--hold) 35%, transparent);
  padding: 12px 16px; border-radius: 12px; margin-bottom: 20px;
}
.banner.info { background: var(--paper-2); border-color: var(--line); }

/* ---- buttons & forms ---- */
.btn {
  appearance: none; border: 1px solid transparent; background: var(--accent); color: var(--accent-ink);
  font: 600 .92rem/1 var(--sans); padding: 10px 16px; border-radius: 999px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; text-decoration: none; white-space: nowrap;
  transition: transform .05s, background .15s, opacity .15s;
}
.btn:hover { background: color-mix(in srgb, var(--accent) 88%, black); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.secondary { background: var(--paper); color: var(--ink); border-color: var(--line-2); }
.btn.secondary:hover { background: var(--paper-2); }
.btn.ghost { background: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--paper-2); }
.btn.danger { background: var(--out); color: #fff; }
.btn.ok { background: var(--ok); color: #fff; }
@media (prefers-color-scheme: dark) { .btn.danger, .btn.ok { color: var(--bg); } }
.btn.hold { background: var(--hold-soft); color: var(--hold); border-color: color-mix(in srgb, var(--hold) 40%, transparent); }
.btn.sm { padding: 7px 12px; font-size: .84rem; }
.btn.block { width: 100%; }
.linklike { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }

label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: 5px; color: var(--ink-2); }
.field { margin-bottom: 14px; }
.field .hint { font-weight: 400; color: var(--muted); font-size: .8rem; margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], input[type=search], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--paper);
  border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 12px;
}
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--accent) 50%, transparent); border-color: var(--accent); }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; margin: 0; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.form-error { color: var(--out); background: var(--out-soft); padding: 9px 12px; border-radius: 10px; font-size: .9rem; margin-bottom: 14px; }
.form-ok { color: var(--ok); background: var(--ok-soft); padding: 9px 12px; border-radius: 10px; font-size: .9rem; margin-bottom: 14px; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; }
.inline-form input { flex: 1 1 220px; width: auto; }

/* ---- toolbar ---- */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; align-items: center; }
.toolbar input[type=search] { flex: 1 1 240px; width: auto; }
.toolbar select { width: auto; flex: 0 0 auto; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line-2); background: var(--paper); color: var(--ink-2); padding: 6px 12px; border-radius: 999px;
  font: 500 .84rem var(--sans); cursor: pointer;
}
.chip[aria-pressed=true] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* ---- record grid ---- */
.records { display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); gap: 22px 18px; }
@media (max-width: 480px) { .records { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; } }
.rec { display: flex; flex-direction: column; min-width: 0; }
.rec-art-btn { all: unset; cursor: pointer; display: block; border-radius: 6px; }
.rec-art-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.art {
  position: relative; aspect-ratio: 1 / 1; max-width: 100%; border-radius: 6px; overflow: hidden;
  background: var(--paper-2); box-shadow: 0 1px 0 rgb(0 0 0 / .05), 0 8px 20px rgb(60 40 20 / .14);
  transition: transform .2s;
}
.rec-art-btn:hover .art { transform: translateY(-3px) rotate(-.4deg); }
.art img { width: 100%; height: 100%; object-fit: cover; }
.art .placeholder { position: absolute; inset: 0; display: grid; place-items: center; background: linear-gradient(135deg, var(--paper-2), var(--line)); }
.placeholder .disc {
  width: 72%; aspect-ratio: 1; border-radius: 50%;
  background:
    radial-gradient(circle, var(--bg) 0 3%, var(--accent) 3.5% 18%, transparent 18.5%),
    repeating-radial-gradient(circle, #2b211a 0 1.5%, #3a2e25 1.6% 2.4%);
  box-shadow: 0 4px 12px rgb(0 0 0 / .25);
}
.art .status {
  position: absolute; left: 8px; bottom: 8px;
}
.rec-body { padding: 10px 2px 0; min-width: 0; }
.rec-title { font-family: var(--serif); font-weight: 700; font-size: 1rem; line-height: 1.2; margin: 0; overflow-wrap: anywhere; }
.rec-artist { color: var(--ink-2); font-size: .9rem; margin: 2px 0 0; overflow-wrap: anywhere; }
.rec-meta { color: var(--muted); font-size: .8rem; margin: 3px 0 0; }
.rec-actions { margin-top: 8px; display: flex; gap: 6px; flex-wrap: wrap; }
.rec-note { font-size: .8rem; color: var(--muted); margin-top: 6px; }
.rec-social { font-size: .8rem; color: var(--muted); margin: 4px 0 0; }
.rec-social .liked { color: var(--accent); }
.social { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 14px; }
.social-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.social-head h3 { margin: 0; font-size: 1.05rem; }
.comments { display: flex; flex-direction: column; gap: 12px; max-height: 320px; overflow-y: auto; margin-bottom: 12px; }
.comment { display: flex; gap: 10px; align-items: flex-start; }
.comment .avatar.xs { margin-top: 2px; }
.comment-head { font-size: .88rem; }
.comment-head a { color: inherit; text-decoration: none; }
.comment-del { margin-left: 8px; color: var(--muted); }
.comment-body { margin: 2px 0 0; font-size: .92rem; white-space: pre-line; overflow-wrap: anywhere; }
.comment-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.comment-form textarea { flex: 1 1 200px; min-height: 42px; resize: vertical; }
.comment-form .form-error, .comment-attach, .gif-panel { flex-basis: 100%; }
.comment-btns { display: flex; gap: 6px; }
.comment-gif { display: block; max-height: 160px; max-width: 100%; border-radius: 8px; margin-top: 6px; background: var(--paper-2); }
.comment-attach { display: flex; align-items: flex-start; gap: 6px; }
.comment-attach[hidden] { display: none; }
.comment-attach .comment-gif { max-height: 100px; margin-top: 0; }
.gif-panel { border: 1px solid var(--line); border-radius: 10px; padding: 10px; background: var(--paper-2); }
.gif-search { width: 100%; margin-bottom: 8px; }
.gif-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; max-height: 240px; overflow-y: auto; }
.gif-pick { all: unset; cursor: pointer; border-radius: 6px; overflow: hidden; aspect-ratio: 1; background: var(--paper); }
.gif-pick img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gif-pick:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.gif-credit { margin: 8px 0 0; font-size: .72rem; color: var(--muted); text-align: right; letter-spacing: .02em; }
.flex-wall { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px 20px; margin-bottom: 24px; }
.flex-wall .section-title { margin-top: 0; align-items: center; }
.flex-move { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 8px; }
.flex-move .btn { min-width: 44px; justify-content: center; }
.flex-move .btn:disabled { opacity: .35; cursor: default; }
@media (min-width: 900px) { .flex-wall .records { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.flex-caption { font-size: .86rem; font-style: italic; color: var(--ink-2); margin: 8px 0 0; padding-left: 10px; border-left: 2px solid var(--accent); overflow-wrap: anywhere; white-space: pre-line; }

.pill {
  display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 3px 9px;
  font: 600 .74rem/1.4 var(--sans); letter-spacing: .01em; white-space: nowrap;
  background: var(--off-soft); color: var(--off);
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.art .pill { box-shadow: 0 1px 4px rgb(0 0 0 / .18); }
.pill.available { background: var(--ok-soft); color: var(--ok); }
.pill.checked_out { background: var(--out-soft); color: var(--out); }
.pill.on_hold { background: var(--hold-soft); color: var(--hold); }
.pill.not_lending { background: var(--off-soft); color: var(--off); }

.empty {
  text-align: center; padding: 48px 20px; border: 2px dashed var(--line-2); border-radius: var(--radius); color: var(--muted);
}
.empty h3 { color: var(--ink); }

/* ---- lists ---- */
.list { display: flex; flex-direction: column; gap: 10px; }
.list-item {
  display: flex; gap: 14px; align-items: center; background: var(--paper); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 14px; flex-wrap: wrap;
}
.list-item .thumb { width: 56px; flex: 0 0 56px; }
.list-item .thumb .art { border-radius: 4px; box-shadow: none; }
.list-item .grow { flex: 1 1 200px; min-width: 0; }
.list-item .title { font-weight: 600; overflow-wrap: anywhere; }
.list-item .sub { color: var(--muted); font-size: .86rem; }
.owner-lending { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; color: var(--muted); }
.owner-lending select { width: auto; padding: 4px 8px; }
.avatar {
  width: 42px; height: 42px; flex: 0 0 42px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--serif); font-weight: 700; color: var(--accent-ink); background: var(--accent);
}
img.avatar { object-fit: cover; background: var(--paper-2); }
.avatar.lg { width: 54px; height: 54px; flex-basis: 54px; font-size: 1.4rem; }
.avatar.xs { width: 22px; height: 22px; flex-basis: 22px; font-size: .7rem; }
.who { display: inline-flex; align-items: center; gap: 6px; }
.avatar-edit { display: flex; gap: 14px; align-items: center; margin: 4px 0 16px; }
#avatar-preview { flex: none; display: flex; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 8px; }
.stat { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; text-decoration: none; color: inherit; }
.stat:hover { border-color: var(--line-2); }
.stat .num { font-family: var(--serif); font-size: 1.9rem; font-weight: 700; line-height: 1; }
.stat .lbl { color: var(--muted); font-size: .84rem; margin-top: 4px; }

.notif { cursor: pointer; }
.notif.unread { border-left: 4px solid var(--accent); }
.notif .when { color: var(--muted); font-size: .8rem; white-space: nowrap; }

/* ---- search results (add record) ---- */
.results { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 10px; }
.result {
  all: unset; box-sizing: border-box; cursor: pointer; display: flex; gap: 12px; align-items: center; padding: 10px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 12px;
}
.result:hover, .result:focus-visible { border-color: var(--accent); outline: none; }
.result .thumb { width: 64px; flex: 0 0 64px; }
.result .thumb .art { box-shadow: none; border-radius: 4px; }
.result .t { font-weight: 600; overflow-wrap: anywhere; }
.result .s { color: var(--muted); font-size: .82rem; }

.record-form { display: grid; grid-template-columns: 220px 1fr; gap: 24px; }
@media (max-width: 640px) { .record-form { grid-template-columns: 1fr; } .record-form .art-col { max-width: 220px; } }

/* ---- prefs table ---- */
.table-wrap { overflow-x: auto; }
table.prefs { width: 100%; border-collapse: collapse; }
.prefs th, .prefs td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); }
.prefs th { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.prefs td.c, .prefs th.c { text-align: center; width: 80px; }
.prefs tr.group td { font-family: var(--serif); font-weight: 700; padding-top: 18px; border-bottom: 0; }

/* ---- modal ---- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgb(30 20 12 / .55); z-index: 50; display: grid; place-items: center; padding: 16px;
  animation: fade .15s;
}
.modal {
  background: var(--paper); border-radius: 18px; width: min(720px, 100%); max-height: calc(100vh - 32px); overflow: auto;
  box-shadow: 0 20px 60px rgb(0 0 0 / .35); padding: 24px; position: relative; animation: pop .18s;
}
.modal.sm { width: min(420px, 100%); }
.modal-close { position: absolute; top: 12px; right: 12px; }
.detail { display: grid; grid-template-columns: 240px 1fr; gap: 24px; }
@media (max-width: 600px) { .detail { grid-template-columns: 1fr; } .detail .art-col { max-width: 260px; } }
.detail dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 14px 0; font-size: .92rem; }
.detail dt { color: var(--muted); }
.detail dd { margin: 0; overflow-wrap: anywhere; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } }

/* ---- toasts ---- */
.toasts { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: center; width: min(460px, calc(100% - 32px)); }
.toast { background: var(--ink); color: var(--bg); padding: 11px 16px; border-radius: 12px; box-shadow: var(--shadow); font-size: .92rem; animation: pop .2s; width: 100%; }
.toast.error { background: var(--out); color: #fff; }

/* ---- landing ---- */
.hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; padding: 30px 0 10px; }
@media (max-width: 800px) { .hero { grid-template-columns: 1fr; gap: 20px; } .hero-art { max-width: 340px; margin: 0 auto; } }
.hero h1 { font-size: clamp(2.2rem, 6vw, 3.6rem); }
.hero .lede { font-size: 1.12rem; color: var(--ink-2); max-width: 34em; }
.hero-art { position: relative; aspect-ratio: 1; width: 100%; }
.hero-art .sleeve { position: absolute; inset: 13% 26% 13% 0; background: #141414 url("/hero-sleeve-pepper.jpg") center / cover no-repeat; border-radius: 6px; box-shadow: var(--shadow); }
.hero-art .vinyl {
  position: absolute; inset: 15% 0 15% 30%; border-radius: 50%;
  background: radial-gradient(circle, var(--bg) 0 2.5%, var(--mustard) 3% 17%, transparent 17.5%), repeating-radial-gradient(circle, #241b15 0 1.2%, #3a2e25 1.3% 2%);
  box-shadow: 0 10px 30px rgb(0 0 0 / .3); animation: spin 14s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .hero-art .vinyl, .brand-disc { animation: none; transition: none; } }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr)); gap: 16px; margin-top: 40px; }
.feature h3 { margin-bottom: 4px; }
.feature p { color: var(--ink-2); margin: 0; }
.nav a.btn, .nav a.btn:hover { color: var(--accent-ink); background: var(--accent); }

/* ---- album → pressing picker ---- */
.result .grow { min-width: 0; }
.result .s.strong { color: var(--ink-2); font-size: .88rem; }
.album-head { display: flex; gap: 16px; align-items: center; }
.album-head .thumb { width: 96px; flex: 0 0 96px; }
.album-head .thumb .art { border-radius: 4px; }
.album-head h2 { margin: 0 0 2px; overflow-wrap: anywhere; }
button.list-item { font: inherit; color: inherit; text-align: left; cursor: pointer; width: 100%; flex-wrap: nowrap; }
button.list-item:hover, button.list-item:focus-visible { border-color: var(--accent); outline: none; }
.versions .thumb { width: 48px; flex: 0 0 48px; }
.versions .list-item { padding: 10px 12px; }
.people .list-item { flex-wrap: nowrap; }
.people .pill { flex: 0 0 auto; }

/* ---- reputation, reviews, due dates, shaming ---- */
.stars { color: var(--mustard); letter-spacing: 1px; white-space: nowrap; }
.stars .off { color: var(--line-2); }
.overdue { color: var(--out); }
.rep { display: inline-flex; align-items: center; border-radius: 999px; padding: 2px 9px; font: 600 .74rem/1.5 var(--sans); white-space: nowrap; }
.rep-excellent { background: var(--ok-soft); color: var(--ok); }
.rep-good { background: color-mix(in srgb, var(--ok-soft) 55%, var(--paper-2)); color: var(--ok); }
.rep-fair { background: var(--hold-soft); color: var(--hold); }
.rep-poor { background: var(--out-soft); color: var(--out); }
.rep-new { background: var(--off-soft); color: var(--off); }
.rep-link { font-size: inherit; }
.rep-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.rep-card {
  display: flex; gap: 14px; align-items: center; background: var(--paper); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 14px; margin-bottom: 16px; flex-wrap: wrap;
}
.rep-card .grow { flex: 1 1 200px; min-width: 0; }
.rep-card .title { font-weight: 600; }
.rep-card .sub { color: var(--muted); font-size: .86rem; }
.rep-score { width: 64px; height: 64px; flex: 0 0 64px; border-radius: 50%; display: grid; place-content: center; text-align: center; }
.rep-score .num { font: 700 1.45rem/1 var(--serif); }
.rep-score .lbl { font-size: .66rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; margin-top: 2px; }
.review-text { margin: 6px 0 4px; white-space: pre-line; overflow-wrap: anywhere; }
.reviews .list-item { align-items: flex-start; }
/* Star picker: radios in reverse order so hovering/choosing a star lights up the ones before it. */
.star-input { border: 0; padding: 0; margin: 4px 0 2px; display: inline-flex; flex-direction: row-reverse; gap: 2px; }
.star-input input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.star-input label { font-size: 2.1rem; line-height: 1; color: var(--line-2); cursor: pointer; margin: 0; padding: 2px; transition: color .1s, transform .1s; }
.star-input label:hover, .star-input label:hover ~ label, .star-input input:checked ~ label { color: var(--mustard); }
.star-input input:focus-visible + label { outline: 2px solid var(--accent); border-radius: 6px; }
.star-input label:active { transform: scale(.9); }
#rv-count.over { color: var(--out); font-weight: 600; }
.shame-row { margin-top: 8px; }
.shame-ctl { gap: 10px; }
.shame-count { font-size: .84rem; color: var(--ink-2); }
.btn.shame { background: var(--out); color: #fff; }
@media (prefers-color-scheme: dark) { .btn.shame { color: var(--bg); } }

/* ---- lending schedule ---- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
fieldset.days-pick, fieldset.owners-pick { border: 0; padding: 0; margin: 0 0 14px; }
.days-pick legend, .owners-pick legend { font-weight: 600; font-size: .88rem; margin-bottom: 6px; color: var(--ink-2); padding: 0; }
.chip-check { margin: 0; cursor: pointer; }
.chip-check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip-check span {
  display: inline-block; border: 1px solid var(--line-2); background: var(--paper); color: var(--ink-2);
  padding: 7px 13px; border-radius: 999px; font: 500 .86rem var(--sans); min-width: 48px; text-align: center;
}
.chip-check input:checked + span { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip-check input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---- phones ---- */
@media (max-width: 720px) {
  /* 16px stops iOS Safari from zooming in when a field is tapped. */
  input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], input[type=search], select, textarea { font-size: 16px; }
}
@media (max-width: 560px) {
  /* Search/inline forms: full-width field, buttons on the next line. */
  .inline-form input { flex-basis: 100%; }
  .inline-form .btn { flex: 1 1 auto; }
  .page-head { align-items: flex-start; }
  /* Loans counters: keep all three on one row. */
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .stat { padding: 12px; }
  .stat .num { font-size: 1.6rem; }
  .stat .lbl { font-size: .78rem; }
  /* Notification settings table: more room for the descriptions. */
  .prefs th, .prefs td { padding: 9px 4px; }
  .prefs td.c, .prefs th.c { width: 58px; }
  .prefs th { font-size: .72rem; }
  .card { padding: 16px; }
  .modal { padding: 20px 16px; border-radius: 16px; }
  .hero { padding-top: 10px; }
  .hero-art { max-width: 270px; }
  .album-head .thumb { width: 72px; flex-basis: 72px; }
  .people .list-item { gap: 10px; padding: 10px 12px; }
  .people .list-item .grow { flex-basis: 0; }
  .hero .row .btn { flex: 1 1 auto; }
}

/* ---- collection tabs + badges ---- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 0 0 20px; }
.tab { appearance: none; background: none; border: 0; border-bottom: 3px solid transparent; margin-bottom: -1px; padding: 10px 14px; font-family: inherit; font-size: .98rem; font-weight: 600; line-height: 1; color: var(--muted); cursor: pointer; }
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; margin-bottom: 24px; }
.badge-card { display: flex; gap: 14px; align-items: center; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 14px; min-width: 0; }
.badge-art { width: 76px; height: 76px; flex: 0 0 76px; filter: drop-shadow(0 3px 6px rgb(0 0 0 / .18)); }
.badge-info { min-width: 0; }
.badge-info h3 { margin: 0; font-size: 1.05rem; }
.badge-how { margin: 2px 0 0; font-size: .86rem; color: var(--ink-2); }
.badge-date { margin: 4px 0 0; font-size: .8rem; color: var(--muted); }
.badge-detail { margin: 4px 0 0; font-size: .84rem; overflow-wrap: anywhere; }
@media (max-width: 480px) { .badge-grid { grid-template-columns: 1fr; } }

/* ---- record owners ---- */
.owner-list { margin-bottom: 12px; }
.owner-list .list-item { align-items: center; flex-wrap: nowrap; }
.owners-pick .chips { flex-wrap: wrap; }
.inline-form .form-error { flex-basis: 100%; }

/* Group headings in the record grid (sort by format or genre) */
.grid-group { grid-column: 1 / -1; margin: 10px 0 -6px; font-size: 1.05rem; display: flex; align-items: baseline; gap: 8px; }
.grid-group:first-child { margin-top: 0; }
.toolbar select#genre { max-width: 220px; }

/* ---- Staff Pick sticker (on the cover's top-right corner) ---- */
.pick-sticker {
  position: absolute; top: 8px; right: 8px; z-index: 1; width: 54px; height: 54px; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  background: radial-gradient(circle at 35% 30%, #ffe08a, #f2b632 70%); color: #4a2a08;
  font: 800 .56rem/1.05 var(--sans); letter-spacing: .06em; text-transform: uppercase;
  border: 2px dashed rgb(74 42 8 / .35); box-shadow: 0 3px 8px rgb(0 0 0 / .28); transform: rotate(12deg); pointer-events: none;
}
.pick-sticker span { font-size: .95rem; line-height: 1; margin-bottom: 1px; }
.detail .art-col .pick-sticker { width: 72px; height: 72px; font-size: .7rem; top: 10px; right: 10px; }
.detail .art-col .pick-sticker span { font-size: 1.2rem; }
@media (max-width: 480px) { .records .pick-sticker { width: 46px; height: 46px; font-size: .5rem; top: 6px; right: 6px; } }

/* Crowns: one holder site-wide */
.badge-card.crown { border-color: #b98ae0; background: linear-gradient(135deg, var(--paper), color-mix(in srgb, #c58cff 10%, var(--paper))); }
.badge-value { margin: 4px 0 0; font-size: .9rem; font-weight: 700; color: var(--ink); }

/* ---- albums with several formats (record popup) ---- */
.formats { margin: 4px 0 14px; display: flex; flex-direction: column; gap: 8px; }
.formats h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0; }
.fmt-row { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.fmt-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fmt-head .title { font-weight: 600; }
.fmt-row .sub { font-size: .84rem; color: var(--muted); overflow-wrap: anywhere; }
.fmt-row .rec-actions { margin-top: 2px; }
.add-as { border: 0; padding: 0; margin: 0 0 12px; display: flex; flex-direction: column; gap: 6px; }
.extra-formats { display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px; }
.extra-format { margin: 0; }
.extra-format legend { float: left; padding: 0; }
.extra-format .field { margin-bottom: 8px; }
input:disabled, select:disabled, textarea:disabled { opacity: .55; cursor: not-allowed; }
