/* Alongside+ Studio - Pixel-Matched Daylight Ivory Default & Executive Navy Toggle */
/* Self-hosted SIL OFL 1.1 fonts only (Cormorant + Figtree). Zero external CDN links. */

:root,
html[data-theme="ivory"] {
  --navy-deep: #061A2E;
  --navy-header: #081E35;
  --navy-sidebar: #061B30;
  --navy-ink: #0A213C;
  --navy-ink-soft: #263B54;

  --bg-page: #FDF9F0;
  --bg-card: #FFFDF7;
  --bg-panel: #FFFFFF;
  --bg-input: #FFFFFF;
  --bg-subtle: #F7F1E2;

  --border-gold: #CCA44E;
  --border-gold-strong: #B88B32;
  --border-soft: rgba(186, 146, 68, 0.34);

  --gold-light: #F2CF7E;
  --gold-mid: #E2AE56;
  --gold-deep: #B98732;
  --gold-icon: #B68934;

  --text-primary: #0A213C;
  --text-secondary: #3B4C62;
  --text-muted: #66758A;

  --shadow-card: 0 4px 14px rgba(10, 33, 60, 0.07), 0 1px 3px rgba(185, 135, 50, 0.14);
  --shadow-card-hover: 0 10px 24px rgba(10, 33, 60, 0.13), 0 0 0 2px rgba(210, 165, 72, 0.38);
  --shadow-recent: 0 3px 10px rgba(10, 33, 60, 0.10);

  --badge-ok-bg: #ECFDF5;
  --badge-ok-border: #86EFAC;
  --badge-ok-text: #166534;
  --badge-err-bg: #FEF2F2;
  --badge-err-border: #FCA5A5;
  --badge-err-text: #991B1B;

  --font-serif: "Cormorant", Georgia, "Times New Roman", serif;
  --font-sans: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;

  --topbar-h: 64px;
  --sidebar-w: 192px;
}

html[data-theme="navy"] {
  --bg-page: #0B192C;
  --bg-card: #12243D;
  --bg-panel: #102038;
  --bg-input: #0A1628;
  --bg-subtle: #182E4C;

  --border-gold: rgba(226, 174, 86, 0.55);
  --border-gold-strong: #E2AE56;
  --border-soft: rgba(226, 174, 86, 0.25);

  --text-primary: #F8F4EA;
  --text-secondary: #CBD5E1;
  --text-muted: #94A3B8;

  --shadow-card: 0 8px 22px rgba(0, 0, 0, 0.34);
  --shadow-card-hover: 0 14px 30px rgba(0, 0, 0, 0.45), 0 0 0 2px rgba(235, 189, 102, 0.45);
  --shadow-recent: 0 6px 16px rgba(0, 0, 0, 0.36);

  --badge-ok-bg: rgba(22, 163, 74, 0.18);
  --badge-ok-border: rgba(74, 222, 128, 0.45);
  --badge-ok-text: #86EFAC;
  --badge-err-bg: rgba(220, 38, 38, 0.18);
  --badge-err-border: rgba(248, 113, 113, 0.45);
  --badge-err-text: #FCA5A5;
}

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

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg-page);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.48;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, textarea, select {
  font-family: inherit;
}

.hidden {
  display: none !important;
}

/* ===========================
   TOP HEADER BAR (64px Royal Navy)
   =========================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  height: var(--topbar-h);
  padding: 0 22px 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: linear-gradient(90deg, #05182B 0%, #092038 52%, #061A2F 100%);
  border-bottom: 1px solid rgba(226, 174, 86, 0.22);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.mobile-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid rgba(226, 174, 86, 0.35);
  background: rgba(255, 255, 255, 0.06);
  color: #F6E8C6;
  cursor: pointer;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  cursor: pointer;
  background: transparent;
  border: none;
  padding: 0;
  text-align: left;
}

.brand-monogram {
  width: 38px;
  height: 32px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-wordmark {
  font-family: var(--font-serif);
  font-size: 27px;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1;
  display: flex;
  align-items: baseline;
  gap: 7px;
  white-space: nowrap;
  -webkit-text-stroke: 0.35px currentColor;
}

.brand-wordmark-white {
  color: #FFFFFF;
}

.brand-wordmark-gold {
  color: #E4B55C;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.theme-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid rgba(226, 174, 86, 0.3);
  background: rgba(255, 255, 255, 0.06);
  color: #E7D5AE;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease;
}

.theme-chip:hover {
  background: rgba(226, 174, 86, 0.16);
  border-color: rgba(236, 196, 118, 0.6);
}

.balance-group {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #FFFFFF;
  background: transparent;
  border: none;
  padding: 4px 2px;
  cursor: pointer;
}

.coins-icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.balance-value {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.005em;
  color: #FFFFFF;
  white-space: nowrap;
  -webkit-text-stroke: 0.28px #FFFFFF;
}

.topbar-divider {
  width: 1px;
  height: 26px;
  background: rgba(255, 255, 255, 0.28);
  flex-shrink: 0;
}

.topup-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 38px;
  padding: 0 22px;
  border-radius: 999px;
  border: 1px solid #F3D48B;
  background: linear-gradient(180deg, #F0CB79 0%, #DFAB4E 100%);
  color: #081E35;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.45);
  transition: transform 0.14s ease, filter 0.14s ease;
  white-space: nowrap;
}

.topup-pill:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

/* ===========================
   APP SHELL (Sidebar + Main)
   =========================== */
.studio-shell {
  display: flex;
  min-height: calc(100vh - var(--topbar-h));
}

/* Left Royal Navy Sidebar */
.sidebar {
  position: relative;
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: linear-gradient(180deg, #071C33 0%, #051629 100%);
  padding: 20px 0 24px 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  border-right: 1px solid rgba(226, 174, 86, 0.16);
}

.sidebar-nav {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: calc(100% - 14px);
  padding: 12px 16px 12px 22px;
  border: none;
  border-radius: 0 12px 12px 0;
  background: transparent;
  color: #F4F7FB;
  font-family: var(--font-sans);
  font-size: 14.5px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #FFFFFF;
}

.nav-item.active {
  background: linear-gradient(135deg, #EDC272 0%, #DA9F49 100%);
  color: #071B30;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.24);
}

.nav-item-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-item-count {
  margin-left: auto;
  font-size: 11.5px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #F2D68A;
}

.nav-item.active .nav-item-count {
  background: rgba(7, 27, 48, 0.16);
  color: #071B30;
}

.sidebar-swoosh {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 155px;
  pointer-events: none;
  z-index: 1;
}

/* ===========================
   MAIN WORKSPACE AREA
   =========================== */
.workspace {
  flex: 1;
  min-width: 0;
  padding: 20px 32px 28px 32px;
  background: var(--bg-page);
}

.view-panel {
  display: none;
  max-width: 1220px;
  margin: 0 auto;
}

.view-panel.active {
  display: block;
}

/* Friendly Sign-In Bar (compact, only if user clicks Create while logged out) */
.auth-banner {
  max-width: 1220px;
  margin: 0 auto 16px auto;
  padding: 12px 18px;
  border-radius: 14px;
  border: 1.5px solid var(--border-gold);
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-card);
}

.auth-banner-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 14px;
  color: var(--text-secondary);
}

.auth-banner-text strong {
  color: var(--text-primary);
  font-size: 15px;
}

/* ===========================
   HOME HUB HERO (Pixel-Matched)
   =========================== */
.home-hero {
  margin-bottom: 18px;
}

.home-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 40px;
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.015em;
  color: var(--text-primary);
  -webkit-text-stroke: 0.45px currentColor;
}

.brand-accent-wrap {
  position: relative;
  display: inline-block;
}

.brand-flourish {
  position: absolute;
  left: 2%;
  right: -12%;
  bottom: -6px;
  width: 112%;
  height: 10px;
  pointer-events: none;
}

.home-subtitle {
  margin: 9px 0 0 0;
  font-family: var(--font-sans);
  font-size: 15.5px;
  font-weight: 500;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* ===========================
   6-TILE ILLUSTRATED HUB GRID
   =========================== */
.hub-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 22px;
}

.hub-card {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  height: 174px;
  padding: 0;
  border-radius: 17px;
  border: 1.5px solid var(--border-gold);
  background: var(--bg-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.hub-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card-hover);
  border-color: var(--border-gold-strong);
}

.hub-card:focus-visible {
  outline: 3px solid var(--gold-mid);
  outline-offset: 2px;
}

.hub-card-left {
  position: relative;
  z-index: 3;
  width: 47%;
  padding: 16px 6px 16px 22px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 8px;
}

.hub-card-icon {
  width: 42px;
  height: 42px;
  color: var(--gold-icon);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

html[data-theme="navy"] .hub-card-icon {
  color: #E8BC67;
}

.hub-card-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.015em;
  color: var(--text-primary);
  -webkit-text-stroke: 0.35px currentColor;
}

.hub-card-art {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 63%;
  z-index: 1;
  overflow: hidden;
}

.hub-card-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: right center;
  display: block;
  transition: transform 0.32s ease;
}

.hub-card:hover .hub-card-art img {
  transform: scale(1.03);
}

.hub-card-art::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    var(--bg-card) 0%,
    rgba(255, 253, 247, 0.85) 5%,
    rgba(255, 253, 247, 0.18) 12%,
    rgba(255, 253, 247, 0) 20%
  );
}

.hub-card[data-open-tool="edit-image"] .hub-card-art,
.hub-card[data-open-tool="cleanup"] .hub-card-art,
.hub-card[data-open-tool="dubbing"] .hub-card-art {
  width: 61%;
}

.hub-card[data-open-tool="edit-image"] .hub-card-art img,
.hub-card[data-open-tool="cleanup"] .hub-card-art img,
.hub-card[data-open-tool="dubbing"] .hub-card-art img {
  object-fit: contain;
  object-position: right center;
  padding: 5px 6px 5px 0;
}

.hub-card[data-open-tool="edit-image"] .hub-card-art::after,
.hub-card[data-open-tool="cleanup"] .hub-card-art::after,
.hub-card[data-open-tool="dubbing"] .hub-card-art::after {
  background: linear-gradient(
    90deg,
    var(--bg-card) 0%,
    rgba(255, 253, 247, 0) 8%
  );
}

html[data-theme="navy"] .hub-card-art::after {
  background: linear-gradient(
    90deg,
    #12243D 0%,
    rgba(18, 36, 61, 0.88) 7%,
    rgba(18, 36, 61, 0.25) 16%,
    rgba(18, 36, 61, 0) 26%
  );
}

html[data-theme="navy"] .hub-card[data-open-tool="edit-image"] .hub-card-art::after,
html[data-theme="navy"] .hub-card[data-open-tool="cleanup"] .hub-card-art::after,
html[data-theme="navy"] .hub-card[data-open-tool="dubbing"] .hub-card-art::after {
  background: linear-gradient(
    90deg,
    #12243D 0%,
    rgba(18, 36, 61, 0) 10%
  );
}

/* Crisp gold Coming Soon pill (ONLY shown if a backend endpoint reports offline) */
.coming-soon-pill {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 5;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #F7DF9E;
  background: linear-gradient(135deg, #F0CA74 0%, #D49B3E 100%);
  color: #071B30;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
}

/* ===========================
   MY RECENT CREATIONS SHELF
   =========================== */
.recent-section {
  margin-top: 6px;
}

.recent-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 13px;
}

.recent-heading {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  -webkit-text-stroke: 0.35px currentColor;
}

.recent-heading svg {
  color: #C79A41;
  flex-shrink: 0;
}

.view-all-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: 10px;
  border: 1.5px solid var(--border-gold);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(10, 33, 60, 0.06);
  transition: background 0.15s ease, transform 0.15s ease;
}

.view-all-btn:hover {
  background: var(--bg-subtle);
  transform: translateY(-1px);
}

.recent-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
}

.recent-card {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1 / 0.94;
  border-radius: 13px;
  overflow: hidden;
  border: 1px solid rgba(186, 146, 68, 0.32);
  background: #0D2038;
  box-shadow: var(--shadow-recent);
  padding: 0;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.recent-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 22px rgba(10, 33, 60, 0.18);
}

.recent-card img,
.recent-card video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.recent-audio-cover {
  width: 100%;
  height: 100%;
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 8px;
  background: linear-gradient(145deg, #0A223D 0%, #15355C 60%, #1D3D63 100%);
  color: #F8F3E6;
}

.recent-audio-cover span {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.15;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.recent-pill {
  position: absolute;
  left: 8px;
  bottom: 8px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 8px;
  background: rgba(255, 253, 249, 0.96);
  color: #0A213C;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.22);
  pointer-events: none;
}

.recent-pill svg {
  width: 13px;
  height: 13px;
  color: #0A213C;
  flex-shrink: 0;
}

/* ===========================
   TOOL WORKSPACE VIEWS
   =========================== */
.tool-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.back-home-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 11px;
  border: 1.5px solid var(--border-gold);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(10, 33, 60, 0.06);
  transition: background 0.15s ease, transform 0.14s ease;
}

.back-home-btn:hover {
  background: var(--bg-subtle);
  transform: translateX(-2px);
}

.unit-tag-lg {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 15px;
  border-radius: 999px;
  border: 1.5px solid var(--border-gold);
  background: var(--bg-subtle);
  color: var(--text-primary);
  font-size: 13.5px;
  font-weight: 700;
}

.panel-header {
  margin-bottom: 18px;
}

.panel-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 34px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--text-primary);
  -webkit-text-stroke: 0.35px currentColor;
}

.panel-subtitle {
  margin: 6px 0 0 0;
  font-size: 15.5px;
  color: var(--text-secondary);
  max-width: 780px;
}

.studio-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: 20px;
  align-items: start;
}

.card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-soft);
  border-radius: 16px;
  padding: 22px;
  box-shadow: var(--shadow-card);
}

.card-title {
  margin: 0 0 14px 0;
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
}

.field {
  margin-bottom: 16px;
}

.field-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-primary);
}

.field-hint {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
}

.input, .textarea, .select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 11px;
  border: 1.5px solid var(--border-soft);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 15px;
  line-height: 1.45;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.textarea {
  min-height: 116px;
  resize: vertical;
}

.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: var(--border-gold-strong);
  box-shadow: 0 0 0 3px rgba(212, 165, 72, 0.22);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 9px;
}

.chip {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-gold);
  background: var(--bg-subtle);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.14s ease, transform 0.12s ease;
}

.chip:hover {
  background: rgba(226, 174, 86, 0.24);
  transform: translateY(-1px);
}

.option-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.option-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.opt-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 11px 13px;
  border-radius: 11px;
  border: 1.5px solid var(--border-soft);
  background: var(--bg-panel);
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.opt-btn strong {
  font-size: 14px;
  font-weight: 700;
}

.opt-btn span {
  font-size: 12.5px;
  color: var(--text-muted);
}

.opt-btn:hover {
  border-color: var(--border-gold);
}

.opt-btn.selected {
  border-color: var(--border-gold-strong);
  background: linear-gradient(135deg, rgba(240, 203, 121, 0.22) 0%, rgba(226, 174, 86, 0.12) 100%);
  box-shadow: 0 0 0 2px rgba(212, 165, 72, 0.22);
}

/* Dropzone */
.dropzone {
  position: relative;
  border: 2px dashed var(--border-gold);
  border-radius: 13px;
  padding: 24px 16px;
  text-align: center;
  background: var(--bg-subtle);
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease;
}

.dropzone.dragover {
  background: rgba(226, 174, 86, 0.22);
  border-color: var(--border-gold-strong);
}

.dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.dropzone-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.dropzone-sub {
  margin-top: 4px;
  font-size: 13px;
  color: var(--text-muted);
}

.upload-preview {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 11px;
  border: 1px solid var(--border-gold);
  background: var(--bg-panel);
  display: flex;
  align-items: center;
  gap: 12px;
}

.upload-preview img {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  object-fit: cover;
}

.upload-preview-info {
  flex: 1;
  min-width: 0;
}

.upload-preview-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-preview-size {
  font-size: 12.5px;
  color: var(--text-muted);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 18px;
  border-radius: 11px;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: transform 0.14s ease, filter 0.14s ease, background 0.14s ease;
}

.btn:disabled {
  opacity: 0.65;
  cursor: wait;
}

.btn-gold {
  background: linear-gradient(180deg, #F0CB79 0%, #DBAA4D 100%);
  border-color: #C9963A;
  color: #071B30;
  box-shadow: 0 3px 10px rgba(185, 135, 50, 0.25);
}

.btn-gold:hover:not(:disabled) {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.btn-lg {
  width: 100%;
  padding: 14px 20px;
  font-size: 16px;
  border-radius: 12px;
}

.btn-ghost {
  background: var(--bg-panel);
  border-color: var(--border-gold);
  color: var(--text-primary);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--bg-subtle);
}

.btn-subtle {
  background: var(--bg-subtle);
  border-color: var(--border-soft);
  color: var(--text-primary);
  padding: 7px 12px;
  font-size: 13px;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

/* Status messages & QC badges */
.status-msg {
  margin-top: 12px;
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
}

.status-msg.success {
  background: var(--badge-ok-bg);
  border: 1px solid var(--badge-ok-border);
  color: var(--badge-ok-text);
}

.status-msg.error {
  background: var(--badge-err-bg);
  border: 1px solid var(--badge-err-border);
  color: var(--badge-err-text);
}

.qc-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.qc-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: var(--badge-ok-bg);
  border: 1px solid var(--badge-ok-border);
  color: var(--badge-ok-text);
}

.qc-badge-gold {
  background: var(--bg-subtle);
  border: 1px solid var(--border-gold);
  color: var(--text-primary);
}

/* Result Stage */
.result-stage {
  min-height: 360px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.empty-stage,
.loading-stage {
  text-align: center;
  padding: 36px 20px;
  color: var(--text-secondary);
}

.empty-stage-icon {
  width: 58px;
  height: 58px;
  margin: 0 auto 14px auto;
  border-radius: 16px;
  background: var(--bg-subtle);
  border: 1.5px solid var(--border-gold);
  color: var(--gold-icon);
  display: flex;
  align-items: center;
  justify-content: center;
}

.empty-stage h3,
.loading-stage h3 {
  margin: 0 0 8px 0;
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
}

.empty-stage p,
.loading-stage p {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.5;
}

.spinner {
  width: 44px;
  height: 44px;
  margin: 0 auto 16px auto;
  border-radius: 50%;
  border: 4px solid rgba(204, 164, 78, 0.25);
  border-top-color: #C9963A;
  animation: spin 0.85s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.media-frame {
  border-radius: 13px;
  overflow: hidden;
  border: 1.5px solid var(--border-gold);
  background: #07192D;
}

.media-frame img,
.media-frame video {
  width: 100%;
  max-height: 460px;
  object-fit: contain;
  display: block;
}

.compare-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.compare-card {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border-soft);
  background: var(--bg-panel);
  padding: 10px;
}

.compare-card img {
  width: 100%;
  max-height: 260px;
  object-fit: contain;
  border-radius: 8px;
  display: block;
}

.audio-box {
  padding: 14px;
  border-radius: 12px;
  border: 1.5px solid var(--border-soft);
  background: var(--bg-panel);
  margin-bottom: 10px;
}

.audio-box-label {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.audio-box audio {
  width: 100%;
  display: block;
}

/* 37-Language Picker */
.lang-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.lang-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  max-height: 215px;
  overflow-y: auto;
  padding: 4px;
  border: 1px solid var(--border-soft);
  border-radius: 11px;
  background: var(--bg-panel);
}

.lang-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 9px;
  border: 1px solid var(--border-soft);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.lang-pill.selected {
  background: linear-gradient(135deg, #F0CB79 0%, #DFA94D 100%);
  border-color: #C49034;
  color: #071B30;
  font-weight: 700;
}

.dub-track-card {
  padding: 14px;
  border-radius: 12px;
  border: 1.5px solid var(--border-gold);
  background: var(--bg-panel);
  margin-bottom: 12px;
}

.dub-track-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.dub-track-lang {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

.dub-preview-text {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0 0 10px 0;
  line-height: 1.45;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--bg-subtle);
}

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

.queue-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border-soft);
  background: var(--bg-panel);
}

.queue-id {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

/* ===========================
   LIBRARY / FAVORITES / PROJECTS
   =========================== */
.library-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-pill {
  padding: 8px 15px;
  border-radius: 999px;
  border: 1.5px solid var(--border-soft);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.filter-pill.active {
  background: linear-gradient(135deg, #F0CB79 0%, #DDA84B 100%);
  border-color: #C79338;
  color: #071B30;
}

.library-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.lib-card {
  border-radius: 15px;
  border: 1.5px solid var(--border-soft);
  background: var(--bg-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-card);
}

.lib-preview {
  position: relative;
  height: 200px;
  background: #0A1E35;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.lib-preview img,
.lib-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lib-preview-audio {
  width: 100%;
  padding: 18px;
  color: #FFFFFF;
}

.lib-preview-audio .audio-box-label {
  color: #F2D283;
}

.fav-toggle-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(7, 25, 45, 0.72);
  color: #FFFFFF;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 4;
}

.fav-toggle-btn.is-fav {
  background: #E8B85B;
  color: #071B30;
  border-color: #F8DF9F;
}

.lib-body {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.lib-name {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-primary);
  word-break: break-word;
}

.lib-meta {
  font-size: 12.5px;
  color: var(--text-muted);
}

.lib-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
  padding-top: 8px;
}

/* Help & Projects Cards */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.project-folder-card {
  padding: 20px;
  border-radius: 16px;
  border: 1.5px solid var(--border-gold);
  background: var(--bg-card);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  text-align: left;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.project-folder-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
}

.project-folder-card h3 {
  margin: 10px 0 4px 0;
  font-family: var(--font-serif);
  font-size: 23px;
  font-weight: 700;
  color: var(--text-primary);
}

.project-folder-card p {
  margin: 0;
  font-size: 13.5px;
  color: var(--text-secondary);
}

.guide-table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
}

.guide-table th,
.guide-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--border-soft);
  text-align: left;
  font-size: 14.5px;
}

.guide-table th {
  font-weight: 700;
  color: var(--text-primary);
  background: var(--bg-subtle);
}

.guide-table td:last-child {
  font-weight: 700;
  color: var(--gold-deep);
  white-space: nowrap;
}

html[data-theme="navy"] .guide-table td:last-child {
  color: #F0CB79;
}

/* ===========================
   MODALS
   =========================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(4, 18, 34, 0.68);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.modal-backdrop.open {
  display: flex;
}

.modal-card {
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 18px;
  border: 1.5px solid var(--border-gold);
  background: var(--bg-card);
  color: var(--text-primary);
  padding: 24px;
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.36);
}

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

.modal-header h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
}

.close-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border-soft);
  background: var(--bg-subtle);
  color: var(--text-primary);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

/* ===========================
   RESPONSIVE (Tablet & Mobile 390px)
   =========================== */
@media (max-width: 1180px) {
  .hub-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .recent-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .studio-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .mobile-menu-btn {
    display: inline-flex;
  }
  .sidebar {
    position: fixed;
    top: var(--topbar-h);
    left: 0;
    bottom: 0;
    z-index: 80;
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    box-shadow: 8px 0 30px rgba(0, 0, 0, 0.35);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .workspace {
    padding: 18px 16px 28px 16px;
  }
  .theme-chip span {
    display: none;
  }
  .topbar {
    padding: 0 12px;
    gap: 8px;
  }
  .brand-wordmark {
    font-size: 20px;
    gap: 5px;
  }
  .brand-monogram {
    width: 28px;
    height: 24px;
  }
  .balance-value {
    font-size: 14.5px;
  }
  .coins-icon {
    width: 22px;
    height: 22px;
  }
  .topbar-divider {
    display: none;
  }
  .topup-pill {
    height: 34px;
    padding: 0 12px;
    font-size: 12.5px;
    max-width: 210px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .topbar-right {
    gap: 8px;
  }
}

.topup-pill .cta-short {
  display: none;
}

@media (max-width: 640px) {
  .topup-pill .cta-full {
    display: none;
  }
  .topup-pill .cta-short {
    display: inline;
  }
  .theme-chip {
    display: none;
  }
  .brand-wordmark {
    font-size: 18px;
  }
  .home-title {
    font-size: 30px;
  }
  .home-subtitle {
    font-size: 14.5px;
  }
  .hub-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .hub-card {
    height: 152px;
  }
  .hub-card-title {
    font-size: 22px;
  }
  .recent-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 11px;
  }
  .library-grid,
  .projects-grid,
  .option-grid,
  .lang-grid,
  .compare-grid {
    grid-template-columns: 1fr;
  }
  .balance-value {
    display: none;
  }
  .balance-group {
    display: none;
  }
  .topup-pill {
    max-width: 168px;
    font-size: 11.5px;
    padding: 0 10px;
  }
}

/* Center Next-Step Studio Pills (compact Royal Navy & warm gold) */
.topbar-center {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  flex: 1 1 auto;
  min-width: 0;
  padding: 0 6px;
}

.topbar-step-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 0 13px;
  border-radius: 999px;
  border: 1px solid rgba(226, 174, 86, 0.34);
  background: rgba(255, 255, 255, 0.06);
  color: #F3E2BA;
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.14s ease, box-shadow 0.16s ease;
}

.topbar-step-pill svg {
  flex-shrink: 0;
  color: #E7BC63;
}

.topbar-step-pill.topbar-step-upload {
  border-color: rgba(236, 194, 108, 0.5);
  background: rgba(226, 174, 86, 0.13);
  color: #FFF4D6;
}

.topbar-step-pill:hover,
.topbar-step-pill:focus-visible {
  background: rgba(226, 174, 86, 0.24);
  border-color: rgba(244, 213, 127, 0.8);
  color: #FFFFFF;
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.22);
  outline: none;
}

.sidebar-next-steps {
  display: none;
  flex-direction: column;
  gap: 6px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(226, 174, 86, 0.2);
}

.sidebar-next-label {
  padding: 0 12px 2px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(243, 212, 139, 0.72);
}

.sidebar-next-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid rgba(226, 174, 86, 0.24);
  background: rgba(255, 255, 255, 0.04);
  color: #F3E2BA;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.sidebar-next-link:hover {
  background: rgba(226, 174, 86, 0.18);
  border-color: rgba(244, 213, 127, 0.65);
  color: #FFFFFF;
}

@media (max-width: 1180px) {
  .topbar-center {
    gap: 6px;
  }
  .topbar-step-pill {
    padding: 0 10px;
    font-size: 12px;
    gap: 5px;
  }
}

@media (max-width: 980px) {
  .topbar-center {
    display: none;
  }
  .sidebar-next-steps {
    display: flex;
  }
}

/* =====================================================
   STUDIO PRO RATIOS, VARIATIONS, CHAINING & LIGHTBOX
   ===================================================== */
.option-grid-ratios {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.option-grid-ratios .opt-btn {
  padding: 9px 11px;
}

.option-grid-ratios .opt-btn strong {
  font-size: 13px;
}

.option-grid-ratios .opt-btn span {
  font-size: 11.5px;
}

.variation-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.variation-card {
  border-radius: 12px;
  overflow: hidden;
  border: 1.5px solid var(--border-gold);
  background: var(--bg-panel);
  display: flex;
  flex-direction: column;
}

.variation-thumb {
  position: relative;
  background: #07192D;
  cursor: pointer;
  overflow: hidden;
}

.variation-thumb img {
  width: 100%;
  height: 210px;
  object-fit: cover;
  display: block;
  transition: transform 0.2s ease;
}

.variation-thumb:hover img {
  transform: scale(1.03);
}

.variation-meta {
  padding: 9px 10px 6px 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  display: flex;
  justify-content: space-between;
  gap: 6px;
}

.variation-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 10px 10px 10px;
}

.btn-chain {
  padding: 6px 10px;
  font-size: 12.5px;
  border-radius: 9px;
}

.media-frame.is-clickable,
.compare-card.is-clickable,
.lib-preview.is-clickable {
  cursor: pointer;
}

.media-frame.is-clickable:hover img,
.compare-card.is-clickable:hover img {
  filter: brightness(1.03);
}

.lib-actions {
  flex-wrap: wrap;
}

.royalty-callout {
  padding: 13px 15px;
  border-radius: 12px;
  border: 1.5px solid var(--border-gold);
  background: var(--bg-subtle);
  color: var(--text-primary);
  font-size: 13.5px;
  line-height: 1.55;
}

.royalty-callout code,
.lb-royalty-note code {
  padding: 1px 5px;
  border-radius: 5px;
  background: rgba(212, 165, 72, 0.18);
  font-size: 12px;
}

/* Full-Screen Studio Creation Lightbox */
.lightbox-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2147483500;
  background: rgba(4, 15, 29, 0.88);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 14px;
  box-sizing: border-box;
}

.lightbox-backdrop.open {
  display: flex;
}

.lightbox-shell {
  position: relative;
  width: min(1120px, calc(100vw - 28px));
  max-width: calc(100vw - 28px);
  max-height: calc(100vh - 28px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
  border-radius: 20px;
  border: 1.5px solid var(--border-gold);
  background: var(--bg-card);
  color: var(--text-primary);
  overflow: hidden;
  box-sizing: border-box;
  box-shadow: 0 28px 72px rgba(0, 0, 0, 0.55);
}

.lightbox-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 10;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1.5px solid var(--border-gold);
  background: rgba(7, 25, 45, 0.85);
  color: #FFFFFF;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.lightbox-close:hover {
  background: #E8B85B;
  color: #071B30;
}

.lightbox-stage {
  position: relative;
  background: #061526;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 16px 20px 20px;
  min-width: 0;
  max-width: 100%;
  height: calc(100vh - 28px);
  min-height: 320px;
  max-height: calc(100vh - 28px);
  overflow: hidden;
  box-sizing: border-box;
}

.lb-media-wrap {
  flex: 1 1 0%;
  min-height: 0;
  height: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.lightbox-stage img,
.lightbox-stage video {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 10px;
  display: block;
}

/* Gleaming Golden-Yellow Dismissible Commission Hop-Link Banner at TOP of Opened Creation */
.hf-lb-hoplink-banner {
  flex: 0 0 auto;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 13px;
  background: linear-gradient(135deg, #FFF7CC 0%, #FDE073 48%, #EFC042 100%);
  border: 1.5px solid #D49B1A;
  color: #0B1F3A;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.72);
  font-family: 'Figtree', system-ui, -apple-system, sans-serif;
  text-align: left;
}

.hf-lb-hoplink-banner.is-dismissed,
.hf-lb-hoplink-banner[hidden] {
  display: none !important;
}

.hf-lb-hop-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.hf-lb-hop-headline {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: 'Cormorant', Georgia, serif;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.15;
  color: #08182E;
  letter-spacing: -0.01em;
}

.hf-lb-hop-star {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 21px;
  height: 21px;
  border-radius: 999px;
  background: #0B1F3A;
  color: #FDE073;
  font-size: 12px;
  flex-shrink: 0;
}

.hf-lb-hop-sub {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.42;
  font-weight: 500;
  color: #162B49;
}

.hf-lb-hop-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-top: 2px;
}

.hf-lb-hop-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(11, 31, 58, 0.11);
  border: 1px solid rgba(11, 31, 58, 0.24);
  color: #0B1F3A;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.25;
  max-width: 100%;
  word-break: break-all;
}

.hf-lb-hop-chip.is-active {
  background: #0F5132;
  border-color: #0A3B24;
  color: #ECFDF5;
}

.hf-lb-hop-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 999px;
  font-family: 'Figtree', system-ui, sans-serif;
  font-size: 11.8px;
  font-weight: 800;
  line-height: 1.25;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.12s ease, background 0.14s ease, box-shadow 0.14s ease;
}

.hf-lb-hop-btn[hidden] {
  display: none !important;
}

.hf-lb-hop-btn.is-vault {
  background: #0B1F3A;
  border: 1.5px solid #0B1F3A;
  color: #FDE073;
  box-shadow: 0 3px 10px rgba(11, 31, 58, 0.22);
}

.hf-lb-hop-btn.is-vault:hover {
  background: #14325B;
  color: #FFF7CC;
  transform: translateY(-1px);
}

.hf-lb-hop-btn.is-copy,
.hf-lb-hop-btn.is-activate {
  background: rgba(255, 255, 255, 0.82);
  border: 1.5px solid #0B1F3A;
  color: #0B1F3A;
}

.hf-lb-hop-btn.is-copy:hover,
.hf-lb-hop-btn.is-activate:hover {
  background: #FFFFFF;
  transform: translateY(-1px);
}

.hf-lb-hop-close {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1.5px solid rgba(11, 31, 58, 0.32);
  background: rgba(255, 255, 255, 0.55);
  color: #0B1F3A;
  font-size: 19px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.14s ease, color 0.14s ease;
}

.hf-lb-hop-close:hover {
  background: #0B1F3A;
  color: #FDE073;
  border-color: #0B1F3A;
}

.lightbox-stage .lb-audio-stage {
  width: 100%;
  max-width: 480px;
  padding: 26px 22px;
  border-radius: 16px;
  border: 1.5px solid rgba(232, 188, 103, 0.45);
  background: rgba(255, 255, 255, 0.05);
  color: #FFFFFF;
  text-align: center;
}

.lightbox-stage .lb-audio-stage audio {
  width: 100%;
  margin-top: 14px;
}

.lightbox-panel {
  min-width: 0;
  max-width: 100%;
  padding: 18px 20px 22px 20px;
  overflow-x: hidden;
  overflow-y: auto;
  max-height: calc(100vh - 28px);
  border-left: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-sizing: border-box;
  scrollbar-gutter: stable;
}

.lightbox-panel > *,
.lb-head,
.lb-section,
.lb-section-head,
.lb-prompt-text,
.lb-meta-grid,
.lb-meta-cell,
.lb-chain-row,
.lb-export-section,
.lb-export-grid,
.lb-share-box,
.lb-share-bar {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.lb-eyebrow {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold-deep);
}

html[data-theme="navy"] .lb-eyebrow {
  color: #F0CB79;
}

.lb-title {
  margin: 4px 0 0 0;
  font-family: var(--font-serif);
  font-size: 24px;
  line-height: 1.18;
  color: var(--text-primary);
  padding-right: 40px;
  word-break: break-word;
}

.lb-section {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.lb-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 8px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.lb-section-head > span {
  min-width: 0;
  max-width: 100%;
  white-space: normal;
  word-break: break-word;
}

.lb-mini-btn {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-gold);
  background: var(--bg-subtle);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.lb-mini-btn:hover {
  background: rgba(226, 174, 86, 0.24);
}

.lb-prompt-text {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-soft);
  background: var(--bg-panel);
  color: var(--text-primary);
  font-size: 13.5px;
  line-height: 1.5;
  max-height: 120px;
  overflow-y: auto;
  word-break: break-word;
}

.lb-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.lb-meta-cell {
  padding: 8px 10px;
  border-radius: 9px;
  border: 1px solid var(--border-soft);
  background: var(--bg-panel);
}

.lb-meta-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.lb-meta-val {
  margin-top: 2px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  word-break: break-word;
}

.lb-chain-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 7px;
}

.lb-chain-btn {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 9px 12px;
  font-size: 13.5px;
  justify-content: space-between;
  white-space: normal;
  text-align: left;
  box-sizing: border-box;
}

.lightbox-panel .btn,
.lightbox-panel a.btn {
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  white-space: normal;
  line-height: 1.3;
}

.lb-share-box {
  padding: 12px;
  border-radius: 12px;
  border: 1.5px solid var(--border-gold);
  background: var(--bg-subtle);
}

.lb-share-bar {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.lb-share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 8px;
  border-radius: 9px;
  border: 1px solid var(--border-gold);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: none;
  text-align: center;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  white-space: normal;
  line-height: 1.25;
  cursor: pointer;
  transition: background 0.14s ease, transform 0.12s ease;
}

.lb-share-btn:hover {
  background: rgba(226, 174, 86, 0.25);
  transform: translateY(-1px);
}

.lb-share-copy {
  background: linear-gradient(180deg, #F0CB79 0%, #DBAA4D 100%);
  border-color: #C9963A;
  color: #071B30;
}

.lb-ref-status {
  font-size: 12px;
  font-weight: 700;
  color: var(--gold-deep);
  word-break: break-all;
}

html[data-theme="navy"] .lb-ref-status {
  color: #F0CB79;
}

.lb-royalty-note {
  margin: 4px 0 0 0;
  font-size: 12.2px;
  line-height: 1.5;
  color: var(--text-secondary);
}

@media (max-width: 960px) {
  .lightbox-backdrop {
    padding: 10px;
  }
  .lightbox-shell {
    width: calc(100vw - 20px);
    max-width: calc(100vw - 20px);
    grid-template-columns: minmax(0, 1fr);
    max-height: calc(100vh - 20px);
    overflow-y: auto;
  }
  .lightbox-stage {
    height: auto;
    min-height: 0;
    max-height: none;
    justify-content: flex-start;
    overflow: visible;
    padding: 52px 12px 14px;
    gap: 10px;
  }
  .lightbox-stage .lb-media-wrap {
    flex: 0 0 auto;
    height: auto;
    max-height: none;
    overflow: visible;
  }
  .lightbox-stage img,
  .lightbox-stage video {
    max-width: 100%;
    max-height: 46vh;
    width: auto;
    height: auto;
  }
  .hf-lb-hoplink-banner {
    padding: 10px 11px;
    gap: 8px;
  }
  .hf-lb-hop-headline {
    font-size: 16px;
  }
  .hf-lb-hop-sub {
    font-size: 12px;
  }
  .hf-lb-hop-btn {
    white-space: normal;
    text-align: left;
    font-size: 11.5px;
  }
  .lightbox-panel {
    max-height: none;
    overflow-y: visible;
    border-left: none;
    border-top: 1px solid var(--border-soft);
    padding: 16px 14px 20px 14px;
  }
}

@media (max-width: 640px) {
  .option-grid-ratios {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .variation-gallery {
    grid-template-columns: 1fr;
  }
}

/* =====================================================================
   ALONGSIDE+ FLAGSHIP PRODUCTION SUITE UPGRADE STYLES
   Simple/Advanced Modes, Luminous Nav Ribbon, SeaArt Masonry Mosaic,
   6-Ref Deck, Live Mic, 3D Camera Lab Countdown, AI Director, Exchange
   ===================================================================== */

/* Fix Sticky Top Bar Clearance so NO heading ever clips behind the 64px topbar */
.workspace {
  padding-top: 24px !important;
}
.view-panel {
  padding-top: 12px;
  scroll-margin-top: 88px;
}
.panel-header,
.panel-title,
.view-panel h1,
.view-panel h2 {
  scroll-margin-top: 90px;
}

/* Simple vs Advanced Mode visibility */
html[data-studio-mode="simple"] .advanced-only {
  display: none !important;
}
html[data-studio-mode="advanced"] .simple-only {
  display: none !important;
}

/* Executive Mode & AI Director Control Bar inside Luminous Nav */
.studio-exec-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 2px 4px 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(226, 174, 86, 0.22);
}
.studio-exec-left,
.studio-exec-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.exec-bar-label {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(246, 218, 147, 0.86);
}

/* Mode Toggle Switch */
.mode-switch {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(226, 174, 86, 0.36);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
  flex-shrink: 0;
}
.mode-switch-btn {
  border: none;
  background: transparent;
  color: rgba(248, 244, 234, 0.78);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}
.mode-switch-btn.active {
  background: linear-gradient(135deg, #F4D587 0%, #D9A243 100%);
  color: #071A2F;
  box-shadow: 0 2px 8px rgba(226, 174, 86, 0.35);
}
.mode-switch-btn:hover:not(.active) {
  color: #FFFFFF;
}

/* AI Studio Director Topbar & Floating Pill */
.director-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid rgba(242, 207, 126, 0.65);
  background: linear-gradient(135deg, rgba(226, 174, 86, 0.24) 0%, rgba(185, 135, 50, 0.14) 100%);
  color: #FCE8AE;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  box-shadow: 0 0 14px rgba(226, 174, 86, 0.2);
}
.director-pill-btn:hover,
.director-pill-btn.active {
  background: linear-gradient(135deg, #F5D98E 0%, #D59B38 100%);
  color: #061A2E;
  transform: translateY(-1px);
}
.director-spark {
  display: inline-block;
  animation: sparkPulse 2.4s ease-in-out infinite;
}
@keyframes sparkPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.22); opacity: 0.78; }
}

/* =====================================================================
   ORIGINAL ALONGSIDE+ LUMINOUS STUDIO NAVIGATION RIBBON
   ===================================================================== */
.luminous-nav-wrap {
  margin-bottom: 22px;
  padding: 10px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(8, 30, 53, 0.96) 0%, rgba(14, 42, 72, 0.94) 100%);
  border: 1px solid rgba(226, 174, 86, 0.34);
  box-shadow: 0 10px 26px rgba(6, 26, 46, 0.16);
}
.luminous-nav-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}
.lum-nav-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
  padding: 11px 12px;
  border-radius: 13px;
  border: 1px solid rgba(226, 174, 86, 0.2);
  background: rgba(255, 255, 255, 0.045);
  color: #F4EFE4;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.22s ease;
  min-height: 76px;
}
.lum-nav-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(125deg, rgba(242, 207, 126, 0.14) 0%, transparent 55%);
  opacity: 0;
  transition: opacity 0.22s ease;
  pointer-events: none;
}
.lum-nav-card:hover {
  border-color: rgba(242, 207, 126, 0.6);
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.09);
}
.lum-nav-card:hover::before,
.lum-nav-card.active::before {
  opacity: 1;
}
.lum-nav-card.active {
  border-color: #EBC574;
  background: linear-gradient(135deg, rgba(226, 174, 86, 0.24) 0%, rgba(16, 46, 78, 0.92) 100%);
  box-shadow: 0 4px 16px rgba(226, 174, 86, 0.22);
}
.lum-nav-top {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.lum-nav-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(242, 207, 126, 0.18);
  color: #F6DA93;
  border: 1px solid rgba(242, 207, 126, 0.34);
  white-space: nowrap;
}
.lum-nav-title {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  color: #FFFFFF;
}
.lum-nav-sub {
  font-size: 11px;
  color: rgba(226, 232, 240, 0.78);
  line-height: 1.25;
}

/* CSS Animated Equalizer Waveform & 3D Wireframe Glow */
.mini-eq {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 16px;
}
.mini-eq span {
  width: 3px;
  border-radius: 2px;
  background: linear-gradient(180deg, #F8DF98 0%, #D49A37 100%);
  animation: eqBounce 1.15s ease-in-out infinite;
}
.mini-eq span:nth-child(1) { height: 6px; animation-delay: 0s; }
.mini-eq span:nth-child(2) { height: 14px; animation-delay: 0.18s; }
.mini-eq span:nth-child(3) { height: 9px; animation-delay: 0.36s; }
.mini-eq span:nth-child(4) { height: 15px; animation-delay: 0.52s; }
.mini-eq span:nth-child(5) { height: 7px; animation-delay: 0.68s; }
@keyframes eqBounce {
  0%, 100% { transform: scaleY(0.42); }
  50% { transform: scaleY(1); }
}

.cube-glow-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #F4D382;
  animation: cubeFloat 2.8s ease-in-out infinite;
}
@keyframes cubeFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-2px) rotate(6deg); }
}

/* =====================================================================
   SIMPLE MODE 3-STEP BANNER & PRODUCTION STRATEGY CARDS
   ===================================================================== */
.simple-steps-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 14px 18px;
  margin-bottom: 20px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-subtle) 100%);
  border: 1px solid var(--border-gold);
  box-shadow: var(--shadow-card);
}
.simple-steps-track {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.simple-step-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--bg-panel);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  padding: 6px 12px;
}
.simple-step-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #E8B95B 0%, #BE862D 100%);
  color: #071A2E;
  font-size: 11px;
  font-weight: 800;
}
.simple-step-arrow {
  color: var(--gold-deep);
  font-weight: 700;
}

.strategy-section {
  margin-bottom: 26px;
}
.strategy-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.strategy-head h2 {
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 700;
  margin: 0;
  color: var(--text-primary);
}
.strategy-head p {
  margin: 2px 0 0;
  font-size: 13.5px;
  color: var(--text-secondary);
}
.strategy-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}
.strategy-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  padding: 15px;
  border-radius: 15px;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-card);
  transition: all 0.2s ease;
}
.strategy-card:hover {
  border-color: var(--border-gold);
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-2px);
}
.strategy-card.featured-recipe {
  border-color: var(--border-gold);
  background: linear-gradient(160deg, var(--bg-card) 0%, var(--bg-subtle) 100%);
}
.strategy-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gold-deep);
  margin-bottom: 4px;
}
.strategy-card h3 {
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 6px;
  color: var(--text-primary);
}
.strategy-card p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.42;
  color: var(--text-secondary);
}
.strategy-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}
.strategy-spec-chip {
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-soft);
  color: var(--text-secondary);
}
.strategy-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.strategy-load-btn {
  flex: 1;
  min-width: 110px;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #E8B95B 0%, #C68E32 100%);
  color: #071A2E;
  cursor: pointer;
  transition: filter 0.18s ease;
}
.strategy-load-btn:hover {
  filter: brightness(1.06);
}
.strategy-info-btn {
  padding: 8px 9px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 10px;
  border: 1px solid var(--border-soft);
  background: var(--bg-panel);
  color: var(--text-primary);
  cursor: pointer;
}
.strategy-info-btn:hover {
  border-color: var(--border-gold);
}

/* =====================================================================
   UNIVERSAL PROMPT ENHANCER & VOICE DICTATION TOOLBAR
   ===================================================================== */
.prompt-assist-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.prompt-assist-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.btn-dictate {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: var(--bg-panel);
  color: var(--text-primary);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
}
.btn-dictate:hover {
  border-color: var(--border-gold);
}
.btn-dictate.listening {
  background: #DC2626;
  border-color: #DC2626;
  color: #FFFFFF;
  animation: micPulse 1.2s ease-in-out infinite;
}
@keyframes micPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.55); }
  50% { box-shadow: 0 0 0 8px rgba(220, 38, 38, 0); }
}

.btn-enhance {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border-gold-strong);
  background: linear-gradient(135deg, #0A2542 0%, #163C66 100%);
  color: #FCE6A6;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
}
.btn-enhance:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(10, 33, 60, 0.25);
}
.btn-enhance:disabled {
  opacity: 0.65;
  cursor: wait;
}
.btn-undo-enhance {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: transparent;
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
}
.enhance-feedback {
  margin-top: 8px;
  padding: 9px 12px;
  border-radius: 10px;
  background: var(--badge-ok-bg);
  border: 1px solid var(--badge-ok-border);
  color: var(--badge-ok-text);
  font-size: 12.5px;
  line-height: 1.4;
}

/* =====================================================================
   FEATURE PILLS & FRONTIER MODEL ROSTER CARDS
   ===================================================================== */
.feature-pill-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 16px;
}
.feature-mode-pill {
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: var(--bg-panel);
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s ease;
}
.feature-mode-pill:hover {
  border-color: var(--border-gold);
  color: var(--text-primary);
}
.feature-mode-pill.active {
  background: #0A233E;
  color: #FBE4A2;
  border-color: #D9A54A;
}

.model-roster-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}
.model-card-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1.5px solid var(--border-soft);
  background: var(--bg-panel);
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
  transition: all 0.16s ease;
}
.model-card-btn:hover {
  border-color: var(--border-gold);
}
.model-card-btn.selected {
  border-color: var(--border-gold-strong);
  background: var(--bg-subtle);
  box-shadow: 0 0 0 2px rgba(210, 165, 72, 0.25);
}
.model-card-head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.model-card-name {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
}
.model-cost-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(217, 165, 74, 0.18);
  color: var(--gold-deep);
  white-space: nowrap;
}
.model-card-tag {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gold-deep);
}
.model-card-desc {
  font-size: 11.5px;
  color: var(--text-secondary);
  line-height: 1.32;
}

/* =====================================================================
   6-SLOT TAGGED REFERENCE IMAGE DECK + MOTION VIDEO + LIVE MIC RECORDER
   ===================================================================== */
.ref-deck-box {
  padding: 14px;
  border-radius: 14px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-soft);
  margin-bottom: 16px;
}
.ref-deck-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.ref-deck-header strong {
  font-size: 14px;
  color: var(--text-primary);
}
.ref-deck-header span {
  font-size: 12px;
  color: var(--text-muted);
}
.ref-slots-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.ref-slot-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  border-radius: 11px;
  background: var(--bg-panel);
  border: 1px dashed var(--border-gold);
}
.ref-slot-card.filled {
  border-style: solid;
  border-color: var(--border-gold-strong);
}
.ref-slot-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}
.ref-slot-label {
  font-size: 11px;
  font-weight: 800;
  color: var(--gold-deep);
  text-transform: uppercase;
}
.ref-slot-insert {
  border: none;
  background: var(--bg-subtle);
  color: var(--text-primary);
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 6px;
  cursor: pointer;
}
.ref-slot-drop {
  position: relative;
  height: 76px;
  border-radius: 8px;
  background: var(--bg-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  overflow: hidden;
  font-size: 11.5px;
  color: var(--text-muted);
  padding: 6px;
}
.ref-slot-drop input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.ref-slot-drop img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #07192D;
  display: block;
}
.ref-slot-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: none;
  background: rgba(6, 26, 46, 0.85);
  color: #FFFFFF;
  font-size: 12px;
  cursor: pointer;
  z-index: 3;
}
.ref-tag-select {
  width: 100%;
  padding: 5px 6px;
  font-size: 11.5px;
  border-radius: 7px;
  border: 1px solid var(--border-soft);
  background: var(--bg-input);
  color: var(--text-primary);
}

/* Video & Live Audio Reference Deck */
.av-ref-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.av-ref-card {
  padding: 12px;
  border-radius: 12px;
  background: var(--bg-panel);
  border: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.av-ref-card h4 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}
.av-ref-card p {
  margin: 0;
  font-size: 11.5px;
  color: var(--text-muted);
}
.mic-recorder-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.btn-mic-rec {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 13px;
  border-radius: 999px;
  border: 1px solid #DC2626;
  background: rgba(220, 38, 38, 0.1);
  color: #B91C1C;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}
html[data-theme="navy"] .btn-mic-rec {
  color: #FCA5A5;
}
.btn-mic-rec.recording {
  background: #DC2626;
  color: #FFFFFF;
  animation: micPulse 1.1s ease-in-out infinite;
}
.mic-timer-pill {
  font-variant-numeric: tabular-nums;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-primary);
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-soft);
}
.file-pill-label {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: var(--bg-subtle);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.file-pill-label input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

/* =====================================================================
   CREATOR LICENSING & CASH-OUT ROYALTY EXCHANGE SELECTOR
   ===================================================================== */
.licensing-box {
  margin: 14px 0;
  padding: 13px;
  border-radius: 13px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-soft);
}
.licensing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}
.license-opt-btn {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px;
  border-radius: 10px;
  border: 1.5px solid var(--border-soft);
  background: var(--bg-panel);
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
  transition: all 0.16s ease;
}
.license-opt-btn strong {
  font-size: 12.5px;
  color: var(--text-primary);
}
.license-opt-btn span {
  font-size: 11px;
  line-height: 1.32;
  color: var(--text-secondary);
}
.license-opt-btn.selected {
  border-color: var(--border-gold-strong);
  box-shadow: 0 0 0 2px rgba(210, 165, 72, 0.24);
}
.license-royalty-tag {
  display: inline-block;
  margin-top: 3px;
  font-size: 10px;
  font-weight: 700;
  color: #166534;
  background: #DCFCE7;
  padding: 2px 6px;
  border-radius: 999px;
  width: fit-content;
}

/* Cost Breakdown Box */
.unit-breakdown-box {
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-gold);
  margin: 12px 0;
  font-size: 12.5px;
}
.unit-breakdown-row {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
  color: var(--text-secondary);
}
.unit-breakdown-row.total {
  border-top: 1px solid var(--border-soft);
  margin-top: 5px;
  padding-top: 6px;
  font-weight: 800;
  font-size: 13.5px;
  color: var(--text-primary);
}

/* =====================================================================
   VOICE WAVEFORM SUB-CARDS & MULTI-LANGUAGE ETA TIMER
   ===================================================================== */
.waveform-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
.waveform-card {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 13px;
  border-radius: 14px;
  border: 1.5px solid var(--border-soft);
  background: var(--bg-card);
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
  transition: all 0.18s ease;
}
.waveform-card:hover,
.waveform-card.active {
  border-color: var(--border-gold-strong);
  box-shadow: var(--shadow-card-hover);
}
.waveform-card strong {
  font-size: 13.5px;
}
.waveform-card span {
  font-size: 11.5px;
  color: var(--text-secondary);
}

.eta-math-card {
  padding: 14px 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, #071B30 0%, #102B48 100%);
  color: #F8F4EA;
  border: 1px solid rgba(235, 197, 116, 0.45);
  margin: 12px 0;
}
.eta-math-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.eta-clock-readout {
  font-family: var(--font-serif);
  font-size: 32px;
  font-weight: 700;
  color: #F6DA93;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.eta-math-note {
  font-size: 12px;
  color: rgba(248, 244, 234, 0.82);
  margin-top: 6px;
  line-height: 1.42;
}

/* =====================================================================
   3D CAMERA LAB (BLENDER) LIVE COUNTDOWN CLOCK STAGE
   ===================================================================== */
.blender-exclusive-banner {
  padding: 14px 18px;
  border-radius: 15px;
  background: linear-gradient(135deg, #081E35 0%, #13355A 100%);
  color: #FAF6EC;
  border: 1px solid rgba(242, 207, 126, 0.48);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.blender-exclusive-banner h3 {
  margin: 0 0 4px;
  font-family: var(--font-serif);
  font-size: 22px;
  color: #F7DC91;
}
.blender-exclusive-banner p {
  margin: 0;
  font-size: 13px;
  color: rgba(248, 244, 234, 0.86);
  max-width: 720px;
}

.countdown-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
  padding: 18px 14px;
}
.countdown-ring {
  width: 176px;
  height: 176px;
  border-radius: 50%;
  background: radial-gradient(circle at center, #081E35 60%, transparent 61%),
              conic-gradient(#E8B95B var(--pct, 12%), rgba(226, 174, 86, 0.2) 0);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 28px rgba(6, 26, 46, 0.25);
}
.countdown-digits {
  font-family: var(--font-serif);
  font-size: 40px;
  font-weight: 700;
  color: #FCE6A6;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.countdown-sub {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(248, 244, 234, 0.78);
  margin-top: 4px;
}
.countdown-reassure {
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-gold);
  font-size: 13px;
  line-height: 1.48;
  color: var(--text-primary);
  text-align: left;
}
.stage-checklist {
  width: 100%;
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}
.stage-checklist li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  padding: 7px 10px;
  border-radius: 9px;
  background: var(--bg-panel);
  border: 1px solid var(--border-soft);
  color: var(--text-secondary);
}
.stage-checklist li.active-stage {
  border-color: var(--border-gold-strong);
  color: var(--text-primary);
  font-weight: 700;
}

/* =====================================================================
   FLAGSHIP SHOWCASE & CREATOR EXCHANGE GALLERY
   ===================================================================== */
.showcase-license-banner {
  padding: 16px 20px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-subtle) 100%);
  border: 1.5px solid var(--border-gold);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.license-pill-gold {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 4px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, #F5D98E 0%, #D9A243 100%);
  color: #061A2E;
  margin-bottom: 6px;
}
.showcase-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.showcase-tab-btn {
  padding: 9px 16px;
  border-radius: 999px;
  border: 1.5px solid var(--border-soft);
  background: var(--bg-panel);
  color: var(--text-primary);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
}
.showcase-tab-btn.active {
  background: #081E35;
  color: #FCE6A6;
  border-color: #E2AE56;
}
.showcase-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.showcase-card {
  border-radius: 16px;
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
}
.showcase-card.premiere-card {
  border: 2px solid var(--border-gold-strong);
}
.showcase-media {
  position: relative;
  background: #07192D;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.showcase-media video,
.showcase-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.premiere-placeholder {
  padding: 20px;
  text-align: center;
  color: #F8F4EA;
  background: radial-gradient(circle at 30% 25%, rgba(226, 174, 86, 0.28), #071A2F 72%);
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.premiere-placeholder h4 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 24px;
  color: #FCE6A6;
}
.premiere-placeholder p {
  margin: 0;
  font-size: 12.5px;
  color: rgba(248, 244, 234, 0.84);
  max-width: 380px;
}
.showcase-body {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.showcase-body h3 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 21px;
  color: var(--text-primary);
}
.showcase-body p {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary);
}
.showcase-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--border-soft);
}

/* =====================================================================
   AI STUDIO DIRECTOR SLIDE-OVER DRAWER & STRATEGY EXPLAINER DRAWER
   ===================================================================== */
.director-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 18, 34, 0.56);
  z-index: 2147483600;
  display: none;
  justify-content: flex-end;
}
.director-drawer-backdrop.open {
  display: flex;
}
.director-drawer {
  width: 430px;
  max-width: 100vw;
  height: 100%;
  background: var(--bg-panel);
  color: var(--text-primary);
  border-left: 2px solid var(--border-gold);
  display: flex;
  flex-direction: column;
  box-shadow: -12px 0 36px rgba(0, 0, 0, 0.35);
}
.director-head {
  padding: 16px 18px;
  background: linear-gradient(135deg, #071A2F 0%, #102D4E 100%);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.director-head h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 23px;
  color: #FCE6A6;
}
.director-head small {
  display: block;
  font-size: 11.5px;
  color: rgba(248, 244, 234, 0.78);
}
.director-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--bg-page);
}
.dir-msg {
  max-width: 90%;
  padding: 10px 13px;
  border-radius: 13px;
  font-size: 13.5px;
  line-height: 1.46;
}
.dir-msg.agent {
  align-self: flex-start;
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  color: var(--text-primary);
}
.dir-msg.user {
  align-self: flex-end;
  background: #0A2542;
  color: #FFFFFF;
}
.dir-action-pill {
  display: inline-block;
  margin-top: 6px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: var(--badge-ok-bg);
  color: var(--badge-ok-text);
  border: 1px solid var(--badge-ok-border);
}
.director-starters {
  padding: 8px 14px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  border-top: 1px solid var(--border-soft);
  background: var(--bg-subtle);
}
.director-input-row {
  padding: 12px 14px;
  display: flex;
  gap: 8px;
  align-items: center;
  border-top: 1px solid var(--border-soft);
  background: var(--bg-panel);
}
.director-input-row input {
  flex: 1;
  min-width: 0;
}

/* Recipe Explainer Banner (Inline Collapsible Drawer) */
.recipe-explainer-bar {
  margin-bottom: 18px;
  padding: 16px 18px;
  border-radius: 15px;
  background: linear-gradient(135deg, #071A2F 0%, #113052 100%);
  color: #F8F4EA;
  border: 1.5px solid #E2AE56;
  box-shadow: 0 8px 24px rgba(6, 26, 46, 0.2);
}
.recipe-explainer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.recipe-explainer-head h3 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 22px;
  color: #FCE6A6;
}
.recipe-flow-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.recipe-flow-step {
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(242, 207, 126, 0.25);
}
.recipe-flow-step strong {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #F6DA93;
  margin-bottom: 3px;
}
.recipe-flow-step span {
  font-size: 12px;
  color: rgba(248, 244, 234, 0.86);
  line-height: 1.38;
}

/* 4-Step Guided Tour Modal */
.tour-step-dots {
  display: flex;
  gap: 6px;
  margin: 12px 0;
}
.tour-dot {
  height: 6px;
  flex: 1;
  border-radius: 999px;
  background: var(--border-soft);
}
.tour-dot.active {
  background: #D9A54A;
}

/* =====================================================================
   SEAART-STYLE FREE-FLOWING MASONRY MOSAIC + ZERO FACE-CROPPING EVERYWHERE
   My Creations, Favorites, My Projects, Recent, Variations, Strategies & Showcase
   Zero cropped heads, exact natural aspect ratios, zero bulky dead space
   ===================================================================== */
.recent-grid {
  display: block !important;
  columns: 4 220px !important;
  column-gap: 12px !important;
}
.recent-card {
  aspect-ratio: auto !important;
  height: auto !important;
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  page-break-inside: avoid;
  margin-bottom: 12px;
}
.recent-card > img,
.recent-card > video,
.variation-thumb img,
.lib-preview > img,
.lib-preview > video,
.media-frame img,
.media-frame video,
.lightbox-stage img,
.lightbox-stage video {
  width: 100% !important;
  height: auto !important;
  max-height: none !important;
  object-fit: contain !important;
  display: block !important;
}
.lightbox-stage img,
.lightbox-stage video {
  width: auto !important;
  max-width: 100% !important;
  max-height: 78vh !important;
}
.recent-audio-cover {
  min-height: 150px;
}

.library-grid {
  display: block !important;
  columns: 4 240px !important;
  column-gap: 12px !important;
}
.library-grid > .empty-stage,
.library-grid > .masonry-full-banner {
  column-span: all;
  margin-bottom: 14px;
}

.lib-card.masonry-card {
  display: block !important;
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  page-break-inside: avoid;
  margin-bottom: 12px;
  border-radius: 14px;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(204, 164, 78, 0.34);
  background: #081C32;
  box-shadow: 0 5px 18px rgba(6, 26, 46, 0.14);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.lib-card.masonry-card:hover {
  transform: translateY(-2px);
  border-color: #E2AE56;
  box-shadow: 0 12px 28px rgba(6, 26, 46, 0.24);
}
.lib-card.masonry-card .lib-preview {
  position: relative;
  height: auto !important;
  min-height: 0 !important;
  background: #07192D;
  display: block;
  overflow: hidden;
  cursor: pointer;
}
.lib-card.masonry-card .lib-preview img,
.lib-card.masonry-card .lib-preview video {
  width: 100% !important;
  height: auto !important;
  object-fit: contain !important;
  display: block !important;
}

.masonry-top-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 4;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(6, 24, 43, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(242, 207, 126, 0.38);
  color: #FCE6A6;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  pointer-events: none;
}

.masonry-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  padding: 28px 11px 10px;
  background: linear-gradient(180deg, rgba(6, 22, 40, 0) 0%, rgba(6, 22, 40, 0.78) 44%, rgba(5, 18, 33, 0.94) 100%);
  color: #FFFFFF;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: background 0.2s ease;
}
.lib-card.masonry-card:hover .masonry-overlay {
  background: linear-gradient(180deg, rgba(6, 22, 40, 0.08) 0%, rgba(6, 22, 40, 0.86) 36%, rgba(5, 18, 33, 0.97) 100%);
}
.masonry-title {
  font-size: 12.5px;
  font-weight: 700;
  color: #FFFFFF;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.masonry-sub {
  font-size: 10.5px;
  color: rgba(240, 234, 218, 0.78);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.masonry-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.masonry-pill-btn {
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(14, 38, 66, 0.76);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #F8F4EA;
  font-size: 10.5px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.2;
  transition: all 0.16s ease;
}
.masonry-pill-btn:hover {
  background: #E8B85B;
  border-color: #F8DF9F;
  color: #061A2E;
}
.masonry-pill-btn.gold {
  background: linear-gradient(135deg, #F2CF7E 0%, #D59B38 100%);
  border-color: #F8DF9F;
  color: #061A2E;
}

/* Video masonry cards keep caption strip cleanly below video controls so controls are never covered */
.lib-card.masonry-video-card .masonry-overlay {
  position: relative;
  padding: 10px 11px 11px;
  background: linear-gradient(180deg, #092038 0%, #06172A 100%);
  border-top: 1px solid rgba(226, 174, 86, 0.24);
}

/* Compact Dark Royal Navy Audio Card in Masonry */
.lib-card.masonry-audio-card {
  background: linear-gradient(150deg, #081F37 0%, #0E2E50 100%);
  padding: 14px;
  color: #F8F4EA;
}
.lib-card.masonry-audio-card audio {
  width: 100%;
  height: 36px;
  margin: 10px 0 8px;
}

/* SeaArt-Style Strategies & Recipes Workflow Masonry Mosaic */
.strategy-grid {
  display: block !important;
  columns: 4 240px !important;
  column-gap: 12px !important;
}
.strategy-card {
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  page-break-inside: avoid;
  margin-bottom: 12px;
  padding: 0 !important;
  border-radius: 14px !important;
  overflow: hidden;
  position: relative;
  background: #081D34 !important;
  border: 1.5px solid rgba(204, 164, 78, 0.36) !important;
  box-shadow: 0 6px 20px rgba(6, 26, 46, 0.16) !important;
}
.strategy-card.featured-recipe {
  border-color: #E8B85B !important;
  box-shadow: 0 8px 24px rgba(185, 135, 50, 0.24) !important;
}
.strategy-visual-wrap {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: #07192D;
}
.strategy-visual-wrap img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.35s ease;
}
.strategy-card:hover .strategy-visual-wrap img {
  transform: scale(1.03);
}
.strategy-visual-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 3;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(6, 24, 43, 0.84);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(242, 207, 126, 0.5);
  color: #FCE6A6;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.strategy-card-body {
  padding: 12px 13px 13px;
  background: linear-gradient(180deg, #092038 0%, #06182C 100%);
  color: #F8F4EA;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.strategy-card-body h3 {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.18;
  margin: 0;
  color: #FFFFFF;
}
.strategy-card-body p {
  margin: 0;
  font-size: 12px;
  line-height: 1.38;
  color: rgba(235, 232, 224, 0.82);
}
.strategy-card .strategy-spec-chip {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(242, 207, 126, 0.26);
  color: #F6DA93;
}
.strategy-card .strategy-info-btn {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.24);
  color: #FFFFFF;
}

/* Showcase & Exchange Natural-Aspect Masonry Mosaic (Zero cropped heads on 9:16, 3:4, 16:9!) */
.showcase-grid {
  display: block !important;
  columns: 3 280px !important;
  column-gap: 14px !important;
}
.showcase-card {
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  page-break-inside: avoid;
  margin-bottom: 14px;
  border-radius: 14px;
  overflow: hidden;
}
.showcase-media {
  aspect-ratio: auto !important;
  height: auto !important;
  background: #07192D;
  display: block !important;
}
.showcase-media video,
.showcase-media img {
  width: 100% !important;
  height: auto !important;
  object-fit: contain !important;
  display: block !important;
}
.premiere-placeholder {
  min-height: 250px;
}

/* =====================================================================
   RESPONSIVE RULES (ZERO HORIZONTAL OVERFLOW DOWN TO 390px)
   ===================================================================== */
@media (max-width: 1200px) {
  .luminous-nav-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .waveform-cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .recipe-flow-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .topbar {
    padding: 0 10px;
    gap: 6px;
  }
  .topbar-center {
    display: none;
  }
  .mode-switch-btn {
    padding: 4px 8px;
    font-size: 11px;
  }
  .luminous-nav-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .recent-grid,
  .library-grid,
  .strategy-grid,
  .showcase-grid {
    columns: 2 150px !important;
    column-gap: 10px !important;
  }
  .model-roster-grid,
  .ref-slots-grid,
  .av-ref-grid,
  .licensing-grid,
  .recipe-flow-grid {
    grid-template-columns: 1fr;
  }
  .waveform-cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 480px) {
  .brand-wordmark {
    font-size: 20px;
  }
  .brand-monogram {
    width: 28px;
    height: 24px;
  }
  .mode-switch {
    padding: 2px;
  }
  .mode-switch-btn {
    padding: 4px 7px;
    font-size: 10.5px;
  }
  .director-pill-btn {
    padding: 5px 9px;
    font-size: 11px;
  }
  .theme-chip {
    display: none;
  }
  .luminous-nav-wrap {
    padding: 8px;
  }
  .lum-nav-card {
    padding: 9px;
    min-height: 66px;
  }
  .lum-nav-title {
    font-size: 12px;
  }
  .lum-nav-sub {
    display: none;
  }
  .waveform-cards-grid {
    grid-template-columns: 1fr;
  }
  .recent-grid,
  .library-grid,
  .strategy-grid,
  .showcase-grid {
    columns: 2 140px !important;
    column-gap: 9px !important;
  }
  .strategy-card-body h3 {
    font-size: 15px;
  }
  .strategy-card-body p {
    font-size: 11px;
  }
  .masonry-pill-btn {
    padding: 3px 6px;
    font-size: 9.5px;
  }
}


/* ==================== SEAART-STYLE FREE-FLOWING MASONRY MOSAIC (#studioShowcaseGrid) ==================== */
#view-showcase {
  padding-top: 24px !important;
}
.st-masonry-mosaic {
  display: block;
  columns: 4 240px;
  column-gap: 12px;
  margin-top: 14px;
}
.st-m-tile {
  display: inline-block;
  width: 100%;
  break-inside: avoid;
  page-break-inside: avoid;
  margin: 0 0 12px 0;
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: #0B192E;
  border: 1px solid rgba(212, 168, 75, 0.28);
  box-shadow: 0 10px 26px -14px rgba(11, 25, 46, 0.42);
  vertical-align: top;
}
.st-m-tile img,
.st-m-tile video {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
}
.st-m-top {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  display: flex;
  justify-content: space-between;
  gap: 6px;
  z-index: 3;
  pointer-events: none;
}
.st-m-pill {
  background: rgba(9, 20, 38, 0.78);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #FFFFFF;
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
}
.st-m-pill.is-gold {
  background: linear-gradient(135deg, rgba(244, 213, 127, 0.94), rgba(212, 168, 75, 0.94));
  color: #0B192E;
}
.st-m-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 4;
  padding: 30px 10px 10px;
  background: linear-gradient(180deg, rgba(8, 16, 30, 0) 0%, rgba(8, 16, 30, 0.72) 38%, rgba(8, 16, 30, 0.95) 100%);
  color: #FFFFFF;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: opacity 0.2s ease;
}
.st-m-tile.is-playing .st-m-overlay,
.st-m-tile.is-playing .st-m-top {
  opacity: 0;
  pointer-events: none;
}
.st-m-title {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
  color: #FFFFFF;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.st-m-creator {
  font-size: 11px;
  color: rgba(235, 241, 250, 0.85);
}
.st-m-actions {
  display: flex;
  gap: 5px;
  flex-wrap: nowrap;
}
.st-m-btn {
  flex: 1 1 auto;
  min-height: 28px;
  padding: 4px 7px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(15, 28, 52, 0.82);
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  white-space: nowrap;
}
.st-m-btn.is-gold {
  background: linear-gradient(135deg, #F4D57F, #D4A84B);
  color: #0B192E;
  border-color: #F4D57F;
}
.st-audio-mosaic {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.st-aud-card {
  background: #0B192E;
  color: #FFFFFF;
  border: 1px solid rgba(212, 168, 75, 0.35);
  border-radius: 14px;
  padding: 13px 15px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.st-aud-card audio { width: 100%; height: 34px; }
@media (max-width: 1100px) {
  .st-masonry-mosaic { columns: 3 210px; }
}
@media (max-width: 720px) {
  .st-masonry-mosaic { columns: 2; column-gap: 10px; }
  .st-m-tile { margin-bottom: 10px; }
  .st-audio-mosaic { grid-template-columns: 1fr; }
  .st-m-actions { flex-wrap: wrap; }
}


/* 2026-11-23 Logged-Out 3-Step Unlock Banner & Omnichannel Share Buttons */
.auth-banner {
  padding: 16px 20px;
  align-items: flex-start;
}
.auth-banner-main {
  flex: 1 1 520px;
  display: grid;
  gap: 10px;
}
.auth-banner-unlock-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.auth-step-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 11px;
  border-radius: 10px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-gold);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
}
.auth-banner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

/* MOBILE-SIDEBAR-SCROLL-FIX: the fixed drawer is taller than the viewport on
   phones, and the base .sidebar rule sets overflow:hidden, so the last items
   (Favorites, etc.) were unreachable. Make the drawer itself scroll. */
@media (max-width: 860px) {
  .sidebar {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    justify-content: flex-start;
    gap: 10px;
    padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px));
    max-height: calc(100dvh - var(--topbar-h));
  }
  .sidebar-nav {
    flex: 0 0 auto;
    padding-bottom: 8px;
  }
  .sidebar > *:last-child {
    margin-top: auto;
  }
  /* keep the scrollbar from eating the narrow rail */
  .sidebar::-webkit-scrollbar { width: 4px; }
  .sidebar::-webkit-scrollbar-thumb { background: rgba(226,174,86,.35); border-radius: 4px; }
}


/* Prominent Live Support button directly right of Studio Mode */
.studio-exec-bar {
  flex-wrap: wrap;
  gap: 10px 14px;
}
.studio-exec-left {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.live-support-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1.5px solid #D4AF37;
  background: linear-gradient(135deg, #0B1F3A 0%, #193A68 100%);
  color: #FFF4CE;
  font: 800 12.5px/1.1 'Figtree', system-ui, sans-serif;
  letter-spacing: 0.01em;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(11, 31, 58, 0.24);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
.live-support-pill-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
  box-shadow: 0 6px 18px rgba(212, 175, 55, 0.34);
}
.live-support-pill-btn:focus-visible {
  outline: 2px solid #F6DA8B;
  outline-offset: 2px;
}
.live-support-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #34D399;
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.28);
  flex-shrink: 0;
}
@media (max-width: 640px) {
  .live-support-pill-btn {
    padding: 6px 12px;
    font-size: 12px;
  }
}

@media (max-width: 900px) { .hf-lb-hoplink-banner { display: none !important; } }
