/* Royall design tokens — shared CSS across creator / company / admin
   portals.

   Phase 0 of the redesign migration. Active only on pages with
   body[data-theme="redesign"] so it doesn't fight existing per-portal
   styles during phased rollout. Pages opt in by setting that body
   attribute (server-side, behind a feature flag).

   Import in <head> together with /static/royall-chrome.css.

   Source of truth: backend/creator/redesign/_tokens.css (the deck).
   Keep these in sync. */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* iOS safe-area fix (2026-05-25 PWA Phase 1A).
   With viewport-fit=cover, the page paints under the notch + home
   indicator on iPhone 14+ / iPad. Without a wine background on the
   <html> element, those safe-area zones show iOS's default WHITE
   between the page content and the device edges — visible most
   clearly on iPhone 17 Pro Max in standalone PWA mode (home
   indicator zone). Painting html with the deepest wine tone makes
   the unreachable area blend with our gradient. Cheap one-liner;
   no impact when viewport-fit isn't set. */
html { background-color: #1e1010; }

/* The `hidden` attribute must always hide, even when a component rule sets
   `display` (e.g. `.step { display:flex }`). The UA `[hidden]{display:none}`
   has near-zero specificity and silently loses to any class rule — which
   re-rendered "hidden" elements as the duplicate "1, 1" steps on
   /extension-pair (2026-05-29). `!important` makes the attribute authoritative
   so JS `el.hidden = true` reliably hides anywhere in the redesign theme. */
body[data-theme="redesign"] [hidden] { display: none !important; }

/* Body atmosphere — only active on opt-in pages */
body[data-theme="redesign"] {
  margin: 0;
  /* min-height uses 100dvh on browsers that support it (iOS Safari
     16.4+ / Android Chrome 108+) so the wine gradient genuinely
     covers the dynamic viewport (URL bar collapsed/expanded).
     Falls back to 100vh on older browsers. The static 100vh
     version is correct in standalone PWA mode anyway. */
  min-height: 100vh;
  min-height: 100dvh;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  color: #f3eef8;
  background:
    radial-gradient(700px 600px at 50% 30%, rgba(255, 180, 180, 0.18), transparent 60%),
    radial-gradient(1200px 800px at 75% 0%, rgba(133, 95, 168, 0.42), transparent 60%),
    radial-gradient(900px 600px at 25% 100%, rgba(74, 50, 100, 0.55), transparent 55%),
    linear-gradient(160deg, #3d1d1d 0%, #121226 50%, #1e1010 100%);
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  /* Tells the UA that native form widgets (date / time / select dropdown,
     color pickers, scrollbars) should render against a dark surface — so
     the calendar-picker glyph on <input type="date"> stops being a black
     square on our wine bg. Reported on signup DOB field 2026-05-08. */
  color-scheme: dark;
}

/* ── Custom date picker ────────────────────────────────────────────────────
   royall-datepicker.js wraps every <input type="date"> in `.royall-dp` and
   adds a styled trigger pill + custom calendar dropdown so the wine + rose
   theme reaches into form controls that the browser otherwise paints
   itself. The native indicator and popup are suppressed below. */

body[data-theme="redesign"] .royall-dp {
  position: relative;
  display: block;
}

/* Hide the native calendar-picker indicator — we render our own pill on top
   of the field. The input still owns the value (form submission, autofill
   for autocomplete=bday, min/max validation all keep working). */
body[data-theme="redesign"] .royall-dp input[type="date"] {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 56px;  /* room for the trigger pill */
}
body[data-theme="redesign"] .royall-dp input[type="date"]::-webkit-calendar-picker-indicator {
  display: none;
  -webkit-appearance: none;
  opacity: 0;
  pointer-events: none;
}

/* Rose pill trigger sitting at the right edge of the field. Uses the same
   visual language as the brand accent buttons. */
body[data-theme="redesign"] .royall-dp-trigger {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(255,180,180,0.18) 0%, rgba(141,76,76,0.10) 100%);
  border: 1px solid rgba(255,180,180,0.28);
  color: #ffd0d0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  transition: background 0.16s ease, color 0.16s ease,
              border-color 0.16s ease, box-shadow 0.16s ease,
              transform 0.16s ease;
  padding: 0;
}
body[data-theme="redesign"] .royall-dp-trigger:hover,
body[data-theme="redesign"] .royall-dp.is-open .royall-dp-trigger {
  background: linear-gradient(135deg, #ffb4b4 0%, #b47878 100%);
  color: #3d1d1d;
  border-color: transparent;
  box-shadow: 0 8px 22px -8px rgba(255,180,180,0.55);
}
body[data-theme="redesign"] .royall-dp-trigger:active {
  transform: translateY(-50%) scale(0.96);
}

/* Calendar dropdown — wine-on-glass surface, rose accents. Anchored to
   the right edge of the field so it stays inside the form column. */
body[data-theme="redesign"] .royall-dp-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 200;
  width: 320px;
  padding: 16px;
  background:
    linear-gradient(160deg,
      rgba(30, 16, 16, 0.96) 0%,
      rgba(18, 18, 38, 0.98) 100%);
  border: 1px solid rgba(255, 180, 180, 0.20);
  border-radius: 18px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow:
    0 32px 80px -24px rgba(0, 0, 0, 0.65),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  display: none;
  font-family: inherit;
  color: #f3eef8;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}
body[data-theme="redesign"] .royall-dp.is-open .royall-dp-dropdown {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

/* Header: prev / next month + month name + year dropdown. */
body[data-theme="redesign"] .royall-dp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}
body[data-theme="redesign"] .royall-dp-nav {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(243, 238, 248, 0.85);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-family: inherit;
  padding: 0;
  transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}
body[data-theme="redesign"] .royall-dp-nav:hover {
  background: rgba(255, 180, 180, 0.14);
  border-color: rgba(255, 180, 180, 0.32);
  color: #ffd0d0;
}
body[data-theme="redesign"] .royall-dp-title {
  display: flex; align-items: center; gap: 8px;
  flex: 1;
  justify-content: center;
}
body[data-theme="redesign"] .royall-dp-month {
  font-size: 14px; font-weight: 800;
  color: #fff;
  letter-spacing: -0.005em;
}
body[data-theme="redesign"] .royall-dp-year {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.10);
  color: #fff;
  font-family: inherit;
  font-size: 13px; font-weight: 800;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23ffd0d0' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 6px center;
  padding-right: 22px;
}
body[data-theme="redesign"] .royall-dp-year:hover {
  background-color: rgba(255, 180, 180, 0.10);
  border-color: rgba(255, 180, 180, 0.30);
}

/* Weekday header row + day grid. */
body[data-theme="redesign"] .royall-dp-weekdays {
  display: grid; grid-template-columns: repeat(7, 1fr);
  margin-bottom: 4px;
}
body[data-theme="redesign"] .royall-dp-weekdays span {
  text-align: center;
  font-size: 10px;
  font-weight: 800;
  color: rgba(243, 238, 248, 0.42);
  letter-spacing: 0.10em;
  padding: 6px 0;
}
body[data-theme="redesign"] .royall-dp-grid {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
body[data-theme="redesign"] .royall-dp-day {
  aspect-ratio: 1 / 1;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  color: rgba(243, 238, 248, 0.85);
  font-size: 13px; font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
body[data-theme="redesign"] .royall-dp-day:hover {
  background: rgba(255, 180, 180, 0.14);
  color: #ffd0d0;
}
body[data-theme="redesign"] .royall-dp-day.other {
  color: rgba(243, 238, 248, 0.22);
}
body[data-theme="redesign"] .royall-dp-day.today {
  border-color: rgba(255, 180, 180, 0.40);
  color: #ffd0d0;
}
body[data-theme="redesign"] .royall-dp-day.selected,
body[data-theme="redesign"] .royall-dp-day.selected:hover {
  background: linear-gradient(135deg, #ffb4b4 0%, #b47878 100%);
  color: #3d1d1d;
  font-weight: 800;
  border-color: transparent;
  box-shadow: 0 6px 14px -8px rgba(255, 180, 180, 0.65);
}
body[data-theme="redesign"] .royall-dp-day.disabled {
  opacity: 0.25;
  cursor: not-allowed;
  pointer-events: none;
}

/* Footer: Clear + Today actions. */
body[data-theme="redesign"] .royall-dp-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
body[data-theme="redesign"] .royall-dp-action {
  background: transparent;
  border: 0;
  color: rgba(243, 238, 248, 0.65);
  font-size: 11px; font-weight: 800;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  cursor: pointer;
  font-family: inherit;
  padding: 6px 10px;
  border-radius: 8px;
  transition: background 0.14s ease, color 0.14s ease;
}
body[data-theme="redesign"] .royall-dp-action:hover {
  background: rgba(255, 180, 180, 0.10);
  color: #ffd0d0;
}
body[data-theme="redesign"] .royall-dp-action.is-primary {
  color: #ffd0d0;
}

/* Box-sizing reset, scoped (existing portals set their own globally) */
body[data-theme="redesign"] *,
body[data-theme="redesign"] *::before,
body[data-theme="redesign"] *::after { box-sizing: border-box; }

/* Page layout helpers — content centers in the viewport. Top padding
   reserves space for the fixed .brand-bar (96px) plus breathing room.
   The deck nav sidebar is a mockup-only collapsible overlay; we don't
   reserve space for it, it lays over the page edge when expanded. */
body[data-theme="redesign"] .page {
  /* B-2 (STUDIO-IOS-CAPTURE-AUDIT-2026-06-08) — the injected .brand-bar grows
     to calc(96px + env(safe-area-inset-top)) on notched/Pro iPhones, but this
     shell used a fixed 144px (96 + 48) with no inset, so the header sat ~11px
     behind the translucent bar in the PWA. Clearance is now additive: 96 (bar)
     + 48 (breathing room) + the safe-area inset (0 on non-notched devices). */
  min-height: 100vh;          /* fallback for browsers without dvh */
  min-height: 100dvh;
  padding: calc(96px + 48px + env(safe-area-inset-top)) 48px 72px;
  max-width: 1440px;
  margin: 0 auto;
}
body[data-theme="redesign"] .page-narrow { max-width: 920px; }
body[data-theme="redesign"] .page-wide { max-width: 1320px; }

body[data-theme="redesign"] .page-center {
  min-height: 100vh;
  display: flex; align-items: safe center; justify-content: center;
  padding: 144px 24px 72px;
}

/* Glass card */
body[data-theme="redesign"] .card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 24px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 32px 80px -24px rgba(0,0,0,0.5);
}

/* Brand orb */
body[data-theme="redesign"] .orb {
  width: 96px; height: 96px;
  border-radius: 50%;
  background: linear-gradient(160deg, #ffb4b4 0%, #8d4c4c 100%);
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow:
    0 0 80px rgba(255, 180, 180, 0.55),
    0 0 32px rgba(255, 180, 180, 0.32),
    inset 0 0 24px rgba(255,255,255,0.18);
  font-size: 38px; font-weight: 900; letter-spacing: -0.04em;
  color: #3d1d1d;
  position: relative;
}
body[data-theme="redesign"] .orb::after {
  content: ""; position: absolute; inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 25%, rgba(255,255,255,0.4), transparent 50%);
  pointer-events: none;
}
body[data-theme="redesign"] .orb-sm { width: 56px; height: 56px; font-size: 22px; }
body[data-theme="redesign"] .orb-xs { width: 36px; height: 36px; font-size: 14px; box-shadow: 0 0 24px rgba(255,180,180,0.35), inset 0 0 12px rgba(255,255,255,0.2); }

/* Type */
body[data-theme="redesign"] .h1 {
  font-size: 44px; font-weight: 900; letter-spacing: -0.025em; line-height: 1.05;
  color: #fff; margin: 0;
}
body[data-theme="redesign"] .h2 {
  font-size: 28px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.15;
  color: #fff; margin: 0;
}
body[data-theme="redesign"] .h3 {
  font-size: 18px; font-weight: 800; letter-spacing: -0.015em;
  color: #fff; margin: 0;
}
body[data-theme="redesign"] .eyebrow {
  font-size: 10px; font-weight: 800;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: rgba(243,238,248, 0.55);
}
body[data-theme="redesign"] .lede {
  font-size: 15px; line-height: 1.55;
  color: rgba(243,238,248, 0.7);
  margin: 0;
}
body[data-theme="redesign"] .muted {
  color: rgba(243,238,248, 0.55);
}
body[data-theme="redesign"] .muted-strong {
  color: rgba(243,238,248, 0.4);
}

/* Inputs */
body[data-theme="redesign"] .input {
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(0,0,0,0.32);
  border: 1px solid rgba(255,255,255,0.1);
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  width: 100%;
  transition: border-color 0.15s, background 0.15s;
}
body[data-theme="redesign"] .input::placeholder { color: rgba(243,238,248, 0.4); }
body[data-theme="redesign"] .input:focus {
  outline: none;
  border-color: rgba(255,180,180, 0.55);
  background: rgba(0,0,0,0.42);
}
body[data-theme="redesign"] .field {
  display: flex; flex-direction: column; gap: 6px;
}
body[data-theme="redesign"] .field label {
  font-size: 10px; font-weight: 800;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: rgba(243,238,248, 0.55);
}

/* Buttons */
body[data-theme="redesign"] .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 14px; font-weight: 800;
  cursor: pointer;
  /* iOS Safari hardening (2026-05-25 PWA Phase 1E):
     - touch-action: manipulation removes the 300ms tap-delay on iOS
       Safari, so button presses feel instant in PWA standalone mode.
     - -webkit-tap-highlight-color: transparent kills the grey overlay
       iOS draws on every tap. We have our own :active / :hover states
       in the brand language and the grey flash fights with them. */
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  border: none;
  font-family: inherit;
  letter-spacing: -0.005em;
  transition: all 0.15s;
  text-decoration: none;
}
body[data-theme="redesign"] .btn.primary {
  background: linear-gradient(135deg, #ffb4b4 0%, #b47878 100%);
  color: #3d1d1d;
  box-shadow: 0 12px 32px -10px rgba(255,180,180,0.55);
}
body[data-theme="redesign"] .btn.primary:hover {
  box-shadow: 0 14px 38px -8px rgba(255,180,180,0.65);
  transform: translateY(-1px);
}
body[data-theme="redesign"] .btn.ghost {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(243,238,248, 0.85);
}
body[data-theme="redesign"] .btn.ghost:hover {
  background: rgba(255,255,255,0.07);
  color: #fff;
}
body[data-theme="redesign"] .btn.danger {
  background: rgba(239, 68, 68, 0.16);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
}
body[data-theme="redesign"] .btn.danger:hover {
  background: rgba(239, 68, 68, 0.22);
  border-color: rgba(239, 68, 68, 0.45);
  color: #fca5a5;
}
body[data-theme="redesign"] .btn.danger-ghost {
  background: transparent;
  border: 1px solid rgba(239, 68, 68, 0.28);
  color: #ffbac1;
}
body[data-theme="redesign"] .btn.danger-ghost:hover {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.45);
}
body[data-theme="redesign"] .btn-block { width: 100%; }
body[data-theme="redesign"] .btn-sm {
  padding: 8px 14px;
  font-size: 12px;
  border-radius: 10px;
}
body[data-theme="redesign"] .btn svg { width: 16px; height: 16px; }
body[data-theme="redesign"] .btn-sm svg { width: 13px; height: 13px; }

/* Tag / chip */
body[data-theme="redesign"] .chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px; font-weight: 800;
  letter-spacing: 0.06em; text-transform: uppercase;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  color: rgba(243,238,248, 0.85);
}
body[data-theme="redesign"] .chip-rose {
  background: linear-gradient(135deg, #ffb4b4 0%, #ffd0d0 100%);
  color: #3d1d1d;
  border-color: transparent;
}
body[data-theme="redesign"] .chip-warn {
  background: rgba(255, 200, 100, 0.12);
  color: #ffd49e;
  border-color: rgba(255, 200, 100, 0.24);
}
body[data-theme="redesign"] .chip-good {
  background: rgba(120, 220, 180, 0.12);
  color: #a8efce;
  border-color: rgba(120, 220, 180, 0.24);
}
body[data-theme="redesign"] .chip-bad {
  background: rgba(255, 120, 130, 0.14);
  color: #ffbac1;
  border-color: rgba(255, 120, 130, 0.24);
}

/* Pill tabs — single in-page nav style across the deck */
body[data-theme="redesign"] .tabs {
  display: flex; gap: 4px;
  padding: 4px;
  background: rgba(0,0,0,0.28);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  width: fit-content;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
body[data-theme="redesign"] .tab {
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 12px; font-weight: 800;
  color: rgba(243,238,248, 0.6);
  cursor: pointer;
  text-decoration: none;
  border: none;
  background: transparent;
  font-family: inherit;
  letter-spacing: 0.005em;
  transition: color 0.15s;
}
body[data-theme="redesign"] .tab:hover { color: #fff; }
body[data-theme="redesign"] .tab.active {
  background: linear-gradient(135deg, #ffb4b4 0%, #b47878 100%);
  color: #3d1d1d;
}

/* Stat tile (giant numerals over labels) */
body[data-theme="redesign"] .stat {
  background: rgba(0,0,0,0.28);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 18px;
  padding: 22px 22px 20px;
}
body[data-theme="redesign"] .stat-label {
  font-size: 10px; font-weight: 800;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: rgba(243,238,248, 0.55);
  margin-bottom: 10px;
}
body[data-theme="redesign"] .stat-value {
  font-size: 40px; font-weight: 900; letter-spacing: -0.025em;
  color: #fff;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
body[data-theme="redesign"] .stat-sub {
  font-size: 12px; color: rgba(243,238,248, 0.55);
  margin-top: 8px;
}

/* Footer */
body[data-theme="redesign"] .deck-footer {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11px; font-weight: 600;
  color: rgba(243,238,248, 0.45);
}
body[data-theme="redesign"] .deck-footer a {
  color: inherit; text-decoration: none;
  transition: color 0.15s;
}
body[data-theme="redesign"] .deck-footer a:hover { color: rgba(243,238,248, 0.75); }

/* Headerbar — used on dashboards inside the page column */
body[data-theme="redesign"] .headerbar {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 32px;
}
body[data-theme="redesign"] .headerbar-left { display: flex; align-items: center; gap: 14px; }
body[data-theme="redesign"] .headerbar-actions { display: flex; gap: 8px; align-items: center; }

/* Utility */
body[data-theme="redesign"] .row { display: flex; gap: 12px; }
body[data-theme="redesign"] .row-tight { display: flex; gap: 6px; }
body[data-theme="redesign"] .col { display: flex; flex-direction: column; gap: 12px; }
body[data-theme="redesign"] .col-tight { display: flex; flex-direction: column; gap: 6px; }
body[data-theme="redesign"] .between { display: flex; justify-content: space-between; align-items: center; }
body[data-theme="redesign"] .grow { flex: 1; }

/* Shared shells (extracted from studio.html / vault.html / etc.) */
body[data-theme="redesign"] .shell-3col {
  display: grid;
  grid-template-columns: 320px 1fr 88px;
  min-height: 100vh;
  padding: 144px 24px 72px;
  gap: 24px;
  max-width: 1440px;
  margin: 0 auto;
}
body[data-theme="redesign"] .shell-2col {
  display: grid;
  grid-template-columns: 1fr 88px;
  min-height: 100vh;
  padding: 144px 24px 72px;
  gap: 24px;
  max-width: 1440px;
  margin: 0 auto;
}

/* Right action rail — used on studio + vault pages for floating shortcuts */
body[data-theme="redesign"] .action-rail {
  display: flex; flex-direction: column; gap: 14px;
  align-items: center;
  padding-top: 80px;
}
body[data-theme="redesign"] .action-rail .action {
  width: 48px; height: 48px;
  border-radius: 16px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: rgba(243,238,248, 0.85);
  transition: all 0.15s;
  text-decoration: none;
}
body[data-theme="redesign"] .action-rail .action:hover {
  background: rgba(255,180,180,0.18);
  border-color: rgba(255,180,180,0.36);
  color: #fff;
  transform: scale(1.05);
}
body[data-theme="redesign"] .action-rail .action.primary {
  background: linear-gradient(135deg, #ffb4b4 0%, #b47878 100%);
  color: #3d1d1d;
  border-color: transparent;
  box-shadow: 0 8px 24px -8px rgba(255,180,180,0.5);
}
body[data-theme="redesign"] .action-rail .action svg { width: 18px; height: 18px; }

/* Wizard chrome — extracted from the 4 onboarding pages */
body[data-theme="redesign"] .wizard-shell {
  width: min(640px, 100%);
  display: flex; flex-direction: column;
  gap: 24px;
}
body[data-theme="redesign"] .wizard-shell.wide { width: min(720px, 100%); }
body[data-theme="redesign"] .wizard-rail {
  display: flex; align-items: center; gap: 0;
  padding: 18px 22px;
}
body[data-theme="redesign"] .pip {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  position: relative;
}
body[data-theme="redesign"] .pip-dot {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 900;
  z-index: 2;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(243,238,248, 0.5);
}
body[data-theme="redesign"] .pip.done .pip-dot {
  background: linear-gradient(135deg, #ffb4b4 0%, #b47878 100%);
  color: #3d1d1d;
  border-color: transparent;
  box-shadow: 0 4px 14px -2px rgba(255,180,180,0.4);
}
body[data-theme="redesign"] .pip-dot svg { width: 14px; height: 14px; stroke-width: 3; }
body[data-theme="redesign"] .pip.current .pip-dot {
  background: rgba(255,180,180,0.14);
  border-color: rgba(255,180,180,0.55);
  color: #ffb4b4;
  box-shadow: 0 0 0 4px rgba(255,180,180,0.12);
}
body[data-theme="redesign"] .pip-label {
  font-size: 10px; font-weight: 800;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: rgba(243,238,248, 0.5);
}
body[data-theme="redesign"] .pip.done .pip-label,
body[data-theme="redesign"] .pip.current .pip-label { color: #fff; }
body[data-theme="redesign"] .pip-conn {
  position: absolute; top: 14px;
  left: 50%; right: -50%;
  height: 2px;
  background: rgba(255,255,255,0.08);
  z-index: 1;
}
body[data-theme="redesign"] .pip.done .pip-conn {
  background: linear-gradient(90deg, #ffb4b4 0%, #b47878 100%);
}
body[data-theme="redesign"] .pip:last-child .pip-conn { display: none; }

body[data-theme="redesign"] .step-card {
  padding: 36px 38px 32px;
  display: flex; flex-direction: column;
  gap: 20px;
}
body[data-theme="redesign"] .step-meta {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 11px;
  color: rgba(243,238,248, 0.55);
}
body[data-theme="redesign"] .step-meta strong { color: #ffb4b4; font-weight: 800; }
body[data-theme="redesign"] .step-meta a { color: rgba(243,238,248, 0.7); text-decoration: none; font-weight: 700; }

body[data-theme="redesign"] .wizard-actions {
  display: flex; gap: 10px;
  margin-top: 4px;
}
body[data-theme="redesign"] .wizard-actions .grow { flex: 1; }

/* ── Sign-up flow animations ─────────────────────────────
   Auto-applied via body[data-flow="signup"], set by _nav.js based
   on URL. Covers landing, sign-up, sign-in, pending, and the 5
   onboarding wizard steps. Premium-subtle entrance + a forward-
   moving transition between steps. */

@keyframes flow-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes flow-fade-up {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes flow-scale-in {
  from { opacity: 0; transform: scale(0.92); }
  60%  { opacity: 1; transform: scale(1.02); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes flow-fade-out-left {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(-28px); }
}

/* Container-level entrance — the shell animates first */
body[data-theme="redesign"] body[data-flow="signup"] .auth-card,
body[data-theme="redesign"] body[data-flow="signup"] .pending-shell,
body[data-theme="redesign"] body[data-flow="signup"] .ready-shell,
body[data-theme="redesign"] body[data-flow="signup"] .signup-shell,
body[data-theme="redesign"] body[data-flow="signup"] .signup-card,
body[data-theme="redesign"] body[data-flow="signup"] .signup-pitch,
body[data-theme="redesign"] body[data-flow="signup"] .wizard-shell {
  animation: flow-fade-up 0.55s 0.10s ease-out both;
}

/* Wizard rail (the pip strip on top) lands first — orients the user */
body[data-theme="redesign"] body[data-flow="signup"] .wizard-rail {
  animation: flow-fade-up 0.45s 0.10s ease-out both;
}
body[data-theme="redesign"] body[data-flow="signup"] .wizard-rail .pip:nth-child(1) { animation: flow-fade-in 0.4s 0.18s ease-out both; }
body[data-theme="redesign"] body[data-flow="signup"] .wizard-rail .pip:nth-child(2) { animation: flow-fade-in 0.4s 0.22s ease-out both; }
body[data-theme="redesign"] body[data-flow="signup"] .wizard-rail .pip:nth-child(3) { animation: flow-fade-in 0.4s 0.26s ease-out both; }
body[data-theme="redesign"] body[data-flow="signup"] .wizard-rail .pip:nth-child(4) { animation: flow-fade-in 0.4s 0.30s ease-out both; }
body[data-theme="redesign"] body[data-flow="signup"] .wizard-rail .pip:nth-child(5) { animation: flow-fade-in 0.4s 0.34s ease-out both; }

/* The step card itself lands after the rail — gives a "rail orients,
   then content fills in" feel */
body[data-theme="redesign"] body[data-flow="signup"] .step-card {
  animation: flow-fade-up 0.55s 0.30s ease-out both;
}

/* Landing page hero — staged top-to-bottom */
body[data-theme="redesign"] body[data-flow="signup"] .hero-eyebrow { animation: flow-fade-up 0.5s 0.10s ease-out both; }
body[data-theme="redesign"] body[data-flow="signup"] .hero-title { animation: flow-fade-up 0.55s 0.20s ease-out both; }
body[data-theme="redesign"] body[data-flow="signup"] .hero-sub { animation: flow-fade-up 0.5s 0.32s ease-out both; }
body[data-theme="redesign"] body[data-flow="signup"] .hero-ctas { animation: flow-fade-up 0.5s 0.42s ease-out both; }
body[data-theme="redesign"] body[data-flow="signup"] .hero-portrait {
  animation: flow-scale-in 0.7s 0.30s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

/* Landing pillars — staggered */
body[data-theme="redesign"] body[data-flow="signup"] .pillar:nth-child(1) { animation: flow-fade-up 0.5s 0.60s ease-out both; }
body[data-theme="redesign"] body[data-flow="signup"] .pillar:nth-child(2) { animation: flow-fade-up 0.5s 0.70s ease-out both; }
body[data-theme="redesign"] body[data-flow="signup"] .pillar:nth-child(3) { animation: flow-fade-up 0.5s 0.80s ease-out both; }
body[data-theme="redesign"] body[data-flow="signup"] .marquee { animation: flow-fade-up 0.5s 0.90s ease-out both; }

/* Pending review — orb scale-in, then list, then reviewer */
body[data-theme="redesign"] body[data-flow="signup"] .pulse-ring {
  animation: flow-scale-in 0.65s 0.20s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
body[data-theme="redesign"] body[data-flow="signup"] .step-list { animation: flow-fade-up 0.5s 0.45s ease-out both; }
body[data-theme="redesign"] body[data-flow="signup"] .reviewer { animation: flow-fade-up 0.5s 0.55s ease-out both; }
body[data-theme="redesign"] body[data-flow="signup"] .help-row { animation: flow-fade-up 0.5s 0.65s ease-out both; }

/* Onboarding step 5 — vault unlocked celebration */
body[data-theme="redesign"] body[data-flow="signup"] .ready-orb {
  animation: flow-scale-in 0.75s 0.15s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
body[data-theme="redesign"] body[data-flow="signup"] .ready-shell .ready-title { animation: flow-fade-up 0.55s 0.50s ease-out both; }
body[data-theme="redesign"] body[data-flow="signup"] .ready-shell .ready-sub { animation: flow-fade-up 0.5s 0.62s ease-out both; }
body[data-theme="redesign"] body[data-flow="signup"] .ready-shell .next-cards { animation: flow-fade-up 0.5s 0.74s ease-out both; }

/* Forward-moving transition out — fires when navigating to another
   step in the signup flow. Slides everything left + fades out. */
body[data-theme="redesign"] body[data-flow="signup"].flow-transitioning .auth-card,
body[data-theme="redesign"] body[data-flow="signup"].flow-transitioning .pending-shell,
body[data-theme="redesign"] body[data-flow="signup"].flow-transitioning .ready-shell,
body[data-theme="redesign"] body[data-flow="signup"].flow-transitioning .signup-shell,
body[data-theme="redesign"] body[data-flow="signup"].flow-transitioning .wizard-shell,
body[data-theme="redesign"] body[data-flow="signup"].flow-transitioning .hero,
body[data-theme="redesign"] body[data-flow="signup"].flow-transitioning .pillars,
body[data-theme="redesign"] body[data-flow="signup"].flow-transitioning .marquee {
  animation: flow-fade-out-left 0.30s ease-in both;
}

@media (max-width: 980px) {
  .page, .page-center { padding-left: 24px; padding-right: 24px; }
  .shell-3col, .shell-2col { grid-template-columns: 1fr; padding-left: 24px; padding-right: 24px; }
  .action-rail { display: none; }
  .mockup-nav { display: none; }
}

/* ============================================================
   Modal vocabulary (Phase 3 — pre-vault mandatory per Decision 6)
   ============================================================
   Three layers below: backdrop, card, content rows. The card
   uses the same glass-card recipe as `.card` (rgba surface +
   blur + 1px hairline border) so modals feel like elevated
   versions of the page, not foreign UI. Backdrop is a deep
   wine wash so the modal sits in front of the gradient field
   without losing context.

   Used by:
   - royall-dialogs.js (.rd-* classes mirror this when the
     redesign theme is active)
   - creator/likeness/modals.html (will opt in when Phase 5
     vault rebuild lands; pattern is here now so vault has
     consistent modal styling on day 1)
   - any new redesign page that needs a modal (just toggle
     .modal-open on the body to show the matching .modal)
   ============================================================ */

body[data-theme="redesign"] .modal-backdrop {
  position: fixed; inset: 0;
  background:
    radial-gradient(800px 600px at 50% 50%, rgba(140, 60, 70, 0.28), transparent 65%),
    rgba(8, 6, 14, 0.72);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  z-index: 200;
  animation: modal-backdrop-in 0.22s ease-out both;
}
@keyframes modal-backdrop-in { from { opacity: 0; } to { opacity: 1; } }

body[data-theme="redesign"] .modal-card {
  width: min(560px, 100%);
  max-height: calc(100vh - 48px);
  overflow: hidden;
  display: flex; flex-direction: column;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 22px;
  box-shadow:
    0 32px 80px -24px rgba(0,0,0,0.55),
    0 0 0 1px rgba(255,255,255,0.04) inset;
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  animation: modal-card-in 0.32s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes modal-card-in {
  from { opacity: 0; transform: scale(0.94) translateY(12px); }
  60%  { opacity: 1; transform: scale(1.01) translateY(0); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* Sized variants — opt in via .modal-card.modal-card-lg */
body[data-theme="redesign"] .modal-card-sm  { max-width: 420px; }
body[data-theme="redesign"] .modal-card-lg  { max-width: 720px; }
body[data-theme="redesign"] .modal-card-xl  { max-width: 920px; }

body[data-theme="redesign"] .modal-head {
  padding: 24px 28px 16px;
  display: flex; align-items: flex-start; gap: 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
body[data-theme="redesign"] .modal-head-text { flex: 1; min-width: 0; }
body[data-theme="redesign"] .modal-title {
  font-size: 20px; font-weight: 800;
  letter-spacing: -0.01em; color: #fff;
  margin: 0 0 4px;
  line-height: 1.25;
}
body[data-theme="redesign"] .modal-sub {
  font-size: 13px; line-height: 1.55;
  color: rgba(243,238,248, 0.65);
  margin: 0;
}
body[data-theme="redesign"] .modal-close {
  flex: none;
  width: 32px; height: 32px;
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  color: rgba(243,238,248, 0.7);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all 0.15s;
  font-family: inherit;
}
body[data-theme="redesign"] .modal-close:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
}
body[data-theme="redesign"] .modal-close i { width: 16px; height: 16px; }

body[data-theme="redesign"] .modal-body {
  padding: 20px 28px;
  overflow: auto;
  /* iOS Safari momentum-scroll hint (2026-05-25 PWA Phase 1E).
     Modern iOS does fling-scroll by default, but the explicit
     -webkit-overflow-scrolling: touch is required for buttery
     momentum inside nested scroll contexts (modal body, sibling
     of fixed brand-bar). Harmless on every other browser. */
  -webkit-overflow-scrolling: touch;
  font-size: 14px; line-height: 1.6;
  color: rgba(243,238,248, 0.85);
}
body[data-theme="redesign"] .modal-body p { margin: 0 0 12px; }
body[data-theme="redesign"] .modal-body p:last-child { margin-bottom: 0; }

/* Optional rose accent strip used for legally-loaded modals
   (license accept, master consent, force terminate). Sits on
   the head, not the body — visually flags "this is a contract,
   read it". */
body[data-theme="redesign"] .modal-card.modal-legal .modal-head {
  border-bottom-color: rgba(255, 180, 180, 0.22);
}
body[data-theme="redesign"] .modal-card.modal-legal::before {
  content: "";
  display: block;
  height: 3px;
  background: linear-gradient(90deg, #ffb4b4 0%, #8d4c4c 100%);
}

/* Danger variant — for destructive confirms (revoke consent,
   force-terminate, hard reject). Tints head + adds red rule. */
body[data-theme="redesign"] .modal-card.modal-danger::before {
  content: "";
  display: block;
  height: 3px;
  background: linear-gradient(90deg, #ef4444 0%, #b91c1c 100%);
}
body[data-theme="redesign"] .modal-card.modal-danger .modal-title {
  color: #fecaca;
}

body[data-theme="redesign"] .modal-foot {
  padding: 16px 28px 22px;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex; gap: 10px; justify-content: flex-end;
  align-items: center;
}
body[data-theme="redesign"] .modal-foot-spread {
  /* Use when one button is destructive on the left, primary on
     the right (e.g. force-terminate confirm: Cancel · Terminate). */
  justify-content: space-between;
}
body[data-theme="redesign"] .modal-foot .modal-foot-note {
  margin-right: auto;
  font-size: 12px;
  color: rgba(243,238,248, 0.5);
  line-height: 1.5;
}

/* Form rows used inside a modal-body. Keeps spacing consistent
   across all 9 production modals so they don't each invent
   their own field rhythm. */
body[data-theme="redesign"] .modal-body .field + .field { margin-top: 14px; }
body[data-theme="redesign"] .modal-body .field label {
  display: block;
  font-size: 11px; font-weight: 800;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: rgba(243,238,248, 0.62);
  margin-bottom: 6px;
}

/* Scrollable legal text inside a modal (master consent, license
   terms). Adds a subtle inner border so users notice it scrolls. */
body[data-theme="redesign"] .modal-doc {
  max-height: 320px;
  overflow: auto;
  padding: 16px 18px;
  background: rgba(0,0,0,0.32);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  font-size: 13px; line-height: 1.6;
  color: rgba(243,238,248, 0.78);
}
body[data-theme="redesign"] .modal-doc h4 {
  font-size: 13px; font-weight: 800;
  color: #fff;
  margin: 16px 0 6px;
  letter-spacing: -0.005em;
}
body[data-theme="redesign"] .modal-doc h4:first-child { margin-top: 0; }

/* Acknowledgement checkbox row — used at the bottom of consent /
   license modals to make the user actively confirm before the
   primary CTA enables. */
body[data-theme="redesign"] .modal-ack {
  margin-top: 14px;
  padding: 12px 14px;
  background: rgba(255, 180, 180, 0.06);
  border: 1px solid rgba(255, 180, 180, 0.16);
  border-radius: 12px;
  display: flex; gap: 10px; align-items: flex-start;
  font-size: 12px; line-height: 1.5;
  color: rgba(243,238,248, 0.85);
  cursor: pointer;
}
body[data-theme="redesign"] .modal-ack input[type="checkbox"] {
  flex: none; width: 18px; height: 18px;
  border-radius: 5px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(0,0,0,0.32);
  appearance: none;
  cursor: pointer;
  position: relative;
  margin-top: 1px;
}
body[data-theme="redesign"] .modal-ack input[type="checkbox"]:checked {
  background: linear-gradient(135deg, #ffb4b4 0%, #b47878 100%);
  border-color: transparent;
}
body[data-theme="redesign"] .modal-ack input[type="checkbox"]:checked::after {
  content: ""; position: absolute; left: 5px; top: 1px;
  width: 5px; height: 10px; border: solid #3d1d1d;
  border-width: 0 2px 2px 0; transform: rotate(45deg);
}

/* When a page wants the host to lock scrolling while a modal
   is up — pages opt in via document.body.classList.add('modal-open'). */
body[data-theme="redesign"].modal-open,
body[data-theme="redesign"] body.modal-open { overflow: hidden; }

/* ============================================================
   Phase 5a — Vault visual port via overrides

   Strategy: leave production class names (.vault-*, .lk-*) in
   place so likeness.js (3,176 lines) doesn't need to change,
   but redefine their visual properties under
   `body[data-theme="redesign"]` so the entire vault adopts
   the wine + rose look the moment the shell opts in.

   What's covered:
   - vault layout + top bar + avatar dropdown
   - vault hero (title + readiness chip)
   - tab strip (4 tabs + badges)
   - tab panel container
   - setup banner (onboarding-incomplete pin)
   - all 9 modals (lk-modal-wrap family — Phase 3 deferred port)
   - shared form bits inside modals (.lk-form-*, .lk-doc, .lk-check)

   What's NOT covered (deferred to Phase 5b):
   - URL split into separate MPA pages
   - likeness.js architecture (still SPA with hash routing)
   - capture studio (likeness-studio.html)
   - per-tab content styling beyond the chrome
   ============================================================ */

/* ── Body + global page surface ─────────────────────────────── */
body[data-theme="redesign"] .vault-layout {
  min-height: 100vh;
  background: transparent;   /* foundation tokens supply the gradient */
}
body[data-theme="redesign"] .vault-main,
body[data-theme="redesign"] .vault-main--no-sidebar {
  margin-left: 0;
  background: transparent;
}

/* Top bar — replaces the legacy white/dark sticky header */
body[data-theme="redesign"] .vault-top {
  background: rgba(20, 12, 22, 0.7);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  padding: 14px 28px;
  display: flex; justify-content: space-between; align-items: center;
}
body[data-theme="redesign"] .vault-top-logo {
  filter: invert(1) brightness(1.05);
  opacity: 0.85;
  height: 22px;
}
body[data-theme="redesign"] .vault-avatar {
  background: linear-gradient(160deg, #ffb4b4 0%, #8d4c4c 100%);
  color: #3d1d1d;
  box-shadow: 0 0 24px rgba(255,180,180, 0.32);
  font-weight: 900;
}
body[data-theme="redesign"] .vault-avatar:hover {
  box-shadow: 0 0 32px rgba(255,180,180, 0.5);
  transform: scale(1.06);
}

body[data-theme="redesign"] .avatar-dropdown {
  background: rgba(20, 12, 22, 0.95);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: 0 24px 60px -20px rgba(0,0,0,0.55);
  color: #fff;
  padding: 14px 16px;
}
body[data-theme="redesign"] .avatar-dropdown-name {
  color: #fff;
  font-weight: 800;
}
body[data-theme="redesign"] .avatar-dropdown-email {
  color: rgba(243,238,248, 0.6);
}
body[data-theme="redesign"] .avatar-dropdown-btn {
  color: rgba(243,238,248, 0.85);
  background: transparent;
  border-radius: 8px;
  font-weight: 700;
}
body[data-theme="redesign"] .avatar-dropdown-btn:hover {
  background: rgba(255,255,255,0.06);
  color: #fff;
}
body[data-theme="redesign"] .avatar-dropdown-btn.neutral:hover {
  background: rgba(255,255,255,0.06);
  color: #fff;
}
body[data-theme="redesign"] .avatar-dropdown > div[style*="surface-3"] {
  background: rgba(255,255,255,0.06) !important;
}

/* ── Page container + hero ──────────────────────────────────── */
body[data-theme="redesign"] .v-panel { background: transparent; }
body[data-theme="redesign"] .lk-page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px 0 96px;
}

body[data-theme="redesign"] .lk-vault-header {
  margin-bottom: 32px;
  padding-top: 8px;
}
body[data-theme="redesign"] .lk-vault-title {
  font-size: 44px;
  font-weight: 900;
  letter-spacing: -0.025em;
  line-height: 1.05;
  color: #fff;
  margin: 0;
}
body[data-theme="redesign"] .lk-vault-title span {
  background: linear-gradient(135deg, #ffd0d0 0%, #ffb4b4 50%, #8d4c4c 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 900;
}

/* Readiness chip — preserves the 5 state classes JS toggles */
body[data-theme="redesign"] .lk-vault-status {
  display: inline-flex; gap: 12px; align-items: center;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  backdrop-filter: blur(12px);
}
body[data-theme="redesign"] .lk-vault-status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
body[data-theme="redesign"] .lk-vault-status-primary {
  font-size: 12px; font-weight: 800;
  color: #fff;
  letter-spacing: -0.005em;
}
body[data-theme="redesign"] .lk-vault-status-sub {
  font-size: 11px;
  color: rgba(243,238,248, 0.6);
}
body[data-theme="redesign"] .lk-vault-status.state-setup {
  border-color: rgba(251, 146, 60, 0.32);
  background: rgba(251, 146, 60, 0.06);
}
body[data-theme="redesign"] .lk-vault-status.state-setup .lk-vault-status-dot { background: #fb923c; }
body[data-theme="redesign"] .lk-vault-status.state-review {
  border-color: rgba(255, 180, 180, 0.36);
  background: rgba(255, 180, 180, 0.06);
}
body[data-theme="redesign"] .lk-vault-status.state-review .lk-vault-status-dot { background: #ffb4b4; }
body[data-theme="redesign"] .lk-vault-status.state-capturing {
  border-color: rgba(234, 179, 8, 0.4);
  background: rgba(234, 179, 8, 0.06);
}
body[data-theme="redesign"] .lk-vault-status.state-capturing .lk-vault-status-dot { background: #eab308; }
body[data-theme="redesign"] .lk-vault-status.state-unlocked {
  border-color: rgba(74, 222, 128, 0.32);
  background: rgba(74, 222, 128, 0.06);
}
body[data-theme="redesign"] .lk-vault-status.state-unlocked .lk-vault-status-dot { background: #4ade80; }
body[data-theme="redesign"] .lk-vault-status.state-live {
  border-color: rgba(74, 222, 128, 0.5);
  background: rgba(74, 222, 128, 0.08);
}
body[data-theme="redesign"] .lk-vault-status.state-live .lk-vault-status-dot { background: #4ade80; }

/* Setup banner (onboarding incomplete) */
body[data-theme="redesign"] .lk-setup-banner {
  background: rgba(255, 180, 180, 0.06);
  border: 1px solid rgba(255, 180, 180, 0.24);
  border-radius: 14px;
  padding: 16px 20px;
  margin: 20px 0 0;
  color: rgba(243, 238, 248, 0.85);
}

/* ── Tab strip ─────────────────────────────────────────────── */
body[data-theme="redesign"] .lk-tabs {
  display: flex; gap: 4px;
  margin: 28px 0 24px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  overflow-x: auto;
}
body[data-theme="redesign"] .lk-tab-btn {
  background: transparent;
  border: none;
  border-radius: 10px 10px 0 0;
  padding: 12px 16px;
  font-size: 13px; font-weight: 700;
  color: rgba(243, 238, 248, 0.55);
  cursor: pointer;
  font-family: inherit;
  display: inline-flex; align-items: center; gap: 8px;
  position: relative;
  transition: color 0.15s;
  /* tabs are <a> as of Phase 5b — kill the default underline */
  text-decoration: none;
}
body[data-theme="redesign"] .lk-tab-btn:hover {
  color: rgba(255, 255, 255, 0.85);
}
body[data-theme="redesign"] .lk-tab-btn.on {
  color: #fff;
  background: rgba(255, 180, 180, 0.06);
}
body[data-theme="redesign"] .lk-tab-btn.on::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: linear-gradient(90deg, #ffb4b4 0%, #8d4c4c 100%);
  border-radius: 999px;
}
body[data-theme="redesign"] .lk-tab-badge {
  background: linear-gradient(135deg, #ffb4b4 0%, #b47878 100%);
  color: #3d1d1d;
  font-size: 10px; font-weight: 900;
  padding: 2px 7px;
  border-radius: 999px;
  min-width: 18px;
  text-align: center;
}
body[data-theme="redesign"] .lk-tab-badge.hidden { display: none; }
body[data-theme="redesign"] .lk-tab-panel { display: none; padding-top: 8px; }
body[data-theme="redesign"] .lk-tab-panel.on { display: block; }

/* ── Modal vocabulary (Phase 3 deferred port) ───────────────
   Map every existing .lk-modal-* class to the redesign modal
   pattern so opening any modal in the vault — by JS toggling
   .on on its .lk-modal-wrap — adopts the rose-glass treatment
   automatically. JS untouched. */
body[data-theme="redesign"] .lk-modal-wrap {
  position: fixed; inset: 0;
  background:
    radial-gradient(800px 600px at 50% 50%, rgba(140, 60, 70, 0.28), transparent 65%),
    rgba(8, 6, 14, 0.72);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  display: none;
  align-items: center; justify-content: center;
  padding: 24px;
  z-index: 200;
}
body[data-theme="redesign"] .lk-modal-wrap.on {
  display: flex;
  animation: lk-backdrop-in 0.22s ease-out both;
}
@keyframes lk-backdrop-in { from { opacity: 0; } to { opacity: 1; } }

body[data-theme="redesign"] .lk-modal {
  width: min(560px, 100%);
  max-height: calc(100vh - 48px);
  overflow: hidden;
  display: flex; flex-direction: column;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 22px;
  box-shadow: 0 32px 80px -24px rgba(0,0,0,0.55);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  animation: lk-card-in 0.32s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes lk-card-in {
  from { opacity: 0; transform: scale(0.94) translateY(12px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* Wider modals — radar-settings + takedown have a lot of content,
   matching the deck's modal-card-lg sizing. */
body[data-theme="redesign"] #radar-settings-modal .lk-modal,
body[data-theme="redesign"] #takedown-modal .lk-modal {
  width: min(720px, 100%);
}

body[data-theme="redesign"] .lk-modal-head {
  padding: 24px 28px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  position: relative;
  display: block;
}
body[data-theme="redesign"] .lk-modal-title {
  font-size: 20px; font-weight: 800;
  color: #fff;
  letter-spacing: -0.01em;
  margin: 0 0 4px;
  line-height: 1.25;
}
body[data-theme="redesign"] .lk-modal-sub {
  font-size: 13px; line-height: 1.55;
  color: rgba(243,238,248, 0.65);
  margin: 0;
}
body[data-theme="redesign"] .lk-modal-x {
  position: absolute;
  top: 18px; right: 18px;
  width: 32px; height: 32px;
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  color: rgba(243,238,248, 0.7);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}
body[data-theme="redesign"] .lk-modal-x:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
}
body[data-theme="redesign"] .lk-modal-x i { width: 16px; height: 16px; }

body[data-theme="redesign"] .lk-modal-body {
  padding: 20px 28px;
  overflow: auto;
  /* iOS Safari momentum-scroll hint — see .modal-body comment. */
  -webkit-overflow-scrolling: touch;
  font-size: 14px; line-height: 1.6;
  color: rgba(243,238,248, 0.85);
  flex: 1;
}
body[data-theme="redesign"] .lk-modal-body p { margin: 0 0 12px; }
body[data-theme="redesign"] .lk-modal-body p:last-child { margin-bottom: 0; }

body[data-theme="redesign"] .lk-modal-foot {
  padding: 16px 28px 22px;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex; gap: 10px; justify-content: flex-end;
  align-items: center;
}

/* The legally-loaded modals get the rose accent strip. */
body[data-theme="redesign"] #consent-modal .lk-modal,
body[data-theme="redesign"] #license-accept-modal .lk-modal,
body[data-theme="redesign"] #takedown-modal .lk-modal {
  position: relative;
}
body[data-theme="redesign"] #consent-modal .lk-modal::before,
body[data-theme="redesign"] #license-accept-modal .lk-modal::before,
body[data-theme="redesign"] #takedown-modal .lk-modal::before {
  content: "";
  display: block;
  height: 3px;
  background: linear-gradient(90deg, #ffb4b4 0%, #8d4c4c 100%);
}

/* Form bits inside modals */
body[data-theme="redesign"] .lk-form-label {
  display: block;
  font-size: 11px; font-weight: 800;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: rgba(243,238,248, 0.62);
  margin: 14px 0 6px;
}
body[data-theme="redesign"] .lk-form-label:first-child { margin-top: 0; }
body[data-theme="redesign"] .lk-form-input {
  width: 100%; box-sizing: border-box;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(0,0,0,0.32);
  border: 1px solid rgba(255,255,255,0.1);
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  transition: border-color 0.15s, background 0.15s;
}
body[data-theme="redesign"] .lk-form-input::placeholder { color: rgba(243,238,248, 0.4); }
body[data-theme="redesign"] .lk-form-input:focus {
  outline: none;
  border-color: rgba(255,180,180, 0.55);
  background: rgba(0,0,0,0.42);
}

/* Doc panel (consent text, license terms) */
body[data-theme="redesign"] .lk-doc {
  padding: 16px 18px;
  background: rgba(0,0,0,0.32);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  font-size: 13px; line-height: 1.6;
  color: rgba(243,238,248, 0.78);
  margin-bottom: 14px;
}
body[data-theme="redesign"] .lk-doc h4 {
  font-size: 13px; font-weight: 800;
  color: #fff;
  margin: 16px 0 6px;
  letter-spacing: -0.005em;
}
body[data-theme="redesign"] .lk-doc h4:first-child { margin-top: 0; }
body[data-theme="redesign"] .lk-doc p { margin: 0 0 10px; }
body[data-theme="redesign"] .lk-doc strong { color: #fff; }

/* Acknowledgement checkbox row inside modals */
body[data-theme="redesign"] .lk-check {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px;
  background: rgba(255, 180, 180, 0.06);
  border: 1px solid rgba(255, 180, 180, 0.22);
  border-radius: 12px;
  font-size: 12px; line-height: 1.5;
  color: rgba(243,238,248, 0.85);
  cursor: pointer;
  margin-bottom: 8px;
}
body[data-theme="redesign"] .lk-check input[type="checkbox"] {
  flex: none; width: 18px; height: 18px;
  border-radius: 5px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(0,0,0,0.32);
  appearance: none;
  cursor: pointer;
  position: relative;
  margin-top: 1px;
}
body[data-theme="redesign"] .lk-check input[type="checkbox"]:checked {
  background: linear-gradient(135deg, #ffb4b4 0%, #b47878 100%);
  border-color: transparent;
}
body[data-theme="redesign"] .lk-check input[type="checkbox"]:checked::after {
  content: ""; position: absolute; left: 5px; top: 1px;
  width: 5px; height: 10px; border: solid #3d1d1d;
  border-width: 0 2px 2px 0; transform: rotate(45deg);
}
body[data-theme="redesign"] .lk-check-text { flex: 1; }

/* Signature canvas inside modals — keep white background so the
   ink stays high-contrast. */
body[data-theme="redesign"] .lk-sig-wrap {
  position: relative;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  background: rgba(255,255,255,0.96);
  overflow: hidden;
}
body[data-theme="redesign"] .lk-sig-canvas {
  display: block;
  width: 100%; height: 140px;
  cursor: crosshair;
  touch-action: none;
  background: rgba(255,255,255,0.96);
}
body[data-theme="redesign"] .lk-sig-clear {
  position: absolute;
  top: 8px; right: 8px;
  font-size: 11px; font-weight: 700;
  padding: 5px 10px;
  border-radius: 6px;
  background: rgba(20,12,18,0.88);
  border: 1px solid rgba(255,255,255,0.12);
  color: #fff;
  cursor: pointer;
  font-family: inherit;
}
body[data-theme="redesign"] .lk-sig-clear:hover {
  background: rgba(20,12,18,0.95);
}

/* ID-status card inside id-modal */
body[data-theme="redesign"] .lk-id-status-card {
  display: flex; gap: 14px; align-items: center;
  padding: 16px 18px;
  background: rgba(255, 180, 180, 0.06);
  border: 1px solid rgba(255, 180, 180, 0.24);
  border-radius: 14px;
  margin-bottom: 14px;
}
body[data-theme="redesign"] .lk-id-status-icon {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: linear-gradient(160deg, #ffb4b4 0%, #8d4c4c 100%);
  color: #3d1d1d;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
body[data-theme="redesign"] .lk-id-status-icon i { width: 22px; height: 22px; }
body[data-theme="redesign"] .lk-id-status-state {
  font-size: 14px; font-weight: 800;
  color: #fff;
}
body[data-theme="redesign"] .lk-id-status-eta {
  font-size: 12px;
  color: rgba(243,238,248, 0.6);
  margin-top: 2px;
}
body[data-theme="redesign"] .lk-id-status-rows {
  display: flex; flex-direction: column; gap: 8px;
  margin-bottom: 8px;
}

/* Section block used in license + takedown modals */
body[data-theme="redesign"] .lk-modal-body .lk-section {
  background: rgba(0,0,0,0.32) !important;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 16px !important;
  margin-top: 0 !important;
}

/* btn-accent → primary; btn-ghost → ghost. The legacy classes
   are widely used inside modal-foot rows; we re-skin them
   here so we don't have to mass-rename in 9 places. */
body[data-theme="redesign"] .btn-accent {
  background: linear-gradient(135deg, #ffb4b4 0%, #b47878 100%) !important;
  color: #3d1d1d !important;
  border: none !important;
  box-shadow: 0 12px 32px -10px rgba(255,180,180,0.55);
  font-weight: 800 !important;
}
body[data-theme="redesign"] .btn-accent:hover {
  box-shadow: 0 14px 38px -8px rgba(255,180,180,0.65);
  transform: translateY(-1px);
}
body[data-theme="redesign"] .btn-ghost {
  background: rgba(255,255,255,0.04) !important;
  border: 1px solid rgba(255,255,255,0.1) !important;
  color: rgba(243,238,248, 0.85) !important;
  font-weight: 700 !important;
}
body[data-theme="redesign"] .btn-ghost:hover {
  background: rgba(255,255,255,0.08) !important;
  color: #fff !important;
}

/* ============================================================
   Phase 6 — Capture Studio visual port

   Strategy mirrors Phase 5a's vault port: leave the production
   class names intact (likeness-studio.js's 2,054 lines reference
   .studio-*, .tut-* classes throughout), redefine their visuals
   under `body[data-theme="redesign"]`. JS untouched.

   What's covered:
   - studio top bar (back / brand / title / progress / save&exit /
     submit-for-review)
   - left side prompt list
   - main stage card (prompt header, instruction, script)
   - voice + video recorders (ring, record button, timer, level
     meter, beat-step pills, face chip)
   - playback rows (audio + video)
   - re-record / save-take action row
   - bottom nav (prev / progress)
   - step-flash toast (Take saved → notification)
   - first-capture tutorial overlay (.tut-bg / .tut-card / .tut-art /
     .tut-step / .tut-h1 / .tut-p / .tut-tip / .tut-pips / .tut-pip /
     .tut-actions / .tut-skip)

   What's NOT covered:
   - capture pipeline (recording, watermarking, fingerprint, upload)
   - .studio-card.advancing-out / .entering animation classes (kept
     from production CSS — they handle the step-in transition)
   ============================================================ */

/* ── Layout shell ──────────────────────────────────────────── */
body[data-theme="redesign"] .studio-layout {
  min-height: 100vh;
  background: transparent;
  display: flex; flex-direction: column;
}

body[data-theme="redesign"] .studio-top {
  background: rgba(20, 12, 22, 0.7);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  padding: 14px 28px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
body[data-theme="redesign"] .studio-top-left {
  display: flex; align-items: center; gap: 14px;
}
body[data-theme="redesign"] .studio-back {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  color: rgba(243,238,248, 0.85);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
body[data-theme="redesign"] .studio-back:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
}
body[data-theme="redesign"] .studio-brand img {
  filter: invert(1) brightness(1.05);
  opacity: 0.85;
  height: 22px;
}
body[data-theme="redesign"] .studio-top-divider {
  width: 1px; height: 24px;
  background: rgba(255,255,255,0.1);
}
body[data-theme="redesign"] .studio-title {
  font-size: 13px; font-weight: 800;
  color: #fff;
  letter-spacing: -0.005em;
}
body[data-theme="redesign"] .studio-progress {
  font-size: 11px; font-weight: 600;
  color: rgba(243,238,248, 0.55);
  letter-spacing: 0.04em;
}

/* Studio main split: side + stage */
body[data-theme="redesign"] .studio-main {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
  padding: 24px 28px 80px;
  flex: 1;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}
@media (max-width: 900px) {
  body[data-theme="redesign"] .studio-main { grid-template-columns: 1fr; }
}

/* Side prompt list */
body[data-theme="redesign"] .studio-side {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  padding: 18px 14px;
  height: fit-content;
  position: sticky;
  top: 90px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
body[data-theme="redesign"] .studio-side-title {
  font-size: 11px; font-weight: 800;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: rgba(255,180,180, 0.85);
  padding: 0 6px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  margin-bottom: 8px;
}

/* Prompt items injected by JS via #prompt-list */
body[data-theme="redesign"] .studio-prompt-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s;
  color: rgba(243,238,248, 0.7);
}
body[data-theme="redesign"] .studio-prompt-item:hover {
  background: rgba(255,255,255,0.04);
  color: #fff;
}
/* JS toggles `.on` (not `.current`) — see renderPromptList() in
   likeness-studio.js. `.locked` is also possible (a future prompt
   you can't jump to yet). */
body[data-theme="redesign"] .studio-prompt-item.on {
  background: rgba(255,180,180, 0.08);
  color: #fff;
}
body[data-theme="redesign"] .studio-prompt-item.on::before {
  content: "";
  width: 3px; height: 18px;
  border-radius: 2px;
  background: linear-gradient(180deg, #ffb4b4 0%, #8d4c4c 100%);
  flex: none;
}
body[data-theme="redesign"] .studio-prompt-item.locked {
  opacity: 0.45;
  cursor: not-allowed;
}
body[data-theme="redesign"] .studio-prompt-num {
  font-size: 11px; font-weight: 800;
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(255,255,255,0.06);
  color: rgba(243,238,248, 0.7);
  display: inline-flex; align-items: center; justify-content: center;
  flex: none;
}
body[data-theme="redesign"] .studio-prompt-item.done .studio-prompt-num {
  background: linear-gradient(135deg, #4ade80 0%, #16a34a 100%);
  color: #052e16;
}
body[data-theme="redesign"] .studio-prompt-item.on .studio-prompt-num {
  background: linear-gradient(135deg, #ffb4b4 0%, #b47878 100%);
  color: #3d1d1d;
}
body[data-theme="redesign"] .studio-prompt-title {
  font-size: 13px; font-weight: 700;
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
body[data-theme="redesign"] .studio-prompt-cat {
  font-size: 10px;
  color: rgba(243,238,248, 0.45);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Stage */
body[data-theme="redesign"] .studio-stage {
  display: flex; flex-direction: column;
  gap: 24px;
  min-width: 0;
}
body[data-theme="redesign"] .studio-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 22px;
  padding: 36px 36px 32px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 24px 60px -24px rgba(0,0,0,0.5);
}
body[data-theme="redesign"] .studio-cat {
  font-size: 11px; font-weight: 800;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: rgba(255,180,180, 0.85);
  margin-bottom: 12px;
}
body[data-theme="redesign"] .studio-prompt-head {
  font-size: 28px; font-weight: 900;
  letter-spacing: -0.02em; line-height: 1.15;
  color: #fff;
  margin: 0 0 12px;
}
body[data-theme="redesign"] .studio-instruction {
  font-size: 14px; line-height: 1.6;
  color: rgba(243,238,248, 0.72);
  margin-bottom: 20px;
}
body[data-theme="redesign"] .studio-script {
  background: rgba(0,0,0,0.32);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 18px 20px;
  font-size: 15px; line-height: 1.65;
  color: rgba(243,238,248, 0.88);
  margin-bottom: 24px;
}

/* ── Studio S6 (voice-alignment / karaoke highlighting) ─────────
   The karaoke feature was REMOVED 2026-05-18. Browser SpeechRecognition
   was too unreliable on diverse voices, and the visible misses
   distracted creators mid-take. See:
     docs/RELEASES/2026-05-18-studio-s6-removal.md
   for the full removal rationale. All `.voice-track-badge`,
   `.voice-skip-btn`, `.voice-aligned`, `.word.*` rules are gone —
   no DOM in the studio renders them anymore.
   ────────────────────────────────────────────────────────────── */

/* Recorder common bits */
body[data-theme="redesign"] .studio-recorder {
  display: flex; flex-direction: column; align-items: center;
  gap: 8px;
  padding: 16px 0;
}
body[data-theme="redesign"] .studio-recwrap {
  position: relative;
  width: 128px; height: 128px;
}
body[data-theme="redesign"] .studio-ring {
  position: absolute; inset: 0;
  width: 128px; height: 128px;
  transform: rotate(-90deg);
}
body[data-theme="redesign"] .studio-ring-track {
  fill: none;
  stroke: rgba(255,255,255,0.08);
  stroke-width: 4;
}
body[data-theme="redesign"] .studio-ring-fill {
  fill: none;
  stroke: url(#studio-ring-grad);   /* JS may override */
  stroke: #ffb4b4;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 364.4;
  stroke-dashoffset: 364.4;
  transition: stroke-dashoffset 0.16s linear;
  filter: drop-shadow(0 0 12px rgba(255,180,180,0.5));
}
body[data-theme="redesign"] .studio-recbtn {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 88px; height: 88px;
  border-radius: 50%;
  background: linear-gradient(160deg, #ffb4b4 0%, #8d4c4c 100%);
  color: #3d1d1d;
  border: none;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow:
    0 0 60px rgba(255,180,180,0.5),
    inset 0 0 24px rgba(255,255,255,0.12);
  transition: transform 0.18s, box-shadow 0.18s;
}
body[data-theme="redesign"] .studio-recbtn:hover {
  transform: translate(-50%, -50%) scale(1.04);
  box-shadow:
    0 0 80px rgba(255,180,180,0.65),
    inset 0 0 24px rgba(255,255,255,0.18);
}
body[data-theme="redesign"] .studio-recbtn[aria-pressed="true"] {
  background: linear-gradient(160deg, #ef4444 0%, #991b1b 100%);
  color: #fef2f2;
  box-shadow: 0 0 80px rgba(239,68,68,0.55);
  animation: studio-rec-pulse 1.4s ease-in-out infinite;
}
@keyframes studio-rec-pulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50%      { transform: translate(-50%, -50%) scale(1.04); }
}
body[data-theme="redesign"] .studio-recbtn i {
  width: 32px; height: 32px;
}

body[data-theme="redesign"] .studio-timer {
  font-size: 28px; font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  color: #fff;
  margin-top: 12px;
}
body[data-theme="redesign"] .studio-count {
  font-size: 12px; font-weight: 600;
  color: rgba(243,238,248, 0.55);
  letter-spacing: 0.04em;
}

/* Audio level meter */
body[data-theme="redesign"] .studio-level {
  width: min(360px, 100%); height: 4px;
  background: rgba(255,255,255,0.06);
  border-radius: 999px;
  margin: 14px auto 0;
  overflow: hidden;
}
body[data-theme="redesign"] .studio-level-fill {
  height: 100%;
  background: linear-gradient(90deg, #4ade80 0%, #ffb4b4 70%, #ef4444 100%);
  border-radius: 999px;
  transition: width 0.08s linear;
  width: 0%;
}

body[data-theme="redesign"] .studio-hint {
  font-size: 13px;
  color: rgba(243,238,248, 0.6);
  margin-top: 14px;
  text-align: center;
}

/* Action row (re-record + save-take) */
body[data-theme="redesign"] .studio-actions {
  display: flex; gap: 12px; justify-content: center;
  margin-top: 18px;
  flex-wrap: wrap;
}
body[data-theme="redesign"] .studio-rerecord {
  background: rgba(255,255,255,0.04) !important;
  border: 1px solid rgba(255,255,255,0.1) !important;
  color: rgba(243,238,248, 0.85) !important;
  padding: 12px 22px !important;
  border-radius: 12px !important;
  font-size: 13px !important; font-weight: 700 !important;
  display: inline-flex; align-items: center; gap: 8px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
body[data-theme="redesign"] .studio-rerecord:hover {
  background: rgba(255,255,255,0.08) !important;
  color: #fff !important;
}
body[data-theme="redesign"] .studio-save-big {
  background: linear-gradient(135deg, #ffb4b4 0%, #b47878 100%) !important;
  color: #3d1d1d !important;
  border: none !important;
  padding: 12px 24px !important;
  border-radius: 12px !important;
  font-size: 13px !important; font-weight: 800 !important;
  display: inline-flex; align-items: center; gap: 8px;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 12px 32px -10px rgba(255,180,180,0.55);
  transition: all 0.15s;
}
body[data-theme="redesign"] .studio-save-big:hover {
  box-shadow: 0 14px 38px -8px rgba(255,180,180,0.65);
  transform: translateY(-1px);
}
body[data-theme="redesign"] .studio-save-big i { width: 16px; height: 16px; }

/* Video preview wrap (face + body recorders) */
body[data-theme="redesign"] .studio-video-wrap {
  position: relative;
  width: 100%; max-width: 560px;
  margin: 0 auto;
  border-radius: 18px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 24px 60px -16px rgba(0,0,0,0.55);
  border: 1px solid rgba(255,255,255,0.08);
}
body[data-theme="redesign"] .studio-video,
body[data-theme="redesign"] .studio-playback-video {
  border-radius: 18px;
  background: #000;
}
body[data-theme="redesign"] .studio-beat-steps {
  position: absolute;
  top: 14px; left: 14px;
  display: flex; gap: 6px;
  padding: 6px 10px;
  background: rgba(0,0,0,0.55);
  border-radius: 999px;
  backdrop-filter: blur(8px);
}
body[data-theme="redesign"] .studio-beat-step {
  width: 24px; height: 4px;
  border-radius: 999px;
  background: rgba(255,255,255,0.18);
}
body[data-theme="redesign"] .studio-beat-step.active {
  background: linear-gradient(90deg, #ffb4b4 0%, #8d4c4c 100%);
  box-shadow: 0 0 8px rgba(255,180,180,0.5);
}
body[data-theme="redesign"] .studio-beat-step.done { background: #4ade80; }
body[data-theme="redesign"] .studio-beat {
  position: absolute;
  bottom: 14px; left: 50%;
  transform: translateX(-50%);
}
body[data-theme="redesign"] .studio-beat-pill {
  background: rgba(0,0,0,0.65);
  border: 1px solid rgba(255,255,255,0.14);
  color: #fff;
  font-size: 13px; font-weight: 700;
  padding: 8px 16px;
  border-radius: 999px;
  display: inline-flex; align-items: center; gap: 8px;
  backdrop-filter: blur(12px);
}
body[data-theme="redesign"] .studio-beat-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #ffb4b4;
  box-shadow: 0 0 8px rgba(255,180,180,0.6);
}
body[data-theme="redesign"] .studio-beat-pill.beat-done .studio-beat-dot { background: #4ade80; }
body[data-theme="redesign"] .studio-beat-check {
  display: none;
  color: #4ade80;
}
body[data-theme="redesign"] .studio-beat-pill.beat-done .studio-beat-check { display: inline-flex; }
body[data-theme="redesign"] .studio-beat-pill.beat-done .studio-beat-dot   { display: none; }

body[data-theme="redesign"] .studio-face-chip {
  position: absolute;
  top: 14px; right: 14px;
  background: rgba(0,0,0,0.55);
  border: 1px solid rgba(255,255,255,0.14);
  color: rgba(243,238,248, 0.9);
  font-size: 11px; font-weight: 700;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  backdrop-filter: blur(8px);
}

/* Bottom nav row */
body[data-theme="redesign"] .studio-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 0;
  margin-top: 8px;
}
body[data-theme="redesign"] .studio-nav-btn {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(243,238,248, 0.85);
  font-size: 13px; font-weight: 700;
  padding: 10px 16px;
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
body[data-theme="redesign"] .studio-nav-btn:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
}
body[data-theme="redesign"] .studio-nav-btn:disabled {
  opacity: 0.4; cursor: not-allowed;
}

/* Step-flash toast (Take saved → notification) */
body[data-theme="redesign"] .studio-step-flash {
  background: rgba(20, 12, 18, 0.95) !important;
  border: 1px solid rgba(74, 222, 128, 0.4);
  color: #fff !important;
  border-radius: 12px !important;
  padding: 12px 22px !important;
  font-size: 13px !important; font-weight: 700 !important;
  letter-spacing: 0 !important;
  box-shadow: 0 18px 40px rgba(0,0,0,0.4) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
body[data-theme="redesign"] .studio-step-flash i {
  color: #4ade80;
}

/* ── Tutorial overlay ──────────────────────────────────────── */
body[data-theme="redesign"] .tut-bg {
  position: fixed; inset: 0;
  background:
    radial-gradient(800px 600px at 50% 50%, rgba(140, 60, 70, 0.32), transparent 65%),
    rgba(8, 6, 14, 0.82);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  display: none;
  align-items: center; justify-content: center;
  padding: 24px;
  z-index: 300;
}
body[data-theme="redesign"] .tut-bg.on,
body[data-theme="redesign"] .tut-bg[data-on] {
  display: flex;
  animation: tut-fade-in 0.28s ease-out both;
}
@keyframes tut-fade-in { from { opacity: 0; } to { opacity: 1; } }

body[data-theme="redesign"] .tut-card {
  width: min(520px, 100%);
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 22px;
  overflow: hidden;
  display: flex; flex-direction: column;
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  box-shadow: 0 32px 80px -20px rgba(0,0,0,0.6);
  animation: tut-card-in 0.36s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes tut-card-in {
  from { opacity: 0; transform: scale(0.94) translateY(12px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
body[data-theme="redesign"] .tut-art {
  background:
    radial-gradient(circle at 30% 30%, rgba(255,180,180,0.45), transparent 60%),
    linear-gradient(160deg, #ffb4b4 0%, #8d4c4c 100%);
  color: #3d1d1d;
  padding: 36px;
  display: flex; align-items: center; justify-content: center;
}
body[data-theme="redesign"] .tut-art i {
  width: 48px; height: 48px;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.25));
}
body[data-theme="redesign"] .tut-body {
  padding: 24px 28px 16px;
}
body[data-theme="redesign"] .tut-step {
  font-size: 11px; font-weight: 800;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: rgba(255,180,180, 0.85);
  margin: 0 0 8px;
}
body[data-theme="redesign"] .tut-h1 {
  font-size: 24px; font-weight: 900;
  letter-spacing: -0.02em;
  color: #fff;
  margin: 0 0 12px;
}
body[data-theme="redesign"] .tut-p {
  font-size: 14px; line-height: 1.55;
  color: rgba(243,238,248, 0.78);
  margin: 0 0 14px;
}
body[data-theme="redesign"] .tut-tip {
  background: rgba(255,180,180, 0.06);
  border: 1px solid rgba(255,180,180, 0.22);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 12px; line-height: 1.55;
  color: rgba(255, 220, 220, 0.95);
}
body[data-theme="redesign"] .tut-foot {
  padding: 16px 24px 22px;
  display: flex; align-items: center; justify-content: space-between;
  border-top: 1px solid rgba(255,255,255,0.06);
  gap: 14px;
}
body[data-theme="redesign"] .tut-pips {
  display: flex; gap: 6px;
}
body[data-theme="redesign"] .tut-pip {
  width: 22px; height: 4px;
  border-radius: 999px;
  background: rgba(255,255,255,0.14);
  transition: background 0.2s;
}
/* Legacy JS toggles `.active` (not `.on` like I first wrote) — match
   what likeness-studio.js's renderTutorial() actually sets. */
body[data-theme="redesign"] .tut-pip.active {
  background: linear-gradient(90deg, #ffb4b4 0%, #8d4c4c 100%);
  box-shadow: 0 0 8px rgba(255,180,180,0.4);
}
body[data-theme="redesign"] .tut-actions {
  display: flex; gap: 8px;
}
body[data-theme="redesign"] .tut-skip {
  background: none;
  border: none;
  color: rgba(243,238,248, 0.55);
  font-size: 12px; font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  padding: 6px 10px;
  transition: color 0.15s;
}
body[data-theme="redesign"] .tut-skip:hover { color: #fff; }

/* QC alert (rendered in JS for poor recording quality) */
body[data-theme="redesign"] .studio-qc-alert {
  background: rgba(245, 158, 11, 0.08) !important;
  border: 1px solid rgba(245, 158, 11, 0.32) !important;
  color: #fde68a !important;
  border-radius: 12px !important;
}
body[data-theme="redesign"] .studio-qc-alert strong { color: #fff !important; }

/* ============================================================
   Phase 7 — Legal pages (Terms / Privacy)

   Long-read legal documents linked from every signup checkbox
   and every footer. Pre-Phase-7 they used a plain stylesheet
   with system font + black text on white, which looked broken
   when a creator clicked through from the redesigned signup.
   The .legal-shell pattern matches the rest of the redesign:
   wine background (from foundation tokens), glass content card,
   rose accents on links + emphasis.

   Used by: backend/legal/tos.html, backend/legal/privacy.html
   ============================================================ */

body[data-theme="redesign"] .legal-shell {
  max-width: 800px;
  margin: 0 auto;
  padding: 120px 24px 96px;
  color: rgba(243, 238, 248, 0.85);
}
body[data-theme="redesign"] .legal-shell h1 {
  font-size: 44px; font-weight: 900;
  letter-spacing: -0.025em;
  line-height: 1.05;
  color: #fff;
  margin: 0 0 12px;
}
body[data-theme="redesign"] .legal-shell .legal-meta {
  font-size: 12px; font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 180, 180, 0.85);
  margin-bottom: 36px;
}
body[data-theme="redesign"] .legal-shell .legal-placeholder {
  background: rgba(245, 158, 11, 0.06);
  border: 1px solid rgba(245, 158, 11, 0.32);
  border-radius: 14px;
  padding: 14px 18px;
  font-size: 13px; line-height: 1.6;
  color: #fde68a;
  margin-bottom: 32px;
}
body[data-theme="redesign"] .legal-shell .legal-placeholder code {
  background: rgba(0,0,0,0.32);
  border: 1px solid rgba(255,255,255,0.08);
  padding: 2px 6px;
  border-radius: 4px;
  color: #fff;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12px;
}
body[data-theme="redesign"] .legal-shell h2 {
  font-size: 20px; font-weight: 800;
  letter-spacing: -0.01em;
  color: #fff;
  margin: 36px 0 12px;
}
body[data-theme="redesign"] .legal-shell p,
body[data-theme="redesign"] .legal-shell li {
  font-size: 15px;
  line-height: 1.7;
  color: rgba(243, 238, 248, 0.85);
  margin: 0 0 12px;
}
body[data-theme="redesign"] .legal-shell ul,
body[data-theme="redesign"] .legal-shell ol {
  padding-left: 22px;
  margin: 0 0 16px;
}
body[data-theme="redesign"] .legal-shell li { margin-bottom: 10px; }
body[data-theme="redesign"] .legal-shell li::marker {
  color: rgba(255, 180, 180, 0.65);
}
/* 2026-05-16 (v1.1) — DMCA designated-agent footer block.
   Replaced the original prominent rose-tinted card (the
   `.legal-contact` class shipped in B2) with a small, muted
   footer-style block per user direction: keep the §512(c)(2)
   required name/address/phone/email publicly accessible on the
   page, but de-emphasize visually. Sits at the end of
   /legal/dmca.html with #agent anchor so the in-page links to
   "Royall's Designated Agent" still resolve cleanly. */
body[data-theme="redesign"] .legal-shell .legal-agent-footer {
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 12px;
  line-height: 1.7;
  color: rgba(243, 238, 248, 0.42);
  letter-spacing: 0.005em;
}
body[data-theme="redesign"] .legal-shell .legal-agent-footer strong {
  color: rgba(243, 238, 248, 0.62);
  font-weight: 700;
}
body[data-theme="redesign"] .legal-shell .legal-agent-footer a {
  color: rgba(255, 180, 180, 0.6);
  border-bottom-color: rgba(255, 180, 180, 0.18);
}
body[data-theme="redesign"] .legal-shell .legal-agent-footer a:hover {
  color: rgba(255, 208, 208, 0.85);
  border-bottom-color: rgba(255, 180, 180, 0.36);
}
body[data-theme="redesign"] .legal-shell strong {
  color: #fff;
  font-weight: 800;
}
body[data-theme="redesign"] .legal-shell a {
  color: #ffb4b4;
  text-decoration: none;
  font-weight: 700;
  border-bottom: 1px solid rgba(255, 180, 180, 0.4);
  transition: color 0.15s, border-color 0.15s;
}
body[data-theme="redesign"] .legal-shell a:hover {
  color: #ffd0d0;
  border-bottom-color: rgba(255, 180, 180, 0.85);
}
body[data-theme="redesign"] .legal-shell .legal-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 180, 180, 0.32), transparent);
  margin: 48px 0 36px;
}

/* ============================================================
   Phase 8 — Buyer (lab) portal visual port

   Strategy mirrors Phase 5a (vault visual port). The company
   stylesheet at backend/company/css/style.css (1,234 lines)
   already uses CSS custom properties (--bg, --surface, --accent,
   etc.) so most of the 237 distinct classes can be re-skinned
   by remapping those variables under
   `body[data-theme="redesign"]`. The cascade does the rest.

   Targeted overrides on top for chrome that has hard-coded
   colors or layout (sidebar, top header, primary card, avatar
   dropdown, badges, tables).

   Pages covered:
   - company/dashboard.html (Likeness Marketplace catalog)
   - company/orders.html (order history list)
   - company/order-builder.html (bulk-license cart)
   - company/order-detail.html (single-order detail)

   What's NOT covered:
   - company/training-deals.html — LEGACY paused, skip.
   - js/chat-widget.js — separate render, deferred to cleanup.
   ============================================================ */

/* CSS variable remap — wine + rose palette mapped onto the
   tokens that the company stylesheet consumes. The !important
   matches the dark-mode override in company/css/style.css line
   54 so we win the cascade against html[data-theme="dark"]. */
body[data-theme="redesign"] {
  --bg: transparent !important;
  --surface: rgba(255,255,255,0.04) !important;
  --surface-2: rgba(255,255,255,0.06) !important;
  --surface-3: rgba(255,255,255,0.08) !important;
  --border: rgba(255,255,255,0.08) !important;
  --border-2: rgba(255,255,255,0.14) !important;

  --text: #fff !important;
  --text-2: rgba(243,238,248, 0.85) !important;
  --text-muted: rgba(243,238,248, 0.55) !important;

  --accent: #ffb4b4 !important;
  --accent-dim: #d18f8f !important;
  --accent-soft: rgba(255,180,180, 0.10) !important;
  --accent-glow: rgba(255,180,180, 0.18) !important;
  --accent-text: #3d1d1d !important;

  --green: #4ade80 !important;
  --amber: #fb923c !important;
  --red: #ef4444 !important;
  --blue: #38bdf8 !important;
  --purple: #ffb4b4 !important;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4) !important;
  --shadow-md: 0 8px 24px -8px rgba(0,0,0,0.55) !important;
  --shadow-lg: 0 20px 48px -16px rgba(0,0,0,0.6) !important;
  --shadow-xl: 0 32px 80px -24px rgba(0,0,0,0.65) !important;
}

/* The body background needs to be the foundation gradient; the
   var-remap above set --bg to transparent so the gradient
   underneath shows through. */
body[data-theme="redesign"].dash-body,
body[data-theme="redesign"] .dash-layout {
  background: transparent !important;
  min-height: 100vh;
}

/* ── Sidebar (left rail) ───────────────────────────────────── */
body[data-theme="redesign"] .sidebar {
  background: rgba(20, 12, 22, 0.7) !important;
  border-right: 1px solid rgba(255,255,255,0.06) !important;
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
}
body[data-theme="redesign"] .sidebar-logo img {
  filter: invert(1) brightness(1.05);
  opacity: 0.85;
}
body[data-theme="redesign"] .nav-item {
  color: rgba(243,238,248, 0.65) !important;
  background: transparent !important;
  border: none !important;
  border-radius: 12px !important;
  font-weight: 700;
  transition: all 0.15s;
}
body[data-theme="redesign"] .nav-item:hover {
  background: rgba(255,255,255,0.04) !important;
  color: #fff !important;
}
body[data-theme="redesign"] .nav-item.active {
  background: linear-gradient(135deg, rgba(255,180,180,0.18), rgba(141,76,76,0.12)) !important;
  color: #fff !important;
  box-shadow: 0 0 0 1px rgba(255,180,180,0.24) inset;
}
body[data-theme="redesign"] .nav-item i {
  width: 16px; height: 16px;
}
body[data-theme="redesign"] .nav-new-pill {
  background: linear-gradient(135deg, #ffb4b4 0%, #b47878 100%) !important;
  color: #3d1d1d !important;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.06em;
  padding: 2px 7px;
  border-radius: 999px;
}

/* ── Top header ────────────────────────────────────────────── */
body[data-theme="redesign"] .dash-header {
  background: rgba(20, 12, 22, 0.7) !important;
  border-bottom: 1px solid rgba(255,255,255,0.06) !important;
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  padding: 16px 28px !important;
}
body[data-theme="redesign"] .dash-header-title {
  font-size: 20px !important;
  font-weight: 800 !important;
  color: #fff !important;
  letter-spacing: -0.01em !important;
}

/* Avatar + dropdown */
body[data-theme="redesign"] .avatar-circle {
  background: linear-gradient(160deg, #ffb4b4 0%, #8d4c4c 100%) !important;
  color: #3d1d1d !important;
  font-weight: 900;
  box-shadow: 0 0 24px rgba(255,180,180, 0.32);
}
body[data-theme="redesign"] .avatar-circle:hover {
  box-shadow: 0 0 32px rgba(255,180,180, 0.5);
  transform: scale(1.04);
}
body[data-theme="redesign"] .avatar-dropdown {
  background: rgba(20, 12, 22, 0.95) !important;
  border: 1px solid rgba(255,255,255,0.1) !important;
  border-radius: 14px !important;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: 0 24px 60px -20px rgba(0,0,0,0.55) !important;
}
body[data-theme="redesign"] .avatar-dd-name { color: #fff !important; font-weight: 800; }
body[data-theme="redesign"] .avatar-dd-email { color: rgba(243,238,248, 0.6) !important; }
body[data-theme="redesign"] .avatar-dd-item {
  background: transparent !important;
  color: rgba(243,238,248, 0.85) !important;
  border-radius: 8px;
  font-weight: 700;
}
body[data-theme="redesign"] .avatar-dd-item:hover {
  background: rgba(255,255,255,0.06) !important;
  color: #fff !important;
}

/* ── Buttons ───────────────────────────────────────────────── */
body[data-theme="redesign"] .btn-primary {
  background: linear-gradient(135deg, #ffb4b4 0%, #b47878 100%) !important;
  color: #3d1d1d !important;
  font-weight: 800;
  border: none !important;
  box-shadow: 0 12px 32px -10px rgba(255,180,180,0.55);
}
body[data-theme="redesign"] .btn-primary:hover:not(:disabled) {
  box-shadow: 0 14px 38px -8px rgba(255,180,180,0.65);
  transform: translateY(-1px);
  background: linear-gradient(135deg, #ffd0d0 0%, #c69090 100%) !important;
}
body[data-theme="redesign"] .btn-ghost {
  background: rgba(255,255,255,0.04) !important;
  color: rgba(243,238,248, 0.85) !important;
  border: 1px solid rgba(255,255,255,0.1) !important;
  font-weight: 700;
}
body[data-theme="redesign"] .btn-ghost:hover:not(:disabled) {
  background: rgba(255,255,255,0.08) !important;
  color: #fff !important;
  border-color: rgba(255,255,255,0.18) !important;
}
body[data-theme="redesign"] .btn-danger {
  background: rgba(239,68,68,0.16) !important;
  border: 1px solid rgba(239,68,68,0.36) !important;
  color: #fca5a5 !important;
  font-weight: 700;
}
body[data-theme="redesign"] .btn-danger:hover:not(:disabled) {
  background: rgba(239,68,68,0.24) !important;
  color: #fecaca !important;
}

/* ── Cards / glass surfaces ───────────────────────────────── */
body[data-theme="redesign"] .card,
body[data-theme="redesign"] .deal-card,
body[data-theme="redesign"] .lk-card,
body[data-theme="redesign"] .pricing-card,
body[data-theme="redesign"] .request-card,
body[data-theme="redesign"] .order-card,
body[data-theme="redesign"] .stat-card,
body[data-theme="redesign"] .empty-state {
  background: rgba(255,255,255,0.04) !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  border-radius: 16px !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

/* Form inputs across the company portal */
body[data-theme="redesign"] .input,
body[data-theme="redesign"] input[type="text"],
body[data-theme="redesign"] input[type="email"],
body[data-theme="redesign"] input[type="number"],
body[data-theme="redesign"] input[type="search"],
body[data-theme="redesign"] input[type="tel"],
body[data-theme="redesign"] input[type="url"],
body[data-theme="redesign"] textarea,
body[data-theme="redesign"] select {
  background: rgba(0,0,0,0.32) !important;
  border: 1px solid rgba(255,255,255,0.1) !important;
  color: #fff !important;
  border-radius: 12px;
}
body[data-theme="redesign"] .input::placeholder,
body[data-theme="redesign"] textarea::placeholder,
body[data-theme="redesign"] input::placeholder {
  color: rgba(243,238,248, 0.4) !important;
}
body[data-theme="redesign"] .input:focus,
body[data-theme="redesign"] textarea:focus,
body[data-theme="redesign"] input:focus,
body[data-theme="redesign"] select:focus {
  outline: none;
  border-color: rgba(255,180,180, 0.55) !important;
  background: rgba(0,0,0,0.42) !important;
}

/* Dropdown selects need their option rows to be readable too */
body[data-theme="redesign"] select option {
  background: #1e1010;
  color: #fff;
}

/* ── Badges (deal status, pricing, deal-badge-active etc.) ──── */
body[data-theme="redesign"] .deal-badge {
  background: rgba(255,255,255,0.06) !important;
  border: 1px solid rgba(255,255,255,0.1) !important;
  color: rgba(243,238,248, 0.85) !important;
}
body[data-theme="redesign"] .deal-badge-active {
  background: rgba(74, 222, 128, 0.12) !important;
  border-color: rgba(74, 222, 128, 0.36) !important;
  color: #86efac !important;
}
body[data-theme="redesign"] .deal-badge-default {
  background: rgba(255, 180, 180, 0.10) !important;
  border-color: rgba(255, 180, 180, 0.32) !important;
  color: #ffd0d0 !important;
}

/* ── Hero / pipeline / stats blocks (analytics dashboard) ──── */
body[data-theme="redesign"] .an-hero-card,
body[data-theme="redesign"] .an-stat,
body[data-theme="redesign"] .an-pipeline {
  background: rgba(255,255,255,0.04) !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  border-radius: 16px !important;
  backdrop-filter: blur(20px);
}
body[data-theme="redesign"] .an-hero-label,
body[data-theme="redesign"] .an-stat-label,
body[data-theme="redesign"] .an-pipe-label,
body[data-theme="redesign"] .an-section-label {
  color: rgba(243,238,248, 0.55) !important;
}
body[data-theme="redesign"] .an-hero-value,
body[data-theme="redesign"] .an-stat-value,
body[data-theme="redesign"] .an-pipe-value {
  color: #fff !important;
}
body[data-theme="redesign"] .an-green { color: #86efac !important; }
body[data-theme="redesign"] .an-amber { color: #fdba74 !important; }
body[data-theme="redesign"] .an-red   { color: #fca5a5 !important; }
body[data-theme="redesign"] .an-hero-accent {
  background: linear-gradient(135deg, #ffd0d0 0%, #ffb4b4 50%, #8d4c4c 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ── Deal channel rows (legacy, low priority but commonly seen) ─ */
body[data-theme="redesign"] .deal-channel-item {
  background: rgba(0,0,0,0.24) !important;
  border: 1px solid rgba(255,255,255,0.06) !important;
  border-radius: 10px;
}
body[data-theme="redesign"] .deal-channel-link:hover {
  background: rgba(255,180,180, 0.06) !important;
}
body[data-theme="redesign"] .deal-channel-name { color: #fff !important; }
body[data-theme="redesign"] .deal-channel-url { color: rgba(243,238,248, 0.5) !important; }
body[data-theme="redesign"] .deal-channel-hours { color: rgba(255,180,180, 0.85) !important; }
body[data-theme="redesign"] .deal-avatar {
  background: linear-gradient(160deg, #ffb4b4 0%, #8d4c4c 100%) !important;
  color: #3d1d1d !important;
  font-weight: 900;
}
body[data-theme="redesign"] .deal-amount { color: #ffd0d0 !important; font-weight: 800; }

/* ── Tables (orders list) ──────────────────────────────────── */
body[data-theme="redesign"] table {
  background: transparent !important;
}
body[data-theme="redesign"] table th {
  background: rgba(255,255,255,0.04) !important;
  color: rgba(243,238,248, 0.6) !important;
  border-bottom: 1px solid rgba(255,255,255,0.08) !important;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
body[data-theme="redesign"] table td {
  border-bottom: 1px solid rgba(255,255,255,0.04) !important;
  color: rgba(243,238,248, 0.85) !important;
}
body[data-theme="redesign"] table tr:hover td {
  background: rgba(255,255,255,0.03) !important;
}

/* Display-class headlines */
body[data-theme="redesign"] .display-xl,
body[data-theme="redesign"] .display-lg,
body[data-theme="redesign"] .display-md {
  color: #fff !important;
}

/* Empty state messaging */
body[data-theme="redesign"] .empty-state {
  text-align: center;
  padding: 48px 32px !important;
}
body[data-theme="redesign"] .empty-state-title { color: #fff !important; }
body[data-theme="redesign"] .empty-state-sub { color: rgba(243,238,248, 0.6) !important; }

/* Anim entrance kept from production CSS — visible on first paint */
body[data-theme="redesign"] .anim {
  /* preserved — production CSS handles the actual animation */
}

/* ── Chat widget (Royall Concierge) overrides ───────────────
   chat-widget.js injects its own <style> tag with var(--accent,
   #D4AF37) fallbacks AND hardcoded rgba(212,175,55,...) gold
   shadows. The CSS-var fallbacks resolve to rose here, but the
   hardcoded shadows need explicit overrides. */
body[data-theme="redesign"] #rcw-btn {
  background: linear-gradient(160deg, #ffb4b4 0%, #8d4c4c 100%) !important;
  color: #3d1d1d !important;
  box-shadow: 0 8px 28px rgba(255,180,180, 0.45) !important;
}
body[data-theme="redesign"] #rcw-btn:hover {
  box-shadow: 0 10px 36px rgba(255,180,180, 0.55) !important;
}
body[data-theme="redesign"] #rcw-window {
  background: rgba(20, 12, 22, 0.92) !important;
  border: 1px solid rgba(255,255,255,0.1) !important;
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  box-shadow: 0 24px 60px -16px rgba(0,0,0,0.55) !important;
}
body[data-theme="redesign"] #rcw-header {
  background: linear-gradient(160deg, #ffb4b4 0%, #8d4c4c 100%) !important;
  color: #3d1d1d !important;
}
body[data-theme="redesign"] #rcw-title {
  color: #3d1d1d !important;
}
body[data-theme="redesign"] #rcw-subtitle {
  color: rgba(61, 29, 29, 0.75) !important;
}
body[data-theme="redesign"] #rcw-close {
  background: rgba(61, 29, 29, 0.18) !important;
  color: rgba(61, 29, 29, 0.85) !important;
}
body[data-theme="redesign"] #rcw-close:hover {
  background: rgba(61, 29, 29, 0.28) !important;
  color: #3d1d1d !important;
}
body[data-theme="redesign"] .rcw-mine .rcw-bubble {
  background: linear-gradient(135deg, #ffb4b4 0%, #b47878 100%) !important;
  color: #3d1d1d !important;
}
body[data-theme="redesign"] .rcw-theirs .rcw-bubble {
  background: rgba(255,255,255,0.06) !important;
  color: rgba(243,238,248, 0.9) !important;
  border-color: rgba(255,255,255,0.08) !important;
}
body[data-theme="redesign"] #rcw-input {
  background: rgba(0,0,0,0.32) !important;
  color: #fff !important;
  border-color: rgba(255,255,255,0.1) !important;
}
body[data-theme="redesign"] #rcw-input::placeholder {
  color: rgba(243,238,248, 0.4) !important;
}
body[data-theme="redesign"] #rcw-input:focus {
  border-color: rgba(255,180,180, 0.55) !important;
}

/* ============================================================
   Phase 10 — Admin redesign (LAST per Decision 7)

   Strategy mirrors Phase 8 (buyer portal): the admin stylesheet
   at backend/admin/css/style.css (805 lines, 78 classes) uses
   CSS custom properties from :root, so a variable remap +
   targeted chrome overrides under body[data-theme="redesign"]
   gives all 34 admin pages the wine + rose treatment without
   per-class rewrites.

   Admin's --accent was violet (#6c5ce7); --bg/--card/--surface
   were all light. The remap below flips them to the rose +
   wine palette, then targeted overrides handle the layout-
   specific chrome (sidebar, page-header, table, badges,
   modals, alerts, status pills).

   Pages covered: all 34 .html files under backend/admin/.

   Audit guard-rail: this is a paint-only port. The 4 admin JS
   files (api.js, sidebar.js, dialogs.js, changelog.js) and the
   805-line stylesheet stay byte-identical. No backend, no DB,
   no endpoint changes. Reversible per file.
   ============================================================ */

/* CSS variable remap — admin uses --card (not just --surface),
   --accent-hover (not --accent-dim), and --muted (not --text-muted).
   Match those names so the cascade works. !important wins against
   any future dark-mode addition. */
body[data-theme="redesign"] {
  /* These are also defined in the company-portal block above —
     redefining is idempotent but listing here for clarity since
     admin can be visited standalone (no company portal loaded). */
  --bg: transparent !important;
  --card: rgba(255,255,255,0.04) !important;
  --surface: rgba(255,255,255,0.04) !important;
  --surface-2: rgba(255,255,255,0.06) !important;
  --border: rgba(255,255,255,0.08) !important;
  --border-2: rgba(255,255,255,0.14) !important;

  --text: #fff !important;
  --text-2: rgba(243,238,248, 0.85) !important;
  --muted: rgba(243,238,248, 0.55) !important;

  --accent: #ffb4b4 !important;
  --accent-hover: #ffd0d0 !important;
  --accent-soft: rgba(255,180,180, 0.10) !important;

  --success: #4ade80 !important;
  --green: #4ade80 !important;
  --warning: #fb923c !important;
  --danger: #ef4444 !important;
  --red: #ef4444 !important;
}

/* ── Body + page surface ───────────────────────────────────── */
body[data-theme="redesign"].admin-body,
body[data-theme="redesign"] .main {
  background: transparent !important;
}

/* ── Sidebar ───────────────────────────────────────────────── */
/* Chrome rebuild Turn 6 (2026-05-05) — clear the fixed .brand-bar
   (96px high, z-index 90) so the sidebar logo isn't trapped behind
   it. The legacy admin/css/style.css sets `top: 0; height: 100vh`
   which made content slide under the brand-bar. We push the sidebar
   down 96px and shrink its height correspondingly. */
body[data-theme="redesign"] .sidebar {
  top: 96px !important;
  height: calc(100vh - 96px) !important;
  background: rgba(20, 12, 22, 0.7) !important;
  border-right: 1px solid rgba(255,255,255,0.06) !important;
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  color: rgba(243,238,248, 0.85) !important;
  z-index: 80;   /* under .brand-bar (z-index 90) so its mask falls correctly */
}

/* Same fix on the .main content surface — the legacy padding of 40px
   meant the page-header sat behind the brand-bar. Bump padding-top
   to 120px = 96px brand-bar + 24px breathing room.            */
body[data-theme="redesign"] .main {
  padding-top: 120px !important;
}
body[data-theme="redesign"] .sidebar-logo {
  color: #fff !important;
}
body[data-theme="redesign"] .sidebar-logo img {
  filter: invert(1) brightness(1.05);
  opacity: 0.85;
}
body[data-theme="redesign"] .sidebar-nav a,
body[data-theme="redesign"] .sidebar-nav button,
body[data-theme="redesign"] .sidebar-nav .nav-item {
  color: rgba(243,238,248, 0.65) !important;
  background: transparent !important;
  border-radius: 12px !important;
  font-weight: 700;
  transition: all 0.15s;
}
body[data-theme="redesign"] .sidebar-nav a:hover,
body[data-theme="redesign"] .sidebar-nav button:hover,
body[data-theme="redesign"] .sidebar-nav .nav-item:hover {
  background: rgba(255,255,255,0.04) !important;
  color: #fff !important;
}
body[data-theme="redesign"] .sidebar-nav a.active,
body[data-theme="redesign"] .sidebar-nav .nav-item.active {
  background: linear-gradient(135deg, rgba(255,180,180,0.18), rgba(141,76,76,0.12)) !important;
  color: #fff !important;
  box-shadow: 0 0 0 1px rgba(255,180,180,0.24) inset;
}
body[data-theme="redesign"] .sidebar-footer {
  border-top: 1px solid rgba(255,255,255,0.06) !important;
  color: rgba(243,238,248, 0.55) !important;
}

/* ── Page header ────────────────────────────────────────────── */
body[data-theme="redesign"] .page-header {
  border-bottom: 1px solid rgba(255,255,255,0.08) !important;
  padding: 24px 28px !important;
}
body[data-theme="redesign"] .page-header h1,
body[data-theme="redesign"] .page-header .page-title {
  color: #fff !important;
  font-weight: 800;
  letter-spacing: -0.01em;
}
body[data-theme="redesign"] .page-header p,
body[data-theme="redesign"] .page-header .page-sub {
  color: rgba(243,238,248, 0.65) !important;
}

/* ── Cards / glass surfaces ─────────────────────────────────── */
body[data-theme="redesign"] .card,
body[data-theme="redesign"] .stat-card,
body[data-theme="redesign"] .login-card {
  background: rgba(255,255,255,0.04) !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  border-radius: 16px !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: rgba(243,238,248, 0.85) !important;
}
body[data-theme="redesign"] .card-header {
  border-bottom: 1px solid rgba(255,255,255,0.08) !important;
  color: #fff !important;
}
body[data-theme="redesign"] .login-page {
  background: transparent !important;
}

/* ── Buttons ───────────────────────────────────────────────── */
body[data-theme="redesign"] .btn-primary,
body[data-theme="redesign"] .btn-accent {
  background: linear-gradient(135deg, #ffb4b4 0%, #b47878 100%) !important;
  color: #3d1d1d !important;
  border: none !important;
  font-weight: 800;
  box-shadow: 0 12px 32px -10px rgba(255,180,180,0.55);
}
body[data-theme="redesign"] .btn-primary:hover:not(:disabled),
body[data-theme="redesign"] .btn-accent:hover:not(:disabled) {
  background: linear-gradient(135deg, #ffd0d0 0%, #c69090 100%) !important;
  box-shadow: 0 14px 38px -8px rgba(255,180,180,0.65);
  transform: translateY(-1px);
}
body[data-theme="redesign"] .btn-secondary,
body[data-theme="redesign"] .btn-ghost {
  background: rgba(255,255,255,0.04) !important;
  color: rgba(243,238,248, 0.85) !important;
  border: 1px solid rgba(255,255,255,0.1) !important;
  font-weight: 700;
}
body[data-theme="redesign"] .btn-secondary:hover:not(:disabled),
body[data-theme="redesign"] .btn-ghost:hover:not(:disabled) {
  background: rgba(255,255,255,0.08) !important;
  color: #fff !important;
  border-color: rgba(255,255,255,0.18) !important;
}
body[data-theme="redesign"] .btn-danger {
  background: rgba(239,68,68,0.16) !important;
  border: 1px solid rgba(239,68,68,0.36) !important;
  color: #fca5a5 !important;
  font-weight: 700;
}
body[data-theme="redesign"] .btn-danger:hover:not(:disabled) {
  background: rgba(239,68,68,0.24) !important;
  color: #fecaca !important;
}

/* ── Forms ─────────────────────────────────────────────────── */
body[data-theme="redesign"] .form-input,
body[data-theme="redesign"] .form-select,
body[data-theme="redesign"] .form-textarea,
body[data-theme="redesign"] .search-input {
  background: rgba(0,0,0,0.32) !important;
  border: 1px solid rgba(255,255,255,0.1) !important;
  color: #fff !important;
  border-radius: 12px;
}
body[data-theme="redesign"] .form-input::placeholder,
body[data-theme="redesign"] .form-textarea::placeholder,
body[data-theme="redesign"] .search-input::placeholder {
  color: rgba(243,238,248, 0.4) !important;
}
body[data-theme="redesign"] .form-input:focus,
body[data-theme="redesign"] .form-select:focus,
body[data-theme="redesign"] .form-textarea:focus,
body[data-theme="redesign"] .search-input:focus {
  outline: none;
  border-color: rgba(255,180,180, 0.55) !important;
  background: rgba(0,0,0,0.42) !important;
}
body[data-theme="redesign"] .form-select option {
  background: #1e1010;
  color: #fff;
}
body[data-theme="redesign"] .form-group label,
body[data-theme="redesign"] .form-row label {
  color: rgba(243,238,248, 0.62) !important;
  font-weight: 800;
  letter-spacing: 0.04em;
}
body[data-theme="redesign"] .form-error {
  color: #fca5a5 !important;
}
body[data-theme="redesign"] .form-check {
  color: rgba(243,238,248, 0.85) !important;
}

/* ── Tables ────────────────────────────────────────────────── */
body[data-theme="redesign"] .table-wrap {
  background: rgba(255,255,255,0.04) !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  border-radius: 16px !important;
  backdrop-filter: blur(20px);
  overflow: hidden;
}
body[data-theme="redesign"] .table {
  background: transparent !important;
  color: rgba(243,238,248, 0.85) !important;
}
body[data-theme="redesign"] .table thead th {
  background: rgba(255,255,255,0.04) !important;
  color: rgba(243,238,248, 0.6) !important;
  border-bottom: 1px solid rgba(255,255,255,0.08) !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase !important;
}
body[data-theme="redesign"] .table tbody td {
  border-bottom: 1px solid rgba(255,255,255,0.04) !important;
  color: rgba(243,238,248, 0.85) !important;
}
body[data-theme="redesign"] .table tbody tr:hover td {
  background: rgba(255,255,255,0.03) !important;
}
body[data-theme="redesign"] .table a {
  color: #ffd0d0 !important;
  text-decoration: none;
  font-weight: 700;
}
body[data-theme="redesign"] .table a:hover {
  color: #fff !important;
  text-decoration: underline;
}

/* ── Badges (status pills) ─────────────────────────────────── */
body[data-theme="redesign"] .badge,
body[data-theme="redesign"] .status-badge {
  background: rgba(255,255,255,0.06) !important;
  border: 1px solid rgba(255,255,255,0.1) !important;
  color: rgba(243,238,248, 0.85) !important;
}
body[data-theme="redesign"] .badge-accent {
  background: rgba(255,180,180, 0.10) !important;
  border-color: rgba(255,180,180, 0.32) !important;
  color: #ffd0d0 !important;
}
body[data-theme="redesign"] .badge-success {
  background: rgba(74, 222, 128, 0.12) !important;
  border-color: rgba(74, 222, 128, 0.36) !important;
  color: #86efac !important;
}
body[data-theme="redesign"] .badge-warning {
  background: rgba(251, 146, 60, 0.12) !important;
  border-color: rgba(251, 146, 60, 0.36) !important;
  color: #fdba74 !important;
}
body[data-theme="redesign"] .badge-danger {
  background: rgba(239, 68, 68, 0.16) !important;
  border-color: rgba(239, 68, 68, 0.36) !important;
  color: #fca5a5 !important;
}
body[data-theme="redesign"] .badge-muted {
  background: rgba(255,255,255,0.04) !important;
  border-color: rgba(255,255,255,0.08) !important;
  color: rgba(243,238,248, 0.5) !important;
}
body[data-theme="redesign"] .consent-badge {
  background: rgba(255,180,180, 0.08) !important;
  border: 1px solid rgba(255,180,180, 0.24) !important;
  color: #ffd0d0 !important;
}

/* ── Alerts ────────────────────────────────────────────────── */
body[data-theme="redesign"] .alert {
  background: rgba(255,255,255,0.04) !important;
  border: 1px solid rgba(255,255,255,0.1) !important;
  color: rgba(243,238,248, 0.85) !important;
  border-radius: 12px;
}
body[data-theme="redesign"] .alert-success {
  background: rgba(74, 222, 128, 0.06) !important;
  border-color: rgba(74, 222, 128, 0.32) !important;
  color: #86efac !important;
}
body[data-theme="redesign"] .alert-warning {
  background: rgba(251, 146, 60, 0.06) !important;
  border-color: rgba(251, 146, 60, 0.32) !important;
  color: #fdba74 !important;
}
body[data-theme="redesign"] .alert-danger {
  background: rgba(239, 68, 68, 0.06) !important;
  border-color: rgba(239, 68, 68, 0.32) !important;
  color: #fca5a5 !important;
}

/* ── Modals (admin uses .modal-overlay / .modal / .modal-header / .modal-footer) ─ */
body[data-theme="redesign"] .modal-overlay {
  background:
    radial-gradient(800px 600px at 50% 50%, rgba(140, 60, 70, 0.28), transparent 65%),
    rgba(8, 6, 14, 0.72) !important;
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
}
body[data-theme="redesign"] .modal {
  background: rgba(255,255,255,0.05) !important;
  border: 1px solid rgba(255,255,255,0.1) !important;
  border-radius: 22px !important;
  color: rgba(243,238,248, 0.85) !important;
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  box-shadow: 0 32px 80px -24px rgba(0,0,0,0.55) !important;
}
body[data-theme="redesign"] .modal-header {
  border-bottom: 1px solid rgba(255,255,255,0.06) !important;
  color: #fff !important;
}
body[data-theme="redesign"] .modal-footer {
  border-top: 1px solid rgba(255,255,255,0.06) !important;
}

/* ── Stat grid (dashboard tiles) ───────────────────────────── */
body[data-theme="redesign"] .stat-grid { gap: 14px; }
body[data-theme="redesign"] .stat-card .stat-label,
body[data-theme="redesign"] .stat-card .label {
  color: rgba(243,238,248, 0.55) !important;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
body[data-theme="redesign"] .stat-card .stat-value,
body[data-theme="redesign"] .stat-card .value {
  color: #fff !important;
  font-weight: 900;
  letter-spacing: -0.02em;
}

/* ── Toasts ────────────────────────────────────────────────── */
body[data-theme="redesign"] .toast {
  background: rgba(20,12,18, 0.95) !important;
  border: 1px solid rgba(255,255,255,0.1) !important;
  color: #fff !important;
  border-radius: 12px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

/* ── Filter bar / search wrap / pagination ─────────────────── */
body[data-theme="redesign"] .filter-bar {
  background: rgba(255,255,255,0.04) !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  border-radius: 14px !important;
  backdrop-filter: blur(20px);
}
body[data-theme="redesign"] .search-wrap {
  background: rgba(0,0,0,0.32) !important;
  border: 1px solid rgba(255,255,255,0.1) !important;
  border-radius: 12px;
}
body[data-theme="redesign"] .search-wrap:focus-within {
  border-color: rgba(255,180,180, 0.55) !important;
}
body[data-theme="redesign"] .pagination {
  color: rgba(243,238,248, 0.7) !important;
}
body[data-theme="redesign"] .pagination button,
body[data-theme="redesign"] .pagination a {
  background: rgba(255,255,255,0.04) !important;
  border: 1px solid rgba(255,255,255,0.1) !important;
  color: rgba(243,238,248, 0.85) !important;
}
body[data-theme="redesign"] .pagination .active,
body[data-theme="redesign"] .pagination button.active {
  background: linear-gradient(135deg, #ffb4b4 0%, #b47878 100%) !important;
  color: #3d1d1d !important;
  border-color: transparent !important;
}

/* Empty/loading states */
body[data-theme="redesign"] .empty-state,
body[data-theme="redesign"] .loading-state {
  color: rgba(243,238,248, 0.55) !important;
  background: rgba(255,255,255,0.02) !important;
  border: 1px dashed rgba(255,255,255,0.12) !important;
  border-radius: 14px;
}

/* Spinner color */
body[data-theme="redesign"] .spinner {
  border-top-color: #ffb4b4 !important;
}

/* Utility text classes */
body[data-theme="redesign"] .text-muted { color: rgba(243,238,248, 0.55) !important; }
body[data-theme="redesign"] .text-accent { color: #ffd0d0 !important; }
body[data-theme="redesign"] .text-success { color: #86efac !important; }
body[data-theme="redesign"] .text-danger  { color: #fca5a5 !important; }

/* Generic links inside admin content (not navigation) */
body[data-theme="redesign"] .main a:not(.btn):not(.sidebar-nav a):not(.nav-item):not(.btn-primary):not(.btn-secondary):not(.btn-ghost):not(.btn-accent):not(.btn-danger) {
  color: #ffd0d0;
  text-decoration: none;
  font-weight: 600;
}
body[data-theme="redesign"] .main a:not(.btn):not(.sidebar-nav a):not(.nav-item):hover {
  color: #fff;
  text-decoration: underline;
}

/* ============================================================
   Vault overview leaf — hero + stats + assets + activity
   (Chrome rebuild Turn 3, sub-turn 1)

   Lifted from backend/creator/redesign/vault.html's inline
   <style> block; scoped under body[data-theme="redesign"] for
   the prod gate. Matches the mockup exactly per the user's
   directive "exactly how the mockup is built."
   ============================================================ */

/* ── Hero ─────────────────────────────────────────────────── */
body[data-theme="redesign"] .hero {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 36px;
  align-items: center;
  padding: 44px 48px;
  border-radius: 28px;
  background:
    radial-gradient(180px 220px at 100px 50%, rgba(255,180,180,0.32), transparent 70%),
    rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
}
body[data-theme="redesign"] .portrait {
  position: relative;
  width: 200px; height: 200px;
  border-radius: 50%;
  background: linear-gradient(160deg, #ffb4b4 0%, #8d4c4c 100%);
  overflow: hidden;
  box-shadow: 0 0 80px rgba(255,180,180,0.45),
              inset 0 0 40px rgba(255,255,255,0.18);
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.92);
}
body[data-theme="redesign"] .portrait::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 25%, rgba(255,255,255,0.32), transparent 50%);
  pointer-events: none;
}

/* Real headshot: <img> that fills the orb. The wrapper still owns the
   rose glow (box-shadow), the inner highlight (::after), and the rose
   gradient is used as a soft tint via mix-blend so the brand color
   reaches the edges of the photo without obliterating the face. */
body[data-theme="redesign"] .portrait-photo {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 50%;
  z-index: 0;
}
/* When a headshot is present, swap the inner highlight for a rose ring
   + soft rose wash blended over the photo. Keeps the wine + rose
   identity on top of the actual portrait. */
body[data-theme="redesign"] .portrait.has-headshot::after {
  background:
    radial-gradient(circle at 30% 25%, rgba(255,255,255,0.18), transparent 55%),
    linear-gradient(160deg, rgba(255,180,180,0.18) 0%, rgba(141,76,76,0.04) 100%);
  mix-blend-mode: screen;
  z-index: 1;
}
/* Rose ring around the headshot edge so the brand color stays visible
   even when the photo is dark. */
body[data-theme="redesign"] .portrait.has-headshot {
  box-shadow:
    0 0 80px rgba(255,180,180,0.45),
    inset 0 0 0 3px rgba(255,180,180,0.45),
    inset 0 0 24px rgba(255,180,180,0.20);
}
/* Q2 — initials shown today; future swap-in: <video class="portrait-video"> */
body[data-theme="redesign"] .portrait-initials {
  font-size: 72px; font-weight: 900; letter-spacing: -0.04em;
  position: relative; z-index: 1;
}
body[data-theme="redesign"] .portrait-video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
body[data-theme="redesign"] .hero-meta {
  display: flex; flex-direction: column; gap: 14px;
}
body[data-theme="redesign"] .hero-name {
  font-size: 36px; font-weight: 900; letter-spacing: -0.02em;
  color: #fff;
}
body[data-theme="redesign"] .hero-status {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px;
  background: rgba(34, 197, 94, 0.16);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: #86efac;
  border-radius: 999px;
  font-size: 12px; font-weight: 700;
  width: fit-content;
}
body[data-theme="redesign"] .hero-status .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 8px rgba(74,222,128,0.6);
}
/* State variants for the hero status pill — JS sets these classes
   on #lk-vault-status. Keeps the legacy state class names so JS
   doesn't need to learn new vocabulary. */
body[data-theme="redesign"] .hero-status.state-setup {
  background: rgba(234,88,12, 0.16);
  border-color: rgba(234,88,12, 0.32);
  color: #fdba74;
}
body[data-theme="redesign"] .hero-status.state-setup .dot { background: #fb923c; box-shadow: 0 0 8px rgba(251,146,60,0.6); }
body[data-theme="redesign"] .hero-status.state-review {
  background: rgba(255,180,180, 0.12);
  border-color: rgba(255,180,180, 0.36);
  color: #ffd0d0;
}
body[data-theme="redesign"] .hero-status.state-review .dot { background: #ffb4b4; box-shadow: 0 0 8px rgba(255,180,180,0.6); }
body[data-theme="redesign"] .hero-status.state-capturing {
  background: rgba(234,179,8, 0.14);
  border-color: rgba(234,179,8, 0.32);
  color: #fde68a;
}
body[data-theme="redesign"] .hero-status.state-capturing .dot { background: #eab308; box-shadow: 0 0 8px rgba(234,179,8,0.6); }
/* Phase V — tier-unlocked hero pills. JS maps the highest tier_reached
   across all kinds to these states (rose / plum / amber, mirroring the
   studio's tier dots). When set, they replace the generic state-live /
   state-unlocked pill so the dashboard reflects the same milestone the
   creator just hit in the studio. */
body[data-theme="redesign"] .hero-status.state-tier-1 {
  background: rgba(255,180,180, 0.16);
  border-color: rgba(255,180,180, 0.42);
  color: #ffd0d0;
}
body[data-theme="redesign"] .hero-status.state-tier-1 .dot { background: #ffb4b4; box-shadow: 0 0 10px rgba(255,180,180,0.7); }
body[data-theme="redesign"] .hero-status.state-tier-2 {
  background: rgba(216,180,255, 0.14);
  border-color: rgba(216,180,255, 0.4);
  color: #e6cdff;
}
body[data-theme="redesign"] .hero-status.state-tier-2 .dot { background: #d8b4ff; box-shadow: 0 0 10px rgba(216,180,255,0.65); }
body[data-theme="redesign"] .hero-status.state-tier-3 {
  background: rgba(255,212,158, 0.16);
  border-color: rgba(255,212,158, 0.42);
  color: #ffe2bd;
}
body[data-theme="redesign"] .hero-status.state-tier-3 .dot { background: #ffd49e; box-shadow: 0 0 10px rgba(255,212,158,0.7); }
/* state-unlocked + state-live use the default green styling above */

/* Tier chip used on asset-summary cards (Phase V). Same palette as the
   studio's tier dots, made pill-sized for the card's metadata row. */
body[data-theme="redesign"] .lk-tier-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
  white-space: nowrap;
}
body[data-theme="redesign"] .lk-tier-chip .lk-tier-dot {
  width: 6px; height: 6px; border-radius: 50%;
}
/* Tier accent palette (2026-05-18) — coral / magenta / violet.
   Replaces the prior rose / plum / amber scheme. T1 reads warm,
   T2 reads pink, T3 reads cool — the trio cleanly progresses on
   the spectrum so creators can tell tiers apart at a glance.
   Mirrored across every tier-marked surface: chips, ring fills,
   roadmap cards, legend dots, prompt-list dots, wizard rows. */
body[data-theme="redesign"] .lk-tier-chip[data-tier="1"] {
  background: rgba(255,138,122, 0.16);
  border-color: rgba(255,138,122, 0.42);
  color: #ffcabf;
}
body[data-theme="redesign"] .lk-tier-chip[data-tier="1"] .lk-tier-dot { background: #ff8a7a; box-shadow: 0 0 6px rgba(255,138,122,0.55); }
body[data-theme="redesign"] .lk-tier-chip[data-tier="2"] {
  background: rgba(255,95,168, 0.14);
  border-color: rgba(255,95,168, 0.4);
  color: #ffc6dd;
}
body[data-theme="redesign"] .lk-tier-chip[data-tier="2"] .lk-tier-dot { background: #ff5fa8; box-shadow: 0 0 6px rgba(255,95,168,0.5); }
body[data-theme="redesign"] .lk-tier-chip[data-tier="3"] {
  background: rgba(200,122,255, 0.16);
  border-color: rgba(200,122,255, 0.42);
  color: #e8caff;
}
body[data-theme="redesign"] .lk-tier-chip[data-tier="3"] .lk-tier-dot { background: #c87aff; box-shadow: 0 0 6px rgba(200,122,255,0.55); }
body[data-theme="redesign"] .lk-asset-tier-row {
  display: flex;
  margin: 6px 0 4px;
}
body[data-theme="redesign"] .hero-line {
  font-size: 15px; line-height: 1.55;
  color: rgba(243,238,248, 0.72);
  max-width: 460px;
  margin: 0;
}

/* ── Stats grid ───────────────────────────────────────────── */
body[data-theme="redesign"] .stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 28px;
}
body[data-theme="redesign"] .stat {
  padding: 20px 22px;
  border-radius: 18px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  transition: background 0.15s;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  color: inherit;
}
body[data-theme="redesign"] .stat:hover { background: rgba(255,255,255,0.06); }
body[data-theme="redesign"] .stat.accent {
  background: rgba(255,180,180,0.12);
  border-color: rgba(255,180,180,0.22);
}
body[data-theme="redesign"] .stat-label {
  font-size: 10px; font-weight: 800;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: rgba(243,238,248, 0.5);
  margin-bottom: 12px;
}
body[data-theme="redesign"] .stat-value {
  font-size: 36px; font-weight: 900;
  color: #fff; letter-spacing: -0.02em;
  line-height: 1;
}
body[data-theme="redesign"] .stat-sub {
  font-size: 12px; color: rgba(243,238,248, 0.55);
  margin-top: 8px;
}

/* ── Section labels (Your assets / Recent activity etc.) ───── */
body[data-theme="redesign"] .section-label {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 14px;
  margin-top: 28px;
}
body[data-theme="redesign"] .section-title {
  font-size: 18px; font-weight: 800; letter-spacing: -0.01em;
  color: #fff;
}
body[data-theme="redesign"] .section-link {
  font-size: 13px; font-weight: 700;
  color: #ffb4b4;
  text-decoration: none;
}
body[data-theme="redesign"] .section-link:hover { color: #ffd0d0; }

/* ── Asset summary cards (overview leaf only) ──────────────── */
body[data-theme="redesign"] .assets {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
body[data-theme="redesign"] .asset {
  position: relative;
  padding: 24px;
  border-radius: 18px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  cursor: pointer;
  transition: transform 0.15s, background 0.15s, border-color 0.15s;
  text-decoration: none;
  color: inherit;
  display: block;
  /* Used as both <a> and <button> (empty-state capture trigger) — make
     sure button defaults don't leak through. */
  font: inherit;
  text-align: left;
  width: 100%;
}
body[data-theme="redesign"] .asset:hover {
  transform: translateY(-2px);
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,180,180,0.28);
}
body[data-theme="redesign"] .asset.empty {
  border-style: dashed;
  text-align: center;
  color: rgba(243,238,248, 0.55);
  display: flex; align-items: center; justify-content: center;
  min-height: 140px;
  font-weight: 700;
}
body[data-theme="redesign"] .asset-kind {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 10px; font-weight: 800;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: rgba(243,238,248, 0.55);
  margin-bottom: 14px;
}
body[data-theme="redesign"] .asset-name {
  font-size: 18px; font-weight: 800; letter-spacing: -0.01em;
  color: #fff; margin-bottom: 8px;
}
body[data-theme="redesign"] .asset-meta {
  display: flex; gap: 14px; align-items: center;
  font-size: 12px; color: rgba(243,238,248, 0.6);
  margin-bottom: 14px;
}
body[data-theme="redesign"] .asset .badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 10px; font-weight: 800;
  letter-spacing: 0.05em; text-transform: uppercase;
}
body[data-theme="redesign"] .asset .badge.premium {
  background: linear-gradient(135deg, #ffb4b4 0%, #ffd0d0 100%);
  color: #3d1d1d;
}
body[data-theme="redesign"] .asset .badge.standard {
  background: rgba(255,255,255,0.1);
  color: rgba(243,238,248, 0.85);
}
body[data-theme="redesign"] .asset .badge.in-review {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  border: 1px solid rgba(245,158,11, 0.3);
}
body[data-theme="redesign"] .asset-stats {
  display: flex; justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
body[data-theme="redesign"] .asset-stat {
  display: flex; flex-direction: column; gap: 2px;
}
body[data-theme="redesign"] .asset-stat-label {
  font-size: 9px; font-weight: 800;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: rgba(243,238,248, 0.45);
}
body[data-theme="redesign"] .asset-stat-value {
  font-size: 15px; font-weight: 800;
  color: #fff;
}

/* ── Activity feed (mockup row format) ─────────────────────── */
body[data-theme="redesign"] .activity {
  display: flex; flex-direction: column;
  padding: 8px 0;
  border-radius: 18px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
}
body[data-theme="redesign"] .activity-row {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px 22px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
body[data-theme="redesign"] .activity-row:last-child { border-bottom: none; }
body[data-theme="redesign"] .activity-icon {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,180,180,0.16);
  display: flex; align-items: center; justify-content: center;
  color: #ffb4b4;
}
body[data-theme="redesign"] .activity-icon.green {
  background: rgba(74, 222, 128, 0.16);
  color: #4ade80;
}
body[data-theme="redesign"] .activity-icon.amber {
  background: rgba(245, 158, 11, 0.16);
  color: #fbbf24;
}
body[data-theme="redesign"] .activity-icon svg { width: 16px; height: 16px; }
body[data-theme="redesign"] .activity-title { font-size: 14px; font-weight: 700; color: #fff; }
body[data-theme="redesign"] .activity-sub { font-size: 12px; color: rgba(243,238,248, 0.55); margin-top: 2px; }
body[data-theme="redesign"] .activity-time { font-size: 11px; color: rgba(243,238,248, 0.42); }

/* Activity empty state (no rows yet) */
body[data-theme="redesign"] .activity-empty {
  padding: 40px 22px;
  text-align: center;
  font-size: 13px;
  color: rgba(243,238,248, 0.5);
}

/* Responsive collapse for narrow viewports */
@media (max-width: 980px) {
  body[data-theme="redesign"] .hero { grid-template-columns: 1fr; padding: 32px 28px; }
  body[data-theme="redesign"] .stats { grid-template-columns: repeat(2, 1fr); }
  body[data-theme="redesign"] .assets { grid-template-columns: 1fr; }
}

/* ────────────────────────────────────────────────────────────────────
   RADAR LEAF tokens
   Mirrors backend/creator/redesign/vault-radar.html. The radar surface
   has three building blocks: scope-card (live status + headline + meta
   row), stack (platform bar list), matches (match-row list). Each is
   a card; the first two share a 1.3fr/1fr grid (.radar-hero).
   See docs/architecture/REDESIGN-CHROME-REBUILD-2026-05-04.md for the
   per-page rebuild context.
   ──────────────────────────────────────────────────────────────────── */

body[data-theme="redesign"] .radar-hero {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

/* Scope card — leftmost of the radar-hero row.
   Pulse-dot + status uppercase + h1 headline + sub + 3-cell meta. */
body[data-theme="redesign"] .scope-card {
  padding: 28px 28px 24px;
}
body[data-theme="redesign"] .scope-title {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 4px;
}
body[data-theme="redesign"] .scope-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: linear-gradient(160deg, #ffb4b4 0%, #8d4c4c 100%);
  box-shadow: 0 0 16px rgba(255,180,180,0.55);
  animation: scope-pulse 2s ease-in-out infinite;
}
@keyframes scope-pulse {
  0%, 100% { box-shadow: 0 0 16px rgba(255,180,180,0.4); }
  50%      { box-shadow: 0 0 28px rgba(255,180,180,0.7); }
}
body[data-theme="redesign"] .scope-status {
  font-size: 11px; font-weight: 800;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: #ffb4b4;
}
body[data-theme="redesign"] .scope-headline {
  font-size: 32px; font-weight: 900;
  letter-spacing: -0.025em;
  color: #fff;
  margin: 8px 0 14px;
  line-height: 1.1;
}
body[data-theme="redesign"] .scope-sub {
  font-size: 14px;
  color: rgba(243,238,248, 0.7);
  line-height: 1.55;
  margin: 0 0 24px;
}
body[data-theme="redesign"] .scope-meta {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
  padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
body[data-theme="redesign"] .scope-meta-cell .label {
  font-size: 10px; font-weight: 800;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: rgba(243,238,248, 0.5);
  margin-bottom: 4px;
}
body[data-theme="redesign"] .scope-meta-cell .value {
  font-size: 16px; font-weight: 800; color: #fff;
  letter-spacing: -0.01em;
}

/* Stack card — rightmost of radar-hero. Per-platform bar list.
   Populated by renderRadarStack() from scan_stats.by_seed. */
body[data-theme="redesign"] .stack {
  padding: 24px 24px 22px;
  display: flex; flex-direction: column; gap: 14px;
}
body[data-theme="redesign"] .stack h3 {
  margin: 0; font-size: 14px; font-weight: 800; color: #fff;
  letter-spacing: -0.005em;
}
body[data-theme="redesign"] .stack-row {
  display: flex; gap: 12px; align-items: center;
  padding: 10px 12px;
  background: rgba(0,0,0,0.2);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
}
body[data-theme="redesign"] .stack-row .name {
  font-size: 13px; font-weight: 700; color: #fff; flex: 1;
}
body[data-theme="redesign"] .stack-row .count {
  font-variant-numeric: tabular-nums;
  font-size: 13px; font-weight: 800;
  color: rgba(243,238,248, 0.85);
}
body[data-theme="redesign"] .stack-bar {
  flex: 1.2;
  height: 4px;
  background: rgba(255,255,255,0.08);
  border-radius: 999px;
  overflow: hidden;
}
body[data-theme="redesign"] .stack-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #ffb4b4 0%, #b47878 100%);
  border-radius: 999px;
}
body[data-theme="redesign"] .stack-empty {
  font-size: 12px;
  color: rgba(243,238,248, 0.5);
  padding: 8px 4px 0;
}

/* Matches card — full-width row list under the radar-hero.
   .match-head holds the heading + filter <select>. Each .match-row is
   a 4-col grid (thumb / meta / conf / actions). */
body[data-theme="redesign"] .matches { padding: 0; }
body[data-theme="redesign"] .match-head {
  padding: 22px 24px 16px;
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}
body[data-theme="redesign"] .match-head h2 {
  font-size: 18px; font-weight: 800; color: #fff;
  letter-spacing: -0.005em;
  margin: 0;
}
body[data-theme="redesign"] .match-list { display: flex; flex-direction: column; }
body[data-theme="redesign"] .match-row {
  display: grid;
  grid-template-columns: 56px 1fr auto auto;
  gap: 16px;
  align-items: center;
  padding: 16px 24px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
body[data-theme="redesign"] .match-thumb {
  width: 56px; height: 56px;
  border-radius: 12px;
  background: rgba(0,0,0,0.42);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800;
  color: rgba(243,238,248, 0.6);
  letter-spacing: 0.04em;
  position: relative;
  overflow: hidden;
  border: 0;
  cursor: pointer;
  text-decoration: none;
}
body[data-theme="redesign"] .match-thumb img {
  width: 100%; height: 100%; object-fit: cover;
}
body[data-theme="redesign"] .match-thumb.audio {
  background:
    repeating-linear-gradient(90deg, rgba(255,180,180,0.4) 0 2px, transparent 2px 6px),
    rgba(0,0,0,0.42);
}
body[data-theme="redesign"] .match-thumb.face {
  background: linear-gradient(160deg, #855fa8 0%, #4a3264 100%);
  color: #fff;
}
body[data-theme="redesign"] .match-thumb.text {
  background: rgba(255,180,180,0.1);
  color: #ffd0d0;
}
body[data-theme="redesign"] .match-meta { min-width: 0; }
body[data-theme="redesign"] .match-title {
  font-size: 14px; font-weight: 800; color: #fff;
  letter-spacing: -0.005em;
  white-space: nowrap; text-overflow: ellipsis; overflow: hidden;
}
body[data-theme="redesign"] .match-source {
  font-size: 11px;
  color: rgba(243,238,248, 0.55);
  margin-top: 4px;
  display: flex; gap: 8px; align-items: center;
  flex-wrap: wrap;
}
body[data-theme="redesign"] .match-source a {
  color: inherit;
  text-decoration: none;
}
body[data-theme="redesign"] .match-source a:hover { color: #fff; }
body[data-theme="redesign"] .source-dot { color: rgba(243,238,248, 0.3); }

/* R10.5 — language pill in match-source row.
   Small monospace 2-letter code (HU, EN, ES, etc.) so creators can
   spot obviously-wrong-language hits at a glance.  Informational
   only; not a filter. */
body[data-theme="redesign"] .match-lang-pill {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(255,255,255, 0.08);
  border: 1px solid rgba(255,255,255, 0.12);
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: rgba(243,238,248, 0.65);
  vertical-align: middle;
}

/* Mode E (2026-05-13) — cross-creator graph correlation chip.
   Surfaces in the match-source row when 2+ Royall creators are
   matched on the same URL. Amber tint sets it apart from the
   normal-cadence rose chips — this is a "look here first"
   triage signal, not a routine status. */
body[data-theme="redesign"] .match-co-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: linear-gradient(135deg,
              rgba(255, 175, 95, 0.16),
              rgba(255, 175, 95, 0.06));
  border: 1px solid rgba(255, 175, 95, 0.36);
  color: #ffd9a8;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
  vertical-align: middle;
}
body[data-theme="redesign"] .match-co-chip svg {
  width: 10px; height: 10px;
  stroke-width: 2.4;
}

/* Audit #18 closer — "auto" chip on Radar inbox rows where
   Royall auto-dispatched the takedown (dispatch_method ==
   'email_auto'). Rose tint matches the Royall accent — rose for
   auto means "system did this," consistent with the same badge
   on /admin/takedowns.html (#11). Same shape as .match-co-chip
   so the two chips align visually when both render on a row. */
body[data-theme="redesign"] .match-auto-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: linear-gradient(135deg,
              rgba(255, 180, 180, 0.18),
              rgba(255, 180, 180, 0.06));
  border: 1px solid rgba(255, 180, 180, 0.36);
  color: #ffb4b4;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  vertical-align: middle;
}
body[data-theme="redesign"] .match-auto-chip svg {
  width: 10px; height: 10px;
  stroke-width: 2.4;
}
body[data-theme="redesign"] .match-conf {
  font-size: 11px; font-weight: 800;
  padding: 4px 10px; border-radius: 999px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
body[data-theme="redesign"] .match-conf.high {
  background: rgba(255, 120, 130, 0.14);
  color: #ffbac1;
  border: 1px solid rgba(255, 120, 130, 0.24);
}
body[data-theme="redesign"] .match-conf.med {
  background: rgba(255, 200, 100, 0.14);
  color: #ffd49e;
  border: 1px solid rgba(255, 200, 100, 0.24);
}
body[data-theme="redesign"] .match-conf.low {
  background: rgba(120, 220, 180, 0.14);
  color: #a8efce;
  border: 1px solid rgba(120, 220, 180, 0.24);
}
body[data-theme="redesign"] .match-actions {
  display: flex; gap: 6px;
  align-items: center;
}

/* Filter <select> in .match-head — Q-R4 retired the chip strip. */
body[data-theme="redesign"] .match-filter {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px;
  color: rgba(243,238,248, 0.6);
}
body[data-theme="redesign"] .match-filter select {
  font: inherit;
  background: rgba(0,0,0,0.32);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  color: #fff;
  padding: 6px 10px;
  cursor: pointer;
}
body[data-theme="redesign"] .match-filter select:hover {
  border-color: rgba(255,255,255,0.2);
}

/* "Nothing to review" empty state inside .matches */
body[data-theme="redesign"] .match-empty {
  padding: 56px 28px;
  text-align: center;
  color: rgba(243,238,248, 0.55);
  font-size: 13px;
}
body[data-theme="redesign"] .match-empty-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: rgba(255, 180, 180, 0.12);
  color: #ffb4b4;
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 12px;
}
body[data-theme="redesign"] .match-empty-icon svg { width: 22px; height: 22px; }
body[data-theme="redesign"] .match-empty-title {
  color: #fff;
  font-size: 15px; font-weight: 800;
  letter-spacing: -0.005em;
  margin-bottom: 4px;
}

/* Footer micro-text under matches card (links to Verify clip page). */
body[data-theme="redesign"] .radar-footnote {
  display: flex; justify-content: space-between; align-items: center;
  gap: 14px; flex-wrap: wrap;
  font-size: 12px;
  color: rgba(243,238,248, 0.5);
  padding: 14px 4px 0;
}
body[data-theme="redesign"] .radar-footnote a {
  color: rgba(243,238,248, 0.85);
  text-decoration: none;
  font-weight: 700;
}
body[data-theme="redesign"] .radar-footnote a:hover { color: #fff; }

/* ── Phase R1 (2026-05-08) — "All clear" radar hero ──────────────────────
   The empty-state visual that fires when the creator has Radar live but
   no matches yet. Replaces the standard scope/stack/matches block in
   that case.

   Three layered animations on a single 360px orb:
     - 3 rose pulse rings rippling outward (2.4s, staggered 1s + 2s)
     - creator's headshot in the absolute center, behind the rings
     - constellation of platform dots orbiting at 60s revolution

   Below the orb: "All clear" headline + 4-stat band + 2-column grid
   (scope card + scan log).                                            */

/* Phase R6 (2026-05-08) — "queued for Radar" state. Mirrors the
   all-clear hero's 360px orb + 3 pulse rings so the visual signal is
   identical (system is alive and warm), but the center hub is an
   hourglass + amber halo so the user reads it as "waiting on a step,
   not a problem." Sits visually between the locked STATE A screen
   (no captures yet) and the STATE C live experience. */
body[data-theme="redesign"] .lk-radar-pending {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  padding: 56px 24px 32px;
  text-align: center;
}
body[data-theme="redesign"] .lk-radar-pending-orb {
  position: relative;
  width: 280px; height: 280px;
  display: flex; align-items: center; justify-content: center;
}
body[data-theme="redesign"] .lk-radar-pending-pulse {
  position: absolute;
  inset: 50%;
  width: 96px; height: 96px;
  margin: -48px 0 0 -48px;
  border-radius: 50%;
  border: 2px solid rgba(255, 212, 158, 0.5);
  opacity: 0;
  animation: radar-clear-pulse 3s ease-out infinite;
  pointer-events: none;
}
body[data-theme="redesign"] .lk-radar-pending-hub {
  position: relative;
  width: 96px; height: 96px;
  border-radius: 50%;
  background: radial-gradient(circle at center, rgba(255,212,158,0.22) 0%, rgba(255,212,158,0.06) 60%, transparent 100%);
  display: flex; align-items: center; justify-content: center;
  color: #ffd49e;
  box-shadow: 0 0 36px rgba(255, 212, 158, 0.35);
}
body[data-theme="redesign"] .lk-radar-pending-hub i {
  width: 36px; height: 36px;
}
body[data-theme="redesign"] .lk-radar-pending-eyebrow {
  font-size: 11px; font-weight: 800;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: #ffd49e;
}
body[data-theme="redesign"] .lk-radar-pending-title {
  font-size: 44px; font-weight: 900;
  letter-spacing: -0.025em;
  color: #fff;
  margin: 0;
}
body[data-theme="redesign"] .lk-radar-pending-sub {
  max-width: 560px;
  font-size: 15px; line-height: 1.55;
  color: rgba(243,238,248, 0.72);
  margin: 0;
}
body[data-theme="redesign"] .lk-radar-pending-actions {
  display: flex; gap: 10px; flex-wrap: wrap; justify-content: center;
  margin-top: 8px;
}

/* Phase R7.2 — first-paint spotlight on the Radar fast-track submit
   button. User feedback: the button blends in with the rest of the
   page and gets missed entirely. JS adds .has-cta-spotlight to the
   panel when we're in the "tier reached, not yet submitted" state.
   The class triggers:
     1. A full-viewport dimmer (::before pseudo, 55% black, 2px blur)
        — pointer-events: none so clicks still pass through to the
        underlying chrome (header / sidebar / etc).
     2. The actions row floats above the dimmer (z-index 10).
     3. The submit button gets a continuous rose-glow pulse so the
        eye is dragged to it. The pulse breathes 1.5s in / out.
   The spotlight auto-dismisses on the FIRST user interaction
   anywhere outside the actions row — JS removes the .has-cta-
   spotlight class. Dismissed state isn't persisted between visits
   (intentional — if you bounced away you might still need the hint
   on return). */
body[data-theme="redesign"] .lk-radar-pending.has-cta-spotlight::before {
  content: '';
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 5;
  pointer-events: none;
  animation: lk-radar-spotlight-fade-in 380ms ease-out both;
}
@keyframes lk-radar-spotlight-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
body[data-theme="redesign"] .lk-radar-pending.has-cta-spotlight .lk-radar-pending-actions {
  position: relative;
  z-index: 10;
}
body[data-theme="redesign"] .lk-radar-pending.has-cta-spotlight #lk-radar-submit-btn {
  position: relative;
  animation: lk-radar-cta-pulse 2.4s ease-in-out infinite;
}
body[data-theme="redesign"] .lk-radar-pending.has-cta-spotlight #lk-radar-submit-btn::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: inherit;
  border: 2px solid rgba(255, 180, 180, 0.6);
  pointer-events: none;
  animation: lk-radar-cta-ring 2.4s ease-out infinite;
}
@keyframes lk-radar-cta-pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 16px 48px -12px rgba(255, 180, 180, 0.55),
                0 0 0 0 rgba(255, 180, 180, 0.55);
  }
  50% {
    transform: scale(1.04);
    box-shadow: 0 22px 64px -12px rgba(255, 180, 180, 0.85),
                0 0 0 16px rgba(255, 180, 180, 0);
  }
}
@keyframes lk-radar-cta-ring {
  0%   { transform: scale(1);   opacity: 0.85; }
  60%  { transform: scale(1.18); opacity: 0;    }
  100% { transform: scale(1.18); opacity: 0;    }
}
/* Slight de-emphasis on the secondary "Capture more first" ghost
   button so the eye lands on the primary first. Subtle — no
   pointer-events change, just opacity. */
body[data-theme="redesign"] .lk-radar-pending.has-cta-spotlight .lk-radar-pending-actions .btn.ghost {
  opacity: 0.65;
}

body[data-theme="redesign"] .radar-clear {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  padding: 36px 24px 8px;
}

/* The 360x360 orb container holds the pulse rings, the headshot, AND
   the constellation orbit — they all share the same center point. */
body[data-theme="redesign"] .radar-clear-orb {
  position: relative;
  width: 360px;
  height: 360px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Pulse rings — three identical .radar-clear-pulse spans staggered via
   inline animation-delay in the markup. Scale from 0 to ~3x and fade
   to 0 — feels like sonar without being aggressive. */
body[data-theme="redesign"] .radar-clear-pulse {
  position: absolute;
  inset: 50%;
  width: 96px; height: 96px;
  margin: -48px 0 0 -48px;
  border-radius: 50%;
  border: 2px solid rgba(255, 180, 180, 0.55);
  opacity: 0;
  animation: radar-clear-pulse 3s ease-out infinite;
  pointer-events: none;
}
@keyframes radar-clear-pulse {
  0%   { transform: scale(0.6); opacity: 0.85; }
  60%  { opacity: 0.30; }
  100% { transform: scale(3.4); opacity: 0;    }
}

/* Center hub — creator's headshot inside a rose-glow halo. */
body[data-theme="redesign"] .radar-clear-center {
  position: relative;
  width: 96px; height: 96px;
  border-radius: 50%;
  background: linear-gradient(160deg, #ffb4b4 0%, #8d4c4c 100%);
  box-shadow: 0 0 60px rgba(255, 180, 180, 0.55),
              inset 0 0 30px rgba(255, 255, 255, 0.18);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  z-index: 1;
}
body[data-theme="redesign"] .radar-clear-photo {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
body[data-theme="redesign"] .radar-clear-initials {
  font-size: 36px; font-weight: 900;
  color: rgba(255,255,255, 0.92);
  letter-spacing: -0.04em;
}

/* Constellation — <ul> with `transform: rotate()` slowly turning so
   every dot sweeps the orbit. Each <li> uses an inline transform to
   sit at its angle on the rim, with a counter-rotate trick so the
   dot itself stays upright. */
body[data-theme="redesign"] .radar-clear-constellation {
  position: absolute;
  inset: 0;
  list-style: none;
  margin: 0; padding: 0;
  animation: radar-clear-orbit 60s linear infinite;
}
@keyframes radar-clear-orbit {
  to { transform: rotate(360deg); }
}
body[data-theme="redesign"] .radar-clear-constellation li {
  position: absolute;
  top: 50%; left: 50%;
  width: 14px; height: 14px;
  margin: -7px 0 0 -7px;
  /* `transform` set inline by JS: rotate(deg) translate(140px) rotate(-deg)
     so each dot sits at its angle but stays upright as the parent rotates. */
}
body[data-theme="redesign"] .radar-clear-constellation .radar-clear-dot {
  display: block;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: rgba(168,239,206, 0.85);   /* mint = active */
  box-shadow: 0 0 10px rgba(168,239,206, 0.75);
  border: 2px solid rgba(255,255,255,0.18);
}
body[data-theme="redesign"] .radar-clear-constellation .radar-clear-dot.coming {
  background: rgba(255, 212, 158, 0.55); /* amber = coming-soon */
  box-shadow: 0 0 8px rgba(255, 212, 158, 0.45);
  opacity: 0.65;
}

/* Headline + stat band sit centered below the orb. */
body[data-theme="redesign"] .radar-clear-headline {
  text-align: center;
  max-width: 540px;
}
body[data-theme="redesign"] .radar-clear-eyebrow {
  font-size: 11px; font-weight: 800;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: #ffd0d0;
  margin-bottom: 6px;
}
body[data-theme="redesign"] .radar-clear-title {
  font-size: 44px; font-weight: 900;
  letter-spacing: -0.03em;
  color: #fff;
  margin: 0 0 8px;
}
body[data-theme="redesign"] .radar-clear-sub {
  font-size: 14px; line-height: 1.55;
  color: rgba(243,238,248, 0.65);
  margin: 0;
}

body[data-theme="redesign"] .radar-clear-stats {
  display: flex; gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
  max-width: 720px;
}
body[data-theme="redesign"] .radar-clear-stat {
  flex: 1 1 140px;
  min-width: 130px;
  padding: 14px 16px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  text-align: center;
}
body[data-theme="redesign"] .radar-clear-stat b {
  display: block;
  font-size: 22px; font-weight: 900;
  color: #fff;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  margin-bottom: 2px;
}
body[data-theme="redesign"] .radar-clear-stat span {
  font-size: 11px; font-weight: 700;
  color: rgba(243,238,248, 0.55);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Two-column grid: scope card (what we watch) + scan log (recent runs).
   Drops to 1-column on narrow viewports. */
body[data-theme="redesign"] .radar-clear-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  width: 100%;
  max-width: 980px;
  margin-top: 4px;
}
@media (max-width: 760px) {
  body[data-theme="redesign"] .radar-clear-grid { grid-template-columns: 1fr; }
}

body[data-theme="redesign"] .radar-clear-scope h3,
body[data-theme="redesign"] .radar-clear-log h3 {
  font-size: 11px; font-weight: 800;
  letter-spacing: 0.10em; text-transform: uppercase;
  color: rgba(243,238,248, 0.5);
  margin: 0 0 10px;
}
body[data-theme="redesign"] .radar-clear-scope-list,
body[data-theme="redesign"] .radar-clear-log-list {
  list-style: none;
  padding: 0; margin: 0;
  display: flex; flex-direction: column;
  gap: 8px;
}

/* Scope row — platform name + status badge. */
body[data-theme="redesign"] .radar-clear-scope-list li {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  font-size: 13px;
  color: rgba(243,238,248, 0.85);
}
body[data-theme="redesign"] .radar-clear-scope-list .platform-dot {
  width: 8px; height: 8px; border-radius: 50%;
  flex-shrink: 0;
  background: rgba(168,239,206, 0.85);
  box-shadow: 0 0 6px rgba(168,239,206, 0.55);
}
body[data-theme="redesign"] .radar-clear-scope-list li[data-status="coming"] .platform-dot {
  background: rgba(255, 212, 158, 0.55);
  box-shadow: 0 0 6px rgba(255, 212, 158, 0.35);
}
body[data-theme="redesign"] .radar-clear-scope-list li[data-status="coming"] {
  color: rgba(243,238,248, 0.55);
}
body[data-theme="redesign"] .radar-clear-scope-list .platform-name { flex: 1; font-weight: 700; }
body[data-theme="redesign"] .radar-clear-scope-list .platform-status {
  font-size: 10px; font-weight: 800;
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(168,239,206, 0.10);
  color: #a8efce;
}
body[data-theme="redesign"] .radar-clear-scope-list li[data-status="coming"] .platform-status {
  background: rgba(255, 212, 158, 0.10);
  color: #ffd49e;
}

/* Scan log row — timestamp + outcome. */
body[data-theme="redesign"] .radar-clear-log-list li {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  font-size: 12px;
  color: rgba(243,238,248, 0.75);
}
body[data-theme="redesign"] .radar-clear-log-list .log-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(168,239,206, 0.75);
  flex-shrink: 0;
}
body[data-theme="redesign"] .radar-clear-log-list li[data-status="failed"] .log-dot {
  background: rgba(255,186,193, 0.75);
}
body[data-theme="redesign"] .radar-clear-log-list .log-when {
  flex: 1;
  color: #fff;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
body[data-theme="redesign"] .radar-clear-log-list .log-outcome {
  font-size: 11px;
  color: rgba(243,238,248, 0.55);
  letter-spacing: 0.02em;
}
body[data-theme="redesign"] .radar-clear-log-list .radar-clear-log-empty {
  text-align: center;
  color: rgba(243,238,248, 0.5);
  font-style: italic;
  background: transparent;
  border: 1px dashed rgba(255,255,255,0.10);
}

@media (prefers-reduced-motion: reduce) {
  body[data-theme="redesign"] .radar-clear-pulse,
  body[data-theme="redesign"] .radar-clear-constellation {
    animation: none !important;
  }
  body[data-theme="redesign"] .radar-clear-pulse {
    opacity: 0.18;
    transform: scale(2);
  }
}

/* ── Phase R2 (2026-05-08) — Tier 1 upgrade-bridge card ──────────────────
   Soft, motivational card injected at the TOP of the matches list when
   a Protected-tier creator (no active licenses) has at least one match.
   Reframes Radar matches as REVENUE SIGNALS rather than missed warnings.
   Uses .match-row as the base class so it sits inline with the regular
   match cards, then overrides for the rose-on-plum upgrade aesthetic. */
body[data-theme="redesign"] .match-row.radar-upgrade-bridge {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  background: linear-gradient(135deg, rgba(255,180,180,0.10) 0%, rgba(133,95,168,0.06) 100%);
  border: 1px solid rgba(255,180,180,0.32);
  border-radius: 14px;
  margin-bottom: 10px;
}
body[data-theme="redesign"] .radar-upgrade-bridge-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(255,180,180,0.30) 0%, rgba(141,76,76,0.16) 100%);
  border: 1px solid rgba(255,180,180,0.40);
  color: #ffd0d0;
  display: inline-flex;
  align-items: center; justify-content: center;
  flex-shrink: 0;
}
body[data-theme="redesign"] .radar-upgrade-bridge-icon svg {
  width: 22px; height: 22px;
}
body[data-theme="redesign"] .radar-upgrade-bridge-body { min-width: 0; }
body[data-theme="redesign"] .radar-upgrade-bridge-eyebrow {
  font-size: 11px; font-weight: 800;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: #ffd0d0;
  margin-bottom: 4px;
}
body[data-theme="redesign"] .radar-upgrade-bridge-title {
  font-size: 16px; font-weight: 800;
  color: #fff;
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}
body[data-theme="redesign"] .radar-upgrade-bridge-sub {
  font-size: 13px;
  line-height: 1.45;
  color: rgba(243,238,248, 0.65);
}
body[data-theme="redesign"] .radar-upgrade-bridge-action {
  flex-shrink: 0;
  align-self: center;
}
@media (max-width: 720px) {
  body[data-theme="redesign"] .match-row.radar-upgrade-bridge {
    grid-template-columns: auto 1fr;
  }
  body[data-theme="redesign"] .radar-upgrade-bridge-action {
    grid-column: 1 / -1;
    justify-self: end;
  }
}

/* Narrow viewport collapse */
@media (max-width: 980px) {
  body[data-theme="redesign"] .radar-hero { grid-template-columns: 1fr; }
  body[data-theme="redesign"] .scope-meta { grid-template-columns: 1fr; gap: 10px; }
  body[data-theme="redesign"] .match-row {
    grid-template-columns: 56px 1fr;
  }
  body[data-theme="redesign"] .match-row .match-conf,
  body[data-theme="redesign"] .match-row .match-actions {
    grid-column: 2;
  }
}

/* ────────────────────────────────────────────────────────────────────
   EARNINGS LEAF tokens
   Mirrors backend/creator/redesign/vault-earnings.html. Three blocks:
   .ks-row (3-tile stake row), .grid-2 (chart + stripe), .panel.payouts
   list. The preview state uses the existing .lk-radar-preview* classes
   from legacy style.css (Q-E4=b — capabilities-style sell when
   creator has zero earnings yet).
   ──────────────────────────────────────────────────────────────────── */

/* Lifetime + this-month + Royall-fee row.
   Stake card on the left (rose-tinted hero), two normal stat tiles
   right. .stat / .stat-label / .stat-value / .stat-sub already exist
   in this file (defined for the overview leaf in sub-turn 1) — we
   reuse them here. */
body[data-theme="redesign"] .ks-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 14px;
  margin-bottom: 18px;
}

body[data-theme="redesign"] .stake {
  padding: 24px 26px;
  background: linear-gradient(160deg, rgba(255,180,180,0.16) 0%, rgba(141,76,76,0.06) 100%);
  border: 1px solid rgba(255,180,180,0.2);
  border-radius: 18px;
  display: flex; flex-direction: column; justify-content: space-between;
  min-height: 168px;
}
body[data-theme="redesign"] .stake-label {
  font-size: 10px; font-weight: 800;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: #ffd0d0;
}
body[data-theme="redesign"] .stake-value {
  font-size: 38px; font-weight: 900;
  color: #fff;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
  margin: 8px 0 4px;
  filter: drop-shadow(0 0 16px rgba(255,180,180,0.32));
}
body[data-theme="redesign"] .stake-foot {
  font-size: 12px;
  color: rgba(243,238,248, 0.7);
  line-height: 1.55;
}
body[data-theme="redesign"] .stake-foot strong {
  color: #fff;
  font-weight: 800;
}

/* Two-column row: chart card + Stripe panel */
body[data-theme="redesign"] .grid-2 {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 18px;
  margin-bottom: 18px;
}

/* Inside-card panel padding + h3 — used by all three earnings cards
   (chart / stripe / recent payouts). */
body[data-theme="redesign"] .panel { padding: 22px 24px; }
body[data-theme="redesign"] .panel h3 {
  margin: 0 0 16px;
  font-size: 16px; font-weight: 800;
  color: #fff;
  letter-spacing: -0.005em;
}

/* 12-month bar chart. Each .chart-bar uses inline `style="height: X%"`
   driven by the JS render. .peak modifier highlights the busiest month. */
body[data-theme="redesign"] .chart {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  align-items: end;
  gap: 8px;
  height: 180px;
  padding-bottom: 24px;
  border-bottom: 1px dashed rgba(255,255,255,0.06);
}
body[data-theme="redesign"] .chart-bar {
  background: linear-gradient(180deg, rgba(255,180,180,0.55) 0%, rgba(141,76,76,0.18) 100%);
  border-radius: 6px 6px 2px 2px;
  min-height: 8%;
  transition: filter 200ms ease;
}
body[data-theme="redesign"] .chart-bar.peak {
  background: linear-gradient(180deg, #ffb4b4 0%, #b47878 100%);
  box-shadow: 0 -4px 16px rgba(255,180,180,0.4);
}
body[data-theme="redesign"] .chart-bar:hover {
  filter: brightness(1.18);
}
body[data-theme="redesign"] .chart-foot {
  display: flex; justify-content: space-between;
  font-size: 11px;
  color: rgba(243,238,248, 0.55);
  margin-top: 14px;
}
body[data-theme="redesign"] .chart-foot strong {
  color: #fff;
  font-weight: 800;
}

/* Stripe Connect status card (right column of .grid-2). */
body[data-theme="redesign"] .stripe-status {
  padding: 18px 20px;
  display: flex; gap: 14px; align-items: center;
  background: rgba(0,0,0,0.18);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
}
body[data-theme="redesign"] .stripe-emblem {
  width: 44px; height: 44px;
  border-radius: 10px;
  background: linear-gradient(135deg, #6772e5 0%, #3a3f9b 100%);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 900;
  flex: none;
}
body[data-theme="redesign"] .stripe-meta { flex: 1; min-width: 0; }
body[data-theme="redesign"] .stripe-title {
  font-size: 14px; font-weight: 800;
  color: #fff;
}
body[data-theme="redesign"] .stripe-detail {
  font-size: 11px;
  color: rgba(243,238,248, 0.55);
  margin-top: 3px;
}

/* Recent payouts list. 4-col grid: icon / meta / status chip / amount. */
body[data-theme="redesign"] .payout-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 14px;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid rgba(255,255,255,0.06);
  font-size: 13px;
}
body[data-theme="redesign"] .payout-row:first-child {
  border-top: none;
  padding-top: 0;
}
body[data-theme="redesign"] .payout-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: rgba(120,220,180,0.16);
  color: #a8efce;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 900;
  flex: none;
}
body[data-theme="redesign"] .payout-icon svg {
  width: 14px; height: 14px;
  stroke-width: 2.5;
}
body[data-theme="redesign"] .payout-icon.held {
  background: rgba(255,200,100,0.16);
  color: #ffd49e;
}
body[data-theme="redesign"] .payout-icon.past {
  background: rgba(255,255,255,0.08);
  color: rgba(243,238,248, 0.6);
}
body[data-theme="redesign"] .payout-name {
  color: #fff;
  font-weight: 700;
}
body[data-theme="redesign"] .payout-meta {
  color: rgba(243,238,248, 0.55);
  margin-top: 2px;
  font-size: 11px;
}
body[data-theme="redesign"] .payout-amt {
  font-size: 14px; font-weight: 800;
  color: #fff;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Earnings list empty fallback (shown inside the recent-payouts card
   when has_earnings=true but recent_payouts is empty — should be rare
   but covers the race where lifetime > 0 and the limit-12 query missed). */
body[data-theme="redesign"] .payouts-empty {
  padding: 28px 8px;
  text-align: center;
  font-size: 13px;
  color: rgba(243,238,248, 0.55);
}

/* Narrow viewport collapse */
@media (max-width: 980px) {
  body[data-theme="redesign"] .ks-row    { grid-template-columns: 1fr; }
  body[data-theme="redesign"] .grid-2    { grid-template-columns: 1fr; }
  body[data-theme="redesign"] .chart     { gap: 4px; height: 140px; }
  body[data-theme="redesign"] .payout-row {
    grid-template-columns: auto 1fr;
  }
  body[data-theme="redesign"] .payout-row .chip,
  body[data-theme="redesign"] .payout-row .payout-amt {
    grid-column: 2;
  }
}

/* Sprint 3 (2026-05-13) — failed-payout icon variant. Matches the
   chip-bad rose/red language used elsewhere in the redesign. */
body[data-theme="redesign"] .payout-icon.failed {
  background: rgba(255, 99, 99, 0.20);
  color: #ff9090;
}

/* ────────────────────────────────────────────────────────────────────
   PAYOUT BANNERS (Sprint 3, 2026-05-13)
   Two banners that sit above the Earnings tab's stake row when
   they have something to say:
   - `.lk-payout-banner-held`   — rose tint, "finish Stripe" CTA
   - `.lk-payout-banner-failed` — amber tint, "view details" CTA
   Grid: icon / body (title + sub) / CTA.
   ──────────────────────────────────────────────────────────────────── */
body[data-theme="redesign"] .lk-payout-banner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 16px 18px;
  border-radius: 14px;
  margin-bottom: 16px;
  font-size: 13px;
}
body[data-theme="redesign"] .lk-payout-banner-held {
  background: linear-gradient(135deg,
              rgba(255, 180, 180, 0.14),
              rgba(255, 180, 180, 0.05));
  border: 1px solid rgba(255, 180, 180, 0.32);
}
body[data-theme="redesign"] .lk-payout-banner-failed {
  background: linear-gradient(135deg,
              rgba(255, 175, 95, 0.14),
              rgba(255, 175, 95, 0.05));
  border: 1px solid rgba(255, 175, 95, 0.32);
}
body[data-theme="redesign"] .lk-payout-banner-icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex: none;
}
body[data-theme="redesign"] .lk-payout-banner-held .lk-payout-banner-icon {
  background: rgba(255, 180, 180, 0.18);
  color: #ffb4b4;
}
body[data-theme="redesign"] .lk-payout-banner-failed .lk-payout-banner-icon {
  background: rgba(255, 175, 95, 0.18);
  color: #ffc88a;
}
body[data-theme="redesign"] .lk-payout-banner-icon svg {
  width: 18px; height: 18px;
  stroke-width: 2.4;
}
body[data-theme="redesign"] .lk-payout-banner-title {
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: -0.005em;
}
body[data-theme="redesign"] .lk-payout-banner-sub {
  color: rgba(243,238,248, 0.65);
  font-size: 12px;
  margin-top: 2px;
  line-height: 1.45;
}
body[data-theme="redesign"] .lk-payout-banner-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  text-decoration: none;
  transition: transform 120ms ease, background 120ms ease;
}
body[data-theme="redesign"] .lk-payout-banner-held .lk-payout-banner-cta {
  background: rgba(255, 180, 180, 0.18);
  color: #ffd0d0;
  border: 1px solid rgba(255, 180, 180, 0.32);
}
body[data-theme="redesign"] .lk-payout-banner-failed .lk-payout-banner-cta {
  background: rgba(255, 175, 95, 0.18);
  color: #ffd9a8;
  border: 1px solid rgba(255, 175, 95, 0.32);
}
body[data-theme="redesign"] .lk-payout-banner-cta:hover {
  transform: translateY(-1px);
}
body[data-theme="redesign"] .lk-payout-banner-cta svg {
  width: 12px; height: 12px;
}

/* "View full history →" footer link below the recent-payouts list. */
body[data-theme="redesign"] .lk-earn-payouts-footer {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,0.06);
  text-align: center;
}
body[data-theme="redesign"] .lk-earn-payouts-footer .section-link {
  font-size: 12px;
  font-weight: 700;
  color: #ffb4b4;
  text-decoration: none;
}
body[data-theme="redesign"] .lk-earn-payouts-footer .section-link:hover {
  color: #ffd0d0;
}

/* Narrow viewport collapse for the banners — stack icon/body, push
   CTA below. */
@media (max-width: 720px) {
  body[data-theme="redesign"] .lk-payout-banner {
    grid-template-columns: auto 1fr;
    gap: 12px;
  }
  body[data-theme="redesign"] .lk-payout-banner-cta {
    grid-column: 1 / -1;
    justify-self: stretch;
    justify-content: center;
  }
}

/* ────────────────────────────────────────────────────────────────────
   PAYOUT HISTORY LEAF (Sprint 3, 2026-05-13)
   /creator/likeness/payouts.html — dedicated full-history surface.
   Filter chips + load-more button + headerbar CSV button.
   ──────────────────────────────────────────────────────────────────── */
body[data-theme="redesign"] .lk-payout-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 20px 0;
}
body[data-theme="redesign"] .lk-payout-chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  color: rgba(243,238,248, 0.65);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
  font-family: inherit;
}
body[data-theme="redesign"] .lk-payout-chip:hover {
  background: rgba(255,255,255,0.07);
  color: #fff;
}
body[data-theme="redesign"] .lk-payout-chip.is-active {
  background: rgba(255, 180, 180, 0.16);
  color: #ffd0d0;
  border-color: rgba(255, 180, 180, 0.40);
}

body[data-theme="redesign"] .lk-payouts-loadmore {
  margin-top: 18px;
  text-align: center;
}

/* Headerbar CSV button on the payouts leaf — picks up .btn .ghost styling
   already in the codebase; just align the icon + label. */
body[data-theme="redesign"] #lk-payouts-csv {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
body[data-theme="redesign"] #lk-payouts-csv svg {
  width: 14px; height: 14px;
}
body[data-theme="redesign"] #lk-payouts-csv.is-loading {
  opacity: 0.75;
  pointer-events: none;
}

/* ────────────────────────────────────────────────────────────────────
   ACTIVITY PAGE tokens
   The standalone /creator/likeness/activity.html sub-page (Conf-1).
   Reuses .activity-row / .activity-icon / .activity-title /
   .activity-sub / .activity-time / .activity-empty from sub-turn 1
   (overview leaf). Adds: page wrapper, filter <select> bar, load-more
   button, skeleton loader for the first paint.
   ──────────────────────────────────────────────────────────────────── */

/* Filter <select> bar — sits above the list, mirrors the radar leaf's
   .match-filter so the two surfaces look like siblings (Q-Act2=b). */
body[data-theme="redesign"] .activity-filterbar {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; flex-wrap: wrap;
  padding: 18px 24px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
body[data-theme="redesign"] .activity-filterbar h2 {
  font-size: 18px; font-weight: 800; color: #fff;
  letter-spacing: -0.005em;
  margin: 0;
}
body[data-theme="redesign"] .activity-filterbar .activity-count {
  font-weight: 600; font-size: 13px;
  color: rgba(243,238,248, 0.55);
}
body[data-theme="redesign"] .activity-filter {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px;
  color: rgba(243,238,248, 0.6);
}
body[data-theme="redesign"] .activity-filter select {
  font: inherit;
  background: rgba(0,0,0,0.32);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  color: #fff;
  padding: 6px 10px;
  cursor: pointer;
}
body[data-theme="redesign"] .activity-filter select:hover {
  border-color: rgba(255,255,255,0.2);
}

/* List wrapper — the activity card holds the rows directly. We add a
   little top padding inside the card so the first row doesn't kiss the
   filter bar's bottom border. */
body[data-theme="redesign"] .activity-list {
  padding: 6px 0;
}

/* Padded variants of the existing .activity-row when used on the
   standalone page — the overview leaf renders rows tighter to fit
   8 in a card; the activity page has all the room in the world so
   we can breathe a bit. */
body[data-theme="redesign"] .activity-list .activity-row {
  padding: 14px 24px;
  gap: 14px;
}

/* Load more button — full-width footer of the list card. */
body[data-theme="redesign"] .activity-loadmore {
  display: flex; justify-content: center;
  padding: 18px 24px 22px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
body[data-theme="redesign"] .activity-loadmore button {
  font: inherit;
  background: rgba(0,0,0,0.32);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  color: rgba(243,238,248, 0.85);
  padding: 10px 22px;
  font-size: 13px; font-weight: 700;
  cursor: pointer;
  letter-spacing: -0.005em;
  transition: border-color 150ms ease, color 150ms ease, background 150ms ease;
}
body[data-theme="redesign"] .activity-loadmore button:hover:not(:disabled) {
  border-color: rgba(255,180,180,0.4);
  color: #fff;
  background: rgba(255,180,180,0.06);
}
body[data-theme="redesign"] .activity-loadmore button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* End-of-feed marker — shown instead of the load-more button when
   has_more=false. */
body[data-theme="redesign"] .activity-end {
  text-align: center;
  padding: 22px 24px;
  font-size: 12px;
  color: rgba(243,238,248, 0.4);
  border-top: 1px solid rgba(255,255,255,0.06);
}

/* ────────────────────────────────────────────────────────────────────
   STUDIO tokens (Chrome rebuild Turn 4, 2026-05-05)
   Mirrors backend/creator/redesign/studio.html (Q-S1=c full visual port).
   Layered as OVERRIDES on top of legacy backend/creator/css/likeness-studio.css
   — we don't touch the legacy file so the recording state-machine
   classes (.advancing-out, .entering, .beat-done, #ring-fill
   stroke-dashoffset animation) keep working unchanged.

   Strategy: the existing SVG progress ring + record button stay; we
   wrap them in a concentric .ring-stack + restyle .studio-recbtn to
   the rose-gradient mic-orb. Pulse rings are pure CSS decoration.
   ──────────────────────────────────────────────────────────────────── */

/* ── Phase T (2026-05-08) — three-tier progress strip ─────────────────────
   Sits between the headerbar and the studio shell. Three concentric SVG
   rings show how far the creator is into each tier (Protected / Listed /
   Premium). Status text + per-tier legend chips on the right.

   Layout: rings 84×84 on the left, status text middle (flex:1), legend
   chips on the right. Drops to a stacked layout below 720px.            */
body[data-theme="redesign"] .tier-progress {
  display: flex;
  align-items: center;
  gap: 18px;
  max-width: 1280px;
  margin: 8px auto 0;
  padding: 14px 18px;
  background: linear-gradient(160deg, rgba(255,180,180,0.06) 0%, rgba(141,76,76,0.02) 100%);
  border: 1px solid rgba(255,180,180,0.14);
  border-radius: 18px;
}
body[data-theme="redesign"] .tier-rings {
  width: 84px; height: 84px;
  flex-shrink: 0;
}
body[data-theme="redesign"] .tier-rings-svg {
  width: 100%; height: 100%;
  /* -90deg so the stroke-dasharray starts at 12 o'clock instead of 3
     o'clock — feels right for "filling up" progress. */
  transform: rotate(-90deg);
}
body[data-theme="redesign"] .tier-ring-track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.06);
  stroke-width: 6;
}
body[data-theme="redesign"] .tier-ring-fill {
  fill: none;
  stroke-width: 6;
  stroke-linecap: round;
  /* Stroke-dashoffset is set inline by JS; pre-set the transition so
     the rings ANIMATE filling up between renders. */
  transition: stroke-dashoffset 480ms cubic-bezier(0.4, 0, 0.2, 1);
}
/* Per-tier colors — distinct enough to read at 84px without overthinking. */
body[data-theme="redesign"] .tier-ring-1 .tier-ring-fill { stroke: #ff8a7a; }   /* Protected: coral */
body[data-theme="redesign"] .tier-ring-2 .tier-ring-fill { stroke: #ff5fa8; }   /* Listed:    magenta */
body[data-theme="redesign"] .tier-ring-3 .tier-ring-fill { stroke: #c87aff; }   /* Premium:   violet */
/* Active-tier pulse — JS adds .is-active to the <g> element of the
   tier the creator is currently working in. Subtle glow so the eye
   knows where the next prompt advances. */
body[data-theme="redesign"] .tier-ring.is-active .tier-ring-fill {
  filter: drop-shadow(0 0 4px currentColor);
  animation: tier-ring-pulse 2200ms ease-in-out infinite;
}
@keyframes tier-ring-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.55; }
}

body[data-theme="redesign"] .tier-status {
  flex: 1;
  min-width: 0;
}
body[data-theme="redesign"] .tier-status-eyebrow {
  font-size: 10px; font-weight: 800;
  letter-spacing: 0.10em; text-transform: uppercase;
  color: #ffd0d0;
  margin-bottom: 4px;
}
body[data-theme="redesign"] .tier-status-meta {
  font-size: 14px; font-weight: 700;
  color: #fff;
  letter-spacing: -0.005em;
  line-height: 1.4;
}

/* Legend chips — one per tier with a colored dot + label + count.
   Inactive tiers fade slightly so the active one reads first. */
body[data-theme="redesign"] .tier-legend {
  list-style: none; padding: 0; margin: 0;
  display: flex; gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
body[data-theme="redesign"] .tier-legend li {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  font-size: 11px; font-weight: 700;
  color: rgba(243,238,248, 0.65);
  letter-spacing: 0.02em;
  white-space: nowrap;
}
body[data-theme="redesign"] .tier-legend li.is-active {
  background: rgba(255,180,180,0.10);
  border-color: rgba(255,180,180,0.30);
  color: #fff;
}
body[data-theme="redesign"] .tier-legend li.is-complete {
  background: rgba(168,239,206,0.08);
  border-color: rgba(168,239,206,0.24);
}
body[data-theme="redesign"] .tier-legend .tier-dot {
  width: 8px; height: 8px; border-radius: 50%;
  flex-shrink: 0;
}
body[data-theme="redesign"] .tier-legend li[data-tier="1"] .tier-dot { background: #ff8a7a; }
body[data-theme="redesign"] .tier-legend li[data-tier="2"] .tier-dot { background: #ff5fa8; }
body[data-theme="redesign"] .tier-legend li[data-tier="3"] .tier-dot { background: #c87aff; }

/* "Open roadmap" pill in the tier-progress strip — only shown after
   the user has dismissed the larger roadmap card below. */
body[data-theme="redesign"] .tier-roadmap-toggle {
  width: 28px; height: 28px;
  border-radius: 999px;
  border: 1px solid rgba(255,180,180,0.30);
  background: rgba(255,180,180,0.10);
  color: #ffd0d0;
  display: inline-flex;
  align-items: center; justify-content: center;
  cursor: pointer;
  font-family: inherit;
  margin-left: 8px;
  flex-shrink: 0;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
body[data-theme="redesign"] .tier-roadmap-toggle:hover {
  background: rgba(255,180,180,0.18);
  color: #fff;
  border-color: rgba(255,180,180,0.55);
}

/* ── Phase T5: tier roadmap card ─────────────────────────────────────────
   Three-column "what each tier unlocks" panel that sits under the
   tier-progress strip on first studio open. The user can dismiss it
   via the X (persisted to localStorage); the toggle button in the
   progress strip re-opens it. */
body[data-theme="redesign"] .tier-roadmap {
  position: relative;
  max-width: 1280px;
  margin: 12px auto 0;
  padding: 22px 22px 18px;
  background: linear-gradient(160deg, rgba(255,180,180,0.05) 0%, rgba(133,95,168,0.04) 100%);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  display: block;
}
body[data-theme="redesign"] .tier-roadmap.is-hidden { display: none; }

body[data-theme="redesign"] .tier-roadmap-close {
  position: absolute; top: 14px; right: 14px;
  width: 28px; height: 28px;
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  color: rgba(243,238,248,0.55);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s ease, color 0.15s ease;
}
body[data-theme="redesign"] .tier-roadmap-close:hover {
  background: rgba(255,255,255,0.10);
  color: #fff;
}
body[data-theme="redesign"] .tier-roadmap-close svg { width: 14px; height: 14px; }

body[data-theme="redesign"] .tier-roadmap-head {
  margin-bottom: 14px;
}
body[data-theme="redesign"] .tier-roadmap-eyebrow {
  font-size: 11px; font-weight: 800;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: #ffd0d0;
  margin-bottom: 4px;
}
body[data-theme="redesign"] .tier-roadmap-title {
  font-size: 18px; font-weight: 800;
  color: #fff;
  letter-spacing: -0.01em;
}

body[data-theme="redesign"] .tier-roadmap-cards {
  list-style: none; padding: 0; margin: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
body[data-theme="redesign"] .tier-roadmap-card {
  padding: 16px 18px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  background: rgba(255,255,255,0.02);
  transition: border-color 0.15s ease, background 0.15s ease;
}
body[data-theme="redesign"] .tier-roadmap-card[data-tier="1"] { border-color: rgba(255,138,122,0.24); }
body[data-theme="redesign"] .tier-roadmap-card[data-tier="2"] { border-color: rgba(255,95,168,0.22); }
body[data-theme="redesign"] .tier-roadmap-card[data-tier="3"] { border-color: rgba(200,122,255,0.24); }

body[data-theme="redesign"] .tier-roadmap-num {
  display: inline-flex;
  align-items: center; gap: 6px;
  font-size: 10px; font-weight: 800;
  letter-spacing: 0.10em; text-transform: uppercase;
  color: rgba(243,238,248,0.55);
  margin-bottom: 4px;
}
body[data-theme="redesign"] .tier-roadmap-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(255,255,255,0.30);
  flex-shrink: 0;
}
body[data-theme="redesign"] .tier-roadmap-card[data-tier="1"] .tier-roadmap-dot { background: #ff8a7a; box-shadow: 0 0 6px rgba(255,138,122,0.55); }
body[data-theme="redesign"] .tier-roadmap-card[data-tier="2"] .tier-roadmap-dot { background: #ff5fa8; box-shadow: 0 0 6px rgba(255,95,168,0.55); }
body[data-theme="redesign"] .tier-roadmap-card[data-tier="3"] .tier-roadmap-dot { background: #c87aff; box-shadow: 0 0 6px rgba(200,122,255,0.55); }

body[data-theme="redesign"] .tier-roadmap-name {
  font-size: 18px; font-weight: 900;
  color: #fff;
  letter-spacing: -0.015em;
  margin-bottom: 2px;
}
body[data-theme="redesign"] .tier-roadmap-time {
  font-size: 12px; font-weight: 700;
  color: rgba(243,238,248,0.55);
  margin-bottom: 10px;
}
body[data-theme="redesign"] .tier-roadmap-blurb {
  font-size: 13px;
  line-height: 1.5;
  color: rgba(243,238,248,0.78);
  margin: 0 0 10px;
}
body[data-theme="redesign"] .tier-roadmap-meta {
  font-size: 11px; font-weight: 700;
  color: rgba(243,238,248,0.50);
  letter-spacing: 0.02em;
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

@media (max-width: 880px) {
  body[data-theme="redesign"] .tier-roadmap-cards {
    grid-template-columns: 1fr;
  }
}

/* Per-prompt tier dot in the sidebar list. Same color key as the
   ring + legend so the visual language is consistent. */
body[data-theme="redesign"] .studio-prompt-tier-dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  margin-right: 7px;
  vertical-align: middle;
  background: rgba(255,255,255,0.18);
  flex-shrink: 0;
}
body[data-theme="redesign"] .studio-prompt-tier-dot[data-tier="1"] { background: #ff8a7a; box-shadow: 0 0 6px rgba(255,138,122,0.45); }
body[data-theme="redesign"] .studio-prompt-tier-dot[data-tier="2"] { background: #ff5fa8; box-shadow: 0 0 6px rgba(255,95,168,0.45); }
body[data-theme="redesign"] .studio-prompt-tier-dot[data-tier="3"] { background: #c87aff; box-shadow: 0 0 6px rgba(200,122,255,0.45); }
body[data-theme="redesign"] .tier-legend b {
  color: #fff; font-weight: 800;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 720px) {
  body[data-theme="redesign"] .tier-progress {
    flex-wrap: wrap;
  }
  body[data-theme="redesign"] .tier-legend {
    flex-basis: 100%;
    justify-content: flex-start;
  }
}

/* New 2-col shell (prompts + stage). Per Q-S2 we don't add a custom
   right rail — the chrome.js FAB rail covers ambient actions. */
body[data-theme="redesign"] .studio-shell {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 0;
  align-items: start;
}

/* ── Prompts pane (left column) ──────────────────────────────────── */
body[data-theme="redesign"] .studio-prompts-pane {
  display: flex; flex-direction: column;
  position: sticky; top: 96px;
  max-height: calc(100vh - 140px);
}
body[data-theme="redesign"] .studio-prompts-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0 8px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 16px;
}
body[data-theme="redesign"] .studio-prompts-title {
  font-size: 16px; font-weight: 800;
  color: #fff;
  letter-spacing: -0.01em;
}
body[data-theme="redesign"] .studio-prompts-progress {
  font-size: 11px; font-weight: 700;
  color: rgba(243,238,248, 0.6);
  letter-spacing: 0.05em;
}

/* Phase S2.3 — voice guide on/off pill. Lives in the prompts-pane
   header next to the count. Hidden by default; JS reveals it once
   speechSynthesis is confirmed available. */
body[data-theme="redesign"] .studio-voice-toggle {
  width: 28px; height: 28px;
  border-radius: 999px;
  border: 1px solid rgba(255,180,180,0.30);
  background: rgba(255,180,180,0.10);
  color: #ffd0d0;
  display: inline-flex;
  align-items: center; justify-content: center;
  cursor: pointer;
  font-family: inherit;
  padding: 0;
  margin-left: auto;
  margin-right: 12px;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
body[data-theme="redesign"] .studio-voice-toggle:hover {
  background: rgba(255,180,180,0.18);
  border-color: rgba(255,180,180,0.50);
  color: #fff;
}
body[data-theme="redesign"] .studio-voice-toggle.muted {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.14);
  color: rgba(243,238,248, 0.55);
}
body[data-theme="redesign"] .studio-voice-toggle.muted:hover {
  background: rgba(255,255,255,0.08);
  color: rgba(243,238,248, 0.80);
}
body[data-theme="redesign"] .studio-voice-toggle svg {
  width: 14px; height: 14px;
}
body[data-theme="redesign"] .studio-prompts-list {
  display: flex; flex-direction: column; gap: 6px;
  flex: 1; overflow-y: auto;
}

/* Per-prompt row. The legacy JS injects rows into #prompt-list with
   class names like prompt-pill / prompt-pill.done / prompt-pill.active —
   we restyle those names. The mockup's class names (prompt-item) don't
   apply because the JS owns the markup; we override the production
   styling. */
body[data-theme="redesign"] .studio-side .prompt-pill,
body[data-theme="redesign"] .studio-prompts-list .prompt-pill {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 12px; align-items: center;
  padding: 12px 14px;
  border-radius: 14px;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease;
  border: 1px solid transparent;
  background: transparent;
  color: inherit;
  text-align: left;
  font-family: inherit;
}
body[data-theme="redesign"] .studio-side .prompt-pill:hover,
body[data-theme="redesign"] .studio-prompts-list .prompt-pill:hover {
  background: rgba(255,255,255,0.04);
}
body[data-theme="redesign"] .studio-side .prompt-pill.active,
body[data-theme="redesign"] .studio-prompts-list .prompt-pill.active {
  background: rgba(255,180,180,0.14);
  border-color: rgba(255,180,180,0.28);
}
body[data-theme="redesign"] .studio-side .prompt-pill .prompt-num,
body[data-theme="redesign"] .studio-prompts-list .prompt-pill .prompt-num {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800;
  background: rgba(255,255,255,0.06);
  color: rgba(243,238,248, 0.65);
}
body[data-theme="redesign"] .studio-side .prompt-pill.done .prompt-num,
body[data-theme="redesign"] .studio-prompts-list .prompt-pill.done .prompt-num {
  background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
  color: #0d2615;
}
body[data-theme="redesign"] .studio-side .prompt-pill.active .prompt-num,
body[data-theme="redesign"] .studio-prompts-list .prompt-pill.active .prompt-num {
  background: #fff;
  color: #3d1d1d;
}

/* ── Recorder hero ── concentric pulse rings + mic-orb wrapper. The
   existing SVG progress ring + record button live INSIDE .ring-stack;
   the pulse rings are pure decoration positioned absolutely behind. */
body[data-theme="redesign"] .ring-stack {
  position: relative;
  width: 320px; height: 320px;
  display: flex; align-items: center; justify-content: center;
  margin: 16px auto 32px;
}
body[data-theme="redesign"] .ring-stack .ring {
  position: absolute; inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(255,180,180,0.18);
  pointer-events: none;
}
body[data-theme="redesign"] .ring-stack .ring.r2 {
  inset: 30px; border-color: rgba(255,180,180,0.32);
}
body[data-theme="redesign"] .ring-stack .ring.r3 {
  inset: 60px; border-color: rgba(255,180,180,0.5);
}
body[data-theme="redesign"] .ring-stack .ring.pulse {
  animation: studio-ring-pulse 2.4s ease-out infinite;
  box-shadow: 0 0 80px rgba(255,180,180,0.2),
              inset 0 0 40px rgba(255,180,180,0.1);
}
@keyframes studio-ring-pulse {
  0%   { transform: scale(0.94); opacity: 0.4; }
  50%  { transform: scale(1.06); opacity: 0.85; }
  100% { transform: scale(0.94); opacity: 0.4; }
}

/* When a recording is active, slow the pulse and brighten — matches
   the mockup's "recording hot" feel. The legacy JS adds a class to
   .studio-recbtn when armed; we read it via the parent .ring-stack. */
body[data-theme="redesign"] .ring-stack:has(.studio-recbtn.recording) .ring.pulse {
  animation-duration: 1.4s;
  box-shadow: 0 0 100px rgba(255,180,180,0.45),
              inset 0 0 50px rgba(255,180,180,0.18);
}

/* ── Mic-orb visual on the recording button ── overrides legacy
   .studio-recbtn / .studio-recwrap. Production renders an SVG ring
   (#ring-fill) on top of the button — that stays for progress. We
   restyle the button to the rose gradient + radial highlight. */
body[data-theme="redesign"] .studio-recwrap {
  position: relative;
  width: 180px; height: 180px;
  z-index: 2;
}
body[data-theme="redesign"] .studio-recwrap .studio-ring {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
}
body[data-theme="redesign"] .studio-recwrap .studio-recbtn {
  /* Chrome rebuild Turn 6 follow-up (2026-05-05) — discovered during
     dev visual verify. The original color-only port (commit bc843dd)
     centered .studio-recbtn via top:50% + left:50% + transform:
     translate(-50%, -50%). Our Turn 4 visual port switched the
     centering technique to inset:8px (so the button scales with the
     wrap), which means the legacy `transform: translate(-50%, -50%)`
     STILL APPLIED from the bc843dd rule and pushed the button half
     its width up + half its width left of the ring center.
     Result: button rendered ~52px above-and-left of where it
     should have been. Force `transform: none` here to neutralise
     the legacy translate. The :hover and recording-state rules
     below explicitly set their own transforms, so they're fine. */
  position: absolute; inset: 8px;
  top: 8px; left: 8px;            /* explicit overrides for legacy 50% */
  transform: none;
  width: calc(100% - 16px); height: calc(100% - 16px);
  border-radius: 50%;
  background: linear-gradient(160deg, #ffb4b4 0%, #8d4c4c 100%);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 100px rgba(255,180,180,0.55),
              inset 0 0 40px rgba(255,255,255,0.18);
  cursor: pointer;
  border: 0;
  color: #fff;
  transition: transform 150ms ease, box-shadow 150ms ease;
  overflow: hidden;
  /* Cancel the legacy `studio-rec-pulse` keyframe animation that
     uses translate(-50%, -50%). We don't need any animation in the
     base state — when the button is .recording, the rule below sets
     a NEW animation that uses pure scale (no translate). */
  animation: none;
}
body[data-theme="redesign"] .studio-recwrap .studio-recbtn::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 25%, rgba(255,255,255,0.4), transparent 50%);
  pointer-events: none;
}
body[data-theme="redesign"] .studio-recwrap .studio-recbtn:hover {
  transform: scale(1.04);
}
body[data-theme="redesign"] .studio-recwrap .studio-recbtn svg {
  width: 64px; height: 64px;
  color: #fff;
  filter: drop-shadow(0 0 12px rgba(255,255,255,0.4));
  position: relative; z-index: 1;
}
body[data-theme="redesign"] .studio-recwrap .studio-recbtn.recording,
body[data-theme="redesign"] .studio-recwrap .studio-recbtn[aria-pressed="true"] {
  /* Slight pulse intensification when recording — rose-warmer.
     Animation uses scale-only (no translate) so the button stays
     centered in the wrap during the pulse. The legacy
     studio-rec-pulse keyframe baked translate(-50%, -50%) into both
     0% and 50%, which conflicts with our inset:8px centering. */
  animation: studio-rec-pulse-scale 1.4s ease-in-out infinite;
  box-shadow: 0 0 140px rgba(255,180,180,0.85),
              inset 0 0 50px rgba(255,180,180,0.25);
}
/* Scale-only recording pulse — replaces the legacy keyframe that baked
   in translate(-50%, -50%). With inset:8px centering, no translate
   is needed; only the scale should animate. */
@keyframes studio-rec-pulse-scale {
  0%, 100% { transform: scale(1);    }
  50%      { transform: scale(1.04); }
}

/* The legacy SVG progress ring still drives #ring-fill / #vring-fill.
   We make its track transparent + recolour the fill so it reads as a
   ring of light around the mic-orb instead of the production grey/violet. */
body[data-theme="redesign"] .studio-recwrap .studio-ring-track {
  stroke: rgba(255,255,255,0.08);
  stroke-width: 3;
  fill: none;
}
body[data-theme="redesign"] .studio-recwrap .studio-ring-fill {
  stroke: #ffb4b4;
  stroke-width: 4;
  fill: none;
  filter: drop-shadow(0 0 8px rgba(255,180,180,0.6));
}

/* ── Studio submit row (Q-S5=b — "where Save button is", not headerbar) ── */
body[data-theme="redesign"] .studio-submit-row {
  display: none;     /* hidden until ready */
  justify-content: center;
  margin: 24px 0 0;
}
body[data-theme="redesign"] .studio-submit-row.ready {
  display: flex;
  animation: studio-submit-rise 380ms ease-out both;
}
@keyframes studio-submit-rise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Tutorial overlay restyle (Q-S4=b — wine/rose) ── overrides
   legacy .tut-* defined in likeness-studio.css. */
body[data-theme="redesign"] .tut-bg {
  background: rgba(13, 7, 18, 0.84);
  backdrop-filter: blur(8px);
}
body[data-theme="redesign"] .tut-card {
  background: linear-gradient(160deg, rgba(61,29,29,0.92) 0%, rgba(30,16,16,0.92) 100%);
  border: 1px solid rgba(255,180,180,0.18);
  border-radius: 22px;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,0.7),
              0 0 0 1px rgba(255,180,180,0.08);
  color: #f3eef8;
}
body[data-theme="redesign"] .tut-art {
  background: radial-gradient(circle at 50% 40%, rgba(255,180,180,0.4), transparent 65%),
              linear-gradient(160deg, #855fa8 0%, #4a3264 100%);
  color: #fff;
}
body[data-theme="redesign"] .tut-art svg {
  filter: drop-shadow(0 0 16px rgba(255,180,180,0.6));
}
body[data-theme="redesign"] .tut-step {
  color: rgba(243,238,248, 0.55);
}
body[data-theme="redesign"] .tut-h1 {
  color: #fff;
  letter-spacing: -0.015em;
}
body[data-theme="redesign"] .tut-p {
  color: rgba(243,238,248, 0.78);
}
body[data-theme="redesign"] .tut-tip {
  background: rgba(255,180,180,0.08);
  border: 1px solid rgba(255,180,180,0.2);
  color: rgba(243,238,248, 0.9);
}
body[data-theme="redesign"] .tut-tip strong {
  color: #fff;
}
body[data-theme="redesign"] .tut-pip {
  background: rgba(255,255,255,0.12);
}
body[data-theme="redesign"] .tut-pip.active {
  background: linear-gradient(90deg, #ffb4b4 0%, #b47878 100%);
}
body[data-theme="redesign"] .tut-skip {
  color: rgba(243,238,248, 0.55);
}
body[data-theme="redesign"] .tut-skip:hover {
  color: #fff;
}

/* Narrow viewport collapse */
@media (max-width: 980px) {
  body[data-theme="redesign"] .studio-shell { grid-template-columns: 1fr; }
  body[data-theme="redesign"] .studio-prompts-pane { position: static; max-height: none; }
  body[data-theme="redesign"] .ring-stack { width: 240px; height: 240px; }
  body[data-theme="redesign"] .studio-recwrap { width: 140px; height: 140px; }
  body[data-theme="redesign"] .studio-recwrap .studio-recbtn svg { width: 48px; height: 48px; }
}

/* Skeleton row used during the first paint (before the first batch
   resolves). Three rows by default. */
body[data-theme="redesign"] .activity-skel {
  display: grid;
  grid-template-columns: 32px 1fr 60px;
  gap: 14px; align-items: center;
  padding: 14px 24px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
body[data-theme="redesign"] .activity-skel:first-child { border-top: none; }
body[data-theme="redesign"] .activity-skel-block {
  height: 12px;
  background: linear-gradient(90deg,
    rgba(255,255,255,0.04) 0%,
    rgba(255,255,255,0.10) 50%,
    rgba(255,255,255,0.04) 100%);
  background-size: 200% 100%;
  border-radius: 6px;
  animation: activity-shimmer 1.4s linear infinite;
}
body[data-theme="redesign"] .activity-skel-block.dot {
  height: 32px; width: 32px;
  border-radius: 8px;
}
body[data-theme="redesign"] .activity-skel-block.short  { width: 35%; }
body[data-theme="redesign"] .activity-skel-block.medium { width: 65%; margin-top: 6px; }
@keyframes activity-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ────────────────────────────────────────────────────────────────────
   STUDIO — Celebration overlay (Phase S1, 2026-05-05)
   Full-screen rose-tinted "Got it ✓" moment shown after voice/face/body
   capture auto-saves with a passing QC. ~1.45s total runtime
   (1.2s show + 250ms fade), driven by _showCelebration() in
   likeness-studio.js. Honors prefers-reduced-motion.

   z-index 10000 sits above the FAB rail (z-index 90) and the brand-bar
   (z-index 90) so the moment owns the screen regardless of what's
   underneath. pointer-events:none on the wrapper means a stray click
   during the fade won't accidentally interact with the page below.
   ──────────────────────────────────────────────────────────────────── */
body[data-theme="redesign"] .studio-celebration {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(18, 18, 38, 0.42);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 10000;
  opacity: 0;
  transition: opacity 280ms ease;
  pointer-events: none;
}
body[data-theme="redesign"] .studio-celebration.show { opacity: 1; }
body[data-theme="redesign"] .studio-celebration.hide { opacity: 0; }

body[data-theme="redesign"] .studio-celebration-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  padding: 44px 56px;
  background: linear-gradient(160deg, rgba(255,180,180,0.18) 0%, rgba(141,76,76,0.08) 100%);
  border: 1px solid rgba(255,180,180,0.35);
  border-radius: 28px;
  box-shadow: 0 32px 80px -20px rgba(255,180,180,0.32),
              inset 0 0 60px rgba(255,180,180,0.05);
  transform: scale(0.82) translateY(8px);
  transition: transform 360ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
body[data-theme="redesign"] .studio-celebration.show .studio-celebration-card {
  transform: scale(1) translateY(0);
}

/* Big rose check disk — the "yes you did it" anchor of the moment.
   Pops in with a small spin overshoot to feel celebratory. */
body[data-theme="redesign"] .studio-celebration-check {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: linear-gradient(160deg, #ffb4b4 0%, #8d4c4c 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 80px rgba(255,180,180,0.65),
              inset 0 0 30px rgba(255,255,255,0.22);
  animation: studio-celeb-check 600ms cubic-bezier(0.34, 1.56, 0.64, 1) 80ms both;
}
body[data-theme="redesign"] .studio-celebration-check svg {
  width: 42px;
  height: 42px;
  stroke-width: 3;
  filter: drop-shadow(0 0 12px rgba(255,255,255,0.4));
}

@keyframes studio-celeb-check {
  0%   { transform: scale(0.4) rotate(-12deg); opacity: 0; }
  60%  { transform: scale(1.15) rotate(8deg);  opacity: 1; }
  100% { transform: scale(1)    rotate(0deg);  opacity: 1; }
}

body[data-theme="redesign"] .studio-celebration-msg {
  font-size: 26px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.015em;
  text-align: center;
  animation: studio-celeb-msg 420ms ease-out 280ms both;
}

@keyframes studio-celeb-msg {
  from { transform: translateY(10px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* Reduced-motion: keep the overlay visible (so screen readers still
   announce the live region) but disable all transforms + animations.
   The user still gets the rose check + the message; just no bounce. */
@media (prefers-reduced-motion: reduce) {
  body[data-theme="redesign"] .studio-celebration,
  body[data-theme="redesign"] .studio-celebration-card,
  body[data-theme="redesign"] .studio-celebration-check,
  body[data-theme="redesign"] .studio-celebration-msg {
    animation: none !important;
    transition: opacity 100ms linear !important;
    transform: none !important;
  }
}

/* ── Studio save overlay (Phase S2.2, 2026-05-08) ─────────────────────────
   Single overlay that morphs through three states from the moment the
   user taps Stop until the celebration fades out:
       data-state="uploading"   → rose ring spinner  · "Saving your take…"
       data-state="checking"    → rose ring spinner  · "Quality check…"
       data-state="celebrating" → rose check disk    · random one-liner

   Replaces the prior pattern where the user only saw the SAVE button
   label flip from "Uploading…" to "Checking…" — easy to miss, the user
   reported "I didn't know what was going on." Now there's one big
   surface that owns the entire 1–4s save+QC+celebration moment.

   Reuses the same fixed positioning + backdrop blur + card shell as
   `.studio-celebration` so the visual language is consistent.        */
body[data-theme="redesign"] .studio-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(18, 18, 38, 0.42);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 10000;
  opacity: 0;
  transition: opacity 240ms ease;
  pointer-events: none;
}
body[data-theme="redesign"] .studio-overlay.show { opacity: 1; }
body[data-theme="redesign"] .studio-overlay.hide { opacity: 0; }

body[data-theme="redesign"] .studio-overlay-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  padding: 44px 56px;
  min-width: 280px;
  background: linear-gradient(160deg, rgba(255,180,180,0.18) 0%, rgba(141,76,76,0.08) 100%);
  border: 1px solid rgba(255,180,180,0.35);
  border-radius: 28px;
  box-shadow: 0 32px 80px -20px rgba(255,180,180,0.32),
              inset 0 0 60px rgba(255,180,180,0.05);
  transform: scale(0.92) translateY(6px);
  transition: transform 320ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
body[data-theme="redesign"] .studio-overlay.show .studio-overlay-card {
  transform: scale(1) translateY(0);
}

/* Art slot — holds the spinner OR the celebration check disk. We swap
   children via JS rather than animating between two elements; it feels
   more solid than a slot-fade and the ~100ms swap is invisible during
   the longer state-text crossfade below. */
body[data-theme="redesign"] .studio-overlay-art {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Spinner — rose conic ring with a transparent slice rotating. Lives in
   .studio-overlay-art when data-state is uploading or checking. */
body[data-theme="redesign"] .studio-overlay-spinner {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    rgba(255,180,180,0.95) 0deg,
    rgba(255,180,180,0.55) 90deg,
    rgba(255,180,180,0.18) 180deg,
    rgba(255,180,180,0.04) 270deg,
    rgba(255,180,180,0.95) 360deg);
  -webkit-mask: radial-gradient(circle, transparent 32px, #000 33px);
          mask: radial-gradient(circle, transparent 32px, #000 33px);
  animation: studio-overlay-spin 1100ms linear infinite;
  box-shadow: 0 0 48px rgba(255,180,180,0.45);
}
@keyframes studio-overlay-spin {
  to { transform: rotate(360deg); }
}

/* Round 15 (2026-05-18) — celebrating-state art is now a 3-ring
   concentric SVG with the take's tier ring drawing in. Mirrors
   the studio sidebar's tier-progress-rings visual language so
   the creator sees the same shape at the celebration moment.
   The rose-gradient disk + check icon are gone — the ring SVG
   stands on its own. */
body[data-theme="redesign"] .studio-overlay[data-state="celebrating"] .studio-overlay-art {
  background: transparent;
  color: #fff;
  box-shadow: none;
  /* Soft glow behind the rings to keep the celebratory energy
     the old gradient disk used to provide. */
  filter: drop-shadow(0 0 24px rgba(255, 180, 180, 0.45));
  /* Subtle entrance pop on the whole SVG — feels celebratory
     without competing with the ring-draw animation. */
  animation: studio-celeb-rings-pop 500ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes studio-celeb-rings-pop {
  0%   { transform: scale(0.6); opacity: 0; }
  60%  { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
body[data-theme="redesign"] .celebrate-rings {
  width: 96px;
  height: 96px;
  overflow: visible;
}
/* Faint tracks for all three concentric circles (Tier 1 inner,
   Tier 2 middle, Tier 3 outer). The active tier's ring draws over
   the matching track. */
body[data-theme="redesign"] .celebrate-ring-track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.10);
  stroke-width: 3;
}
/* Active ring — drawn clockwise from 12 o'clock via the
   stroke-dashoffset animation. transform-origin centers the
   rotation. */
body[data-theme="redesign"] .celebrate-ring-fill {
  fill: none;
  stroke-width: 5;
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
  animation: celebrate-ring-draw 640ms ease-out 120ms forwards;
}
@keyframes celebrate-ring-draw {
  from { stroke-dashoffset: 100; }
  to   { stroke-dashoffset: 0; }
}
/* Per-tier accent colors mirror the studio sidebar tier rings
   + the wizard tier-pill accent stripes (2026-05-18 palette:
   coral → magenta → violet). Used by the tier-unlock cumulative
   ring SVG: T1 card draws the inner ring, T2 draws inner + middle,
   T3 draws all three — each at its tier's hue. */
body[data-theme="redesign"] .celebrate-ring-fill.tier-1 {
  stroke: #ff8a7a;
  filter: drop-shadow(0 0 8px rgba(255, 138, 122, 0.75));
}
body[data-theme="redesign"] .celebrate-ring-fill.tier-2 {
  stroke: #ff5fa8;
  filter: drop-shadow(0 0 8px rgba(255, 95, 168, 0.75));
}
body[data-theme="redesign"] .celebrate-ring-fill.tier-3 {
  stroke: #c87aff;
  filter: drop-shadow(0 0 10px rgba(200, 122, 255, 0.85));
}

/* Round 15 — explainer line that decodes the celebration headline
   (e.g., "Lab-licensable." → "AI labs can pay to use this take
   for training their models."). Lives inside .studio-overlay-sub
   alongside the Continue button on the click-gated path only.
   The 1.2s auto-flash path doesn't render this — no time to read. */
body[data-theme="redesign"] .studio-overlay-celebrate-explainer {
  font-size: 13.5px;
  line-height: 1.5;
  color: rgba(255, 230, 230, 0.78);
  margin: 0 auto 18px;
  max-width: 320px;
  text-align: center;
  font-weight: 500;
}

/* Message + sub line — fade between state copy. */
body[data-theme="redesign"] .studio-overlay-msg {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.015em;
  text-align: center;
  min-height: 26px;
  transition: opacity 180ms ease;
}
body[data-theme="redesign"] .studio-overlay[data-state="celebrating"] .studio-overlay-msg {
  font-size: 26px;
  animation: studio-celeb-msg 420ms ease-out 100ms both;
}
body[data-theme="redesign"] .studio-overlay-sub {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.65);
  letter-spacing: 0.01em;
  text-align: center;
  min-height: 16px;
  margin-top: -10px;
  transition: opacity 180ms ease;
}
body[data-theme="redesign"] .studio-overlay[data-state="celebrating"] .studio-overlay-sub {
  display: none;
}

/* Mid-transition: briefly fade the text out so the new label doesn't
   pop in awkwardly. JS toggles `.swapping` for ~150ms during state changes. */
body[data-theme="redesign"] .studio-overlay.swapping .studio-overlay-msg,
body[data-theme="redesign"] .studio-overlay.swapping .studio-overlay-sub {
  opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
  body[data-theme="redesign"] .studio-overlay,
  body[data-theme="redesign"] .studio-overlay-card,
  body[data-theme="redesign"] .studio-overlay-art,
  body[data-theme="redesign"] .studio-overlay-spinner,
  body[data-theme="redesign"] .studio-overlay-msg,
  body[data-theme="redesign"] .studio-overlay-sub {
    animation: none !important;
    transition: opacity 100ms linear !important;
    transform: none !important;
  }
}

/* ── Phase T3: tier-unlock beats — the milestone moment ────────────────────
   Three states (`unlocking-1` / `unlocking-2` / `unlocking-3`) reuse the
   .studio-overlay shell + glass card, but swap the art slot, accent color,
   and ambient animation per tier so each unlock feels distinct.

       unlocking-1 (Protected) — rose. Radar pulse rings expand from
                                  the icon outward. "Radar live" energy.
       unlocking-2 (Listed)    — plum. Card lift / slide-up. "Going on
                                  the marketplace" energy.
       unlocking-3 (Premium)   — amber. Gold seal stamp + sparkle.
                                  "Top tier" energy.                 */

/* Bigger card for unlocks (more breathing room) and a small eyebrow
   above the title. */
body[data-theme="redesign"] .studio-overlay[data-state^="unlocking"] .studio-overlay-card {
  padding: 52px 64px;
  min-width: 360px;
  gap: 18px;
}
body[data-theme="redesign"] .studio-overlay-eyebrow {
  font-size: 11px; font-weight: 800;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 6px;
}
body[data-theme="redesign"] .studio-overlay-title {
  font-size: 32px; font-weight: 900;
  letter-spacing: -0.025em;
  color: #fff;
}
body[data-theme="redesign"] .studio-overlay[data-state^="unlocking"] .studio-overlay-art {
  width: 96px; height: 96px;
  position: relative;
}

/* Tier 1 (Protected) — rose radar pulse. */
body[data-theme="redesign"] .studio-overlay[data-state="unlocking-1"] .studio-overlay-card {
  background: linear-gradient(160deg, rgba(255,180,180,0.28) 0%, rgba(141,76,76,0.10) 100%);
  border-color: rgba(255,180,180, 0.42);
  box-shadow: 0 32px 80px -10px rgba(255,180,180,0.42),
              inset 0 0 60px rgba(255,180,180,0.10);
}
body[data-theme="redesign"] .studio-overlay[data-state="unlocking-1"] .studio-overlay-art {
  color: #ffb4b4;
}
body[data-theme="redesign"] .studio-overlay[data-state="unlocking-1"] .studio-overlay-art::before,
body[data-theme="redesign"] .studio-overlay[data-state="unlocking-1"] .studio-overlay-art::after {
  content: ""; position: absolute; inset: -8px;
  border-radius: 50%;
  border: 2px solid rgba(255,180,180,0.55);
  animation: tier-unlock-pulse 1800ms ease-out infinite;
  pointer-events: none;
}
body[data-theme="redesign"] .studio-overlay[data-state="unlocking-1"] .studio-overlay-art::after {
  animation-delay: 600ms;
}
@keyframes tier-unlock-pulse {
  0%   { transform: scale(0.6); opacity: 1;   }
  100% { transform: scale(1.6); opacity: 0;   }
}

/* Tier 2 (Listed) — plum, slide-up emphasis on the icon. */
body[data-theme="redesign"] .studio-overlay[data-state="unlocking-2"] .studio-overlay-card {
  background: linear-gradient(160deg, rgba(216,180,255,0.22) 0%, rgba(133,95,168,0.10) 100%);
  border-color: rgba(216,180,255, 0.42);
  box-shadow: 0 32px 80px -10px rgba(216,180,255,0.42),
              inset 0 0 60px rgba(216,180,255,0.08);
}
body[data-theme="redesign"] .studio-overlay[data-state="unlocking-2"] .studio-overlay-art {
  color: #d8b4ff;
  background: rgba(216,180,255, 0.18);
  border-radius: 24px;
  display: flex; align-items: center; justify-content: center;
  animation: tier-unlock-rise 720ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes tier-unlock-rise {
  0%   { transform: translateY(20px); opacity: 0; }
  60%  { transform: translateY(-4px); opacity: 1; }
  100% { transform: translateY(0);    opacity: 1; }
}

/* Tier 3 (Premium) — amber, stamp recoil + sparkle ring. */
body[data-theme="redesign"] .studio-overlay[data-state="unlocking-3"] .studio-overlay-card {
  background: linear-gradient(160deg, rgba(255,212,158,0.30) 0%, rgba(141,76,76,0.10) 100%);
  border-color: rgba(255,212,158, 0.50);
  box-shadow: 0 32px 80px -10px rgba(255,212,158,0.46),
              inset 0 0 60px rgba(255,212,158,0.10);
}
body[data-theme="redesign"] .studio-overlay[data-state="unlocking-3"] .studio-overlay-art {
  color: #ffd49e;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 25%, rgba(255,212,158,0.45) 0%, rgba(255,212,158,0.10) 60%, transparent 100%);
  box-shadow: 0 0 60px rgba(255,212,158, 0.5),
              inset 0 0 30px rgba(255,255,255, 0.18);
  display: flex; align-items: center; justify-content: center;
  animation: tier-unlock-stamp 720ms cubic-bezier(0.4, 1.8, 0.6, 1) both;
}
@keyframes tier-unlock-stamp {
  0%   { transform: scale(0.4) rotate(-8deg); opacity: 0; }
  55%  { transform: scale(1.18) rotate(4deg); opacity: 1; }
  72%  { transform: scale(0.96) rotate(-2deg); }
  100% { transform: scale(1)    rotate(0);    opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  body[data-theme="redesign"] .studio-overlay[data-state^="unlocking"] .studio-overlay-art::before,
  body[data-theme="redesign"] .studio-overlay[data-state^="unlocking"] .studio-overlay-art::after,
  body[data-theme="redesign"] .studio-overlay[data-state^="unlocking"] .studio-overlay-art {
    animation: none !important;
    transform: none !important;
  }
}

/* Phase T4 — "you can stop here" buttons inside the tier-1 / tier-2
   unlock card. Two-button row: Save & exit (ghost) + Continue (primary).
   Tier 3 doesn't render these (final state, auto-advance). The
   .studio-overlay-sub container is restyled here when buttons are
   present to space everything cleanly. */
body[data-theme="redesign"] .studio-overlay-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 22px;
}
body[data-theme="redesign"] .studio-overlay-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 13px; font-weight: 800;
  font-family: inherit;
  letter-spacing: -0.005em;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s ease, color 0.15s ease,
              border-color 0.15s ease, transform 0.15s ease,
              box-shadow 0.15s ease;
}
body[data-theme="redesign"] .studio-overlay-btn:active { transform: translateY(1px); }
body[data-theme="redesign"] .studio-overlay-btn.primary {
  background: linear-gradient(135deg, #ffb4b4 0%, #b47878 100%);
  color: #3d1d1d;
  box-shadow: 0 12px 32px -10px rgba(255,180,180,0.55);
}
body[data-theme="redesign"] .studio-overlay-btn.primary:hover {
  background: linear-gradient(135deg, #ffd0d0 0%, #ffb4b4 100%);
}
body[data-theme="redesign"] .studio-overlay-btn.ghost {
  background: rgba(255,255,255,0.06);
  color: rgba(243,238,248,0.85);
  border-color: rgba(255,255,255,0.16);
}
body[data-theme="redesign"] .studio-overlay-btn.ghost:hover {
  background: rgba(255,255,255,0.12);
  color: #fff;
}
/* Phase R7 — Radar fast-track button. Plum on rose so it visually
   distinguishes from the primary "Continue" rose button. Same row. */
body[data-theme="redesign"] .studio-overlay-btn.radar {
  background: rgba(216,180,255, 0.16);
  color: #e6cdff;
  border-color: rgba(216,180,255, 0.42);
}
body[data-theme="redesign"] .studio-overlay-btn.radar:hover {
  background: rgba(216,180,255, 0.28);
  color: #fff;
}
body[data-theme="redesign"] .studio-overlay-btn:disabled {
  opacity: 0.6;
  cursor: progress;
}
/* Round 13 (2026-05-17 night) — `.studio-overlay-radar-status` rule
   removed. The green "Submitted for Radar review" pill that used
   to sit alongside the Save & exit / Continue buttons on the Tier 1
   unlock card was redundant with the body subtitle (which carries
   the same statement). Removing the pill also stopped the two
   action buttons from being squeezed together. See the comment
   block in tierUnlock() in backend/creator/js/likeness-studio.js
   for the full rationale. */

/* When buttons are present the sub line gets a bit more breathing
   room above the action row. */
body[data-theme="redesign"] .studio-overlay[data-state^="unlocking"] .studio-overlay-sub {
  max-width: 320px;
  line-height: 1.5;
}

/* ── Round 8 (2026-05-17) — upload progress bar in the 'uploading'
   overlay state. Only painted when data-state="uploading"; hidden
   for checking / celebrating / unlocking / finale states. ────── */
body[data-theme="redesign"] .studio-overlay-progress {
  display: none;
  width: 100%;
  max-width: 280px;
  margin: 14px auto 0;
}
body[data-theme="redesign"] .studio-overlay[data-state="uploading"] .studio-overlay-progress {
  display: block;
}
body[data-theme="redesign"] .studio-overlay-progress-track {
  position: relative;
  height: 6px;
  background: rgba(255, 255, 255, 0.10);
  border-radius: 999px;
  overflow: hidden;
}
body[data-theme="redesign"] .studio-overlay-progress-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background: linear-gradient(90deg, #ffd1d1 0%, #ffb4b4 50%, #d97a99 100%);
  border-radius: 999px;
  box-shadow: 0 0 12px rgba(255, 180, 180, 0.55);
  transition: width 220ms ease-out;
}
/* Indeterminate (chunked encoding — no length-computable progress).
   Drives a sliding shimmer instead of width fill. */
body[data-theme="redesign"] .studio-overlay-progress.is-indeterminate .studio-overlay-progress-fill {
  width: 40%;
  animation: studio-overlay-progress-shimmer 1400ms ease-in-out infinite;
}
@keyframes studio-overlay-progress-shimmer {
  0%   { left: -40%; }
  100% { left: 100%; }
}
body[data-theme="redesign"] .studio-overlay-progress-label {
  margin-top: 8px;
  font-size: 12px;
  font-weight: 700;
  color: rgba(255, 230, 230, 0.78);
  font-variant-numeric: tabular-nums;
  text-align: center;
  letter-spacing: 0.02em;
}

/* Stalled-upload hint — fires after 20s without a progress event.
   Sub text gains an amber tint to signal "things are slow but not
   broken" without alarming red. */
body[data-theme="redesign"] .studio-overlay-sub.is-warning {
  color: #ffd4a1;
}

/* Round 12 (2026-05-17, post-round-11 retro) — when the save flow
   enters the server-processing state, the overlay collapses to a
   single-message view: spinner + ONE phase text (in sub) + the
   indeterminate-sweep bar.

   User principle that drove this round, verbatim:
     "ok I'm so confused there are so many messages in the same
      screen. […] and why the clock. only make the user frustrated
      the time that he is missing."

   So we hide msg + label-below-bar at this point — the phase
   ticker writes the only visible text into sub. The bar
   reuses the existing .is-indeterminate sweep (set by
   setUploadProgress when percent >= 100), so the visual is the
   same "working, unknown duration" animation creators see
   pre-upload. One animation, one mental model. */
body[data-theme="redesign"] .studio-overlay.is-server-processing .studio-overlay-msg {
  display: none;
}
body[data-theme="redesign"] .studio-overlay.is-server-processing .studio-overlay-progress-label {
  display: none;
}

/* Cancel host — empty by default, appears at the 90s threshold
   with the Cancel and try again button inside it. CSS collapses
   the wrapper when empty so it doesn't push the bar around. */
body[data-theme="redesign"] .studio-overlay-cancel-host:empty {
  display: none;
}
body[data-theme="redesign"] .studio-overlay-cancel-host {
  margin-top: 14px;
  display: flex;
  justify-content: center;
}
body[data-theme="redesign"] .studio-overlay-cancel-btn {
  /* Matches the existing .studio-overlay-btn.ghost surface so the
     Cancel offer feels integrated, not alarming. */
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(243, 238, 248, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.16);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
body[data-theme="redesign"] .studio-overlay-cancel-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

/* ── Round 8 — celebrating state click-gated. The base rule above
   sets `display: none` on .studio-overlay-sub during celebrating
   because the legacy 1.2s flash didn't need it. When .is-actionable
   is on the overlay (Continue button injected), re-show the sub
   region so the button can render. ──────────────────────────── */
body[data-theme="redesign"] .studio-overlay.is-actionable[data-state="celebrating"] .studio-overlay-sub {
  display: block;
  margin-top: 8px;
  /* Initial state — invisible; the JS toggles .is-on on the sub
     element a few frames after injection so the button fades in
     instead of popping. */
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 280ms ease-out, transform 280ms ease-out;
}
body[data-theme="redesign"] .studio-overlay.is-actionable[data-state="celebrating"] .studio-overlay-sub.is-on {
  opacity: 1;
  transform: translateY(0);
}
/* Single-button row layout — Continue alone, centered. */
body[data-theme="redesign"] .studio-overlay-actions-single {
  display: flex;
  justify-content: center;
  margin-top: 6px;
}

/* ════════════════════════════════════════════════════════════════════
   ADMIN THEME RESCUES — 2026-05-09
   ════════════════════════════════════════════════════════════════════
   Several admin pages (likeness, payments, channels, deals,
   generation-api, etc.) ship with light-theme-first patterns of
   `background: var(--text); color: var(--bg)` for active filters,
   accent stat cards, and primary buttons. In the legacy admin theme
   `--text=#0f0f12` and `--bg=#f4f5f7`, so those patterns rendered
   correctly as "dark pill, light text". On the redesign theme
   `--text=#fff` and `--bg=transparent`, so the pills became
   "white-on-transparent" — invisible text inside a white blob
   (see user screenshots 2026-05-09 of admin Likeness Vault filter
   chips + the giant white card on /admin/payments.html).
   This block fixes the patterns at the redesign-theme level so we
   don't have to touch every individual admin page.
   ════════════════════════════════════════════════════════════════════ */

/* ── Active filter pills (likeness.html, channels.html, etc.) ── */
body[data-theme="redesign"] .lkq-filter.on,
body[data-theme="redesign"] .uc-filter.on,
body[data-theme="redesign"] .cat-tab.active,
body[data-theme="redesign"] .filter-chip.active,
body[data-theme="redesign"] .filter-chip.on {
  background: rgba(255, 180, 180, 0.18);
  color: #ffd0d0;
  border-color: rgba(255, 180, 180, 0.42);
}

/* ── Accent stat tile (payments.html "Royall Platform Revenue",
        plus any generic `.widget.accent` / `.stat-card.accent` etc) ── */
body[data-theme="redesign"] .widget.accent,
body[data-theme="redesign"] .stat-card.accent,
body[data-theme="redesign"] .stat.accent {
  background: linear-gradient(135deg,
              rgba(255, 180, 180, 0.16) 0%,
              rgba(216, 180, 255, 0.12) 100%) !important;
  border-color: rgba(255, 180, 180, 0.32) !important;
  color: #fff !important;
}
body[data-theme="redesign"] .widget.accent .widget-label,
body[data-theme="redesign"] .widget.accent .widget-value,
body[data-theme="redesign"] .widget.accent .widget-sub {
  color: rgba(255, 255, 255, 0.92) !important;
}
body[data-theme="redesign"] .widget.accent .widget-label {
  color: rgba(243, 238, 248, 0.7) !important;
}
body[data-theme="redesign"] .widget.accent .widget-icon {
  background: rgba(255, 255, 255, 0.12) !important;
}

/* ── Primary admin buttons (deals.html download buttons, header
        accents, switchTab states, generation-api primary CTA) ── */
body[data-theme="redesign"] .gap-btn.primary,
body[data-theme="redesign"] .btn-primary-dark,
body[data-theme="redesign"] [style*="background:var(--text);color:#fff"],
body[data-theme="redesign"] [style*="background:var(--text);color:var(--bg)"],
body[data-theme="redesign"] [style*="background: var(--text); color: #fff"] {
  background: linear-gradient(135deg, #ffb4b4 0%, #b47878 100%) !important;
  color: #3d1d1d !important;
  border-color: transparent !important;
  box-shadow: 0 12px 32px -10px rgba(255, 180, 180, 0.55);
}
body[data-theme="redesign"] .gap-btn.primary:hover,
body[data-theme="redesign"] .btn-primary-dark:hover {
  background: linear-gradient(135deg, #ffd0d0 0%, #ffb4b4 100%) !important;
}

/* ── Inline #fff card backgrounds in deals.html, emails.html, etc.
        Match the surrounding wine + rose surfaces instead of stark
        white.  Last-resort attribute selector — only fires for the
        redesign theme. ── */
body[data-theme="redesign"] [style*="background:#fff"]:not(input):not(textarea),
body[data-theme="redesign"] [style*="background: #fff"]:not(input):not(textarea),
body[data-theme="redesign"] [style*="background:white"]:not(input):not(textarea),
body[data-theme="redesign"] [style*="background: white"]:not(input):not(textarea) {
  background: rgba(255, 255, 255, 0.04) !important;
}

/* ── Channels/active-tab variants that hardcode dark background ── */
body[data-theme="redesign"] [style*="background:var(--text);border-color:var(--text)"] {
  background: rgba(255, 180, 180, 0.18) !important;
  border-color: rgba(255, 180, 180, 0.42) !important;
  color: #ffd0d0 !important;
}

/* ── all-users.html — 17x white surfaces (inputs, dropdowns, table,
        pagination, column toggle, hover states, stripe pill).
        Selectors named explicitly because CSS can't match by
        computed value, and we don't want to edit the page itself. ── */
body[data-theme="redesign"] #filter-attr-menu,
body[data-theme="redesign"] #col-menu,
body[data-theme="redesign"] .filter-row,
body[data-theme="redesign"] .fr-op,
body[data-theme="redesign"] .fr-val,
body[data-theme="redesign"] .fr-remove,
body[data-theme="redesign"] .clear-filters-btn,
body[data-theme="redesign"] .export-btn,
body[data-theme="redesign"] .pg-btn,
body[data-theme="redesign"] .people-table-wrap {
  background: rgba(20, 12, 22, 0.92) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  color: rgba(243, 238, 248, 0.92) !important;
}
/* Row hover (was #f8f8fb pale gray, became bright bar in dark theme) */
body[data-theme="redesign"] .people-table-wrap tbody tr:hover,
body[data-theme="redesign"] .col-item:hover {
  background: rgba(255, 180, 180, 0.08) !important;
}
/* Stripe-not-connected pill (was #f5f5fa near-white) */
body[data-theme="redesign"] .stripe-no {
  background: rgba(255, 255, 255, 0.04) !important;
  border-color: rgba(255, 255, 255, 0.10) !important;
  color: rgba(243, 238, 248, 0.55) !important;
}
body[data-theme="redesign"] .stripe-yes {
  background: rgba(74, 222, 128, 0.12) !important;
  color: #86efac !important;
  border-color: rgba(74, 222, 128, 0.32) !important;
}
/* Toolbar buttons (Filter + Columns) — `background: #f8f8fb` in
   their CSS rules, rendered as light pills on white background;
   on dark theme they became near-white blobs. Match the rest of
   the toolbar surface treatment. */
body[data-theme="redesign"] #add-filter-btn,
body[data-theme="redesign"] #col-toggle-btn {
  background: rgba(255, 255, 255, 0.04) !important;
  border-color: rgba(255, 255, 255, 0.10) !important;
  color: rgba(243, 238, 248, 0.85) !important;
}
body[data-theme="redesign"] #add-filter-btn:hover,
body[data-theme="redesign"] #add-filter-btn.active,
body[data-theme="redesign"] #col-toggle-btn:hover {
  background: rgba(255, 180, 180, 0.10) !important;
  border-color: rgba(255, 180, 180, 0.42) !important;
  color: #ffd0d0 !important;
}
/* Search input focus state used `background: #fff` which created a
   focus-flash white box.  Keep the focus accent ring without the
   white background. */
body[data-theme="redesign"] #search-input:focus {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: rgba(255, 180, 180, 0.45) !important;
}
body[data-theme="redesign"] #filter-attr-menu {
  /* Slightly more opaque + a soft rose halo so the dropdown reads
     as a panel above the page rather than washed-into-it. */
  background: rgba(28, 16, 28, 0.96) !important;
  box-shadow: 0 16px 48px -12px rgba(0, 0, 0, 0.55),
              0 0 0 1px rgba(255, 180, 180, 0.16) !important;
  backdrop-filter: blur(8px);
}
body[data-theme="redesign"] .fa-item {
  color: rgba(243, 238, 248, 0.92) !important;
}
body[data-theme="redesign"] .fa-item:hover {
  background: rgba(255, 180, 180, 0.10) !important;
  color: #ffd0d0 !important;
}
body[data-theme="redesign"] #search-input,
body[data-theme="redesign"] #search-input:focus {
  background: rgba(255, 255, 255, 0.04) !important;
  color: #fff !important;
}
body[data-theme="redesign"] .fr-remove:hover {
  background: rgba(239, 68, 68, 0.16) !important;
  color: #fca5a5 !important;
}

/* ── deals.html drawer + sticky surfaces ── */
body[data-theme="redesign"] .drawer-side,
body[data-theme="redesign"] .drawer-header,
body[data-theme="redesign"] .drawer-foot {
  background: rgba(28, 16, 28, 0.96) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  color: rgba(243, 238, 248, 0.92) !important;
}

/* ── emails.html editor / gallery / modal surfaces ── */
body[data-theme="redesign"] #editorToolbar,
body[data-theme="redesign"] #galleryBox,
body[data-theme="redesign"] .modal,
body[data-theme="redesign"] #subjectInput,
body[data-theme="redesign"] #gallerySearch {
  background: rgba(28, 16, 28, 0.96) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  color: rgba(243, 238, 248, 0.92) !important;
}
body[data-theme="redesign"] #subjectInput:focus,
body[data-theme="redesign"] #gallerySearch:focus {
  border-color: rgba(255, 180, 180, 0.4) !important;
}
/* emails.html extras: test-email input + tbody hover + gallery thumbs */
body[data-theme="redesign"] #testEmailInput,
body[data-theme="redesign"] .gallery-thumb,
body[data-theme="redesign"] .gallery-thumb .g-name {
  background: rgba(255, 255, 255, 0.04) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  color: rgba(243, 238, 248, 0.92) !important;
}
body[data-theme="redesign"] .gallery-thumb {
  background: rgba(20, 12, 22, 0.6) !important;
}
body[data-theme="redesign"] tbody tr:hover {
  /* generic table-row hover (emails.html uses bare `tbody tr:hover`) */
  background: rgba(255, 180, 180, 0.08) !important;
}
body[data-theme="redesign"] .toggle-track::after {
  /* toggle-switch knob — keep it visible but match the rose accent */
  background: #ffd0d0 !important;
}

/* ── companies.html: reject button + lab-modal ── */
body[data-theme="redesign"] .co-action-btn.reject {
  background: rgba(239, 68, 68, 0.12) !important;
  color: #fca5a5 !important;
  border-color: rgba(239, 68, 68, 0.36) !important;
}
body[data-theme="redesign"] .lab-modal {
  background: rgba(28, 16, 28, 0.96) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  color: rgba(243, 238, 248, 0.92) !important;
}

/* ── Inline #f8f8fb / #f5f5fa pale-gray surfaces (search inputs in
        emails.html, code-pill table cells, gallery URL inputs) ── */
body[data-theme="redesign"] [style*="background:#f8f8fb"]:not(input):not(textarea),
body[data-theme="redesign"] [style*="background: #f8f8fb"]:not(input):not(textarea),
body[data-theme="redesign"] [style*="background:#f5f5fa"]:not(input):not(textarea),
body[data-theme="redesign"] [style*="background: #f5f5fa"]:not(input):not(textarea) {
  background: rgba(255, 255, 255, 0.06) !important;
  color: rgba(243, 238, 248, 0.92) !important;
}
/* Form inputs with the same pale-gray bg need a writable surface +
   readable text. Selectors include input/textarea here. */
body[data-theme="redesign"] input[style*="background:#f8f8fb"],
body[data-theme="redesign"] input[style*="background: #f8f8fb"],
body[data-theme="redesign"] textarea[style*="background:#f8f8fb"],
body[data-theme="redesign"] textarea[style*="background: #f8f8fb"] {
  background: rgba(255, 255, 255, 0.04) !important;
  color: #fff !important;
  border-color: rgba(255, 255, 255, 0.10) !important;
}

/* ── Creator Radar Settings modal (creator/likeness/modals.html) ──
   Same `background: #fff` pattern that bit the admin pages: segmented
   control's active segment + the source cards' "on" state both
   declared explicit white backgrounds in CSS rules.  On the dark
   redesign theme that's an opaque white pill against a wine modal
   surface — readable but visually jarring + the text sometimes
   becomes invisible (var(--text-1) was being overridden too).  */
body[data-theme="redesign"] .rs-seg.on {
  background: rgba(255, 180, 180, 0.16) !important;
  color: #ffd0d0 !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18) !important;
}
body[data-theme="redesign"] .rs-source {
  background: rgba(255, 255, 255, 0.04) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}
body[data-theme="redesign"] .rs-source.on {
  background: rgba(255, 180, 180, 0.10) !important;
  border-color: rgba(255, 180, 180, 0.36) !important;
  color: rgba(243, 238, 248, 0.92) !important;
  opacity: 1 !important;
}
body[data-theme="redesign"] .rs-source.on i {
  color: #ffd0d0 !important;
}
body[data-theme="redesign"] .rs-source-name {
  color: rgba(243, 238, 248, 0.92) !important;
}
body[data-theme="redesign"] .rs-source-state {
  color: rgba(243, 238, 248, 0.55) !important;
}
/* Muted "soon" pill on Sources used #eef2f7 — same near-white issue. */
body[data-theme="redesign"] .rs-pill-muted {
  background: rgba(255, 255, 255, 0.06) !important;
  color: rgba(243, 238, 248, 0.55) !important;
}

/* 2026-05-13 audit fix — radar settings modal cleanup.
   Cadence is read-only now (the scheduler runs tiered free/paid
   intervals, not a per-creator setting). The "Daily" / "Weekly"
   rows below replace the deprecated Daily/Weekly/Monthly segmented
   buttons. */
body[data-theme="redesign"] .rs-cadence-readonly {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
body[data-theme="redesign"] .rs-cadence-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
}
body[data-theme="redesign"] .rs-cadence-row-label {
  flex-shrink: 0;
  width: 70px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: #ffb4b4;
}
body[data-theme="redesign"] .rs-cadence-row-value {
  font-size: 13px;
  color: rgba(243, 238, 248, 0.82);
  letter-spacing: -0.005em;
}

/* Static "always-on" row used for the Smart query expansion entry
   in "What to scan for" — same shape as a normal rs-row but the
   toggle slot carries a label instead. */
body[data-theme="redesign"] .rs-row-static .rs-row-always-on {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255, 180, 180, 0.14);
  border: 1px solid rgba(255, 180, 180, 0.32);
  color: #ffd0d0;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Sentinel footer block under "Sources we scan" — a complementary
   channel disclosure so creators don't think the seed list is the
   only signal source. */
body[data-theme="redesign"] .rs-sentinel-footer {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-top: 14px;
  padding: 14px 16px;
  background: linear-gradient(135deg,
              rgba(255, 180, 180, 0.08),
              rgba(255, 180, 180, 0.02));
  border: 1px solid rgba(255, 180, 180, 0.18);
  border-radius: 12px;
}
body[data-theme="redesign"] .rs-sentinel-icon {
  flex-shrink: 0;
  width: 32px; height: 32px;
  border-radius: 8px;
  background: rgba(255, 180, 180, 0.14);
  border: 1px solid rgba(255, 180, 180, 0.24);
  display: flex; align-items: center; justify-content: center;
  color: #ffb4b4;
}
body[data-theme="redesign"] .rs-sentinel-icon svg {
  width: 16px; height: 16px;
}
body[data-theme="redesign"] .rs-sentinel-title {
  font-size: 12px;
  font-weight: 800;
  color: #ffd0d0;
  letter-spacing: 0.02em;
  margin-bottom: 4px;
}
body[data-theme="redesign"] .rs-sentinel-sub {
  font-size: 11px;
  color: rgba(243, 238, 248, 0.62);
  line-height: 1.5;
}
body[data-theme="redesign"] .rs-sentinel-sub a {
  color: #ffd0d0;
  text-decoration: underline;
}
body[data-theme="redesign"] .rs-sentinel-sub a:hover {
  color: #fff;
}

/* 2026-05-13 — vault assets leaf editorial header.
   Sits between the tabs and the asset-card grid on
   `/creator/likeness/assets.html`. Anchors the section with a
   display-weight title + a state-aware subtitle that's painted by
   `paintVaultIntro()` in likeness.js. Pre-fix the page jumped
   straight from tabs to cards and the upper third read as a void.

   Typography hierarchy mirrors the redesign mockups: small
   rose eyebrow → big white display title → muted off-white sub. */
body[data-theme="redesign"] .lk-vault-intro {
  margin: 40px 0 28px;
  max-width: 720px;
}
body[data-theme="redesign"] .lk-vault-intro-eyebrow {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #ffb4b4;
  margin-bottom: 12px;
}
body[data-theme="redesign"] .lk-vault-intro-title {
  font-size: 38px;
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: rgba(243, 238, 248, 0.96);
  margin: 0 0 14px;
}
body[data-theme="redesign"] .lk-vault-intro-sub {
  font-size: 15px;
  line-height: 1.55;
  color: rgba(243, 238, 248, 0.62);
  margin: 0;
  max-width: 560px;
  /* Subtle fade as the state-aware copy gets swapped in to avoid a
     hard jump from the placeholder line to the resolved subtitle. */
  transition: opacity 0.24s ease;
}
@media (max-width: 720px) {
  body[data-theme="redesign"] .lk-vault-intro {
    margin: 28px 0 22px;
  }
  body[data-theme="redesign"] .lk-vault-intro-title {
    font-size: 30px;
  }
  body[data-theme="redesign"] .lk-vault-intro-sub {
    font-size: 14px;
  }
}

/* 2026-05-13 — brand-logo fix.
   The base `.lk-radar-brand-logo` rule in style.css applies
   `filter: brightness(0)` to collapse simple-icons SVGs into a
   black silhouette. That was a legacy *light-theme* tactic — on
   the wine + rose redesign every radar surface is dark-on-dark, so
   black silhouettes either vanish (simple-icons brands like
   YouTube + Apple Podcasts whose SVG is path-only on a transparent
   background) or paint an opaque black square (the Civitai +
   OpenArt custom SVGs that emitted a full-viewBox `<rect>` for
   their brand gradient).

   The fix chains a second filter so the silhouette inverts to
   *white*: `brightness(0)` collapses any color to black, then
   `invert(1)` flips black to white. Works for every brand the
   radar renders (settings modal source cards, match-card
   thumbnails, platform-filter chips). Civitai + OpenArt were
   simultaneously rewritten in `likeness.js` to drop their
   background `<rect>` so the filter produces a clean monochrome
   glyph instead of a filled square. */
body[data-theme="redesign"] .lk-radar-brand-logo {
  filter: brightness(0) invert(1) !important;
}

/* ── Phase R9 (2026-05-09) — dev-only Demo/Real provider toggle.
   Sits in the Radar page headerbar next to Settings + Scan now.
   Segmented control with two pills; the active pill gets the rose
   accent treatment and Scan now uses the matching provider. */
body[data-theme="redesign"] .dev-provider-toggle {
  display: inline-flex;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 180, 180, 0.24);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
  position: relative;
}
body[data-theme="redesign"] .dev-provider-toggle::before {
  /* Tiny "DEV" tag on the top-left corner so it's obvious this control
     doesn't ship to prod. */
  content: 'DEV';
  position: absolute;
  top: -7px; left: 8px;
  font-size: 9px; font-weight: 800;
  letter-spacing: 0.06em;
  color: #ffd0d0;
  background: linear-gradient(135deg, rgba(28,16,28,0.96), rgba(40,20,30,0.96));
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid rgba(255, 180, 180, 0.32);
  pointer-events: none;
}
body[data-theme="redesign"] .dev-provider-pill {
  appearance: none; border: none; background: transparent;
  font: inherit; font-weight: 700; font-size: 12px;
  color: rgba(243, 238, 248, 0.55);
  padding: 5px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
body[data-theme="redesign"] .dev-provider-pill:hover {
  color: rgba(243, 238, 248, 0.85);
}
body[data-theme="redesign"] .dev-provider-pill.on {
  background: rgba(255, 180, 180, 0.16);
  color: #ffd0d0;
}

/* ── Phase S3: end-of-session finale (2026-05-13) ─────────────────────────
   Fired when every prompt in the asset has a sample. Bigger card than
   the per-tier unlock, three stat tiles, drifting rose particles,
   single "Back to vault" CTA. Replaces the per-tier unlock beat when
   applicable so the creator doesn't sit through two celebratory
   cards back-to-back.

   Built on top of the existing .studio-overlay shell — same backdrop
   blur + dark scrim — so the visual language matches the per-prompt
   moment. Only the inner card + new sub-elements (particles, stats)
   get unique styling. */

body[data-theme="redesign"] .studio-overlay[data-state="finale"] .studio-overlay-card {
  padding: 56px 64px 48px;
  min-width: 520px;
  max-width: 600px;
  gap: 18px;
  position: relative;     /* anchor for absolute-positioned particles */
  overflow: hidden;        /* clip particles drifting up past the top */
}

/* Particles container — fills the card; particles are absolutely
   positioned within it. Pointer-events: none so the underlying CTA
   stays clickable. */
body[data-theme="redesign"] .studio-finale-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  border-radius: 28px;     /* match card corners so particles don't peek out */
}

/* Each particle is a small rose dot that drifts up + fades.
   --x : horizontal start position (percent across the card)
   --d : animation delay (staggered across particles)
   --s : scale multiplier so the field isn't uniform
   Travels ~140% of the card height so it disappears past the top
   edge. 5.4s duration with `infinite` makes the field feel alive
   for the entire time the user lingers on the finale. */
body[data-theme="redesign"] .studio-finale-particle {
  position: absolute;
  bottom: -14px;
  left: var(--x, 50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%,
    rgba(255, 240, 240, 0.95) 0%,
    rgba(255, 180, 180, 0.70) 40%,
    rgba(255, 180, 180, 0.00) 100%);
  transform: scale(var(--s, 1));
  opacity: 0;
  animation: studio-finale-particle 5.4s ease-in-out var(--d, 0s) infinite;
  filter: blur(0.4px);
}
@keyframes studio-finale-particle {
  /* Drift ~420px up — clears the top of the card (which is ~430-470px
     tall with all 3 stats + CTA). The card has overflow:hidden so any
     particle that escapes the card bounds disappears cleanly. */
  0%   { transform: translateY(0)      scale(var(--s, 1));        opacity: 0; }
  10%  {                                                            opacity: 0.95; }
  85%  {                                                            opacity: 0.8; }
  100% { transform: translateY(-460px) scale(calc(var(--s, 1) * 0.6)); opacity: 0; }
}

/* The hero art slot — sparkles icon on the gradient disc. Inherits
   the gradient + box-shadow from celebrating-state but with a
   slightly larger pulse. Phase S3 sparkles read as "completion +
   shine" rather than the standard checkmark used per-prompt. */
body[data-theme="redesign"] .studio-overlay[data-state="finale"] .studio-overlay-art {
  width: 96px;
  height: 96px;
  background: linear-gradient(160deg, #ffd0d0 0%, #b87474 100%);
  color: #fff;
  box-shadow:
    0 0 100px rgba(255,180,180,0.65),
    inset 0 0 32px rgba(255,255,255,0.30);
  animation: studio-finale-art 700ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
  position: relative;
  z-index: 2;
}
body[data-theme="redesign"] .studio-overlay[data-state="finale"] .studio-overlay-art svg {
  width: 56px;
  height: 56px;
  filter: drop-shadow(0 0 12px rgba(255,255,255,0.55));
}
@keyframes studio-finale-art {
  0%   { transform: scale(0.55) rotate(-8deg); opacity: 0; }
  60%  { transform: scale(1.08) rotate(2deg);  opacity: 1; }
  100% { transform: scale(1.0)  rotate(0deg);  opacity: 1; }
}

/* Title — slightly bigger than tier-unlock so the finale feels like
   the bigger moment. */
body[data-theme="redesign"] .studio-overlay[data-state="finale"] .studio-overlay-title {
  font-size: 38px;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: #fff;
  position: relative;
  z-index: 2;
}
body[data-theme="redesign"] .studio-overlay[data-state="finale"] .studio-overlay-eyebrow {
  color: #ffd0d0;
  margin-bottom: 4px;
}
body[data-theme="redesign"] .studio-overlay[data-state="finale"] .studio-overlay-msg {
  position: relative;
  z-index: 2;
}
body[data-theme="redesign"] .studio-overlay[data-state="finale"] .studio-overlay-sub {
  display: block;       /* the celebrating-state hides this; un-hide for finale */
  font-size: 14px;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.55;
  max-width: 440px;
  margin: 0 auto -4px;
  position: relative;
  z-index: 2;
  animation: none;
}

/* Stats row — three large numerals with small uppercase labels. */
body[data-theme="redesign"] .studio-finale-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  width: 100%;
  margin-top: 8px;
  margin-bottom: 4px;
  position: relative;
  z-index: 2;
}
body[data-theme="redesign"] .studio-finale-stat {
  padding: 18px 14px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 180, 180, 0.18);
  border-radius: 16px;
  text-align: center;
  backdrop-filter: blur(8px);
}
body[data-theme="redesign"] .studio-finale-stat-num {
  font-size: 24px;
  font-weight: 900;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #ffe6e6 0%, #ffb4b4 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1;
  margin-bottom: 6px;
}
body[data-theme="redesign"] .studio-finale-stat-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(243, 238, 248, 0.62);
}

/* Actions row — finale only has one button, but reuse the existing
   .studio-overlay-actions flex layout. */
body[data-theme="redesign"] .studio-overlay[data-state="finale"] .studio-overlay-actions {
  margin-top: 8px;
  position: relative;
  z-index: 2;
}

@media (prefers-reduced-motion: reduce) {
  body[data-theme="redesign"] .studio-finale-particle,
  body[data-theme="redesign"] .studio-overlay[data-state="finale"] .studio-overlay-art {
    animation: none !important;
  }
  body[data-theme="redesign"] .studio-finale-particle {
    opacity: 0.4;
  }
}

/* ── Phase S4 (2026-05-13): voice preflight ──────────────────────────────
   When the record button is in preflight state (mic-level check in
   progress, real recorder hasn't started), give the button a softer
   pulse so the creator's mental model is "listening, not yet
   recording." Distinct from the full .recording state (solid red /
   stop-icon) so a future-self glance at a screenshot can tell which
   phase we were in.
   Inherits .recording's color tokens but adds an outer ring that
   breathes — same visual language as the env-pill dot on the dashboard. */
body[data-theme="redesign"] .studio-recbtn.preflighting {
  animation: studio-preflight-pulse 1400ms ease-in-out infinite;
  box-shadow:
    0 0 0 0 rgba(255, 180, 180, 0.55),
    0 8px 24px -8px rgba(255, 180, 180, 0.40);
}
@keyframes studio-preflight-pulse {
  0%, 100% { box-shadow: 0 0 0 0  rgba(255, 180, 180, 0.55),
                          0 8px 24px -8px rgba(255, 180, 180, 0.40); }
  50%      { box-shadow: 0 0 0 12px rgba(255, 180, 180, 0.00),
                          0 8px 24px -8px rgba(255, 180, 180, 0.40); }
}
@media (prefers-reduced-motion: reduce) {
  body[data-theme="redesign"] .studio-recbtn.preflighting {
    animation: none !important;
  }
}

/* ── Phase S5 (2026-05-13) — fun layer ───────────────────────────────
   Streak chip — "N in a row" with a flame icon. Lives inside
   .tier-status, surfaces only when _currentStreak >= 2. Rose-tinted
   pill that picks up the same wine+rose language as the studio
   chrome (matches .tier-legend.is-active visually so it feels native
   instead of a foreign sticker).

   Three pieces:
   - `.tier-status-streak`         : the pill itself (display flipped
                                     on/off by JS via inline style)
   - `.tier-status-streak-num`     : the count (the visual hero — the
                                     flame icon is decoration, the
                                     NUMBER is what the creator scans)
   - `.tier-status-streak-label`   : "in a row" tail
   - `.just-bumped` modifier       : scale-pop animation re-triggered
                                     on every increment so each save
                                     gets a tiny moment of delight   */
body[data-theme="redesign"] .tier-status-streak {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding: 4px 10px 4px 8px;
  border-radius: 999px;
  background: linear-gradient(135deg,
              rgba(255, 180, 180, 0.16),
              rgba(255, 180, 180, 0.08));
  border: 1px solid rgba(255, 180, 180, 0.32);
  color: #ffd0d0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.06) inset,
    0 4px 12px -6px rgba(255, 100, 100, 0.35);
}
body[data-theme="redesign"] .tier-status-streak [data-lucide="flame"],
body[data-theme="redesign"] .tier-status-streak svg {
  width: 12px; height: 12px;
  color: #ffb4b4;
  flex-shrink: 0;
}
body[data-theme="redesign"] .tier-status-streak-num {
  font-size: 12px;
  font-weight: 900;
  color: #fff;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
body[data-theme="redesign"] .tier-status-streak-label {
  opacity: 0.85;
}

/* Pop on every increment — the JS toggles `.just-bumped` off then
   back on (with a forced reflow between) so the animation re-fires
   even when only the number text changes. Short + restrained — this
   is meant to draw a microsecond of attention to the chip, not turn
   it into a parade float. */
body[data-theme="redesign"] .tier-status-streak.just-bumped {
  animation: tier-status-streak-bump 420ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes tier-status-streak-bump {
  0%   { transform: scale(1);    }
  35%  { transform: scale(1.12); }
  100% { transform: scale(1);    }
}
@media (prefers-reduced-motion: reduce) {
  body[data-theme="redesign"] .tier-status-streak.just-bumped {
    animation: none !important;
  }
}

/* ────────────────────────────────────────────────────────────────────
   PWA Phase 1E — iOS Safari mobile hardening (2026-05-25)
   ────────────────────────────────────────────────────────────────────
   The portal went PWA-installable in Phase 1A. With creators now
   using these pages on iPhones in standalone mode, we hit a handful
   of iOS-specific papercuts that don't show up on desktop:

   1) Inputs with font-size < 16px trigger automatic viewport zoom
      on focus, then zoom back out on blur. A jarring jolt on every
      form field. Bump form inputs to 16px on coarse-pointer (touch)
      so iOS leaves the viewport alone. Desktop stays at 14px for
      visual density.

   2) The brand-foot lives at position:absolute / bottom:0 of the
      body, which with viewport-fit=cover lands behind the home-
      indicator gesture zone on iPhone 14+. Adding bottom safe-area
      padding to the body shifts everything up cleanly — content
      no longer scrolls into the unreachable strip.

   3) Apple HIG calls for minimum 44×44 px touch targets. The modal
      close buttons (.modal-close, .lk-modal-x) are 32×32 — easy to
      misclick on a finger. Bump to 44×44 on touch devices only; on
      desktop the 32×32 with a 16px icon looks intentional.

   The @media (hover: none) and (pointer: coarse) query targets
   genuine touch devices and skips desktop browsers in their dev-
   tools-responsive simulators. Behavior unchanged on every desktop
   and laptop. */

/* Bottom safe-area for the document — keeps content above the iOS
   home-indicator zone. env(safe-area-inset-bottom) returns 0 on
   non-iOS so this is safe to set unconditionally. */
body[data-theme="redesign"] {
  padding-bottom: env(safe-area-inset-bottom);
}

@media (hover: none) and (pointer: coarse) {
  /* No-zoom inputs on iOS — 16px is the threshold below which
     Safari auto-zooms on focus. Applies to every text-ish input
     using our shared .input class (signup, settings, profile,
     onboarding, etc.). */
  body[data-theme="redesign"] .input { font-size: 16px; }

  /* 44×44 touch targets on modal close buttons (Apple HIG). The
     16px close icon is already centered via flex, so just bumping
     the box absorbs the change without altering the icon. */
  body[data-theme="redesign"] .modal-close,
  body[data-theme="redesign"] .lk-modal-x {
    width: 44px;
    height: 44px;
  }

  /* B-3 (STUDIO-IOS-CAPTURE-AUDIT-2026-06-08) — studio capture controls
     to the Apple-HIG 44×44 minimum so they're hittable one-handed mid-
     capture on a phone. Scoped to touch (this query) so the GLOBAL tokens
     (.orb-xs / .btn-sm — used in admin tables) aren't enlarged on desktop.
     Same treatment PWA Phase 1E gave the modal close buttons (the studio
     controls were missed). min-* wins over the fixed width/height. */
  body[data-theme="redesign"] .orb-xs,           /* Back orb (36px) */
  body[data-theme="redesign"] .studio-voice-toggle,  /* voice toggle (28px) */
  body[data-theme="redesign"] .tier-roadmap-close {  /* roadmap X (28px) */
    min-width: 44px;
    min-height: 44px;
  }
  /* These are text+padding buttons — only the height needs the floor; the
     width is driven by the label. */
  body[data-theme="redesign"] .btn.btn-sm,
  body[data-theme="redesign"] .studio-nav-btn {
    min-height: 44px;
  }
}
