/* One family (Bricolage Grotesque), neutral surfaces, and a single accent
   (--tint) that the page borrows from whatever wallpaper is on stage. */
@font-face {
  font-family: 'Bricolage Grotesque';
  src: url('/static/fonts/Bricolage.ttf?v=1') format('truetype');
  font-weight: 200 800;
  font-stretch: 75% 100%;
  font-display: swap;
}
:root {
  --bg: #0e0e10; --bg-2: #161618; --bg-3: #1f1f23; --bg-4: #2a2a30;
  --line: rgba(255,255,255,.08); --line-2: rgba(255,255,255,.16);
  --text: #ececef; --mute: #8e8e97; --dim: #5d5d66;
  --tint: #d8c9a3; --tint-ink: #17140c; --danger: #f07070; --ok: #7fd3a1;
  --r: 8px; --r-lg: 14px;
  --head-h: 56px;
  --shadow: 0 24px 60px rgba(0,0,0,.55);
  --font: "Bricolage Grotesque", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f2f1ee; --bg-2: #ffffff; --bg-3: #e8e7e2; --bg-4: #dcdbd5;
  --line: rgba(0,0,0,.09); --line-2: rgba(0,0,0,.18);
  --text: #18181b; --mute: #63636b; --dim: #9a9aa2;
  --tint: #6d5a2e; --tint-ink: #fff; --shadow: 0 24px 60px rgba(0,0,0,.22);
  color-scheme: light;
}
:root[data-theme="black"] { --bg: #000; --bg-2: #0b0b0c; --bg-3: #141416; --bg-4: #1d1d20; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 var(--font); font-optical-sizing: auto;
       min-height: 100vh; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--tint); color: var(--tint-ink); padding: .4rem .8rem; border-radius: var(--r); z-index: 99; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--tint); outline-offset: 2px; }

/* header */
.top { position: sticky; top: 0; z-index: 30; height: var(--head-h); display: grid; grid-template-columns: auto 1fr auto; gap: 1rem; align-items: center;
       padding: 0 clamp(12px, 2.5vw, 28px); background: color-mix(in srgb, var(--bg) 84%, transparent); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: .6rem; font-weight: 600; letter-spacing: -.01em; white-space: nowrap; }

.search { display: flex; align-items: center; gap: .5rem; max-width: 640px; width: 100%; justify-self: center; height: 40px; padding: 0 .5rem 0 .9rem;
          background: var(--bg-3); border: 1px solid transparent; border-radius: 999px; color: var(--mute); }
.search-kbd { font: inherit; font-size: .7rem; color: var(--dim); border: 1px solid var(--line-2); border-radius: 4px; padding: 0 .35rem; line-height: 1.3; }
.search:focus-within .search-kbd { display: none; }
.search { position: relative; }
.suggest { position: absolute; left: 0; right: 0; top: 46px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: .35rem; z-index: 45; display: flex; flex-direction: column; }
.suggest button { display: flex; align-items: center; gap: .6rem; width: 100%; text-align: left; padding: .5rem .7rem; border: 0; border-radius: var(--r); background: transparent; color: var(--text); font-size: .9rem; }
.suggest button:hover, .suggest button:focus-visible { background: var(--bg-3); }
.suggest button small { margin-left: auto; color: var(--mute); }
.suggest img { width: 44px; height: 26px; object-fit: cover; border-radius: 4px; }
.sg-kind { font-size: .7rem; color: var(--mute); border: 1px solid var(--line-2); border-radius: 4px; padding: 0 .35rem; min-width: 46px; text-align: center; }
.search-clear { border: 0; background: var(--bg-4); color: var(--text); width: 26px; height: 26px; border-radius: 50%; font-size: .7rem; }
.search:focus-within { border-color: var(--line-2); color: var(--text); }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; color: var(--text); }
.search input::placeholder { color: var(--mute); }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.searching .hero, .searching .shelf-wrap { display: none; }
.top-actions { display: flex; align-items: center; gap: .5rem; }
.icon-btn { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 999px; border: 1px solid transparent; background: transparent; color: var(--mute); }
.icon-btn:hover { background: var(--bg-3); color: var(--text); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; height: 38px; padding: 0 1rem; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; color: var(--text); white-space: nowrap; font-weight: 500; }
.btn:hover { background: var(--bg-3); }
.btn.primary { background: var(--tint); color: var(--tint-ink); border-color: transparent; font-weight: 600; transition: background .4s; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.small { height: 32px; padding: 0 .8rem; font-size: .88rem; }
.btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.btn[disabled] { opacity: .5; cursor: default; }
.user-chip { display: flex; align-items: center; gap: .5rem; height: 38px; padding: 0 .4rem 0 .4rem; border-radius: 999px; border: 1px solid var(--line); }
.user-chip img, .user-chip .avatar-fallback { width: 28px; height: 28px; border-radius: 50%; background: var(--bg-4); display: grid; place-items: center; font-size: .75rem; font-weight: 700; color: var(--tint); }
.quota-pill { font-size: .78rem; color: var(--mute); padding-right: .4rem; }
.quota-pill b { color: var(--text); font-weight: 600; }
.menu { position: absolute; right: clamp(12px, 2.5vw, 28px); top: calc(var(--head-h) - 6px); min-width: 220px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: .4rem; z-index: 40; }
.menu a, .menu button { display: block; width: 100%; text-align: left; padding: .55rem .8rem; border-radius: var(--r); border: 0; background: transparent; }
.menu a:hover, .menu button:hover { background: var(--bg-3); }
.menu .sep { height: 1px; background: var(--line); margin: .3rem 0; }
.menu small { display: block; color: var(--mute); font-size: .78rem; }

/* announcements + ads */
.announce { display: flex; gap: .8rem; align-items: center; padding: .55rem clamp(12px, 2.5vw, 28px); font-size: .9rem; border-bottom: 1px solid var(--line); background: var(--bg-2); }
.announce .kind { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--tint); }
.announce.warn .kind { background: var(--danger); } .announce.new .kind { background: var(--ok); }
.announce strong { font-weight: 600; }
.announce span.body { color: var(--mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.announce a { color: var(--tint); margin-left: auto; white-space: nowrap; }
.announce .x { margin-left: .5rem; }
.ad { display: grid; place-items: center; color: var(--dim); font-size: .8rem; }
.ad:empty { display: none; }
.ad-top { min-height: 90px; margin: 12px clamp(12px, 2.5vw, 28px) 0; border: 1px dashed var(--line-2); border-radius: var(--r); }
.ad-top.filled, .ad-card.filled, .ad-detail.filled { border: 0; }
.ad-card { border: 1px dashed var(--line-2); border-radius: var(--r); }

main { min-height: 70vh; }

/* hero: the wallpaper itself, with the page tint taken from it */
.hero { position: relative; margin: 12px clamp(12px, 2.5vw, 28px) 0; height: clamp(300px, 52vh, 640px); border-radius: var(--r-lg); overflow: hidden; background: var(--bg-3); }
.hero:empty { display: none; }
.hero-slide { position: absolute; inset: 0; opacity: 0; transition: opacity 1s ease; }
.hero-slide.on { opacity: 1; }
.hero-slide img { width: 100%; height: 100%; object-fit: cover; }
.hero-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(0,0,0,.72) 100%); pointer-events: none; }
.hero-copy { position: absolute; left: clamp(16px, 3vw, 40px); right: 16px; bottom: clamp(16px, 3vw, 36px); display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; color: #fff; }
.hero-title { margin: 0; font-size: clamp(1.6rem, 4vw, 3rem); font-weight: 500; letter-spacing: -.02em; line-height: 1.02; max-width: 16ch; text-shadow: 0 2px 30px rgba(0,0,0,.5); }
.hero-sub { margin: .5rem 0 0; color: rgba(255,255,255,.72); font-size: .95rem; }
.hero-actions { display: flex; gap: .5rem; }
.hero-actions .btn { color: #fff; border-color: rgba(255,255,255,.35); backdrop-filter: blur(8px); }
.hero-actions .btn.primary { color: var(--tint-ink); border-color: transparent; }
.hero-dots { position: absolute; right: 18px; top: 16px; display: flex; gap: 6px; }
.hero-dots button { width: 22px; height: 4px; border-radius: 2px; border: 0; background: rgba(255,255,255,.35); padding: 0; }
.hero-dots button.on { background: #fff; }

/* theme shelf: a slider with arrows, plus a panel listing every theme */
.shelf-wrap { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: .4rem; padding: 14px clamp(12px, 2.5vw, 28px) 4px; }
.shelf { display: flex; gap: .5rem; overflow-x: auto; scroll-behavior: smooth; padding: 4px 2px; scrollbar-width: none; min-width: 0; }
.shelf-arrow { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: var(--bg-2); color: var(--text); font-size: 1.1rem; line-height: 1; }
.shelf-arrow:disabled { opacity: .3; cursor: default; }
.shelf-all { height: 34px; }
.themes-panel { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .4rem; padding: .6rem 0 .2rem; }
.themes-panel .theme-chip { height: 40px; justify-content: flex-start; }
.shelf::-webkit-scrollbar { display: none; }
.theme-chip { flex: none; display: flex; align-items: center; gap: .55rem; height: 44px; padding: 0 .9rem 0 .35rem; border-radius: 999px; border: 1px solid var(--line); background: var(--bg-2); color: var(--text); font-size: .9rem; }
.theme-chip img { width: 56px; height: 34px; object-fit: cover; border-radius: 999px; }
.theme-chip small { color: var(--mute); flex: none; }
.tc-label { white-space: nowrap; }
.themes-panel .tc-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; text-align: left; }
.theme-chip.on { border-color: var(--tint); background: color-mix(in srgb, var(--tint) 14%, var(--bg-2)); }
.theme-chip.all { padding: 0 .9rem; }

/* filters: one dropdown per facet, active choices as removable pills */
.filters { position: sticky; top: var(--head-h); z-index: 20; display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .5rem; padding: 10px clamp(12px, 2.5vw, 28px);
           background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.f-group { display: flex; align-items: center; gap: .3rem; }
.dd { position: relative; }
.dd > .chip { padding-right: .55rem; }
.dd > .chip::after { content: "▾"; margin-left: .35rem; opacity: .6; }
.dd-panel { position: absolute; left: 0; top: 36px; z-index: 30; min-width: 220px; max-width: min(90vw, 640px); background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: .5rem; display: flex; flex-wrap: wrap; gap: .3rem; }
.dd-panel.wide { min-width: 460px; }
.dd-panel .dot { width: 26px; height: 26px; }
.dd-panel .chip { height: 30px; }
.f-pills { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; }
.pill-f { display: inline-flex; align-items: center; gap: .35rem; height: 30px; padding: 0 .4rem 0 .7rem; border-radius: 999px; background: color-mix(in srgb, var(--tint) 16%, transparent); border: 1px solid color-mix(in srgb, var(--tint) 50%, transparent); color: var(--text); font-size: .84rem; }
.pill-f i { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.pill-f button { border: 0; background: transparent; color: var(--mute); width: 20px; height: 20px; border-radius: 50%; font-size: .75rem; }
.pill-f button:hover { background: var(--bg-4); color: var(--text); }
.btn-clear { height: 30px; padding: 0 .8rem; border-radius: 999px; border: 0; background: var(--danger); color: #fff; font-weight: 600; font-size: .84rem; }
.btn-clear:hover { filter: brightness(1.1); }
.chip { height: 30px; padding: 0 .75rem; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--mute); font-size: .84rem; white-space: nowrap; }
.chip:hover { color: var(--text); border-color: var(--line-2); }
.chip.on { color: var(--tint); border-color: var(--tint); background: color-mix(in srgb, var(--tint) 12%, transparent); }
.chip small { opacity: .7; margin-left: .2rem; }
.chip.surprise { color: var(--tint-ink); border-color: transparent; background: var(--tint); font-weight: 600; box-shadow: 0 0 0 3px color-mix(in srgb, var(--tint) 22%, transparent); transition: background .4s; }
.chip.surprise:hover { filter: brightness(1.08); color: var(--tint-ink); }
.dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid transparent; padding: 0; box-shadow: inset 0 0 0 1px rgba(0,0,0,.25); }
.dot.on { border-color: var(--text); transform: scale(1.12); }
.dot[disabled] { opacity: .25; cursor: default; }
.f-spacer { flex: 1; }
.select { height: 30px; padding: 0 .6rem; border-radius: 999px; border: 1px solid var(--line); background: var(--bg-2); color: var(--text); font-size: .84rem; }
.f-tags { width: 100%; display: flex; flex-wrap: wrap; gap: .3rem; padding-top: .3rem; }
.f-tags.collapsed { display: none; }
.f-summary { width: 100%; color: var(--mute); font-size: .84rem; display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }

/* justified grid */
.grid { padding: 12px clamp(12px, 2.5vw, 28px) 0; display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; gap: 8px; }
.card { position: relative; flex: none; overflow: hidden; border-radius: var(--r); background: var(--bg-3); cursor: pointer; border: 0; padding: 0; text-align: left; color: #fff; }
.card img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .35s ease; }
.card img.in { opacity: 1; }
.card .cap { position: absolute; inset: auto 0 0 0; padding: 1.4rem .7rem .55rem; display: flex; align-items: flex-end; justify-content: space-between; gap: .5rem; font-size: .82rem;
             background: linear-gradient(180deg, rgba(0,0,0,0), rgba(0,0,0,.7)); opacity: 0; transition: opacity .2s; }
.card:hover .cap, .card:focus-visible .cap { opacity: 1; }
.card .cap b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .cap span { flex: none; font-size: .72rem; color: rgba(255,255,255,.8); }
.card .res { position: absolute; top: 8px; left: 8px; font-size: .66rem; font-weight: 700; letter-spacing: .04em; padding: .15rem .4rem; border-radius: 4px; background: rgba(0,0,0,.55); color: #fff; backdrop-filter: blur(6px); }
.ad-card { flex: none; display: grid; place-items: center; }
.empty { padding: 4rem 1rem; text-align: center; color: var(--mute); }
.empty h3 { margin: 0 0 .4rem; font-weight: 500; color: var(--text); }
.sentinel { height: 1px; }
.loading { padding: 2rem; text-align: center; color: var(--mute); }

/* detail overlay */
.detail { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.86); display: grid; grid-template-columns: 1fr 360px; }
.detail-stage { position: relative; display: grid; place-items: center; padding: 20px; min-width: 0; min-height: 0;
                background: radial-gradient(120% 90% at 50% 40%, var(--stage, #141416) 0%, color-mix(in srgb, var(--stage, #141416) 55%, #000) 100%); }
.detail-stage img { display: block; width: auto; height: auto; max-width: 100%; max-height: calc(100vh - 40px); object-fit: contain;
                    border-radius: 6px; box-shadow: var(--shadow); background: var(--bg-3); }
.detail-stage.zoom { overflow: auto; place-items: start; }
.detail-stage.zoom img { max-width: none; max-height: none; cursor: zoom-out; }
.detail-close { position: absolute; top: 14px; left: 14px; z-index: 2; background: rgba(0,0,0,.5); color: #fff; border: 0; }
.detail-surprise { position: absolute; top: 14px; right: 14px; z-index: 2; background: var(--tint); color: var(--tint-ink); border: 0; font-weight: 600; box-shadow: 0 0 0 3px color-mix(in srgb, var(--tint) 22%, transparent); }
.detail-surprise:hover { filter: brightness(1.08); color: var(--tint-ink); }
.detail-nav { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(0,0,0,.5); color: #fff; border: 0; width: 42px; height: 42px; border-radius: 50%; font-size: 1.3rem; }
.detail-nav.prev { left: 14px; } .detail-nav.next { right: 14px; }
.detail-side { background: var(--bg-2); border-left: 1px solid var(--line); overflow-y: auto; padding: 22px 22px 40px; display: flex; flex-direction: column; gap: 1.1rem; }
.detail-side h2 { margin: 0; font-size: 1.45rem; font-weight: 500; letter-spacing: -.02em; line-height: 1.15; }
.detail-side .theme-link { color: var(--tint); font-size: .9rem; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: .25rem 1rem; font-size: .88rem; margin: 0; }
.facts dt { color: var(--mute); } .facts dd { margin: 0; }
.swatches { display: flex; flex-wrap: wrap; gap: .4rem; }
.swatch { display: inline-flex; align-items: center; gap: .4rem; height: 28px; padding: 0 .6rem 0 .3rem; border-radius: 999px; border: 1px solid var(--line); background: transparent; font-size: .8rem; }
.swatch i { width: 18px; height: 18px; border-radius: 50%; }
.palette { display: flex; height: 10px; border-radius: 999px; overflow: hidden; }
.palette i { display: block; height: 100%; }
.votes { display: flex; flex-wrap: wrap; gap: .5rem; }
.votes .btn.on { border-color: var(--tint); color: var(--tint); background: color-mix(in srgb, var(--tint) 12%, transparent); }
.votes .btn.on.down { border-color: var(--danger); color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent); }
.dl { display: flex; flex-direction: column; gap: .4rem; }
.dl .btn { justify-content: space-between; }
.dl .btn small { color: var(--mute); font-weight: 400; }
.dl .btn.primary small { color: var(--tint-ink); opacity: .75; }
.quota-note { font-size: .84rem; color: var(--mute); }
.quota-note b { color: var(--text); }
.quota-note.out { color: var(--danger); }
.quota { display: flex; flex-direction: column; gap: .4rem; padding: .8rem .9rem; border-radius: var(--r-lg); background: var(--bg-3); border: 1px solid var(--line); }
.quota strong { font-weight: 600; }
.quota.out { border-color: color-mix(in srgb, var(--danger) 45%, transparent); background: color-mix(in srgb, var(--danger) 10%, var(--bg-3)); }
.quota .quota-note { margin: 0; }
.quota-dots { display: flex; gap: .3rem; }
.quota-dots i { width: 22px; height: 6px; border-radius: 3px; background: var(--tint); }
.quota-dots i.used { background: var(--bg-4); }
.quota.out .quota-dots i.used { background: color-mix(in srgb, var(--danger) 50%, var(--bg-4)); }
.countdown { font-variant-numeric: tabular-nums; }
.tags { display: flex; flex-wrap: wrap; gap: .3rem; }
.tags .chip { height: 26px; font-size: .76rem; }
.related { display: grid; grid-template-columns: repeat(2, 1fr); gap: .4rem; }
.related .card { border-radius: 6px; aspect-ratio: 16/9; }
.related .card img { opacity: 1; }
.ad-detail { min-height: 250px; border: 1px dashed var(--line-2); border-radius: var(--r); }
.list-pick { position: relative; }
.list-pick .menu { position: absolute; left: 0; right: auto; top: 42px; }
.list-pick .menu label { display: flex; align-items: center; gap: .5rem; padding: .45rem .8rem; border-radius: var(--r); cursor: pointer; }
.list-pick .menu label:hover { background: var(--bg-3); }

/* modal (auth, new list) */
.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(0,0,0,.6); padding: 16px; }
.modal-box { width: min(420px, 100%); background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 24px; display: flex; flex-direction: column; gap: .9rem; }
.modal-box h2 { margin: 0; font-size: 1.3rem; font-weight: 500; letter-spacing: -.01em; }
.modal-box p { margin: 0; color: var(--mute); font-size: .9rem; }
.tabs { display: flex; gap: .3rem; border-bottom: 1px solid var(--line); }
.tabs button { background: none; border: 0; padding: .5rem .8rem; color: var(--mute); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.on { color: var(--text); border-bottom-color: var(--tint); }
.field { display: flex; flex-direction: column; gap: .3rem; font-size: .86rem; color: var(--mute); }
.field input, .field textarea, .field select { height: 40px; padding: 0 .75rem; border-radius: var(--r); border: 1px solid var(--line-2); background: var(--bg); color: var(--text); }
.field textarea { height: auto; padding: .6rem .75rem; min-height: 90px; resize: vertical; }
.field input:focus { border-color: var(--tint); outline: none; }
.check { display: flex; align-items: center; gap: .5rem; font-size: .9rem; }
.form-error { color: var(--danger); font-size: .86rem; min-height: 1.2em; }
.google-btn { background: #fff; color: #1f1f1f; border-color: transparent; }
.google-btn:hover { background: #f1f1f1; }
.or { display: flex; align-items: center; gap: .6rem; color: var(--dim); font-size: .78rem; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* generic page (lists, announcements, account) */
.page { max-width: 1100px; margin: 0 auto; padding: 28px clamp(12px, 2.5vw, 28px) 60px; display: flex; flex-direction: column; gap: 1.2rem; }
.page h1 { margin: 0; font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 500; letter-spacing: -.02em; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.page p.lead { margin: .3rem 0 0; color: var(--mute); max-width: 60ch; }
.lists-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .8rem; }
.list-card { display: flex; flex-direction: column; border-radius: var(--r-lg); overflow: hidden; background: var(--bg-2); border: 1px solid var(--line); }
.list-card .cover { aspect-ratio: 16/9; background: var(--bg-3); }
.list-card .cover img { width: 100%; height: 100%; object-fit: cover; }
.list-card .body { padding: .8rem .9rem; display: flex; justify-content: space-between; gap: .5rem; align-items: center; }
.list-card .body b { font-weight: 500; } .list-card .body small { color: var(--mute); display: block; }
.ann { padding: 1rem 1.1rem; border-radius: var(--r-lg); background: var(--bg-2); border: 1px solid var(--line); border-left: 3px solid var(--tint); }
.ann.warn { border-left-color: var(--danger); } .ann.new { border-left-color: var(--ok); }
.ann h3 { margin: 0 0 .3rem; font-weight: 500; font-size: 1.05rem; }
.ann p { margin: 0; color: var(--mute); white-space: pre-line; }
.ann time { display: block; margin-top: .5rem; font-size: .78rem; color: var(--dim); }
.stat-row { display: flex; gap: .8rem; flex-wrap: wrap; }
.stat { flex: 1 1 160px; padding: .9rem 1rem; border-radius: var(--r-lg); background: var(--bg-2); border: 1px solid var(--line); }
.stat b { display: block; font-size: 1.6rem; font-weight: 500; letter-spacing: -.02em; } .stat span { color: var(--mute); font-size: .84rem; }

.foot { display: flex; flex-wrap: wrap; gap: 1.2rem; padding: 40px clamp(12px, 2.5vw, 28px); color: var(--mute); font-size: .84rem; border-top: 1px solid var(--line); margin-top: 40px; }
.foot a:hover { color: var(--text); }
.toasts { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: .4rem; align-items: center; pointer-events: none; }
.toast { background: var(--bg-4); color: var(--text); padding: .6rem 1rem; border-radius: 999px; box-shadow: var(--shadow); font-size: .9rem; border: 1px solid var(--line-2); animation: toast .25s ease; }
.toast.err { border-color: var(--danger); }
@keyframes toast { from { opacity: 0; transform: translateY(8px); } }
body.locked { overflow: hidden; }

@media (max-width: 900px) {
  .detail { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; }
  .detail-stage { padding: 12px; min-height: 40vh; } .detail-stage img { max-height: calc(58vh - 24px); }
  .detail-side { border-left: 0; border-top: 1px solid var(--line); max-height: 42vh; padding: 16px; }
  .related { display: none; }
}
@media (max-width: 640px) {
  .top { grid-template-columns: auto 1fr auto; gap: .5rem; padding: 0 12px; }
  .brand-name { display: none; }
  .search { height: 36px; }
  .top-actions .btn { padding: 0 .8rem; }
  .user-chip { padding-right: .4rem; }
  .quota-pill { display: none; }
  .hero { height: 46vw; min-height: 220px; }
  .shelf-arrow { display: none; }
  .shelf-wrap { grid-template-columns: minmax(0, 1fr) auto; }
  .dd-panel.wide { min-width: 0; width: 90vw; }
  .hero-title { font-size: 1.5rem; }
  .f-group + .f-group::before { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* browse view: one strip per theme */
.shelf-row { display: flex; flex-direction: column; gap: .5rem; padding-top: .6rem; }
.shelf-head { display: flex; align-items: baseline; justify-content: space-between; gap: .8rem; }
.shelf-head h2 { margin: 0; font-size: 1.15rem; font-weight: 500; letter-spacing: -.01em; display: flex; gap: .5rem; align-items: baseline; }
.shelf-head h2 small { color: var(--mute); font-weight: 400; font-size: .84rem; }
.shelf-head .chip { text-decoration: none; }
.strip { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x proximity; padding-bottom: 6px; scrollbar-width: thin; }
.strip .card { height: clamp(150px, 16vw, 230px); scroll-snap-align: start; }
.strip .card img { width: auto; height: 100%; }
.ad-shelf { min-height: 120px; border: 1px dashed var(--line-2); border-radius: var(--r); margin-top: .8rem; }
.shelf-all { height: 36px; color: var(--tint); border-color: var(--tint); font-weight: 600; background: color-mix(in srgb, var(--tint) 12%, transparent); }
.shelf-all.on { background: var(--tint); color: var(--tint-ink); }
.brand-logo { width: 34px; height: 26px; color: var(--tint); transition: color .4s; }

/* server-rendered content: what crawlers and visitors without JavaScript
   see; hidden as soon as the app takes over (theme.js adds .js) */
.js .ssr { display: none; }
.ssr { max-width: 1100px; margin: 0 auto; padding: 28px clamp(12px, 2.5vw, 28px) 40px; display: flex; flex-direction: column; gap: 1rem; }
.ssr h1 { margin: 0; font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 500; letter-spacing: -.02em; }
.ssr h2 { margin: .6rem 0 0; font-size: 1.15rem; font-weight: 500; }
.ssr p { margin: 0; max-width: 70ch; }
.ssr a { color: var(--tint); }
.ssr nav ul, .ssr ul.ssr-tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem .8rem; }
.ssr-breadcrumb { color: var(--mute); font-size: .9rem; }
.ssr-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .8rem; }
.ssr-grid a { display: block; color: var(--text); }
.ssr-grid img { width: 100%; height: auto; border-radius: var(--r); background: var(--bg-3); }
.ssr-grid span { display: block; margin-top: .3rem; font-size: .88rem; color: var(--mute); }
.ssr > img { width: 100%; height: auto; max-width: 960px; border-radius: var(--r-lg); background: var(--bg-3); }
.ssr article { padding: 1rem 1.1rem; border-radius: var(--r-lg); background: var(--bg-2); border: 1px solid var(--line); }
.ssr article h2 { margin: 0 0 .3rem; }
.ssr article time { display: block; margin-top: .5rem; font-size: .78rem; color: var(--dim); }
.ssr-foot { color: var(--mute); font-size: .84rem; }

/* developer-tools deterrent (guard.js toggles the class) */
.devtools-open .detail-stage img, .devtools-open .card img { filter: blur(18px); }
.devtools-open .detail-stage::after { content: "Close developer tools to keep viewing"; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 1.1rem; background: rgba(0,0,0,.45); }

/* the console can hide popularity numbers */
.no-counts .card .cap > span, .no-counts .votes .btn span, .no-counts .facts dt:nth-of-type(3), .no-counts .facts dd:nth-of-type(3) { display: none; }

/* the download countdown window and the server-rendered pages */
.dl-wait .ad-inter { position: relative; min-height: 120px; display: grid; place-items: center; border: 1px dashed var(--line-2); border-radius: var(--r); color: var(--dim); padding: 1.6rem .8rem .8rem; }
.dl-wait .ad-inter.filled { border-style: solid; color: inherit; display: block; }
.modal-box.dl-wait { width: min(780px, 100%); padding: 28px; gap: 1rem; }
.dl-wait h2 { margin-bottom: .2rem; font-size: 1.5rem; }
.dl-wait .ad-inter { min-height: 300px; }
.dl-status { display: flex; align-items: center; gap: .9rem; padding: .7rem 1rem; border-radius: var(--r); background: color-mix(in srgb, var(--tint) 16%, transparent); color: var(--tint); font-weight: 500; font-size: 1.02rem; line-height: 1.3; }
.dl-status .dl-num { font-size: 2rem; font-weight: 600; letter-spacing: -.03em; min-width: 2.4rem; text-align: center; font-variant-numeric: tabular-nums; }
.dl-status.busy { background: var(--bg-3); color: var(--mute); }
.dl-status.done { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.dl-hint { margin: 0; color: var(--dim); font-size: .8rem; }
.dl-actions { display: flex; gap: .5rem; justify-content: flex-end; }
.dl-wait .ad-label { position: absolute; top: .3rem; left: .5rem; font-size: .68rem; letter-spacing: .04em; color: var(--dim); }
.page-static { max-width: 720px; margin: 0 auto; padding: 1rem 0 3rem; line-height: 1.6; }
.page-static h1 { font-weight: 500; font-size: 1.6rem; }
.page-static p { color: var(--text); }
