/* ==========================================================================
   KOPAI Studio - Design System & Stylesheet
   Theme: Obsidian & Minimal Monochrome with Yellow Highlights
   (Strictly no purple, Grayscale dominant, Yellow highlights, Inside-card loading)
   ========================================================================== */

/* Variables & Custom Tokens */
:root {
  --bg-app: #050505;
  --bg-sidebar: #0d0d0d;
  --bg-card: #121212;
  --bg-card-hover: #181818;
  --bg-input: #151515;

  --border-color: #222222;
  --border-color-hover: #444444;
  --border-active: #ffcc00;
  /* Yellow accent highlight */

  /* Accent Colors (No Purple) */
  --accent-yellow: #ffcc00;
  --accent-yellow-rgb: 255, 204, 0;
  --accent-red: #ff3333;
  --accent-muted-yellow: rgba(255, 204, 0, 0.08);

  /* Filled action-button yellow — stays identical in light & dark so every
     primary button shares one flat style per theme (no muddy gold in light). */
  --btn-yellow: #ffcc00;
  --btn-yellow-text: #1a1a1a;

  /* Typography Colors */
  --text-primary: #ffffff;
  --text-secondary: #a3a3a3;
  --text-muted: #525252;

  /* Transitions & Shadows */
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --glow-shadow: 0 0 15px rgba(255, 204, 0, 0.25);

  /* Font Stacks */
  --font-display: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Light Theme Variables */
body.light-theme {
  --bg-app: #f5f5f7;
  --bg-sidebar: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #fafafa;
  --bg-input: #eaeaea;

  --border-color: #dddddd;
  --border-color-hover: #b0b0b0;
  --border-active: #c59600;
  /* Rich golden yellow contrast */

  --accent-yellow: #c59600;
  --accent-yellow-rgb: 197, 150, 0;
  --accent-muted-yellow: rgba(197, 150, 0, 0.08);

  --text-primary: #111111;
  --text-secondary: #555555;
  --text-muted: #999999;
  --glow-shadow: 0 0 15px rgba(197, 150, 0, 0.15);
}

/* Reset & Base Rules */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  outline: none;
}

/* Global guard: never allow horizontal scrolling. Decorative absolutely-
   positioned elements (e.g. landing page glows) can extend past the viewport;
   clipping at the root prevents the document from becoming wider than the
   screen, which on Android shifts/jiggles centered content. */
html {
  overflow-x: hidden;
}

body {
  background-color: var(--bg-app);
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: 14px;
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  -webkit-font-smoothing: antialiased;
  /* App-like feel: disable the double-tap-to-zoom gesture (and its 300ms
     delay) without blocking scrolling. */
  touch-action: manipulation;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

/* Custom Scrollbar Styles */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

body.light-theme ::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.1);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-yellow);
}

/* Utility classes */
.hidden {
  display: none !important;
}

.yellow-highlight {
  color: var(--accent-yellow) !important;
}

/* App Container Layout */
.app-container {
  display: flex;
  height: 100vh;
  width: 100vw;
  position: relative;
}

/* Left Sidebar Styles */
.sidebar {
  width: 250px;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 10;
  transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

.sidebar-logo {
  height: 70px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border-color);
}

.brand-icon {
  width: 24px;
  height: 24px;
  color: var(--accent-yellow);
}

.brand-text {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--text-primary);
}

.brand-accent {
  color: var(--text-secondary);
  font-weight: 400;
  margin-left: 2px;
}

.sidebar-menu {
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-grow: 1;
}

.menu-item {
  width: 100%;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.2px;
  text-decoration: none;
  padding: 11px 14px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  transition: var(--transition-fast);
}

.menu-icon {
  width: 17px;
  height: 17px;
  transition: var(--transition-fast);
}

.menu-item:hover {
  background-color: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
}

body.light-theme .menu-item:hover {
  background-color: rgba(0, 0, 0, 0.03);
}

.menu-item.active {
  background-color: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-weight: 700;
}

body.light-theme .menu-item.active {
  background-color: rgba(0, 0, 0, 0.04);
}

.menu-item.active .menu-icon {
  color: var(--accent-yellow);
}

/* Extra bottom-nav entries (Refill / History) shown only on mobile, since on
   desktop those actions live in the sidebar credits card. */
.nav-mobile-only {
  display: none !important;
}

/* Sidebar Balance Widget */
.sidebar-balance {
  position: relative;
  overflow: hidden;
  margin: 16px;
  padding: 16px;
  background:
    radial-gradient(120% 120% at 100% 0%, rgba(var(--accent-yellow-rgb), .12), transparent 60%),
    var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

.balance-top {
  display: flex;
  align-items: center;
  gap: 11px;
}

.balance-coin {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-muted-yellow);
  border: 1px solid rgba(var(--accent-yellow-rgb), .22);
}

.balance-coin svg {
  width: 20px;
  height: 20px;
  color: var(--accent-yellow);
}

.balance-details {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.balance-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .4px;
  text-transform: uppercase;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.balance-icon {
  width: 13px;
  height: 13px;
}

.balance-value {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  line-height: 1.05;
  color: var(--text-primary);
}

.balance-bar-bg {
  width: 100%;
  height: 5px;
  background-color: #222222;
  border-radius: 99px;
  overflow: hidden;
}

body.light-theme .balance-bar-bg {
  background-color: #e2e8f0;
}

.balance-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-yellow), #ff9d00);
  border-radius: 99px;
  transition: width 0.5s ease;
}

.btn-topup {
  width: 100%;
  padding: 11px;
  background-color: var(--btn-yellow);
  border: 1px solid var(--btn-yellow);
  border-radius: 10px;
  color: var(--btn-yellow-text);
  font-family: var(--font-display);
  font-size: 12.5px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: filter var(--transition-fast), transform .1s;
}

.btn-topup .topup-icon {
  width: 15px;
  height: 15px;
}

.btn-topup:hover {
  filter: brightness(1.06);
}

.btn-topup:active {
  transform: scale(.98);
}

.btn-history {
  width: 100%;
  padding: 9px;
  background-color: transparent;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: var(--transition-fast);
}

.btn-history .topup-icon {
  width: 14px;
  height: 14px;
}

.btn-history:hover {
  color: var(--accent-yellow);
  border-color: var(--accent-yellow);
}

.btn-history.active {
  color: var(--accent-yellow);
  border-color: rgba(var(--accent-yellow-rgb), .4);
  background: var(--accent-muted-yellow);
}

.topup-icon {
  width: 12px;
  height: 12px;
}

/* User profile details */
.sidebar-user {
  margin: 8px 0 4px;
  padding: 12px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  box-sizing: border-box;
}

body.light-theme .sidebar-user {
  background: rgba(0, 0, 0, 0.025);
}

.user-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex-grow: 1;
}

.user-avatar-wrapper {
  position: relative;
  flex-shrink: 0;
}

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: transparent;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

body.light-theme .user-avatar {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.user-status-online {
  width: 9px;
  height: 9px;
  background-color: #22c55e;
  border: 2px solid var(--bg-sidebar);
  border-radius: 50%;
  position: absolute;
  bottom: 0;
  right: 0;
}

.user-info {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  min-width: 0;
  overflow: hidden;
}

.user-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: capitalize;
}

.user-role {
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-logout {
  color: var(--text-secondary);
  padding: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 8px;
  transition: color 0.2s, background-color 0.2s;
}

.btn-logout:hover {
  color: var(--accent-yellow, #ffcc00);
  background-color: rgba(255, 204, 0, 0.1);
}

/* Main Workspace layout */
.workspace {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* Secondary user pages (Refill, History) content area */
.user-page-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 28px 32px 80px;
}

@media (max-width: 768px) {
  .user-page-body {
    padding: 18px 16px 110px;
  }
}

/* Top Navigation Header */
.header {
  height: 70px;
  border-bottom: 1px solid var(--border-color);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  transition: border-color var(--transition-normal);
}

.page-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  color: var(--text-primary);
}

.page-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 20px;
}


/* Theme Toggle Button */
.theme-toggle-btn {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
}

.theme-toggle-btn:hover {
  border-color: var(--border-color-hover);
  background-color: var(--bg-card-hover);
  color: var(--accent-yellow);
}

.theme-icon {
  width: 16px;
  height: 16px;
}

/* Mobile logout button in header (hidden on desktop; sidebar handles logout there) */
.header-logout-mobile {
  display: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
  flex-shrink: 0;
}

.header-logout-mobile:hover {
  border-color: var(--border-color-hover);
  color: var(--accent-yellow);
}

.header-logout-mobile svg {
  width: 16px;
  height: 16px;
}

/* Mode toggles container (Stretched in controls panel) */
.controls-panel .mode-toggle-container {
  width: 100%;
  display: flex;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  padding: 3px;
  border-radius: 8px;
  margin-bottom: 12px;
  transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

.mode-toggle-btn {
  flex-grow: 1;
  justify-content: center;
  background: transparent;
  border: none;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition-fast);
}

.mode-toggle-btn:hover {
  color: var(--text-primary);
}

.mode-toggle-btn.active {
  background-color: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

body.light-theme .mode-toggle-btn.active {
  background-color: #111111;
  color: #ffffff;
  border-color: #111111;
}

.toggle-icon {
  width: 14px;
  height: 14px;
}

/* Workspace Grid Area */
.workspace-grid {
  display: flex;
  flex-grow: 1;
  overflow: hidden;
}

/* ===== Desktop sidebar tab navigation behavior ===== */
/* Config is not used on desktop */
@media (min-width: 769px) {
  #btn-menu-settings {
    display: none;
  }
}

/* Creations: focus the gallery/output, hide the configuration panel */
body.tab-creations .controls-panel {
  display: none;
}

/* Creations must never show the generate prompt bar (desktop) */
body.tab-creations .prompt-container-wrapper {
  display: none !important;
}

/* TTS is its own workspace: audio controls + audio result list only. */
body.tab-tts .canvas-display,
body.tab-tts .featured-grid,
body.tab-tts .controls-panel,
body.tab-tts .prompt-container-wrapper {
  display: none !important;
}

body.tab-tts .tts-results-panel {
  display: flex;
  flex: 1 1 auto;
}

/* Config: focus the configuration panel, hide the canvas */
body.tab-config .main-canvas {
  display: none;
}

body.tab-config .controls-panel {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  border-right: none;
}

/* ===== Model combobox + flyout (Leonardo-style) ===== */
.panel-field-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  display: block;
  margin-bottom: 6px;
}

.model-select-wrap {
  position: relative;
}

.model-combobox {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
  color: var(--text-primary);
  position: relative;
  overflow: hidden;
  transition: border-color var(--transition-fast), background-color var(--transition-fast);
}

/* Selected model's result image as a subtle background (matches the cards) */
.model-combobox::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 60%;
  background-image: var(--card-image);
  background-size: cover;
  background-position: center;
  -webkit-mask: linear-gradient(to right, transparent 0%, rgba(0, 0, 0, 0.85) 70%, #000 100%);
  mask: linear-gradient(to right, transparent 0%, rgba(0, 0, 0, 0.85) 70%, #000 100%);
  opacity: 0.32;
  filter: saturate(0.85) brightness(0.95);
  pointer-events: none;
  z-index: 0;
}

body.light-theme .model-combobox::after {
  opacity: 0.18;
}

.model-combobox:hover {
  border-color: var(--border-color-hover);
}

.model-combobox.open {
  border-color: var(--accent-yellow);
}

.model-combobox-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
  position: relative;
  z-index: 1;
}

.model-combobox-icon svg {
  width: 19px;
  height: 19px;
}

.model-combobox-text {
  flex-grow: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  position: relative;
  z-index: 1;
  text-align: left;
}

.model-combobox-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.model-combobox-cost {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-yellow);
  white-space: nowrap;
}

.model-combobox-chevron {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  transition: transform var(--transition-fast);
}

.model-combobox.open .model-combobox-chevron {
  transform: rotate(180deg);
}

.model-flyout {
  position: fixed;
  top: 120px;
  left: 600px;
  width: min(420px, calc(100vw - 24px));
  max-height: 72vh;
  overflow-y: auto;
  background: var(--bg-sidebar);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 16px;
  z-index: 1200;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  opacity: 0;
  visibility: hidden;
  transform: translateX(-8px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

body.light-theme .model-flyout {
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.model-flyout.open {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

.model-flyout-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

/* Engine toggle relocated into the model popup — polished segmented control
   with an animated sliding indicator. */
.model-flyout .mode-toggle-container.in-flyout {
  position: relative;
  display: flex;
  width: 100%;
  padding: 4px;
  gap: 0;
  margin-bottom: 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 13px;
  overflow: hidden;
}

.model-flyout .mode-toggle-container.in-flyout .engine-toggle-slider {
  position: absolute;
  top: 4px;
  left: 4px;
  width: calc((100% - 8px) / 3);
  height: calc(100% - 8px);
  border-radius: 10px;
  background: linear-gradient(135deg, #2a2a2a, #111111);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transform: translateX(0);
  transition: transform 0.38s cubic-bezier(0.34, 1.4, 0.45, 1);
  z-index: 0;
  pointer-events: none;
}

.model-flyout .mode-toggle-container.in-flyout.video-active .engine-toggle-slider {
  transform: translateX(100%);
}

.model-flyout .mode-toggle-container.in-flyout.audio-active .engine-toggle-slider {
  transform: translateX(200%);
}

.model-flyout .mode-toggle-container.in-flyout.music-active .engine-toggle-slider {
  transform: translateX(300%);
}

.model-flyout .mode-toggle-container.in-flyout .mode-toggle-btn {
  position: relative;
  z-index: 1;
  flex: 1;
  background: transparent !important;
  border: none !important;
  color: var(--text-secondary);
  font-weight: 700;
  padding: 9px 10px;
  border-radius: 10px;
  transition: color 0.25s ease;
}

.model-flyout .mode-toggle-container.in-flyout .mode-toggle-btn:hover {
  color: var(--text-primary);
}

.model-flyout .mode-toggle-container.in-flyout .mode-toggle-btn.active {
  color: #ffffff;
}

.model-flyout .mode-toggle-container.in-flyout .toggle-icon {
  transition: transform 0.25s ease;
}

.model-flyout .mode-toggle-container.in-flyout .mode-toggle-btn.active .toggle-icon {
  transform: scale(1.08);
}

.model-flyout-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  color: var(--text-primary);
}

.model-flyout-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.model-flyout-close svg {
  width: 14px;
  height: 14px;
}

.model-flyout-close:hover {
  color: var(--accent-yellow);
  border-color: var(--border-color-hover);
}

/* Featured latest creations (shown large in the Generates view) */
.featured-grid {
  display: none;
  gap: 16px;
  padding: 28px 32px;
}

.featured-card {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  aspect-ratio: 3 / 4;
  cursor: pointer;
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.featured-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-color-hover);
}

.featured-card img,
.featured-card video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.featured-card:hover img,
.featured-card:hover video {
  transform: scale(1.05);
}

.featured-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 14px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.78), transparent);
  color: #fff;
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.featured-overlay .featured-model {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-family: var(--font-display);
  font-size: 12.5px;
  letter-spacing: 0.2px;
}

.featured-model-icon {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.16);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fff;
}

.featured-model-icon svg {
  width: 14px;
  height: 14px;
}

.featured-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  padding: 60px 20px;
  border: 1px dashed var(--border-color);
  border-radius: 14px;
}

@media (min-width: 769px) {

  /* Prompt bar moves to the top; latest creations shown large below it */
  body.tab-generates .prompt-container-wrapper {
    order: -1;
  }

  body.tab-generates .featured-grid {
    order: 1;
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
    align-items: stretch;
    overflow: hidden;
  }

  body.tab-generates .canvas-display {
    display: none;
  }

  .main-canvas .prompt-container-wrapper {
    background: none;
    border-bottom: 1px solid var(--border-color);
    padding: 18px 32px;
  }

  /* Premium prompt bar, full width (Leonardo-style, not basic) */
  .main-canvas .prompt-container {
    max-width: none;
    width: 100%;
    border-radius: 16px;
    padding: 8px 8px 8px 14px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.22);
  }

  body.light-theme .main-canvas .prompt-container {
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.08);
  }

  .main-canvas .prompt-textarea {
    font-size: 15px;
    padding: 12px 6px;
  }

  /* Latest-3 cards fill the available height so nothing gets clipped */
  .featured-card {
    aspect-ratio: auto;
    height: 100%;
  }

  /* Creations: full gallery only, no prompt/featured */
  body.tab-creations .featured-grid {
    display: none;
  }
}

/* Control settings panel (Left column) */
.controls-panel {
  width: 320px;
  border-right: 1px solid var(--border-color);
  padding: 24px;
  overflow-y: auto;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
  transition: border-color var(--transition-normal);
}

.panel-section-title {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-icon {
  width: 16px;
  height: 16px;
}

.spacing-top {
  margin-top: 4px;
}

/* Model selection cards layout */
.model-cards-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.model-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.model-cards-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.group-label {
  font-size: 10px;
  color: var(--text-secondary);
  font-weight: 600;
  margin-bottom: 2px;
}

.model-card {
  background: rgba(18, 18, 18, 0.45);
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px;
  cursor: pointer;
  display: flex;
  gap: 12px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
}

body.light-theme .model-card {
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05);
}

/* Beautiful Glowing Radial Background Gradient */
.model-card::before {
  content: '';
  position: absolute;
  top: -60%;
  left: -60%;
  width: 220%;
  height: 220%;
  background: radial-gradient(circle at 80% 80%, var(--card-glow, rgba(255, 255, 255, 0.02)), transparent 50%);
  opacity: 0.35;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  z-index: 0;
}

/* Artistic realistic-result image decoration on the right side of each card */
.model-card::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 58%;
  background-image: var(--card-image);
  background-size: cover;
  background-position: center;
  -webkit-mask: linear-gradient(to right, transparent 0%, rgba(0, 0, 0, 0.85) 65%, #000 100%);
  mask: linear-gradient(to right, transparent 0%, rgba(0, 0, 0, 0.85) 65%, #000 100%);
  opacity: 0.3;
  filter: saturate(0.8) brightness(0.92) contrast(0.95);
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  z-index: 0;
  transform-origin: center center;
  animation: cardZoom 18s ease-in-out infinite alternate;
}

.model-card:hover::after {
  opacity: 0.45;
}

.model-card.active::after {
  opacity: 0.52;
}

/* Slow gentle zoom for image-model previews */
@keyframes cardZoom {
  0% {
    transform: scale(1.02);
  }

  100% {
    transform: scale(1.12);
  }
}

/* Slightly more noticeable slow zoom for VIDEO models */
#group-video-models .model-card::after {
  animation: cardZoomVideo 14s ease-in-out infinite alternate;
}

#group-video-models .model-card::before {
  /* darken slightly toward a filmic vignette */
  opacity: 0.5;
}

@keyframes cardZoomVideo {
  0% {
    transform: scale(1.04);
  }

  100% {
    transform: scale(1.18);
  }
}

/* Respect users who prefer less motion */
@media (prefers-reduced-motion: reduce) {

  .model-card::after,
  #group-video-models .model-card::after {
    animation: none;
  }
}

/* Realistic sample results for IMAGE models */
#group-image-models .model-card:nth-child(4n + 1) {
  --card-image: url('images/gen-img-1.jpg');
}

#group-image-models .model-card:nth-child(4n + 2) {
  --card-image: url('images/gen-img-2.jpg');
}

#group-image-models .model-card:nth-child(4n + 3) {
  --card-image: url('images/gen-img-3.jpg');
}

#group-image-models .model-card:nth-child(4n + 4) {
  --card-image: url('images/gen-img-4.jpg');
}

/* Distinct motion-themed sample results for VIDEO models */
#group-video-models .model-card:nth-child(4n + 1) {
  --card-image: url('images/gen-vid-1.jpg');
}

#group-video-models .model-card:nth-child(4n + 2) {
  --card-image: url('images/gen-vid-2.jpg');
}

#group-video-models .model-card:nth-child(4n + 3) {
  --card-image: url('images/gen-vid-3.jpg');
}

#group-video-models .model-card:nth-child(4n + 4) {
  --card-image: url('images/gen-vid-4.jpg');
}

#group-audio-models .model-card:nth-child(2n + 1) {
  --card-image: url('images/gen-img-2.jpg');
}

#group-audio-models .model-card:nth-child(2n + 2) {
  --card-image: url('images/gen-img-3.jpg');
}

/* Mobile bottom-sheet model cards: themed result images per model */
.sheet-model-card[data-model="gpt-image"] {
  --card-image: url('images/gen-img-1.jpg');
}

.sheet-model-card[data-model="gpt-image-native"] {
  --card-image: url('images/gen-img-2.jpg');
}

.sheet-model-card[data-model="nano-banana-pro"] {
  --card-image: url('images/gen-img-3.jpg');
}

.sheet-model-card[data-model="nano-banana-2"] {
  --card-image: url('images/gen-img-4.jpg');
}

.sheet-model-card[data-model="seedance"] {
  --card-image: url('images/gen-vid-1.jpg');
}

.sheet-model-card[data-model="seedance-fast"] {
  --card-image: url('images/gen-vid-1.jpg');
}

.sheet-model-card[data-model="gemini-omni-flash"],
.sheet-model-card[data-model="flow-gemini-omni-flash"] {
  --card-image: url('images/gen-vid-4.jpg');
}

.sheet-model-card[data-model="kling-3"] {
  --card-image: url('images/gen-vid-2.jpg');
}

.sheet-model-card[data-model^="kling-motion"] {
  --card-image: url('images/gen-vid-3.jpg');
}

.sheet-model-card[data-model="veo-3"] {
  --card-image: url('images/gen-vid-4.jpg');
}

.sheet-model-card[data-model="veo-3-fast"],
.sheet-model-card[data-model="flow-veo-3.1"] {
  --card-image: url('images/gen-vid-1.jpg');
}

.sheet-model-card[data-model="veo-3-0-fast"] {
  --card-image: url('images/gen-vid-1.jpg');
}

.sheet-model-card[data-model^="tts"] {
  --card-image: url('images/gen-img-2.jpg');
}

/* Hover State */
.model-card:hover {
  background: rgba(26, 26, 26, 0.65);
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}

body.light-theme .model-card:hover {
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(0, 0, 0, 0.18);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

/* Active State */
.model-card.active {
  background: rgba(30, 30, 30, 0.7);
  border-color: var(--border-active);
  box-shadow: 0 8px 32px rgba(var(--accent-yellow-rgb), 0.15), inset 0 0 0 1px rgba(var(--accent-yellow-rgb), 0.2);
}

body.light-theme .model-card.active {
  background: rgba(255, 249, 230, 0.85);
  border-color: var(--border-active);
  box-shadow: 0 8px 32px rgba(var(--accent-yellow-rgb), 0.08);
}

/* Provider-specific Glow Colors */
.model-card[data-model*="gpt"] {
  --card-glow: rgba(16, 163, 127, 0.15);
}

.model-card[data-model*="gpt"]:hover,
.model-card[data-model*="gpt"].active {
  --card-glow: rgba(16, 163, 127, 0.25);
}

.model-card[data-model*="banana"] {
  --card-glow: rgba(244, 180, 0, 0.15);
}

.model-card[data-model*="banana"]:hover,
.model-card[data-model*="banana"].active {
  --card-glow: rgba(244, 180, 0, 0.25);
}

.model-card[data-model*="seedance"] {
  --card-glow: rgba(254, 44, 85, 0.15);
}

.model-card[data-model*="seedance"]:hover,
.model-card[data-model*="seedance"].active {
  --card-glow: rgba(254, 44, 85, 0.25);
}

.model-card[data-model*="kling"] {
  --card-glow: rgba(124, 58, 237, 0.15);
}

.model-card[data-model*="kling"]:hover,
.model-card[data-model*="kling"].active {
  --card-glow: rgba(124, 58, 237, 0.25);
}

.model-card[data-model*="veo"],
.model-card[data-model*="gemini"] {
  --card-glow: rgba(66, 133, 244, 0.15);
}

.model-card[data-model*="veo"]:hover,
.model-card[data-model*="veo"].active,
.model-card[data-model*="gemini"]:hover,
.model-card[data-model*="gemini"].active {
  --card-glow: rgba(66, 133, 244, 0.25);
}

.model-card[data-model*="tts"] {
  --card-glow: rgba(232, 185, 74, 0.15);
}

.model-card[data-model*="tts"]:hover,
.model-card[data-model*="tts"].active {
  --card-glow: rgba(232, 185, 74, 0.25);
}

.tts-version-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tts-version-card .model-description {
  line-height: 1.35;
}

.tts-hidden-select {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.tts-voice-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tts-voice-select {
  flex: 1;
  min-width: 0;
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
}

.tts-talent-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.tts-search-field {
  position: relative;
  flex: 1;
  min-width: 0;
  width: min(420px, 100%);
  display: flex;
  align-items: center;
}

.tts-search-field svg {
  position: absolute;
  left: 12px;
  width: 15px;
  height: 15px;
  color: var(--text-muted);
  pointer-events: none;
}

.tts-search-field input {
  width: 100%;
  min-width: 0;
  height: 40px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-input);
  color: var(--text-primary);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  outline: none;
  padding: 0 12px 0 38px;
}

.tts-search-field input::placeholder {
  color: var(--text-muted);
}

.tts-search-field input:focus {
  border-color: var(--accent-yellow);
  box-shadow: 0 0 0 3px rgba(255, 204, 0, 0.16);
}

.tts-voice-count {
  flex-shrink: 0;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
}

.tts-voice-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: clamp(520px, calc(100dvh - 360px), 780px);
  overflow-y: auto;
  padding: 6px 2px 2px;
}

.tts-voice-item {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
  transition: border-color var(--transition-fast), background var(--transition-fast), transform var(--transition-fast);
}

body.light-theme .tts-voice-item {
  background: rgba(255, 255, 255, 0.7);
}

.tts-voice-item:hover {
  border-color: var(--border-color-hover);
  background: var(--bg-card-hover);
}

.tts-voice-item.active {
  border-color: var(--border-active);
  background: rgba(var(--accent-yellow-rgb), 0.08);
}

.tts-voice-select-btn {
  min-width: 0;
  flex: 1;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 9px 0 9px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  cursor: pointer;
}

.tts-voice-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--btn-yellow-text);
  background: var(--accent-yellow);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 13px;
}

.tts-voice-info {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tts-voice-name {
  color: var(--text-primary);
  font-weight: 700;
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tts-voice-desc {
  color: var(--text-muted);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tts-voice-meta {
  max-width: 82px;
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tts-voice-play {
  border: 1px solid var(--border-color);
  background: var(--bg-input);
  color: var(--text-secondary);
  cursor: pointer;
  transition: border-color var(--transition-fast), color var(--transition-fast), background var(--transition-fast);
}

.tts-voice-play {
  width: 34px;
  height: 34px;
  margin-right: 8px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tts-voice-play svg {
  width: 15px;
  height: 15px;
}

.tts-voice-play .tts-stop-icon {
  display: none;
}

.tts-voice-play.playing .tts-play-icon {
  display: none;
}

.tts-voice-play.playing .tts-stop-icon {
  display: block;
}

.tts-voice-play:hover:not(:disabled) {
  color: var(--text-primary);
  border-color: var(--border-color-hover);
  background: var(--bg-card-hover);
}

.tts-voice-play:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.tts-voice-empty {
  border: 1px dashed var(--border-color);
  border-radius: 8px;
  padding: 14px 12px;
  color: var(--text-muted);
  font-size: 12px;
  text-align: center;
}

.tts-results-panel {
  display: none;
  flex-direction: column;
  gap: 14px;
  padding: 24px 32px;
  min-height: 0;
  overflow: hidden;
  position: relative;
}

body.tab-generates.mode-audio .featured-grid {
  display: none;
}

/* Music Generator workspace */
.music-results-panel {
  display: none;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
  padding: 24px 32px 140px;
  overflow-y: auto;
}

body.tab-generates.mode-music .music-results-panel {
  display: flex;
  flex: 1 1 auto;
}

body.tab-generates.mode-music .featured-grid,
body.tab-generates.mode-music .canvas-display {
  display: none !important;
}

/* Music has no image/video output settings. This defensive rule prevents a
   partially loaded catalog from ever showing dimensions, batch, or seed. */
body.mode-music .parameters-container,
body.mode-music #btn-trigger-upload,
body.mode-music #mobile-setting-aspect,
body.mode-music #mobile-setting-batch,
body.mode-music #mobile-setting-duration,
body.mode-music #mobile-setting-resolution,
body.mode-music #mobile-setting-format,
body.mode-music #mobile-setting-motion-tier,
body.mode-music #mobile-setting-tts-voice {
  display: none !important;
}

/* Music is a separate product menu. Its model picker must contain only music
   models, not the Image/Video/Voice engine navigation owned by Generates. */
body.mode-music #engine-toggle,
body.mode-music #mobile-engine-toggle {
  display: none !important;
}

.music-options-strip {
  display: none;
  min-height: 48px;
  align-items: center;
  gap: 11px;
  padding: 8px 10px;
  border: 1px solid var(--border-color);
  border-radius: 11px;
  background: rgba(255, 255, 255, .025);
  transition: border-color .2s ease, background .2s ease;
}

body.mode-music .music-options-strip {
  display: flex;
}

.music-options-strip.is-active {
  border-color: rgba(var(--accent-yellow-rgb), .38);
  background: rgba(var(--accent-yellow-rgb), .075);
}

.music-options-icon {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  place-items: center;
  border-radius: 9px;
  color: var(--accent-yellow);
  background: rgba(var(--accent-yellow-rgb), .11);
}

.music-options-icon svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.music-options-copy {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 2px;
}

.music-options-copy strong {
  color: var(--text-primary);
  font: 800 12px/1.2 var(--font-display);
}

.music-options-copy small {
  color: var(--text-muted);
  font-size: 10px;
  line-height: 1.25;
}

.music-instrumental-switch {
  display: inline-flex;
  flex: 0 0 auto;
  cursor: pointer;
}

.music-instrumental-switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.music-instrumental-track {
  position: relative;
  width: 44px;
  height: 24px;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  background: var(--bg-input);
  transition: background .2s ease, border-color .2s ease;
}

.music-instrumental-track i {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: transform .2s ease, background .2s ease;
}

.music-instrumental-switch input:checked + .music-instrumental-track {
  border-color: var(--accent-yellow);
  background: var(--accent-yellow);
}

.music-instrumental-switch input:checked + .music-instrumental-track i {
  background: #111;
  transform: translateX(20px);
}

.music-instrumental-switch input:focus-visible + .music-instrumental-track {
  outline: 2px solid var(--accent-yellow);
  outline-offset: 3px;
}

.music-instrumental-switch input:disabled + .music-instrumental-track {
  cursor: not-allowed;
  opacity: .5;
}

@media (max-width: 768px) {
  /* The generic mobile settings carousel reserves a large blank block even
     when every image/video setting inside it is hidden. Music has no such
     settings, so remove the container itself. */
  body.tab-generates.mode-music .mobile-generate-settings {
    display: none !important;
  }
}

.music-results-toolbar,
.music-result-heading,
.music-result-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.music-results-toolbar h2 {
  margin: 3px 0 0;
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 24px;
}

.music-results-eyebrow,
.music-result-heading span {
  color: var(--accent-yellow);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .14em;
}

.music-results-count {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
}

.music-results-list {
  display: grid;
  gap: 14px;
}

.music-result-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--border-color);
  border-radius: 18px;
  background:
    radial-gradient(circle at 0 0, rgba(var(--accent-yellow-rgb), .07), transparent 34%),
    var(--bg-card);
  box-shadow: 0 12px 34px rgba(0, 0, 0, .12);
}

.music-result-top {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
}

.music-result-cover {
  width: 104px;
  aspect-ratio: 1;
  border-radius: 16px;
  object-fit: cover;
  background: var(--bg-input);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .2);
}

.music-result-cover-fallback {
  display: grid;
  place-items: center;
  color: var(--accent-yellow);
  font-size: 52px;
  background:
    radial-gradient(circle at 28% 22%, rgba(var(--accent-yellow-rgb), .22), transparent 42%),
    var(--bg-input);
}

.music-result-content {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 10px;
}

.music-result-heading {
  align-items: flex-start;
}

.music-result-heading h3 {
  margin: 3px 0 0;
  color: var(--text-primary);
  font: 800 18px/1.2 var(--font-display);
}

.music-result-heading time,
.music-result-content > p {
  color: var(--text-muted);
  font-size: 12px;
}

.music-result-content > p {
  margin: 0;
  line-height: 1.5;
}

.music-custom-player {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border: 1px solid var(--border-color);
  border-radius: 15px;
  background: rgba(0, 0, 0, .18);
}

body.light-theme .music-custom-player {
  background: rgba(0, 0, 0, .035);
}

.music-custom-player audio {
  display: none;
}

.music-player-toggle,
.music-player-mute {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  border: 0;
  cursor: pointer;
}

.music-player-toggle {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: #111;
  background: var(--accent-yellow);
  box-shadow: 0 7px 18px rgba(var(--accent-yellow-rgb), .2);
  transition: transform .18s ease, filter .18s ease;
}

.music-player-toggle:hover {
  filter: brightness(1.08);
  transform: scale(1.04);
}

.music-player-toggle:disabled {
  cursor: not-allowed;
  filter: grayscale(1);
  opacity: .55;
}

.music-player-toggle svg {
  width: 19px;
  height: 19px;
  fill: currentColor;
}

.music-player-icon-pause,
.music-custom-player.is-playing .music-player-icon-play {
  display: none;
}

.music-custom-player.is-playing .music-player-icon-pause {
  display: block;
}

.music-player-timeline {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 7px;
}

.music-player-seek {
  --music-seek: 0%;
  width: 100%;
  height: 5px;
  margin: 0;
  appearance: none;
  border: 0;
  border-radius: 999px;
  outline: none;
  background: linear-gradient(90deg,
      var(--accent-yellow) 0 var(--music-seek),
      rgba(255, 255, 255, .2) var(--music-seek) 100%);
  cursor: pointer;
}

body.light-theme .music-player-seek {
  background: linear-gradient(90deg,
      var(--accent-yellow) 0 var(--music-seek),
      rgba(0, 0, 0, .16) var(--music-seek) 100%);
}

.music-player-seek::-webkit-slider-thumb {
  width: 13px;
  height: 13px;
  appearance: none;
  border: 3px solid var(--bg-card);
  border-radius: 50%;
  background: var(--accent-yellow);
  box-shadow: 0 1px 5px rgba(0, 0, 0, .35);
}

.music-player-seek::-moz-range-thumb {
  width: 9px;
  height: 9px;
  border: 3px solid var(--bg-card);
  border-radius: 50%;
  background: var(--accent-yellow);
}

.music-player-time {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.music-player-time i {
  font-style: normal;
  opacity: .55;
}

.music-player-mute {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: var(--text-secondary);
  background: transparent;
}

.music-player-mute:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.music-player-mute svg {
  width: 18px;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.music-player-icon-muted,
.music-player-mute.is-muted .music-player-icon-volume {
  display: none;
}

.music-player-mute.is-muted .music-player-icon-muted {
  display: block;
}

.music-result-lyrics {
  border-top: 1px solid var(--border-color);
  padding-top: 11px;
}

.music-result-no-lyrics {
  margin: 0;
  padding-top: 11px;
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.5;
}

.music-result-lyrics summary {
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  list-style: none;
}

.music-result-lyrics summary::before {
  display: inline-block;
  margin-right: 7px;
  color: var(--accent-yellow);
  content: '›';
  transform: rotate(0);
  transition: transform .18s ease;
}

.music-result-lyrics[open] summary::before {
  transform: rotate(90deg);
}

.music-result-lyrics pre {
  max-height: 280px;
  margin: 12px 0 0;
  padding: 14px;
  overflow: auto;
  border-radius: 10px;
  color: var(--text-secondary);
  background: var(--bg-input);
  font: 500 13px/1.7 var(--font-display);
  white-space: pre-wrap;
}

.music-result-actions {
  justify-content: space-between;
}

.music-result-actions a,
.music-result-actions button {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-secondary);
  background: transparent;
  font-size: 11px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.music-result-actions svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.music-result-actions .music-result-download {
  border-color: rgba(var(--accent-yellow-rgb), .38);
  color: #111;
  background: var(--accent-yellow);
}

.music-result-actions .music-result-delete {
  margin-left: auto;
}

.music-result-processing {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  color: var(--text-secondary);
  font-size: 12px;
}

.music-progress-row {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.music-progress-row > span:nth-child(2) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.music-progress-row strong {
  margin-left: auto;
  color: var(--accent-yellow);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.music-progress-spinner {
  width: 13px;
  height: 13px;
  flex: 0 0 13px;
  border: 2px solid var(--border-color);
  border-top-color: var(--accent-yellow);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.music-progress-track {
  width: 100%;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

body.light-theme .music-progress-track {
  background: rgba(0, 0, 0, 0.09);
}

.music-progress-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #e6b800, var(--accent-yellow));
  box-shadow: 0 0 12px rgba(255, 204, 0, 0.28);
  transition: width 0.35s ease;
}

.music-results-empty {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 48px 20px;
  border: 1px dashed var(--border-color);
  border-radius: 14px;
  color: var(--text-muted);
  text-align: center;
}

.music-results-empty strong {
  color: var(--text-primary);
}

@media (max-width: 768px) {
  .mobile-mode-toggle .mode-toggle-btn {
    padding-inline: 5px;
    font-size: 10px;
    gap: 4px;
  }

  .music-results-panel,
  body.tab-generates.mode-music .music-results-panel {
    order: 2;
    flex: 0 0 auto;
    padding: 12px 16px 20px;
    overflow-y: visible;
  }

  body.tab-generates.mode-music .prompt-container-wrapper {
    order: 1;
    padding-top: 16px;
  }

  .music-results-toolbar {
    align-items: flex-end;
    gap: 8px;
  }

  .music-results-toolbar h2 {
    font-size: 22px;
  }

  .music-result-card {
    gap: 12px;
    padding: 12px;
    border-radius: 14px;
  }

  .music-result-top {
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 11px;
  }

  .music-result-cover {
    width: 64px;
    border-radius: 11px;
  }

  .music-result-heading h3 {
    font-size: 15px;
  }

  .music-custom-player {
    gap: 9px;
    padding: 9px 10px;
  }

  .music-player-toggle {
    width: 38px;
    height: 38px;
  }

  .music-player-mute {
    width: 30px;
    height: 30px;
  }

  .music-result-lyrics pre {
    max-height: 220px;
    overflow-y: auto;
    font-size: 12px;
  }

  .music-result-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  body.mode-music .prompt-textarea-wrapper {
    min-height: 88px;
  }

  body.mode-music .music-options-strip {
    min-height: 44px;
    padding: 7px 8px;
  }

  body.mode-music .prompt-char-counter {
    margin-top: auto;
    width: 100%;
    justify-content: flex-start;
    padding-top: 9px;
    border-top: 1px solid var(--border-color);
  }

  body.mode-music .btn-generate {
    width: 100%;
    height: 44px;
    margin-left: 0;
    padding: 0 8px 0 16px;
  }

  body.mode-music .btn-generate-text {
    display: inline !important;
  }

  body.mode-music .mobile-model-header {
    gap: 0;
    padding-block: 10px;
  }

  body.mode-music .mobile-model-trigger {
    min-height: 52px;
  }
}

.tts-results-count {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.tts-library-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}

.tts-library-search {
  position: relative;
  flex: 1 1 auto;
  width: auto;
  max-width: 480px;
  display: flex;
  align-items: center;
}

.tts-library-search svg {
  position: absolute;
  left: 12px;
  width: 15px;
  height: 15px;
  color: var(--text-muted);
  pointer-events: none;
}

.tts-library-search input {
  width: 100%;
  height: 40px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  outline: none;
  padding: 0 12px 0 38px;
}

.tts-library-search input::placeholder {
  color: var(--text-muted);
}

.tts-library-search input:focus {
  border-color: var(--accent-yellow);
  box-shadow: 0 0 0 3px rgba(255, 204, 0, 0.16);
}

.tts-results-list {
  min-height: 0;
  flex: 1 1 auto;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 4px;
}

.tts-results-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  flex-shrink: 0;
}

.tts-results-pagination:empty {
  display: none;
}

.tts-page-btn {
  min-width: 34px;
  height: 34px;
  padding: 0 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-input);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: border-color 0.14s ease, color 0.14s ease, background 0.14s ease;
}

.tts-page-btn svg {
  width: 15px;
  height: 15px;
}

.tts-page-btn:hover:not(:disabled):not(.active) {
  color: var(--text-primary);
  border-color: var(--border-color-hover);
  background: var(--bg-card-hover);
}

.tts-page-btn.active {
  color: var(--btn-yellow-text);
  background: var(--accent-yellow);
  border-color: var(--accent-yellow);
  cursor: default;
}

.tts-page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.tts-page-gap {
  min-width: 20px;
  text-align: center;
  color: var(--text-muted);
  font-weight: 800;
}

.tts-results-empty {
  border: 1px dashed var(--border-color);
  border-radius: 14px;
  background: var(--bg-card);
  min-height: 200px;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  padding: 32px;
}

.tts-result-item {
  position: relative;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 11px 14px 11px 12px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: var(--bg-card);
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.tts-result-item:hover {
  border-color: var(--border-color-hover);
  background: var(--bg-card-hover);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.14);
}

/* Active row: subtle yellow wash + a left accent rail (no gimmicky waveform). */
.tts-result-item.active {
  border-color: rgba(var(--accent-yellow-rgb), 0.55);
  background: rgba(var(--accent-yellow-rgb), 0.055);
}

.tts-result-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent-yellow);
}

.tts-result-item.loading {
  cursor: default;
}

/* Play control: quiet outline by default, fills with accent on hover / active
   — reads as a real player button rather than a heavy solid yellow dot. */
.tts-result-play,
.tts-result-status {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tts-result-play {
  cursor: pointer;
  color: var(--accent-yellow);
  background: rgba(var(--accent-yellow-rgb), 0.10);
  border: 1px solid rgba(var(--accent-yellow-rgb), 0.30);
  transition: background 0.16s ease, color 0.16s ease, transform 0.12s ease, border-color 0.16s ease;
}

.tts-result-item:hover .tts-result-play,
.tts-result-play.playing {
  background: var(--accent-yellow);
  border-color: var(--accent-yellow);
  color: var(--btn-yellow-text);
}

.tts-result-play:active {
  transform: scale(0.94);
}

.tts-result-status {
  color: var(--accent-yellow);
  background: rgba(var(--accent-yellow-rgb), 0.10);
  border: 1px solid rgba(var(--accent-yellow-rgb), 0.24);
}

.tts-result-play svg {
  width: 15px;
  height: 15px;
}

.tts-result-play .icon-pause,
.tts-player-play .icon-pause {
  display: none;
}

.tts-result-play.playing .icon-play,
.tts-player-play.playing .icon-play {
  display: none;
}

.tts-result-play.playing .icon-pause,
.tts-player-play.playing .icon-pause {
  display: block;
}

.tts-result-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.tts-result-title {
  color: var(--text-primary);
  font-weight: 650;
  font-size: 13.5px;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tts-result-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.tts-result-meta-text {
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Origin badge (Web / Telegram) shown in the result meta row. */
.tts-origin {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  padding: 2px 8px 2px 6px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.2px;
  line-height: 1;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
}

.tts-origin svg {
  width: 12px;
  height: 12px;
}

.tts-origin-tg {
  color: #229ed9;
  border-color: rgba(34, 158, 217, 0.35);
  background: rgba(34, 158, 217, 0.10);
}

.tts-origin-web {
  color: var(--accent-yellow);
  border-color: rgba(var(--accent-yellow-rgb), 0.32);
  background: rgba(var(--accent-yellow-rgb), 0.10);
}

/* Compact "now playing" equalizer — only visible on the active row. */
.tts-eq {
  display: none;
  align-items: flex-end;
  gap: 2px;
  height: 12px;
  flex-shrink: 0;
}

.tts-result-item.active .tts-eq {
  display: inline-flex;
}

.tts-eq span {
  width: 2.5px;
  height: 30%;
  border-radius: 2px;
  background: var(--accent-yellow);
  transform-origin: bottom;
}

.tts-result-item.active .tts-eq span {
  animation: tts-wave-pulse 0.85s ease-in-out infinite alternate;
}

.tts-eq span:nth-child(1) { height: 45%; animation-delay: 0s; }
.tts-eq span:nth-child(2) { height: 90%; animation-delay: 0.16s; }
.tts-eq span:nth-child(3) { height: 55%; animation-delay: 0.32s; }
.tts-eq span:nth-child(4) { height: 75%; animation-delay: 0.10s; }

@keyframes tts-wave-pulse {
  from {
    transform: scaleY(0.4);
  }
  to {
    transform: scaleY(1);
  }
}

.tts-result-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tts-result-action {
  width: 34px;
  height: 34px;
  border: 1px solid transparent;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  background: transparent;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.14s ease, background 0.14s ease, border-color 0.14s ease;
}

.tts-result-action svg {
  width: 16px;
  height: 16px;
}

.tts-result-action:hover {
  color: var(--text-primary);
  background: var(--bg-input);
  border-color: var(--border-color);
}

.tts-result-action.danger:hover {
  color: var(--accent-red);
  border-color: rgba(var(--accent-red-rgb, 220, 38, 38), 0.4);
}

.tts-result-pill {
  color: var(--accent-yellow);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.tts-result-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(0, 0, 0, 0.25);
  border-top-color: var(--btn-yellow-text);
  border-radius: 50%;
  animation: rotate-spinner 0.9s linear infinite;
}

.tts-library-player {
  --tts-player-bg: #181818;
  --tts-player-border: rgba(255, 255, 255, 0.08);
  --tts-player-text: #ffffff;
  --tts-player-muted: #b3b3b3;
  --tts-player-time: #a7a7a7;
  --tts-player-track: #535353;
  --tts-player-art-bg: #242424;
  --tts-player-art-border: rgba(255, 255, 255, 0.08);
  --tts-player-play-bg: #ffffff;
  --tts-player-play-text: #101010;
  --tts-player-action-hover: rgba(255, 255, 255, 0.08);
  position: sticky;
  bottom: 0;
  z-index: 10;
  flex-shrink: 0;
  margin: auto 0 0;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(320px, 1.45fr) minmax(120px, 1fr);
  align-items: center;
  gap: 18px;
  min-height: 84px;
  padding: 12px 28px calc(12px + env(safe-area-inset-bottom, 0px));
  border: 0;
  border-top: 1px solid var(--tts-player-border);
  border-radius: 0;
  color: var(--tts-player-text);
  background: var(--tts-player-bg);
  box-shadow: 0 -16px 44px rgba(0, 0, 0, 0.34);
}

body.light-theme .tts-library-player {
  --tts-player-bg: #ffffff;
  --tts-player-border: rgba(17, 17, 17, 0.10);
  --tts-player-text: #111111;
  --tts-player-muted: #686868;
  --tts-player-time: #777777;
  --tts-player-track: #dedede;
  --tts-player-art-bg: #fff8df;
  --tts-player-art-border: rgba(var(--accent-yellow-rgb), 0.24);
  --tts-player-play-bg: var(--accent-yellow);
  --tts-player-play-text: var(--btn-yellow-text);
  --tts-player-action-hover: rgba(17, 17, 17, 0.06);
  box-shadow: 0 -12px 30px rgba(0, 0, 0, 0.10);
}

.tts-library-player.hidden {
  display: none !important;
}

.tts-player-info {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.tts-player-art {
  width: 52px;
  height: 52px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-yellow);
  background: var(--tts-player-art-bg);
  border: 1px solid var(--tts-player-art-border);
  flex-shrink: 0;
}

.tts-player-art svg {
  width: 22px;
  height: 22px;
}

.tts-player-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.tts-player-title {
  color: var(--tts-player-text);
  font-size: 13.5px;
  font-weight: 750;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tts-player-sub {
  color: var(--tts-player-muted);
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tts-player-center {
  min-width: 0;
  width: min(100%, 560px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-self: center;
  gap: 7px;
}

.tts-player-play {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--tts-player-play-text);
  background: var(--tts-player-play-bg);
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: none;
  transition: transform 0.12s ease, box-shadow 0.16s ease;
}

.tts-player-play:hover {
  transform: scale(1.06);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.34);
}

.tts-player-play:active {
  transform: scale(0.97);
}

.tts-player-play svg {
  width: 18px;
  height: 18px;
}

.tts-player-progress {
  width: 100%;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
}

.tts-player-time {
  min-width: 36px;
  color: var(--tts-player-time);
  font-size: 11px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.tts-player-time-end {
  color: var(--tts-player-muted);
}

/* Custom Spotify-style seek bar: filled portion driven by --seek-progress. */
.tts-player-seek {
  -webkit-appearance: none;
  appearance: none;
  min-width: 0;
  width: 100%;
  height: 4px;
  border-radius: 999px;
  cursor: pointer;
  background: linear-gradient(
    to right,
    var(--btn-yellow) 0%,
    var(--btn-yellow) var(--seek-progress, 0%),
    var(--tts-player-track) var(--seek-progress, 0%),
    var(--tts-player-track) 100%
  );
  outline: none;
}

.tts-player-seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #fff;
  border: 0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  opacity: 0;
  transition: opacity 0.14s ease;
}

.tts-player-seek:hover::-webkit-slider-thumb,
.tts-player-seek:focus::-webkit-slider-thumb,
.tts-player-seek:active::-webkit-slider-thumb {
  opacity: 1;
}

.tts-player-seek::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #fff;
  border: 0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.tts-player-seek::-moz-range-track {
  height: 6px;
  border-radius: 999px;
  background: transparent;
}

/* Animated equalizer bars inside the player artwork. */
.tts-player-art-bars {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 18px;
}

.tts-player-art-bars span {
  width: 3px;
  height: 40%;
  border-radius: 2px;
  background: var(--btn-yellow);
  opacity: 0.92;
}

.tts-library-player:has(.tts-player-play.playing) .tts-player-art-bars span {
  animation: tts-wave-pulse 0.9s ease-in-out infinite alternate;
  transform-origin: bottom;
}

.tts-player-art-bars span:nth-child(1) { animation-delay: 0s; height: 55%; }
.tts-player-art-bars span:nth-child(2) { animation-delay: 0.18s; height: 90%; }
.tts-player-art-bars span:nth-child(3) { animation-delay: 0.36s; height: 45%; }
.tts-player-art-bars span:nth-child(4) { animation-delay: 0.12s; height: 75%; }

.tts-player-actions {
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 8px;
}

.tts-player-action {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--tts-player-muted);
  background: transparent;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.14s ease, background 0.14s ease, transform 0.12s ease;
}

.tts-player-action svg {
  width: 15px;
  height: 15px;
}

.tts-player-action:hover {
  color: var(--tts-player-text);
  background: var(--tts-player-action-hover);
  transform: scale(1.04);
}

.logo-tts,
.logo-tts-pro {
  color: var(--accent-yellow);
}

.card-audio-poster,
.custom-audio-player {
  width: 100%;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: linear-gradient(135deg, rgba(20, 20, 20, 0.96), rgba(48, 42, 29, 0.92));
}

.audio-visual-mark,
.card-audio-icon {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(var(--accent-yellow-rgb), 0.24);
  border-radius: 50%;
  color: var(--accent-yellow);
  background: rgba(var(--accent-yellow-rgb), 0.08);
}

.audio-visual-mark svg,
.card-audio-icon svg {
  width: 34px;
  height: 34px;
}

.custom-audio-player {
  height: 100%;
  padding: 28px;
}

.custom-audio-player audio {
  width: min(520px, 92%);
}

/* Logo Wrappers */
.model-logo-wrapper {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  z-index: 1;
}

body.light-theme .model-logo-wrapper {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.05);
}

/* Custom Provider Colors for Logos */
.logo-gpt {
  color: #10a37f !important;
  background: rgba(16, 163, 127, 0.08) !important;
  border-color: rgba(16, 163, 127, 0.15) !important;
}

.logo-banana-pro,
.logo-banana-2 {
  color: #f4b400 !important;
  background: rgba(244, 180, 0, 0.08) !important;
  border-color: rgba(244, 180, 0, 0.15) !important;
}

.logo-seedance {
  color: #fe2c55 !important;
  background: linear-gradient(135deg, rgba(0, 242, 234, 0.1), rgba(254, 44, 85, 0.1)) !important;
  border-color: rgba(254, 44, 85, 0.15) !important;
}

.logo-kling,
.logo-kling-pro {
  color: #8b5cf6 !important;
  background: rgba(139, 92, 246, 0.08) !important;
  border-color: rgba(139, 92, 246, 0.15) !important;
}

.logo-veo,
.logo-veo-fast {
  color: #4285f4 !important;
  background: rgba(66, 133, 244, 0.08) !important;
  border-color: rgba(66, 133, 244, 0.15) !important;
}

.logo-grok {
  color: var(--text-primary) !important;
  background: rgba(120, 120, 130, 0.10) !important;
  border-color: rgba(120, 120, 130, 0.18) !important;
}

.provider-logo {
  width: 20px;
  height: 20px;
  z-index: 1;
}

.model-card.active .model-logo-wrapper {
  transform: scale(1.05);
  box-shadow: 0 0 12px rgba(var(--accent-yellow-rgb), 0.15);
}

.model-card-details {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex-grow: 1;
  position: relative;
  z-index: 1;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
}

body.light-theme .model-card-details {
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.6);
}

.model-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.model-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  color: var(--text-primary);
  transition: color var(--transition-fast);
}

.model-card.active .model-name {
  color: var(--accent-yellow);
}

.model-tag-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}

body.light-theme .model-tag-badge {
  background-color: rgba(0, 0, 0, 0.05);
}

.model-tag-badge.gold {
  background-color: rgba(255, 204, 0, 0.1);
  color: var(--accent-yellow);
  border: 1px solid rgba(255, 204, 0, 0.2);
}

body.light-theme .model-tag-badge.gold {
  background-color: rgba(197, 150, 0, 0.08);
}

.model-description {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.model-cost {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Light theme: keep card text readable over the bright preview image */
body.light-theme .model-card::after {
  opacity: 0.16;
  filter: saturate(0.8) brightness(1.02) contrast(0.92);
}

body.light-theme .model-card:hover::after {
  opacity: 0.26;
}

body.light-theme .model-card.active::after {
  opacity: 0.3;
}

body.light-theme .model-description {
  color: #3f3f46;
}

body.light-theme .model-cost {
  color: #52525b;
}

/* Parameters Container */
.parameters-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.param-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.param-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.param-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.param-value {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
}

.param-row:hover .param-value {
  color: var(--accent-yellow);
}

/* Seed control */
#val-seed-state {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.seed-input-group {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.seed-field {
  flex: 1;
  min-width: 0;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  padding: 9px 12px;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .02em;
  transition: var(--transition-fast);
}

.seed-field::placeholder {
  color: var(--text-muted);
  font-weight: 500;
}

.seed-field:focus {
  outline: none;
  border-color: var(--accent-yellow);
  box-shadow: 0 0 0 3px var(--accent-muted-yellow, rgba(234, 179, 8, .15));
}

.seed-dice {
  flex-shrink: 0;
  width: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-fast);
}

.seed-dice svg {
  width: 18px;
  height: 18px;
}

.seed-dice:hover {
  border-color: var(--accent-yellow);
  color: var(--accent-yellow);
}

.seed-dice:active {
  transform: scale(.94);
}

.seed-hint {
  font-size: 11px;
  line-height: 1.4;
  color: var(--text-muted);
}

/* Aspect Ratio Selectors */
.aspect-ratio-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.aspect-btn {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 8px 4px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--text-secondary);
  transition: var(--transition-fast);
}

.aspect-btn:hover {
  background-color: var(--bg-card-hover);
  border-color: var(--border-color-hover);
  color: var(--text-primary);
}

.aspect-btn.active {
  background-color: rgba(255, 255, 255, 0.02);
  border-color: var(--accent-yellow);
  color: var(--accent-yellow);
}

body.light-theme .aspect-btn.active {
  background-color: rgba(197, 150, 0, 0.02);
}

.aspect-box {
  border: 1.5px solid currentColor;
  border-radius: 1px;
  background-color: rgba(255, 255, 255, 0.02);
  transition: var(--transition-fast);
}

.sq-1-1 {
  width: 12px;
  height: 12px;
}

.rect-16-9 {
  width: 18px;
  height: 10px;
}

.rect-9-16 {
  width: 10px;
  height: 18px;
}

.rect-4-3 {
  width: 16px;
  height: 12px;
}

.aspect-text {
  font-size: 9px;
  font-weight: 700;
}

/* Batch and Duration Selector buttons */
.batch-selector,
.duration-selector,
.resolution-selector,
.framerate-selector,
.format-selector {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  padding: 3px;
  border-radius: 6px;
  transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

.duration-selector,
.resolution-selector,
.framerate-selector {
  grid-template-columns: repeat(3, 1fr);
}

.format-selector {
  grid-template-columns: repeat(2, 1fr);
}

.batch-btn,
.dur-btn,
.res-btn,
.fps-btn,
.format-btn {
  background-color: transparent;
  border: none;
  border-radius: 4px;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  padding: 6px 0;
  cursor: pointer;
  transition: var(--transition-fast);
}

.batch-btn:hover,
.dur-btn:hover,
.res-btn:hover,
.fps-btn:hover,
.format-btn:hover {
  color: var(--text-primary);
}

.batch-btn.active,
.dur-btn.active,
.res-btn.active,
.fps-btn.active,
.format-btn.active {
  background-color: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

body.light-theme .batch-btn.active,
body.light-theme .dur-btn.active,
body.light-theme .res-btn.active,
body.light-theme .fps-btn.active,
body.light-theme .format-btn.active {
  background-color: #ffffff;
  color: #111111;
}

/* Range Sliders */
.param-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background-color: var(--bg-input);
  outline: none;
  margin: 6px 0;
  transition: background-color var(--transition-normal);
}

.param-slider::-webkit-slider-runnable-track {
  width: 100%;
  height: 4px;
  cursor: pointer;
  background: var(--bg-input);
  border-radius: 2px;
  border: 1px solid var(--border-color);
  transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

.param-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  height: 12px;
  width: 12px;
  border-radius: 50%;
  background: var(--text-primary);
  cursor: pointer;
  margin-top: -5px;
  transition: background var(--transition-fast), transform var(--transition-fast);
}

.param-slider::-webkit-slider-thumb:hover {
  transform: scale(1.25);
  background: var(--accent-yellow);
}

.slider-bounds {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  color: var(--text-muted);
}

/* When the duration selector renders a range slider (video models) it must
   NOT use the 3-column button grid — lay the slider out full width with the
   min/max bounds row underneath. */
.duration-selector.duration-as-slider {
  display: block;
  background-color: transparent;
  border: none;
  padding: 0;
}
.duration-selector.duration-as-slider .param-slider {
  width: 100%;
  margin: 4px 0 2px;
}
.duration-selector.duration-as-slider .slider-bounds {
  font-size: 11px;
  color: var(--text-secondary);
}

/* Advanced Configuration accordion (legacy seed control removed; seed is now a
   direct control in the params panel) */

.btn-text-link {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 500;
  cursor: pointer;
}

.btn-text-link:hover {
  color: var(--accent-yellow);
}

.text-input,
.textarea-input {
  width: 100%;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-primary);
  padding: 8px 10px;
  font-family: var(--font-ui);
  font-size: 12px;
  transition: var(--transition-fast);
}

.text-input:focus,
.textarea-input:focus {
  border-color: var(--accent-yellow);
}

.textarea-input {
  min-height: 50px;
  resize: vertical;
}

/* Main Canvas Screen */
.main-canvas {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background-color: #030303;
  position: relative;
  transition: background-color var(--transition-normal);
}

body.light-theme .main-canvas {
  background-color: #f1f1f3;
}

.mobile-model-header {
  display: none;
}

.mobile-params-strip {
  display: none;
}

.mobile-generate-settings {
  display: none;
}

.canvas-display {
  flex-grow: 1;
  padding: 32px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Empty State */
.empty-state {
  margin: auto;
  text-align: center;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.empty-icon {
  width: 48px;
  height: 48px;
  color: var(--text-muted);
}

.empty-state h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
}

.empty-state p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Outputs Grid Styling */
.output-grid {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  width: 100%;
}

.masonry-col {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.gallery-feedback {
  align-self: center;
  width: min(520px, 100%);
  margin: 24px auto 0;
  padding: 14px 16px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.45;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.gallery-feedback.is-error {
  border-color: rgba(239, 68, 68, 0.45);
  color: var(--text-primary);
}

.gallery-retry-btn,
.gallery-page-nav,
.gallery-page-number {
  min-height: 38px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: var(--bg-card);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.gallery-retry-btn,
.gallery-page-nav {
  padding: 0 14px;
}

.gallery-retry-btn:hover:not(:disabled),
.gallery-page-nav:hover:not(:disabled),
.gallery-page-number:hover:not(:disabled) {
  border-color: var(--accent-yellow);
}

.gallery-pagination {
  width: 100%;
  margin: 28px auto 4px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.gallery-page-buttons {
  display: flex;
  align-items: center;
  gap: 6px;
}

.gallery-page-number {
  width: 38px;
  padding: 0;
}

.gallery-page-number.active {
  border-color: var(--accent-yellow);
  background: var(--accent-yellow);
  color: #111111;
}

.gallery-retry-btn:disabled,
.gallery-page-nav:disabled,
.gallery-page-number:disabled {
  cursor: default;
  opacity: 0.45;
}

.gallery-page-number.active:disabled {
  opacity: 1;
}

.gallery-page-summary {
  flex-basis: 100%;
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 11px;
  text-align: center;
}

/* Output card */
.output-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  overflow: hidden;
  position: relative;
  display: block;
  width: 100%;
  transition: var(--transition-normal);
  animation: card-appear 0.4s ease both;
}

.output-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-color-hover);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
}

body.light-theme .output-card:hover {
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.1);
}

@keyframes card-appear {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.97);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.card-viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background-color: #000000;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Pinterest-style varied tile heights based on output aspect ratio */
.output-card[data-aspect="tall"] .card-viewport {
  aspect-ratio: 3 / 4;
}

.output-card[data-aspect="portrait"] .card-viewport {
  aspect-ratio: 2 / 3;
}

.output-card[data-aspect="square"] .card-viewport {
  aspect-ratio: 1 / 1;
}

.output-card[data-aspect="wide"] .card-viewport,
.output-card[data-aspect="audio"] .card-viewport {
  aspect-ratio: 4 / 3;
}

.output-card[data-aspect="video"] .card-viewport {
  aspect-ratio: 16 / 9;
}

body.light-theme .card-viewport {
  background-color: #eeeeee;
}

.card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-video-poster {
  position: relative;
  width: 100%;
  height: 100%;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 44%, rgba(255, 213, 74, 0.2), transparent 34%),
    linear-gradient(135deg, rgba(28, 28, 28, 1), rgba(5, 5, 5, 1));
}

.card-video-thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
  z-index: 1;
}

.card-video-play-badge {
  position: relative;
  z-index: 2;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #1a1a1a;
  background: var(--accent-yellow);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.35);
}

.card-video-play-badge svg {
  width: 22px;
  height: 22px;
  margin-left: 3px;
}

/* Video indicators */
.video-indicator-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background-color: rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 4px 8px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 2;
}

body.light-theme .video-indicator-badge {
  background-color: rgba(255, 255, 255, 0.85);
  border-color: rgba(0, 0, 0, 0.05);
}

.video-badge-icon {
  width: 11px;
  height: 11px;
  color: var(--text-primary);
}

.video-badge-text {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text-primary);
}

/* Card details (Model text) */
.card-details-footer {
  padding: 10px 12px;
  border-top: 1px solid var(--border-color);
  background-color: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-model-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 11px;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.card-model-icon {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text-primary);
}

body.light-theme .card-model-icon {
  background: rgba(0, 0, 0, 0.05);
}

.card-model-icon svg {
  width: 11px;
  height: 11px;
}

.card-time {
  font-size: 10px;
  color: var(--text-muted);
}

/* Inside-Grid Generative / Loading Card styling */
.generating-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  aspect-ratio: 1/1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  position: relative;
  transition: border-color var(--transition-normal);
}

.generating-card.active-loading {
  border-color: var(--accent-yellow);
}

.generating-card.roboneo-retry-card {
  border-color: rgba(255, 196, 0, 0.7);
}

.roboneo-retry-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 18px;
  text-align: center;
}

.roboneo-retry-body > strong {
  font-family: var(--font-display);
  font-size: 14px;
}

.roboneo-retry-body > span {
  color: var(--text-secondary);
  font-size: 10px;
  line-height: 1.45;
}

.roboneo-retry-body > small {
  color: var(--text-muted);
  font-size: 9px;
  line-height: 1.35;
}

.roboneo-retry-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--accent-yellow);
  border-radius: 50%;
  color: var(--accent-yellow);
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
}

.roboneo-retry-btn {
  min-height: 34px;
  padding: 0 18px;
  border: 0;
  border-radius: 6px;
  background: var(--accent-yellow);
  color: #111;
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
}

.roboneo-retry-btn:hover {
  filter: brightness(1.08);
}

.roboneo-retry-card.retry-submitting {
  opacity: 0.7;
  pointer-events: none;
}

.generating-card-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-grow: 1;
}

.generating-spinner-wrapper {
  position: relative;
  width: 60px;
  height: 60px;
}

.generating-spinner-ring {
  width: 100%;
  height: 100%;
  border: 2px solid rgba(255, 255, 255, 0.05);
  border-top-color: var(--accent-yellow);
  border-radius: 50%;
  animation: rotate-spinner 0.9s linear infinite;
}

body.light-theme .generating-spinner-ring {
  border: 2px solid rgba(0, 0, 0, 0.04);
  border-top-color: var(--accent-yellow);
}

.generating-percent {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 56px;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  color: var(--accent-yellow);
}

.generating-step {
  font-size: 10px;
  color: var(--text-secondary);
  text-align: center;
  max-width: 80%;
  min-height: 16px;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.generating-progress-track {
  width: min(150px, 72%);
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.generating-progress-track > i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent-yellow);
  transition: width 0.35s ease;
}

body.light-theme .generating-progress-track {
  background: rgba(0, 0, 0, 0.08);
}

.generating-footer {
  height: 36px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-color);
  background-color: rgba(0, 0, 0, 0.2);
}

body.light-theme .generating-footer {
  background-color: #fafafa;
}

.generating-model-label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 10px;
  color: var(--accent-yellow);
  letter-spacing: 0.5px;
}

.generating-elapsed {
  font-size: 9px;
  color: var(--text-muted);
}

@keyframes rotate-spinner {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* Kling Motion Pro Requirements Box Styling */
.kling-requirements-container {
  max-width: 960px;
  margin: 0 auto 12px auto;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: slide-down 0.25s ease-out;
  transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

@keyframes slide-down {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.kling-req-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.kling-req-header span {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.kling-req-header p {
  font-size: 11px;
  color: var(--text-secondary);
}

.motion-variant-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 3px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-input);
}

.motion-tier-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-fast);
}

.motion-tier-btn span {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
}

.motion-tier-btn:hover,
.motion-tier-btn.active {
  border-color: var(--accent-yellow);
  color: var(--accent-yellow);
  background: rgba(234, 179, 8, 0.08);
}

.motion-tier-btn.active span {
  color: var(--accent-yellow);
}

.kling-req-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.kling-tiktok-reference {
  display: grid;
  gap: 6px;
  font-size: 11px;
  color: var(--text-secondary);
}

.kling-tiktok-reference input {
  width: 100%;
  min-height: 40px;
  padding: 9px 11px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-input);
  color: var(--text-primary);
  font: inherit;
}

.kling-tiktok-reference input:focus {
  outline: none;
  border-color: var(--accent-yellow);
}

.kling-tiktok-reference small {
  color: var(--text-muted);
}

.kling-upload-slot {
  height: 90px;
  background-color: var(--bg-input);
  border: 1.5px dashed var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}

.kling-upload-slot:hover {
  border-color: var(--accent-yellow);
  background-color: rgba(255, 255, 255, 0.01);
}

body.light-theme .kling-upload-slot:hover {
  background-color: rgba(0, 0, 0, 0.01);
}

.slot-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 500;
}

.slot-empty svg {
  width: 22px;
  height: 22px;
  color: var(--text-secondary);
}

.kling-upload-slot:hover .slot-empty svg {
  color: var(--accent-yellow);
}

.slot-filled {
  width: 100%;
  height: 100%;
  position: relative;
}

.slot-filled img,
.video-preview-placeholder {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-preview-placeholder {
  background-color: #080808;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}

body.light-theme .video-preview-placeholder {
  background-color: #f0f0f0;
}

.video-preview-placeholder svg {
  width: 24px;
  height: 24px;
}

.slot-overlay {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
}

.slot-filename {
  font-size: 11px;
  color: #fff;
  max-width: 150px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-clear-slot {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: var(--transition-fast);
}

.btn-clear-slot:hover {
  color: var(--accent-red);
  background-color: rgba(255, 62, 108, 0.15);
}

/* Prompter Panel (Bottom Input area) */
.prompt-container-wrapper {
  padding: 20px 32px 32px 32px;
  background: linear-gradient(to top, var(--bg-app) 70%, transparent 100%);
  flex-shrink: 0;
  position: relative;
  z-index: 4;
  transition: background-color var(--transition-normal);
}

body.light-theme .prompt-container-wrapper {
  background: linear-gradient(to top, var(--bg-app) 70%, transparent 100%);
}

.prompt-container {
  max-width: 960px;
  margin: 0 auto;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: var(--transition-fast);
}

.prompt-container:focus-within {
  border-color: var(--border-color-hover);
  box-shadow: 0 0 0 3px rgba(255, 204, 0, 0.06);
}

body.light-theme .prompt-container:focus-within {
  box-shadow: 0 0 0 3px rgba(197, 150, 0, 0.06);
}

/* Topaz Video Upscaler: a real source-video dropzone instead of a lone
   circular upload icon beside Generate. */
body.mode-video-upscaler .prompt-container {
  max-width: 1040px;
  padding: 14px;
  gap: 12px;
}

body.mode-video-upscaler .prompt-input-row {
  justify-content: flex-end;
}

body.mode-video-upscaler .prompt-action-btn,
body.mode-video-upscaler .prompt-textarea-wrapper,
body.mode-video-upscaler .upload-preview-area {
  display: none !important;
}

body.mode-video-upscaler .btn-generate {
  min-width: 176px;
  justify-content: center;
}

.upscaler-upload-card {
  width: 100%;
  min-height: 112px;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 18px;
  border: 1.5px dashed var(--border-color-hover);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.018);
  color: var(--text-primary);
  cursor: pointer;
  outline: none;
  transition: border-color var(--transition-fast), background-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
}

body.light-theme .upscaler-upload-card {
  background: rgba(0, 0, 0, 0.018);
}

.upscaler-upload-card:hover,
.upscaler-upload-card:focus-visible,
.upscaler-upload-card.is-dragging {
  border-color: var(--accent-yellow);
  background: rgba(255, 204, 0, 0.055);
  box-shadow: 0 0 0 3px rgba(255, 204, 0, 0.1);
}

.upscaler-upload-card:active {
  transform: translateY(1px);
}

.upscaler-upload-card.has-video {
  border-style: solid;
  border-color: rgba(255, 204, 0, 0.48);
  background: rgba(255, 204, 0, 0.045);
}

.upscaler-upload-media {
  position: relative;
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid var(--border-color);
  border-radius: 11px;
  background: rgba(255, 204, 0, 0.09);
  color: var(--accent-yellow);
}

body.light-theme .upscaler-upload-media {
  background: rgba(197, 150, 0, 0.08);
}

.upscaler-upload-empty-icon {
  width: 30px;
  height: 30px;
}

.upscaler-upload-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #080808;
}

.upscaler-upload-kind {
  display: none;
  position: absolute;
  left: 5px;
  bottom: 5px;
  padding: 2px 5px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-size: 7px;
  font-weight: 900;
  letter-spacing: 0.5px;
  line-height: 1.2;
}

.upscaler-upload-card.has-video .upscaler-upload-kind {
  display: inline-flex;
}

.upscaler-upload-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
}

.upscaler-upload-eyebrow {
  color: var(--accent-yellow);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 1.25px;
  line-height: 1;
}

.upscaler-upload-title {
  max-width: 100%;
  overflow: hidden;
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upscaler-upload-meta {
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.45;
}

.upscaler-upload-cta {
  min-width: 128px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid var(--border-color-hover);
  border-radius: 999px;
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.upscaler-upload-cta svg {
  width: 15px;
  height: 15px;
  color: var(--accent-yellow);
}

.upscaler-upload-card:hover .upscaler-upload-cta,
.upscaler-upload-card:focus-visible .upscaler-upload-cta {
  border-color: var(--accent-yellow);
}

.upscaler-scale-panel {
  width: 100%;
  padding: 17px 18px 14px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.018);
}

body.light-theme .upscaler-scale-panel {
  background: rgba(0, 0, 0, 0.018);
}

.upscaler-scale-heading,
.upscaler-scale-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.upscaler-scale-heading > div {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.upscaler-scale-heading strong {
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.2;
}

.upscaler-scale-eyebrow {
  color: var(--text-muted);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 1.15px;
  line-height: 1;
}

.upscaler-scale-value {
  min-width: 56px;
  padding: 7px 11px;
  border: 1px solid rgba(255, 204, 0, 0.48);
  border-radius: 9px;
  background: rgba(255, 204, 0, 0.09);
  color: var(--accent-yellow);
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
  text-align: center;
}

.upscaler-scale-range {
  --upscaler-range-progress: 0%;
  width: 100%;
  height: 24px;
  margin: 13px 0 0;
  padding: 0;
  border: 0;
  outline: none;
  background: transparent;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.upscaler-scale-range::-webkit-slider-runnable-track {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(
    to right,
    var(--accent-yellow) 0,
    var(--accent-yellow) var(--upscaler-range-progress),
    var(--border-color-hover) var(--upscaler-range-progress),
    var(--border-color-hover) 100%
  );
}

.upscaler-scale-range::-webkit-slider-thumb {
  width: 21px;
  height: 21px;
  margin-top: -7.5px;
  border: 3px solid var(--bg-card);
  border-radius: 50%;
  background: var(--accent-yellow);
  box-shadow: 0 0 0 1px rgba(255, 204, 0, 0.66), 0 3px 10px rgba(0, 0, 0, 0.28);
  appearance: none;
  -webkit-appearance: none;
}

.upscaler-scale-range::-moz-range-track {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: var(--border-color-hover);
}

.upscaler-scale-range::-moz-range-progress {
  height: 6px;
  border-radius: 999px;
  background: var(--accent-yellow);
}

.upscaler-scale-range::-moz-range-thumb {
  width: 17px;
  height: 17px;
  border: 3px solid var(--bg-card);
  border-radius: 50%;
  background: var(--accent-yellow);
  box-shadow: 0 0 0 1px rgba(255, 204, 0, 0.66), 0 3px 10px rgba(0, 0, 0, 0.28);
}

.upscaler-scale-range:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 4px rgba(255, 204, 0, 0.18), 0 0 0 1px var(--accent-yellow);
}

.upscaler-scale-range:disabled {
  cursor: default;
  opacity: 0.62;
}

.upscaler-scale-marks {
  display: grid;
  grid-template-columns: repeat(var(--upscaler-scale-count, 4), minmax(0, 1fr));
  gap: 8px;
  margin-top: 2px;
}

.upscaler-scale-mark {
  min-width: 0;
  min-height: 42px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 5px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1;
  text-align: center;
  cursor: pointer;
}

.upscaler-scale-mark strong {
  overflow: hidden;
  max-width: 100%;
  color: inherit;
  font-size: 10.5px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upscaler-scale-mark small {
  overflow: hidden;
  max-width: 100%;
  color: var(--text-muted);
  font-size: 8px;
  font-weight: 700;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upscaler-scale-mark.active small {
  color: var(--accent-yellow);
}

.upscaler-scale-mark:hover,
.upscaler-scale-mark.active {
  background: rgba(255, 204, 0, 0.08);
  color: var(--accent-yellow);
}

.upscaler-scale-footer {
  margin-top: 9px;
  padding-top: 10px;
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.15px;
}

.prompt-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Image preview section for Upload in prompt box */
.upload-preview-area {
  display: flex;
  align-items: center;
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  padding: 5px 10px 5px 5px;
  border-radius: 8px;
  margin-bottom: 4px;
  align-self: flex-start;
  gap: 10px;
  max-width: 100%;
}

body.light-theme .upload-preview-area {
  background-color: rgba(0, 0, 0, 0.02);
}

#upload-preview-image {
  height: 28px;
  width: 28px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--border-color);
}

.upload-preview-overlay {
  display: flex;
  align-items: center;
  gap: 8px;
}

.upload-name {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  max-width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-remove-upload {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  width: 16px;
  height: 16px;
}

.btn-remove-upload:hover {
  color: var(--accent-red);
}

.prompt-action-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
  flex-shrink: 0;
}

body.light-theme .prompt-action-btn {
  background-color: rgba(0, 0, 0, 0.02);
}

.prompt-action-btn:hover {
  background-color: rgba(255, 255, 255, 0.06);
  color: var(--accent-yellow);
  border-color: var(--border-color-hover);
}

body.light-theme .prompt-action-btn:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.prompt-action-btn svg {
  width: 18px;
  height: 18px;
}

.prompt-textarea-wrapper {
  flex-grow: 1;
  min-width: 0;
}

.prompt-textarea {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.1px;
  line-height: 1.55;
  resize: none;
  min-height: 24px;
  max-height: 140px;
  padding: 9px 6px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-color-hover) transparent;
}

.prompt-textarea::-webkit-scrollbar {
  width: 6px;
}

.prompt-textarea::-webkit-scrollbar-track {
  background: transparent;
  margin: 4px 0;
}

.prompt-textarea::-webkit-scrollbar-thumb {
  background: var(--border-color-hover);
  border-radius: 99px;
}

.prompt-textarea::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

.prompt-textarea::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}

.prompt-char-counter {
  display: none;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 6px 7px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

body.mode-audio .prompt-char-counter {
  display: flex;
}

body.mode-music .prompt-char-counter {
  display: flex;
}

.prompt-char-counter.over-limit span:first-child {
  color: #ff6b6b;
  border-color: rgba(255, 107, 107, 0.45);
}

.prompt-char-counter span {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.025);
  white-space: nowrap;
}

.prompt-char-counter span:last-child {
  color: var(--accent-yellow);
  border-color: rgba(var(--accent-yellow-rgb), 0.24);
  background: rgba(var(--accent-yellow-rgb), 0.08);
}

body.light-theme .prompt-char-counter span {
  background: rgba(0, 0, 0, 0.025);
}

/* Generate Button styling */
.btn-generate {
  position: relative;
  background: var(--btn-yellow);
  color: var(--btn-yellow-text);
  border: none;
  border-radius: 999px;
  padding: 0 8px 0 18px;
  height: 44px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.2px;
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform var(--transition-fast), filter var(--transition-fast), box-shadow var(--transition-fast);
}

body.light-theme .btn-generate {
  color: var(--btn-yellow-text);
}

.btn-generate:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
  box-shadow: 0 6px 18px rgba(255, 204, 0, 0.32);
}

body.light-theme .btn-generate:hover {
  filter: brightness(1.02);
  box-shadow: 0 6px 18px rgba(255, 204, 0, 0.3);
}

.btn-generate:active {
  transform: translateY(0);
  filter: brightness(0.98);
}

.btn-generate:disabled {
  cursor: not-allowed;
}

.btn-generate-text {
  position: relative;
  top: 0.5px;
}

.btn-generate-icon {
  width: 16px;
  height: 16px;
  display: block;
  flex-shrink: 0;
}

.btn-generate-cost {
  background-color: rgba(0, 0, 0, 0.16);
  color: #1a1a1a;
  font-weight: 800;
  padding: 0 11px;
  height: 30px;
  border-radius: 999px;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  line-height: 1;
}

.btn-generate-cost .credit-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

body.light-theme .btn-generate-cost {
  color: #1a1a1a;
  background-color: rgba(0, 0, 0, 0.12);
}

.generate-loading-icon {
  width: 16px;
  height: 16px;
  animation: rotate-spinner 1s linear infinite;
  color: #1a1a1a;
}

body.light-theme .generate-loading-icon {
  color: #1a1a1a;
}

/* Media Viewer Lightbox Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 40px;
  animation: fade-in 0.2s ease-out;
}

body.light-theme .modal-overlay {
  background-color: rgba(255, 255, 255, 0.85);
}

@keyframes fade-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.modal-container {
  width: 100%;
  max-width: 1100px;
  background-color: var(--bg-app);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  animation: scale-up 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes scale-up {
  from {
    opacity: 0;
    transform: scale(0.97);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.modal-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
  transition: var(--transition-fast);
}

body.light-theme .modal-close-btn {
  background-color: rgba(0, 0, 0, 0.04);
}

.modal-close-btn:hover {
  background-color: var(--accent-red);
  color: white;
  border-color: var(--accent-red);
}

.modal-content {
  display: flex;
  height: 550px;
  max-height: 80vh;
}

.modal-viewport {
  flex-grow: 1;
  background-color: #000000;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

body.light-theme .modal-viewport {
  background-color: #fcfcfc;
}

#modal-img-display,
#modal-video-display {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.modal-viewport-loader {
  position: absolute;
}

.modal-spinner {
  width: 36px;
  height: 36px;
  border: 2px solid rgba(255, 255, 255, 0.05);
  border-top-color: var(--accent-yellow);
  border-radius: 50%;
  animation: rotate-spinner 0.8s linear infinite;
}

/* Modal sidebar information */
.modal-sidebar {
  width: 340px;
  background-color: var(--bg-sidebar);
  border-left: 1px solid var(--border-color);
  padding: 24px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  flex-shrink: 0;
}

.modal-model-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-model-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text-primary);
}

body.light-theme .modal-model-icon {
  background: rgba(0, 0, 0, 0.05);
}

.modal-model-icon svg {
  width: 18px;
  height: 18px;
}

.modal-meta-tag {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 3px 6px;
  border-radius: 4px;
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  align-self: flex-start;
  margin-top: 6px;
  margin-bottom: 20px;
}

body.light-theme .modal-meta-tag {
  background-color: rgba(0, 0, 0, 0.04);
}

.modal-info-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 20px;
}

.info-sec-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.info-sec-content {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-primary);
  background-color: rgba(255, 255, 255, 0.01);
  padding: 10px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
}

body.light-theme .info-sec-content {
  background-color: rgba(0, 0, 0, 0.01);
}

.modal-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: auto;
}

.info-grid-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cell-label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
}

.cell-value {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 24px;
}

.modal-action-btn {
  width: 100%;
  height: 40px;
  border-radius: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition-fast);
}

.modal-action-btn.primary {
  background-color: var(--text-primary);
  color: var(--bg-app);
  border: none;
}

body.light-theme .modal-action-btn.primary {
  background-color: #111111;
  color: #ffffff;
}

.modal-action-btn.primary:hover {
  background-color: var(--accent-yellow);
}

body.light-theme .modal-action-btn.primary:hover {
  background-color: var(--accent-yellow);
  color: #ffffff;
}

.modal-action-btn.secondary {
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

body.light-theme .modal-action-btn.secondary {
  background-color: rgba(0, 0, 0, 0.02);
  color: var(--text-primary);
}

.modal-action-btn.secondary:hover {
  border-color: var(--text-secondary);
}

.modal-action-btn.danger {
  background-color: rgba(244, 63, 94, 0.08);
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: #f43f5e;
}

.modal-action-btn.danger:hover {
  background-color: var(--accent-red, #f43f5e);
  border-color: var(--accent-red, #f43f5e);
  color: #ffffff;
}

.modal-action-btn svg {
  width: 14px;
  height: 14px;
}

/* ==========================================================================
   Mobile-Responsive Overrides (Professional Mobile-First Design)
   ========================================================================== */

/* Bottom Sheet Component (always in DOM, shown only on mobile) */
.bottom-sheet-backdrop {
  display: none;
}

.bottom-sheet {
  display: none;
}

.mobile-model-trigger {
  display: none;
}

/* ===== Tablet & small-laptop (769px–1200px): keep the 3-column studio
   comfortable so the canvas never gets crushed between the panels. ===== */
@media (min-width: 769px) and (max-width: 1200px) {
  .sidebar {
    width: 220px;
  }

  .sidebar-logo {
    padding: 0 18px;
  }

  .sidebar-menu {
    padding: 20px 12px;
  }

  .controls-panel {
    width: 296px;
    padding: 22px 18px;
  }
}

@media (min-width: 769px) and (max-width: 992px) {
  .sidebar {
    width: 200px;
  }

  .controls-panel {
    width: 270px;
    padding: 18px 14px;
  }

  /* Tighter aspect/dimension tiles so 4 columns still fit cleanly */
  .aspect-ratio-grid {
    gap: 5px;
  }

  .model-combobox {
    padding: 9px 10px;
  }
}

/* ===== Large / ultra-wide screens: cap the controls panel growth and give the
   canvas balanced breathing room so it looks intentional, not stretched. ===== */
@media (min-width: 1700px) {
  .controls-panel {
    width: 360px;
  }

  .sidebar {
    width: 280px;
  }
}

@media (max-width: 768px) {

  /* Prevent horizontal browser scroll and lock canvas layout */
  body {
    position: fixed;
    width: 100vw;
    height: 100dvh;
    overflow: hidden;
  }

  .app-container {
    flex-direction: column;
    height: 100dvh;
    width: 100vw;
  }

  /* ===== HEADER - Compact & Clean ===== */
  .header {
    height: auto;
    min-height: 56px;
    padding: 11px 18px;
    gap: 12px;
    background-color: var(--bg-sidebar);
    border-bottom: 1px solid var(--border-color);
  }

  /* Stronger separation in light mode so the bar reads clearly. */
  body.light-theme .header {
    border-bottom-color: #e2e2e6;
    box-shadow: 0 1px 0 rgba(0, 0, 0, .04), 0 4px 14px rgba(0, 0, 0, .04);
  }

  .header-right {
    gap: 12px;
  }

  .header-title-desktop {
    display: none !important;
  }

  .header-logo-mobile {
    display: flex !important;
    align-items: center;
    gap: 8px;
  }

  .header-logo-mobile .brand-icon {
    width: 20px;
    height: 20px;
  }

  .header-logo-mobile .brand-text {
    font-size: 15px;
  }

  .header-balance-mobile {
    display: flex !important;
    align-items: center;
    gap: 5px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-primary);
  }

  .header-balance-mobile .balance-icon {
    width: 11px;
    height: 11px;
    color: var(--accent-yellow);
  }

  /* Show logout in the mobile header */
  .header-logout-mobile {
    display: flex;
  }

  /* ===== WORKSPACE LAYOUT ===== */
  .workspace-grid {
    flex-direction: column;
    position: relative;
    height: calc(100dvh - 112px);
    overflow: hidden;
  }

  body.tab-generates .workspace-grid {
    padding-bottom: calc(var(--mobile-bottom-nav-height) + env(safe-area-inset-bottom, 0px));
  }

  /* ===== TAB VISIBILITY RULES ===== */
  /* GENERATES tab: settings-focused, no gallery */
  body.tab-generates .controls-panel {
    display: none !important;
  }

  body.tab-generates .main-canvas {
    display: flex !important;
    min-height: 0;
    overflow-y: auto;
  }

  body.tab-generates .canvas-display {
    display: none !important;
  }

  body.tab-generates .prompt-container-wrapper {
    display: block !important;
  }

  body.tab-generates .mobile-model-header {
    display: flex !important;
  }

  body.tab-generates .mobile-generate-settings {
    display: flex !important;
  }

  /* TTS tab: audio library only */
  body.tab-tts .controls-panel {
    display: none !important;
  }

  body.tab-tts .main-canvas {
    display: flex !important;
  }

  body.tab-tts .canvas-display {
    display: none !important;
  }

  body.tab-tts .prompt-container-wrapper {
    display: none !important;
  }

  body.tab-tts .mobile-model-header {
    display: none !important;
  }

  body.tab-tts .mobile-generate-settings {
    display: none !important;
  }

  /* CREATIONS tab: gallery-only, no settings */
  body.tab-creations .controls-panel {
    display: none !important;
  }

  body.tab-creations .main-canvas {
    display: flex !important;
  }

  body.tab-creations .canvas-display {
    display: flex !important;
    padding-bottom: 120px !important;
  }

  body.tab-creations .prompt-container-wrapper {
    display: none !important;
  }

  body.tab-creations .mobile-model-header {
    display: none !important;
  }

  body.tab-creations .mobile-generate-settings {
    display: none !important;
  }

  /* Hide Config tab on mobile */
  #btn-menu-settings {
    display: none !important;
  }

  /* ===== MOBILE MODEL HEADER (Selector Trigger) ===== */
  .mobile-model-header {
    display: flex !important;
    flex-direction: column;
    flex-shrink: 0;
    gap: 10px;
    padding: 12px 16px;
    background-color: var(--bg-sidebar);
    border-bottom: 1px solid var(--border-color);
  }

  .mobile-mode-toggle {
    position: relative;
    display: flex;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    padding: 4px;
    border-radius: 11px;
    overflow: hidden;
  }

  .mobile-mode-toggle .engine-toggle-slider {
    position: absolute;
    top: 4px;
    left: 4px;
    width: calc((100% - 8px) / 3);
    height: calc(100% - 8px);
    border-radius: 8px;
    background: linear-gradient(135deg, #2a2a2a, #111111);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    transform: translateX(0);
    transition: transform 0.38s cubic-bezier(0.34, 1.4, 0.45, 1);
    z-index: 0;
    pointer-events: none;
  }

  .mobile-mode-toggle.video-active .engine-toggle-slider {
    transform: translateX(100%);
  }

  .mobile-mode-toggle.audio-active .engine-toggle-slider {
    transform: translateX(200%);
  }

  .mobile-mode-toggle.music-active .engine-toggle-slider {
    transform: translateX(300%);
  }

  .mobile-mode-toggle .mode-toggle-btn {
    position: relative;
    z-index: 1;
    flex-grow: 1;
    justify-content: center;
    padding: 9px 10px;
    font-size: 12px;
    font-weight: 700;
    border-radius: 8px;
    gap: 6px;
    background: transparent !important;
    border: none !important;
    color: var(--text-secondary);
    transition: color 0.25s ease;
  }

  .mobile-mode-toggle .mode-toggle-btn.active {
    color: #ffffff;
  }

  .mobile-mode-toggle .mode-toggle-btn .toggle-icon {
    width: 13px;
    height: 13px;
    transition: transform 0.25s ease;
  }

  .mobile-mode-toggle .mode-toggle-btn.active .toggle-icon {
    transform: scale(1.08);
  }

  /* Model Trigger Button */
  .mobile-model-trigger {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 10px 14px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: var(--transition-fast);
  }

  /* Selected model's result image as a subtle background (matches desktop) */
  .mobile-model-trigger::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 62%;
    background-image: var(--card-image);
    background-size: cover;
    background-position: center;
    -webkit-mask: linear-gradient(to right, transparent 0%, rgba(0, 0, 0, 0.85) 70%, #000 100%);
    mask: linear-gradient(to right, transparent 0%, rgba(0, 0, 0, 0.85) 70%, #000 100%);
    opacity: 0.32;
    filter: saturate(0.85) brightness(0.95);
    pointer-events: none;
    z-index: 0;
  }

  body.light-theme .mobile-model-trigger::after {
    opacity: 0.2;
  }

  .mobile-model-trigger .model-trigger-left,
  .mobile-model-trigger .model-trigger-chevron {
    position: relative;
    z-index: 1;
  }

  .mobile-model-trigger:active {
    background-color: var(--bg-card-hover);
    border-color: var(--accent-yellow);
  }

  .model-trigger-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  .model-trigger-name {
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 700;
    color: var(--accent-yellow);
  }

  .model-trigger-cost {
    font-size: 10px;
    color: var(--text-secondary);
    font-weight: 500;
  }

  .model-trigger-chevron {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    transition: transform var(--transition-fast);
  }

  .mobile-model-trigger:active .model-trigger-chevron {
    transform: rotate(180deg);
  }

  /* ===== INLINE PARAMS STRIP (Mobile Generate Screen) ===== */
  .mobile-params-strip {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding: 2px 0;
  }

  .mobile-params-strip::-webkit-scrollbar {
    display: none;
  }

  .param-pills {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
  }

  .param-pills-divider {
    width: 1px;
    height: 20px;
    background-color: var(--border-color);
    flex-shrink: 0;
  }

  .pill {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-family: var(--font-ui);
    font-size: 11px;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 16px;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition-fast);
    flex-shrink: 0;
  }

  .pill:active {
    transform: scale(0.95);
  }

  .pill.active {
    background-color: var(--accent-yellow);
    border-color: var(--accent-yellow);
    color: #000000;
  }

  body.light-theme .pill.active {
    color: #ffffff;
  }

  /* ===== MOBILE GENERATE SETTINGS (Full params on Generates tab) ===== */
  .mobile-generate-settings {
    display: none;
    flex-direction: column;
    flex: 0 0 auto;
    overflow: visible;
    -webkit-overflow-scrolling: touch;
    padding: 0;
  }

  .mobile-settings-scroll {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
  }

  .mobile-setting-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .setting-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .setting-card-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
  }

  .setting-card-value {
    font-size: 13px;
    font-weight: 700;
    color: var(--accent-yellow);
    font-family: var(--font-display);
  }

  .mobile-setting-card .param-slider {
    margin: 4px 0 !important;
  }

  .mobile-setting-card .slider-bounds {
    font-size: 9px;
    margin-top: -2px;
  }

  .mobile-setting-card .text-input,
  .mobile-setting-card .textarea-input {
    font-size: 13px;
    padding: 10px 12px;
    border-radius: 8px;
  }

  .mobile-setting-card .textarea-input {
    min-height: 60px;
  }

  .mobile-setting-card .btn-text-link {
    font-size: 11px;
    color: var(--accent-yellow);
    font-weight: 600;
  }

  /* ===== BOTTOM SHEET ===== */
  .bottom-sheet-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
  }

  .bottom-sheet-backdrop.visible {
    opacity: 1;
    pointer-events: auto;
  }

  body.light-theme .bottom-sheet-backdrop {
    background-color: rgba(0, 0, 0, 0.3);
  }

  .bottom-sheet {
    display: flex;
    flex-direction: column;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 75dvh;
    background-color: var(--bg-sidebar);
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    border: 1px solid var(--border-color);
    border-bottom: none;
    z-index: 2001;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.3);
    overflow: hidden;
  }

  body.light-theme .bottom-sheet {
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.08);
  }

  .bottom-sheet.open {
    transform: translateY(0);
  }

  .bottom-sheet-handle {
    width: 36px;
    height: 4px;
    flex-shrink: 0;
    touch-action: none;
    background-color: var(--text-muted);
    border-radius: 2px;
    margin: 10px auto 0 auto;
    opacity: 0.5;
  }

  .bottom-sheet-header {
    display: flex;
    flex-shrink: 0;
    touch-action: none;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px 10px 20px;
    border-bottom: 1px solid var(--border-color);
  }

  .bottom-sheet-title {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
  }

  .bottom-sheet-close {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
  }

  body.light-theme .bottom-sheet-close {
    background-color: rgba(0, 0, 0, 0.04);
  }

  .bottom-sheet-close:active {
    background-color: var(--accent-red);
    color: white;
    border-color: var(--accent-red);
  }

  .bottom-sheet-close svg {
    width: 14px;
    height: 14px;
  }

  .bottom-sheet-body {
    min-height: 0;
    padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px));
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  /* Bottom sheet model cards */
  .sheet-model-card {
    --card-image: url('images/gen-img-1.jpg');
    display: flex;
    flex-shrink: 0;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: rgba(18, 18, 18, 0.45);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
  }

  .sheet-model-card:active {
    transform: scale(0.98);
  }

  /* Realistic result image background (matches desktop model cards) */
  .sheet-model-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 56%;
    background-image: var(--card-image);
    background-size: cover;
    background-position: center;
    -webkit-mask: linear-gradient(to right, transparent 0%, rgba(0, 0, 0, 0.85) 65%, #000 100%);
    mask: linear-gradient(to right, transparent 0%, rgba(0, 0, 0, 0.85) 65%, #000 100%);
    opacity: 0.28;
    filter: saturate(0.8) brightness(0.92) contrast(0.95);
    z-index: 0;
    pointer-events: none;
  }

  .sheet-model-card.active::after {
    opacity: 0.4;
  }

  body.light-theme .sheet-model-card::after {
    opacity: 0.16;
  }

  .sheet-model-card.active {
    border-color: var(--accent-yellow);
    background: rgba(30, 30, 30, 0.7);
    box-shadow: 0 4px 20px rgba(var(--accent-yellow-rgb), 0.1);
  }

  body.light-theme .sheet-model-card {
    background: rgba(255, 255, 255, 0.65);
    border-color: rgba(0, 0, 0, 0.08);
  }

  body.light-theme .sheet-model-card.active {
    background: rgba(255, 249, 230, 0.85);
  }

  .sheet-model-logo {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--text-secondary);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
  }

  body.light-theme .sheet-model-logo {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.05);
  }

  .sheet-model-card.active .sheet-model-logo {
    transform: scale(1.05);
    box-shadow: 0 0 10px rgba(var(--accent-yellow-rgb), 0.1);
  }

  /* Custom Provider Colors for Mobile Logos */
  .sheet-model-card[data-model*="gpt"] .sheet-model-logo {
    color: #10a37f !important;
    background: rgba(16, 163, 127, 0.08) !important;
    border-color: rgba(16, 163, 127, 0.15) !important;
  }

  .sheet-model-card[data-model*="banana"] .sheet-model-logo {
    color: #f4b400 !important;
    background: rgba(244, 180, 0, 0.08) !important;
    border-color: rgba(244, 180, 0, 0.15) !important;
  }

  .sheet-model-card[data-model*="seedance"] .sheet-model-logo {
    color: #fe2c55 !important;
    background: linear-gradient(135deg, rgba(0, 242, 234, 0.1), rgba(254, 44, 85, 0.1)) !important;
    border-color: rgba(254, 44, 85, 0.15) !important;
  }

  .sheet-model-card[data-model*="kling"] .sheet-model-logo {
    color: #8b5cf6 !important;
    background: rgba(139, 92, 246, 0.08) !important;
    border-color: rgba(139, 92, 246, 0.15) !important;
  }

  .sheet-model-card[data-model*="veo"] .sheet-model-logo,
  .sheet-model-card[data-model*="gemini"] .sheet-model-logo {
    color: #4285f4 !important;
    background: rgba(66, 133, 244, 0.08) !important;
    border-color: rgba(66, 133, 244, 0.15) !important;
  }

  .sheet-model-card[data-model*="tts"] .sheet-model-logo {
    color: var(--accent-yellow) !important;
    background: rgba(var(--accent-yellow-rgb), 0.08) !important;
    border-color: rgba(var(--accent-yellow-rgb), 0.16) !important;
  }

  .sheet-model-logo svg {
    width: 20px;
    height: 20px;
  }

  .sheet-model-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    position: relative;
    z-index: 1;
  }

  .sheet-model-name {
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
  }

  .sheet-model-card.active .sheet-model-name {
    color: var(--accent-yellow);
  }

  .sheet-model-desc {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .sheet-model-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
  }

  .sheet-model-cost {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    background-color: rgba(255, 255, 255, 0.04);
    padding: 3px 8px;
    border-radius: 6px;
  }

  body.light-theme .sheet-model-cost {
    background-color: rgba(0, 0, 0, 0.04);
  }

  .sheet-model-card.active .sheet-model-cost {
    background-color: var(--accent-yellow);
    color: #000000;
  }

  body.light-theme .sheet-model-card.active .sheet-model-cost {
    color: #ffffff;
  }

  .sheet-model-check {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }

  .sheet-model-card.active .sheet-model-check {
    background-color: var(--accent-yellow);
    border-color: var(--accent-yellow);
  }

  .sheet-model-check svg {
    width: 10px;
    height: 10px;
    color: #000;
    display: none;
  }

  .sheet-model-card.active .sheet-model-check svg {
    display: block;
  }

  /* ===== MAIN CANVAS ===== */
  .main-canvas {
    height: 100%;
    width: 100vw;
    padding-bottom: 0;
  }

  .canvas-display {
    padding: 12px;
    padding-bottom: 120px;
    scroll-behavior: smooth;
  }

  /* Creations tab — gallery-focused layout */
  body.tab-creations .canvas-display {
    padding: 16px 12px 120px 12px !important;
  }

  body.tab-creations .empty-state h3 {
    font-size: 16px;
  }

  body.tab-creations .empty-state p {
    font-size: 12px;
  }

  /* ===== MASONRY GALLERY ===== */
  .output-grid {
    display: flex !important;
    align-items: flex-start;
    gap: 10px !important;
    width: 100%;
  }

  .masonry-col {
    gap: 10px;
  }

  .gallery-feedback {
    margin-top: 16px;
    align-items: flex-start;
    flex-direction: column;
  }

  .gallery-retry-btn {
    width: 100%;
  }

  .gallery-pagination {
    margin-top: 20px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .gallery-page-nav {
    width: 100%;
    padding: 0 10px;
  }

  .gallery-page-buttons {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: center;
  }

  .gallery-page-number {
    width: 36px;
  }

  .gallery-page-summary {
    grid-column: 1 / -1;
  }

  .output-card {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  }

  body.light-theme .output-card {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  }

  .output-card[data-aspect="tall"] .card-viewport {
    aspect-ratio: 3/4;
  }

  .output-card[data-aspect="square"] .card-viewport {
    aspect-ratio: 1/1;
  }

  .output-card[data-aspect="wide"] .card-viewport {
    aspect-ratio: 4/3;
  }

  .output-card[data-aspect="video"] .card-viewport {
    aspect-ratio: 16/9;
  }

  .card-viewport {
    width: 100%;
    position: relative;
  }

  .card-prompt {
    display: none !important;
  }

  .card-details-footer {
    padding: 8px 10px;
  }

  .card-model-name {
    font-size: 10px;
  }

  .card-time {
    font-size: 9px;
  }

  /* Generating card in masonry */
  .generating-card {
    break-inside: avoid;
    margin-bottom: 10px;
    display: flex !important;
    width: 100%;
    aspect-ratio: 1/1;
    border-radius: 12px;
  }

  /* Gallery entry animation */
  .output-card {
    animation: card-appear 0.35s ease both;
  }

  @keyframes card-appear {
    from {
      opacity: 0;
      transform: translateY(12px) scale(0.97);
    }

    to {
      opacity: 1;
      transform: translateY(0) scale(1);
    }
  }

  /* ===== BOTTOM NAVIGATION - Frosted Glass ===== */
  :root {
    --mobile-bottom-nav-height: 72px;
    --tts-mobile-player-reserve: 148px;
  }

  .sidebar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100vw;
    height: calc(var(--mobile-bottom-nav-height) + env(safe-area-inset-bottom, 0px));
    flex-direction: row;
    border-right: none;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    align-items: center;
    background-color: rgba(13, 13, 13, 0.85);
    backdrop-filter: blur(20px) saturate(1.5);
    -webkit-backdrop-filter: blur(20px) saturate(1.5);
    z-index: 1000;
  }

  body.light-theme .sidebar {
    background-color: rgba(255, 255, 255, 0.85);
    border-top-color: rgba(0, 0, 0, 0.06);
  }

  .sidebar-logo,
  .sidebar-balance,
  .sidebar-user {
    display: none !important;
  }

  .sidebar-menu {
    flex-direction: row;
    height: var(--mobile-bottom-nav-height);
    padding: 0;
    width: 100%;
    justify-content: space-around;
    align-items: center;
    gap: 0;
  }

  .menu-item {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 6px 16px;
    width: auto;
    min-width: 64px;
    height: auto;
    font-size: 10px;
    font-weight: 500;
    border: none !important;
    background: transparent !important;
    color: var(--text-muted);
    border-radius: 0;
    position: relative;
  }

  .menu-item.active {
    color: var(--accent-yellow) !important;
  }

  /* Reveal the mobile-only nav entries in the bottom bar. */
  .nav-mobile-only {
    display: flex !important;
  }

  /* With up to 4–5 items, tighten spacing so the bar never overflows. */
  .sidebar-menu .menu-item {
    min-width: 0;
    flex: 1 1 0;
    padding: 6px 4px;
  }

  .menu-item.active::after {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    background-color: var(--accent-yellow);
    border-radius: 0 0 3px 3px;
  }

  .menu-icon {
    width: 20px;
    height: 20px;
  }

  /* ===== PANEL MOBILE HEADER HIDE ===== */
  .panel-header-mobile {
    display: none !important;
  }

  /* ===== CONFIG TAB - Mobile Card Carousel ===== */
  .model-cards-list {
    flex-direction: row !important;
    overflow-x: auto !important;
    scroll-snap-type: x mandatory;
    gap: 10px !important;
    padding: 8px 2px 16px 2px !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .model-cards-list::-webkit-scrollbar {
    display: none !important;
  }

  .model-cards-list .model-card {
    scroll-snap-align: start;
    flex-shrink: 0;
    width: 250px !important;
    margin-bottom: 0 !important;
    padding: 10px !important;
    border-radius: 10px;
  }

  /* Touch Targets for Parameters */
  .aspect-btn {
    padding: 12px 6px !important;
    border-radius: 8px;
  }

  .batch-btn,
  .dur-btn,
  .fps-btn {
    padding: 10px 0 !important;
    font-size: 12px;
  }

  /* Enlarged Sliders for Mobile */
  .param-slider {
    margin: 12px 0 !important;
  }

  .param-slider::-webkit-slider-thumb {
    width: 22px !important;
    height: 22px !important;
    margin-top: -9px !important;
    background: var(--accent-yellow) !important;
    border: 2px solid var(--bg-app) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  }

  .param-slider::-webkit-slider-runnable-track {
    height: 6px !important;
    border-radius: 3px !important;
  }

  /* The prompt follows settings in the same scrollable page. */
  .prompt-container-wrapper {
    position: relative;
    width: 100%;
    padding: 0 16px 20px;
    background: transparent;
    border-top: none;
    z-index: auto;
  }

  .prompt-container {
    border-radius: 16px;
    padding: 6px 6px 6px 10px;
    pointer-events: auto;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: none;
  }

  body.light-theme .prompt-container {
    background-color: var(--bg-card);
  }

  .prompt-container:focus-within {
    border-color: var(--accent-yellow);
    box-shadow: 0 0 0 2px rgba(255, 204, 0, 0.15);
  }

  body.light-theme .prompt-container:focus-within {
    box-shadow: 0 0 0 2px rgba(197, 150, 0, 0.12);
  }

  .prompt-input-row {
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    padding: 2px;
  }

  /* Comfortable chat-style composer on mobile: the text area gets its own
     full-width row on top, with the upload + generate buttons on a second
     row below. Removes the cramped "squeezed between two buttons" feel. */
  .prompt-input-row > .prompt-textarea-wrapper {
    order: -1;
    flex: 1 1 100%;
    width: 100%;
  }

  .prompt-input-row > .prompt-action-btn {
    order: 1;
  }

  .prompt-input-row > .btn-generate {
    order: 2;
    margin-left: auto;
  }

  /* Subtle divider so the negative prompt reads as its own field instead of
     looking like overflowing/scrolled text. */
  .prompt-textarea-wrapper .negative-prompt-input {
    border-top: 1px solid var(--border-color);
    padding-top: 8px;
    margin-top: 2px;
  }

  /* Voice Over composer: park the character / block counter as a full-width
     footer that fills the empty space under the text, reading as meta info
     instead of cramped chips floating mid-card. */
  body.mode-audio .prompt-textarea-wrapper {
    min-height: 96px;
  }

  body.mode-audio .prompt-char-counter {
    margin-top: auto;
    width: 100%;
    justify-content: flex-start;
    gap: 8px;
    padding-top: 9px;
    border-top: 1px solid var(--border-color);
  }

  /* Compact mobile player: track info + actions on top, transport below. */
  .tts-library-player {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "info actions"
      "center center";
    gap: 10px 10px;
    min-height: auto;
    margin: 0;
    padding: 10px 12px 12px;
    border-radius: 0;
  }

  .tts-player-info {
    grid-area: info;
    gap: 10px;
  }

  .tts-player-actions {
    grid-area: actions;
  }

  .tts-player-center {
    grid-area: center;
    flex-direction: row;
    width: 100%;
    gap: 10px;
  }

  .tts-player-art {
    width: 42px;
    height: 42px;
  }

  .prompt-action-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background-color: rgba(255, 255, 255, 0.04);
    display: flex;
    align-items: center;
    justify-content: center;
  }

  body.light-theme .prompt-action-btn {
    background-color: rgba(0, 0, 0, 0.04);
  }

  .prompt-action-btn svg {
    width: 16px;
    height: 16px;
  }

  .prompt-textarea {
    font-size: 16px;
    padding: 8px 2px;
    min-height: 40px;
    max-height: 104px;
    overflow-y: auto;
    scrollbar-width: none;
  }

  .prompt-textarea::-webkit-scrollbar {
    display: none;
  }

  .prompt-textarea::placeholder {
    font-size: 16px;
  }

  /* Negative prompt is secondary: keep the input at 16px (so iOS doesn't
     zoom on focus) but render its placeholder smaller/muted so the main
     prompt stays the prominent one. */
  .negative-prompt-input::placeholder {
    font-size: 13px;
  }

  /* Mobile: keep a compact pill that still shows credit consumption */
  .btn-generate {
    width: auto;
    height: 38px;
    padding: 0 6px 0 12px;
    border-radius: 999px;
    justify-content: center;
    gap: 7px;
    flex-shrink: 0;
  }

  .btn-generate-text {
    display: none !important;
  }

  .btn-generate-cost {
    display: inline-flex !important;
    height: 26px;
    padding: 0 9px;
    font-size: 11.5px;
  }

  .btn-generate-cost .credit-icon {
    width: 13px;
    height: 13px;
  }

  .btn-generate-icon:not(.hidden) {
    display: block !important;
    width: 16px;
    height: 16px;
  }

  .generate-loading-icon {
    width: 16px;
    height: 16px;
  }

  /* ===== KLING REQUIREMENTS - Mobile ===== */
  .kling-requirements-container {
    margin: 8px 12px 8px 12px;
    padding: 12px;
    border-radius: 10px;
  }

  .kling-req-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .kling-upload-slot {
    height: 80px;
    border-radius: 8px;
  }

  /* ===== LIGHTBOX MODAL - Mobile ===== */
  .modal-overlay {
    padding: 0 0 calc(75px + env(safe-area-inset-bottom, 0px)) 0;
    align-items: flex-end;
  }

  .modal-container {
    max-height: calc(100dvh - 75px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 16px);
    border-radius: 20px 20px 0 0;
    border-bottom: none;
  }

  .modal-content {
    height: auto;
    flex-direction: column;
    overflow-y: auto;
  }

  .modal-viewport {
    height: auto;
    aspect-ratio: 1/1;
    width: 100%;
    border-radius: 0;
  }

  .modal-sidebar {
    width: 100%;
    padding: 16px;
    border-left: none;
    border-top: 1px solid var(--border-color);
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  }

  .modal-close-btn {
    top: 10px;
    right: 12px;
    width: 32px;
    height: 32px;
    background-color: rgba(0, 0, 0, 0.55);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 20;
  }

  body.light-theme .modal-close-btn {
    background-color: rgba(0, 0, 0, 0.55);
    color: #fff;
  }

  .modal-model-title {
    font-size: 18px;
  }

  .modal-info-grid {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
  }

  .modal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 16px;
  }

  .modal-action-btn {
    width: 100%;
    min-width: 0;
    height: 42px;
    font-size: 12px;
    border-radius: 12px;
  }

  #btn-modal-download-cdn,
  #btn-modal-download {
    grid-column: 1 / -1;
    height: 46px;
  }
}

/* =========================================
   LANDING PAGE STYLES (ENTERPRISE)
   ========================================= */
/* Base Buttons (Enterprise Custom) */
.btn-primary {
  background-color: var(--btn-yellow);
  color: var(--btn-yellow-text);
  border: 1px solid var(--btn-yellow);
  padding: 10px 24px;
  font-weight: 600;
  font-size: 14.5px;
  border-radius: 10px;
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: all var(--transition-fast);
}

.btn-primary:hover {
  background-color: #ffe066;
  border-color: #ffe066;
  color: #000;
}

.btn-secondary {
  background-color: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  padding: 10px 24px;
  font-weight: 600;
  font-size: 14.5px;
  border-radius: 10px;
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: all var(--transition-fast);
}

.btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.08);
  border-color: var(--border-color-hover);
}

body.light-theme .btn-secondary {
  background-color: rgba(0, 0, 0, 0.02);
  border-color: var(--border-color);
}

body.light-theme .btn-secondary:hover {
  background-color: rgba(0, 0, 0, 0.05);
  border-color: var(--border-color-hover);
}

body.page-landing {
  background-color: var(--bg-app);
  font-family: var(--font-ui);
  line-height: 1.5;
  color: var(--text-primary);
  position: relative;
  height: auto !important;
  width: 100% !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
}

/* Base Landing Layout Container */
.landing-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Background Glowing Spots */
.landing-bg-glow {
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 204, 0, 0.08) 0%, rgba(255, 107, 0, 0.02) 50%, rgba(0, 0, 0, 0) 70%);
  filter: blur(80px);
  z-index: 1;
  pointer-events: none;
}

.landing-bg-glow.glow-1 {
  top: -100px;
  right: -100px;
  animation: floatGlow 15s infinite alternate ease-in-out;
}

.landing-bg-glow.glow-2 {
  top: 600px;
  left: -200px;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(255, 204, 0, 0.05) 0%, rgba(255, 204, 0, 0.01) 60%, rgba(0, 0, 0, 0) 80%);
  animation: floatGlow 20s infinite alternate-reverse ease-in-out 2s;
}

.landing-bg-glow.glow-3 {
  bottom: 200px;
  right: -100px;
  width: 550px;
  height: 550px;
  background: radial-gradient(circle, rgba(255, 107, 0, 0.04) 0%, rgba(255, 204, 0, 0.01) 50%, rgba(0, 0, 0, 0) 75%);
}

@keyframes floatGlow {
  0% {
    transform: translate(0, 0) scale(1);
  }

  100% {
    transform: translate(40px, 60px) scale(1.1);
  }
}

/* Decorative Grid Background overlay */
.landing-grid-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  background-size: 50px 50px;
  z-index: 2;
  pointer-events: none;
}

body.light-theme .landing-grid-overlay {
  background-image: linear-gradient(rgba(0, 0, 0, 0.01) 1px, transparent 1px), linear-gradient(90deg, rgba(0, 0, 0, 0.01) 1px, transparent 1px);
}

/* Navigation Bar */
.landing-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 80px;
  display: flex;
  align-items: center;
  z-index: 1000;
  background: rgba(5, 5, 5, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: background-color var(--transition-normal);
}

body.light-theme .landing-nav {
  background: rgba(245, 245, 247, 0.6);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.landing-nav .landing-nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.landing-nav .nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.landing-nav .brand-icon {
  width: 26px;
  height: 26px;
  color: var(--accent-yellow);
}

.landing-nav .brand-text {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.landing-nav .nav-links {
  display: flex;
  gap: 36px;
}

.landing-nav .nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  transition: var(--transition-fast);
  position: relative;
  padding: 8px 0;
}

.landing-nav .nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--accent-yellow);
  transition: width var(--transition-fast);
}

.landing-nav .nav-links a:hover {
  color: var(--text-primary);
}

.landing-nav .nav-links a:hover::after {
  width: 100%;
}

.landing-nav .nav-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.landing-nav .btn-theme-toggle {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.landing-nav .btn-theme-toggle:hover {
  background-color: rgba(255, 255, 255, 0.05);
  border-color: var(--border-color-hover);
}

body.light-theme .landing-nav .btn-theme-toggle:hover {
  background-color: rgba(0, 0, 0, 0.03);
}

.landing-nav .btn-login-link {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  padding: 8px 16px;
  border-radius: 8px;
  transition: var(--transition-fast);
}

.landing-nav .btn-login-link:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

body.light-theme .landing-nav .btn-login-link:hover {
  background-color: rgba(0, 0, 0, 0.03);
}

.landing-nav .cta-short {
  display: none;
}

/* Mobile Hamburger Menu */
.btn-mobile-menu {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 4px;
}

/* Hero Section */
.hero-section {
  min-height: 90vh;
  display: flex;
  align-items: center;
  padding: 140px 0 80px 0;
  position: relative;
  z-index: 10;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 60px;
  align-items: center;
  width: 100%;
}

.hero-content {
  text-align: left;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 204, 0, 0.07);
  color: var(--accent-yellow);
  border: 1px solid rgba(255, 204, 0, 0.15);
  padding: 8px 16px;
  border-radius: 30px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 28px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.hero-title {
  font-family: var(--font-display);
  font-size: 64px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
  overflow-wrap: break-word;
  word-break: break-word;
}

.hero-title .text-gradient {
  background: linear-gradient(135deg, #ffcc00 0%, #ff8800 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 18px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 40px;
  max-width: 520px;
}

.hero-buttons {
  display: flex;
  gap: 16px;
  align-items: center;
}

.btn-large {
  padding: 16px 36px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 12px;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary.btn-large:hover {
  transform: translateY(-2px);
  box-shadow: var(--glow-shadow);
}

.btn-secondary.btn-large {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

.btn-secondary.btn-large:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--border-color-hover);
  transform: translateY(-2px);
}

body.light-theme .btn-secondary.btn-large {
  background: rgba(0, 0, 0, 0.02);
}

body.light-theme .btn-secondary.btn-large:hover {
  background: rgba(0, 0, 0, 0.05);
}

/* High Fidelity Browser Mockup for Hero */
.hero-visual {
  width: 100%;
  display: flex;
  justify-content: center;
}

.mockup-window {
  width: 100%;
  background-color: #0e0e0e;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.6), 0 0 40px rgba(255, 204, 0, 0.03);
  transform: perspective(1000px) rotateY(-8deg) rotateX(4deg) translateZ(0);
  transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

body.light-theme .mockup-window {
  background-color: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.15);
}

.mockup-window:hover {
  transform: perspective(1000px) rotateY(0deg) rotateX(0deg) scale(1.02);
  border-color: rgba(255, 204, 0, 0.2);
}

.mockup-header {
  height: 44px;
  background-color: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 8px;
}

body.light-theme .mockup-header {
  background-color: rgba(0, 0, 0, 0.01);
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.mockup-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.mockup-dot.red {
  background-color: #ff5f56;
}

.mockup-dot.yellow {
  background-color: #ffbd2e;
}

.mockup-dot.green {
  background-color: #27c93f;
}

.mockup-body {
  background: #080808;
  display: flex;
  height: 320px;
  overflow: hidden;
}

body.light-theme .mockup-body {
  background: #f8f9fa;
}

.mockup-sidebar {
  width: 80px;
  background-color: rgba(255, 255, 255, 0.01);
  border-right: 1px solid rgba(255, 255, 255, 0.04);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 0;
  gap: 24px;
}

body.light-theme .mockup-sidebar {
  border-right: 1px solid rgba(0, 0, 0, 0.05);
}

.mockup-sidebar-item {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background-color: rgba(255, 255, 255, 0.03);
  display: flex;
  align-items: center;
  justify-content: center;
}

.mockup-sidebar-item.active {
  background-color: var(--accent-yellow);
  color: #000;
}

.mockup-sidebar-item svg {
  width: 16px;
  height: 16px;
  color: var(--text-secondary);
}

.mockup-sidebar-item.active svg {
  color: #000;
}

.mockup-content {
  flex-grow: 1;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.mockup-prompt-bar {
  display: flex;
  gap: 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  padding: 10px 14px;
  border-radius: 10px;
  align-items: center;
}

body.light-theme .mockup-prompt-bar {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.mockup-prompt-text {
  font-size: 11px;
  color: var(--text-secondary);
  flex-grow: 1;
  font-family: var(--font-ui);
  text-align: left;
}

.mockup-prompt-badge {
  background: rgba(255, 204, 0, 0.1);
  color: var(--accent-yellow);
  font-size: 9px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
}

.mockup-btn-gen {
  background-color: var(--accent-yellow);
  color: #000;
  font-size: 10px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 6px;
  border: none;
}

.mockup-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  flex-grow: 1;
}

.mockup-grid-item {
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.mockup-grid-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.mockup-grid-item:hover img {
  transform: scale(1.1);
}

.mockup-item-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0) 60%);
  opacity: 0;
  transition: opacity 0.3s;
  display: flex;
  align-items: flex-end;
  padding: 10px;
}

.mockup-grid-item:hover .mockup-item-overlay {
  opacity: 1;
}

.mockup-item-tag {
  font-size: 8px;
  color: #fff;
  background: rgba(255, 255, 255, 0.2);
  padding: 2px 6px;
  border-radius: 4px;
  backdrop-filter: blur(4px);
}

/* Trust Bar / Clients Logos */
.trust-section {
  padding: 60px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.015) 50%, rgba(255, 255, 255, 0) 100%);
  text-align: center;
}

body.light-theme .trust-section {
  border-top: 1px solid rgba(0, 0, 0, 0.04);
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.01) 50%, rgba(0, 0, 0, 0) 100%);
}

.trust-title {
  font-size: 13px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 600;
  margin-bottom: 30px;
}

.trust-logos {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 60px;
  flex-wrap: wrap;
}

.trust-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0.85;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
  color: var(--text-primary);
}

.trust-logo:hover {
  opacity: 1;
  transform: translateY(-2px);
}

.trust-logo svg {
  width: 24px;
  height: 24px;
}

.trust-logo span {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

/* Features Section */
.features-section {
  padding: 120px 0;
  position: relative;
}

.section-header {
  text-align: center;
  max-width: 650px;
  margin: 0 auto 70px auto;
}

.section-header .section-badge {
  color: var(--accent-yellow);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 12px;
  display: inline-block;
}

.section-title-large {
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.25;
  color: var(--text-primary);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

.feature-card {
  background-color: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.03);
  padding: 48px 36px;
  border-radius: 20px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

body.light-theme .feature-card {
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.feature-card:hover {
  transform: translateY(-8px);
  border-color: rgba(255, 204, 0, 0.3);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

body.light-theme .feature-card:hover {
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.06);
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--accent-yellow) 0%, transparent 100%);
  opacity: 0;
  transition: opacity 0.3s;
}

.feature-card:hover::before {
  opacity: 1;
}

.feature-icon {
  width: 52px;
  height: 52px;
  background: rgba(255, 204, 0, 0.06);
  color: var(--accent-yellow);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 28px;
  border: 1px solid rgba(255, 204, 0, 0.1);
  transition: all 0.3s ease;
}

.feature-card:hover .feature-icon {
  background: var(--accent-yellow);
  color: #000;
  transform: scale(1.05);
}

.feature-card h3 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 16px;
}

.feature-card p {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
}

/* Models Showcase Section */
.models-section {
  padding: 120px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.03);
}

body.light-theme .models-section {
  border-top: 1px solid rgba(0, 0, 0, 0.04);
}

.models-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-top: 20px;
}

.model-card {
  background-color: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body.light-theme .model-card {
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.model-card:hover {
  transform: translateY(-5px);
  border-color: rgba(255, 204, 0, 0.2);
}

.model-thumbnail {
  height: 200px;
  overflow: hidden;
  position: relative;
  background-color: #111;
}

.model-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.model-card:hover .model-thumbnail img {
  transform: scale(1.05);
}

.model-badge {
  position: absolute;
  top: 16px;
  left: 16px;
  background-color: rgba(5, 5, 5, 0.7);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
}

.model-info {
  padding: 30px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.model-info h3 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 8px;
}

.model-type {
  font-size: 12px;
  color: var(--accent-yellow);
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 16px;
  letter-spacing: 0.5px;
}

.model-desc {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 24px;
  flex-grow: 1;
}

.model-specs {
  display: flex;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  padding-top: 20px;
  gap: 20px;
}

body.light-theme .model-specs {
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.spec-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.spec-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.spec-val {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

/* Pricing Section (Landing Page Specific Inline) */
.pricing-section {
  padding: 120px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.03);
  position: relative;
}

body.light-theme .pricing-section {
  border-top: 1px solid rgba(0, 0, 0, 0.04);
}

/* CTA Callout Banner */
.cta-section {
  padding: 100px 0;
}

.cta-banner {
  background: linear-gradient(135deg, rgba(25, 25, 25, 0.7) 0%, rgba(10, 10, 10, 0.9) 100%);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 28px;
  padding: 80px 40px;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
}

body.light-theme .cta-banner {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.8) 0%, rgba(245, 245, 247, 0.9) 100%);
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.05);
}

.cta-banner::after {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(255, 204, 0, 0.05) 0%, transparent 60%);
  bottom: -200px;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
}

.cta-title {
  font-family: var(--font-display);
  font-size: 44px;
  font-weight: 800;
  margin-bottom: 20px;
  letter-spacing: -0.01em;
}

.cta-subtitle {
  color: var(--text-secondary);
  font-size: 18px;
  max-width: 580px;
  margin: 0 auto 36px auto;
  line-height: 1.6;
}

/* Footer Styles */
.landing-footer {
  padding: 60px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.03);
  background-color: #030303;
}

body.light-theme .landing-footer {
  border-top: 1px solid rgba(0, 0, 0, 0.04);
  background-color: #fafafa;
}

.footer-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.footer-brand {
  text-align: left;
}

.footer-brand .brand-text {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 8px;
  display: inline-block;
}

.footer-brand p {
  color: var(--text-muted);
  font-size: 13px;
}

.footer-links {
  font-size: 13px;
  color: var(--text-muted);
}


/* =========================================
   AUTH PAGES STYLES (MODERN SPLIT-SCREEN)
   ========================================= */
body.page-auth {
  background-color: var(--bg-app);
  font-family: var(--font-ui);
  color: var(--text-primary);
  height: auto !important;
  width: 100% !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  margin: 0;
}

/* Split-screen container */
.auth-split-container {
  display: flex;
  min-height: 100vh;
  width: 100vw;
  position: relative;
}

/* Form panel (Left Side) */
.auth-side-form {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 40px 60px;
  background-color: var(--bg-app);
  position: relative;
  z-index: 10;
  overflow-y: auto;
}

.auth-form-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text-primary);
}

.auth-logo .brand-icon {
  width: 24px;
  height: 24px;
  color: var(--accent-yellow);
}

.auth-logo .brand-text {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
}

.auth-back-home {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: color var(--transition-fast);
}

.auth-back-home:hover {
  color: var(--text-primary);
}

.auth-back-home svg {
  width: 14px;
  height: 14px;
}

.auth-form-body {
  max-width: 400px;
  width: 100%;
  margin: auto;
}

.auth-title-row {
  margin-bottom: 32px;
}

.auth-title-row h1 {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.auth-title-row p {
  color: var(--text-secondary);
  font-size: 14px;
}

/* Enterprise Sleek Auth Inputs */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.password-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.forgot-password {
  font-size: 12px;
  color: var(--accent-yellow);
  text-decoration: none;
  font-weight: 500;
}

.forgot-password:hover {
  text-decoration: underline;
}

/* Input Icon Wrapper */
.input-icon-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon-wrapper svg {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
  transition: color var(--transition-fast);
}

.input-icon-wrapper input {
  width: 100%;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 14px 16px 14px 44px;
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: 14px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.input-icon-wrapper input:focus {
  outline: none;
  border-color: var(--accent-yellow);
  box-shadow: 0 0 0 3px rgba(255, 204, 0, 0.1);
}

.input-icon-wrapper input:focus+svg {
  color: var(--accent-yellow);
}

.auth-submit-btn {
  margin-top: 8px;
  padding: 14px;
  font-size: 14px;
  font-weight: 700;
  border-radius: 12px;
  cursor: pointer;
  border: none;
}

.auth-submit-btn:hover {
  transform: translateY(-1px);
}

/* Auth Divider */
.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 24px 0;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-color);
}

.auth-divider span {
  padding: 0 16px;
}

/* Social Buttons */
.social-login {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.btn-social {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 13px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.btn-social[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

body.light-theme .btn-social {
  background-color: #ffffff;
}

.btn-social:hover {
  background-color: rgba(255, 255, 255, 0.06);
  border-color: var(--border-color-hover);
}

body.light-theme .btn-social:hover {
  background-color: rgba(0, 0, 0, 0.02);
}

.btn-social svg {
  width: 18px;
  height: 18px;
}

.auth-form-footer {
  margin-top: 40px;
  text-align: center;
  font-size: 14px;
  color: var(--text-secondary);
}

.auth-oauth-note {
  margin-top: 18px;
  text-align: center;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-secondary);
}

/* --- Enterprise auth (Google-only sign-in) --- */
.auth-eyebrow {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-yellow);
  margin-bottom: 14px;
}

.auth-alert {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(220, 53, 69, 0.08);
  border: 1px solid rgba(220, 53, 69, 0.25);
  color: #f1808b;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 13.5px;
  margin-bottom: 22px;
}

.auth-alert svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

body.light-theme .auth-alert {
  color: #c02434;
}

.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 14px 18px;
  border-radius: 12px;
  background: #ffffff;
  color: #1f1f1f;
  font-size: 15px;
  font-weight: 600;
  border: 1px solid #dadce0;
  text-decoration: none;
  cursor: pointer;
  transition: box-shadow var(--transition-fast), transform var(--transition-fast), background-color var(--transition-fast);
}

.btn-google:hover {
  background: #f7faff;
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3), 0 2px 8px rgba(60, 64, 67, 0.15);
}

.btn-google:active {
  transform: translateY(1px);
}

.btn-google__logo {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}

.auth-trust {
  list-style: none;
  margin: 30px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-trust li {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-secondary);
}

.auth-trust svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  color: var(--accent-yellow);
}

.auth-legal {
  margin-top: 32px;
  font-size: 12px;
  line-height: 1.65;
  color: var(--text-secondary);
}

.auth-legal a {
  color: var(--text-primary);
  font-weight: 600;
  text-decoration: none;
}

.auth-legal a:hover {
  text-decoration: underline;
}

.auth-form-footer a {
  color: var(--accent-yellow);
  font-weight: 600;
  text-decoration: none;
}

.auth-form-footer a:hover {
  text-decoration: underline;
}

/* Login uses a bounded layout; signup retains the shared auth layout. */
.page-login .auth-split-container {
  flex-direction: column;
  width: 100%;
  max-width: 1240px;
  min-height: 100svh;
  margin: 0 auto;
  padding: 32px 40px;
  gap: 32px;
}

.page-login .auth-form-header { margin: 0; gap: 24px; }
.page-login .auth-logo { flex-shrink: 0; }
.page-login .auth-logo .brand-icon { width: 28px; height: 28px; }
.page-login .auth-logo .brand-text { font-size: 20px; }
.page-login .auth-back-home { padding: 10px 14px; border: 1px solid var(--border-color); border-radius: 10px; }
.auth-back-label-short { display: none; }
.page-login .auth-back-home:hover { background: var(--bg-card); }
.page-login .auth-layout { display: grid; grid-template-columns: minmax(0, 440px) minmax(0, 1fr); gap: 28px; margin: auto 0; }
.page-login .auth-side-form {
  justify-content: center;
  padding: 32px;
  border: 1px solid var(--border-color);
  border-radius: 24px;
  background: var(--bg-sidebar);
  overflow: visible;
  box-shadow: 0 16px 48px rgba(0, 0, 0, .06);
}
.page-login .auth-form-body { max-width: none; margin: 0; }
.page-login .auth-title-row { margin-bottom: 26px; }
.page-login .auth-eyebrow { font-size: 11px; margin-bottom: 12px; }
.page-login .auth-title-row h1 { font-size: 32px; line-height: 1.2; letter-spacing: -.025em; margin: 0 0 12px; }
.page-login .auth-title-row p { font-size: 14px; line-height: 1.7; }
.page-login .btn-google { min-height: 52px; }
.page-login .input-icon-wrapper input { min-height: 52px; font-size: 16px; }
.page-login .auth-legal { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border-color); font-size: 11.5px; line-height: 1.8; }
.page-login .auth-alert { align-items: flex-start; line-height: 1.6; overflow-wrap: anywhere; }
.page-login .auth-alert svg { margin-top: 2px; }
.page-login .auth-side-visual {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: stretch;
  gap: 48px;
  min-height: 560px;
  padding: 36px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 24px;
}
.page-login .visual-background { opacity: .75; }
.page-login .visual-overlay { background: linear-gradient(180deg, rgba(3, 3, 3, .55), rgba(3, 3, 3, .1) 42%, rgba(3, 3, 3, .65)); }
.page-login .auth-visual-heading { position: relative; z-index: 1; max-width: 420px; }
.page-login .auth-visual-eyebrow { color: #ffcc00; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .12em; }
.page-login .auth-visual-heading h2 { margin-top: 14px; color: #fff; font-family: var(--font-display); font-size: clamp(32px, 3.2vw, 48px); line-height: 1.1; letter-spacing: -.035em; font-weight: 700; }
.page-login .auth-visual-heading > p { max-width: 310px; margin-top: 16px; color: rgba(255, 255, 255, .7); font-size: 13px; line-height: 1.65; }
.page-login .auth-visual-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.page-login .auth-visual-tags span { padding: 6px 11px; color: rgba(255, 255, 255, .85); border: 1px solid rgba(255, 255, 255, .18); border-radius: 999px; background: rgba(0, 0, 0, .2); font-size: 11px; }
.page-login .visual-quote-card { max-width: none; width: 100%; padding: 22px; border-radius: 16px; border-color: rgba(255, 255, 255, .16); background: rgba(8, 8, 8, .65); box-shadow: none; }
.page-login .quote-text { min-height: 76px; margin-bottom: 18px; font-family: var(--font-display); font-size: 15px; font-weight: 500; line-height: 1.65; }
.page-login .quote-author { padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .15); }
.page-login .author-info { margin: 0; }
.page-login .author-name { display: block; color: #ffcc00; font-family: var(--font-display); font-size: 12px; font-weight: 600; }
.page-login .author-role { display: block; margin-top: 4px; color: rgba(255, 255, 255, .55); font-size: 11px; }
.page-login a:focus-visible, .page-login button:focus-visible { outline: 2px solid var(--accent-yellow); outline-offset: 4px; }

@media (max-width: 1100px) {
  .page-login .auth-split-container { padding: 28px; }
  .page-login .auth-layout { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
  .page-login .auth-side-form, .page-login .auth-side-visual { padding: 28px; }
}
@media (max-width: 900px) {
  .page-login .auth-split-container { max-width: 540px; padding: 24px; gap: 28px; }
  .page-login .auth-layout { grid-template-columns: minmax(0, 1fr); }
  .page-login .auth-side-visual { display: none; }
  .page-login .auth-logo .brand-text { font-size: 18px; }
  .page-login .auth-back-home { padding: 8px 10px; font-size: 12px; }
  .page-login .auth-side-form { padding: 28px; }
}
@media (max-width: 480px) {
  .page-login .auth-split-container { padding: 22px 16px max(22px, env(safe-area-inset-bottom)); gap: 24px; }
  .page-login .auth-form-header { gap: 12px; }
  .page-login .auth-logo .brand-icon { width: 24px; height: 24px; }
  .page-login .auth-logo .brand-text { font-size: 16px; }
  .page-login .auth-back-home { border: none; padding: 8px 0; }
  .page-login .auth-back-label { display: none; }
  .page-login .auth-back-label-short { display: inline; }
  .page-login .auth-side-form { padding: 26px 22px; border-radius: 20px; }
  .page-login .auth-title-row h1 { font-size: 28px; }
  .page-login .auth-title-row p { font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  .page-login .visual-background { animation: none; }
}

/* Visual Panel (Right Side) */
.auth-side-visual {
  flex: 1.1;
  position: relative;
  overflow: hidden;
  background-color: #030303;
  display: flex;
  align-items: flex-end;
  padding: 60px;
}

.visual-background {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.65;
  animation: kenBurnsZoom 30s infinite alternate ease-in-out;
}

@keyframes kenBurnsZoom {
  0% {
    transform: scale(1);
  }

  100% {
    transform: scale(1.15) translate(10px, -10px);
  }
}

.visual-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(3, 3, 3, 0.95) 0%, rgba(3, 3, 3, 0.4) 60%, rgba(3, 3, 3, 0.1) 100%),
    linear-gradient(to right, rgba(3, 3, 3, 0.8) 0%, rgba(3, 3, 3, 0) 40%);
  pointer-events: none;
}

/* Testimonial Glass Card overlay */
.visual-quote-card {
  position: relative;
  z-index: 10;
  background: rgba(20, 20, 20, 0.4);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 36px;
  max-width: 500px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
}

.quote-stars {
  display: flex;
  gap: 4px;
  color: var(--accent-yellow);
  margin-bottom: 16px;
}

.quote-stars svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.quote-text {
  font-size: 16px;
  color: #fff;
  line-height: 1.6;
  margin-bottom: 24px;
  font-weight: 500;
}

.quote-author {
  display: flex;
  align-items: center;
  gap: 12px;
}

.author-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-yellow) 0%, #ff8800 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000;
  font-weight: 700;
  font-size: 14px;
}

.author-info {
  display: flex;
  flex-direction: column;
}

.author-name {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}

.author-role {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
}


/* =========================================
   COHESIVE PRICING CARDS (LANDING & MODAL)
   ========================================= */
.pricing-modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(3, 3, 3, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s;
}

body.light-theme .pricing-modal-overlay {
  background-color: rgba(255, 255, 255, 0.85);
}

.pricing-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.pricing-modal-container {
  background-color: var(--bg-app);
  border: 1px solid var(--border-color);
  border-radius: 28px;
  width: 100%;
  max-width: 960px;
  padding: 48px;
  position: relative;
  transform: translateY(30px) scale(0.96);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.6);
  max-height: 90vh;
  overflow-y: auto;
}

.pricing-modal-overlay.active .pricing-modal-container {
  transform: translateY(0) scale(1);
}

.pricing-close-btn {
  position: absolute;
  top: 24px;
  right: 24px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: var(--transition-fast);
}

.pricing-close-btn:hover {
  background-color: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border-color: var(--border-color-hover);
}

body.light-theme .pricing-close-btn:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.pricing-header {
  text-align: center;
  max-width: 600px;
  margin: 0 auto 50px auto;
}

.pricing-header h2 {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 800;
  margin-bottom: 12px;
}

.pricing-header p {
  color: var(--text-secondary);
  font-size: 15px;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  align-items: stretch;
}

.pricing-card {
  background-color: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: 20px;
  padding: 40px 30px;
  position: relative;
  display: flex;
  flex-direction: column;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body.light-theme .pricing-card {
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.pricing-card:hover {
  transform: translateY(-6px);
  border-color: rgba(255, 204, 0, 0.15);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

body.light-theme .pricing-card:hover {
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.05);
}

.pricing-card.featured {
  border-color: var(--accent-yellow);
  box-shadow: 0 20px 40px rgba(255, 204, 0, 0.06);
  background: linear-gradient(to bottom, rgba(25, 25, 25, 0.6) 0%, var(--bg-card) 100%);
}

body.light-theme .pricing-card.featured {
  background: linear-gradient(to bottom, rgba(255, 204, 0, 0.02) 0%, var(--bg-card) 100%);
}

.pricing-card.featured:hover {
  box-shadow: 0 25px 50px rgba(255, 204, 0, 0.12);
}

.pricing-badge {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--accent-yellow);
  color: #000;
  padding: 6px 14px;
  border-radius: 30px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: 0 4px 15px rgba(255, 204, 0, 0.2);
}

.pricing-card-header {
  margin-bottom: 28px;
  text-align: center;
}

.pricing-card-header h3 {
  font-size: 18px;
  color: var(--text-secondary);
  font-weight: 600;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.pricing-price {
  font-family: var(--font-display);
  font-size: 52px;
  font-weight: 800;
  color: var(--text-primary);
}

.pricing-price span {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-muted);
}

.pricing-credits {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background-color: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.03);
  padding: 12px;
  border-radius: 12px;
  margin-bottom: 28px;
  font-weight: 700;
  font-size: 15px;
}

body.light-theme .pricing-credits {
  background-color: rgba(0, 0, 0, 0.02);
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.pricing-credits svg {
  width: 20px;
  height: 20px;
  color: var(--accent-yellow);
}

.pricing-features {
  list-style: none;
  padding: 0;
  margin: 0 0 32px 0;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pricing-features li {
  padding: 4px 0;
  color: var(--text-secondary);
  font-size: 13.5px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.pricing-features li::before {
  content: '✓';
  color: var(--accent-yellow);
  font-weight: 700;
}

.w-100 {
  width: 100%;
}

/* ---- Coming-soon pricing cards (no price shown) ---- */
.pricing-badge.soon {
  background-color: #6b6b6b;
  color: #fff;
  box-shadow: none;
}

body.light-theme .pricing-badge.soon {
  background-color: #9a9a9a;
  color: #fff;
}

.pricing-card.coming-soon {
  border-style: dashed;
  border-color: var(--border-color);
}

.pricing-card.coming-soon:hover {
  transform: translateY(-3px);
  border-color: var(--border-color-hover);
}

.pricing-price.soon-price {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0.3px;
  color: var(--text-muted);
}

.pricing-card.coming-soon .pricing-credits,
.pricing-card.coming-soon .pricing-features {
  opacity: 0.55;
}

.pricing-card.coming-soon .btn-secondary[disabled] {
  opacity: 0.55;
  pointer-events: none;
}


/* =========================================
   RESPONSIVENESS AND COLLAPSIBILITY
   ========================================= */
@media (max-width: 1024px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1fr);
    text-align: center;
    gap: 50px;
  }

  .hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-width: 0;
  }

  .hero-subtitle {
    margin-left: auto;
    margin-right: auto;
  }

  .mockup-window {
    transform: perspective(1000px) rotateY(0deg) rotateX(0deg);
    max-width: 720px;
    min-width: 0;
  }

  .features-grid,
  .models-grid,
  .pricing-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .landing-nav .nav-links.desktop-only {
    display: none;
  }

  .landing-nav {
    height: 70px;
  }

  /* Tidy, single-line nav on mobile */
  .landing-nav .landing-nav-container {
    padding: 0 16px;
    gap: 10px;
  }

  .landing-nav .nav-logo {
    gap: 8px;
    min-width: 0;
  }

  .landing-nav .brand-icon {
    width: 22px;
    height: 22px;
  }

  .landing-nav .brand-text {
    font-size: 17px;
    letter-spacing: 0.3px;
    white-space: nowrap;
  }

  .landing-nav .nav-actions {
    gap: 8px;
    flex-shrink: 0;
  }

  .landing-nav .btn-theme-toggle {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
  }

  .landing-nav .btn-login-link {
    padding: 8px 10px;
    white-space: nowrap;
  }

  .landing-nav .nav-cta-register {
    white-space: nowrap;
    flex-shrink: 0;
    padding: 9px 16px !important;
    font-size: 13px !important;
  }

  .landing-nav .cta-full {
    display: none;
  }

  .landing-nav .cta-short {
    display: inline;
  }

  .hero-title {
    font-size: 44px;
  }

  .hero-buttons {
    flex-direction: column;
    width: 100%;
  }

  .hero-buttons a {
    width: 100%;
    text-align: center;
  }

  .features-grid,
  .models-grid,
  .pricing-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  /* Auth Split Page Mobile Collapsing */
  .auth-split-container {
    flex-direction: column;
  }

  .auth-side-visual {
    display: none;
    /* Hide visual showcase on mobile auth for speed */
  }

  .auth-side-form {
    padding: 30px 24px;
  }

  .trust-logos {
    gap: 30px;
  }

  .cta-banner {
    padding: 60px 24px;
  }

  .cta-title {
    font-size: 32px;
  }

  .footer-container {
    flex-direction: column;
    gap: 20px;
    text-align: center;
  }

  .footer-brand {
    text-align: center;
  }

  .pricing-modal-container {
    padding: 30px 20px;
  }
}


/* =========================================================
   Mobile Account Sheet (Profil) — bottom-nav driven
   Shown only on mobile; desktop keeps actions in the credits card.
   ========================================================= */
.acct-sheet,
.acct-sheet-backdrop {
  display: none;
}

@media (max-width: 768px) {
  .acct-sheet-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 2950;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
  }

  body.light-theme .acct-sheet-backdrop {
    background-color: rgba(0, 0, 0, 0.3);
  }

  .acct-sheet-backdrop.visible {
    opacity: 1;
    pointer-events: auto;
  }

  .acct-sheet {
    display: flex;
    flex-direction: column;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--bg-sidebar);
    border-top-left-radius: 22px;
    border-top-right-radius: 22px;
    border: 1px solid var(--border-color);
    border-bottom: none;
    z-index: 2951;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.35);
    padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  }

  .acct-sheet.open {
    transform: translateY(0);
  }

  .acct-sheet-handle {
    width: 36px;
    height: 4px;
    background-color: var(--text-muted);
    border-radius: 2px;
    margin: 10px auto 0 auto;
    opacity: 0.5;
  }

  .acct-sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px 12px 20px;
  }

  .acct-sheet-title {
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
  }

  .acct-sheet-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
  }

  body.light-theme .acct-sheet-close {
    background-color: rgba(0, 0, 0, 0.04);
  }

  .acct-sheet-close svg {
    width: 15px;
    height: 15px;
  }

  .acct-sheet-body {
    padding: 6px 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  /* Profile identity */
  .acct-profile {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 14px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
  }

  .acct-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
  }

  .acct-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }

  .acct-id {
    min-width: 0;
  }

  .acct-name {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .acct-email {
    font-size: 12.5px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Credit info */
  .acct-credit {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px;
    border-radius: 14px;
    background:
      radial-gradient(120% 130% at 100% 0%, rgba(var(--accent-yellow-rgb), .16), transparent 60%),
      var(--bg-card);
    border: 1px solid rgba(var(--accent-yellow-rgb), .25);
  }

  .acct-credit-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  .acct-credit-label {
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: .4px;
    text-transform: uppercase;
    color: var(--text-muted);
  }

  .acct-credit-value {
    font-family: var(--font-display);
    font-size: 30px;
    font-weight: 800;
    line-height: 1;
    color: var(--accent-yellow);
  }

  .acct-credit-cta {
    flex-shrink: 0;
    background-color: var(--btn-yellow);
    color: var(--btn-yellow-text);
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 13px;
    text-decoration: none;
    padding: 11px 18px;
    border-radius: 10px;
  }

  /* Action rows */
  .acct-action {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 14px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 13px;
    text-decoration: none;
    color: var(--text-primary);
    transition: border-color .15s, background-color .15s;
  }

  .acct-action:active {
    background-color: var(--bg-card-hover);
  }

  .acct-action.active {
    border-color: rgba(var(--accent-yellow-rgb), .4);
    background: var(--accent-muted-yellow);
  }

  .acct-action-ic {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--accent-muted-yellow);
    color: var(--accent-yellow);
  }

  .acct-action-ic svg {
    width: 18px;
    height: 18px;
  }

  .acct-action-label {
    flex-grow: 1;
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 700;
  }

  .acct-action-chev {
    width: 17px;
    height: 17px;
    color: var(--text-muted);
    flex-shrink: 0;
  }

  .acct-action.danger .acct-action-ic {
    background-color: rgba(244, 63, 94, .12);
    color: #f43f5e;
  }

  .acct-action.danger .acct-action-label {
    color: #f43f5e;
  }
}

/* ===== Professional Notice / Alert Modal ===== */
.notice-overlay {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background-color: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.18s ease;
}

.notice-overlay.show {
  opacity: 1;
}

body.light-theme .notice-overlay {
  background-color: rgba(20, 20, 25, 0.38);
}

.notice-container {
  width: 100%;
  max-width: 400px;
  background-color: var(--bg-sidebar);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  padding: 30px 26px 22px;
  text-align: center;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
  transform: translateY(10px) scale(0.97);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

body.light-theme .notice-container {
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18);
}

.notice-overlay.show .notice-container {
  transform: translateY(0) scale(1);
}

.notice-icon-wrap {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(255, 51, 51, 0.1);
  color: var(--accent-red);
}

.notice-icon-wrap.success {
  background-color: rgba(34, 197, 94, 0.12);
  color: #22c55e;
}

.notice-icon-wrap.info {
  background-color: var(--accent-muted-yellow);
  color: var(--accent-yellow);
}

.notice-icon {
  width: 28px;
  height: 28px;
}

.notice-title {
  font-family: var(--font-display, inherit);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 8px;
}

.notice-message {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-secondary);
  margin: 0 0 14px;
}

.notice-code {
  display: inline-block;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  background-color: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 5px 12px;
  margin: 0 auto 18px;
}

body.light-theme .notice-code {
  background-color: rgba(0, 0, 0, 0.03);
}

.notice-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.notice-btn {
  flex: 1;
  height: 42px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background-color 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

.notice-btn.primary {
  background-color: var(--text-primary);
  color: var(--bg-app);
}

.notice-btn.primary:hover {
  opacity: 0.88;
}

.notice-btn.secondary {
  background-color: transparent;
  border-color: var(--border-color);
  color: var(--text-primary);
}

.notice-btn.secondary:hover {
  background-color: var(--bg-card-hover);
}

.notice-btn.danger {
  background-color: var(--accent-red);
  color: #ffffff;
}

.notice-btn.danger:hover {
  opacity: 0.88;
}

/* ===== Landing page: small-phone polish (≤480px) ===== */
@media (max-width: 480px) {
  .landing-nav .landing-nav-container {
    padding-left: 14px;
    padding-right: 14px;
  }

  .landing-nav .nav-actions {
    gap: 7px;
  }

  .landing-nav .brand-text {
    font-size: 16px;
  }

  .landing-nav .btn-login-link {
    padding: 8px 8px;
    font-size: 13px;
  }

  .landing-nav .nav-cta-register {
    padding: 9px 14px !important;
    font-size: 12.5px !important;
  }

  .hero-section {
    min-height: auto;
    padding-top: 110px;
    padding-bottom: 60px;
  }

  .hero-title {
    font-size: clamp(26px, 7.6vw, 34px);
    line-height: 1.1;
  }

  .hero-subtitle {
    font-size: 15px;
  }

  .section-title-large {
    font-size: 26px;
    line-height: 1.25;
  }

  .section-header {
    margin-bottom: 32px;
  }

  .feature-card {
    padding: 28px 22px;
  }

  .pricing-card {
    padding: 32px 22px;
  }

  .pricing-price {
    font-size: 42px;
  }

  .cta-banner {
    padding: 44px 20px;
  }

  .cta-title {
    font-size: 26px;
  }

  .trust-logos {
    gap: 22px 28px;
    flex-wrap: wrap;
    justify-content: center;
  }

  .mockup-window {
    max-width: 100%;
  }
}

/* Very narrow phones: drop the nav theme toggle so the header never overflows */
@media (max-width: 360px) {
  .landing-nav .btn-theme-toggle {
    display: none;
  }

  .landing-nav .brand-text {
    font-size: 15px;
  }
}

/* Custom Premium Video Player */
.custom-video-player {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background-color: #000000;
}

.custom-video-player video {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.video-controls-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
  padding: 20px 15px 10px 15px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 10;
}

.custom-video-player:hover .video-controls-overlay {
  opacity: 1;
  pointer-events: auto;
}

.video-progress-container {
  width: 100%;
  height: 12px;
  display: flex;
  align-items: center;
  cursor: pointer;
  pointer-events: auto;
}

.video-progress-bar {
  width: 100%;
  height: 4px;
  background-color: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
  position: relative;
  transition: height 0.1s ease;
}

.video-progress-container:hover .video-progress-bar {
  height: 6px;
}

.video-progress-filled {
  height: 100%;
  width: 0%;
  background-color: #ffffff;
  border-radius: 2px;
  position: relative;
}

.video-progress-filled::after {
  content: '';
  position: absolute;
  right: -6px;
  top: 50%;
  transform: translateY(-50%) scale(0);
  width: 12px;
  height: 12px;
  background-color: #ffffff;
  border-radius: 50%;
  transition: transform 0.1s ease;
}

.video-progress-container:hover .video-progress-filled::after {
  transform: translateY(-50%) scale(1);
}

.video-controls-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: auto;
}

.video-controls-left,
.video-controls-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.video-control-btn {
  background: none;
  border: none;
  color: #ffffff;
  padding: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background-color 0.2s ease, transform 0.1s ease;
}

.video-control-btn:hover {
  background-color: rgba(255, 255, 255, 0.15);
}

.video-control-btn:active {
  transform: scale(0.95);
}

.video-control-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.video-time-display {
  color: #ffffff;
  font-size: 12px;
  font-family: monospace;
  letter-spacing: 0.05em;
  user-select: none;
}

/* Prevent iOS Safari auto-zoom on mobile inputs */
@media (max-width: 768px) {
  input[type="text"],
  input[type="number"],
  input[type="email"],
  input[type="password"],
  input[type="search"],
  input[type="tel"],
  input[type="url"],
  select,
  textarea,
  .prompt-textarea,
  .seed-field,
  .text-input,
  .textarea-input,
  .input-icon-wrapper input,
  #mobile-input-negative {
    font-size: 16px !important;
  }
}

/* Consistent Prompt Textarea Wrapper & Negative Prompt Input styling */
.prompt-textarea-wrapper {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
}

.negative-prompt-input {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 4px 6px;
  outline: none;
  margin-bottom: 4px;
  width: 100%;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 500;
  transition: color var(--transition-fast);
}

body.light-theme .negative-prompt-input {
  color: var(--text-secondary);
}

.negative-prompt-input::placeholder {
  color: var(--text-muted);
}

body.mode-audio .negative-prompt-input,
body.mode-music .negative-prompt-input,
body.tab-tts .negative-prompt-input {
  display: none !important;
}

/* Multiple Upload Previews */
.upload-preview-area {
  display: flex;
  flex-direction: column;
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  padding: 8px;
  border-radius: 10px;
  margin-bottom: 6px;
  align-self: stretch;
  gap: 8px;
  max-width: 100%;
}

body.light-theme .upload-preview-area {
  background-color: rgba(0, 0, 0, 0.02);
}

.upload-preview-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
}

.upload-preview-item {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  overflow: hidden;
  flex-shrink: 0;
}

.upload-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.upload-preview-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #050505;
}

.upload-preview-kind {
  position: absolute;
  left: 3px;
  bottom: 3px;
  padding: 1px 3px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.68);
  color: #fff;
  font-size: 7px;
  font-weight: 800;
  line-height: 1.1;
}

.btn-remove-upload-item {
  position: absolute;
  top: 1px;
  right: 1px;
  width: 14px;
  height: 14px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 9px;
  line-height: 1;
  padding: 0;
  transition: background var(--transition-fast);
}

.btn-remove-upload-item:hover {
  background: var(--accent-red);
}

@media (max-width: 768px) {
  body.mode-video-upscaler .prompt-container {
    padding: 10px;
    gap: 9px;
  }

  body.mode-video-upscaler .prompt-input-row {
    flex-wrap: nowrap;
  }

  body.mode-video-upscaler .btn-generate {
    width: 100%;
    height: 42px;
  }

  body.mode-video-upscaler .btn-generate-text {
    display: inline !important;
  }

  .upscaler-upload-card {
    min-height: 92px;
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 11px;
    padding: 12px;
    border-radius: 11px;
  }

  .upscaler-upload-media {
    width: 54px;
    height: 54px;
    border-radius: 9px;
  }

  .upscaler-upload-empty-icon {
    width: 25px;
    height: 25px;
  }

  .upscaler-upload-title {
    font-size: 13px;
  }

  .upscaler-upload-meta {
    font-size: 10.5px;
  }

  .upscaler-upload-cta {
    grid-column: 1 / -1;
    width: 100%;
    height: 36px;
    min-width: 0;
  }

  .upscaler-scale-panel {
    padding: 14px 13px 12px;
    border-radius: 11px;
  }

  .upscaler-scale-range {
    margin-top: 11px;
  }

  .upscaler-scale-mark {
    min-height: 42px;
    font-size: 10px;
  }

  .upscaler-scale-mark strong {
    font-size: 9.5px;
  }

  .upscaler-scale-mark small {
    font-size: 7.5px;
  }

  .upscaler-scale-footer {
    align-items: flex-start;
    font-size: 9px;
  }

  /* NOTE: settings (`.mobile-generate-settings`) and the model header
     (`.mobile-model-header`) intentionally stay visible when the prompt text
     area is focused. Previously `body.keyboard-open` hid them, which blanked
     the whole settings area the moment you tapped to type. */
  .negative-prompt-input {
    font-size: 14px !important;
    padding: 2px 2px 6px 2px;
  }

  body.tab-tts .tts-results-panel {
    display: flex;
    padding: 14px 12px calc(var(--mobile-bottom-nav-height) + var(--tts-mobile-player-reserve) + env(safe-area-inset-bottom, 0px));
    overflow-y: auto;
  }

  body.tab-tts .tts-results-list {
    flex: 0 0 auto;
    overflow: visible;
    padding-right: 0;
  }

  .tts-library-toolbar {
    flex-wrap: wrap;
  }

  .tts-library-search {
    width: 100%;
    max-width: none;
  }

  .tts-result-item,
  .tts-result-item.loading {
    grid-template-columns: 40px minmax(0, 1fr);
    grid-template-areas:
      "play main"
      "actions actions";
    column-gap: 12px;
    row-gap: 8px;
    align-items: center;
  }

  .tts-result-item > .tts-result-play,
  .tts-result-item > .tts-result-status {
    grid-area: play;
    align-self: center;
    width: 40px;
    height: 40px;
  }

  .tts-result-item > .tts-result-main {
    grid-area: main;
  }

  .tts-result-item > .tts-result-actions,
  .tts-result-item > .tts-result-pill {
    grid-area: actions;
    justify-self: start;
    margin-left: -6px;
  }

  .tts-library-player {
    position: fixed;
    left: 0;
    right: 0;
    bottom: calc(var(--mobile-bottom-nav-height) + env(safe-area-inset-bottom, 0px));
    z-index: 990;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "info actions"
      "center center";
    gap: 8px 10px;
    margin: 0;
    padding: 8px 12px 10px;
    border-radius: 0;
    border: 0;
    border-top: 1px solid var(--tts-player-border);
    border-bottom: 1px solid var(--tts-player-border);
    box-shadow: none;
  }

  body.light-theme .tts-library-player {
    box-shadow: none;
  }

  .tts-library-player::before {
    display: none;
  }

  .tts-player-info {
    grid-area: info;
    padding-right: 0;
  }

  .tts-player-art {
    width: 40px;
    height: 40px;
  }

  .tts-player-title {
    font-size: 12.5px;
  }

  .tts-player-sub {
    font-size: 10.5px;
  }

  .tts-player-center {
    grid-area: center;
    width: 100%;
    flex-direction: row;
    gap: 7px;
  }

  .tts-player-play {
    width: 36px;
    height: 36px;
  }

  .tts-player-actions {
    grid-area: actions;
    position: static;
    justify-content: flex-end;
  }

  .tts-player-action {
    width: 32px;
    height: 32px;
  }

  .mobile-tts-voice-list,
  .tts-voice-list {
    max-height: 260px;
  }

  .tts-talent-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  #mobile-setting-tts-voice {
    padding: 0;
    gap: 0;
    overflow: hidden;
    border-radius: 16px;
    background:
      radial-gradient(120% 90% at 100% 0%, rgba(var(--accent-yellow-rgb), 0.10), transparent 58%),
      var(--bg-card);
  }

  #mobile-setting-tts-voice .setting-card-header {
    padding: 14px 14px 12px;
    border-bottom: 1px solid var(--border-color);
  }

  #mobile-setting-tts-voice .setting-card-label {
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 800;
  }

  #mobile-setting-tts-voice .setting-card-value {
    max-width: 46%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-tts-toolbar {
    margin: 0;
    padding: 12px 12px 10px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.018);
  }

  .mobile-tts-toolbar .tts-search-field {
    width: 100%;
  }

  .mobile-tts-toolbar .tts-search-field svg {
    color: var(--text-muted);
  }

  .mobile-tts-toolbar .tts-search-field input {
    height: 40px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
  }

  .mobile-tts-voice-list {
    max-height: 330px;
    padding: 12px;
    gap: 9px;
  }

  .tts-voice-item.compact {
    min-height: 60px;
    border-radius: 14px;
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015)),
      rgba(255, 255, 255, 0.018);
  }

  body.light-theme .tts-voice-item.compact {
    background: rgba(255, 255, 255, 0.78);
  }

  .tts-voice-item.compact.active {
    box-shadow: 0 0 0 3px rgba(var(--accent-yellow-rgb), 0.12);
  }

  .tts-voice-item.compact .tts-voice-select-btn {
    padding: 10px 0 10px 10px;
  }

  .tts-voice-item.compact .tts-voice-name {
    font-size: 13px;
  }

  .tts-voice-item.compact .tts-voice-desc {
    font-size: 11.5px;
  }

  .tts-voice-item.compact .tts-voice-play {
    width: 38px;
    height: 38px;
    margin-right: 10px;
  }

  .tts-voice-count {
    align-self: flex-end;
  }

  .tts-voice-meta {
    display: none;
  }

  .tts-voice-item.compact .tts-voice-avatar {
    width: 36px;
    height: 36px;
  }
}

/* ===== Pro-only model lock (Free users) ===== */
.model-card { position: relative; }
/* Clean SVG padlock chip — replaces the old emoji badge. */
.model-card .pro-lock {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  color: #fff;
  background: rgba(17, 19, 26, .72);
  backdrop-filter: blur(2px);
  border: 1px solid rgba(255, 255, 255, .18);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .35);
  pointer-events: none;
}
.model-card .pro-lock svg { width: 15px; height: 15px; }
.model-card.pro-locked { opacity: .82; }
.model-card.pro-locked::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(15, 17, 22, .14);
  pointer-events: none;
}
.model-card.pro-locked:hover { cursor: not-allowed; }

/* ===== Membership tier badge + upgrade CTA (sidebar balance) ===== */
.tier-badge {
  margin-left: auto;
  align-self: flex-start;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .5px;
}
.tier-badge.is-pro {
  color: #1a1206;
  background: linear-gradient(135deg, var(--accent-yellow), #ff9d00);
}
.tier-badge.is-free {
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--border-color);
}
.tier-cta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.35;
  color: var(--text-secondary);
  background: var(--accent-muted-yellow);
  border: 1px solid rgba(var(--accent-yellow-rgb), .38);
}
.tier-cta .tier-cta-lock { display: inline-flex; align-items: center; color: var(--accent-yellow); flex: 0 0 auto; }
.tier-cta b { color: var(--text-primary); }
