/* ── TOKENS — single BLACK GLASS theme (no light mode) ── */
:root {
  /* Neutral scale, tuned for a permanent dark / black-glass system */
  --neutral-0: hsl(0 0% 7%);
  --neutral-5: hsl(0 0% 10%);
  --neutral-10: hsl(0 0% 14%);
  --neutral-20: hsl(0 0% 20%);
  --neutral-40: hsl(0 0% 38%);
  --neutral-60: hsl(0 0% 56%);
  --neutral-80: hsl(0 0% 75%);
  --neutral-90: hsl(0 0% 88%);
  --neutral-100: hsl(0 0% 96%);

  --bg-primary: hsl(0 0% 8%);
  --bg-secondary: hsl(0 0% 100% / 6%);
  --bg-tertiary: hsl(0 0% 100% / 10%);
  --bg-inverse: hsl(0 0% 96%);
  --bg-inverse-hover: hsl(0 0% 88%);

  --text-primary: hsl(0 0% 96%);
  --text-secondary: hsl(0 0% 56%);
  --text-tertiary: hsl(0 0% 38%);
  --text-inverse: hsl(0 0% 8%);

  --border-divider: hsl(0 0% 100% / 8%);
  --border-secondary: hsl(0 0% 100% / 8%);
  --border-tertiary: hsl(0 0% 100% / 14%);

  /* ── UNIFIED GLASS SYSTEM ──
     One panel language shared by every major UI block: a low-opacity
     light fill over black, a soft hairline border, blur, a faint top
     highlight, and one consistent shadow depth. */
  --glass-bg: hsl(0 0% 100% / 4%);
  --glass-bg-strong: hsl(0 0% 100% / 6.5%);
  --glass-border: hsl(0 0% 100% / 9%);
  --glass-blur: blur(22px) saturate(150%);
  --glass-highlight: inset 0 1px 0 hsl(0 0% 100% / 6%);
  --shadow-panel: 0 24px 70px hsl(0 0% 0% / 45%);
  --shadow-soft: 0 8px 30px hsl(0 0% 0% / 32%);

  --nav-glass: hsl(0 0% 7% / 55%);
  --nav-border: hsl(0 0% 100% / 9%);
  --nav-shadow:
    0 10px 40px hsl(0 0% 0% / 50%),
    inset 0 1px 0 hsl(0 0% 100% / 7%);

  --font: 'Saans', 'Inter', system-ui, sans-serif;
  --feature-settings: "dlig" on, "ss07" on, "calt" off;

  /* Shared horizontal page inset. Never narrower than the original 80px, grows
     gently on wider screens for breathing room without feeling narrow. Every
     full-width section uses this so left/right spacing stays consistent. */
  --page-x: clamp(80px, 7vw, 140px);

  /* Shared VERTICAL section rhythm. Replaces the per-section fixed 100–120px
     block padding so vertical breathing room scales with the viewport instead
     of being pinned to one resolution: tighter on short laptops, more generous
     on large displays. Tuned so it lands at ~its old value on a ~1500px screen,
     so nothing shifts on the desktop it was designed at. */
  --section-y: clamp(72px, 8vw, 128px);

  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --radius-full: 9999px;
}

/* ── RESET ── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  font-feature-settings: var(--feature-settings);
  -webkit-font-smoothing: antialiased;
  /* Black-glass atmosphere: true-black base lifted by soft, colorless
     radial gradients + a vertical falloff. Fixed so it reads as ambient
     depth behind the glass UI rather than scrolling content. */
  background-color: #000;
  background-image:
    radial-gradient(125% 85% at 50% -15%, hsl(0 0% 18% / 55%) 0%, transparent 55%),
    radial-gradient(110% 70% at 100% 0%, hsl(0 0% 14% / 38%) 0%, transparent 50%),
    radial-gradient(110% 75% at 0% 100%, hsl(0 0% 12% / 42%) 0%, transparent 55%),
    linear-gradient(180deg, hsl(0 0% 6%) 0%, hsl(0 0% 3%) 45%, hsl(0 0% 1.5%) 100%);
  background-attachment: fixed;
  background-repeat: no-repeat;
  color: var(--text-primary);
  line-height: 1.5;
  overflow-x: hidden;
}

img,
video {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

ul,
ol {
  list-style: none;
}

/* ── TYPOGRAPHY SCALE (Mobbin) ── */
.text-showcase {
  font-size: 80px;
  line-height: 80px;
  letter-spacing: -0.6px;
  font-weight: 652;
}

.text-spotlight {
  font-size: 56px;
  line-height: 56px;
  letter-spacing: -0.6px;
  font-weight: 652;
}

.text-title-1 {
  font-size: 44px;
  line-height: 44px;
  letter-spacing: -0.4px;
  font-weight: 652;
}

.text-title-2 {
  font-size: 32px;
  line-height: 36px;
  letter-spacing: 0;
  font-weight: 652;
}

.text-title-3 {
  font-size: 24px;
  line-height: 30px;
  letter-spacing: 0;
  font-weight: 652;
}

.text-feature-bold {
  font-size: 20px;
  line-height: 26px;
  font-weight: 600;
}

.text-feature {
  font-size: 20px;
  line-height: 26px;
  font-weight: 440;
}

.text-body-bold {
  font-size: 16px;
  line-height: 22px;
  letter-spacing: 0.2px;
  font-weight: 600;
}

.text-body {
  font-size: 16px;
  line-height: 22px;
  letter-spacing: 0.2px;
  font-weight: 456;
}

.text-compact-bold {
  font-size: 14px;
  line-height: 20px;
  letter-spacing: 0.2px;
  font-weight: 600;
}

.text-compact {
  font-size: 14px;
  line-height: 20px;
  letter-spacing: 0.2px;
  font-weight: 456;
}

.text-caption {
  font-size: 12px;
  line-height: 16px;
  letter-spacing: 0.2px;
  font-weight: 456;
}

/* Launch button "running" state — floating lyrics are already active, so the
   button is inactive: dimmed, not clickable, no hover affordance. */
.btn-primary.is-running,
.nav-btn-primary.is-running {
  opacity: 0.45;
  cursor: default;
  pointer-events: none;
}

.btn-primary.is-running:hover,
.nav-btn-primary.is-running:hover {
  background: var(--bg-inverse);
}

/* ── SETTINGS PANEL / CONTROLLER (black glass) ──
   Shared controller surface and fallback geometry. The marketing page owns its
   responsive viewport placement in marketing.css; the extension reframes the
   same surface for its popup. Keeping the fallback out of normal flow prevents
   the controller from reflowing surrounding content on any host. */
.settings-panel {
  position: absolute;
  top: 14%;
  left: calc(50% - 200px);
  width: 320px;
  z-index: 200;
  background: hsl(0 0% 9% / 72%);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-panel), var(--glass-highlight);
  transition: opacity 0.3s ease, transform 0.3s ease;
  user-select: none;
}

.settings-panel.hidden {
  opacity: 0;
  transform: translateY(12px) scale(0.98);
  pointer-events: none;
}

.settings-drag {
  cursor: grab;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.settings-drag:active {
  cursor: grabbing;
}

.settings-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 18px 16px 16px;
  border-bottom: 1px solid var(--border-secondary);
}

.settings-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
}

.settings-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--text-secondary);
  transition: background 0.15s;
}

.settings-close:hover {
  background: var(--bg-tertiary);
}

.settings-body {
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.setting-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.setting-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  justify-content: space-between;
}

.setting-val {
  color: var(--text-primary);
}
#letter-spacing-val { text-transform: none; }

.setting-select {
  width: 100%;
  padding: 10px 12px;
  background-color: var(--glass-bg-strong);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 14px;
  outline: none;
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.setting-select:focus {
  border-color: var(--text-primary);
}

.status-row {
  flex-direction: row !important;
  align-items: center;
  justify-content: space-between;
}

.marquee-container {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  mask-image: linear-gradient(to right, transparent, black 8%, black 92%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, black 8%, black 92%, transparent);
  margin-right: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.marquee-container.is-scrolling {
  justify-content: flex-start;
}

.track-title-label {
  display: inline-block;
  color: #00c853 !important;
  /* Vibrant Green */
  font-weight: 700 !important;
  font-size: 13px !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  flex-shrink: 0;
}

.track-title-label.scrolling {
  animation: marquee 10s linear infinite;
  padding-right: 0;
  /* Handled by text duplication */
}

.track-title-label.scrolling:hover {
  animation-play-state: paused;
}

@keyframes marquee {
  0% {
    transform: translateX(0);
  }

  100% {
    transform: translateX(-50%);
  }
}

.tab-switch-btn {
  position: relative;
  overflow: visible;
  background: hsl(0 0% 100% / 8%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid hsl(0 0% 100% / 15%);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 20px hsl(0 0% 0% / 20%);
  flex-shrink: 0;
}

.tab-switch-count {
  position: absolute;
  top: -6px;
  right: -5px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(105, 217, 155, 0.45);
  border-radius: 999px;
  background: #17352a;
  color: #c8f6dc;
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  pointer-events: none;
}
.tab-switch-count[hidden] { display: none; }

.tab-switch-btn:hover {
  background: hsl(0 0% 100% / 12%);
  border-color: var(--text-primary);
  transform: translateX(2px);
  box-shadow: 0 6px 16px hsl(0 0% 0% / 20%);
}

.tab-switch-btn.hidden {
  display: none;
}

.tab-drawer {
  position: absolute;
  left: calc(100% + 12px);
  top: 0;
  width: 240px;
  /* Header-pinned flex column: the list child fills the remaining height and
     scrolls; this max-height (viewport-based for the fly-out) is the "available
     space" the list uses before scrolling. The extension popup overrides the
     max-height with its own popup-relative value. */
  display: flex;
  flex-direction: column;
  max-height: 70vh;
  background: hsl(0 0% 9% / 80%);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: 0 12px 60px hsl(0 0% 0% / 40%), var(--glass-highlight);
  opacity: 0;
  transform: translateX(-10px) scale(0.95);
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 199;
}

.tab-drawer.open {
  opacity: 1;
  transform: translateX(0) scale(1);
  pointer-events: all;
}

.drawer-header {
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: none;   /* stay pinned; only the list below scrolls */
}

.drawer-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.drawer-subtitle {
  font-size: 10px;
  color: var(--text-tertiary);
}

.tab-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  /* Scroll region: fill the drawer's remaining height (below the pinned header)
     and scroll only once the tabs actually exceed it — so cards keep their
     natural height and the drawer's available space is used before scrolling.
     Minimal scrollbar matches .font-list / .style-list. */
  flex: 0 1 auto;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-tertiary) transparent;
}
.tab-list::-webkit-scrollbar { width: 6px; }
.tab-list::-webkit-scrollbar-track { background: transparent; }
.tab-list::-webkit-scrollbar-thumb { background: var(--border-tertiary); border-radius: 99px; }
.tab-list:hover::-webkit-scrollbar-thumb { background: var(--text-tertiary); }

.tab-item {
  padding: 8px 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-secondary);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
  flex-shrink: 0;   /* keep natural card height — the list scrolls, cards never compress */
}

.tab-item:hover {
  background: var(--bg-tertiary);
  border-color: var(--border-tertiary);
  color: var(--text-primary);
}

.tab-item.active {
  background: var(--bg-inverse);
  color: var(--text-inverse);
  border-color: var(--bg-inverse);
  font-weight: 600;
}

.setting-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 4px;
  background: var(--bg-tertiary);
  border-radius: 99px;
  outline: none;
  cursor: pointer;
}

.setting-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--bg-inverse);
  box-shadow: 0 1px 4px hsl(0 0% 0% / 24%);
  cursor: pointer;
}

.lines-control {
  display: flex;
  align-items: center;
  gap: 16px;
}

.lines-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--text-primary);
  transition: background 0.15s;
}

.lines-btn:hover {
  background: var(--bg-tertiary);
}

.lines-num {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  min-width: 24px;
  text-align: center;
}

.segment-control {
  display: flex;
  background: var(--bg-secondary);
  border: 1px solid var(--border-secondary);
  border-radius: var(--radius-sm);
  padding: 2px;
  gap: 2px;
}

.segment-btn {
  flex: 1;
  text-align: center;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  border-radius: calc(var(--radius-sm) - 2px);
  transition: all 0.2s ease;
}

.segment-btn:hover {
  color: var(--text-primary);
}

.segment-btn.active {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  box-shadow: 0 1px 4px hsl(0 0% 0% / 30%);
}

.alignment-options { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; width: 100%; }
.alignment-option {
  min-width: 0;
  min-height: 32px;
  padding: 6px 3px;
  border: 1px solid var(--border-secondary);
  border-radius: 9px;
  background: var(--bg-primary);
  color: var(--text-secondary);
  font: 600 11px/1 var(--font);
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, color .16s ease;
}
.alignment-option:hover { border-color: var(--border-tertiary); color: var(--text-primary); }
.alignment-option.active { border-color: rgba(255,255,255,.25); background: var(--bg-tertiary); color: var(--text-primary); }

/* ── PREMIUM CONTROLLER: tabs, triggers, drawers, color picker ── */

/* Reusable inline icon — inherits text color + sizes with em */
.ic {
  width: 1em;
  height: 1em;
  display: inline-block;
  vertical-align: -0.12em;
  flex-shrink: 0;
}

/* PRO pill — the "this is a Pro item" marker (studio-tool, not emoji) */
.pro-pill {
  display: inline-flex;
  align-items: center;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.8px;
  line-height: 1;
  padding: 3px 5px 2px;
  border-radius: 4px;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  border: 1px solid var(--border-tertiary);
  text-transform: uppercase;
}

/* Section tabs reuse .segment-control; lock glyph sits inline */
.settings-tabs { margin-bottom: 2px; }
.tab-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 4px; }
/* Lock glyph — the "gated right now" marker */
.tab-lock {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  opacity: 0.75;
  color: var(--text-tertiary);
}
.inline-lock {
  font-size: 9px;
  opacity: 0.7;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-tertiary);
}
/* Premium tabs hide their lock once unlocked */
.settings-panel.is-premium .tab-lock { display: none; }
.settings-panel.is-premium .inline-lock { display: none; }

/* Only one panel visible at a time → panel never grows with feature count.
   The content area is a FIXED height so switching Display / Font / Motion never
   resizes the controller — taller tabs scroll internally instead of stretching
   the panel. This gives the stable "studio panel" feel. */
.tab-panel {
  display: none;
  flex-direction: column;
  gap: 16px;
  position: relative;
  height: 300px;
  max-height: 52vh;
  overflow-y: auto;
  overflow-x: hidden;
  /* Reserve the scrollbar lane so width is identical with or without a scrollbar */
  scrollbar-gutter: stable;
}
.tab-panel.active { display: flex; }
/* Display has no lyric card; size it to the remaining controls. */
.tab-panel[data-panel="display"],
body.marketing-page .tab-panel[data-panel="display"] { height: auto; }

/* Thin, unobtrusive scrollbar — keeps the panel feeling premium when a tab scrolls */
.tab-panel::-webkit-scrollbar { width: 6px; }
.tab-panel::-webkit-scrollbar-track { background: transparent; }
.tab-panel::-webkit-scrollbar-thumb {
  background: var(--border-secondary);
  border-radius: 3px;
}
.tab-panel::-webkit-scrollbar-thumb:hover { background: var(--text-tertiary); }
/* Rows keep their natural height so overflow scrolls instead of squishing them */
.tab-panel > * { flex-shrink: 0; }

/* ── Shortcut discovery hint ─────────────────────────────────────────────
   Clean, understated shortcut reference at the bottom of personalization tabs. */
.shortcut-hint {
  flex-shrink: 0;
  margin-top: auto;
  padding: 8px 0 2px;
  text-align: center;
  font-size: 11px;
  line-height: 1.4;
  color: var(--text-secondary);
  letter-spacing: 0.01em;
  user-select: none;
  white-space: nowrap;
}

.shortcut-hint .shortcut-keys {
  color: var(--text-tertiary);
  font-weight: 500;
}

.shortcut-hint kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 17px;
  height: 18px;
  padding: 0 4px;
  font-family: inherit;
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  color: var(--text-primary);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-secondary);
  border-radius: 4px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
  vertical-align: middle;
}

.shortcut-hint .shortcut-desc {
  color: var(--text-secondary);
}

/* Author display:flex would otherwise beat the UA [hidden] rule — re-assert it */
.premium-lock[hidden],
.setting-row[hidden] { display: none; }

/* Trigger row: one line that opens a drawer/popover (depth, not breadth) */
.trigger-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-primary);
  border: 1px solid var(--border-secondary);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 14px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.trigger-row:hover { border-color: var(--border-tertiary); }
.trigger-row[aria-expanded="true"] { border-color: var(--text-primary); }
.trigger-chev { flex-shrink: 0; color: var(--text-tertiary); }
.trigger-mono { font-variant-numeric: tabular-nums; letter-spacing: 0.3px; }

.settings-utilities {
  display: flex;
  align-items: center;
  gap: 4px;
}

.header-action-btn {
  position: relative;
  width: 28px;
  height: 28px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.header-action-btn svg {
  width: 14px;
  height: 14px;
}
.header-action-btn--face {
  padding-bottom: 1px;
  font: 650 12px/1 var(--font);
  letter-spacing: -0.6px;
}
.header-action-btn:hover:not(:disabled) {
  color: var(--text-primary);
  background: var(--bg-secondary);
  border-color: var(--border-secondary);
}
.header-action-btn.is-active {
  color: hsl(145 48% 62%);
  background: hsl(145 48% 32% / 18%);
  border-color: hsl(145 48% 42% / 34%);
}
.header-action-btn.is-active:hover:not(:disabled) {
  color: hsl(145 52% 70%);
  background: hsl(145 48% 32% / 25%);
  border-color: hsl(145 48% 42% / 46%);
}
.header-action-btn:disabled {
  opacity: 0.35;
  cursor: default;
}
.header-action-btn:focus-visible {
  outline: 2px solid var(--text-primary);
  outline-offset: 2px;
}
.header-action-btn[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  top: calc(100% + 9px);
  right: 0;
  z-index: 260;
  padding: 7px 10px;
  border: 1px solid var(--glass-border);
  border-radius: 9px;
  background: hsl(0 0% 9% / 92%);
  color: var(--text-primary);
  box-shadow: 0 8px 24px hsl(0 0% 0% / 38%), var(--glass-highlight);
  backdrop-filter: blur(14px) saturate(135%);
  -webkit-backdrop-filter: blur(14px) saturate(135%);
  font: 500 11px/1.2 var(--font);
  letter-spacing: 0;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-3px) scale(0.98);
  transform-origin: top right;
  transition: opacity 0.14s ease, transform 0.14s ease;
}
.header-action-btn[data-tooltip]:hover::after,
.header-action-btn[data-tooltip]:focus-visible::after {
  opacity: 1;
  transform: translateY(0) scale(1);
  transition-delay: 0.28s;
}

.color-swatch {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  flex-shrink: 0;
  background: #ffffff;
  border: 1px solid var(--border-tertiary);
  box-shadow: inset 0 0 0 2px hsl(0 0% 100% / 30%);
}

/* Stroke detail block */
.stroke-detail { padding-top: 2px; }

/* Spacing controls (letter / word / sentence) */
.spacing-rows { display: flex; flex-direction: column; gap: 12px; }
.spacing-row { display: flex; flex-direction: column; gap: 5px; }
.spacing-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  justify-content: space-between;
}

/* Font item: name fills, check sits right */
.fi-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Font Style selector (Layer 2): vertical list — same layout as the font drawer.
   Each row's left marker is a live-rendered "Aa" chip showing the TRUE composite
   (painted by the shared engine via .ls-aa), then the style name + check/lock. */
.style-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 280px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-tertiary) transparent;
  /* Soft top/bottom fade, identical to the font list. */
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 12px, #000 calc(100% - 12px), transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 12px, #000 calc(100% - 12px), transparent 100%);
  padding: 4px 2px;
}
.style-list::-webkit-scrollbar { width: 6px; }
.style-list::-webkit-scrollbar-track { background: transparent; }
.style-list::-webkit-scrollbar-thumb { background: var(--border-tertiary); border-radius: 99px; }
.style-list:hover::-webkit-scrollbar-thumb { background: var(--text-tertiary); }

.style-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  background: var(--bg-secondary);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
  text-align: left;
}
.style-item:hover { background: var(--bg-tertiary); }
.style-item.active { border-color: var(--text-primary); }

/* Live-preview chip on the left of each row — neutral dark tile so white text,
   glows and pills all read against it. */
.ls-chip {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 30px;
  border-radius: 6px;
  background: #34373E;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06);
  overflow: hidden;
}
/* The "Aa" that carries the composite look. */
.ls-aa {
  font-size: 16px;
  font-weight: 700;
  color: #FFFFFF;
  letter-spacing: 0.2px;
  line-height: 1;
}
/* Leading "Default" row: a ⊘ glyph instead of styled text. */
.ls-chip-none .ls-aa::before {
  content: '⊘';
  font-size: 16px;
  font-weight: 500;
  color: var(--text-tertiary);
}
.si-name { flex: 1; font-size: 14px; font-weight: 600; color: var(--text-primary); }
/* Marker slot: check when active, lock for premium styles in basic (.tab-lock hides
   in Pro via the global rule). Mirrors the font drawer exactly. */
.style-item .si-check { display: none; color: var(--text-primary); }
.style-item.active .si-check { display: inline-block; }
.settings-panel:not(.is-premium) .style-item.premium-style .si-check { display: none; }
.settings-panel:not(.is-premium) .style-item.premium-style { cursor: not-allowed; }

/* Composite consumers — gradient fill + background pill. The base look (fill color,
   weight, shadow, stroke) is applied inline by the engine; these two need CSS.
   Used by the font-style selector chip (.ls-aa). */
.ls-aa.ls-gradient {
  background-image: var(--ls-fill-image);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.ls-aa.ls-bg {
  padding: var(--ls-bg-pad, 3px 8px);
  border-radius: var(--ls-bg-radius, 8px);
  background: var(--ls-bg, transparent);
}
/* Motion gallery — each card loops its own animation as a live demo */
.motion-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.motion-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  background: var(--bg-secondary);
  border: 1.5px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.motion-card:hover { background: var(--bg-tertiary); }
.motion-card.active { border-color: var(--text-primary); }
.mp-stage {
  position: relative;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 5px;
  background: var(--bg-primary);
  contain: layout paint;   /* isolate each looping preview from siblings' layout/paint */
}
/* Lock badge on each motion item — shown in Basic (premium feature, like pro
   fonts), hidden in Pro. Never blocks clicks. */
.motion-lock {
  display: inline-flex;
  position: absolute;
  top: 4px;
  right: 5px;
  font-size: 9px;
  line-height: 1;
  color: var(--text-tertiary);
  opacity: 0.55;
  pointer-events: none;
}
.settings-panel.is-premium .motion-lock { display: none; }
.mp-text {
  display: inline-block;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
}
.mc-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: center;
  letter-spacing: 0.2px;
}
/* Basic: gallery is fully animated & viewable, but not selectable (no lock icon) */
.settings-panel:not(.is-premium) .motion-card { cursor: not-allowed; }

/* ── Looping preview animations (continuous demo of each motion) ── */
@keyframes mp-fade { 0%, 100% { opacity: 0.12; } 45%, 65% { opacity: 1; } }
.mp-fade { animation: mp-fade 2s ease-in-out infinite; }

@keyframes mp-slide {
  0%   { opacity: 0; transform: translateY(10px); }
  25%, 70% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-10px); }
}
.mp-slide { animation: mp-slide 2s ease-in-out infinite; }

@keyframes mp-scale {
  0%, 100% { opacity: 0; transform: scale(0.45); }
  40%, 65% { opacity: 1; transform: scale(1); }
}
.mp-scale { animation: mp-scale 1.9s cubic-bezier(0.25, 1, 0.5, 1) infinite; }

/* GPU-friendly: represent "focus in" with opacity + scale instead of filter:blur
   (which forces a full-layer raster every frame — the overlay drag-lag culprit). */
@keyframes mp-blur {
  0%, 100% { opacity: 0; transform: scale(1.18); }
  40%, 65% { opacity: 1; transform: scale(1); }
}
.mp-blur { animation: mp-blur 2s ease-in-out infinite; }

@keyframes mp-bounce {
  0%   { opacity: 0; transform: translateY(12px); }
  30%  { opacity: 1; transform: translateY(-6px); }
  45%  { transform: translateY(0); }
  60%  { transform: translateY(-3px); }
  72%, 82% { transform: translateY(0); }
  100% { opacity: 0; transform: translateY(12px); }
}
.mp-bounce { animation: mp-bounce 2.1s ease-in-out infinite; }

@keyframes mp-flip {
  0%, 100% { opacity: 0; transform: perspective(220px) rotateX(90deg); }
  35%, 65% { opacity: 1; transform: perspective(220px) rotateX(0deg); }
}
.mp-flip { animation: mp-flip 2.2s ease-in-out infinite; transform-origin: center bottom; }

/* GPU-friendly: reveal via transform:scaleX (compositor) instead of animating
   max-width, which forced a layout reflow every step every frame. steps() keeps
   the character-by-character typing feel. */
@keyframes mp-tw {
  0%       { transform: scaleX(0); }
  45%      { transform: scaleX(1); }
  85%      { transform: scaleX(1); }
  100%     { transform: scaleX(0); }
}
.mp-typewriter {
  transform-origin: center;
  animation: mp-tw 2.4s steps(13, end) infinite;
}

/* Typewriter → : same character-by-character feel, but the reveal is anchored to the
   LEFT edge (clip-path wipe) so it types left→right instead of growing from center. */
/* GPU-friendly left→right reveal via left-origin scaleX (compositor) instead of
   animating clip-path (per-frame raster). */
@keyframes mp-tw-lr {
  0%   { transform: scaleX(0); }
  45%  { transform: scaleX(1); }
  85%  { transform: scaleX(1); }
  100% { transform: scaleX(0); }
}
.mp-typewriter-lr {
  transform-origin: left;
  animation: mp-tw-lr 2.4s steps(13, end) infinite;
}
@keyframes mp-fade-up {
  0%, 100% { opacity: 0; transform: translateY(7px); }
  45%, 70% { opacity: 1; transform: translateY(0); }
}
.mp-fade-up { animation: mp-fade-up 2s ease-in-out infinite; }

@keyframes mp-rise {
  0%   { opacity: 0; transform: translateY(18px); }
  30%, 68% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-18px); }
}
.mp-rise { animation: mp-rise 2s cubic-bezier(0.22, 1, 0.36, 1) infinite; }

@keyframes mp-drop {
  0%   { opacity: 0; transform: translateY(-18px); }
  30%, 68% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(18px); }
}
.mp-drop { animation: mp-drop 2s cubic-bezier(0.22, 1, 0.36, 1) infinite; }

@keyframes mp-zoom {
  0%, 100% { opacity: 0; transform: scale(1.6); }
  40%, 65% { opacity: 1; transform: scale(1); }
}
.mp-zoom { animation: mp-zoom 2s cubic-bezier(0.22, 1, 0.36, 1) infinite; }

@keyframes mp-spring {
  0%   { opacity: 0; transform: scale(0.5); }
  35%  { opacity: 1; transform: scale(1.12); }
  52%  { transform: scale(0.97); }
  68%  { transform: scale(1); }
  100% { opacity: 0; transform: scale(0.5); }
}
.mp-spring { animation: mp-spring 2.1s cubic-bezier(0.34, 1.56, 0.64, 1) infinite; }

@keyframes mp-swing {
  0%   { opacity: 0; transform: rotate(-11deg) translateY(7px); }
  40%, 68% { opacity: 1; transform: rotate(0) translateY(0); }
  100% { opacity: 0; transform: rotate(9deg) translateY(7px); }
}
.mp-swing { animation: mp-swing 2.1s cubic-bezier(0.34, 1.4, 0.64, 1) infinite; transform-origin: center bottom; }

@keyframes mp-skew {
  0%   { opacity: 0; transform: translateX(-12px) skewX(13deg); }
  38%, 68% { opacity: 1; transform: translateX(0) skewX(0); }
  100% { opacity: 0; transform: translateX(12px) skewX(-13deg); }
}
.mp-skew { animation: mp-skew 2s cubic-bezier(0.22, 1, 0.36, 1) infinite; }

/* GPU-friendly wipe via left-origin scaleX (compositor) instead of clip-path. */
@keyframes mp-wipe {
  0%   { opacity: 1; transform: scaleX(0); }
  45%, 78% { opacity: 1; transform: scaleX(1); }
  100% { opacity: 1; transform: scaleX(0); }
}
.mp-wipe { transform-origin: left; animation: mp-wipe 2.2s cubic-bezier(0.5, 0, 0.2, 1) infinite; }

/* GPU-friendly: approximate letter-spacing "tracking" with a scaleX pulse
   (compositor) — animating letter-spacing reflowed the line every frame. */
@keyframes mp-track {
  0%, 100% { opacity: 0; transform: scaleX(0.9); }
  45%, 70% { opacity: 1; transform: scaleX(1.06); }
}
.mp-track { transform-origin: center; animation: mp-track 2.1s ease-in-out infinite; }

@keyframes mp-slide-left {
  0%   { opacity: 0; transform: translateX(-20px); }
  35%, 68% { opacity: 1; transform: translateX(0); }
  100% { opacity: 0; transform: translateX(20px); }
}
.mp-slide-left { animation: mp-slide-left 2s cubic-bezier(0.22, 1, 0.36, 1) infinite; }

@keyframes mp-slide-right {
  0%   { opacity: 0; transform: translateX(20px); }
  35%, 68% { opacity: 1; transform: translateX(0); }
  100% { opacity: 0; transform: translateX(-20px); }
}
.mp-slide-right { animation: mp-slide-right 2s cubic-bezier(0.22, 1, 0.36, 1) infinite; }

@keyframes mp-punch {
  0%, 100% { opacity: 0; transform: scale(2); }
  35%, 60% { opacity: 1; transform: scale(1); }
}
.mp-punch { animation: mp-punch 1.9s cubic-bezier(0.2, 0.9, 0.3, 1) infinite; }

@keyframes mp-stamp {
  0%   { opacity: 0; transform: scale(1.8) rotate(-6deg); }
  18%  { opacity: 1; transform: scale(0.94) rotate(1deg); }
  32%, 65% { transform: scale(1) rotate(0); }
  100% { opacity: 0; transform: scale(1.8) rotate(-6deg); }
}
.mp-stamp { animation: mp-stamp 2.1s cubic-bezier(0.3, 1.2, 0.4, 1) infinite; }

@keyframes mp-float {
  0%, 100% { opacity: 0; transform: translateY(5px); }
  40%, 70% { opacity: 1; transform: translateY(-2px); }
}
.mp-float { animation: mp-float 2.6s ease-in-out infinite; }

/* GPU-friendly: strobe with opacity only instead of filter:brightness (raster). */
@keyframes mp-flash {
  0%, 100% { opacity: 0; }
  12% { opacity: 1; }
  24% { opacity: 0.4; }
  38%, 70% { opacity: 1; }
}
.mp-flash { animation: mp-flash 2s ease-out infinite; }

@keyframes mp-roll {
  0%   { opacity: 0; transform: translateX(-16px) rotate(-14deg); }
  38%, 68% { opacity: 1; transform: translateX(0) rotate(0); }
  100% { opacity: 0; transform: translateX(16px) rotate(14deg); }
}
.mp-roll { animation: mp-roll 2.1s cubic-bezier(0.22, 1, 0.36, 1) infinite; }

@keyframes mp-tilt {
  0%, 100% { opacity: 0; transform: rotate(6deg) scale(0.9); }
  40%, 68% { opacity: 1; transform: rotate(0) scale(1); }
}
.mp-tilt { animation: mp-tilt 2.1s cubic-bezier(0.34, 1.4, 0.64, 1) infinite; transform-origin: left center; }

/* GPU-friendly top-down reveal via top-origin scaleY (compositor) not clip-path. */
@keyframes mp-reveal-down {
  0%   { opacity: 1; transform: scaleY(0); }
  45%, 78% { opacity: 1; transform: scaleY(1); }
  100% { opacity: 1; transform: scaleY(0); }
}
.mp-reveal-down { transform-origin: top; animation: mp-reveal-down 2.2s cubic-bezier(0.5, 0, 0.2, 1) infinite; }

@keyframes mp-elastic {
  0%   { opacity: 0; transform: translateY(16px); }
  35%  { opacity: 1; transform: translateY(-7px); }
  52%  { transform: translateY(3px); }
  64%  { transform: translateY(-1px); }
  74%  { transform: translateY(0); }
  100% { opacity: 0; transform: translateY(16px); }
}
.mp-elastic { animation: mp-elastic 2.2s cubic-bezier(0.34, 1.56, 0.64, 1) infinite; }

/* 'None' = static text, intentionally no animation */
.mp-none { animation: none; }

/* Pause every looping preview when the controller tab is hidden/minimized — JS
   toggles .motion-anim-paused on #motion-grid (zero compositor work when away). */
#motion-grid.motion-anim-paused .mp-text { animation-play-state: paused; }

/* Reduced-motion: no continuous looping previews at all. */
@media (prefers-reduced-motion: reduce) {
  .mp-text { animation: none !important; }
}

/* Premium lock overlay (covers a whole premium tab when free) */
.premium-lock {
  position: absolute;
  inset: -8px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--nav-glass);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: var(--radius-md);
}
.premium-lock-inner {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 16px;
}
.premium-lock-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 18px;
  color: var(--text-secondary);
}
.premium-lock-badge .pro-pill { font-size: 9.5px; }
.premium-lock-inner p {
  font-size: 13px;
  color: var(--text-secondary);
  max-width: 200px;
}
.lock-unlock-btn {
  padding: 8px 18px;
  background: var(--bg-inverse);
  color: var(--text-inverse);
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.lock-unlock-btn:hover { background: var(--bg-inverse-hover); }

/* Shared floating panel for font drawer + color popover (reuses tab-drawer feel) */
.fl-drawer {
  position: absolute;
  left: calc(100% + 12px);
  top: 0;
  width: 240px;
  background: hsl(0 0% 9% / 88%);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 14px;
  box-shadow: 0 12px 60px hsl(0 0% 0% / 40%), var(--glass-highlight);
  opacity: 0;
  transform: translateX(-10px) scale(0.96);
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 210;
}
.fl-drawer.open {
  opacity: 1;
  transform: translateX(0) scale(1);
  pointer-events: all;
}

/* Font list inside drawer */
.font-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 280px;
  overflow-y: auto;
  /* Premium overlay scrollbar (Firefox) */
  scrollbar-width: thin;
  scrollbar-color: var(--border-tertiary) transparent;
  /* Soft top/bottom fade so the list dissolves instead of hard-cutting */
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 12px, #000 calc(100% - 12px), transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 12px, #000 calc(100% - 12px), transparent 100%);
  padding: 4px 2px;
}
/* Premium overlay scrollbar (WebKit) */
.font-list::-webkit-scrollbar { width: 6px; }
.font-list::-webkit-scrollbar-track { background: transparent; }
.font-list::-webkit-scrollbar-thumb {
  background: var(--border-tertiary);
  border-radius: 99px;
}
.font-list:hover::-webkit-scrollbar-thumb { background: var(--text-tertiary); }

/* Category header for Pro grouping (Sans / Serif / Display / Mono) */
.font-group-header {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-tertiary);
  padding: 10px 12px 4px;
}
.font-group-header:first-child { padding-top: 2px; }

.font-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px;
  background: var(--bg-secondary);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 15px;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.15s;
  text-align: left;
}
.font-item:hover { background: var(--bg-tertiary); }
.font-item.active { border-color: var(--text-primary); }
/* Marker slot: check when active, lock for premium fonts in basic (.tab-lock
   hides in Pro). Display-based so check + lock never both take space. */
.font-item .fi-check { display: none; color: var(--text-primary); }
.font-item.active .fi-check { display: inline-block; }
.settings-panel:not(.is-premium) .font-item.premium-font .fi-check { display: none; }
/* Basic: premium fonts are visible/previewable but not selectable */
.settings-panel:not(.is-premium) .font-item.premium-font { cursor: not-allowed; }

/* ── Custom Text Styling section ── color + outline editor (CapCut/Canva-style) ── */
.custom-style-section {
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border-secondary);
}
.custom-style-controls {
  margin-top: 4px;
  transition: opacity 0.2s;
}
/* Disabled = custom styling toggled Off: dim + non-interactive (toggle stays live). */
.custom-style-controls.cs-disabled {
  opacity: 0.4;
  pointer-events: none;
  filter: grayscale(0.4);
}
/* Color row: a swatch button (chip + hex) that opens the in-app color picker. */
.cs-swatch-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 11px 5px 6px;
  background: var(--bg-primary);
  border: 1px solid var(--border-secondary);
  border-radius: 9px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
}
.cs-swatch-btn:hover { border-color: var(--text-primary); }
.cs-swatch-btn:active { transform: scale(0.97); }
.cs-swatch-chip {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1px solid hsl(0 0% 50% / 0.35);
  box-shadow: inset 0 0 0 1px hsl(0 0% 100% / 0.14);
}
.cs-swatch-hex {
  font-size: 12px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
/* In-app color picker fits the drawer; gradient overlays are click-through so the
   saturation/value drag always targets the area itself. */
.color-drawer .color-popover { width: 100%; }
.cp-area-sat, .cp-area-val, .cp-area-thumb { pointer-events: none; }
.cp-area { touch-action: none; }
.cs-hint {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 2px;
  line-height: 1.4;
}
/* Font Style trigger locked while custom styling overrides it. */
.trigger-row.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

/* Color popover internals */
.color-popover { width: 220px; }
.cp-area {
  position: relative;
  width: 100%;
  height: 130px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: crosshair;
  background: hsl(var(--cp-hue, 0) 100% 50%);
  margin-bottom: 12px;
}
.cp-area-sat,
.cp-area-val { position: absolute; inset: 0; }
.cp-area-sat { background: linear-gradient(to right, #fff, transparent); }
.cp-area-val { background: linear-gradient(to top, #000, transparent); }
.cp-area-thumb {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px hsl(0 0% 0% / 40%), 0 1px 3px hsl(0 0% 0% / 40%);
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.cp-hue { margin-bottom: 12px; }
.cp-hue-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 12px;
  border-radius: 99px;
  outline: none;
  cursor: pointer;
  background: linear-gradient(to right, #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);
}
.cp-hue-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid hsl(0 0% 0% / 25%);
  box-shadow: 0 1px 4px hsl(0 0% 0% / 30%);
  cursor: pointer;
}
.cp-models { margin-bottom: 10px; }
.cp-model-btn { font-size: 11px; padding: 5px 6px; }
.cp-inputs { display: flex; gap: 6px; margin-bottom: 12px; }
.cp-field { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.cp-field label {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-tertiary);
  text-transform: uppercase;
  text-align: center;
}
.cp-field input {
  width: 100%;
  padding: 7px 4px;
  background: var(--bg-primary);
  border: 1px solid var(--border-secondary);
  border-radius: 6px;
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 12px;
  text-align: center;
  outline: none;
  font-variant-numeric: tabular-nums;
}
.cp-field input:focus { border-color: var(--text-primary); }
.cp-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.cp-preset {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid var(--border-tertiary);
  transition: transform 0.12s;
}
.cp-preset:hover { transform: scale(1.12); }

.settings-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
}

#overlay-visibility-btn { width: 100%; }
#overlay-license-status { font-size: 12px; color: var(--text-secondary); text-align: center; }

.installed-badge {
  font-size: 12px;
  font-weight: 600;
  color: hsl(140 50% 55%);
}

/* ── ONBOARDING MODAL ── */
.onboarding-modal {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 1;
  transition: opacity 0.3s ease;
}
.onboarding-modal.hidden {
  opacity: 0;
  pointer-events: none;
}
.ob-backdrop {
  position: absolute;
  inset: 0;
  background: hsl(0 0% 0% / 38%);
  backdrop-filter: blur(5px) saturate(108%);
  -webkit-backdrop-filter: blur(5px) saturate(108%);
}
.ob-card {
  position: relative;
  background: hsl(0 0% 9% / 90%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 480px;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: var(--shadow-panel), var(--glass-highlight);
  transform: translateY(0) scale(1);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}
.onboarding-modal.hidden .ob-card {
  transform: translateY(16px) scale(0.97);
}
.ob-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 32px;
  border-bottom: 1px solid var(--border-secondary);
}
.ob-title {
  font-size: 20px;
  font-weight: 650;
  color: var(--text-primary);
}
.ob-close {
  font-size: 24px;
  color: var(--text-tertiary);
  background: transparent;
  border: none;
  cursor: pointer;
  line-height: 1;
  transition: color 0.15s;
}
.ob-close:hover { color: var(--text-primary); }
.ob-body {
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}
.ob-step {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ob-step-header {
  display: flex;
  align-items: center;
  gap: 12px;
}
.ob-step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg-inverse);
  color: var(--text-inverse);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}
.ob-step-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}
.ob-step-content {
  padding-left: 36px;
}
.ob-step-content p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 16px;
}
.ob-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  background: var(--bg-inverse);
  color: var(--text-inverse);
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s, transform 0.1s;
}
.ob-btn-primary:hover { background: var(--bg-inverse-hover); }
.ob-btn-primary:active { transform: scale(0.97); }
.ob-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-secondary);
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s, transform 0.1s;
}
.ob-btn-secondary:hover { background: var(--bg-tertiary); }
.ob-btn-secondary:active { transform: scale(0.97); }
.ob-downloads {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.ob-step-content .ob-platform-note {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--text-tertiary);
}
.ob-status-box {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--glass-highlight);
}
.ob-status-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-tertiary);
  font-size: 13px;
  line-height: 18px;
  font-weight: 500;
}
.ob-status-dot {
  width: 7px;
  height: 7px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--text-tertiary);
  box-shadow: 0 0 0 3px hsl(145 60% 45% / 0%);
  transition: background 0.25s ease, box-shadow 0.25s ease;
}
.ob-status-row.success {
  color: hsl(145 45% 62%);
}
.ob-status-row.success .ob-status-dot {
  background: hsl(145 60% 45%);
  box-shadow: 0 0 0 3px hsl(145 60% 45% / 18%);
}
.ob-icon-error { color: hsl(0 60% 60%); }
.ob-status-text {
  font-size: 13px;
  font-weight: 500;
  color: inherit;
}
.ob-status-row.success .ob-status-text {
  color: inherit;
}
.ob-footer {
  padding: 24px 32px;
  border-top: 1px solid var(--border-secondary);
  background: var(--bg-primary);
}
.ob-btn-launch {
  width: 100%;
  padding: 14px;
  background: var(--bg-inverse);
  color: var(--text-inverse);
  border-radius: var(--radius-full);
  font-size: 15px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}
.ob-btn-launch:disabled {
  background: var(--bg-tertiary);
  color: var(--text-tertiary);
  cursor: not-allowed;
}
.ob-btn-launch:not(:disabled):hover {
  background: var(--bg-inverse-hover);
}

/* No glass panel here — the moving lyric ticker IS the container. We keep the
   same footprint (radius + padding) the glass box had, but drop the fill,
   border, blur and shadow so the scrolling sentences read as the backdrop. */
.pricing-section {
  position: relative;
  isolation: isolate;          /* scope the ticker's z-index to this section */
  overflow: hidden;            /* clip the moving ticker to the rounded area */
  border-radius: var(--radius-xl);
  padding: clamp(40px, 5vw, 72px) clamp(24px, 4vw, 56px);
  background: transparent;
}

/* Content sits above the ambient ticker and stays fully readable. */
.pricing-content {
  position: relative;
  z-index: 1;
  max-width: 880px;
  margin: 0 auto;
}

.pricing-stage {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  min-height: 470px;
  margin-top: 36px;
  padding: clamp(24px, 4vw, 44px);
  overflow: visible;
  border: 0;
  background: transparent;
}

.pricing-stage .plans {
  position: relative;
  z-index: 2;
  width: 100%;
  margin-top: 0;
}

/* ── LYRIC-TICKER CONTAINER (decorative) ──
   A dense wall of slow-scrolling lyric fragments behind the offer. Low opacity,
   varied pacing, soft blur and edge fades keep it atmospheric and pointer-inert. */
.pricing-ticker {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  gap: 4px;
  pointer-events: none;
  overflow: hidden;
  border-radius: inherit;
  opacity: 0.06;
  filter: blur(1px);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent), linear-gradient(180deg, transparent, #000 14%, #000 86%, transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent), linear-gradient(180deg, transparent, #000 14%, #000 86%, transparent);
  mask-composite: intersect;
}

.pt-row {
  display: flex;
  white-space: nowrap;
  overflow: hidden;
}

.pt-track {
  display: inline-flex;
  flex: none;
  width: max-content;
  will-change: transform;
}

.pt-track span {
  display: inline-block;
  flex: none;
  color: hsl(0 0% 100%);
  font-size: clamp(20px, 2.4vw, 34px);
  font-weight: 700;
  letter-spacing: -0.4px;
  line-height: 1.2;
  white-space: nowrap;
}

/* Two identical copies per track → translating one copy width loops seamlessly. */
@keyframes pt-scroll-left  { from { transform: translateX(0); }     to { transform: translateX(-50%); } }
@keyframes pt-scroll-right { from { transform: translateX(-50%); }  to { transform: translateX(0); } }

.pt-left  .pt-track { animation: pt-scroll-left  var(--pt-dur, 60s) linear infinite; }
.pt-right .pt-track { animation: pt-scroll-right var(--pt-dur, 60s) linear infinite; }
.pricing-ticker .pt-track { animation-delay: var(--pt-delay, 0s); }

/* Varied, slow speeds and negative offsets prevent rigid, synchronized movement. */
.pricing-ticker .pt-row:nth-child(1) .pt-track { --pt-dur: 58s; --pt-delay: 0s; }
.pricing-ticker .pt-row:nth-child(2) .pt-track { --pt-dur: 72s; --pt-delay: 0s; }
.pricing-ticker .pt-row:nth-child(3) .pt-track { --pt-dur: 50s; --pt-delay: 0s; }
.pricing-ticker .pt-row:nth-child(4) .pt-track { --pt-dur: 66s; --pt-delay: 0s; }
.pricing-ticker .pt-row:nth-child(5) .pt-track { --pt-dur: 62s; --pt-delay: 0s; }
.pricing-ticker .pt-row:nth-child(6) .pt-track { --pt-dur: 54s; --pt-delay: 0s; }
.pricing-ticker .pt-row:nth-child(7) .pt-track { --pt-dur: 70s; --pt-delay: 0s; }
.pricing-ticker .pt-row:nth-child(8) .pt-track { --pt-dur: 60s; --pt-delay: 0s; }

@media (prefers-reduced-motion: reduce) {
  .pt-track { animation: none; }
}

/* ── Heading ── */
.pricing-head {
  position: relative;
  z-index: 2;
  text-align: center;
  margin-bottom: 28px;
}

.pricing-heading {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1.1;
}

.pricing-subtext {
  margin: 12px auto 0;
  max-width: 460px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-secondary);
}

/* ── Plan grid ── */
.plans {
  display: grid;
  grid-template-columns: minmax(0, 560px);
  justify-content: center;
  align-items: center;
  margin-top: 44px;
}

/* ── Shared card shell ── */
.plan-card {
  position: relative;
  isolation: isolate;          /* scope each card's own ticker z-index */
  overflow: hidden;            /* clip the card's scrolling lyrics to its corners */
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  background: var(--glass-bg-strong);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-soft), var(--glass-highlight);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.3s ease, border-color 0.3s ease;
}

.pricing-section .plan-card.plan-one-time {
  background: linear-gradient(180deg, hsl(0 0% 100% / 8%), hsl(0 0% 100% / 3%));
}

/* Card content sits above that card's ticker and stays fully readable. */
.plan-body {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.plan-name {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.2px;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

.plan-price {
  display: flex;
  align-items: baseline;
  gap: 3px;
}

.pp-cur {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-secondary);
  align-self: flex-start;
  padding-top: 8px;
}

.pp-amt {
  font-size: clamp(42px, 5vw, 58px);
  font-weight: 800;
  letter-spacing: -2px;
  line-height: 1;
}

.pp-per {
  font-size: 14px;
  color: var(--text-tertiary);
  margin-left: 6px;
}

.plan-period {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-tertiary);
  min-height: 18px;
}

.plan-save {
  display: inline-block;
  font-weight: 600;
  color: hsl(145 60% 60%);
}

.plan-feats {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 11px;
  margin: 24px 0 28px;
}

.plan-feats li {
  position: relative;
  padding-left: 28px;
  font-size: 15px;
  font-weight: 450;
  color: var(--text-secondary);
}

.plan-feats li::before {
  content: '✓';
  position: absolute;
  left: 0;
  top: 1px;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: hsl(145 55% 50%);
  background: hsl(145 60% 45% / 14%);
  border-radius: 50%;
}

/* ── CTA buttons ── */
.plan-cta {
  margin-top: auto;
  height: 46px;
  padding: 0 24px;
  border-radius: var(--radius-full);
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.18s ease, box-shadow 0.25s ease, transform 0.15s ease;
}

.plan-cta-muted {
  background: hsl(0 0% 100% / 5%);
  border: 1px solid var(--glass-border);
  color: var(--text-tertiary);
  cursor: default;
}

.plan-cta-primary {
  background: var(--bg-inverse);
  color: var(--text-inverse);
  box-shadow: 0 6px 24px hsl(0 0% 100% / 14%);
}

.plan-cta-primary:hover {
  background: var(--bg-inverse-hover);
  box-shadow: 0 8px 32px hsl(0 0% 100% / 22%);
}

.plan-cta-primary:active { transform: translateY(1px); }

/* ── FREE card — dimmed, no glow ── */
.plan-free {
  opacity: 0.92;
}

/* ── PRO card — emphasis, soft animated glow border ── */
.plan-pro {
  background:
    linear-gradient(180deg, hsl(0 0% 100% / 8%), hsl(0 0% 100% / 3%));
  border-color: hsl(0 0% 100% / 16%);
  box-shadow:
    var(--shadow-panel),
    var(--glass-highlight),
    0 0 40px hsl(0 0% 100% / 6%);
}

/* Subtle gradient glow edge that breathes — kept very low-key. */
.plan-pro::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(140deg, hsl(0 0% 100% / 35%), hsl(0 0% 100% / 5%) 40%, hsl(0 0% 100% / 30%));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  opacity: 0.5;
  pointer-events: none;
  animation: pro-glow 5s ease-in-out infinite;
}

@keyframes pro-glow {
  0%, 100% { opacity: 0.35; }
  50%      { opacity: 0.65; }
}

/* Hover lift on the interactive Pro card. */
.plan-pro:hover {
  transform: translateY(-4px);
  box-shadow:
    var(--shadow-panel),
    var(--glass-highlight),
    0 0 56px hsl(0 0% 100% / 12%);
}

/* Featured Pro offer. */
.plan-pro.is-featured {
  border-color: hsl(0 0% 100% / 22%);
  box-shadow:
    var(--shadow-panel),
    var(--glass-highlight),
    0 0 56px hsl(0 0% 100% / 10%);
  transform: scale(1.04);
}
.plan-pro.is-featured:hover {
  transform: scale(1.04) translateY(-4px);
}
.plan-pro.is-featured::before { opacity: 0.7; }

/* ── PRO badge ── */
.plan-badge {
  position: absolute;
  top: 20px;
  right: 24px;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: var(--text-primary);
  background: hsl(0 0% 100% / 10%);
  border: 1px solid hsl(0 0% 100% / 16%);
  box-shadow: var(--glass-highlight);
  z-index: 2;
}

/* "Best Value" badge on the featured card reads a touch brighter. */
.plan-badge-accent {
  color: var(--text-inverse);
  background: var(--bg-inverse);
  border-color: transparent;
  box-shadow: 0 4px 16px hsl(0 0% 100% / 18%);
}

@media (prefers-reduced-motion: reduce) {
  .plan-pro::before { animation: none; }
}

/* ── Tablet ── */
@media (max-width: 980px) and (min-width: 721px) {
  .plans {
    grid-template-columns: minmax(0, 560px);
  }
  .plan-pro.is-featured,
  .plan-pro.is-featured:hover { transform: none; }
}

/* ── Mobile: stack the offers and drop the featured scale ── */
@media (max-width: 720px) {
  .plans {
    grid-template-columns: 1fr;
  }
  .plan-pro.is-featured,
  .plan-pro.is-featured:hover {
    transform: none;
  }
  .plan-pro:hover { transform: translateY(-4px); }
}

/* ── FOOTER ── */
.footer {
  padding: 32px var(--page-x);
  border-top: 1px solid var(--border-divider);
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 600;
}

.footer-copy {
  font-size: 12px;
  color: var(--text-tertiary);
}

/* ── PAYMENT TOAST ── */
.payment-toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 400;
  transition: opacity 0.25s, transform 0.25s;
}

.payment-toast.hidden {
  opacity: 0;
  transform: translateX(-50%) translateY(10px);
  pointer-events: none;
}

.toast-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-inverse);
  color: var(--text-inverse);
  border-radius: var(--radius-full);
  padding: 12px 20px;
  box-shadow: 0 8px 40px hsl(0 0% 0% / 24%);
}

.toast-icon {
  font-size: 16px;
}

.toast-text {
  font-size: 14px;
  font-weight: 600;
}

/* ── SCROLL REVEAL ── */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Website-owned purchase verification, inside the controller. */
