:root {
  --bg: #f4f5f7; --card: #fff; --ink: #14181d; --muted: #6b7280;
  --line: #e6e8ec; --accent: #2f7fb0; --accent-ink: #fff;
  --sidebar: #171b21; --sidebar-ink: #e9edf2; --sidebar-muted: #8b95a3;
  --radius: 12px; --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16,24,40,.04), 0 4px 16px rgba(16,24,40,.05);
  --shadow-sm: 0 1px 2px rgba(16,24,40,.06);
  --sidebar-w: 220px;
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Sidebar layout ────────────────────────────────────────────────────────── */
body.app { display: flex; min-height: 100vh; }

.sidebar {
  position: sticky; top: 0; align-self: flex-start;
  width: var(--sidebar-w); min-width: var(--sidebar-w); height: 100vh;
  background: var(--sidebar); color: var(--sidebar-ink);
  display: flex; flex-direction: column; padding: 20px 14px;
}
.sidebar .brand { color: #fff; font-weight: 700; font-size: 20px; letter-spacing: -.01em;
  padding: 4px 8px 18px; display: block; }
.sidebar .brand:hover { text-decoration: none; }
.sidebar .brand span { color: var(--accent); }

.side-nav { flex: 1; overflow-y: auto; }
.nav-group { margin-bottom: 18px; }
.nav-head { margin: 0 8px 6px; font-size: 11px; text-transform: uppercase;
  letter-spacing: .08em; color: var(--sidebar-muted); font-weight: 600; }
.side-nav a { display: block; color: var(--sidebar-ink); padding: 8px 10px;
  border-radius: var(--radius-sm); font-size: 14.5px; margin-bottom: 1px; transition: background .12s; }
.side-nav a:hover { background: rgba(255,255,255,.06); text-decoration: none; }
.side-nav a.active { background: var(--accent); color: #fff; font-weight: 600; }

.side-user { border-top: 1px solid rgba(255,255,255,.08); padding: 14px 8px 4px; margin-top: 8px; }
.su-name { font-weight: 600; font-size: 14px; color: #fff; }
.su-email { font-size: 12px; color: var(--sidebar-muted); margin: 2px 0 8px; word-break: break-all; }
.su-logout { display: inline-block; font-size: 13px; color: var(--sidebar-ink);
  border: 1px solid rgba(255,255,255,.14); padding: 4px 12px; border-radius: 6px; }
.su-logout:hover { background: rgba(255,255,255,.08); text-decoration: none; }

main { flex: 1; min-width: 0; max-width: 1160px; margin: 0 auto; padding: 32px 40px; width: 100%; }
h1 { font-size: 26px; margin: 0 0 18px; letter-spacing: -.015em; }
h2 { font-size: 18px; margin: 30px 0 12px; letter-spacing: -.01em; }
.muted { color: var(--muted); font-size: 13.5px; }
p.muted { line-height: 1.5; }

/* ── Login page (no sidebar) ───────────────────────────────────────────────── */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh;
  background: linear-gradient(160deg, #eef1f5 0%, #e3e8ee 100%); padding: 24px; }
.login-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 8px 40px rgba(16,24,40,.10); padding: 36px 34px; width: 100%; max-width: 380px; }
.login-brand { display: block; font-weight: 700; font-size: 24px; color: var(--ink); text-align: center; }
.login-brand span { color: var(--accent); }
.login-brand:hover { text-decoration: none; }
.login-sub { text-align: center; color: var(--muted); margin: 6px 0 22px; font-size: 14px; }
.login-form label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.login-form input { display: block; width: 100%; margin-top: 5px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); font: inherit; background: #fff; }
.login-form input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(47,127,176,.15); }
.login-form button { width: 100%; padding: 11px; margin-top: 6px; font-size: 15px; font-weight: 600; }
.login-error { background: #fef2f2; color: #b42318; border: 1px solid #fecaca;
  border-radius: var(--radius-sm); padding: 10px 12px; font-size: 13.5px; margin-bottom: 16px; }

/* ── Filters / forms ───────────────────────────────────────────────────────── */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  background: var(--card); padding: 14px; border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.filters input[type=search] { flex: 1; min-width: 220px; }
.filters input, .filters select, .form input, .form select, .form textarea {
  padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); font: inherit; background: #fff; }
.filters input:focus, .filters select:focus, .form input:focus, .form select:focus, .form textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(47,127,176,.13); }
.filters .chk { display: flex; align-items: center; gap: 6px; font-size: 14px; }

button { padding: 8px 16px; border: 0; border-radius: var(--radius-sm); background: var(--accent);
  color: var(--accent-ink); font: inherit; font-weight: 500; cursor: pointer; transition: filter .12s, background .12s; }
button:hover { filter: brightness(1.06); }
.clear { padding: 8px 10px; color: var(--muted); }

/* ── Tables / grids ────────────────────────────────────────────────────────── */
table.grid { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  margin-top: 14px; box-shadow: var(--shadow-sm); }
.grid th, .grid td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); font-size: 14px; }
.grid tbody tr:last-child td { border-bottom: 0; }
.grid thead th { background: #fafbfc; color: var(--muted); font-weight: 600; font-size: 11.5px;
  text-transform: uppercase; letter-spacing: .04em; }
.grid tbody tr[onclick] { cursor: pointer; }
.grid tbody tr[onclick]:hover { background: #f2f7fb; }
.grid td.thumb { width: 1%; }
.thumb img { object-fit: cover; border-radius: 6px; box-shadow: var(--shadow-sm); display: block; }
.noimg { display: inline-block; background: #eef0f2; border-radius: 6px; }
.thumb img, .noimg { width: 40px; height: 55px; }
.grid.thumb-m .thumb img, .grid.thumb-m .noimg { width: 68px; height: 94px; }
.grid.thumb-l .thumb img, .grid.thumb-l .noimg { width: 112px; height: 154px; }

.gridhead { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 6px; }
.gridhead h1 { margin: 0; }
.gridhead p { margin: 0; }
.thumbtoggle { display: inline-flex; align-items: center; gap: 6px; }
.thumbtoggle button { background: #fff; color: var(--ink); border: 1px solid var(--line);
  padding: 5px 12px; border-radius: 6px; font: inherit; cursor: pointer; }
.thumbtoggle button:hover { background: #f2f7fb; }
.thumbtoggle button.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.pill { display: inline-block; background: #eef2f6; color: #334155; border-radius: 20px; padding: 2px 9px;
  font-size: 12px; margin-right: 3px; font-weight: 500; }
.pill-blocked { background: #fee2e2; color: #b91c1c; }
.status { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px;
  text-transform: capitalize; font-weight: 500; }
.status.new { background: #fef3c7; color: #92400e; }
.status.reviewed { background: #dcfce7; color: #166534; }
.status.in_stock { background: #dcfce7; color: #166534; }
.status.reserved { background: #e0e7ff; color: #3730a3; }
.status.sold { background: #f3f4f6; color: #6b7280; }

/* ── Card detail / meta ────────────────────────────────────────────────────── */
/* Legacy detail layout — still used by supply_detail / box_detail pages */
.detail-head { display: flex; gap: 24px; flex-wrap: wrap; }
.detail-images img { width: 160px; border-radius: 10px; border: 1px solid var(--line);
  margin-right: 8px; box-shadow: var(--shadow); }
.detail-meta { flex: 1; min-width: 280px; }
.detail-meta dl { display: grid; grid-template-columns: 110px 1fr; gap: 4px 12px; margin: 12px 0; }
.detail-meta dt { color: var(--muted); font-size: 13px; }
.detail-meta dd { margin: 0; font-size: 14px; }

.btn { display: inline-block; background: var(--accent); color: #fff; padding: 9px 16px;
  border-radius: var(--radius-sm); font-weight: 500; box-shadow: var(--shadow-sm); }
.btn:hover { text-decoration: none; filter: brightness(1.06); }
.btn-muted { background: #eef1f4; color: var(--ink); box-shadow: none; }
.btn-muted:hover { background: #e4e8ed; filter: none; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
button.btn-danger { background: #b00020; color: #fff; }
button.btn-muted { background: #eef1f4; color: var(--ink); }

/* ── Card detail page ──────────────────────────────────────────────────────── */
.crumb { margin: 0 0 14px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--shadow-sm); }
.panel-title { font-size: 15px; margin: 0 0 14px; font-weight: 600; }

.cd-header { display: flex; align-items: flex-start; justify-content: space-between;
  gap: 20px; flex-wrap: wrap; margin-bottom: 18px; }
.cd-heading h1 { margin: 0 0 4px; }
.cd-key { margin: 0 0 8px; font-size: 12.5px; word-break: break-all; }
.cd-badges { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.cd-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.cd-top { display: grid; grid-template-columns: 300px 1fr; gap: 18px; align-items: start; margin-bottom: 18px; }
.cd-media { position: sticky; top: 18px; }
.cd-rightcol { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.cd-imggroup { margin-bottom: 14px; }
.cd-imggroup:last-of-type { margin-bottom: 0; }
.cd-imgs { display: flex; gap: 10px; flex-wrap: wrap; }
.cd-imgs img { width: 130px; border-radius: 10px; border: 1px solid var(--line); box-shadow: var(--shadow);
  display: block; transition: transform .12s ease; }
.cd-imgs a:hover img { transform: translateY(-2px); }
.cd-noimg { width: 100%; padding: 40px 0; text-align: center; background: #f4f5f7; border-radius: 10px; }
.cd-imgtools { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.cd-sublabel { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 2px; }
.cd-replace { display: flex; flex-direction: column; gap: 8px; }
.cd-file { font-size: 13px; color: var(--muted); }
.cd-file input { display: block; margin-top: 3px; font-size: 12px; }

.cd-dl { display: grid; grid-template-columns: 120px 1fr 120px 1fr; gap: 10px 16px; margin: 0; }
.cd-dl dt { color: var(--muted); font-size: 13px; align-self: center; }
.cd-dl dd { margin: 0; font-size: 14px; align-self: center; }

.cd-channels { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.cd-channel-body { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cd-auction { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.cd-auction-fields { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.cd-auction-fields label { font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 3px; }
.cd-auction-fields input, .cd-auction-fields select { padding: 6px 8px; border: 1px solid var(--line);
  border-radius: 6px; font: inherit; color: var(--ink); }
.cd-warn { margin-top: 10px; font-size: 13px; color: #b00020; }

.cd-inventory, .cd-addstock { margin-bottom: 18px; }
.cd-tablewrap { overflow-x: auto; }
.cd-inventory .grid { font-size: 13px; }
.cd-inventory .grid th, .cd-inventory .grid td { padding: 8px 10px; }
.cd-inventory .pxin { width: 72px; }
.cd-form-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 16px; }
.cd-form-grid label { font-size: 13px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.cd-form-grid input, .cd-form-grid select { padding: 8px 10px; border: 1px solid var(--line);
  border-radius: 6px; font: inherit; color: var(--ink); }

/* Still used by settings / supply_detail pages */
.shopify-box { display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 18px; margin-top: 16px; box-shadow: var(--shadow-sm); }
.shopify-box .btn { padding: 7px 13px; }

/* ── Record Review ─────────────────────────────────────────────────────── */
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { filter: brightness(1.06); }
.nav-badge { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px;
  font-size: 11.5px; line-height: 18px; text-align: center; border-radius: 9px;
  background: #b91c1c; color: #fff; font-weight: 700; vertical-align: middle; }
.side-nav a.active .nav-badge { background: #fff; color: var(--accent); }

/* Scan → review call-to-action */
.rv-cta { display: flex; align-items: center; justify-content: space-between; gap: 16px;
  flex-wrap: wrap; background: #eef6fb; border: 1px solid #cfe4f1;
  border-radius: var(--radius); padding: 14px 18px; margin: 8px 0 18px; }
.rv-cta strong { display: block; margin-bottom: 2px; }
.rv-cta .btn { white-space: nowrap; }

.rv-progress { color: var(--muted); font-size: 13.5px; }

/* Sticky top bar: progress · queue dropdown · prev/next/save */
.rv-bar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px 16px; margin-bottom: 18px; position: sticky; top: 0; z-index: 5;
  box-shadow: var(--shadow-sm); }
.rv-bar-l { display: flex; align-items: baseline; gap: 12px; }
.rv-bar-l strong { font-size: 16px; }
.rv-jump { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 220px; }
.rv-jump select { flex: 1; padding: 7px 10px; border: 1px solid var(--line);
  border-radius: 6px; font: inherit; color: var(--ink); background: var(--card); max-width: 460px; }
.rv-bar-r { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.rv-disabled { opacity: .45; pointer-events: none; cursor: default; }

.rv-layout { display: grid; grid-template-columns: 340px 1fr; gap: 24px;
  align-items: start; margin-top: 8px; }
.rv-media { position: sticky; top: 78px; }
.rv-imgs { display: flex; flex-direction: column; gap: 10px; }
.rv-imgs img { width: 100%; border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: var(--card); }
.rv-conf { margin: 10px 0 4px; background: #fffbeb; border: 1px solid #fde68a;
  border-radius: 6px; padding: 8px 10px; color: #92400e; font-size: 13px; }
.rv-key { font-size: 12px; word-break: break-all; }

.rv-form { margin: 0; max-width: 720px; }
.rv-form .row label { flex: 1; }

/* Checkbox grid (shared by review + edit) */
.chk-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 20px; margin-bottom: 14px; }
.chk-grid .chk { margin-bottom: 0; }
.rv-spacer { visibility: hidden; }
.rv-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.rv-hint { margin-top: 10px; font-size: 13px; }

.rv-done { background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 34px 26px; text-align: center; max-width: 520px; }
.rv-done-icon { font-size: 40px; margin: 0 0 6px; }
.rv-done h2 { margin: 0 0 8px; }

@media (max-width: 900px) {
  .rv-layout { grid-template-columns: 1fr; }
  .rv-media { position: static; }

  .cd-top { grid-template-columns: 1fr; }
  .cd-media { position: static; }
  .cd-channels { grid-template-columns: 1fr; }
  .cd-dl { grid-template-columns: 120px 1fr; }
  .cd-form-grid { grid-template-columns: 1fr 1fr; }
}

.form { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; max-width: 720px; box-shadow: var(--shadow-sm); }
.form label { display: block; margin-bottom: 14px; font-size: 13px; color: var(--muted); }
.form label input, .form label select, .form label textarea { display: block; width: 100%; margin-top: 5px;
  color: var(--ink); font-size: 14px; }
.form .row { display: flex; gap: 12px; }
.form .row label { flex: 1; }
.form .chk { display: flex; align-items: center; gap: 6px; }
.form .chk input { width: auto; margin: 0; }
/* Title field: char counter + rebuild button */
.title-count { display: inline-block; margin-top: 4px; font-size: 12px; }
.title-count.over { color: #b42318; font-weight: 600; }
.title-rebuild { margin-top: 6px; margin-left: 10px; padding: 3px 10px; font-size: 12px;
  background: #fff; color: var(--accent); border: 1px solid var(--line); border-radius: 6px;
  cursor: pointer; width: auto; display: inline-block; vertical-align: middle; }
.title-rebuild:hover { background: #f4f7fa; border-color: var(--accent); }

.actions { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.actions-top { margin-top: 0; margin-bottom: 14px; }

/* Marketplace quick-search links on the pricing list (Vinted / eBay) */
.mkt-links { display: inline-flex; gap: 5px; margin-left: 8px; vertical-align: middle; }
.mkt {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 4px;
  font-weight: 700; font-size: 12px; line-height: 1;
  text-decoration: none; color: #fff; opacity: .9;
}
.mkt:hover { opacity: 1; }
.mkt-vinted { background: #09b1ba; }            /* Vinted teal */
.mkt-ebay   { background: #e53238; }            /* eBay red */

/* ── Pager ─────────────────────────────────────────────────────────────────── */
.pager { display: flex; align-items: center; gap: 10px; margin: 18px 0; font-size: 14px; }
.pager a { padding: 7px 13px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; }
.pager a:hover { text-decoration: none; background: #f2f7fb; }
.pager .disabled { padding: 7px 13px; color: #c3c8ce; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.pager .pageinfo { color: var(--muted); }

.linkbtn { background: none; color: #b00020; padding: 0 0 0 10px; font: inherit; cursor: pointer; }
.linkbtn:hover { text-decoration: underline; }

.pxin { width: 82px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; font: inherit; }
.pxin:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(47,127,176,.13); }
.rowactions { white-space: nowrap; }
.rowactions button[type=submit] { padding: 4px 10px; margin-right: 4px; }
.rowactions a { margin: 0 6px; }

.dangerbox { border: 1px solid #f0c0c0; background: #fff5f5; border-radius: var(--radius); padding: 16px; max-width: 560px; }
.dangerbox input { padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; margin-right: 8px; }


/* ── Card Index: pill search, chips, filter bar, poster grid ─────────────────── */
.cardsearch { position: relative; margin: 4px 0 16px; }
.cs-icon { position: absolute; left: 18px; top: 50%; transform: translateY(-50%);
  color: var(--muted); display: flex; pointer-events: none; }
.cs-input { width: 100%; padding: 15px 20px 15px 50px; font-size: 16px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--card);
  box-shadow: var(--shadow-sm); color: var(--ink); }
.cs-input::placeholder { color: #9aa1ab; }
.cs-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(47,127,176,.15); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.chip { display: inline-block; padding: 7px 16px; border-radius: 999px; font-size: 14px;
  font-weight: 500; border: 1px solid var(--line); background: var(--card); color: var(--ink);
  transition: background .12s, border-color .12s, color .12s; }
.chip:hover { text-decoration: none; background: #f2f7fb; border-color: #cdd5dd; }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip.active:hover { background: var(--accent); filter: brightness(1.05); }

.filterbar { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow-sm); margin-bottom: 18px; }
.fb-field { display: flex; flex-direction: column; gap: 5px; min-width: 150px; flex: 1; }
.fb-field label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em;
  font-weight: 600; color: var(--muted); }
.fb-field select { padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  font: inherit; background: #fff; color: var(--ink); }
.fb-field select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(47,127,176,.13); }
.fb-clear { flex: 0 0 auto; min-width: 0; }
.fb-clear .clear { padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: #fff; color: var(--muted); font-size: 14px; }
.fb-clear .clear:hover { background: #f2f7fb; text-decoration: none; }

.countline { margin: 0 0 14px; }
.countline strong { color: var(--ink); }

.gridhead { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0; }
.gridhead .countline { margin: 0; }
.sizetoggle { display: inline-flex; align-items: center; gap: 6px; }
.sizetoggle button { background: #fff; color: var(--ink); border: 1px solid var(--line);
  padding: 4px 11px; border-radius: 6px; font: inherit; cursor: pointer; line-height: 1; }
.sizetoggle button:hover { background: #f0f6fb; }
.sizetoggle button.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.poster-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(152px, 1fr));
  gap: 20px 16px; margin-top: 4px; }
/* Image size switcher (default L = 152px, matches the base above) */
.poster-grid.size-s { grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 16px 12px; }
.poster-grid.size-m { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 18px 14px; }
.poster-grid.size-l { grid-template-columns: repeat(auto-fill, minmax(152px, 1fr)); gap: 20px 16px; }
.poster { display: flex; flex-direction: column; gap: 6px; color: var(--ink); }
.poster:hover { text-decoration: none; }
.poster-img { position: relative; aspect-ratio: 2.5 / 3.5; border-radius: 8px; overflow: hidden;
  background: #eef0f2; box-shadow: var(--shadow); transition: transform .14s ease, box-shadow .14s ease; }
.poster:hover .poster-img { transform: translateY(-4px);
  box-shadow: 0 8px 26px rgba(16,24,40,.16); }
.poster-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.poster-noimg { width: 100%; height: 100%; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px; color: #aab1bb; }
.poster-num { font-size: 13px; font-weight: 600; color: #97a0ab; }
.poster-stock { position: absolute; left: 8px; bottom: 8px; background: rgba(20,24,29,.78);
  color: #fff; font-size: 11px; font-weight: 500; padding: 2px 8px; border-radius: 999px;
  backdrop-filter: blur(2px); }
/* Live-on-channel badges, stacked top-right of the poster image. */
.poster-live { position: absolute; top: 8px; right: 8px; display: flex; gap: 4px; }
.live-badge { font-size: 10px; font-weight: 700; letter-spacing: .01em; line-height: 1;
  padding: 3px 6px; border-radius: 5px; color: #fff; box-shadow: 0 1px 3px rgba(16,24,40,.25); }
.live-ebay { background: #e53238; }        /* eBay red */
.live-shopify { background: #5a8e3a; }      /* Shopify green */
.poster-title { font-size: 14px; font-weight: 600; line-height: 1.3; letter-spacing: -.005em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.poster-caption { font-size: 12.5px; color: var(--muted); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }

@media (max-width: 620px) {
  .poster-grid, .poster-grid.size-m, .poster-grid.size-l {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 16px 12px; }
  .poster-grid.size-s { grid-template-columns: repeat(auto-fill, minmax(98px, 1fr)); gap: 14px 10px; }
  .cs-input { font-size: 15px; padding: 13px 18px 13px 46px; }
}

/* ── Mobile top bar + slide-in nav drawer ──────────────────────────────────── */
/* Hidden on desktop; the sticky sidebar handles navigation there. */
.topbar { display: none; }
.nav-toggle { display: none; }
.nav-scrim { display: none; }

@media (max-width: 820px) {
  /* Fixed top bar with brand + hamburger. */
  .topbar { display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 40; background: var(--sidebar); color: #fff;
    padding: 12px 16px; }
  .topbar .brand { color: #fff; font-weight: 700; font-size: 19px; letter-spacing: -.01em; }
  .topbar .brand span { color: var(--accent); }
  .topbar .brand:hover { text-decoration: none; }
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center;
    background: none; border: 0; color: #fff; padding: 6px; cursor: pointer; border-radius: 6px; }
  .nav-toggle:hover { background: rgba(255,255,255,.08); }

  /* Sidebar becomes an off-canvas drawer, hidden until body.nav-open. */
  body.app { flex-direction: column; }
  .sidebar { position: fixed; top: 0; left: 0; z-index: 50;
    width: 82%; max-width: 320px; height: 100%; min-width: 0;
    padding: 20px 14px; overflow-y: auto;
    transform: translateX(-100%); transition: transform .22s ease; }
  body.nav-open .sidebar { transform: translateX(0); box-shadow: 0 0 40px rgba(0,0,0,.4); }
  .sidebar > .brand { display: block; }   /* keep the in-drawer brand as a home link */

  /* Dim + tap-to-close backdrop. */
  .nav-scrim { display: block; position: fixed; inset: 0; z-index: 45;
    background: rgba(0,0,0,.45); opacity: 0; pointer-events: none; transition: opacity .22s ease; }
  body.nav-open .nav-scrim { opacity: 1; pointer-events: auto; }

  main { padding: 20px 18px; }
}
