/* ============================================================================
   Poké SA House of Cards • Shop theme (forked from PokeVault) ("Lux" Architectural Smoked Glass)
   Built on the exact tokens, glass, typography, and motion of Marquee & reneos.dev
   ============================================================================ */


:root {
  /* reneOS Core Colour Tokens */
  --rene-black: #FBF8F4;
  --rene-black-soft: #F3EEE7;
  --rene-surface: #FFFFFF;
  --rene-surface-raised: #FFFFFF;

  --rene-white: #1B1A1A;
  --rene-white-soft: #3A3535;
  --rene-muted: #574F4C;
  --rene-dim: #6B6360;

  --rene-blue: #C2410C;
  --rene-blue-bright: #C2410C;
  --rene-blue-deep: #9A3412;

  --rene-gold: #9E1B32;
  --rene-gold-bright: #B5172F;
  --rene-gold-deep: #6E1222;

  --rene-line: rgba(27, 26, 26, 0.14);
  --rene-line-soft: rgba(27, 26, 26, 0.08);
  --rene-glass: rgba(255, 255, 255, 0.9);
  --rene-glass-hover: rgba(255, 255, 255, 1);

  --rene-error: #C5120C;
  --rene-success: #2E8B57;

  /* Mapped legacy variables for seamless JS compatibility */
  --bg-base: var(--rene-black);
  --bg-surface: rgba(255, 255, 255, 0.92);
  --bg-elevated: #FFFFFF;
  --bg-hover: rgba(158, 27, 50, 0.05);
  --border-subtle: var(--rene-line-soft);
  --border-focus: rgba(158, 27, 50, 0.45);

  --text-main: var(--rene-white);
  --text-muted: var(--rene-muted);
  --text-dim: var(--rene-dim);

  --pastel-mint: var(--rene-gold);
  --pastel-mint-bg: rgba(158, 27, 50, 0.08);
  --pastel-blue: var(--rene-blue);
  --pastel-blue-bg: rgba(255, 87, 0, 0.10);
  --pastel-peach: var(--rene-gold-bright);
  --pastel-peach-bg: rgba(197, 18, 12, 0.07);
  --pastel-lavender: #4D1313;
  --pastel-lavender-bg: rgba(77, 19, 19, 0.08);
  --pastel-rose: #C5120C;
  --pastel-rose-bg: rgba(197, 18, 12, 0.08);

  /* Spacing & Radius */
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-xl: 30px;

  /* Motion */
  --rene-ease: cubic-bezier(.2, .8, .2, 1);
  --rene-transition: 240ms var(--rene-ease);
  --rene-font: "Poppins", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  background: var(--rene-black);
  color-scheme: light;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--rene-white);
  font-family: var(--rene-font);
  font-weight: 400;
  line-height: 1.5;
  padding-bottom: 96px;
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(circle at 18% 15%, rgba(255, 87, 0, 0.135), transparent 34%),
    radial-gradient(circle at 82% 25%, rgba(158, 27, 50, 0.09), transparent 30%),
    radial-gradient(circle at 50% 100%, rgba(255, 87, 0, 0.072), transparent 42%),
    var(--rene-black);
  background-attachment: fixed;
}

@supports (-webkit-touch-callout: none) {
  body { background-attachment: scroll; }
}

::selection {
  background: rgba(158, 27, 50, 0.25);
  color: var(--rene-white);
}

/* ================= ARCHITECTURAL LUX OPENING SCREEN ================= */
.splash-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background:
    radial-gradient(circle at 50% 42%, rgba(158, 27, 50, 0.12), transparent 38%),
    radial-gradient(circle at 50% 60%, rgba(255, 87, 0, 0.072), transparent 45%),
    var(--rene-black);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 500ms var(--rene-ease), transform 500ms var(--rene-ease);
}

.splash-overlay.fade-out {
  opacity: 0;
  transform: scale(1.02);
  pointer-events: none;
}

.splash-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

.pokeball-vault {
  position: relative;
  width: 108px;
  height: 108px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ring-outer {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(158, 27, 50, 0.35);
  animation: spinVault 6s linear infinite;
}

.ring-inner {
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  border: 1px solid rgba(27, 26, 26, 0.132);
  border-top-color: var(--rene-gold);
  border-bottom-color: var(--rene-blue);
  animation: spinVaultReverse 2.8s var(--rene-ease) infinite;
}

.pokeball-core {
  position: relative;
  width: 66px;
  height: 66px;
  border-radius: 50%;
  overflow: hidden;
  border: 1.5px solid rgba(158, 27, 50, 0.75);
  box-shadow: 0 0 36px rgba(158, 27, 50, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  background: linear-gradient(145deg, rgba(27, 26, 26, 0.081), rgba(27, 26, 26, 0.018));
}

.ball-top {
  height: 50%;
  background: linear-gradient(145deg, rgba(158, 27, 50, 0.32), rgba(77, 19, 19, 0.144));
}

.ball-bottom {
  height: 50%;
  background: rgba(255, 255, 255, 0.92);
}

.ball-band {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 2px;
  transform: translateY(-50%);
  background: linear-gradient(90deg, transparent, var(--rene-gold), transparent);
}

.ball-button {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: var(--rene-gold-bright);
  border: 4px solid var(--rene-black);
  box-shadow: 0 0 14px rgba(158, 27, 50, 0.8);
}

.splash-title {
  font-size: 2.25rem;
  font-weight: 400;
  letter-spacing: -0.035em;
  color: var(--rene-white);
}

.splash-sub {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--rene-muted);
}

.splash-bar {
  width: 160px;
  height: 2px;
  background: rgba(27, 26, 26, 0.072);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 6px;
}

.splash-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--rene-gold), var(--rene-blue));
  animation: loadBar 1.05s var(--rene-ease) forwards;
}

@keyframes spinVault { to { transform: rotate(360deg); } }
@keyframes spinVaultReverse { to { transform: rotate(-360deg); } }
@keyframes loadBar {
  0% { width: 0%; }
  65% { width: 84%; }
  100% { width: 100%; }
}

/* ================= TOP NAVIGATION SURFACE (rene-nav) ================= */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 68px;
  padding: 12px 32px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--rene-line-soft);
  -webkit-backdrop-filter: blur(28px) saturate(120%);
  backdrop-filter: blur(28px) saturate(120%);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(27, 26, 26, 0.068), rgba(27, 26, 26, 0.018));
  border: 1px solid rgba(158, 27, 50, 0.35);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 0 18px rgba(158, 27, 50, 0.12);
  color: var(--rene-gold);
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-title {
  font-weight: 400;
  font-size: 18px;
  letter-spacing: -0.025em;
  color: var(--rene-white);
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-badge {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(27, 26, 26, 0.036);
  color: var(--rene-gold);
  border: 1px solid rgba(158, 27, 50, 0.28);
}

.brand-sub {
  font-size: 13px;
  font-weight: 400;
  color: var(--rene-muted);
  letter-spacing: 0.01em;
}

/* Desktop Navigation Pills */
.desktop-nav {
  display: flex;
  gap: 4px;
  background: linear-gradient(145deg, rgba(27, 26, 26, 0.041), rgba(27, 26, 26, 0.013));
  padding: 5px;
  border-radius: 16px;
  border: 1px solid var(--rene-line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.nav-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--rene-muted);
  font-family: var(--rene-font);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.01em;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: color var(--rene-transition), background var(--rene-transition), border-color var(--rene-transition), transform var(--rene-transition);
}

.nav-btn:hover {
  color: var(--rene-white);
}

.nav-btn:active {
  transform: scale(0.985);
}

.nav-btn.active {
  background: linear-gradient(145deg, rgba(27, 26, 26, 0.077), rgba(27, 26, 26, 0.027));
  color: var(--rene-white);
  border-color: rgba(27, 26, 26, 0.176);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 8px 24px rgba(70, 25, 25, 0.087);
}

/* Subtle metallic indicator dots instead of cartoon skittles */
.nav-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  opacity: 0.75;
}
.dot-mint { background: var(--rene-gold); box-shadow: 0 0 6px rgba(158, 27, 50, 0.5); }
.dot-blue { background: var(--rene-blue); box-shadow: 0 0 6px rgba(255, 87, 0, 0.450); }
.dot-peach { background: var(--rene-gold-bright); }
.dot-lavender { background: #4D1313; }
.dot-rose { background: var(--rene-gold-deep); }

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* User Chip */
.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 5px 14px 5px 7px;
  border-radius: 999px;
  background: linear-gradient(145deg, rgba(27, 26, 26, 0.050), rgba(27, 26, 26, 0.016));
  border: 1px solid var(--rene-line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: border-color var(--rene-transition), background var(--rene-transition), transform var(--rene-transition);
}

.user-chip:hover {
  border-color: rgba(158, 27, 50, 0.45);
  background: rgba(27, 26, 26, 0.054);
}

.user-chip:active {
  transform: scale(0.985);
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(158, 27, 50, 0.14);
  color: var(--rene-gold);
  font-weight: 500;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(158, 27, 50, 0.38);
}

.user-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--rene-white);
  line-height: 1.15;
}

.user-sync {
  font-size: 13px;
  color: var(--rene-muted);
  display: flex;
  align-items: center;
  gap: 5px;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--rene-success);
  box-shadow: 0 0 8px var(--rene-success);
}

/* ================= LUX BUTTONS (rene-button-primary & secondary) ================= */
.btn-pastel {
  font-family: var(--rene-font);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  min-height: 40px;
  padding: 9px 18px;
  border-radius: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background var(--rene-transition), border-color var(--rene-transition), transform var(--rene-transition), filter var(--rene-transition);
}

.btn-pastel:hover {
  filter: brightness(1.06);
}

.btn-pastel:active {
  transform: scale(0.985);
}

/* Primary pearl/silver glass button */
.btn-mint {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(243, 238, 231, 0.88));
  color: #FFFFFF;
  border: 1px solid rgba(27, 26, 26, 0.880);
  box-shadow: 0 8px 30px rgba(70, 25, 25, 0.087);
}

/* Warm Champagne Gold Lux button */
.btn-peach {
  background: linear-gradient(135deg, rgba(158, 27, 50, 0.22), rgba(158, 27, 50, 0.08));
  color: var(--rene-gold-bright);
  border: 1px solid rgba(158, 27, 50, 0.42);
  box-shadow: inset 0 1px 0 rgba(158, 27, 50, 0.15), 0 8px 24px rgba(70, 25, 25, 0.070);
}

/* Ice Blue Lux button */
.btn-blue {
  background: linear-gradient(135deg, rgba(255, 87, 0, 0.162), rgba(255, 87, 0, 0.054));
  color: var(--rene-blue-bright);
  border: 1px solid rgba(255, 87, 0, 0.342);
  box-shadow: inset 0 1px 0 rgba(255, 87, 0, 0.108);
}

/* Marquee Amethyst Glass button */
.btn-lavender {
  background: linear-gradient(135deg, rgba(77, 19, 19, 0.160), rgba(77, 19, 19, 0.048));
  color: #4D1313;
  border: 1px solid rgba(77, 19, 19, 0.304);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.btn-ghost {
  font-family: var(--rene-font);
  min-height: 38px;
  background: rgba(27, 26, 26, 0.032);
  color: var(--rene-white-soft);
  border: 1px solid rgba(27, 26, 26, 0.154);
  padding: 8px 15px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
  transition: background var(--rene-transition), border-color var(--rene-transition), transform var(--rene-transition);
}

.btn-ghost:hover {
  background: rgba(27, 26, 26, 0.059);
  border-color: rgba(27, 26, 26, 0.264);
  color: var(--rene-white);
}

.btn-ghost:active {
  transform: scale(0.985);
}

/* ================= MAIN CONTAINER & PANELS (Architectural Smoked Glass) ================= */
.container {
  width: min(calc(100% - 48px), var(--rene-max-width, 1440px));
  margin: 28px auto;
}

.tab-panel {
  display: none;
  flex-direction: column;
  gap: 24px;
  animation: rene-rise 420ms var(--rene-ease) both;
}

.tab-panel.active {
  display: flex;
}

@keyframes rene-rise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* ================= MARQUEE-STYLE EDITORIAL VAULT HERO ================= */
.lux-hero {
  text-align: center;
  max-width: 820px;
  margin: 18px auto 8px;
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.lux-eyebrow {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--rene-muted);
}

.lux-networth {
  font-size: clamp(2.85rem, 6.2vw, 4.75rem);
  font-weight: 400;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--rene-white);
  margin: 2px 0;
}

.rene-divider-gold {
  width: min(380px, 80%);
  height: 1px;
  border: 0;
  margin: 4px 0;
  background: linear-gradient(90deg, transparent, rgba(158, 27, 50, 0.55), transparent);
}

.lux-ledger-line {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 400;
  color: var(--rene-muted);
}

.lux-ledger-line strong {
  font-weight: 500;
  color: var(--rene-white-soft);
}

.dot-sep {
  color: rgba(158, 27, 50, 0.45);
}

.lux-hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 10px;
}

.lux-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 14px 18px;
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(27, 26, 26, 0.041), rgba(27, 26, 26, 0.013));
  border: 1px solid var(--rene-line-soft);
}

.lux-toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* 9-Pocket (3x3) Physical Binder Page Mode */
.binder-page-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  border-radius: 14px;
  background: rgba(158, 27, 50, 0.07);
  border: 1px solid rgba(158, 27, 50, 0.28);
}

.card-grid.binder-3x3 {
  grid-template-columns: repeat(3, 1fr);
  max-width: 820px;
  margin: 0 auto;
  padding: 24px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(27, 26, 26, 0.154);
  box-shadow: inset 0 0 40px rgba(70, 25, 25, 0.245), 0 24px 70px rgba(70, 25, 25, 0.140);
  gap: 18px;
}

.binder-empty-slot {
  aspect-ratio: 2.5 / 3.5;
  border-radius: 16px;
  border: 1px dashed rgba(27, 26, 26, 0.110);
  background: rgba(27, 26, 26, 0.011);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  letter-spacing: 0.18em;
  color: rgba(27, 26, 26, 0.198);
}

/* Card Detail Inspector Sheet Layout */
.detail-sheet-body {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 20px;
  align-items: start;
}

@media (max-width: 680px) {
  .detail-sheet-body {
    grid-template-columns: 1fr;
  }
  .card-grid.binder-3x3 {
    padding: 12px;
    gap: 10px;
  }
}

/* Top Stat Cards (Smoked Glass w/ Hairline Top Highlight) */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.stat-card {
  background: linear-gradient(145deg, rgba(27, 26, 26, 0.052), rgba(27, 26, 26, 0.016));
  border: 1px solid var(--rene-line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.065), 0 20px 60px rgba(70, 25, 25, 0.084);
  -webkit-backdrop-filter: blur(28px) saturate(120%);
  backdrop-filter: blur(28px) saturate(120%);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 24px;
  right: 24px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(158, 27, 50, 0.5), transparent);
}

.card-blue::after {
  background: linear-gradient(90deg, transparent, rgba(255, 87, 0, 0.450), transparent);
}

.stat-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--rene-muted);
  text-transform: uppercase;
  letter-spacing: 0.20em;
}

.stat-value {
  font-size: clamp(1.75rem, 2.5vw, 2.25rem);
  font-weight: 400;
  color: var(--rene-white);
  margin: 10px 0 6px;
  letter-spacing: -0.035em;
  line-height: 1.05;
}

.stat-delta.pos, .pos {
  color: var(--rene-gold);
  font-size: 13px;
  font-weight: 400;
}

.stat-sub {
  font-size: 13px;
  font-weight: 400;
  color: var(--rene-muted);
}

/* Panels & Split Layout */
.split-row {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 24px;
}

.panel {
  background: linear-gradient(145deg, rgba(27, 26, 26, 0.045), rgba(27, 26, 26, 0.013));
  border: 1px solid var(--rene-line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.055), 0 20px 60px rgba(70, 25, 25, 0.077);
  -webkit-backdrop-filter: blur(28px) saturate(120%);
  backdrop-filter: blur(28px) saturate(120%);
  border-radius: var(--radius-lg);
  padding: 26px 28px;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.panel-header h2 {
  font-size: 19px;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--rene-white);
}

.panel-sub {
  font-size: 13px;
  font-weight: 400;
  color: var(--rene-muted);
  margin-top: 4px;
}

/* Pills & Chips */
.pill-group, .filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pill, .chip {
  font-family: var(--rene-font);
  background: rgba(27, 26, 26, 0.027);
  border: 1px solid var(--rene-line-soft);
  color: var(--rene-muted);
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: all var(--rene-transition);
}

.pill:hover, .chip:hover {
  color: var(--rene-white);
  border-color: var(--rene-line);
}

.pill.active, .chip.active {
  background: rgba(158, 27, 50, 0.12);
  color: var(--rene-gold-bright);
  border-color: rgba(158, 27, 50, 0.42);
  box-shadow: inset 0 1px 0 rgba(158, 27, 50, 0.12);
}

/* Portfolio Chart Frame */
.chart-wrap {
  width: 100%;
  height: 205px;
  background: rgba(255, 255, 255, 0.92);
  border-radius: var(--radius-md);
  padding: 14px;
  border: 1px solid var(--rene-line-soft);
}

#portfolioChart {
  width: 100%;
  height: 100%;
}

/* Binder Shelves */
.binder-shelves {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.shelf-btn {
  font-family: var(--rene-font);
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 13px;
  background: rgba(27, 26, 26, 0.025);
  border: 1px solid var(--rene-line-soft);
  color: var(--rene-white-soft);
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
  transition: all var(--rene-transition);
}

.shelf-btn:hover {
  background: rgba(27, 26, 26, 0.045);
  border-color: var(--rene-line);
  color: var(--rene-white);
}

.shelf-btn.active {
  border-color: rgba(158, 27, 50, 0.45);
  background: linear-gradient(135deg, rgba(158, 27, 50, 0.12), rgba(158, 27, 50, 0.03));
  color: var(--rene-white);
}

.shelf-meta {
  font-size: 13px;
  color: var(--rene-muted);
}

/* Metallic Status Tags */
.tag-mint {
  background: rgba(158, 27, 50, 0.12);
  color: var(--rene-gold-bright);
  border: 1px solid rgba(158, 27, 50, 0.32);
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.03em;
}

.tag-peach {
  background: rgba(255, 87, 0, 0.108);
  color: var(--rene-blue-bright);
  border: 1px solid rgba(255, 87, 0, 0.288);
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
}

.tag-lavender {
  background: rgba(77, 19, 19, 0.112);
  color: #4D1313;
  border: 1px solid rgba(77, 19, 19, 0.256);
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
}

/* Inputs & Fields (rene-field) */
.cert-box {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--rene-line-soft);
}

.field-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--rene-muted);
  margin-bottom: 8px;
}

.input-row {
  display: flex;
  gap: 8px;
}

input[type="text"],
input[type="number"],
input[type="email"],
select {
  font-family: var(--rene-font);
  background: rgba(27, 26, 26, 0.032);
  border: 1px solid rgba(27, 26, 26, 0.154);
  color: var(--rene-white);
  min-height: 40px;
  padding: 9px 14px;
  border-radius: 13px;
  font-size: 13px;
  outline: none;
  width: 100%;
  transition: border-color var(--rene-transition), background var(--rene-transition);
}

input:focus, select:focus {
  border-color: rgba(255, 87, 0, 0.495);
  background: rgba(27, 26, 26, 0.050);
}

.cert-result {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 13px;
  background: rgba(158, 27, 50, 0.08);
  border: 1px solid rgba(158, 27, 50, 0.3);
  font-size: 13px;
}

.hidden {
  display: none !important;
}

/* ================= LUX CARD VAULT TILES (rene-experience-card) ================= */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
  gap: 18px;
  margin-top: 16px;
}

.poke-card {
  background: linear-gradient(145deg, rgba(27, 26, 26, 0.050), rgba(27, 26, 26, 0.016));
  border: 1px solid rgba(27, 26, 26, 0.132);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.055), 0 16px 40px rgba(70, 25, 25, 0.087);
  border-radius: 20px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 11px;
  transition: transform 300ms var(--rene-ease), border-color 300ms ease, background 300ms ease;
}

.poke-card:hover {
  transform: translateY(-3px);
  background: linear-gradient(145deg, rgba(27, 26, 26, 0.068), rgba(27, 26, 26, 0.023));
  border-color: rgba(27, 26, 26, 0.242);
}

/* Slab Header Plaque */
.slab-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 10px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.slab-psa {
  background: linear-gradient(135deg, rgba(158, 27, 50, 0.18), rgba(158, 27, 50, 0.05));
  color: var(--rene-gold-bright);
  border: 1px solid rgba(158, 27, 50, 0.38);
}

.slab-bgs {
  background: linear-gradient(135deg, rgba(77, 19, 19, 0.144), rgba(77, 19, 19, 0.040));
  color: #4D1313;
  border: 1px solid rgba(77, 19, 19, 0.280);
}

.slab-cgc {
  background: linear-gradient(135deg, rgba(255, 87, 0, 0.162), rgba(255, 87, 0, 0.045));
  color: var(--rene-blue-bright);
  border: 1px solid rgba(255, 87, 0, 0.315);
}

.slab-raw {
  background: rgba(27, 26, 26, 0.036);
  color: var(--rene-white-soft);
  border: 1px solid var(--rene-line-soft);
}

/* Card Showcase Frame + 3D Holographic Shimmer */
.card-img-box {
  position: relative;
  width: 100%;
  aspect-ratio: 2.5 / 3.5;
  border-radius: 13px;
  overflow: hidden;
  background: radial-gradient(circle at 50% 35%, rgba(27, 26, 26, 0.054), rgba(255, 255, 255, 0.92));
  border: 1px solid rgba(27, 26, 26, 0.077);
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transform-style: preserve-3d;
  transition: transform 0.14s ease-out, box-shadow 0.14s ease-out;
}

.card-img-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 8px;
}

.card-img-box::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(
    115deg,
    transparent 20%,
    rgba(158, 27, 50, 0.32) 38%,
    rgba(255, 87, 0, 0.342) 48%,
    rgba(77, 19, 19, 0.256) 58%,
    transparent 82%
  );
  background-size: 220% 220%;
  background-position: var(--holo-x, 50%) var(--holo-y, 50%);
  mix-blend-mode: color-dodge;
  transition: opacity 0.2s ease;
}

.poke-card:hover .card-img-box::after {
  opacity: 0.72;
}

.card-title {
  font-size: 14.5px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--rene-white);
}

.card-sub {
  font-size: 13px;
  font-weight: 400;
  color: var(--rene-muted);
}

.card-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 8px;
  border-top: 1px solid var(--rene-line-soft);
}

.price-main {
  font-size: 16px;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--rene-white);
}

.price-sub {
  font-size: 13px;
  font-weight: 400;
  color: var(--rene-muted);
}

.card-actions {
  display: flex;
  gap: 6px;
}

.card-actions button {
  font-family: var(--rene-font);
  flex: 1;
  font-size: 13px;
  font-weight: 400;
  padding: 7px 6px;
  border-radius: 9px;
  background: rgba(27, 26, 26, 0.027);
  color: var(--rene-white-soft);
  border: 1px solid var(--rene-line-soft);
  cursor: pointer;
  transition: all var(--rene-transition);
}

.card-actions button:hover {
  border-color: rgba(158, 27, 50, 0.45);
  color: var(--rene-gold-bright);
  background: rgba(158, 27, 50, 0.08);
}

/* ================= SETS & GAMES GRIDS ================= */
.sets-grid, .mobile-grid, .games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: 14px;
}

.set-card, .mobile-card, .game-card {
  background: linear-gradient(145deg, rgba(27, 26, 26, 0.041), rgba(27, 26, 26, 0.013));
  border: 1px solid var(--rene-line-soft);
  border-radius: 16px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  transition: all var(--rene-transition);
}

.set-card { cursor: pointer; }
.set-card:hover, .game-card:hover {
  border-color: rgba(27, 26, 26, 0.242);
  transform: translateY(-2px);
}

.set-card.active, .game-card.owned {
  border-color: rgba(158, 27, 50, 0.48);
  background: linear-gradient(145deg, rgba(158, 27, 50, 0.1), rgba(27, 26, 26, 0.018));
}

.set-top, .mobile-card-top, .game-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.set-name, .mobile-title, .game-title {
  font-weight: 500;
  font-size: 14.5px;
  letter-spacing: -0.01em;
}

.set-lang, .plat-badge {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(27, 26, 26, 0.045);
  color: var(--rene-gold);
  border: 1px solid rgba(158, 27, 50, 0.25);
}

.progress-track {
  height: 5px;
  background: rgba(27, 26, 26, 0.063);
  border-radius: 99px;
  overflow: hidden;
  margin: 6px 0 2px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--rene-gold), var(--rene-blue));
  border-radius: 99px;
}

.variant-row, .cond-pills {
  display: flex;
  gap: 6px;
}

.var-pill, .cond-pill {
  font-family: var(--rene-font);
  flex: 1;
  text-align: center;
  font-size: 13px;
  padding: 6px;
  border-radius: 8px;
  background: rgba(27, 26, 26, 0.023);
  color: var(--rene-muted);
  border: 1px solid var(--rene-line-soft);
  cursor: pointer;
  transition: all var(--rene-transition);
}

.var-pill.owned, .cond-pill.active {
  background: rgba(158, 27, 50, 0.14);
  color: var(--rene-gold-bright);
  border-color: rgba(158, 27, 50, 0.45);
  font-weight: 500;
}

.friend-code-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 87, 0, 0.252);
  border-radius: 10px;
  padding: 9px 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  color: var(--rene-blue-bright);
  cursor: pointer;
}

/* ================= PRE-GRADE & LOUPE INSPECTOR ================= */
.pregrade-layout {
  grid-template-columns: 1.1fr 1fr;
}

.scanner-stage {
  display: flex;
  justify-content: center;
  align-items: center;
  background: #F3EEE7;
  border: 1px solid var(--rene-line);
  border-radius: 18px;
  padding: 24px;
}

.card-frame {
  position: relative;
  width: 300px;
  aspect-ratio: 2.5 / 3.5;
  user-select: none;
  touch-action: none;
}

.card-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 12px;
  pointer-events: none;
}

.guide-line {
  position: absolute;
  z-index: 10;
}

.guide-v {
  top: 0;
  bottom: 0;
  width: 1.5px;
  background: var(--rene-gold);
  box-shadow: 0 0 8px rgba(70, 25, 25, 0.315);
  cursor: ew-resize;
}

.guide-h {
  left: 0;
  right: 0;
  height: 1.5px;
  background: var(--rene-blue);
  box-shadow: 0 0 8px rgba(70, 25, 25, 0.315);
  cursor: ns-resize;
}

.guide-handle {
  position: absolute;
  background: var(--rene-black);
  color: var(--rene-white);
  border: 1px solid var(--rene-gold);
  font-size: 12px;
  font-weight: 600;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.guide-v .guide-handle { top: 12px; left: -9px; }
.guide-h .guide-handle { left: 12px; top: -9px; border-color: var(--rene-blue); }

.corner-loupes-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 14px;
}

.corner-loupe-item {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--rene-line-soft);
  border-radius: 12px;
  padding: 7px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.corner-loupe-item canvas {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  background: #FBF8F4;
  border: 1px solid rgba(158, 27, 50, 0.25);
}

.corner-loupe-label {
  font-size: 12px;
  color: var(--rene-muted);
  font-weight: 500;
  letter-spacing: 0.14em;
}

.preset-cards-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.centering-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 20px;
}

.metric-box, .roi-box {
  background: rgba(27, 26, 26, 0.027);
  border: 1px solid var(--rene-line-soft);
  border-radius: 16px;
  padding: 16px;
}

.metric-title, .roi-title {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--rene-muted);
}

.metric-val, .roi-num {
  font-size: 22px;
  font-weight: 400;
  letter-spacing: -0.02em;
  margin: 8px 0;
}

.subgrade-controls {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 20px;
}

.subgrade-controls h3 {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--rene-muted);
}

.slider-group label {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 6px;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--rene-gold);
}

.verdict-card, .roi-box.highlight {
  background: linear-gradient(145deg, rgba(158, 27, 50, 0.1), rgba(27, 26, 26, 0.018));
  border: 1px solid rgba(158, 27, 50, 0.38);
  border-radius: 18px;
  padding: 20px;
}

.verdict-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.verdict-eyebrow {
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--rene-muted);
}

.verdict-grade {
  font-size: 24px;
  font-weight: 400;
  letter-spacing: -0.025em;
}

.verdict-desc {
  font-size: 13px;
  font-weight: 400;
  color: var(--rene-white-soft);
  margin-bottom: 16px;
}

/* ================= ROI & SHOW TRADE DESK ================= */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-field label {
  display: block;
  font-size: 13px;
  color: var(--rene-muted);
  margin-bottom: 6px;
}

.full-span { grid-column: span 2; }

.roi-results-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-top: 20px;
}

.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.leader-item, .profile-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: rgba(27, 26, 26, 0.027);
  border: 1px solid var(--rene-line-soft);
  border-radius: 14px;
  cursor: pointer;
  transition: all var(--rene-transition);
}

.leader-item:hover, .profile-row:hover {
  border-color: rgba(158, 27, 50, 0.38);
  background: rgba(27, 26, 26, 0.045);
}

.trade-desk {
  display: grid;
  grid-template-columns: 1fr 250px 1fr;
  gap: 18px;
  align-items: start;
}

.trade-column, .settlement-card {
  background: rgba(27, 26, 26, 0.027);
  border: 1px solid var(--rene-line);
  border-radius: 18px;
  padding: 18px;
}

.trade-col-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.trade-total {
  font-size: 24px;
  font-weight: 400;
  color: var(--rene-gold);
}

.trade-add-row, .trade-custom-row {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.trade-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
  min-height: 120px;
}

.trade-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 11px;
  border: 1px solid var(--rene-line-soft);
  font-size: 13px;
}

.settlement-card {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.settlement-label {
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--rene-muted);
}

.settlement-value {
  font-size: 28px;
  font-weight: 400;
  letter-spacing: -0.03em;
}

/* Empty Vault Box */
.empty-vault-box {
  grid-column: 1 / -1;
  background: rgba(27, 26, 26, 0.018);
  border: 1px dashed rgba(27, 26, 26, 0.154);
  border-radius: 20px;
  padding: 42px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.empty-vault-title {
  font-size: 17px;
  font-weight: 400;
  letter-spacing: -0.015em;
  color: var(--rene-white);
}

.empty-vault-sub {
  font-size: 13px;
  font-weight: 400;
  color: var(--rene-muted);
  max-width: 440px;
}

/* ================= MODALS (rene-glass-raised) ================= */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(40, 18, 18, 0.546);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: max(12px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.modal-card {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.96));
  border: 1px solid rgba(27, 26, 26, 0.176);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 28px 80px rgba(70, 25, 25, 0.193);
  border-radius: 24px;
  width: 100%;
  max-width: 500px;
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 26px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.modal-header h3 {
  font-weight: 400;
  font-size: 18px;
  letter-spacing: -0.02em;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.auth-divider {
  text-align: center;
  margin: 16px 0;
  font-size: 12px;
  color: var(--rene-muted);
  letter-spacing: 0.2em;
}

.section-mini-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--rene-muted);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
}

/* Mobile Floating Frosted Dock */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: max(12px, env(safe-area-inset-bottom));
  left: max(12px, env(safe-area-inset-left));
  right: max(12px, env(safe-area-inset-right));
  background: rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: blur(28px) saturate(130%);
  backdrop-filter: blur(28px) saturate(130%);
  border: 1px solid rgba(27, 26, 26, 0.154);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 16px 40px rgba(70, 25, 25, 0.158);
  border-radius: 20px;
  padding: 6px 8px;
  justify-content: space-around;
  z-index: 60;
}

.mob-nav-btn {
  font-family: var(--rene-font);
  background: none;
  border: none;
  color: var(--rene-muted);
  font-size: 13px;
  font-weight: 400;
  min-height: 40px;
  padding: 6px 10px;
  border-radius: 12px;
  transition: all var(--rene-transition);
}

.mob-nav-btn.active {
  color: var(--rene-gold-bright);
  background: rgba(158, 27, 50, 0.14);
}

@media (max-width: 1020px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .split-row, .pregrade-layout, .trade-desk { grid-template-columns: 1fr; }
  .desktop-nav { display: none; }
  .mobile-bottom-nav { display: flex; }
  .topbar {
    padding: 12px max(18px, env(safe-area-inset-right)) 12px max(18px, env(safe-area-inset-left));
  }
  .container {
    width: calc(100% - 28px);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }
}

/* ================= FULL-SCREEN SCANNER STUDIO & SPACIOUS CARD TRAY ================= */
.modal-card.scanner-studio-modal {
  max-width: 1360px;
  width: 96vw;
  height: 92dvh;
  max-height: 92dvh;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.scanner-studio-body {
  display: grid;
  grid-template-columns: 310px 1fr;
  gap: 18px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.scanner-studio-body.mini-camera-mode {
  grid-template-columns: 210px 1fr;
}

.scanner-left-dock {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-right: 2px;
}

.scanner-dock-actions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.scanner-viewfinder-box {
  position: relative;
  background: #F3EEE7;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(158, 27, 50, 0.38);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px;
  gap: 10px;
  flex-shrink: 0;
}

.scanner-video-wrap {
  position: relative;
  width: 100%;
  max-width: 260px;
  aspect-ratio: 2.5 / 3.5;
  border-radius: 10px;
  overflow: hidden;
  background: #000;
  transition: all 200ms ease;
}

.scanner-studio-body.mini-camera-mode .scanner-video-wrap {
  max-width: 160px;
}

.scanner-camera-controls {
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
  width: 100%;
}

.scanner-tray-main {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #FFFFFF;
  border: 1px solid rgba(27, 26, 26, 0.12);
  border-radius: 18px;
  padding: 14px;
  overflow: hidden;
}

.scanner-tray-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(27, 26, 26, 0.088);
}

.scanner-tray-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--rene-gold-bright);
}

.scanner-queue-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(265px, 1fr));
  gap: 12px;
  align-content: start;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
  min-height: 0;
  padding-right: 4px;
}

.scan-queue-tile {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(27, 26, 26, 0.110);
  border-radius: 14px;
  padding: 11px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  transition: border-color 180ms ease, transform 180ms ease;
}

.scan-queue-tile:hover {
  border-color: rgba(158, 27, 50, 0.42);
}

.scan-queue-tile.is-added {
  border-color: rgba(132, 232, 184, 0.55);
  background: rgba(255, 255, 255, 0.92);
}

.scan-tile-top {
  display: flex;
  gap: 11px;
  align-items: flex-start;
}

.scan-tile-thumb {
  width: 60px;
  height: 84px;
  object-fit: contain;
  border-radius: 7px;
  background: #FBF8F4;
  border: 1px solid rgba(27, 26, 26, 0.088);
  flex-shrink: 0;
}

.scan-tile-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.scan-tile-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 6px;
}

.scan-tile-name {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--rene-white);
  line-height: 1.25;
  word-break: break-word;
}

.scan-tile-set {
  font-size: 13px;
  color: var(--rene-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.scan-tile-prices {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 3px;
}

.scan-tile-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: space-between;
  padding-top: 7px;
  border-top: 1px solid rgba(27, 26, 26, 0.066);
}

.scan-tile-drawer {
  background: #FBF8F4;
  border: 1px solid rgba(27, 26, 26, 0.088);
  border-radius: 10px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Portrait Phone Mode: Compact horizontal camera header on top, 75% tray below */
@media (max-width: 760px) and (orientation: portrait) {
  .modal-card.scanner-studio-modal {
    width: 98vw;
    height: 94dvh;
    max-height: 94dvh;
    padding: 12px;
    border-radius: 18px;
  }

  .scanner-studio-body,
  .scanner-studio-body.mini-camera-mode {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .scanner-left-dock {
    flex-shrink: 0;
    overflow: visible;
  }

  .scanner-viewfinder-box {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    gap: 10px;
  }

  .scanner-video-wrap {
    width: 114px;
    max-width: 114px;
    flex-shrink: 0;
  }

  .scanner-studio-body.mini-camera-mode .scanner-video-wrap {
    width: 74px;
    max-width: 74px;
  }

  .scanner-camera-controls {
    flex-direction: column;
    align-items: stretch;
    flex: 1;
  }

  .scanner-queue-grid {
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  }
}

/* Landscape Phone & Dual-Screen / Short Viewport Mode:
   1. Keep navigation inside the topbar & hide the bottom floating dock so it never blocks buttons.
   2. Keep the Scanner Studio side-by-side (left camera dock + right card tray) with compact height and safe-area padding so every button is reachable. */
@media (orientation: landscape) and (max-height: 600px) {
  body {
    padding-bottom: max(28px, env(safe-area-inset-bottom));
  }

  .topbar {
    position: relative;
    min-height: 52px;
    padding: 8px max(22px, env(safe-area-inset-right)) 8px max(22px, env(safe-area-inset-left));
    gap: 10px;
    flex-wrap: wrap;
  }

  .brand-sub {
    display: none;
  }

  .desktop-nav {
    display: flex !important;
    padding: 3px;
    gap: 3px;
  }

  .nav-btn {
    min-height: 32px;
    padding: 0 10px;
    font-size: 13px;
  }

  .mobile-bottom-nav {
    display: none !important;
  }

  .lux-hero {
    padding: 12px 16px;
    margin: 6px auto;
    gap: 8px;
  }

  .lux-networth {
    font-size: 2.2rem;
  }

  .modal-backdrop {
    align-items: flex-start;
    padding: max(6px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  }

  .modal-card {
    max-height: calc(100dvh - 14px);
    padding: 14px 18px;
    border-radius: 16px;
  }

  .modal-card.scanner-studio-modal {
    width: 100%;
    max-width: 100%;
    height: calc(100dvh - 14px);
    max-height: calc(100dvh - 14px);
    padding: 10px 14px;
  }

  .modal-card.scanner-studio-modal .modal-header {
    margin-bottom: 6px;
  }

  .modal-card.scanner-studio-modal .modal-header .panel-sub {
    display: none;
  }

  .scanner-studio-body {
    display: grid;
    grid-template-columns: 265px 1fr;
    gap: 10px;
  }

  .scanner-studio-body.mini-camera-mode {
    grid-template-columns: 205px 1fr;
  }

  .scanner-left-dock {
    gap: 6px;
    overflow-y: auto;
  }

  .scanner-viewfinder-box {
    flex-direction: row;
    align-items: center;
    padding: 6px 8px;
    gap: 8px;
  }

  .scanner-video-wrap {
    width: 96px;
    max-width: 96px;
    flex-shrink: 0;
  }

  .scanner-studio-body.mini-camera-mode .scanner-video-wrap {
    width: 68px;
    max-width: 68px;
  }

  .scanner-camera-controls {
    flex-direction: column;
    align-items: stretch;
    flex: 1;
    gap: 5px;
  }

  .scanner-tray-main {
    padding: 8px 10px;
  }

  .scanner-tray-header {
    padding-bottom: 6px;
    margin-bottom: 8px;
  }

  .scanner-queue-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 8px;
  }
}

/* "est." tag on prices that are guesses, not sold comps */
.tag-est {
  display: inline-block;
  margin-left: 4px;
  padding: 0 5px;
  border-radius: 6px;
  font-size: 0.62em;
  font-weight: 500;
  letter-spacing: 0.04em;
  vertical-align: middle;
  color: #9E1B32;
  border: 1px solid rgba(158, 27, 50, 0.5);
}

/* iPad / iPhone home-screen app: the status bar (clock, Wi-Fi, battery) is see-through
   and sits on top of the page. Push the header below it so nothing is covered. */
.topbar {
  padding-top: max(12px, calc(env(safe-area-inset-top) + 8px));
  padding-right: max(32px, calc(env(safe-area-inset-right) + 16px));
}
@media (max-width: 900px) {
  .topbar { padding-right: max(18px, calc(env(safe-area-inset-right) + 12px)); }
}
@media (orientation: landscape) and (max-height: 600px) {
  .topbar { padding-top: max(8px, calc(env(safe-area-inset-top) + 6px)); }
}

/* ================= PHONES (portrait) =================
   Keep the top bar inside the screen: logo, avatar, Scan, + Add.
   Show cards two per row so a big collection is quick to browse. */
@media (max-width: 640px) {
  .topbar { gap: 10px; padding-left: max(14px, calc(env(safe-area-inset-left) + 10px)); }
  .topbar .brand { min-width: 0; gap: 10px; }
  .brand-sub, .brand-badge, .hide-sm { display: none; }
  .brand-title { font-size: 18px; white-space: nowrap; }
  .topbar-actions { gap: 6px; flex-shrink: 0; }
  .topbar-actions .user-info { display: none; }
  .topbar-actions .user-chip { padding: 5px; min-height: 38px; }
  .topbar-actions .btn-pastel { padding: 0 12px; min-height: 38px; font-size: 13px; }

  #vaultGrid.card-grid:not(.binder-3x3), #setChecklistGrid.card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  #vaultGrid .poke-card, #setChecklistGrid .poke-card { padding: 9px; gap: 8px; border-radius: 16px; }
  #vaultGrid .slab-label { white-space: nowrap; font-size: 12px; letter-spacing: 0.08em; padding: 6px 8px; }
  #vaultGrid .slab-label .slab-set { display: none; }
  #vaultGrid .card-title { font-size: 13.5px; }
  #vaultGrid .price-main { font-size: 17px; }
}
html, body { overflow-x: clip; }
/* Grid columns must be allowed to shrink, or wide content pushes past the screen edge. */
.split-row > *, .pregrade-layout > *, .trade-desk > * { min-width: 0; }
@media (max-width: 1020px) {
  .split-row, .pregrade-layout, .trade-desk { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .input-row { flex-wrap: wrap; }
  .input-row > input { flex: 1 1 100%; min-width: 0; }
}
.neg { color: #B3261E; font-size: 13px; font-weight: 400; }
.row-remove { margin-top: 6px; padding: 3px 9px; font-size: 13px; min-height: 0; }

/* Read-only share links: show the collection, hide every way to change it. */
.share-view .owner-only,
.share-view #openCameraScannerBtn, .share-view #quickAddBtn,
.share-view #addSealedBtn, .share-view #addWishlistBtn, .share-view #openAddGameModalBtn,
.share-view #saveDetailChangesBtn, .share-view #detailDeleteCardBtn, .share-view #detailSendTradeBtn,
.share-view .row-remove, .share-view .card-actions,
.share-view #saveScannedWithGradeBtn { display: none !important; }
.share-view .var-pill, .share-view #tab-games .btn-ghost { pointer-events: none; }
.share-view #detailStatusSelect, .share-view #detailBinderSelect, .share-view #detailCostInput,
.share-view #detailMarketInput, .share-view #detailQtyInput, .share-view #detailConditionSelect { pointer-events: none; opacity: 0.75; }
.field-hint { display: block; font-size: 13px; color: var(--rene-muted); font-weight: 400; margin-top: 2px; }
@media (max-width: 640px) {
  .trade-custom-row { display: flex; flex-wrap: wrap; gap: 8px; }
  .trade-custom-row input[type="text"] { flex: 1 1 100%; }
  .trade-custom-row input[type="number"] { flex: 1 1 0; min-width: 0; }
  .trade-custom-row button { flex: 0 0 auto; }
}
.share-view .binder-empty-slot, .share-view .cond-pill, .share-view .empty-vault-box button { pointer-events: none; }
.share-view .empty-vault-box button, .share-view .binder-empty-slot { display: none !important; }
.share-view .price-sub, .share-view #detailGainSub, .share-view .unrealized-stat, .share-view .owner-only,
.share-view [data-tab="studio"], .share-view #detailInspectPregradeBtn, .share-view #detailOpenRoiBtn { display: none !important; }
@media (max-width: 640px) {
  .card-frame { width: min(300px, 100%); height: auto; aspect-ratio: 5 / 7; }
  .scanner-stage { padding: 12px; }
  .panel { padding-left: 16px; padding-right: 16px; }
}
.share-view .chart-panel, .share-view [data-filter="GRADE_CANDIDATE"] { display: none !important; }
.share-view .paid-info, .share-view .cost-field { display: none !important; }
.share-view .grail-panel { display: none !important; }
.share-view #detailNameInput, .share-view #detailSetInput { pointer-events: none; }
