:root {
  /* Theme tokens — change these to retheme the entire app */
  --navy-800: #191e34;
  --navy-900: #0b0f1a;
  --navy-700: #161b30;
  --gold: #cfb159;
  --gold-light: #e5d3a1;
  --gold-dark: #b0983a;
  --bg-dark: #1a1f38;
  --bg-page: #1a1f38;
  --text-primary: rgba(255, 255, 255, 0.87);
  --text-secondary: rgba(255, 255, 255, 0.6);
  --text-muted: rgba(255, 255, 255, 0.5);
  --text-gold: #cfb159;
  /* White tints for Tailwind utility classes */
  --white: #ffffff;
  --white-5: rgba(255, 255, 255, 0.05);
  --white-10: rgba(255, 255, 255, 0.1);
  --white-20: rgba(255, 255, 255, 0.2);
  --white-30: rgba(255, 255, 255, 0.3);
  --white-40: rgba(255, 255, 255, 0.4);
  --white-50: rgba(255, 255, 255, 0.5);
  --white-60: rgba(255, 255, 255, 0.6);
  --white-70: rgba(255, 255, 255, 0.7);
  --white-80: rgba(255, 255, 255, 0.8);
  --white-90: rgba(255, 255, 255, 0.9);
  /* Glassmorphism */
  --glass-bg: rgba(255, 255, 255, 0.65);
  --glass-border: rgba(255, 255, 255, 0.25);
  --glass-navy-bg: linear-gradient(
    180deg,
    #1a1f38 0%,
    #1e2440 50%,
    #222a4a 100%
  );
  --glass-navy-border: rgba(255, 255, 255, 0.12);
  /* FLAT panel surface for new work. The navy GRADIENT (--glass-navy-bg) starts
     at the exact page colour, so panels faded in from nowhere and rows looked
     bottom-heavy — user feedback. --glass-navy-bg itself is intentionally left
     alone because the cross-list cards + landing use it. */
  --surface-flat: rgba(11, 15, 26, 0.45);
  --glass-navy-dark-bg: rgba(25, 30, 52, 0.92);
  --glass-navy-dark-content-bg: rgba(25, 30, 52, 0.7);
  /* Dock scroll animation — hide on scroll down, reveal on scroll up */
  .dock-hidden {
    transform: translateY(140%) !important;
    opacity: 0 !important;
    pointer-events: none;
  }
  #mobile-dock-wrapper {
    transition:
      transform 350ms var(--motion-ease-out),
      opacity 300ms ease;
  }
  .header-hidden {
    transform: translateY(-120%) !important;
    opacity: 0 !important;
    pointer-events: none;
  }
  #mobile-header-wrapper {
    transition:
      transform 350ms var(--motion-ease-out),
      opacity 300ms ease;
  }

  /* Dock background — switches with theme */
  --dock-bg: rgba(25, 30, 52, 0.92);
  --dock-shadow:
    0 8px 32px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  --dock-ring: ring-white/10;
  /* Motion */
  --motion-duration: 0.2s;
  --motion-ease: cubic-bezier(0.4, 0, 0.2, 1);
  --motion-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* Manual light theme — toggled via data-theme="light" on <html> */
[data-theme="light"] {
  --navy-800: #ffffff;
  --navy-900: #f1f5f9;
  --navy-700: #e2e8f0;
  --light-panel: #ffffff;
  --bg-page: #fbfcfd;
  --text-primary: #0f172a;
  --text-secondary: rgba(15, 23, 42, 0.6);
  --text-muted: rgba(15, 23, 42, 0.5);
  /* `--text-gold` was never overridden for light, so EVERY `color: var(--text-gold)`
     rendered brand gold #cfb159 on white = 2.03:1. The `.text-gold` CLASS is overridden,
     which masked it for utility-class users, but variable users got the unreadable gold. */
  --text-gold: #8a6d1f;
  --white: #0f172a;
  --white-5: rgba(15, 23, 42, 0.05);
  --white-10: rgba(15, 23, 42, 0.08);
  --white-20: rgba(15, 23, 42, 0.12);
  --white-30: rgba(15, 23, 42, 0.18);
  --white-40: rgba(15, 23, 42, 0.25);
  --white-50: rgba(15, 23, 42, 0.35);
  --white-60: rgba(15, 23, 42, 0.45);
  --white-70: rgba(15, 23, 42, 0.55);
  --white-80: rgba(15, 23, 42, 0.65);
  --white-90: rgba(15, 23, 42, 0.75);
  --glass-bg: rgba(255, 255, 255, 0.92);
  --glass-border: rgba(15, 23, 42, 0.15);
  --glass-navy-bg: linear-gradient(
    180deg,
    #f8fafc 0%,
    #f1f5f9 50%,
    #e2e8f0 100%
  );
  --glass-navy-border: rgba(15, 23, 42, 0.1);
  --surface-flat: var(--light-panel);
  --glass-navy-dark-bg: rgba(255, 255, 255, 0.92);
  --glass-navy-dark-content-bg: rgba(255, 255, 255, 0.7);
}

/* Override Tailwind utility classes for light theme */
[data-theme="light"] .bg-navy-800,
[data-theme="light"] .bg-navy,
[data-theme="light"] .bg-navy-900 {
  background-color: #f8fafc !important;
}
[data-theme="light"] .text-white,
[data-theme="light"] .text-white\/20,
[data-theme="light"] .text-white\/30,
[data-theme="light"] .text-white\/35,
[data-theme="light"] .text-white\/40,
[data-theme="light"] .text-white\/45,
[data-theme="light"] .text-white\/50,
[data-theme="light"] .text-white\/55,
[data-theme="light"] .text-white\/60,
[data-theme="light"] .text-white\/65,
[data-theme="light"] .text-white\/70,
[data-theme="light"] .text-white\/80,
[data-theme="light"] .text-white\/85,
[data-theme="light"] .text-white\/90 {
  color: #0f172a !important;
}
[data-theme="light"] .hover\:text-white:hover,
[data-theme="light"] .hover\:text-white\/60:hover,
[data-theme="light"] .hover\:text-white\/70:hover,
[data-theme="light"] .hover\:text-white\/80:hover {
  color: #0f172a !important;
}
/* MUST target ::placeholder. Setting `color` on the ELEMENT clobbered the input's
   text colour: this rule lands after the .text-white override, so in light theme
   typed text rendered at rgba(15,23,42,.4) — 40% grey. */
[data-theme="light"] .placeholder-white\/30::placeholder,
[data-theme="light"] .placeholder-white\/40::placeholder {
  color: rgba(15, 23, 42, 0.4) !important;
}

/* --- navy-family colour fixes ---------------------------------------------
   `.text-navy` / `.text-navy-800` resolve to var(--navy-800), and in the light
   theme THAT TOKEN IS #ffffff — so every element using these rendered invisible
   white-on-white (measured: rgb(255,255,255) on rgba(15,23,42,.08)). They always
   sit on light surfaces, so dark text is the correct theme mapping.
   `.text-navy-900` is only ever used on GOLD (dock active pill, gold CTAs, tab
   pill) where the text must stay dark in both themes. */
[data-theme="light"] .text-navy,
[data-theme="light"] .text-navy-800 {
  color: #0f172a !important;
}

/* --- shadows that were tuned for navy only -------------------------------
   `.polished-sidebar` cast `4px 0 32px rgba(0,0,0,.45)`. On MOBILE the sidebar is
   off-canvas, so that 45%-black shadow bled INTO the viewport as a dark strip
   down the entire left edge (measured rgb(178,181,184) over an #eef1f6 page),
   which made the whole page read grey. The header was 30% black too. */
[data-theme="light"] .polished-sidebar {
  box-shadow: 4px 0 24px rgba(15, 23, 42, 0.08);
}
[data-theme="light"] .polished-header {
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.07);
}
@media (max-width: 1023px) {
  /* an off-canvas drawer must not cast a shadow at all */
  .polished-sidebar {
    box-shadow: none;
  }
}
[data-theme="light"] .text-navy-900 {
  color: #10131f !important;
}
[data-theme="light"] .border-navy,
[data-theme="light"] .border-navy-800 {
  border-color: rgba(15, 23, 42, 0.2) !important;
}

/* A GOLD background always needs DARK text. `bg-gold text-white/90` rendered
   white-on-gold in the dark theme (it only worked in light because of the
   .text-white override above). Applies in both themes. */
.bg-gold.text-white,
.bg-gold.text-white\/90,
.bg-gold.text-white\/80,
.bg-gold\/90.text-white\/90,
.bg-gold\/90.text-white,
.grad-gold.text-white\/90 {
  color: #10131f !important;
}
[data-theme="light"] .bg-white\/5,
[data-theme="light"] .bg-white\/10,
[data-theme="light"] .bg-white\/15,
[data-theme="light"] .bg-white\/20,
[data-theme="light"] .bg-white\/30,
[data-theme="light"] .bg-white\/50,
[data-theme="light"] .bg-white\/70,
[data-theme="light"] .bg-white\/80 {
  background-color: rgba(15, 23, 42, 0.08) !important;
}
[data-theme="light"] .border-white\/5,
[data-theme="light"] .border-white\/10,
[data-theme="light"] .border-white\/15,
[data-theme="light"] .border-white\/20,
[data-theme="light"] .border-white\/30 {
  border-color: rgba(15, 23, 42, 0.15) !important;
}
[data-theme="light"] body {
  /* The darker backdrop lives HERE, behind the cards — not on the cards.
     (Was a hardcoded #f8fafc, which overrode --bg-page and made the panels
     the dark element instead.) */
  background-color: var(--bg-page) !important;
  color: #0f172a !important;
}
/* Override all bg-navy-800 usages in the app (sidebar, header, search, etc.) */
[data-theme="light"] .bg-navy-800,
[data-theme="light"] .bg-navy-800\/95,
[data-theme="light"] .bg-navy-800\/90,
[data-theme="light"] .bg-navy-800\/80,
[data-theme="light"] .bg-navy-800\/70,
[data-theme="light"] .bg-navy-800\/60,
[data-theme="light"] .bg-navy-800\/50,
[data-theme="light"] .bg-navy-800\/40,
[data-theme="light"] .bg-navy-800\/30,
[data-theme="light"] .bg-navy-800\/20,
[data-theme="light"] .bg-navy-800\/10,
[data-theme="light"] .bg-navy-800\/5 {
  background-color: #f8fafc !important;
}
/* Override all bg-navy-900 usages */
[data-theme="light"] .bg-navy-900,
[data-theme="light"] .bg-navy-900\/60,
[data-theme="light"] .bg-navy-900\/50 {
  background-color: #f1f5f9 !important;
}
/* Override all bg-navy-700 usages */
[data-theme="light"] .bg-navy-700,
[data-theme="light"] .bg-navy-700\/70,
[data-theme="light"] .bg-navy-700\/50 {
  background-color: #e2e8f0 !important;
}
/* Override base bg-navy (no shade) */
[data-theme="light"] .bg-navy {
  background-color: #f8fafc !important;
}
[data-theme="light"] .bg-navy\/8,
[data-theme="light"] .bg-navy\/10 {
  background-color: rgba(15, 23, 42, 0.05) !important;
}
/* Sidebar and header bg-navy-800 */
[data-theme="light"] .polished-sidebar {
  background: #f8fafc !important;
  border-right: 1px solid rgba(15, 23, 42, 0.1) !important;
}
[data-theme="light"] .polished-header {
  background: #f8fafc !important;
  border-bottom: 1px solid rgba(15, 23, 42, 0.1) !important;
}
/* Glass-navy-dark modals */
[data-theme="light"] .glass-navy-dark {
  /* WHITE, not #f8fafc: the page is now #fbfcfd, so a 248 panel sat DARKER than
     the page (sunken). The shadow below does the layering, like every other card. */
  background: rgba(255, 255, 255, 0.98) !important;
  border: 1px solid rgba(207, 177, 89, 0.2) !important;
}
[data-theme="light"] .glass-navy-dark-content {
  background: rgba(248, 250, 252, 0.75) !important;
}
/* Light theme dock overrides */
[data-theme="light"] {
  --dock-bg: rgba(248, 250, 252, 0.92);
  --dock-shadow:
    0 8px 32px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

/* Scan progress pill — same design language as the dock capsule: identical
   bg/shadow tokens, rounded-full, theme-aware text and progress track, plus a
   circular (dock-style) cancel button. */
.scan-pill {
  background: var(--dock-bg);
  box-shadow: var(--dock-shadow);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.scan-pill-text {
  color: rgba(255, 255, 255, 0.92);
}
.scan-pill-track {
  background: rgba(255, 255, 255, 0.16);
}
.scan-pill-cancel {
  background: rgba(239, 68, 68, 0.18);
  color: #fca5a5;
}
.scan-pill-cancel:hover {
  background: rgba(239, 68, 68, 0.32);
  color: #fecaca;
}
[data-theme="light"] .scan-pill {
  border-color: rgba(15, 23, 42, 0.1);
}
[data-theme="light"] .scan-pill-text {
  color: rgba(15, 23, 42, 0.86);
}
[data-theme="light"] .scan-pill-track {
  background: rgba(15, 23, 42, 0.12);
}
[data-theme="light"] .scan-pill-cancel {
  background: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
}
[data-theme="light"] .scan-pill-cancel:hover {
  background: rgba(239, 68, 68, 0.22);
  color: #991b1b;
}

/* ── Login modal internals ───────────────────────────────────────────────
   The login modal is a permanently NAVY surface (`bg-navy-800`) — there is no
   light-theme variant in this file — so these deliberately have NO
   [data-theme="light"] overrides. Adding them would paint a white button onto a
   navy modal whenever the user switches to light mode. */
.login-panel {
  background: linear-gradient(
    180deg,
    rgba(25, 30, 52, 0.97) 0%,
    rgba(11, 15, 26, 0.98) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
/* The panel's height is set imperatively from the content's natural height
   (see LoginModal) so ANY content change animates — switching Login/Register
   adds the Full Name field, and an error/notice changes the height too.
   Kept SHORT (200ms): a slow height ease on a tab toggle reads as laggy. */
.login-panel-measured {
  transition: height 200ms cubic-bezier(0.22, 1, 0.36, 1);
}
/* Content swap (tab change): the fields crossfade and rise slightly. */
@keyframes loginSwapIn {
  0% {
    opacity: 0;
    transform: translateY(6px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}
.login-swap {
  animation: loginSwapIn 180ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
/* Inline notices (error / OAuth) slide in rather than popping. */
@keyframes loginNoticeIn {
  0% {
    opacity: 0;
    transform: translateY(-4px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}
.login-notice {
  animation: loginNoticeIn 220ms ease-out both;
}
/* Busy spinner inside the submit button. */
@keyframes loginSpin {
  to {
    transform: rotate(360deg);
  }
}
.login-spin {
  animation: loginSpin 800ms linear infinite;
}
@media (prefers-reduced-motion: reduce) {
  .login-panel-measured {
    transition: none;
  }
  .login-swap,
  .login-notice,
  .login-spin {
    animation: none;
  }
}
/* gold ambience inside the panel — same language as the landing surface */
.login-ambience {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(
      420px 220px at 84% -12%,
      rgba(207, 177, 89, 0.2),
      transparent 70%
    ),
    radial-gradient(
      320px 200px at -10% 105%,
      rgba(207, 177, 89, 0.08),
      transparent 72%
    );
}
.login-tabbar {
  background: rgba(11, 15, 26, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.07);
}
/* Inputs: Tailwind's `forms` plugin injects its own element-level input styles
   (white background) from the CDN AFTER this file, so these need !important to
   win. Verified by measuring the computed background — without it the fields
   rendered pure white on the navy panel. */
.login-input {
  background: rgba(255, 255, 255, 0.04) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  color: #fff !important;
}
.login-input::placeholder {
  color: rgba(255, 255, 255, 0.3) !important;
}
.login-input:focus {
  outline: none !important;
  border-color: rgba(207, 177, 89, 0.6) !important;
  box-shadow: 0 0 0 3px rgba(207, 177, 89, 0.15) !important;
}
.login-rule {
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(207, 177, 89, 0.3),
    transparent
  );
}
.oauth-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.92);
}
.oauth-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(207, 177, 89, 0.4);
}
.oauth-soon {
  background: rgba(207, 177, 89, 0.14);
  border: 1px solid rgba(207, 177, 89, 0.32);
  color: #cfb159;
}
.oauth-divider {
  color: rgba(255, 255, 255, 0.35);
}

/* Nav link text */
[data-theme="light"] .nav-link {
  color: rgba(15, 23, 42, 0.6) !important;
}
[data-theme="light"] .nav-link:hover {
  color: #cfb159 !important;
}

/* ── Landing page (mobile-first) ─────────────────────────────────────────
   Replaces the old BackgroundV5.png photo + overlay + corner glows: a dark
   navy surface with two soft gold ambiences and a very faint scanline grain. */
.landing-surface {
  background: #0b0f1a;
  color: #fff;
}
.landing-ambience {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(
      600px 340px at 78% -6%,
      rgba(207, 177, 89, 0.16),
      transparent 70%
    ),
    radial-gradient(
      520px 320px at 6% 34%,
      rgba(207, 177, 89, 0.07),
      transparent 72%
    );
}
/* Animated constellation canvas (NodeBackground). Scoped to the HERO section —
   absolutely positioned inside it (the hero is `relative overflow-hidden`), so
   the web sits behind the hero copy only and scrolls away with it. */
.landing-nodes {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
  pointer-events: none;
}
.landing-grain {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.5;
  background-image: linear-gradient(
    rgba(255, 255, 255, 0.02) 1px,
    transparent 1px
  );
  background-size: 100% 3px;
}
.landing-rule {
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(207, 177, 89, 0.35),
    transparent
  );
}
.landing-card {
  background: rgba(25, 30, 52, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.07);
}
.landing-viz {
  background: rgba(11, 15, 26, 0.55);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.landing-chip {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.09);
}
.landing-node {
  background: rgba(207, 177, 89, 0.1);
  border: 1px solid rgba(207, 177, 89, 0.28);
}
.landing-bar-gold {
  background: linear-gradient(180deg, #cfb159, rgba(207, 177, 89, 0.25));
}
.landing-bar-dim {
  background: rgba(255, 255, 255, 0.14);
}
.grad-gold {
  background: linear-gradient(135deg, #e5d3a1 0%, #cfb159 50%, #b0983a 100%);
}

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

html,
body {
  height: 100%;
}
#root {
  min-height: 100vh;
}
body {
  font-family: "DM Sans", sans-serif;
  -webkit-font-smoothing: antialiased;
  background-color: var(--bg-page);
  color: var(--text-primary);
  overflow-x: hidden;
}

.fixed-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: url("/frontend/BackgroundV5.png") no-repeat right center;
  background-size: cover;
  z-index: 1;
}

.bg-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 60vw;
  height: 100vh;
  background: linear-gradient(
    90deg,
    rgba(4, 11, 22, 0.92) 0%,
    rgba(4, 11, 22, 0.55) 60%,
    rgba(4, 11, 22, 0) 100%
  );
  z-index: 2;
}

.corner-glow {
  position: fixed;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(207, 177, 89, 0.15) 0%,
    transparent 70%
  );
  z-index: 3;
  pointer-events: none;
}

.glow-top-left {
  top: -100px;
  left: -100px;
  animation: pulse 5s ease-in-out infinite;
}

.glow-bottom-right {
  bottom: -100px;
  right: -100px;
  animation: pulse 5s ease-in-out infinite 2.5s;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.15;
    transform: scale(1);
  }
  50% {
    opacity: 0.4;
    transform: scale(1.15);
  }
}

.gold-shine {
  color: #cfb159;
  text-shadow: 0 0 12px rgba(207, 177, 89, 0.5);
  animation: shimmer 2.5s ease-in-out infinite alternate;
}

@keyframes shimmer {
  from {
    text-shadow: 0 0 6px rgba(207, 177, 89, 0.3);
  }
  to {
    text-shadow: 0 0 18px rgba(207, 177, 89, 0.8);
  }
}

.gold-border-hover:hover {
  border-color: rgba(207, 177, 89, 0.3);
}

.vertical-text {
  writing-mode: vertical-rl;
  text-orientation: mixed;
}

.nav-link {
  color: var(--text-secondary);
  transition: color 0.3s ease;
  font-size: 0.8125rem;
}
.nav-link:hover {
  color: var(--gold);
}

.btn-gold {
  background: linear-gradient(135deg, #e5d3a1 0%, #cfb159 50%, #b0983a 100%);
  color: #040b16;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(207, 177, 89, 0.15);
  letter-spacing: 0.1em;
}

.btn-gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(207, 177, 89, 0.3);
  background: linear-gradient(135deg, #e3cea2 0%, #cfb159 50%, #b0983a 100%);
}
.btn-gold:active {
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(207, 177, 89, 0.25);
}

body.modal-open {
  overflow: hidden;
}
/* a11y: visible focus rings for keyboard navigation */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus,
[tabindex]:focus,
[role="button"]:focus {
  outline: 2px solid #cfb159;
  outline-offset: 2px;
}
#skip-link:focus {
  outline: 2px solid #cfb159;
  outline-offset: 2px;
}
#skip-link {
  position: absolute;
  top: 0;
  left: 0;
  transform: translateY(-100%);
  transition: transform 0.2s ease;
  pointer-events: none;
}
#skip-link:focus {
  transform: translateY(0);
  pointer-events: auto;
  z-index: 9999;
}

/* Glass Effects */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--glass-border);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}
.glass-navy {
  background: var(--glass-navy-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-navy-border);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.floating-card {
  animation: float-in 400ms ease-out both;
}
@keyframes float-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Modal Transition — I5: standardized 150-200ms (175ms) */
.modal-fade {
  opacity: 0;
  transition: opacity var(--motion-duration) var(--motion-ease);
}
.modal-fade-active {
  opacity: 1;
}
.modal-scale {
  transform: scale(0.95);
  opacity: 0;
  transition:
    transform var(--motion-duration) var(--motion-ease),
    opacity var(--motion-duration) var(--motion-ease);
}
.modal-scale-active {
  transform: scale(1);
  opacity: 1;
}
/* Unified modal enter/exit — I5: 175ms fade + scale */
.modal-enter {
  opacity: 0;
  transform: scale(0.96);
  transition:
    opacity var(--motion-duration) var(--motion-ease),
    transform var(--motion-duration) var(--motion-ease);
}
.modal-enter-active {
  opacity: 1;
  transform: scale(1);
}
/* Exit animation — symmetric to enter so modals don't snap out */
.modal-exit {
  opacity: 1;
  transform: scale(1);
  transition:
    opacity var(--motion-duration) var(--motion-ease),
    transform var(--motion-duration) var(--motion-ease);
}
.modal-exit-active {
  opacity: 0;
  transform: scale(0.96);
  pointer-events: none;
}
/* View transition — I5: 175ms fade + slide for routed view changes */
.view-enter {
  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity var(--motion-duration) var(--motion-ease-out),
    transform var(--motion-duration) var(--motion-ease-out);
}
.view-enter-active {
  opacity: 1;
  transform: translateY(0);
}
/* Sidebar slide for mobile — I5: 175ms slide */
.sidebar-slide {
  transition: transform var(--motion-duration) var(--motion-ease);
}

/* Module Organizer — drag states, fake sidebar layout, description panel */
.module-organizer-backdrop {
  animation: modalFadeIn var(--motion-duration) var(--motion-ease) forwards;
}
@keyframes modalFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.module-card {
  transition:
    background-color 0.15s ease,
    opacity 0.15s ease,
    transform 0.15s ease;
}
.module-card:active {
  transform: scale(0.98);
}
.module-card.dragging {
  opacity: 0.5;
  background-color: rgba(207, 177, 89, 0.1);
}
.module-card.drag-over {
  border-top: 2px solid #cfb159;
  margin-top: -2px;
  padding-top: calc(0.75rem + 2px);
}
.module-card-toggle {
  transition:
    background-color 0.2s ease,
    transform 0.2s ease;
}
.module-card-toggle:active {
  transform: scale(0.92);
}
.organizer-description-panel {
  background: rgba(11, 15, 26, 0.5);
}
.organizer-section-header {
  transition: opacity 0.15s ease;
}

/* Collapse panel transitions — I5: standardized 150-200ms
           Fixed: max-height target reduced from 2000px to 600px so open animation
           doesn't snap to content size within first 3-15% of duration.
           Added opacity transition for symmetric open/close perception.
           Changed easing from ease-out to ease-in-out for balanced open/close feel. */
.collapse-panel {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition:
    max-height 0.22s var(--motion-ease),
    opacity 0.22s var(--motion-ease);
}
.collapse-enter-active {
  max-height: 600px;
  opacity: 1;
}
.collapse-exit-active {
  max-height: 0;
  opacity: 0;
}
@media (max-width: 640px) {
  .collapse-enter-active {
    max-height: 1000px;
  }
}

/* Gold Alpha Colors */
.bg-gold\\/10 {
  background-color: rgba(207, 177, 89, 0.1);
}
.bg-gold\\/20 {
  background-color: rgba(207, 177, 89, 0.2);
}
.border-gold {
  border-color: var(--gold);
}
.text-gold {
  color: var(--gold);
}
.text-navy {
  color: var(--navy-800);
}
.bg-navy {
  background-color: var(--navy-800);
}
.bg-navy-800 {
  background-color: var(--navy-800);
}
.bg-navy-900 {
  background-color: var(--navy-900);
}
.border-navy {
  border-color: var(--navy-800);
}
.text-navy-800 {
  color: var(--navy-800);
}

/* Navy-800 Glassmorphism for Modals */
.glass-navy-dark {
  background: var(--glass-navy-dark-bg);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid rgba(207, 177, 89, 0.2);
  box-shadow:
    0 12px 48px rgba(0, 0, 0, 0.4),
    0 0 24px rgba(207, 177, 89, 0.08),
    inset 0 1px 0 rgba(207, 177, 89, 0.1);
}
.glass-navy-dark-content {
  background: var(--glass-navy-dark-content-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.gold-glow-border {
  border-color: rgba(207, 177, 89, 0.25);
}
.gold-glow-border:focus {
  border-color: rgba(207, 177, 89, 0.6);
  box-shadow: 0 0 0 3px rgba(207, 177, 89, 0.15);
}

/* Polished Edges */
.polished-card {
  border-radius: 1rem;
  border: 1px solid rgba(207, 177, 89, 0.2);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 var(--white-5);
}

.polished-sidebar {
  border-right: 1px solid rgba(207, 177, 89, 0.15);
  box-shadow: 4px 0 32px rgba(0, 0, 0, 0.45);
}

.polished-header {
  border-bottom: 1px solid rgba(207, 177, 89, 0.15);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

.gold-glow {
  box-shadow: 0 0 20px rgba(207, 177, 89, 0.15);
}

/* Cross-List Fade In */
.cl-fade-in {
  animation: clFadeIn 0.8s ease-out both;
}
.cl-fade-in-delay-1 {
  animation-delay: 0.1s;
}
.cl-fade-in-delay-2 {
  animation-delay: 0.2s;
}
.cl-fade-in-delay-3 {
  animation-delay: 0.3s;
}
@keyframes clFadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Tab content fade transition */
.tab-transition-enter {
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 0.15s ease,
    transform 0.15s ease;
}
.tab-transition-enter-active {
  opacity: 1;
  transform: translateY(0);
}

/* Dropdown fade-in-scale */
.animate-fade-in-scale {
  animation: fade-in-scale 0.15s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
@keyframes fade-in-scale {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Sleek List View for Cross-List — navy/gold glassmorphism table rows */
.list-row {
  background: var(--white-5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(207, 177, 89, 0.1);
  border-radius: 0.75rem;
  transition: all 0.2s ease;
}
.list-row:hover {
  background: var(--white-10);
  border-color: rgba(207, 177, 89, 0.3);
  box-shadow: 0 4px 24px rgba(207, 177, 89, 0.08);
}
.list-row-divider {
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(207, 177, 89, 0.15),
    transparent
  );
}
.dot-gold {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #cfb159;
  box-shadow: 0 0 6px rgba(207, 177, 89, 0.5);
}

/* Bottom Sheet Animation - I5: 175ms fade + 200ms slide */
.bs-enter .bs-backdrop {
  opacity: 1;
}
.bs-enter .bs-panel {
  transform: translateY(0);
}
.bs-exit .bs-backdrop {
  opacity: 0;
}
.bs-exit .bs-panel {
  transform: translateY(100%);
}

/* Mobile */
@media (max-width: 640px) {
  .mobile-stack {
    flex-direction: column;
    gap: 0.5rem;
  }
  input,
  textarea,
  select {
    font-size: 16px;
  }
  .fixed-bg {
    display: none;
  }
  .corner-glow {
    display: none;
  }
  .bg-overlay {
    display: none;
  }
  /* Make room for the mobile bottom dock — add bottom padding to view content */
  main .view-enter > div.overflow-y-auto {
    padding-bottom: 5rem;
  }
  /* Hide horizontal scrollbar but keep scroll functional on mobile */
  .scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
  }
  .scrollbar-hide::-webkit-scrollbar {
    display: none;
  }
  /* Mobile: ensure text is legible on both light and dark backgrounds */
  .text-white,
  .text-white\\/20,
  .text-white\\/30,
  .text-white\\/40,
  .text-white\\/50,
  .text-white\\/60,
  .text-white\\/70,
  .text-white\\/80,
  .text-white\\/90 {
    color: var(--text-primary) !important;
  }
  /* Mobile: ensure bg-white tints adapt to theme */
  .bg-white\\/5,
  .bg-white\\/10,
  .bg-white\\/20,
  .bg-white\\/30 {
    background-color: var(--white-5) !important;
  }
  .bg-white\\/50,
  .bg-white\\/70,
  .bg-white\\/80 {
    background-color: var(--white-10) !important;
  }
  /* Mobile: ensure border-white tints adapt */
  .border-white\\/5,
  .border-white\\/10,
  .border-white\\/15,
  .border-white\\/20 {
    border-color: var(--white-10) !important;
  }
  /* Mobile: ensure nav-link text is legible */
  .nav-link {
    color: var(--text-secondary) !important;
  }
  /* Mobile: ensure glass-navy-dark modals are legible */
  .glass-navy-dark {
    background: var(--glass-navy-dark-bg) !important;
  }
}

/* --- Scan progress pill bar ------------------------------------------------
   scan-progress-bar-fill had no CSS at all: the fill div had no height and
   no background, so the bar rendered as an empty grey track. These rules give
   it a visible gold fill, a CSS transition so the eased value glides rather
   than stepping, and a subtle shimmer to read as "actively working". */
.scan-progress-bar-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #d4af37 0%, #f4d77a 100%);
  border-radius: 9999px;
  box-shadow: 0 0 8px rgba(212, 175, 55, 0.55);
  transition: width 220ms cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
  overflow: hidden;
}

.scan-progress-bar-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.45) 50%,
    transparent 100%
  );
  transform: translateX(-100%);
  animation: scan-bar-shimmer 1.6s ease-in-out infinite;
}

@keyframes scan-bar-shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .scan-progress-bar-fill {
    transition: none;
  }
  .scan-progress-bar-fill::after {
    animation: none;
  }
}

/* =====================================================================
   Cross-List page — approved redesign (see ordeal-design-system §8)
   Mockups: mockups/crosslist-redesign-{mobile,desktop}.html
   Every surface uses the theme TOKENS so both themes render correctly.
   ===================================================================== */

/* ---------- hero panel (mobile) ---------- */
.cl-hero {
  position: relative;
  overflow: hidden;
  border-radius: 26px;
  padding: 20px 18px 18px;
  background: var(--surface-flat);
  border: 1px solid var(--glass-navy-border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow:
    0 18px 44px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.cl-hero::before {
  content: "";
  position: absolute;
  top: -60%;
  right: -20%;
  width: 260px;
  height: 260px;
  pointer-events: none;
  background: radial-gradient(
    circle,
    rgba(207, 177, 89, 0.22),
    transparent 62%
  );
}
[data-theme="light"] .cl-hero {
  box-shadow:
    0 14px 34px rgba(15, 23, 42, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
}
[data-theme="light"] .cl-hero::before {
  background: radial-gradient(
    circle,
    rgba(207, 177, 89, 0.16),
    transparent 62%
  );
}

.cl-eyebrow {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
}
.cl-heading {
  margin: 10px 0 0;
  font-size: 27px;
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}
.cl-heading em {
  font-style: normal;
  background: linear-gradient(135deg, #e5d3a1 0%, #cfb159 50%, #b0983a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
[data-theme="light"] .cl-heading em {
  background: none;
  -webkit-text-fill-color: #8a6d1f;
  color: #8a6d1f;
}
.cl-sub {
  margin: 9px 0 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-secondary);
}

/* ---------- gold CTA ---------- */
/* The mobile hero stacks `.cl-sub` then the CTA, and `.cl-sub` has `margin: 9px 0 0`
   (nothing below) while .cl-cta had no top margin -> the gold button sat FLUSH under
   the status line (measured gap 0px). Scoped to the adjacent-sibling case so the
   desktop `.cl-cta-pill` inside its flex row is untouched. */
.cl-hero .cl-sub + .cl-cta {
  margin-top: 14px;
}
.cl-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 0;
  border-radius: 16px;
  padding: 15px 16px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  color: #10131f;
  background: linear-gradient(135deg, #e5d3a1 0%, #cfb159 50%, #b0983a 100%);
  box-shadow:
    0 12px 30px rgba(207, 177, 89, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease;
}
.cl-cta:hover {
  transform: translateY(-1px);
  box-shadow:
    0 16px 34px rgba(207, 177, 89, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.cl-cta:active {
  transform: scale(0.99);
}
.cl-cta-pill {
  border-radius: 999px;
  padding: 13px 20px;
  margin: 0;
  font-size: 13.5px;
  width: auto;
}

/* ---------- ghost chips ---------- */
.cl-ghostrow {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.cl-ghost {
  flex: 1;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 14px;
  background: var(--white-5);
  border: 1px solid var(--glass-navy-border);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition:
    background 0.18s ease,
    color 0.18s ease;
}
.cl-ghost:hover {
  background: var(--white-10);
  color: var(--text-primary);
}

/* ---------- "not wired yet" chip (honest labelling) ---------- */
.cl-soon {
  margin-left: 5px;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: rgba(207, 177, 89, 0.16);
  border: 1px solid rgba(207, 177, 89, 0.36);
  color: var(--gold);
}
[data-theme="light"] .cl-soon {
  color: #8a6d1f;
  border-color: rgba(207, 177, 89, 0.5);
}
.cl-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 14px;
  padding: 10px 13px;
  font-size: 12px;
  font-weight: 600;
  color: var(--gold);
  background: rgba(207, 177, 89, 0.1);
  border: 1px solid rgba(207, 177, 89, 0.28);
  animation: cl-notice-in 220ms ease-out both;
}
[data-theme="light"] .cl-notice {
  color: #8a6d1f;
  background: rgba(207, 177, 89, 0.14);
  border-color: rgba(207, 177, 89, 0.45);
}
@keyframes cl-notice-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- stat chips ---------- */
.cl-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  margin-top: 12px;
}
@media (min-width: 1024px) {
  .cl-stats {
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-top: 18px;
  }
}
.cl-stat {
  border-radius: 16px;
  padding: 11px 12px;
  background: var(--surface-flat);
  border: 1px solid var(--glass-navy-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
@media (min-width: 1024px) {
  .cl-stat {
    border-radius: 18px;
    padding: 14px 16px;
  }
}
.cl-stat-k {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.cl-stat-v {
  margin-top: 7px;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}
@media (min-width: 1024px) {
  .cl-stat-v {
    margin-top: 8px;
    font-size: 23px;
  }
}
.cl-stat.is-ready .cl-stat-v {
  color: var(--gold);
}
[data-theme="light"] .cl-stat.is-ready .cl-stat-v {
  color: #8a6d1f;
}
.cl-dot {
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: 50%;
}
.cl-dot-ready {
  background: var(--gold);
}
.cl-dot-listed {
  background: #4ade80;
}
.cl-dot-failed {
  background: #f87171;
}
.cl-dot-total {
  background: var(--text-muted);
}

/* ---------- segmented control (matches the login modal) ---------- */
.cl-seg {
  position: relative;
  display: flex;
  padding: 4px;
  border-radius: 999px;
  background: var(--white-5);
  border: 1px solid var(--glass-navy-border);
}
.cl-seg-pill {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: 84px;
  border-radius: 999px;
  background: linear-gradient(135deg, #e5d3a1 0%, #cfb159 50%, #b0983a 100%);
  box-shadow: 0 6px 16px rgba(207, 177, 89, 0.3);
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}
.cl-seg-pill.is-list {
  transform: translateX(84px);
}
.cl-seg-btn {
  position: relative;
  z-index: 1;
  width: 84px;
  border: 0;
  background: transparent;
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  padding: 8px 0;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s ease;
}
.cl-seg-btn.is-on {
  color: #10131f;
}
@media (min-width: 1024px) {
  .cl-seg-pill,
  .cl-seg-btn {
    width: 92px;
  }
  .cl-seg-pill.is-list {
    transform: translateX(92px);
  }
  .cl-seg-btn {
    font-size: 12.5px;
    padding: 9px 0;
  }
}

/* ---------- toolbar ---------- */
.cl-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.cl-count {
  margin-left: auto;
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--white-5);
  border: 1px solid var(--glass-navy-border);
}
.cl-dd {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--white-5);
  border: 1px solid var(--glass-navy-border);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}
.cl-dd:hover {
  color: var(--text-primary);
}
.cl-dd select {
  background: transparent;
  border: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
  outline: 0;
}
.cl-dd select option {
  background: var(--navy-800);
  color: var(--text-primary);
}

/* search — !important because the Tailwind `forms` plugin injects element-level
   input styles (white background) after this file. See SKILL always-on rule 7. */
.cl-search {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 250px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--white-5);
  border: 1px solid var(--glass-navy-border);
  color: var(--text-muted);
  transition: border-color 0.18s ease;
}
.cl-search:focus-within {
  border-color: rgba(207, 177, 89, 0.5);
}
.cl-search input {
  width: 100%;
  min-height: 42px;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  outline: 0 !important;
  color: var(--text-primary) !important;
  font-family: inherit;
  font-size: 13px;
}
.cl-search input::placeholder {
  color: var(--text-muted);
}

/* ---------- cards ---------- */
.cl-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (min-width: 1024px) {
  .cl-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
  }
}
.cl-card {
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  background: var(--surface-flat);
  border: 1px solid var(--glass-navy-border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow:
    0 14px 30px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}
[data-theme="light"] .cl-card {
  box-shadow:
    0 10px 24px rgba(15, 23, 42, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
}
.cl-card.is-clickable {
  cursor: pointer;
}
.cl-card.is-clickable:hover {
  transform: translateY(-3px);
  border-color: rgba(207, 177, 89, 0.4);
  box-shadow:
    0 26px 48px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(207, 177, 89, 0.18);
}
[data-theme="light"] .cl-card.is-clickable:hover {
  box-shadow:
    0 20px 40px rgba(15, 23, 42, 0.14),
    0 0 0 1px rgba(207, 177, 89, 0.3);
}
.cl-thumb {
  position: relative;
  height: 118px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #1d2440 0%, #12172a 100%);
  border-bottom: 1px solid var(--glass-navy-border);
}
[data-theme="light"] .cl-thumb {
  background: linear-gradient(160deg, #eef2f8 0%, #e2e8f0 100%);
}
@media (min-width: 1024px) {
  .cl-thumb {
    height: 150px;
  }
}
.cl-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cl-disc {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(207, 177, 89, 0.12);
  border: 1px solid rgba(207, 177, 89, 0.26);
  color: var(--gold);
}
@media (min-width: 1024px) {
  .cl-disc {
    width: 48px;
    height: 48px;
  }
}
.cl-disc.is-fail {
  background: rgba(248, 113, 113, 0.12);
  border-color: rgba(248, 113, 113, 0.3);
  color: #ef4444;
}
.cl-chip {
  position: absolute;
  top: 11px;
  left: 11px;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: rgba(11, 15, 26, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.74);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.cl-pill {
  position: absolute;
  top: 11px;
  right: 11px;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.cl-body {
  padding: 11px 12px 12px;
}
@media (min-width: 1024px) {
  .cl-body {
    padding: 13px 14px 14px;
  }
}
.cl-cardtitle {
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.32;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 33px;
}
@media (min-width: 1024px) {
  .cl-cardtitle {
    font-size: 13px;
    line-height: 1.34;
    min-height: 35px;
  }
}
.cl-price {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin-top: 9px;
}
.cl-amt {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.01em;
  background: linear-gradient(135deg, #e5d3a1 0%, #cfb159 50%, #b0983a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
@media (min-width: 1024px) {
  .cl-amt {
    font-size: 18px;
  }
}
[data-theme="light"] .cl-amt {
  background: none;
  -webkit-text-fill-color: #8a6d1f;
  color: #8a6d1f;
}
/* A job whose listing_json has no price still needs the row to keep its height */
.cl-amt.is-empty {
  background: none;
  -webkit-text-fill-color: var(--text-muted);
  color: var(--text-muted);
}
.cl-cond {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.cl-cmeta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px solid var(--glass-navy-border);
  font-size: 10.5px;
  color: var(--text-muted);
}
.cl-open {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 800;
  color: var(--gold);
}
[data-theme="light"] .cl-open {
  color: #8a6d1f;
}

/* status / platform tones (shared by cards, list rows, rail) */
.tone-gold {
  background: rgba(207, 177, 89, 0.16);
  border: 1px solid rgba(207, 177, 89, 0.36);
  color: var(--gold);
}
.tone-green {
  background: rgba(74, 222, 128, 0.14);
  border: 1px solid rgba(74, 222, 128, 0.32);
  color: #4ade80;
}
.tone-red {
  background: rgba(248, 113, 113, 0.14);
  border: 1px solid rgba(248, 113, 113, 0.34);
  color: #f87171;
}
.tone-blue {
  background: rgba(96, 165, 250, 0.14);
  border: 1px solid rgba(96, 165, 250, 0.32);
  color: #60a5fa;
}
.tone-neutral {
  background: rgba(148, 163, 184, 0.14);
  border: 1px solid rgba(148, 163, 184, 0.3);
  color: var(--text-secondary);
}
[data-theme="light"] .tone-gold {
  color: #8a6d1f;
  border-color: rgba(207, 177, 89, 0.5);
}
[data-theme="light"] .tone-green {
  color: #15803d;
  border-color: rgba(21, 128, 61, 0.35);
}
[data-theme="light"] .tone-red {
  color: #b91c1c;
  border-color: rgba(185, 28, 28, 0.35);
}
[data-theme="light"] .tone-blue {
  color: #1d4ed8;
  border-color: rgba(29, 78, 216, 0.35);
}

/* ---------- list mode rows ---------- */
.cl-rows {
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.cl-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px;
  border-radius: 18px;
  background: var(--surface-flat);
  border: 1px solid var(--glass-navy-border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition:
    border-color 0.18s ease,
    transform 0.18s ease;
}
.cl-row:hover {
  border-color: rgba(207, 177, 89, 0.32);
}
.cl-row.is-clickable {
  cursor: pointer;
}
.cl-sq {
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: linear-gradient(160deg, #1d2440 0%, #12172a 100%);
  border: 1px solid var(--glass-navy-border);
  color: rgba(207, 177, 89, 0.75);
}
[data-theme="light"] .cl-sq {
  background: linear-gradient(160deg, #eef2f8 0%, #e2e8f0 100%);
}
.cl-sq img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cl-rowtitle {
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cl-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  flex-wrap: wrap;
}
.cl-badge {
  padding: 3px 7px;
  border-radius: 7px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--white-5);
  border: 1px solid var(--glass-navy-border);
  color: var(--text-secondary);
}
.cl-rowprice {
  flex: 0 0 auto;
  text-align: right;
}
.cl-rowprice .cl-amt {
  font-size: 15px;
}
.cl-rowdate {
  margin-top: 5px;
  font-size: 10px;
  color: var(--text-muted);
}

/* ---------- filter rail (desktop) ---------- */
.cl-rail {
  width: 236px;
  flex: 0 0 236px;
  border-radius: 22px;
  padding: 16px;
  background: var(--surface-flat);
  border: 1px solid var(--glass-navy-border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow:
    0 14px 30px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
[data-theme="light"] .cl-rail {
  box-shadow:
    0 10px 24px rgba(15, 23, 42, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
}
.cl-rail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}
[data-theme="light"] .cl-rail-head {
  color: #8a6d1f;
}
.cl-rail-head button {
  border: 0;
  background: none;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
}
.cl-rail-head button:hover {
  color: var(--gold);
}
.cl-fgroup {
  margin-top: 16px;
}
.cl-fgroup h5 {
  margin: 0 0 9px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.cl-frow {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 7px 8px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: none;
  font-family: inherit;
  font-size: 12.5px;
  text-align: left;
  color: var(--text-secondary);
  cursor: pointer;
  transition:
    background 0.16s ease,
    color 0.16s ease;
}
.cl-frow:hover {
  background: var(--white-5);
}
.cl-frow.is-on {
  background: rgba(207, 177, 89, 0.1);
  border-color: rgba(207, 177, 89, 0.26);
  color: var(--gold);
  font-weight: 700;
}
[data-theme="light"] .cl-frow.is-on {
  color: #8a6d1f;
}
.cl-fbox {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  border-radius: 5px;
  border: 1.5px solid var(--white-20);
}
.cl-frow.is-on .cl-fbox {
  border-color: transparent;
  background: linear-gradient(135deg, #e5d3a1 0%, #cfb159 50%, #b0983a 100%);
}
.cl-fnum {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-muted);
}

/* ---------- page header (desktop) ---------- */
.cl-crumb {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
}
[data-theme="light"] .cl-crumb {
  color: #8a6d1f;
}
.cl-h1 {
  margin: 8px 0 0;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--text-primary);
}
.cl-page-sub {
  margin: 7px 0 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.cl-sidebar-wrap {
  display: flex;
  gap: 18px;
  align-items: flex-start;
}

@media (prefers-reduced-motion: reduce) {
  .cl-card,
  .cl-cta,
  .cl-seg-pill,
  .cl-row {
    transition: none;
  }
  .cl-notice {
    animation: none;
  }
}

/* ---- fixups: tone classes must beat .cl-badge (same specificity, later wins) ---- */
.cl-badge.tone-gold,
.cl-badge.tone-green,
.cl-badge.tone-red,
.cl-badge.tone-blue,
.cl-badge.tone-neutral {
  border-width: 1px;
}
.cl-badge.tone-gold {
  background: rgba(207, 177, 89, 0.16);
  border-color: rgba(207, 177, 89, 0.36);
  color: var(--gold);
}
.cl-badge.tone-green {
  background: rgba(74, 222, 128, 0.14);
  border-color: rgba(74, 222, 128, 0.32);
  color: #4ade80;
}
.cl-badge.tone-red {
  background: rgba(248, 113, 113, 0.14);
  border-color: rgba(248, 113, 113, 0.34);
  color: #f87171;
}
.cl-badge.tone-blue {
  background: rgba(96, 165, 250, 0.14);
  border-color: rgba(96, 165, 250, 0.32);
  color: #60a5fa;
}
.cl-badge.tone-neutral {
  background: rgba(148, 163, 184, 0.14);
  border-color: rgba(148, 163, 184, 0.3);
  color: var(--text-secondary);
}
[data-theme="light"] .cl-badge.tone-gold {
  color: #8a6d1f;
  border-color: rgba(207, 177, 89, 0.5);
}
[data-theme="light"] .cl-badge.tone-green {
  color: #15803d;
  border-color: rgba(21, 128, 61, 0.35);
}
[data-theme="light"] .cl-badge.tone-red {
  color: #b91c1c;
  border-color: rgba(185, 28, 28, 0.35);
}
[data-theme="light"] .cl-badge.tone-blue {
  color: #1d4ed8;
  border-color: rgba(29, 78, 216, 0.35);
}
/* pill CTA must shrink to content (it is display:flex by default) */
.cl-cta.cl-cta-pill {
  display: inline-flex;
  width: auto;
}

/* ---- light-theme contrast + selected-check polish (from the desktop audit) ---- */
.cl-fbox {
  display: grid;
  place-items: center;
  color: #10131f;
}
.cl-stat-k {
  font-size: 10px;
}
[data-theme="light"] .cl-stat-k {
  color: rgba(15, 23, 42, 0.62);
}
[data-theme="light"] .cl-count {
  color: rgba(15, 23, 42, 0.6);
}
[data-theme="light"] .cl-rail-head button {
  color: rgba(15, 23, 42, 0.6);
}
[data-theme="light"] .cl-rail-head button:hover {
  color: #8a6d1f;
}
[data-theme="light"] .cl-fnum {
  color: rgba(15, 23, 42, 0.55);
}
[data-theme="light"] .cl-cmeta,
[data-theme="light"] .cl-rowdate,
[data-theme="light"] .cl-cond {
  color: rgba(15, 23, 42, 0.58);
}

/* ---- Login modal: desktop brand column ----
   The login modal is a PERMANENTLY navy surface, so these are navy-only by
   design — adding [data-theme="light"] overrides here would paint light
   controls onto the navy panel (design system always-on rule 2 exception). */
.login-brand {
  background:
    radial-gradient(
      520px 320px at 12% 0%,
      rgba(207, 177, 89, 0.18),
      transparent 62%
    ),
    rgba(11, 15, 26, 0.5);
  border-right: 1px solid rgba(255, 255, 255, 0.07);
}
.login-brand-bullet {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: inherit;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.72);
}
.login-brand-check {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(207, 177, 89, 0.16);
  border: 1px solid rgba(207, 177, 89, 0.34);
  color: #cfb159;
}
/* =====================================================================
   Listings page (InventoryView) — approved redesign
   Mockup: mockups/listings-redesign.html
   NOTE: --glass-navy-bg is deliberately UNCHANGED (shared with the cross-list
   cards + landing). These surfaces use a new FLAT token instead — the navy
   gradient started at the exact page colour and made rows look bottom-heavy.
   ===================================================================== */

/* 3-way variant of the shared segmented control (Active / Drafts / Sold) */
.cl-seg.is-3 .cl-seg-pill,
.cl-seg.is-3 .cl-seg-btn {
  width: auto;
}
.cl-seg.is-3 .cl-seg-pill {
  width: calc((100% - 8px) / 3);
}
.cl-seg.is-3 .cl-seg-btn {
  flex: 1;
}
.cl-seg.is-3 .cl-seg-pill.is-mid {
  transform: translateX(100%);
}
.cl-seg.is-3 .cl-seg-pill.is-list {
  transform: translateX(200%);
}

/* ---- mobile summary panel ---- */
.li-hero {
  position: relative;
  overflow: hidden;
  margin-top: 12px;
  border-radius: 24px;
  padding: 17px 16px 16px;
  background: var(--surface-flat);
  border: 1px solid var(--glass-navy-border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow:
    0 18px 44px rgba(0, 0, 0, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.li-hero::before {
  content: "";
  position: absolute;
  top: -60%;
  right: -20%;
  width: 250px;
  height: 250px;
  pointer-events: none;
  background: radial-gradient(
    circle,
    rgba(207, 177, 89, 0.13),
    transparent 64%
  );
}
[data-theme="light"] .li-hero {
  box-shadow:
    0 14px 32px rgba(15, 23, 42, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
}
.li-eyebrow {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
}
.li-big {
  margin: 9px 0 0;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--text-primary);
}
.li-big small {
  margin-left: 7px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--text-secondary);
}
.li-sub {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--text-secondary);
}

/* ---- toolbar ---- */
.li-toolbar {
  margin: 14px 0 0;
}
@media (min-width: 1024px) {
  .li-toolbar {
    margin: 18px 0 12px;
  }
}
.li-toolbar-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
/* A content-sized flex container gives flex:1 no free space to distribute, so the
   buttons came out 38/37/26 and the sliding pill (34px) never matched. A definite
   width makes all three equal AND makes the pill's 1/3 calc line up. */
.li-toolbar-row .cl-seg {
  width: 100%;
  max-width: 340px;
}
@media (min-width: 1024px) {
  .li-toolbar-row .cl-seg {
    width: 288px;
    max-width: none;
    flex: 0 0 288px;
  }
}
.li-count {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--text-muted);
}

/* ---- platform pills ---- */
.li-pills {
  display: flex;
  gap: 7px;
  margin-top: 12px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}
.li-pills::-webkit-scrollbar {
  display: none;
}
.li-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--white-5);
  border: 1px solid var(--glass-navy-border);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease;
}
.li-pill:hover {
  color: var(--text-primary);
}
.li-pill.is-on {
  background: rgba(207, 177, 89, 0.14);
  border-color: rgba(207, 177, 89, 0.45);
  color: var(--gold);
}
[data-theme="light"] .li-pill.is-on {
  color: #8a6d1f;
  border-color: rgba(207, 177, 89, 0.5);
}
.li-pill .n {
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  background: var(--white-10);
  color: var(--text-muted);
}
.li-pill.is-on .n {
  background: rgba(207, 177, 89, 0.18);
  color: inherit;
}

/* ---- mobile rows ---- */
.li-rows {
  display: flex;
  flex-direction: column;
  /* was 9px — the tightest gap in the app; list separators are now a consistent 16px */
  gap: 16px;
  margin-top: 14px;
}
.li-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-radius: 18px;
  background: var(--surface-flat);
  border: 1px solid var(--glass-navy-border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
[data-theme="light"] .li-row {
  box-shadow:
    0 8px 20px rgba(15, 23, 42, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
}
.li-rowtop {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.li-rowmid {
  flex: 1;
  min-width: 0;
}
.li-title {
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.32;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.li-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 7px;
  flex-wrap: wrap;
}
.li-price {
  flex: 0 0 auto;
}
.li-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  justify-content: flex-end;
}
.li-act {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 42px;
  padding: 0 13px;
  border-radius: 12px;
  background: var(--white-5);
  border: 1px solid var(--glass-navy-border);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease;
}
.li-act:hover {
  background: var(--white-10);
  color: var(--text-primary);
}
.li-act.gold {
  background: rgba(207, 177, 89, 0.1);
  border-color: rgba(207, 177, 89, 0.32);
  color: var(--gold);
}
[data-theme="light"] .li-act {
  color: rgba(15, 23, 42, 0.75);
  border-color: rgba(15, 23, 42, 0.18);
}
[data-theme="light"] .li-act.gold {
  color: #8a6d1f;
  border-color: rgba(207, 177, 89, 0.5);
}
.li-act.gold:hover {
  background: rgba(207, 177, 89, 0.18);
}

/* ---- desktop table ---- */
.li-tablewrap {
  max-height: calc(100vh - 330px);
  overflow-y: auto;
  border-radius: 20px;
}
.li-table {
  border-radius: 20px;
  overflow: hidden;
  background: var(--surface-flat);
  border: 1px solid var(--glass-navy-border);
  box-shadow:
    0 16px 34px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
[data-theme="light"] .li-table {
  box-shadow:
    0 12px 28px rgba(15, 23, 42, 0.07),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
}
.li-thead,
.li-trow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 116px 100px 110px 212px;
  align-items: center;
  gap: 14px;
  padding: 0 18px;
}
.li-thead {
  height: 42px;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--white-5);
  border-bottom: 1px solid var(--glass-navy-border);
}
.li-thead .r {
  text-align: right;
}
.li-trow {
  min-height: 64px;
  border-bottom: 1px solid var(--white-5);
}
.li-trow:last-child {
  border-bottom: 0;
}
.li-trow:hover {
  background: var(--white-5);
}
.li-tname {
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.32;
  color: var(--text-primary);
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.li-tname:hover {
  color: var(--gold);
}
.li-tprice {
  text-align: right;
  font-size: 14px;
}
.li-tacts {
  display: flex;
  align-items: center;
  gap: 7px;
  justify-content: flex-end;
}

/* ---- pagination ---- */
.li-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 16px;
}
.li-pager-pb {
  min-width: 40px;
  min-height: 40px;
  display: grid;
  place-items: center;
  padding: 0 10px;
  border-radius: 13px;
  background: var(--white-5);
  border: 1px solid var(--glass-navy-border);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition:
    background 0.18s ease,
    color 0.18s ease;
}
.li-pager-pb:hover:not(:disabled) {
  background: var(--white-10);
  color: var(--text-primary);
}
.li-pager-pb.is-on {
  background: linear-gradient(135deg, #e5d3a1 0%, #cfb159 50%, #b0983a 100%);
  border-color: transparent;
  color: #10131f;
}
.li-pager-pb:disabled {
  opacity: 0.4;
  cursor: default;
}
.li-pager-gap {
  padding: 0 2px;
  font-size: 12px;
  color: var(--text-muted);
}
.li-pager-note {
  margin: 10px 0 0;
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
}

/* ---- empty / loading ---- */
.li-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 56px 20px;
  text-align: center;
}
.li-empty-disc {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(207, 177, 89, 0.12);
  border: 1px solid rgba(207, 177, 89, 0.28);
  color: var(--gold);
}
.li-empty-t {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}
.li-empty-s {
  margin: 0;
  max-width: 300px;
  font-size: 12px;
  color: var(--text-secondary);
}

/* ---- extra platform tones (brand-consistent, replaces the rainbow borders) ---- */
.tone-pink {
  background: rgba(244, 114, 182, 0.16);
  border: 1px solid rgba(244, 114, 182, 0.36);
  color: #f9a8d4;
}
.tone-amber {
  background: rgba(251, 191, 36, 0.14);
  border: 1px solid rgba(251, 191, 36, 0.34);
  color: #fcd34d;
}
[data-theme="light"] .tone-pink {
  color: #9d174d;
  border-color: rgba(157, 23, 77, 0.35);
}
[data-theme="light"] .tone-amber {
  color: #92400e;
  border-color: rgba(146, 64, 14, 0.35);
}

@media (prefers-reduced-motion: reduce) {
  .li-pill,
  .li-act,
  .li-pager-pb {
    transition: none;
  }
}

/* =====================================================================
   Shared FLAT glass surface + shelves view
   `--glass-navy-bg` is deliberately NOT used here (see tokens reference).
   ===================================================================== */
.glass-flat {
  background: var(--surface-flat);
  border: 1px solid var(--glass-navy-border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
}
[data-theme="light"] .glass-flat {
  box-shadow:
    0 8px 20px rgba(15, 23, 42, 0.07),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
.glass-flat.is-expanded {
  border-color: rgba(207, 177, 89, 0.34);
}
.glass-flat-inset {
  background: var(--white-5);
  border: 1px solid var(--glass-navy-border);
}

/* Theme-aware text helpers. Replaces `text-navy`, which resolved to #ffffff in
   the light theme and made book titles invisible. */
.t-ink {
  color: var(--text-primary);
}
.t-ink-2 {
  color: var(--text-secondary);
}
.t-ink-3 {
  color: var(--text-muted);
}

.sh-tile {
  background: var(--white-5);
  border: 1px solid var(--glass-navy-border);
}
.sh-iconbtn {
  border-radius: 12px;
  color: var(--text-secondary);
  transition:
    background 0.18s ease,
    color 0.18s ease;
}
.sh-iconbtn:hover {
  background: var(--white-10);
  color: var(--text-primary);
}
.sh-btn-gold {
  background: linear-gradient(135deg, #e5d3a1 0%, #cfb159 50%, #b0983a 100%);
  color: #10131f;
  border: 0;
  font-family: inherit;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(207, 177, 89, 0.24);
}
.sh-btn-gold:hover {
  box-shadow: 0 12px 24px rgba(207, 177, 89, 0.32);
}
.sh-item {
  background: var(--white-5);
  border: 1px solid var(--glass-navy-border);
}
.sh-item:hover {
  background: var(--white-10);
}
.sh-item.is-selected {
  background: rgba(207, 177, 89, 0.15);
  border-color: rgba(207, 177, 89, 0.45);
  box-shadow: 0 0 0 1px rgba(207, 177, 89, 0.3);
}
@media (prefers-reduced-motion: reduce) {
  .sh-iconbtn {
    transition: none;
  }
}

/* Mobile bottom sheets that lift from boxes/shelves. These must be OPAQUE (they
   occlude the page) and clearly separated from it. `bg-navy-800` was solid but in
   the light theme that token IS the page colour (#f8fafc), so the sheet had no
   separation at all. */
:root {
  --sheet-bg: #141a2d;
}
[data-theme="light"] {
  --sheet-bg: var(--light-panel);
}
.sheet-flat {
  background: var(--sheet-bg);
  border-top: 1px solid var(--glass-navy-border);
  box-shadow: 0 -18px 50px rgba(0, 0, 0, 0.4);
}
[data-theme="light"] .sheet-flat {
  box-shadow: 0 -16px 40px rgba(15, 23, 42, 0.16);
}

/* =====================================================================
   LIGHT MODE: page is near-white and cards are white — the LAYER is defined by
   the card SHADOW, not by a fill difference (user's explicit direction).
   This block comes last so it wins over the earlier per-class light overrides.
   ===================================================================== */
[data-theme="light"] .glass-flat,
[data-theme="light"] .cl-hero,
[data-theme="light"] .cl-stat,
[data-theme="light"] .cl-card,
[data-theme="light"] .cl-row,
[data-theme="light"] .cl-rail,
[data-theme="light"] .li-hero,
[data-theme="light"] .li-row,
[data-theme="light"] .li-table {
  /* tight so it hugs the card edge: the gaps between cards are only 9px, and a
     wide blur fills them completely (the gutter measured 238 instead of 251).
     A crisp contact shadow + the hairline border define the layer instead. */
  box-shadow:
    0 2px 5px rgba(15, 23, 42, 0.09),
    0 1px 2px rgba(15, 23, 42, 0.06);
}
[data-theme="light"] .cl-card.is-clickable:hover {
  box-shadow:
    0 16px 34px rgba(15, 23, 42, 0.16),
    0 2px 6px rgba(15, 23, 42, 0.09);
}

/* =====================================================================
   ONE canonical gold treatment for every gold element in the app.
   There were 17+ `bg-gold text-navy-800` (flat), 5 `grad-gold`, and ad-hoc
   shadows — three different looks for the same button. Adding a background-IMAGE
   layers the gradient over Tailwind's flat `bg-gold` color without fighting it,
   and pins the label to #10131f, which is ~13:1 on gold in BOTH themes.
   (.bg-gold is also used on a progress fill and small dots — a gradient there is
   either imperceptible or an improvement, and neither carries text.)
   ===================================================================== */
.bg-gold {
  background-image: linear-gradient(
    135deg,
    #e5d3a1 0%,
    #cfb159 50%,
    #b0983a 100%
  );
  color: #10131f !important;
}

/* =====================================================================
   LIGHT: modal panels follow the same layering rule as cards — a WHITE surface
   separated by a shadow. `.glass-navy-dark` (settings, add-item, both edit
   panels) flipped to rgba(248,250,252,.95), which is DARKER than the near-white
   page (#fbfcfd) and had NO box-shadow at all, so the panel was sunken.
   ===================================================================== */
[data-theme="light"] .glass-navy-dark {
  box-shadow:
    0 18px 44px rgba(15, 23, 42, 0.16),
    0 2px 6px rgba(15, 23, 42, 0.08);
}

/* =====================================================================
   GOLD TEXT on light surfaces. Brand gold #CFB159 measures only **2.03:1** on the
   near-white page (WCAG needs 4.5:1) — it hit 74 elements on the shelves page, 11 on
   boxes. #8a6d1f is the BRIGHTEST gold that clears AA (4.77:1) and is already the
   light-mode price colour, so the system stays coherent.
   Safe for the login modal: it renders with no data-theme set (dark only), so this
   light-scoped rule cannot darken gold on its navy panel.
   Borders/fills keep the bright brand gold — only TEXT and icons darken.
   ===================================================================== */
[data-theme="light"] .text-gold,
[data-theme="light"] .text-gold\/60,
[data-theme="light"] .text-gold\/70,
[data-theme="light"] .text-gold\/80,
[data-theme="light"] .text-gold\/85,
[data-theme="light"] .cl-crumb,
[data-theme="light"] .cl-eyebrow,
[data-theme="light"] .li-eyebrow {
  /* the faded variants are worse still on light; readability beats the fade */
  color: #8a6d1f !important;
}

/* =====================================================================
   SHELF OCCUPANCY STRIP + COMPACT EMPTY LEVELS  (approved mockup:
   mockups/shelves-redesign.html, applied to ShelvesView + the mobile sheet)

   Why: 39 levels exist across 11 shelves but only 3 levels hold books. The page
   rendered 156 inset panels (level headers + 3 row columns each) to show that, and
   every level showed a full 3-column block even when empty.
   ===================================================================== */
.sh-occ {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 0 16px 14px;
}
.sh-occ-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid var(--glass-navy-border);
  color: var(--text-muted);
}
.sh-occ-chip.has {
  border-color: rgba(207, 177, 89, 0.42);
  color: var(--text-gold);
  background: rgba(207, 177, 89, 0.1);
}
.sh-occ-chip .d {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: var(--glass-navy-border);
}
.sh-occ-chip.has .d {
  background: rgba(207, 177, 89, 0.6);
}

/* An empty level is ONE line, not a three-column panel. */
.sh-lvl-slim {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  flex-wrap: wrap;
}
.sh-lvl-slim .n {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-muted);
}
.sh-lvl-slim .note {
  flex: 1;
  min-width: 130px;
  font-size: 11.5px;
  color: var(--text-muted);
}
.sh-phchip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 800;
  color: var(--text-gold);
  padding: 6px 11px;
  border-radius: 9px;
  border: 1px solid rgba(207, 177, 89, 0.38);
  background: transparent;
  min-height: 32px;
}
.sh-addbtn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 800;
  padding: 8px 12px;
  border-radius: 10px;
  border: 0;
  color: #10131f;
  background-image: linear-gradient(
    135deg,
    var(--gold-light),
    var(--gold),
    var(--gold-dark)
  );
  min-height: 34px;
}

/* =====================================================================
   LIGHT: stop the inset tints COMPOUNDING. `.glass-flat-inset` is a 5% dark tint,
   and a row column is another inset nested inside the level inset, so the two
   stacked (~10% = lum 229) inside a pure-white card and the level area read grey.
   Measured before: level panel 242, row column 229, book items 217.
   After: 249 / 249 / 238.
   ===================================================================== */
[data-theme="light"] .glass-flat-inset {
  background: rgba(15, 23, 42, 0.022);
}
[data-theme="light"] .glass-flat-inset .glass-flat-inset {
  background: transparent;
}
[data-theme="light"] .glass-flat-inset .glass-flat-inset .glass-flat-inset {
  background: rgba(15, 23, 42, 0.028);
}
[data-theme="light"]
  .glass-flat-inset
  .glass-flat-inset
  .glass-flat-inset
  .glass-flat-inset {
  background: rgba(15, 23, 42, 0.016);
}

/* Row columns are content-driven: the grid only lays out the rows that exist
   (setting grid-template-columns here overrides Tailwind's grid-cols-*, so an
   omitted row leaves no empty slot). */
.sh-cols {
  grid-template-columns: 1fr;
}
@media (min-width: 768px) {
  .sh-cols[data-cols="2"],
  .sh-cols[data-cols="3"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 1024px) {
  .sh-cols[data-cols="3"] {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
