/* ============================================================
   discs.fyi — Awwwards-inspired redesign
   Loaded LAST so it layers over styles.css + cartoon.css.

   Language: clean white/grey contrast, a grotesk display face for
   big lettering, Inter for UI text, hairline rules and crisp line
   icons. Monochrome, generous whitespace, almost no shadow.
   ============================================================ */

:root {
  --aw-display: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  --aw-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --aw-paper: #f1f1ef;   /* page — soft warm grey */
  --aw-surface: #ffffff; /* cards / panels */
  --aw-ink: #0e0e0e;     /* near-black text + accents */
  --aw-ink-2: #707070;   /* muted text */
  --aw-ink-3: #a8a8a4;   /* faint text */
  --aw-line: #e3e3df;    /* hairline borders */
  --aw-line-2: #d3d3cd;  /* slightly stronger borders */
  --aw-danger: #c4362f;  /* destructive accent */
  --aw-radius: 14px;
}

/* ============================================================
   Base + shared chrome
   ============================================================ */
body {
  font-family: var(--aw-sans);
  background: var(--aw-paper);
  color: var(--aw-ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.main { max-width: 1180px; }

/* Every page title gets the big grotesk treatment by default. Matches
   cartoon.css `.main h1` specificity (0,1,1) and wins by load order. */
.main h1 {
  font-family: var(--aw-display);
  font-weight: 700;
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
  color: var(--aw-ink);
  text-wrap: balance;
}

.main h2 {
  font-family: var(--aw-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--aw-ink);
}

.main p { color: var(--aw-ink); }

.site-header {
  /* no backdrop-filter here: it would make the fixed search overlay a
     containing block and trap it inside the header */
  background: rgba(241, 241, 239, 0.94);
  border-bottom: 1px solid var(--aw-line);
  position: sticky;
  top: 0;
  z-index: 20;
}

.site-header .logo-img { height: 36px; }

.site-header .logo-text {
  font-family: var(--aw-display);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.03em;
  text-transform: none;
  color: var(--aw-ink);
}

.nav-links { gap: 1.75rem; }
.nav-links span { color: var(--aw-ink-2); font-size: 0.9rem; }

.nav-links a {
  color: var(--aw-ink);
  font-size: 0.9rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  text-decoration: none;
}

.nav-links a:hover { color: var(--aw-ink-2); }

/* nav links are text on desktop; icons hidden until mobile */
.nav-link { display: inline-flex; align-items: center; gap: 0.4rem; }
.nav-links .nav-link .aw-ico { display: none; }

/* ---- Header user menu — far-right account dropdown ---- */
.user-menu { position: relative; display: inline-flex; }

.user-menu-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  padding: 0;
  border-radius: 100px;
  border: 1px solid var(--aw-line-2);
  background: var(--aw-surface);
  color: var(--aw-ink);
  cursor: pointer;
  transition: border-color 120ms ease;
}
.user-menu-trigger:hover,
.user-menu-trigger.is-open { border-color: var(--aw-ink); }
.user-menu-trigger .aw-ico { width: 1.1rem; height: 1.1rem; color: var(--aw-ink-2); }

.user-menu-panel {
  position: absolute;
  top: calc(100% + 0.45rem);
  right: 0;
  min-width: 12rem;
  background: var(--aw-bg, #fff);
  border: 1px solid var(--aw-line-2);
  border-radius: 0.6rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  padding: 0.3rem;
  z-index: 25;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.user-menu-id {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.5rem 0.7rem;
  margin-bottom: 0.2rem;
  border-bottom: 1px solid var(--aw-line);
}
.user-menu-id-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--aw-ink-3);
}
.user-menu-id-name {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--aw-ink);
  word-break: break-word;
}

.user-menu-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 0.7rem;
  border-radius: 0.4rem;
  color: var(--aw-ink);
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
}
.user-menu-item:hover { background: var(--aw-surface); color: var(--aw-ink); }
.user-menu-item .aw-ico { width: 1.05rem; height: 1.05rem; color: var(--aw-ink-2); }

/* Scan/Collections live in the bar on desktop, so hide their menu duplicates. */
.user-menu-collapse { display: none; }

/* ============================================================
   Site footer — sparse split row, hairline rule, monochrome
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--aw-line);
  margin-top: clamp(3rem, 6vw, 5rem);
  background: var(--aw-paper);
}

.site-footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(1.75rem, 4vw, 2.75rem) clamp(1rem, 2.5vw, 2rem);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}

.site-footer-brand {
  font-family: var(--aw-display);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.03em;
  color: var(--aw-ink);
}

.site-footer-meta {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  max-width: 36ch;
  text-align: right;
  align-items: flex-end;
}

.site-footer-eyebrow {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--aw-ink-2);
}

.site-footer-attribution {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--aw-ink-3);
}

@media (max-width: 600px) {
  .site-footer-meta {
    text-align: left;
    align-items: flex-start;
    max-width: none;
  }
}

/* ============================================================
   Header search — pill that morphs into a full-screen panel
   ============================================================ */
.hsearch {
  flex: 1 1 auto;
  display: flex;
  justify-content: center;
  min-width: 0;
  padding: 0 1.5rem;
}

.hsearch-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  max-width: 440px;
  padding: 0.55rem 1rem;
  border: 1px solid var(--aw-line-2);
  border-radius: 100px;
  background: var(--aw-surface);
  font-family: var(--aw-sans);
  font-size: 0.9rem;
  cursor: text;
  text-align: left;
  view-transition-name: hsearch;
}
.hsearch-trigger:hover { border-color: var(--aw-ink); }
.hsearch-trigger .aw-ico { width: 1.05rem; height: 1.05rem; color: var(--aw-ink-2); }
.hsearch-trigger-label { color: var(--aw-ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Overlay */
.search-overlay { position: fixed; inset: 0; z-index: 60; }
.search-overlay[hidden] { display: none; }

/* Confirmation dialog (see Dialog in ui.ts). Visibility is toggled inline by the
   view via display:none, so no [hidden] rule is needed here. */
.aw-dialog {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.aw-dialog-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(18, 18, 18, 0.3);
  backdrop-filter: blur(8px) saturate(120%);
}

.aw-dialog-panel {
  position: relative;
  width: 100%;
  max-width: 26rem;
  background: var(--aw-surface);
  border: 1px solid var(--aw-line);
  border-radius: var(--aw-radius);
  box-shadow: 0 30px 70px -30px rgba(0, 0, 0, 0.45);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.aw-dialog-title {
  font-family: var(--aw-display);
  font-size: 1.3rem;
  line-height: 1.2;
  color: var(--aw-ink);
  margin: 0;
}

.aw-dialog-body { color: var(--aw-ink-2); font-size: 0.95rem; line-height: 1.5; }
.aw-dialog-body p { margin: 0; }

.aw-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 0.4rem;
}

.search-overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(18, 18, 18, 0.3);
  backdrop-filter: blur(8px) saturate(120%);
}

.search-overlay-panel {
  position: relative;
  /* inset from the viewport edges so the blurred page shows around the sheet;
     wider gap on the sides than top */
  margin: 0.6rem 1.5rem;
  background: var(--aw-surface);
  border-radius: 22px;
  box-shadow: 0 30px 70px -30px rgba(0, 0, 0, 0.45);
  padding: 0.85rem clamp(1rem, 4vw, 2.25rem) clamp(1.75rem, 3vw, 2.5rem);
  /* name the whole sheet so it morphs out of the header pill (not just the
     input row), making the entire box appear to expand from the header */
  view-transition-name: hsearch;
}

.search-overlay-bar {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.8rem 0.4rem;
  border-bottom: 1px solid var(--aw-line);
}
.search-overlay-bar > .aw-ico { width: 1.4rem; height: 1.4rem; color: var(--aw-ink-2); flex: 0 0 auto; }

.search-overlay-input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--aw-display);
  font-weight: 500;
  font-size: clamp(1.25rem, 3vw, 1.9rem);
  letter-spacing: -0.02em;
  color: var(--aw-ink);
}
.search-overlay-input::placeholder { color: var(--aw-ink-3); }

.search-overlay-esc {
  flex: 0 0 auto;
  border: 1px solid var(--aw-line-2);
  background: transparent;
  border-radius: 8px;
  padding: 0.35rem 0.6rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--aw-ink-2);
  cursor: pointer;
}
.search-overlay-esc:hover { border-color: var(--aw-ink); color: var(--aw-ink); }

.search-overlay-body {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: clamp(1.25rem, 4vw, 3.5rem);
  padding-top: 1.5rem;
  max-width: 1100px;
}

.search-overlay-coltitle {
  display: block;
  margin-bottom: 0.6rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--aw-ink-3);
}

.search-overlay-nav {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.6rem 0.6rem;
  margin: 0 -0.6rem;
  border-radius: 10px;
  text-decoration: none;
  color: var(--aw-ink);
  font-weight: 500;
}
.search-overlay-nav:hover { background: #f2f2ef; }
.search-overlay-nav .aw-ico { width: 1.1rem; height: 1.1rem; color: var(--aw-ink-2); }

.search-overlay-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 0.25rem;
  border-bottom: 1px solid var(--aw-line);
  text-decoration: none;
  color: var(--aw-ink);
  font-size: 0.98rem;
}
.search-overlay-row:hover { color: var(--aw-ink-2); }
.search-overlay-row .aw-ico { width: 1rem; height: 1rem; color: var(--aw-ink-3); }
.search-overlay-row:hover .aw-ico { color: var(--aw-ink); transform: translate(2px, -2px); transition: transform 0.15s ease; }

/* Recent searches: a row carries the query link plus an inline remove (✕) form,
   so the row (not the link) owns the layout/border that .search-overlay-row does. */
.search-recent-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid var(--aw-line);
}
.search-recent-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex: 1;
  min-width: 0;
  padding: 0.65rem 0.25rem;
  text-decoration: none;
  color: var(--aw-ink);
  font-size: 0.98rem;
}
.search-recent-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-recent-link:hover { color: var(--aw-ink-2); }
.search-recent-link .aw-ico { width: 1rem; height: 1rem; color: var(--aw-ink-3); }
.search-recent-link:hover .aw-ico { color: var(--aw-ink); transform: translate(2px, -2px); transition: transform 0.15s ease; }
.search-recent-remove-form { display: flex; }
.search-recent-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  padding: 0;
  border: none;
  background: none;
  border-radius: 8px;
  color: var(--aw-ink-3);
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
}
.search-recent-remove:hover { background: #f2f2ef; color: var(--aw-ink); }
.search-recent-clearform { margin-top: 0.85rem; }
.search-recent-clear {
  padding: 0;
  border: none;
  background: none;
  color: var(--aw-ink-3);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  cursor: pointer;
}
.search-recent-clear:hover { color: var(--aw-ink); }

html.search-open { overflow: hidden; }

/* The pill ↔ bar morph (shared view-transition-name: hsearch) */
::view-transition-group(hsearch) {
  animation-duration: 0.26s;
  animation-timing-function: cubic-bezier(0.2, 0.7, 0.2, 1);
}
/* keep the cross-fade of the morph contents in step with the group */
::view-transition-old(hsearch),
::view-transition-new(hsearch) {
  animation-duration: 0.26s;
}

@media (max-width: 760px) {
  .nav { padding: 0 1rem; }
  .hsearch { padding: 0 0.85rem; }
  .hsearch-trigger { max-width: none; }
  .search-overlay-body { grid-template-columns: 1fr; gap: 1.5rem; }

  /* free up space: swap remaining nav text for icons, fold Scan/Collections
     into the user menu (only Spin stays as a bar link). */
  .nav-links { gap: 1.5rem; }
  .nav-links .nav-link-collapse { display: none; }
  .nav-links .nav-link { padding: 0.3rem 0; }
  .nav-links .nav-link .nav-label { display: none; }
  .nav-links .nav-link .aw-ico { display: inline-block; width: 1.3rem; height: 1.3rem; }
  .user-menu-collapse { display: flex; }
}

@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(hsearch),
  ::view-transition-old(hsearch),
  ::view-transition-new(hsearch) { animation: none; }
}

/* ============================================================
   Buttons (shared — legacy .btn-* + new .aw-btn)
   ============================================================ */
.aw-btn,
.btn-primary,
.btn-secondary,
.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.2rem;
  border-radius: 100px;
  border: 1px solid transparent;
  font-family: var(--aw-sans);
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  box-shadow: none;
  letter-spacing: 0;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.aw-btn .aw-ico { width: 1.05rem; height: 1.05rem; }

.aw-btn-primary,
.btn-primary {
  background: var(--aw-ink);
  color: #fff;
  border-color: var(--aw-ink);
}
.aw-btn-primary:hover,
.btn-primary:hover { background: #2a2a2a; border-color: #2a2a2a; transform: translateY(-1px); }

.aw-btn-ghost,
.btn-secondary {
  background: transparent;
  color: var(--aw-ink);
  border-color: var(--aw-line-2);
}
.aw-btn-ghost:hover,
.btn-secondary:hover { border-color: var(--aw-ink); background: rgba(0, 0, 0, 0.03); color: var(--aw-ink); }

.aw-btn-danger,
.btn-danger {
  background: transparent;
  color: var(--aw-danger);
  border-color: color-mix(in srgb, var(--aw-danger) 45%, transparent);
}
.aw-btn-danger:hover,
.btn-danger:hover { background: var(--aw-danger); color: #fff; border-color: var(--aw-danger); }

/* ============================================================
   Page header pattern (eyebrow + big title + actions)
   ============================================================ */
.aw-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--aw-ink-2);
}
.aw-eyebrow .aw-ico { width: 1rem; height: 1rem; }

.aw-page-head {
  display: block;
  padding: clamp(1.25rem, 4vw, 3rem) 0 clamp(1.5rem, 3vw, 2.25rem);
  border-bottom: 1px solid var(--aw-line);
  margin-bottom: clamp(1.75rem, 4vw, 3rem);
}

.aw-page-head-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: clamp(1rem, 3vw, 2rem);
}

.aw-page-head-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; }

.main .aw-page-title {
  margin: 0;
  font-size: clamp(2.4rem, 7vw, 5rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
}

.aw-page-desc {
  margin: 1.1rem 0 0;
  max-width: 46ch;
  font-size: clamp(1rem, 1.3vw, 1.15rem);
  line-height: 1.5;
  color: var(--aw-ink-2);
}

/* ============================================================
   Collection page
   ============================================================ */
.aw-collection { --gutter: clamp(1.25rem, 4vw, 3rem); }

.aw-hero {
  padding: clamp(1.5rem, 5vw, 4rem) 0 clamp(1.75rem, 4vw, 3rem);
  border-bottom: 1px solid var(--aw-line);
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
}

.aw-hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: clamp(1.25rem, 4vw, 2.5rem);
}

/* `.aw-collection` prefix lifts specificity above cartoon.css `.main h1`. */
.aw-collection .aw-hero-title {
  margin: 0;
  font-family: var(--aw-display);
  font-weight: 700;
  font-size: clamp(2.75rem, 9vw, 7rem);
  line-height: 0.92;
  letter-spacing: -0.04em;
  color: var(--aw-ink);
  text-wrap: balance;
}

.aw-hero-desc {
  margin: 1.25rem 0 0;
  max-width: 42ch;
  font-size: clamp(1rem, 1.4vw, 1.2rem);
  line-height: 1.5;
  color: var(--aw-ink-2);
}

.aw-hero-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; }

.aw-stats {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(1.5rem, 5vw, 3.5rem);
  margin-top: clamp(1.75rem, 4vw, 2.75rem);
}

.aw-stat { display: flex; flex-direction: column; gap: 0.15rem; }

.aw-stat-num {
  font-family: var(--aw-display);
  font-weight: 500;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--aw-ink);
  font-variant-numeric: tabular-nums;
}

.aw-stat-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--aw-ink-3);
}

.aw-section { margin-bottom: clamp(2.5rem, 6vw, 4.5rem); }

.aw-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1rem;
  margin-bottom: 1.75rem;
  border-bottom: 1px solid var(--aw-line);
}

.aw-section-headline { display: flex; align-items: baseline; gap: 0.85rem; }

.aw-section-index {
  font-family: var(--aw-display);
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--aw-ink-3);
  font-variant-numeric: tabular-nums;
}

.aw-section-title {
  margin: 0;
  font-family: var(--aw-display);
  font-weight: 600;
  font-size: clamp(1.5rem, 3.5vw, 2.5rem);
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--aw-ink);
}

.aw-section-count {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--aw-ink-3);
  white-space: nowrap;
}

/* ============================================================
   Pager (numbered pages, range, prev/next)
   Same hairline / grotesk vibe as section heads.
   ============================================================ */
.aw-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding-top: 1rem;
  margin: -1rem 0 clamp(2.5rem, 6vw, 4.5rem);
  border-top: 1px solid var(--aw-line);
}

.aw-pager-pages {
  display: flex;
  align-items: baseline;
  gap: 0.85rem;
  font-family: var(--aw-display);
  font-variant-numeric: tabular-nums;
  font-size: 0.95rem;
}

.aw-pager-page {
  color: var(--aw-ink-3);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s ease;
}
.aw-pager-page:hover { color: var(--aw-ink); }
.aw-pager-page.is-current { color: var(--aw-ink); font-weight: 600; }

.aw-pager-gap { color: var(--aw-ink-3); }

.aw-pager-meta {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.aw-pager-range {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--aw-ink-3);
  white-space: nowrap;
}

.aw-pager-controls { display: flex; gap: 0.5rem; }

.aw-pager-nav {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.95rem;
  border-radius: 100px;
  border: 1px solid var(--aw-line-2);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--aw-ink);
  text-decoration: none;
  background: transparent;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.aw-pager-nav:hover { border-color: var(--aw-ink); background: rgba(0, 0, 0, 0.03); }
.aw-pager-nav .aw-ico { width: 0.95rem; height: 0.95rem; }

/* ============================================================
   Poster grids + cards (collection .aw-card, search/box .movie-card)
   ============================================================ */
.aw-grid,
.main .movie-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: clamp(1rem, 2vw, 1.75rem);
  list-style: none;
  margin: 0;
  padding: 0;
}

.aw-card-link,
.movie-card a {
  display: block;
  text-decoration: none;
  color: inherit;
}

/* Shared poster frame */
.aw-card-media,
.movie-poster,
.movie-poster-placeholder {
  position: relative;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border-radius: var(--aw-radius);
  background: var(--aw-surface);
  border: 1px solid var(--aw-line);
  box-shadow: none;
  filter: none;
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.aw-card-link:hover .aw-card-media,
.movie-card a:hover .movie-poster {
  border-color: var(--aw-line-2);
  transform: translateY(-4px);
  box-shadow: 0 18px 40px -22px rgba(0, 0, 0, 0.45);
  opacity: 1;
}

.aw-card-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.aw-card-link:hover .aw-card-img { transform: scale(1.04); }

.movie-poster-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--aw-ink-3);
  font-family: var(--aw-display);
}

.aw-card-blank {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1rem;
  font-family: var(--aw-display);
  font-weight: 500;
  font-size: 1rem;
  line-height: 1.2;
  color: var(--aw-ink-3);
  background: radial-gradient(120% 120% at 50% 0%, #fafafa 0%, #eeeeea 100%);
}

.aw-card.is-wishlist .aw-card-media { border-style: dashed; }
.aw-card.is-wishlist .aw-card-img { opacity: 0.9; }

/* Format pills overlaid on the poster — one per release. The wrapper sits
   absolutely so cards keep a uniform poster aspect; pills wrap if a title
   ends up with more formats than fit on one row. */
.aw-card-formats {
  position: absolute;
  top: 0.6rem;
  left: 0.6rem;
  right: 0.6rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.aw-card-format {
  padding: 0.25rem 0.55rem;
  border-radius: 100px;
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--aw-ink);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.6);
}

.aw-card-format.is-wishlist {
  background: rgba(255, 255, 255, 0.4);
  border-style: dashed;
  color: var(--aw-ink-2);
}

.aw-card-go {
  position: absolute;
  bottom: 0.6rem;
  right: 0.6rem;
  width: 2.2rem;
  height: 2.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 100px;
  background: var(--aw-ink);
  color: #fff;
  opacity: 0;
  transform: translateY(6px) scale(0.9);
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.aw-card-go .aw-ico { width: 1.1rem; height: 1.1rem; }
.aw-card-link:hover .aw-card-go { opacity: 1; transform: translateY(0) scale(1); }

.aw-card-info,
.movie-info { padding: 0.75rem 0.1rem 0; }

.aw-card-title,
.movie-title {
  display: block;
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1.25;
  color: var(--aw-ink);
}

.aw-card-meta,
.movie-year {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.8rem;
  color: var(--aw-ink-2);
  font-variant-numeric: tabular-nums;
}

.aw-card-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.55rem; }

.aw-tag,
.media-type-badge {
  display: inline-block;
  margin-top: 0.45rem;
  padding: 0.12rem 0.5rem;
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--aw-ink-2);
  background: #ededea;
  border-radius: 100px;
}
.aw-tag { margin-top: 0; }

.aw-tag-shelf {
  color: var(--shelf, var(--aw-ink));
  background: color-mix(in srgb, var(--shelf, #888) 14%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--shelf, #888) 35%, transparent);
}

/* Wishlist chip — used on grouped cards where some releases are owned and
   some are wished-for. Dashed border + transparent bg distinguishes the gap
   without changing the chip size. */
.aw-tag.is-wishlist {
  background: transparent;
  color: var(--aw-ink-3);
  box-shadow: inset 0 0 0 1px var(--aw-line-2);
  border: 1px dashed var(--aw-line-2);
  padding: calc(0.12rem - 1px) calc(0.5rem - 1px);
}

/* ============================================================
   Detail pages (movie / tv / box-set)
   ============================================================ */
/* Temporary "Back to search results" link at the top of a detail page reached
   from search (issue #10). */
.main .movie-page .detail-back {
  margin-bottom: clamp(1rem, 3vw, 1.75rem);
}

.main .movie-page .movie-header {
  grid-template-columns: clamp(220px, 28vw, 320px) 1fr;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: start;
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
}

.movie-poster-large,
.movie-poster-large-placeholder {
  border-radius: var(--aw-radius);
  border: 1px solid var(--aw-line);
  box-shadow: 0 24px 50px -30px rgba(0, 0, 0, 0.5);
  filter: none;
}

.movie-poster-large-placeholder {
  background: var(--aw-surface);
  color: var(--aw-ink-3);
  font-family: var(--aw-display);
}

.movie-details h1 { margin-top: 0; }

.movie-details .original-title,
.movie-details .runtime,
.movie-details .rating {
  color: var(--aw-ink-2);
  font-size: 0.9rem;
  margin: 0.25rem 0;
}
.movie-details .rating { font-weight: 600; color: var(--aw-ink); }

.movie-details .overview {
  color: var(--aw-ink);
  line-height: 1.65;
  max-width: 60ch;
  margin: 1.25rem 0 1.75rem;
}

.movie-details .genres {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.75rem 0 0.25rem;
}

.genre-pill {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  border-radius: 100px;
  border: 1px solid var(--aw-line-2);
  background: var(--aw-surface);
  color: var(--aw-ink-2);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* Owned-release pills on the detail page */
.owned-releases { margin: 0 0 1.5rem; }

.owned-label {
  display: block;
  margin-bottom: 0.6rem;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--aw-ink-3);
}

.owned-pills { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.owned-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.8rem;
  border-radius: 100px;
  border: 1px solid var(--aw-line-2);
  background: var(--aw-surface);
  color: var(--aw-ink);
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.owned-pill:hover { border-color: var(--aw-ink); transform: translateY(-1px); }
.owned-pill .aw-ico { width: 1rem; height: 1rem; color: var(--aw-ink-2); }

.owned-pill-edition {
  padding-left: 0.5rem;
  margin-left: 0.05rem;
  border-left: 1px solid var(--aw-line);
  color: var(--aw-ink-2);
  font-size: 0.78rem;
}

.owned-pill-shelf {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding-left: 0.5rem;
  margin-left: 0.05rem;
  border-left: 1px solid var(--aw-line);
  color: var(--aw-ink-2);
  font-size: 0.78rem;
}

.owned-pill-shelf-dot {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  flex: 0 0 auto;
  border: 1px solid rgba(0, 0, 0, 0.12);
}

.owned-pill.is-wishlist {
  border-style: dashed;
  color: var(--aw-ink-2);
}
.owned-pill.is-wishlist .aw-ico { color: var(--aw-ink-3); }

/* Seasons (tv) */
.main .tv-series-page .season-list {
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: clamp(1rem, 2vw, 1.5rem);
}

.season-card {
  background: var(--aw-surface);
  border: 1px solid var(--aw-line);
  border-radius: var(--aw-radius);
  box-shadow: none;
  padding: 0.85rem;
  gap: 0.65rem;
  transition: border-color 0.18s ease, transform 0.18s ease;
}
.season-card:hover { border-color: var(--aw-line-2); transform: translateY(-3px); }

.season-poster,
.season-poster-placeholder {
  border-radius: 8px;
  border: 1px solid var(--aw-line);
  filter: none;
}
.season-poster-placeholder { background: #f3f3f0; color: var(--aw-ink-3); }

.season-name { font-weight: 600; }
.season-year { color: var(--aw-ink-2); }
.season-episodes { color: var(--aw-ink-3); }

/* Either/or path copy on the show page */
.tv-path-hint {
  margin: 0.6rem 0 0;
  font-size: 0.82rem;
  color: var(--aw-ink-3);
}
.tv-path-note {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--aw-ink-2);
}

.tv-locked-notice {
  margin: 0 0 1.25rem;
  padding: 0.75rem 0.95rem;
  border: 1px solid var(--aw-line-2);
  border-left: 3px solid var(--aw-ink);
  border-radius: 8px;
  background: var(--aw-surface);
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--aw-ink-2);
}

/* A season already in the collection: subdued card, no add button */
.season-card.is-owned { border-color: var(--aw-line-2); }
.season-owned-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--aw-ink-2);
  text-decoration: none;
}
.season-owned-badge:hover { color: var(--aw-ink); }
.season-owned-badge .aw-ico { width: 0.9rem; height: 0.9rem; color: var(--aw-ink-2); }

/* ============================================================
   Collections list
   ============================================================ */
.collections-list { gap: 0.6rem; }

.collection-card {
  display: block;
  text-decoration: none;
  background: var(--aw-surface);
  border: 1px solid var(--aw-line);
  border-bottom: 1px solid var(--aw-line);
  border-radius: var(--aw-radius);
  box-shadow: none;
  padding: 1.15rem 1.3rem;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.collection-card:hover { background: var(--aw-surface); border-color: var(--aw-ink); transform: translateX(3px); }
.collection-card-head { display: flex; align-items: center; gap: 0.5rem; }

.collection-name {
  font-family: var(--aw-display);
  font-weight: 600;
  font-size: 1.3rem;
  letter-spacing: -0.02em;
  color: var(--aw-ink);
}
.collection-description { color: var(--aw-ink-2); margin-top: 0.2rem; }

/* legacy header (collections list / collection.ts) → align like the new pattern */
.collection-header { align-items: center; }
.collection-header h1 { margin: 0; }

/* ============================================================
   Landing
   ============================================================ */
.landing-page {
  background: transparent;
  border: none;
  box-shadow: none;
  text-align: left;
  max-width: 760px;
  margin: 0;
  padding: clamp(3rem, 12vw, 7rem) 0;
}

.landing-headline {
  display: flex;
  align-items: center;
  gap: clamp(0.75rem, 2vw, 1.5rem);
}
.landing-headline h1 { margin: 0; }

.landing-logo {
  flex: 0 0 auto;
  width: clamp(110px, 17vw, 200px);
  height: auto;
}

.main .landing-page h1 {
  font-family: var(--aw-display);
  font-weight: 700;
  font-size: clamp(3rem, 12vw, 6.5rem);
  letter-spacing: -0.045em;
  line-height: 0.92;
  text-shadow: none;
}

.landing-page p {
  color: var(--aw-ink-2);
  font-size: clamp(1.05rem, 1.6vw, 1.35rem);
  max-width: 48ch;
  margin: 1.25rem 0 2rem;
}

/* ============================================================
   Forms (create-collection / release-form / edit-release)
   ============================================================ */
.create-collection-page { max-width: 640px; }
/* the release editor uses a full-width two-region layout (see below) */
.release-form-page { max-width: none; }

.release-form {
  background: var(--aw-surface);
  border: 1px solid var(--aw-line);
  border-radius: var(--aw-radius);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.02);
  padding: clamp(1.25rem, 3vw, 2rem);
}

.form-group { margin-bottom: 1.25rem; }

.form-group label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--aw-ink-2);
  margin-bottom: 0.45rem;
}

.form-control,
.search-input,
.toon-input {
  border: 1px solid var(--aw-line-2);
  border-radius: 10px;
  background: var(--aw-surface);
  color: var(--aw-ink);
  font-family: var(--aw-sans);
}

.form-control:focus,
.search-input:focus,
.toon-input:focus {
  outline: none;
  border-color: var(--aw-ink);
  box-shadow: 0 0 0 3px rgba(14, 14, 14, 0.08);
}

select.form-control { cursor: pointer; }

.color-input { padding: 0.2rem; border-radius: 10px; }

.ai-parse-group {
  background: #f7f7f4;
  border: 1px dashed var(--aw-line-2);
  border-radius: 12px;
}
.ai-parse-loading { color: var(--aw-ink-2); }
.ai-parse-success { color: #1f7a44; }
.ai-parse-error { color: var(--aw-danger); }

.delete-form { border-top: 1px solid var(--aw-line); margin-top: 2rem; padding-top: 2rem; }

/* Checkbox field (e.g. "Main collection") */
.checkbox-field {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem;
  margin-bottom: 1.25rem;
  border: 1px solid var(--aw-line);
  border-radius: 12px;
  background: #f7f7f4;
  cursor: pointer;
}
.checkbox-field input[type="checkbox"] {
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 0.1rem;
  accent-color: var(--aw-ink);
  cursor: pointer;
  flex: 0 0 auto;
}
.checkbox-field-title {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
  text-transform: none;
  letter-spacing: 0;
  color: var(--aw-ink);
}
.checkbox-field-hint { margin: 0.2rem 0 0; font-size: 0.85rem; color: var(--aw-ink-2); }

/* "Main" pill on a collection card */
.collection-main-tag {
  display: inline-block;
  margin-left: 0.6rem;
  padding: 0.1rem 0.5rem;
  border-radius: 100px;
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  vertical-align: middle;
  color: #fff;
  background: var(--aw-ink);
}

/* Search */
.search-form { gap: 0.6rem; max-width: 680px; }
.search-input { padding: 0.8rem 1.1rem; }
.no-results { color: var(--aw-ink-2); }

/* Scanner UI inside forms */
.scanner-container { margin: 0.75rem 0; border-radius: 12px; overflow: hidden; border: 1px solid var(--aw-line); }
.scan-actions { margin-top: 0.6rem; }
.barcode-result { margin-top: 0.5rem; color: var(--aw-ink-2); font-size: 0.9rem; }

/* ============================================================
   Release editor (add / edit release) — two-region form
   ============================================================ */
.rf-layout {
  display: grid;
  grid-template-columns: minmax(0, 280px) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: start;
}

/* Left rail: what you're cataloguing */
.rf-aside { position: sticky; top: 88px; display: flex; flex-direction: column; gap: 1rem; }
.rf-poster {
  aspect-ratio: 2 / 3;
  border-radius: var(--aw-radius);
  overflow: hidden;
  border: 1px solid var(--aw-line);
  background: var(--aw-surface);
  box-shadow: 0 24px 50px -30px rgba(0, 0, 0, 0.5);
}
.rf-poster-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rf-poster-blank {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 1rem;
  font-family: var(--aw-display); color: var(--aw-ink-3);
  background: radial-gradient(120% 120% at 50% 0%, #fafafa 0%, #eeeeea 100%);
}
.rf-aside-meta { display: flex; flex-direction: column; gap: 0.3rem; }
.rf-aside-title { font-family: var(--aw-display); font-weight: 600; font-size: 1.2rem; letter-spacing: -0.02em; line-height: 1.15; }
.rf-aside-year { color: var(--aw-ink-2); font-size: 0.9rem; font-variant-numeric: tabular-nums; }

/* Form column */
.rf-form { min-width: 0; display: flex; flex-direction: column; gap: clamp(1.5rem, 3vw, 2.25rem); }

.rf-field { display: flex; flex-direction: column; gap: 0.45rem; margin-bottom: 1.1rem; }
.rf-field:last-child { margin-bottom: 0; }
.rf-field > label {
  font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--aw-ink-2);
}
.rf-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.rf-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1.25rem; }
.rf-grid-2 .rf-field, .rf-grid-3 .rf-field { margin-bottom: 0; }

.rf-section-title {
  margin: 0 0 1.1rem; padding-bottom: 0.6rem; border-bottom: 1px solid var(--aw-line);
  font-family: var(--aw-display); font-weight: 600; font-size: 1.15rem; letter-spacing: -0.02em;
}

/* Quick fill (AI) */
.rf-quickfill { background: #f7f7f4; border: 1px dashed var(--aw-line-2); border-radius: 14px; padding: 1.1rem 1.25rem; }
.rf-quickfill-eyebrow {
  display: inline-flex; align-items: center; gap: 0.4rem; margin-bottom: 0.5rem;
  font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.14em; color: var(--aw-ink-2);
}
.rf-quickfill-eyebrow .aw-ico { width: 0.95rem; height: 0.95rem; }
.rf-quickfill-label { display: block; margin-bottom: 0.6rem; color: var(--aw-ink-2); font-size: 0.92rem; }
.rf-quickfill textarea { min-height: 64px; }
.rf-quickfill-actions { display: flex; align-items: center; gap: 0.85rem; margin-top: 0.6rem; }

/* Barcode row */
.rf-barcode-row { display: flex; gap: 0.6rem; align-items: stretch; }
.rf-barcode-row .form-control { flex: 1; }
.rf-barcode-row .aw-btn { flex: 0 0 auto; }

/* Segmented status toggle with a sliding thumb */
.rf-seg {
  position: relative;
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  align-self: flex-start;
  padding: 4px;
  border: 1px solid var(--aw-line-2);
  border-radius: 100px;
  background: var(--aw-surface);
  isolation: isolate;
}
.rf-seg-thumb {
  position: absolute;
  z-index: 0;
  top: 4px;
  bottom: 4px;
  left: 4px;
  right: 50%;
  border-radius: 100px;
  background: var(--aw-ink);
  transition: transform 0.28s cubic-bezier(0.2, 0.7, 0.2, 1);
}
/* slide the thumb to the second option when it's selected */
.rf-seg:has(.rf-seg-option:last-child input:checked) .rf-seg-thumb { transform: translateX(100%); }

.rf-seg-option { position: relative; z-index: 1; display: flex; cursor: pointer; }
.rf-seg-option input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.rf-seg-label {
  flex: 1;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.45rem 1.15rem; border-radius: 100px;
  font-size: 0.88rem; font-weight: 500; color: var(--aw-ink-2);
  white-space: nowrap;
  transition: color 0.2s ease;
}
.rf-seg-option input:checked + .rf-seg-label { color: #fff; }
.rf-seg-option input:focus-visible + .rf-seg-label { box-shadow: 0 0 0 3px rgba(14, 14, 14, 0.15); }

@media (prefers-reduced-motion: reduce) {
  .rf-seg-thumb { transition: none; }
}

/* Actions */
.rf-actions {
  display: flex; justify-content: flex-end; gap: 0.6rem;
  margin-top: 0.5rem; padding-top: 1.5rem; border-top: 1px solid var(--aw-line);
}

/* Delete (edit mode) */
.rf-delete {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem;
  max-width: none; margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--aw-line);
}
.rf-delete-label { color: var(--aw-ink-2); font-size: 0.9rem; }

@media (max-width: 760px) {
  .rf-layout { grid-template-columns: 1fr; gap: 1.5rem; }
  .rf-aside { position: static; flex-direction: row; align-items: center; gap: 1rem; }
  .rf-poster { width: 92px; flex: 0 0 auto; }
  .rf-grid-2, .rf-grid-3 { grid-template-columns: 1fr; gap: 1.1rem; }
}

/* ============================================================
   Shelves list + shelf detail
   ============================================================ */
/* full width — match the collection page (styles.css caps .shelves-page at 700px) */
.shelves-page,
.shelf-page { max-width: none; }

/* "New shelf" disclosure */
.shelf-add { margin-bottom: 1.5rem; }
.shelf-add[open] {
  background: var(--aw-surface);
  border: 1px solid var(--aw-line);
  border-radius: var(--aw-radius);
  padding: 1.25rem;
}

summary.shelf-add-summary,
summary.shelf-edit-summary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
summary.shelf-add-summary::-webkit-details-marker,
summary.shelf-edit-summary::-webkit-details-marker { display: none; }

.shelf-add-summary {
  padding: 0.7rem 1.2rem;
  border-radius: 100px;
  border: 1px solid var(--aw-line-2);
  font-size: 0.9rem;
  font-weight: 500;
}
.shelf-add-summary:hover { border-color: var(--aw-ink); background: rgba(0, 0, 0, 0.03); }
.shelf-add-summary .aw-ico { width: 1.05rem; height: 1.05rem; }
.shelf-add[open] .shelf-add-summary {
  border-style: dashed;
  margin-bottom: 1.1rem;
}

.shelf-add .shelf-form { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-end; }
.shelf-add .shelf-form .form-group { margin: 0; flex: 1 1 200px; }

/* Shelf list */
.shelves-list { gap: 0.6rem; }

.shelf-item {
  background: var(--aw-surface);
  border: 1px solid var(--aw-line);
  border-radius: var(--aw-radius);
  box-shadow: none;
  padding: 0;
  display: block;
  overflow: hidden;
  transition: border-color 0.15s ease;
}
.shelf-item:hover { border-color: var(--aw-line-2); }

.shelf-link {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1rem 1.15rem;
  text-decoration: none;
  color: var(--aw-ink);
}

.shelf-color-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  flex: 0 0 auto;
  border: 1px solid rgba(0, 0, 0, 0.12);
}

.shelf-name {
  font-family: var(--aw-display);
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  flex: 1;
}

.shelf-count {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--aw-ink-3);
}

.shelf-go {
  display: inline-flex;
  color: var(--aw-ink-3);
  transition: transform 0.15s ease, color 0.15s ease;
}
.shelf-go .aw-ico { width: 1.1rem; height: 1.1rem; }
.shelf-link:hover .shelf-go { color: var(--aw-ink); transform: translate(2px, -2px); }

/* Inline edit disclosure */
.shelf-edit { border-top: 1px solid var(--aw-line); }
.shelf-edit-summary {
  padding: 0.6rem 1.15rem;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--aw-ink-2);
}
.shelf-edit-summary:hover { color: var(--aw-ink); }
.shelf-edit-summary .aw-ico { width: 0.95rem; height: 0.95rem; }

.shelf-edit-body {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  padding: 0 1.15rem 1.1rem;
}
.shelf-edit-form { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; }
.shelf-edit-form .form-control { padding: 0.55rem 0.75rem; width: auto; }
.shelf-edit-form input[type="text"] { min-width: 200px; }
/* keep the inline colour picker a proper swatch (styles.css forces width:auto here) */
.shelf-edit-form .color-input { width: 46px; min-width: 46px; height: 42px; padding: 0.15rem; }
.shelf-delete-form { margin-left: auto; }

/* ============================================================
   Share / Join (formerly unstyled .toon-* classes)
   ============================================================ */
.toon { max-width: 560px; margin: 0 auto; }
.toon-grain { display: none; }

.toon-titlecard { padding: clamp(2rem, 6vw, 3.5rem) 0 clamp(1.25rem, 3vw, 2rem); text-align: center; }
.toon-eyebrow {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--aw-ink-2);
}
.toon-title {
  margin: 0.5rem 0 0;
  font-family: var(--aw-display);
  font-weight: 700;
  font-size: clamp(2.25rem, 7vw, 3.75rem);
  letter-spacing: -0.04em;
  line-height: 0.95;
  color: var(--aw-ink);
}
.toon-rule { width: 48px; height: 3px; background: var(--aw-ink); border-radius: 2px; margin: 1.1rem auto 0; }

.toon-share-box,
.toon-join-box {
  background: var(--aw-surface);
  border: 1px solid var(--aw-line);
  border-radius: var(--aw-radius);
  padding: clamp(1.5rem, 4vw, 2.25rem);
  text-align: center;
}
.toon-share-box h2,
.toon-join-box h2 {
  font-family: var(--aw-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 0.5rem;
}
.toon-share-box p,
.toon-join-box p { color: var(--aw-ink-2); }

.toon-invite-link { margin: 1rem 0 0.5rem; }
.toon-input { width: 100%; padding: 0.75rem 1rem; text-align: center; }
.toon-hint { font-size: 0.85rem; color: var(--aw-ink-3); }

.toon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding: 0.7rem 1.4rem;
  border-radius: 100px;
  border: 1px solid var(--aw-ink);
  background: var(--aw-ink);
  color: #fff;
  font-family: var(--aw-sans);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.15s ease;
}
.toon-btn:hover { background: #2a2a2a; transform: translateY(-1px); }
.toon-btn-secondary { background: transparent; color: var(--aw-ink); border-color: var(--aw-line-2); }
.toon-btn-secondary:hover { background: rgba(0, 0, 0, 0.03); }

.toon-join-status { font-weight: 500; }
.toon-join-error { color: var(--aw-danger); }

/* ============================================================
   Scan page
   ============================================================ */
.scan-page { max-width: 640px; }
.scan-page p { color: var(--aw-ink-2); }

.scan-camera-wrap {
  position: relative;
  margin: 1.5rem 0;
  border-radius: var(--aw-radius);
  overflow: hidden;
  border: 1px solid var(--aw-line);
  background: #000;
  aspect-ratio: 4 / 3;
}
.scanner-video-element { width: 100%; height: 100%; }

/* ============================================================
   Scanner feedback overlay (ScannerOverlay) — drawn over the live
   camera on /scan and the inline release-editor scanner.
   ============================================================ */
.scanner-container { position: relative; }

.scan-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none; /* taps pass through to the camera; the torch btn opts back in */
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 2;
}
.scan-overlay.is-active { opacity: 1; }

/* Reticle: a centered framed target with corner brackets and a sweeping line,
   plus a dimmed vignette around it to draw the eye in. */
.scan-reticle {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(78%, 320px);
  aspect-ratio: 5 / 3;
  transform: translate(-50%, -50%);
  border-radius: 12px;
  box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.34);
}
.scan-corner {
  position: absolute;
  width: 22px;
  height: 22px;
  border: 3px solid #fff;
  border-radius: 3px;
}
.scan-corner.tl { top: -2px; left: -2px; border-right: 0; border-bottom: 0; }
.scan-corner.tr { top: -2px; right: -2px; border-left: 0; border-bottom: 0; }
.scan-corner.bl { bottom: -2px; left: -2px; border-right: 0; border-top: 0; }
.scan-corner.br { bottom: -2px; right: -2px; border-left: 0; border-top: 0; }

.scan-line {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 8%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #fff, transparent);
  border-radius: 2px;
  animation: scan-sweep 2.2s ease-in-out infinite;
}
@keyframes scan-sweep {
  0%   { top: 8%; opacity: 0.35; }
  50%  { top: 92%; opacity: 1; }
  100% { top: 8%; opacity: 0.35; }
}

/* Status pill (top) and rotating tip (bottom). */
.scan-pill {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(14, 14, 14, 0.72);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  backdrop-filter: blur(4px);
  white-space: nowrap;
  max-width: 90%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.scan-tip {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 76%;
  text-align: center;
  background: rgba(14, 14, 14, 0.6);
  color: #fff;
  font-size: 0.78rem;
  line-height: 1.3;
  padding: 0.3rem 0.7rem;
  border-radius: 10px;
  backdrop-filter: blur(4px);
  animation: scan-tip-in 0.3s ease;
}
@keyframes scan-tip-in {
  from { opacity: 0; transform: translate(-50%, 6px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

/* Torch toggle (top-right; only shown when the device supports it). */
.scan-torch {
  position: absolute;
  top: 10px;
  right: 10px;
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(14, 14, 14, 0.7);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(4px);
}
.scan-torch .aw-ico { width: 0.95rem; height: 0.95rem; }
.scan-torch.is-on { background: #fff; color: #0e0e0e; border-color: #fff; }

/* Success / error states: stop the sweep, recolour the frame, pop once. */
.scan-overlay.is-success .scan-line,
.scan-overlay.is-error .scan-line { animation: none; opacity: 0; }
.scan-overlay.is-success .scan-corner { border-color: #34d399; }
.scan-overlay.is-error .scan-corner { border-color: #f87171; }
.scan-overlay.is-success .scan-pill { background: rgba(16, 122, 87, 0.88); }
.scan-overlay.is-error .scan-pill { background: rgba(153, 27, 27, 0.88); }
.scan-overlay.is-success .scan-reticle { animation: scan-pop 0.4s ease; }
@keyframes scan-pop {
  0%   { transform: translate(-50%, -50%) scale(1); }
  50%  { transform: translate(-50%, -50%) scale(1.04); }
  100% { transform: translate(-50%, -50%) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .scan-line { animation: none; top: 50%; }
  .scan-overlay.is-success .scan-reticle,
  .scan-tip { animation: none; }
}

.scan-results { margin-top: 1.25rem; }
.scan-status { color: var(--aw-ink-2); }

.scan-result-card {
  background: var(--aw-surface);
  border: 1px solid var(--aw-line);
  border-radius: var(--aw-radius);
  padding: 1.5rem;
}
.scan-result-card h2 { font-family: var(--aw-display); margin-top: 0; }
.scan-meta { color: var(--aw-ink-2); font-weight: 600; }
.scan-desc { color: var(--aw-ink-2); }
.scan-result-actions { display: flex; gap: 0.6rem; margin-top: 1rem; flex-wrap: wrap; }

/* Multiple-match options on /scan: tappable rows linking to a pre-filled Add release. */
.scan-options { margin-top: 1.25rem; }
.scan-option-list { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.75rem; }
.scan-option {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--aw-line);
  border-radius: var(--aw-radius);
  background: var(--aw-surface);
  color: var(--aw-ink);
  text-decoration: none;
}
.scan-option:hover { border-color: var(--aw-ink); }
.scan-option-poster {
  width: 40px;
  height: 60px;
  object-fit: cover;
  border-radius: 4px;
  flex: 0 0 auto;
  background: #eee;
}
.scan-option-meta { display: flex; flex-direction: column; gap: 0.1rem; flex: 1 1 auto; min-width: 0; }
.scan-option-title { font-weight: 600; }
.scan-option-year { color: var(--aw-ink-2); font-size: 0.85rem; }
.scan-option .aw-ico { width: 1rem; height: 1rem; color: var(--aw-ink-3); flex: 0 0 auto; }
.scan-option:hover .aw-ico { color: var(--aw-ink); }
.scan-option-search { display: inline-block; margin-top: 0.85rem; color: var(--aw-ink-2); font-size: 0.9rem; }

/* ============================================================
   Empty states
   ============================================================ */
.empty-state,
.aw-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  text-align: center;
  padding: clamp(3rem, 10vw, 6rem) 1rem;
  color: var(--aw-ink-2);
}
.aw-empty .aw-eyebrow { margin-bottom: 0.5rem; }
.aw-empty-title {
  margin: 0;
  font-family: var(--aw-display);
  font-weight: 700;
  font-size: clamp(2rem, 6vw, 3.25rem);
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--aw-ink);
}
.aw-empty-sub { margin: 0 0 1.25rem; color: var(--aw-ink-2); max-width: 36ch; }

/* ============================================================
   Line icons (CSS mask — color from currentColor)
   ============================================================ */
.aw-ico {
  display: inline-block;
  width: 1em;
  height: 1em;
  flex: 0 0 auto;
  background-color: currentColor;
  -webkit-mask: var(--i) center / contain no-repeat;
  mask: var(--i) center / contain no-repeat;
}

.aw-ico-disc { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Ccircle cx='12' cy='12' r='2.5'/%3E%3C/svg%3E"); }
.aw-ico-plus { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E"); }
.aw-ico-users { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='9' cy='7' r='4'/%3E%3Cpath d='M19 8v6M22 11h-6'/%3E%3C/svg%3E"); }
.aw-ico-shelves { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 2 2 7l10 5 10-5-10-5z'/%3E%3Cpath d='M2 17l10 5 10-5'/%3E%3Cpath d='M2 12l10 5 10-5'/%3E%3C/svg%3E"); }
.aw-ico-arrow { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 17 17 7M8 7h9v9'/%3E%3C/svg%3E"); }
.aw-ico-back { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19 12H5M12 19l-7-7 7-7'/%3E%3C/svg%3E"); }
.aw-ico-search { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E"); }
.aw-ico-film { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='18' rx='2'/%3E%3Cpath d='M7 3v18M17 3v18M3 7h4M3 12h18M3 17h4M17 7h4M17 17h4'/%3E%3C/svg%3E"); }
.aw-ico-tv { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='7' width='20' height='14' rx='2'/%3E%3Cpath d='m7 3 5 4 5-4'/%3E%3C/svg%3E"); }
.aw-ico-box { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m21 8-9-5-9 5v8l9 5 9-5z'/%3E%3Cpath d='m3 8 9 5 9-5M12 13v9'/%3E%3C/svg%3E"); }
.aw-ico-camera { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 8a2 2 0 0 1 2-2h2l2-2h6l2 2h2a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z'/%3E%3Ccircle cx='12' cy='13' r='3.5'/%3E%3C/svg%3E"); }
.aw-ico-flash { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolygon points='13 2 3 14 12 14 11 22 21 10 12 10 13 2'/%3E%3C/svg%3E"); }
.aw-ico-link { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 13a5 5 0 0 0 7 0l3-3a5 5 0 0 0-7-7l-1 1'/%3E%3Cpath d='M14 11a5 5 0 0 0-7 0l-3 3a5 5 0 0 0 7 7l1-1'/%3E%3C/svg%3E"); }
.aw-ico-check { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E"); }
.aw-ico-plus-circle { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 8v8M8 12h8'/%3E%3C/svg%3E"); }
.aw-ico-edit { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 20h9'/%3E%3Cpath d='M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4z'/%3E%3C/svg%3E"); }
.aw-ico-arrow-right { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M12 5l7 7-7 7'/%3E%3C/svg%3E"); }
.aw-ico-signout { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4'/%3E%3Cpath d='M16 17l5-5-5-5'/%3E%3Cpath d='M21 12H9'/%3E%3C/svg%3E"); }
.aw-ico-user { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='12' cy='7' r='4'/%3E%3C/svg%3E"); }
.aw-ico-sparkles { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3l1.6 4.6L18 9l-4.4 1.4L12 15l-1.6-4.6L6 9l4.4-1.4z'/%3E%3Cpath d='M18 14l.8 2.2L21 17l-2.2.8L18 20l-.8-2.2L15 17l2.2-.8z'/%3E%3C/svg%3E"); }
.aw-ico-trash { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 6h18M8 6V4a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1v2M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6'/%3E%3Cpath d='M10 11v6M14 11v6'/%3E%3C/svg%3E"); }
.aw-ico-chevron-down { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }

/* ============================================================
   Dropdown
   ============================================================ */
.aw-dropdown { position: relative; display: inline-block; }

.aw-dropdown-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.85rem;
  border-radius: 100px;
  border: 1px solid var(--aw-line-2);
  background: var(--aw-surface);
  color: var(--aw-ink);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 120ms ease, transform 120ms ease;
}
.aw-dropdown-trigger:hover { border-color: var(--aw-ink); }
.aw-dropdown-trigger .aw-ico {
  width: 1rem;
  height: 1rem;
  color: var(--aw-ink-2);
  transition: transform 150ms ease;
}
.aw-dropdown-trigger.is-open .aw-ico { transform: rotate(180deg); }
.aw-dropdown-label { display: inline-block; }

.aw-dropdown-panel {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  min-width: 100%;
  max-height: 18rem;
  overflow-y: auto;
  background: var(--aw-bg, #fff);
  border: 1px solid var(--aw-line-2);
  border-radius: 0.6rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  padding: 0.3rem;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.aw-dropdown-option {
  text-align: left;
  padding: 0.45rem 0.7rem;
  border-radius: 0.4rem;
  border: 0;
  background: transparent;
  color: var(--aw-ink);
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
}
.aw-dropdown-option:hover { background: var(--aw-surface); }
.aw-dropdown-option.is-selected {
  background: var(--aw-ink);
  color: var(--aw-bg, #fff);
}

/* Filter bar (above sections). Right-aligned so multiple filters can stack
   horizontally from the right without ever fighting the section title. */
.aw-filter-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  margin: 0 0 1.75rem;
}

.aw-empty-filter {
  margin: 2rem 0;
  padding: 2rem;
  text-align: center;
  color: var(--aw-ink-3);
  border: 1px dashed var(--aw-line-2);
  border-radius: 0.6rem;
}

/* ============================================================
   Motion + responsive
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .aw-card-media,
  .aw-card-img,
  .aw-card-go,
  .movie-poster,
  .season-card,
  .collection-card,
  .aw-btn,
  .btn-primary,
  .btn-secondary,
  .btn-danger,
  .toon-btn { transition: none; }
}

@media (max-width: 700px) {
  .main .movie-page .movie-header { grid-template-columns: 1fr; }
  .movie-poster-large, .movie-poster-large-placeholder { max-width: 280px; }
}

@media (max-width: 600px) {
  .aw-hero-top, .aw-page-head-top { align-items: flex-start; }
  .aw-grid, .main .movie-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}

/* ---- Spin (random picker) ------------------------------------------------ */
.spin-page { text-align: center; }

.spin-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin: 0.5rem 0 clamp(1.5rem, 4vw, 2.5rem);
}

/* The reel window — one poster tall, clips the strip scrolling past. */
.spin-stagewrap { display: flex; justify-content: center; }

.spin-stage {
  position: relative;
  width: clamp(220px, 48vw, 300px);
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border-radius: var(--aw-radius);
  background: var(--aw-surface);
  border: 1px solid var(--aw-line);
  box-shadow: 0 22px 50px -30px rgba(0, 0, 0, 0.5);
}

.spin-stage.is-landed {
  border-color: var(--aw-ink);
  animation: spin-pop 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
}

@keyframes spin-pop {
  0% { transform: scale(0.96); }
  55% { transform: scale(1.03); }
  100% { transform: scale(1); }
}

/* Sparkle flash on landing. */
.spin-stage.is-landed::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 42%, rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0) 60%);
  opacity: 0;
  pointer-events: none;
  animation: spin-flash 0.6s ease-out;
}

@keyframes spin-flash {
  0% { opacity: 0.9; }
  100% { opacity: 0; }
}

.spin-reel-strip {
  display: flex;
  flex-direction: column;
  will-change: transform;
}

.spin-reel-strip.is-rolling {
  transition: transform 2.4s cubic-bezier(0.12, 0.85, 0.18, 1);
}

/* Posters blur slightly while the reel is in motion, then snap sharp on land. */
.spin-reel-strip.is-rolling .spin-reel-img { filter: blur(1.5px); }

.spin-reel-cell {
  flex: 0 0 auto;
  width: 100%;
  aspect-ratio: 2 / 3;
}

.spin-reel-img,
.spin-stage > .spin-reel-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.spin-stage-msg {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 1.5rem;
  color: var(--aw-ink-2);
  font-size: 0.92rem;
}

.spin-stage-msg .aw-ico { width: 1.8rem; height: 1.8rem; color: var(--aw-ink-3); }

.spin-noposter {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 0.75rem;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--aw-ink-2);
  background: #ededea;
}

.spin-meta { min-height: 2.5rem; margin-top: clamp(1rem, 3vw, 1.5rem); }

.spin-title {
  font-family: var(--aw-display);
  font-weight: 600;
  font-size: clamp(1.2rem, 3vw, 1.6rem);
  letter-spacing: -0.02em;
  color: var(--aw-ink);
}

.spin-formats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem;
  margin-top: 0.6rem;
}

/* The handful of titles the reel considered; the winner stays highlighted. */
.spin-candidates {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.55rem;
  margin-top: clamp(1rem, 3vw, 1.5rem);
}

.spin-cand {
  display: block;
  width: 56px;
  aspect-ratio: 2 / 3;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--aw-line);
  opacity: 0.5;
  filter: grayscale(0.4);
  transition: opacity 0.2s ease, transform 0.2s ease, filter 0.2s ease;
}

.spin-cand:hover { opacity: 0.85; transform: translateY(-2px); }

.spin-cand.is-winner {
  opacity: 1;
  filter: none;
  border-color: var(--aw-ink);
  box-shadow: 0 0 0 2px var(--aw-ink);
  transform: translateY(-2px);
}

.spin-cand-img { display: block; width: 100%; height: 100%; object-fit: cover; }

.spin-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: clamp(1.25rem, 3vw, 2rem);
}

.spin-go { padding: 0.85rem 1.8rem; font-size: 1rem; }

.spin-actions { display: flex; gap: 0.6rem; }

@media (prefers-reduced-motion: reduce) {
  .spin-reel-strip.is-rolling { transition: none; }
  .spin-reel-strip.is-rolling .spin-reel-img { filter: none; }
  .spin-stage.is-landed { animation: none; }
  .spin-stage.is-landed::after { animation: none; opacity: 0; }
}

/* ---- Release detail page (/release/:id) ---------------------------------- */
.release-detail-page { display: flex; flex-direction: column; gap: clamp(1.5rem, 4vw, 2.5rem); }

.rd-layout {
  display: grid;
  grid-template-columns: minmax(0, 240px) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: start;
}
.rd-aside { position: sticky; top: 88px; }
.rd-main { min-width: 0; }

.rd-facts { display: flex; flex-direction: column; }
.rd-fact {
  display: grid;
  grid-template-columns: minmax(120px, 160px) minmax(0, 1fr);
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--aw-line);
}
.rd-fact:first-child { padding-top: 0; }
.rd-fact-label {
  font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--aw-ink-2);
}
.rd-fact-value { color: var(--aw-ink); }
.rd-fact-shelf { display: inline-flex; align-items: center; gap: 0.45rem; }
.rd-shelf-dot {
  width: 0.7rem; height: 0.7rem; border-radius: 50%; flex: 0 0 auto;
  border: 1px solid rgba(0, 0, 0, 0.12);
}

/* Watch history */
.rd-watch-section { display: flex; flex-direction: column; gap: 1rem; }
.rd-watch-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.rd-watch-title { font-family: var(--aw-display); font-size: 1.4rem; letter-spacing: -0.02em; }
.rd-watch-count {
  font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--aw-ink-3);
  font-variant-numeric: tabular-nums;
}

.rd-watch-form { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }
.rd-watch-form .form-control { width: auto; }

.rd-watch-empty { color: var(--aw-ink-3); }

.rd-watch-list { display: flex; flex-direction: column; }
.rd-watch-row {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--aw-line);
}
.rd-watch-date { display: inline-flex; align-items: center; gap: 0.55rem; font-variant-numeric: tabular-nums; }
.rd-watch-date .aw-ico { width: 1rem; height: 1rem; color: var(--aw-ink-2); }
.rd-watch-delete { display: flex; }
.rd-watch-delete-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2rem; height: 2rem; padding: 0;
  border: 1px solid transparent; border-radius: 8px;
  background: transparent; color: var(--aw-ink-3); cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.rd-watch-delete-btn:hover { color: var(--aw-danger, #c0392b); border-color: var(--aw-line-2); background: var(--aw-surface); }
.rd-watch-delete-btn .aw-ico { width: 1rem; height: 1rem; }

@media (max-width: 720px) {
  .rd-layout { grid-template-columns: minmax(0, 1fr); }
  .rd-aside { position: static; max-width: 220px; }
}

/* ---- Movie page: watch history list -------------------------------------- */
.movie-watches { margin-top: clamp(1.5rem, 4vw, 2.5rem); display: flex; flex-direction: column; gap: 1rem; }
.movie-watches-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.movie-watches-count {
  font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--aw-ink-3);
  font-variant-numeric: tabular-nums;
}
.movie-watches-list { display: flex; flex-direction: column; }
.movie-watch-row {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--aw-line);
  text-decoration: none; color: var(--aw-ink);
  transition: padding-left 0.15s ease;
}
.movie-watch-row:hover { padding-left: 0.4rem; }
.movie-watch-date { font-variant-numeric: tabular-nums; }
.movie-watch-format { font-size: 0.8rem; color: var(--aw-ink-2); }
