/* ───────────────────────────────────────────────────────────
   Rook's Game Shop — brand system
   paper + ink + vermilion · chunky display · mono logistics
─────────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,600;12..96,700;12..96,800&family=Hanken+Grotesk:wght@400;500;600;700&family=Space+Grotesk:wght@500;600;700&family=Archivo:wght@600;700;800&family=Space+Mono:wght@400;700&display=swap');

*, *::before, *::after { box-sizing: border-box; }

:root {
  --paper:  #F4EEE1;
  --paper-2:#EDE6D5;
  --surface:#FFFFFF;
  --surface-2:#FBF7EF;
  --ink:    #221D16;
  --ink-2:  #5C5547;
  --ink-3:  #908876;
  --line:   rgba(34,29,22,0.10);
  --line-2: rgba(34,29,22,0.16);
  --accent: #D6452B;          /* rook red / vermilion — tweakable */
  --accent-2:#B7361F;
  --on-accent:#FFF6EE;
  --gold:   #C2912F;
  --teal:   #2E7D74;
  --good:   #2E7D5B;
  --shadow-sm: 0 1px 2px rgba(34,29,22,0.06), 0 2px 8px rgba(34,29,22,0.05);
  --shadow-md: 0 6px 18px rgba(34,29,22,0.10), 0 2px 6px rgba(34,29,22,0.06);
  --shadow-lg: 0 18px 44px rgba(34,29,22,0.18);
  --r-sm: 12px; --r-md: 18px; --r-lg: 26px; --r-xl: 34px;
  --ff-display: 'Bricolage Grotesque', system-ui, sans-serif;
  --ff-ui: 'Hanken Grotesk', system-ui, sans-serif;
  --ff-mono: 'Space Mono', ui-monospace, monospace;
}

.rps.dark {
  --paper:  #16130E;
  --paper-2:#1C1813;
  --surface:#211C15;
  --surface-2:#262017;
  --ink:    #F3EDE0;
  --ink-2:  #B7AE9C;
  --ink-3:  #837B6A;
  --line:   rgba(243,237,224,0.12);
  --line-2: rgba(243,237,224,0.20);
  --on-accent:#FFF6EE;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
  --shadow-md: 0 8px 22px rgba(0,0,0,0.5);
  --shadow-lg: 0 20px 50px rgba(0,0,0,0.6);
}

body { margin: 0; background: #2a2724; }

/* ── app shell ──────────────────────────────────────────────
   Mobile first: one column, bottom tab bar, edge to edge.
   >=768px  tablet  — nav becomes an icon rail, content gets a column
   >=1180px desktop — nav gets labels, Ops view unlocks
   dvh (not vh) so mobile browser chrome doesn't clip the tab bar.
   Breakpoints mirror BP in app.jsx; change both together.
─────────────────────────────────────────────────────────── */
.shell {
  display: flex;
  width: 100%;
  height: 100vh; height: 100dvh;
  overflow: hidden;
}
.pane { flex: 1; min-width: 0; position: relative; }

/* readable measure for the storefront; Ops opts out and uses the width */
.col { width: 100%; }

.rps {
  /* clears the browser's own status bar / notch — no faked one to dodge */
  --top-pad: calc(env(safe-area-inset-top, 0px) + 18px);
  font-family: var(--ff-ui);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  height: 100%;
  position: relative;
}

/* ── app shell layout ── */
.app-root { height: 100%; display: flex; flex-direction: column; position: relative; overflow: hidden; }
.scroll { flex: 1; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.scroll::-webkit-scrollbar { display: none; }

/* type helpers */
.t-display { font-family: var(--ff-display); font-weight: 800; letter-spacing: -0.02em; line-height: 0.98; }
.t-mono { font-family: var(--ff-mono); }
.kicker {
  font-family: var(--ff-mono); font-size: 11px; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3);
}
.muted { color: var(--ink-2); }

/* buttons */
.btn {
  font-family: var(--ff-ui); font-weight: 700; font-size: 16px;
  border: none; cursor: pointer; border-radius: 9999px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform .12s ease, filter .15s ease, background .15s ease;
  user-select: none; -webkit-tap-highlight-color: transparent; white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn-accent { background: var(--accent); color: var(--on-accent); padding: 15px 22px; box-shadow: 0 6px 16px color-mix(in oklab, var(--accent) 40%, transparent); }
.btn-accent:hover { filter: brightness(1.04); }
.btn-ghost { background: transparent; color: var(--ink); padding: 13px 18px; box-shadow: inset 0 0 0 1.5px var(--line-2); }
.btn-soft { background: var(--surface-2); color: var(--ink); padding: 13px 18px; box-shadow: inset 0 0 0 1px var(--line); }
.btn-block { width: 100%; }

/* cards */
.card { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.hairline { box-shadow: inset 0 0 0 1px var(--line); }

/* chips */
.chip {
  font-family: var(--ff-ui); font-weight: 600; font-size: 13.5px;
  padding: 8px 14px; border-radius: 9999px; cursor: pointer; white-space: nowrap;
  background: var(--surface); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line);
  transition: all .14s ease; -webkit-tap-highlight-color: transparent;
}
.chip.on { background: var(--ink); color: var(--paper); box-shadow: none; }

/* category rail — the shelves */
.cat-rail { gap: 8px; padding-top: 0; }
.cat-chip {
  font-family: var(--ff-ui); font-weight: 600; font-size: 13px;
  display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0;
  padding: 8px 13px; border: none; border-radius: 9999px; white-space: nowrap;
  background: var(--surface); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line);
  cursor: pointer; transition: all .14s ease; -webkit-tap-highlight-color: transparent;
}
.cat-chip.on { background: var(--ink); color: var(--paper); box-shadow: none; cursor: default; }
.cat-chip.soon { color: var(--ink-3); background: transparent; }
.cat-chip.soon:hover { background: var(--surface); color: var(--ink-2); }
.cat-chip em {
  font-family: var(--ff-mono); font-style: normal; font-size: 8.5px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase; padding: 2px 5px; border-radius: 5px;
  background: var(--paper-2); color: var(--ink-3);
}

/* badges */
.badge {
  font-family: var(--ff-mono); font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; padding: 4px 8px; border-radius: 7px; display: inline-flex; align-items: center; gap: 5px;
}
.badge-gold { background: color-mix(in oklab, var(--gold) 18%, var(--surface)); color: var(--gold); }
.badge-accent { background: color-mix(in oklab, var(--accent) 14%, var(--surface)); color: var(--accent); }
.badge-good { background: color-mix(in oklab, var(--good) 16%, var(--surface)); color: var(--good); }
.badge-low { background: color-mix(in oklab, var(--gold) 20%, var(--surface)); color: var(--gold); }

/* tab bar */
.tabbar {
  display: flex; align-items: stretch; justify-content: space-around;
  padding: 8px 10px calc(env(safe-area-inset-bottom, 0px) + 10px); gap: 4px;
  background: color-mix(in oklab, var(--surface) 86%, transparent);
  backdrop-filter: blur(16px) saturate(160%); -webkit-backdrop-filter: blur(16px) saturate(160%);
  box-shadow: 0 -0.5px 0 var(--line), 0 -8px 24px rgba(34,29,22,0.05);
  position: relative; z-index: 20;
}
.tab { flex: 1; background: none; border: none; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 0; color: var(--ink-3); -webkit-tap-highlight-color: transparent; }
.tab.on { color: var(--accent); }
.tab-label { font-size: 10.5px; font-weight: 700; font-family: var(--ff-ui); letter-spacing: 0.01em; }
.tab .cart-dot {
  position: absolute; top: 2px; right: calc(50% - 18px);
  min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9999px;
  background: var(--accent); color: var(--on-accent);
  font-family: var(--ff-mono); font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

/* pushed screen */
.screen-push { position: absolute; inset: 0; background: var(--paper); z-index: 30; display: flex; flex-direction: column; }
@keyframes slideIn { from { transform: translateX(100%); } to { transform: translateX(0); } }
@keyframes slideOut { from { transform: translateX(0); } to { transform: translateX(100%); } }
.anim-in { animation: slideIn .26s cubic-bezier(.32,.72,0,1); }
/* transform-only so a paused/backgrounded frame never strands content invisible */
@keyframes fadeUp { from { transform: translateY(10px); } to { transform: translateY(0); } }
.fade-up { animation: fadeUp .4s cubic-bezier(.2,.7,.2,1) both; }
@keyframes popIn { 0% { transform: scale(.6); } 60% { transform: scale(1.06); } 100% { transform: scale(1); } }
.pop-in { animation: popIn .5s cubic-bezier(.2,.8,.2,1) both; }

/* sheen for pack foil */
@keyframes sheen { 0% { transform: translateX(-120%) skewX(-18deg); } 100% { transform: translateX(220%) skewX(-18deg); } }

/* number stepper */
.stepper { display: inline-flex; align-items: center; background: var(--surface-2); border-radius: 9999px; box-shadow: inset 0 0 0 1px var(--line); }
.stepper button { width: 38px; height: 38px; border: none; background: none; cursor: pointer; color: var(--ink); display: flex; align-items: center; justify-content: center; -webkit-tap-highlight-color: transparent; }
.stepper button:active { transform: scale(.9); }
.stepper .val { font-family: var(--ff-mono); font-weight: 700; font-size: 16px; min-width: 26px; text-align: center; }

.divider { height: 1px; background: var(--line); border: none; margin: 0; }

/* progress */
.track { height: 10px; border-radius: 9999px; background: var(--paper-2); overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.track > span { display: block; height: 100%; border-radius: 9999px; background: linear-gradient(90deg, var(--gold), color-mix(in oklab, var(--gold) 60%, var(--accent))); transition: width .5s cubic-bezier(.2,.7,.2,1); }

/* hide scrollbars on horizontal rails */
.rail { display: flex; gap: 14px; overflow-x: auto; scrollbar-width: none; padding: 2px 20px 4px; }
.rail::-webkit-scrollbar { display: none; }

/* mini-cart floating bar */
@keyframes barUp { from { transform: translateY(140%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.minicart {
  position: absolute; left: 14px; right: 14px; z-index: 18;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 80px);
  border-radius: 18px; padding: 12px 14px 12px 16px;
  background: var(--ink); color: var(--paper);
  display: flex; align-items: center; gap: 12px; cursor: pointer; border: none;
  box-shadow: 0 12px 30px rgba(34,29,22,0.28); animation: barUp .3s cubic-bezier(.32,.72,0,1);
  -webkit-tap-highlight-color: transparent; text-align: left; width: calc(100% - 28px);
}
.minicart:active { transform: scale(0.985); }

/* toast */
@keyframes toastIn { from { transform: translate(-50%, -18px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }
.toast {
  position: absolute; top: calc(var(--top-pad) + 46px); left: 50%; z-index: 80;
  display: flex; align-items: center; gap: 11px; padding: 11px 14px 11px 12px;
  border-radius: 14px; background: var(--ink); color: var(--paper);
  box-shadow: var(--shadow-lg); animation: toastIn .26s cubic-bezier(.2,.8,.2,1);
  max-width: calc(100% - 32px);
}

/* badge pop */
@keyframes badgePop { 0% { transform: scale(1); } 40% { transform: scale(1.5); } 100% { transform: scale(1); } }
.pop { animation: badgePop .4s cubic-bezier(.2,.8,.2,1); }

/* sold-out treatment */
.soldout { filter: grayscale(0.8) brightness(0.96); opacity: 0.6; }

/* ═══════════════════════════════════════════════════════════
   v2.0.0 — Clubhouse: cards, binder, wall, delivery
═══════════════════════════════════════════════════════════ */

/* holo foil shimmer on CardFace */
@keyframes holoShift { 0% { background-position: 0% 50%; } 100% { background-position: 220% 50%; } }
.holo-foil { background-size: 220% 220%; animation: holoShift 3.6s linear infinite; }

/* sub-tab segmented control (Wall / Binder section switch) */
.subtabs { display: flex; gap: 4px; padding: 4px; border-radius: 9999px; background: var(--paper-2); box-shadow: inset 0 0 0 1px var(--line); }
.subtab { flex: 1; border: none; background: none; cursor: pointer; padding: 9px 6px; border-radius: 9999px; font-family: var(--ff-ui); font-weight: 700; font-size: 13px; color: var(--ink-2); transition: all .14s; -webkit-tap-highlight-color: transparent; }
.subtab.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

/* pack art idle float — splash deal-in */
@keyframes packFloat { 0%,100% { transform: translateY(0) rotate(-1.5deg); } 50% { transform: translateY(-14px) rotate(1.5deg); } }
.pack-float { animation: packFloat 3.4s ease-in-out infinite; }

/* hit glow — behind a holo/chase card in the viewer */
@keyframes glowPulse { 0%,100% { opacity: .55; transform: translate(-50%,-50%) scale(1); } 50% { opacity: .85; transform: translate(-50%,-50%) scale(1.12); } }
.hit-glow { position: absolute; top: 50%; left: 50%; width: 120%; aspect-ratio: 1; transform: translate(-50%,-50%); border-radius: 9999px;
  background: radial-gradient(closest-side, var(--hit-glow, #FFDD8A) 0%, transparent 68%); animation: glowPulse 2.2s ease-in-out infinite; pointer-events: none; }

/* ── Binder grid ── */
.binder-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
/* a <button>, so the reset matters: the binder's only write path is a slot tap */
.slot { position: relative; aspect-ratio: 5 / 7; border-radius: 9px; overflow: hidden; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: transform .12s; padding: 0; border: none; background: none; font: inherit; color: inherit; width: 100%; }
.slot:active { transform: scale(.95); }
.slot.locked { background: var(--paper-2); box-shadow: inset 0 0 0 1px var(--line); display: flex; align-items: center; justify-content: center; }
.slot.locked .q { font-family: var(--ff-display); font-weight: 800; font-size: 20px; color: var(--ink-3); opacity: .5; }

/* set ring (completion) */
.ring { transform: rotate(-90deg); }
.ring circle { fill: none; stroke-linecap: round; }

/* ── Delivery timeline ── */
.timeline { position: relative; padding-left: 6px; }
.tl-row { display: flex; gap: 14px; align-items: flex-start; padding-bottom: 18px; position: relative; }
.tl-row:last-child { padding-bottom: 0; }
.tl-dot { width: 18px; height: 18px; border-radius: 9999px; flex-shrink: 0; margin-top: 1px; position: relative; z-index: 2; box-shadow: 0 0 0 3px var(--paper); }
.tl-line { position: absolute; left: 8px; top: 18px; bottom: -2px; width: 2px; background: var(--line-2); z-index: 1; }
.tl-row:last-child .tl-line { display: none; }
@keyframes pingRing { 0% { transform: scale(1); opacity: .6; } 100% { transform: scale(2.4); opacity: 0; } }
.tl-ping { position: absolute; inset: 0; border-radius: 9999px; background: var(--accent); animation: pingRing 1.8s ease-out infinite; }

/* ═══════════════════════════════════════════════════════════
   Boot splash
═══════════════════════════════════════════════════════════ */
.splash {
  position: absolute; inset: 0; z-index: 90;
  background:
    radial-gradient(120% 60% at 50% 8%, color-mix(in oklab, var(--accent) 12%, var(--paper)) 0%, var(--paper) 60%);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 30px; padding: 0 28px;
}
@keyframes splashOut { from { opacity: 1; transform: scale(1); } to { opacity: 0; transform: scale(1.05); } }
.splash-out { animation: splashOut .48s cubic-bezier(.4,0,.7,.2) forwards; pointer-events: none; }

/* fanned packs */
.splash-fan { position: relative; width: 240px; height: 184px; display: flex; align-items: center; justify-content: center; }
.splash-pack { position: absolute; top: 50%; left: 50%; filter: drop-shadow(0 14px 26px rgba(34,29,22,0.22)); }
@keyframes packDealL { from { transform: translate(-50%,-50%) rotate(0) translateX(0); opacity: 0; } to { transform: translate(-50%,-50%) rotate(-13deg) translateX(-58px); opacity: 1; } }
@keyframes packDealR { from { transform: translate(-50%,-50%) rotate(0) translateX(0); opacity: 0; } to { transform: translate(-50%,-50%) rotate(13deg) translateX(58px); opacity: 1; } }
@keyframes packDealC { from { transform: translate(-50%,-50%) translateY(16px) scale(.86); opacity: 0; } to { transform: translate(-50%,-50%) translateY(0) scale(1); opacity: 1; } }
.splash-pack-l { z-index: 1; transform: translate(-50%,-50%) rotate(-13deg) translateX(-58px); animation: packDealL .5s cubic-bezier(.2,.8,.2,1) .06s both; }
.splash-pack-r { z-index: 1; transform: translate(-50%,-50%) rotate(13deg) translateX(58px); animation: packDealR .5s cubic-bezier(.2,.8,.2,1) .14s both; }
.splash-pack-c { z-index: 2; transform: translate(-50%,-50%); animation: packDealC .46s cubic-bezier(.2,.8,.2,1) .22s both; }
/* center pack keeps floating after it's dealt in */
.splash-pack-c.pack-float { animation: packDealC .46s cubic-bezier(.2,.8,.2,1) .22s both, packFloat 3.4s ease-in-out .7s infinite; }

/* wordmark */
.splash-mark { display: flex; align-items: center; gap: 11px; animation: fadeUp .5s cubic-bezier(.2,.7,.2,1) .34s both; }
.splash-rook { width: 46px; height: 46px; border-radius: 14px; display: flex; align-items: center; justify-content: center;
  background: var(--surface); box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--line); flex-shrink: 0; }
.splash-kicker { font-family: var(--ff-mono); font-size: 9.5px; font-weight: 700; letter-spacing: 0.16em; color: var(--accent); }
.splash-title { font-size: 27px; color: var(--ink); margin-top: 2px; }

/* loading bar + status */
.splash-bar { width: 200px; display: flex; flex-direction: column; align-items: center; gap: 11px; animation: fadeUp .5s cubic-bezier(.2,.7,.2,1) .42s both; }
.splash-bar .track { width: 100%; height: 7px; }
.splash-status { font-size: 11px; color: var(--ink-3); letter-spacing: 0.02em; }
@keyframes splashDots { 0% { content: ''; } 25% { content: '.'; } 50% { content: '..'; } 75%,100% { content: '...'; } }
.splash-dots::after { content: '...'; animation: splashDots 1.1s steps(1) infinite; }

/* ═══════════════════════════════════════════════════════════
   Responsive: tablet + desktop
   Mobile needs no rules here — it is the base stylesheet above.
═══════════════════════════════════════════════════════════ */

.mono { font-family: var(--ff-mono); }

/* side nav — hidden on mobile (no markup rendered), icon rail on tablet,
   labelled sidebar on desktop */
.sidenav {
  display: flex; flex-direction: column; gap: 6px;
  width: 76px; flex-shrink: 0;
  padding: 18px 10px calc(env(safe-area-inset-bottom, 0px) + 14px);
  background: var(--surface);
  box-shadow: inset -1px 0 0 var(--line);
  z-index: 30;
}
.sidenav-brand { display: flex; align-items: center; gap: 10px; padding: 4px 4px 16px; }
.sidenav-mark {
  width: 38px; height: 38px; border-radius: 11px; background: var(--ink);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.sidenav-word { display: none; min-width: 0; }
.sidenav-items { display: flex; flex-direction: column; gap: 4px; }
.sidenav-item {
  position: relative; display: flex; align-items: center; gap: 12px;
  padding: 11px; border: none; border-radius: 13px; cursor: pointer;
  background: none; color: var(--ink-3); font-family: var(--ff-ui);
  font-weight: 700; font-size: 14px; text-align: left;
  transition: background .14s ease, color .14s ease;
  -webkit-tap-highlight-color: transparent;
}
.sidenav-item:hover { background: var(--surface-2); color: var(--ink-2); }
.sidenav-item.on { background: color-mix(in oklab, var(--accent) 12%, var(--surface)); color: var(--accent); }
.sidenav-item.admin { margin-top: auto; }
.sidenav-item.admin::before {
  content: ''; position: absolute; top: -9px; left: 11px; right: 11px;
  height: 1px; background: var(--line);
}
.sidenav-label { display: none; white-space: nowrap; }
.sidenav-dot {
  position: absolute; top: 7px; left: 26px;
  min-width: 16px; height: 16px; padding: 0 4px; border-radius: 9999px;
  background: var(--accent); color: var(--on-accent);
  font-family: var(--ff-mono); font-size: 9.5px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.sidenav-cart {
  display: flex; align-items: center; gap: 10px; margin-top: 10px;
  padding: 12px 11px; border: none; border-radius: 13px; cursor: pointer;
  background: var(--ink); color: var(--paper);
  font-family: var(--ff-ui); font-weight: 700; font-size: 13.5px;
  -webkit-tap-highlight-color: transparent;
}
.sidenav-cart:active { transform: scale(.98); }

/* ── tablet ─────────────────────────────────────────────── */
@media (min-width: 768px) {
  /* the phone-sized top padding was for a notch that isn't there on a tablet */
  .rps { --top-pad: 26px; }

  .col { max-width: 720px; margin: 0 auto; }

  /* the horizontal pack rail has room to become a grid */
  .rail {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px; overflow-x: visible; padding: 2px 20px 4px;
  }
  .rail > button { width: 100% !important; }
  /* chip rows stay a flex row — they are filters, not cards */
  .rail:has(> .chip) { display: flex; }

  .binder-grid { grid-template-columns: repeat(6, 1fr); gap: 10px; }

  /* pushed screens become a centred sheet instead of a full-bleed slide-over.
     The slide-in transform would fight the centring transform, so swap the
     keyframes rather than layering them. */
  .screen-push {
    inset: 50% auto auto 50%;
    transform: translate(-50%, -50%);
    width: min(560px, calc(100% - 56px));
    height: auto; max-height: calc(100% - 56px);
    border-radius: var(--r-xl); overflow: hidden;
    box-shadow: var(--shadow-lg), 0 0 0 1px var(--line-2);
  }
  @keyframes sheetIn {
    from { transform: translate(-50%, calc(-50% + 16px)); opacity: 0; }
    to   { transform: translate(-50%, -50%); opacity: 1; }
  }
  .screen-push.anim-in { animation: sheetIn .24s cubic-bezier(.2,.8,.2,1); }

  .minicart { left: auto; right: 24px; width: min(420px, calc(100% - 48px)); bottom: 24px; }
  .toast { top: 24px; }
}

/* ── desktop ────────────────────────────────────────────── */
@media (min-width: 1180px) {
  .sidenav { width: 216px; padding: 22px 14px; }
  .sidenav-word, .sidenav-label { display: block; }
  .sidenav-item { padding: 11px 13px; }
  .sidenav-dot { position: static; margin-left: auto; }

  .col { max-width: 840px; }
  .binder-grid { grid-template-columns: repeat(8, 1fr); }
  .rail { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
}

/* ═══════════════════════════════════════════════════════════
   Ops — desktop-only admin view
═══════════════════════════════════════════════════════════ */
.col-ops { max-width: 1400px; margin: 0 auto; padding: 0 32px; }

.ops-hd {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 20px; padding: var(--top-pad) 0 22px;
}
.ops-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px; margin-bottom: 18px;
}
.ops-stat { padding: 16px 18px; }

.ops-grid {
  display: grid; gap: 16px;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  align-items: start;
}
.ops-panel { padding: 18px 20px 20px; min-width: 0; }
.ops-panel-wide { grid-column: 1 / -1; }
.ops-panel-hd {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 14px; margin-bottom: 16px;
}
.ops-daytabs { flex-shrink: 0; width: auto; }
.ops-daytabs .subtab { padding: 7px 13px; flex: none; }

/* order book */
.ops-tablewrap { overflow-x: auto; margin: 0 -4px; }
.ops-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ops-table th {
  text-align: left; padding: 0 10px 9px; white-space: nowrap;
  font-family: var(--ff-mono); font-size: 10px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3);
  border-bottom: 1px solid var(--line);
}
.ops-table td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.ops-table tr:last-child td { border-bottom: none; }
.ops-table tbody tr:hover { background: var(--surface-2); }
.ops-table .num { text-align: right; }
.ops-table .mono { font-family: var(--ff-mono); font-size: 12px; }

/* sourcing pipeline */
.ops-pipegrid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.ops-lot { padding: 15px 16px; }
/* three across, two rows — five narrow columns collided at card width */
.ops-lot-nums {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px 10px; padding-top: 12px; border-top: 1px solid var(--line);
}
.ops-lot-nums .kicker { font-size: 9px; letter-spacing: 0.1em; }
.ops-num {
  font-family: var(--ff-mono); font-weight: 700; font-size: 13px;
  margin-top: 3px; font-variant-numeric: tabular-nums;
}

/* Ops sub-navigation */
.ops-viewtabs { width: max-content; margin: var(--top-pad) 0 0; }
.ops-viewtabs .subtab { flex: none; padding: 9px 18px; }
.ops-viewtabs + .fade-up .ops-hd { padding-top: 18px; }

/* ── inventory ── */
.inv-search {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
  padding: 8px 12px; border-radius: 9999px;
  background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line);
}
.inv-search input {
  border: none; background: none; outline: none; width: 210px;
  font-family: var(--ff-ui); font-size: 13px; color: var(--ink);
}
.inv-search input::placeholder { color: var(--ink-3); }
.inv-search button {
  border: none; background: none; cursor: pointer; color: var(--ink-3);
  font-size: 17px; line-height: 1; padding: 0 2px;
}

.inv-controls {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-bottom: 14px; flex-wrap: wrap;
}
.inv-sort { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.inv-sort select {
  font-family: var(--ff-ui); font-size: 13px; font-weight: 600; color: var(--ink);
  padding: 7px 10px; border-radius: 9px; cursor: pointer;
  background: var(--surface-2); border: none; box-shadow: inset 0 0 0 1px var(--line);
}

/* ── Singles storefront (customer side) ──
   One cell per SKU. Mobile is a single column so the condition and price stay
   readable; wider viewports fit more cards per row rather than stretching them. */
.singles-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap; padding: 16px 20px 12px;
}
.singles-grid { display: grid; grid-template-columns: 1fr; gap: 12px; padding: 0 20px; }
.single-cell {
  display: flex; gap: 14px; align-items: stretch; text-align: left;
  padding: 12px; border: none; cursor: pointer; width: 100%;
  -webkit-tap-highlight-color: transparent; transition: transform .12s ease;
}
.single-cell:active { transform: scale(.99); }
.single-cell-body { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.cond-swap {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 11px 13px; border: none; cursor: pointer;
  -webkit-tap-highlight-color: transparent; transition: transform .12s ease;
}
.cond-swap:active { transform: scale(.99); }
@media (min-width: 768px) {
  .singles-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1180px) {
  .singles-grid { grid-template-columns: repeat(3, 1fr); }
}

.inv-table td, .inv-table th { padding-left: 8px; padding-right: 8px; }
.inv-row { cursor: pointer; }
.inv-row.open { background: var(--surface-2); }
.inv-row.open td { border-bottom-color: transparent; }
.inv-detail > td { background: var(--surface-2); padding: 4px 14px 16px; }
.inv-detail-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px 16px;
}
.inv-prov {
  font-size: 11.5px; line-height: 1.55; margin: 14px 0 0;
  padding-top: 12px; border-top: 1px solid var(--line);
}
.inv-table tfoot td {
  padding-top: 12px; border-top: 1px solid var(--line-2); border-bottom: none;
}

/* Ops is desktop-only, but keep it legible if a narrow window sneaks in */
@media (max-width: 1320px) {
  .ops-grid { grid-template-columns: minmax(0, 1fr); }
  .col-ops { padding: 0 20px; }
}

/* ═══════════════════════════════════════════════════════════
   Lens — real-time card translation
   The stage is dark regardless of theme: it is a camera viewfinder, and
   paper-coloured chrome around a video feed reads as a bug.
═══════════════════════════════════════════════════════════ */
/* Viewport-fixed rather than inset into .app-root. A viewfinder has to own a
   known height — the stage/sheet split is a proportion of it — and .app-root
   is as tall as whatever tab is behind it. */
.lens {
  position: fixed; inset: 0;
  height: 100vh; height: 100dvh;
  /* Rebind the theme tokens rather than overriding rule by rule: shared pieces
     (PushHeader, badges, icons) set their colours inline from these vars, and
     an inline style can't be beaten by a class selector. Rebinding makes them
     all follow the viewfinder into the dark in one move — including in light
     mode, where the header would otherwise sit as a paper strip above a
     camera feed. */
  --paper: #14110c;
  --paper-2: #1C1813;
  --surface: #221D16;
  --surface-2: #2A241B;
  --ink: #F3EDE0;
  --ink-2: #B7AE9C;
  --ink-3: #8F8776;
  --line: rgba(243,237,224,0.12);
  --line-2: rgba(243,237,224,0.20);
  background: var(--paper); color: var(--ink);
}

/* the engine badge in the header — FRAME vs OCR is load-bearing information,
   so it is always on screen, never behind a menu */
.lens-badge {
  font-family: var(--ff-mono); font-size: 10px; font-weight: 700;
  letter-spacing: 0.12em; padding: 6px 10px; border-radius: 8px;
  background: color-mix(in oklab, var(--gold) 22%, transparent); color: #E9C978;
  flex-shrink: 0;
}
.lens-badge.live { background: color-mix(in oklab, var(--good) 26%, transparent); color: #7FD1A8; }

.lens-stage {
  flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center;
  padding: 0 12px; overflow: hidden;
}
/* the media keeps its own aspect and the overlay layer is its child, so
   normalized detector coordinates map straight to percentages — no letterbox
   arithmetic anywhere in the render path */
.lens-media {
  position: relative; max-width: 100%; max-height: 100%;
  border-radius: 18px; overflow: hidden; background: #000;
  box-shadow: 0 10px 34px rgba(0,0,0,0.5);
}
.lens-video { display: block; width: 100%; height: 100%; object-fit: cover; }
.lens-layer { position: absolute; inset: 0; pointer-events: none; }

/* measured card box — corner brackets read as a viewfinder; a full outline
   would read as a crop tool */
.lens-quad { position: absolute; transition: all .09s linear; }
.lens-quad i {
  position: absolute; width: 18px; height: 18px;
  border: 2.5px solid rgba(255,255,255,0.5); border-radius: 3px;
}
.lens-quad i:nth-child(1) { top: -2px; left: -2px; border-right: none; border-bottom: none; }
.lens-quad i:nth-child(2) { top: -2px; right: -2px; border-left: none; border-bottom: none; }
.lens-quad i:nth-child(3) { bottom: -2px; left: -2px; border-right: none; border-top: none; }
.lens-quad i:nth-child(4) { bottom: -2px; right: -2px; border-left: none; border-top: none; }
.lens-quad.on i { border-color: var(--accent); }
/* the guide box is an instruction, not a measurement — dashed, and it never
   turns accent, because accent means "found it" */
.lens-quad.guide i { border-style: dashed; border-color: rgba(255,255,255,0.38); }

/* translated plates. Opaque on purpose: a translucent plate over card art is
   unreadable at exactly the moment you need to read it. */
.lens-plate {
  position: absolute; display: flex; align-items: center;
  width: max-content;                 /* grows to the English, floored by minWidth */
  padding: 2px 5px; border-radius: 4px;
  background: #F6F1E6; color: #171208;
  font-family: var(--ff-ui); font-weight: 600; line-height: 1.15;
  box-shadow: 0 1px 4px rgba(0,0,0,0.35);
  overflow: hidden; transition: all .09s linear, opacity .16s ease;
}
/* partial or romanized — visibly not a clean read, and never priced against */
.lens-plate.soft {
  background: color-mix(in oklab, #F6F1E6 82%, var(--gold));
  font-style: italic;
  border-bottom: 2px dotted color-mix(in oklab, var(--gold) 70%, #171208);
}
/* a region we found but could not read: outline only. Inventing text here is
   the one failure that would cost real money. */
.lens-plate.ghost {
  background: transparent; box-shadow: none;
  border: 1.5px dashed rgba(255,255,255,0.45);
}
/* the text did not fit even at the minimum size, so it is cut rather than
   allowed to cover the plate below. Marked, never silent — the fade says there
   is more, and press-and-hold shows the source. */
.lens-plate.clipped { position: absolute; }
.lens-plate.clipped::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 8px;
  background: linear-gradient(to bottom, transparent, #F6F1E6);
  border-bottom: 2px solid color-mix(in oklab, var(--accent) 75%, #171208);
  pointer-events: none;
}
/* photo capture, inside an expanded inventory row */
.inv-photo {
  margin-top: 12px; padding: 13px 14px; border-radius: var(--r-sm);
  background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line);
}
.inv-photo-faces { display: flex; gap: 12px; flex-wrap: wrap; }
.inv-photo-face {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  padding: 11px 13px; border-radius: 10px; min-width: 190px;
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--line);
}
.inv-photo-face.live { box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--good) 45%, transparent); }
.inv-photo-face.pending { box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--gold) 45%, transparent); }
.inv-photo-face code { font-size: 10.5px; color: var(--ink-3); word-break: break-all; }
.inv-photo-pick { position: relative; overflow: hidden; cursor: pointer; }
.inv-photo-pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* row-select column, only present while something is selectable */
.inv-pick { width: 34px; padding-right: 0 !important; }
.inv-pick input { width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; margin: 0; }

/* allocate a collection's cost across scanned rows */
.inv-alloc {
  display: flex; align-items: center; justify-content: space-between;
  gap: 18px; flex-wrap: wrap;
  margin: 0 0 18px; padding: 15px 18px;
  border-radius: var(--r-md);
  background: color-mix(in oklab, var(--gold) 9%, var(--surface));
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--gold) 28%, transparent);
}

/* cost entry, inside an expanded inventory row */
.inv-cost {
  margin-top: 14px; padding: 13px 14px;
  border-radius: var(--r-sm);
  background: color-mix(in oklab, var(--gold) 8%, var(--surface));
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--gold) 26%, transparent);
}
.inv-cost-row { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.inv-cost-field { display: flex; flex-direction: column; gap: 5px; }
.inv-cost-field select {
  font-family: var(--ff-ui); font-size: 13.5px; color: var(--ink);
  background: var(--surface); border: none; border-radius: 9px;
  box-shadow: inset 0 0 0 1px var(--line-2); padding: 10px 11px; cursor: pointer;
}
.inv-cost-input {
  display: flex; align-items: center; gap: 4px;
  background: var(--surface); border-radius: 9px;
  box-shadow: inset 0 0 0 1px var(--line-2); padding: 0 11px;
}
.inv-cost-input span { font-family: var(--ff-mono); font-size: 13px; color: var(--ink-3); }
.inv-cost-input input {
  font-family: var(--ff-mono); font-size: 14px; font-weight: 700; color: var(--ink);
  background: none; border: none; outline: none; padding: 10px 0; width: 92px;
}

/* import block inside the identity sheet */
.lens-import {
  margin-top: 14px; padding-top: 13px;
  border-top: 1px solid rgba(255,255,255,0.10);
}
.lens-import-done {
  display: flex; align-items: flex-start; gap: 9px;
  font-size: 12.5px; line-height: 1.45; color: var(--ink);
}
.lens-import-done b { font-size: 12px; }

.lens-hidden { opacity: 0; }

.lens-status, .lens-frozen {
  position: absolute; left: 50%; transform: translateX(-50%);
  font-family: var(--ff-mono); font-size: 11px; font-weight: 700; letter-spacing: 0.1em;
  padding: 7px 13px; border-radius: 9999px; background: rgba(0,0,0,0.62); color: #F3EDE0;
}
.lens-status { bottom: 12px; }
.lens-frozen { top: 12px; background: var(--accent); color: var(--on-accent); }

.lens-controls {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
  padding: 12px 16px 4px; overflow-x: auto; scrollbar-width: none;
}
.lens-controls::-webkit-scrollbar { display: none; }
.lens-controls-wrap { flex-wrap: wrap; overflow: visible; padding-top: 4px; }
.lens-controls .chip {
  background: rgba(255,255,255,0.08); color: #D9D2C4; box-shadow: none; flex-shrink: 0;
  -webkit-user-select: none; user-select: none;
}
.lens-controls .chip.on { background: var(--accent); color: var(--on-accent); }
.lens-langs { display: flex; align-items: center; gap: 6px; margin-left: auto; flex-shrink: 0; }

.lens-scroll {
  flex-shrink: 0; max-height: 42%; overflow-y: auto; scrollbar-width: none;
  padding: 0 16px calc(env(safe-area-inset-bottom, 0px) + 8px);
}
.lens-scroll::-webkit-scrollbar { display: none; }

.lens-sheet {
  margin-top: 12px; padding: 15px 17px 16px; border-radius: 18px;
  background: rgba(255,255,255,0.06); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.10);
}
.lens-sheet-hint { display: flex; align-items: center; gap: 12px; }
.lens-sheet-hd { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.lens-sheet-nums {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px; margin-top: 14px; padding-top: 13px;
  border-top: 1px solid rgba(255,255,255,0.10);
}
.lens-note {
  font-size: 11.5px; line-height: 1.5; margin: 13px 0 0;
  padding-top: 11px; border-top: 1px solid rgba(255,255,255,0.10);
}

/* the provenance block. On screen rather than in a tooltip: what is measured
   and what is substituted is the whole reason this is trustworthy. */
.lens-truth { margin-top: 12px; padding: 0 2px; }
.lens-truth p { font-size: 11.5px; line-height: 1.55; color: #B7AE9C; margin: 0 0 8px; }
.lens-truth b { color: #E7DFCE; }
.lens-truth .lens-warn { color: #E9C978; }

/* Shop home entry */
.lens-entry {
  width: calc(100% - 40px); margin: 0 20px 22px;
  display: flex; align-items: center; gap: 13px;
  padding: 13px 15px; border: none; border-radius: 18px; cursor: pointer;
  background: var(--surface); box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--line);
  text-align: left; color: var(--ink); -webkit-tap-highlight-color: transparent;
}
.lens-entry:active { transform: scale(.99); }
.lens-entry-mark {
  width: 42px; height: 42px; border-radius: 13px; flex-shrink: 0;
  background: var(--ink); display: flex; align-items: center; justify-content: center;
}

/* on a tablet or desktop the push sheet is short and centred; Lens wants the
   height, because the viewfinder is the screen */
@media (min-width: 768px) {
  .screen-push.lens {
    inset: 50% auto auto 50%;
    height: calc(100dvh - 56px); width: min(620px, calc(100vw - 56px));
  }
}

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  .pack-float, .holo-foil, .hit-glow, .tl-ping { animation: none !important; }
  .splash-pack-c.pack-float { animation: packDealC .46s ease both; }
  .splash-dots::after { animation: none; }
  .lens-quad, .lens-plate { transition: none; }
}
