/* ==========================================================================
   VoiceMyText - Minimalist Light Mode Design System
   Inspired by Apple, Notion, and Stripe Aesthetics
   ========================================================================== */

:root {
  /* Color Palette */
  --bg-primary: #FFFFFF;
  --bg-secondary: #F9FAFB;
  --bg-tertiary: #F3F4F6;
  --bg-hover: #E5E7EB;
  --card-bg: #FFFFFF;

  --text-main: #111827;
  --text-secondary: #4B5563;
  --text-muted: #6B7280;
  --text-inverted: #FFFFFF;

  --border-light: #E5E7EB;
  --border-focus: #111827;

  --primary-btn-bg: #000000;
  --primary-btn-text: #FFFFFF;
  --primary-btn-hover: #1F2937;

  --badge-bg: #F3F4F6;
  --badge-text: #374151;

  --accent-success: #10B981;
  --accent-warning: #F59E0B;
  --accent-blue: #2563EB;

  /* Typography */
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* Transitions & Radii */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --shadow-subtle: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
  --shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.03);
  --shadow-elevated: 0 12px 24px -4px rgba(0, 0, 0, 0.08), 0 4px 8px -2px rgba(0, 0, 0, 0.04);
}

/* Reset & Base */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  overflow-x: hidden;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* ==================== MODERN CUSTOM SCROLLBARS ==================== */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 9999px;
  border: 1px solid transparent;
  background-clip: padding-box;
  transition: background-color 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: #94A3B8;
}

::-webkit-scrollbar-corner {
  background: transparent;
}

::-webkit-scrollbar-button {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

* {
  scrollbar-width: thin;
  scrollbar-color: #CBD5E1 transparent;
}

/* ==================== HEADER ==================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
  height: 64px;
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  height: 100%;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-main);
}

.brand-logo {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1px solid var(--border-light);
}

.brand-text {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-badge {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 7px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Language Selector */
.lang-selector-wrapper {
  position: relative;
}

.lang-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  padding: 6px 12px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s var(--ease);
}

.lang-btn:hover {
  background: var(--bg-tertiary);
  border-color: #D1D5DB;
}

.lang-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  left: auto;
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-elevated);
  width: 170px;
  max-width: calc(100vw - 24px);
  display: none;
  flex-direction: column;
  padding: 4px;
  z-index: 100;
}

.lang-dropdown.active {
  display: flex;
}

.lang-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  color: var(--text-secondary);
  border: none;
  background: none;
  cursor: pointer;
  width: 100%;
  text-align: left;
  text-decoration: none;
  transition: background 0.15s var(--ease);
}

.lang-item:hover,
.lang-item.selected {
  background: var(--bg-tertiary);
  color: var(--text-main);
  font-weight: 600;
}

/* Live Balance Pill */
.balance-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  padding: 6px 12px;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 500;
}

.balance-pill .count {
  font-weight: 700;
  color: var(--text-main);
}

.btn-upgrade-sm {
  background: var(--primary-btn-bg);
  color: var(--primary-btn-text);
  border: none;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s var(--ease);
}

.btn-upgrade-sm:hover {
  background: var(--primary-btn-hover);
  transform: translateY(-1px);
}

#authContainer {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.btn-demo-pill {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.btn-demo-pill:hover {
  background: var(--bg-tertiary);
  color: var(--text-main);
  border-color: #D1D5DB;
}

.btn-auth-signin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  gap: 6px;
  background: #FFFFFF;
  color: var(--text-main);
  border: 1px solid var(--border-light);
  padding: 6px 14px;
  border-radius: var(--radius-md);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  transition: all 0.2s var(--ease);
  white-space: nowrap;
}

.btn-auth-signin:hover {
  background: var(--bg-secondary);
  border-color: #CBD5E1;
  color: var(--text-main);
  text-decoration: none;
  transform: translateY(-1px);
}

.btn-auth-signup {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  gap: 6px;
  background: #000000;
  color: #FFFFFF;
  border: 1px solid #000000;
  padding: 6px 16px;
  border-radius: var(--radius-md);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  transition: all 0.2s var(--ease);
  white-space: nowrap;
}

.btn-auth-signup:hover {
  background: #262626;
  border-color: #262626;
  color: #FFFFFF;
  text-decoration: none;
  transform: translateY(-1px);
}

.btn-google-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #FFFFFF;
  color: var(--text-main);
  border: 1px solid var(--border-light);
  padding: 6px 14px;
  border-radius: var(--radius-md);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: all 0.2s var(--ease);
  white-space: nowrap;
}

.btn-google-pill:hover {
  background: var(--bg-secondary);
  border-color: #D1D5DB;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
}

.btn-auth {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #FFFFFF;
  color: var(--text-main);
  border: 1px solid var(--border-light);
  padding: 6px 14px;
  border-radius: var(--radius-md);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  white-space: nowrap;
}

.btn-auth:hover {
  background: var(--bg-secondary);
  border-color: #D1D5DB;
}


.user-profile-widget {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  cursor: pointer;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-light);
  object-fit: cover;
}

/* User Menu Pill & Dropdown */
.user-menu-wrapper {
  position: relative;
}

.user-pill-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  padding: 5px 12px 5px 6px;
  border-radius: var(--radius-md);
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  transition: all 0.2s var(--ease);
}

.user-pill-btn:hover,
.user-pill-btn.active {
  background: var(--bg-secondary);
  border-color: #CBD5E1;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
}

.user-pill-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-pill-arrow {
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.user-pill-btn.active .user-pill-arrow {
  transform: rotate(180deg);
}

.user-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 240px;
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  padding: 8px;
  z-index: 100;
  display: none;
  animation: dropdownIn 0.18s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.user-dropdown-menu.active {
  display: block;
}

.user-dropdown-header {
  padding: 8px 10px 10px 10px;
}

.user-dropdown-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-dropdown-email {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.user-dropdown-badge {
  display: inline-flex;
  align-items: center;
  margin-top: 8px;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.plan-badge-free {
  background: #F1F5F9;
  color: #475569;
}

.plan-badge-onetime {
  background: #FEF3C7;
  color: #92400E;
  border: 1px solid #FDE68A;
}

.plan-badge-monthly {
  background: #DCFCE7;
  color: #166534;
  border: 1px solid #BBF7D0;
}

.user-dropdown-divider {
  height: 1px;
  background: var(--border-light);
  margin: 6px 0;
}

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.84rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
  box-sizing: border-box;
}

.user-dropdown-item:hover {
  background: var(--bg-tertiary);
  color: var(--text-main);
}

.user-dropdown-item.btn-dropdown-logout {
  color: #EF4444;
}

.user-dropdown-item.btn-dropdown-logout:hover {
  background: #FEF2F2;
  color: #DC2626;
}


/* ==================== COMPACT HERO INTRO SECTION ==================== */
.hero-intro-section {
  text-align: center;
  margin: 0 auto 18px auto;
  max-width: 820px;
  padding: 4px 12px 0 12px;
}

.hero-intro-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--bg-tertiary, #F3F4F6);
  border: 1px solid var(--border-light, #E5E7EB);
  padding: 4px 14px;
  border-radius: var(--radius-full, 9999px);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary, #4B5563);
  margin-bottom: 10px;
  letter-spacing: -0.01em;
}

.hero-badge-dot {
  width: 7px;
  height: 7px;
  background: var(--accent-success, #10B981);
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.45);
}

.hero-intro-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-main, #111827);
  letter-spacing: -0.03em;
  line-height: 1.25;
  margin: 0 0 8px 0;
}

.hero-intro-desc {
  font-size: 0.95rem;
  color: var(--text-secondary, #4B5563);
  line-height: 1.5;
  margin: 0 auto;
  max-width: 700px;
}

@media (max-width: 768px) {
  .hero-intro-section {
    margin-bottom: 12px;
    padding: 0 4px;
  }
  .hero-intro-title {
    font-size: 1.3rem;
    margin-bottom: 6px;
    letter-spacing: -0.02em;
  }
  .hero-intro-desc {
    font-size: 0.85rem;
    line-height: 1.45;
  }
  .hero-intro-badge {
    font-size: 0.72rem;
    padding: 3px 10px;
    margin-bottom: 8px;
  }
}

/* ==================== MAIN WORKSPACE ==================== */
.main-wrapper {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
  width: 100%;
  flex: 1;
}

.studio-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

/* Cards & Panels */
.studio-card {
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-subtle);
  display: flex;
  flex-direction: column;
  gap: 13px;
  min-width: 0;
  width: 100%;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Presets Bar */
.presets-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-preset {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  padding: 5px 11px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s var(--ease);
}

.btn-preset:hover {
  background: var(--bg-tertiary);
  color: var(--text-main);
  border-color: #D1D5DB;
}

.btn-file-upload {
  background: #F8FAFC;
  border: 1.5px solid #CBD5E1;
  color: #0F172A;
  padding: 6px 14px;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: all 0.2s var(--ease);
}

.btn-file-upload:hover {
  background: #FFFFFF;
  border-color: #0F172A;
  color: #0F172A;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}

/* Script Textarea */
.textarea-container {
  position: relative;
  display: flex;
  flex-direction: column;
}

.script-textarea {
  width: 100%;
  min-height: 185px;
  max-height: 480px;
  padding: 14px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  font-family: var(--font-family);
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--text-main);
  background: var(--bg-secondary);
  resize: vertical;
  outline: none;
  transition: all 0.2s var(--ease);
}

.script-textarea:focus {
  background: #FFFFFF;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

.textarea-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.counts-group {
  display: flex;
  gap: 14px;
}

.counts-group span strong {
  color: var(--text-main);
}

.guest-hint-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 6px;
  color: var(--primary, #2563EB);
  font-size: 0.76rem;
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.15s ease, color 0.15s ease;
}

.guest-hint-link .guest-hint-text {
  text-decoration: underline;
  text-underline-offset: 2.5px;
  text-decoration-thickness: 1px;
}

.guest-hint-link .guest-hint-arrow {
  text-decoration: none;
  display: inline-block;
  font-size: 0.8rem;
  line-height: 1;
  transition: transform 0.15s ease;
}

.guest-hint-link:hover {
  opacity: 0.8;
  color: #1D4ED8;
}

.guest-hint-link:hover .guest-hint-arrow {
  transform: translateX(2px);
}

/* Voice Picker Panel (Clean 2-Column Row) */
.voice-picker-panel {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 10px 12px;
}

.voice-picker-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 10px;
  align-items: flex-end;
}

.voice-picker-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.voice-picker-label {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.voice-custom-select {
  width: 100%;
  height: 38px;
  padding: 0 10px;
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text-main);
  outline: none;
  cursor: pointer;
  transition: all 0.15s var(--ease);
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

.voice-custom-select:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.05);
}

/* ==================== CUSTOM SELECT DROPDOWN COMPONENT ==================== */
.custom-dropdown-wrap {
  position: relative;
  width: 100%;
}

.custom-dropdown-trigger {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text-main);
  outline: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  transition: all 0.15s var(--ease);
  user-select: none;
}

.custom-dropdown-trigger:hover {
  border-color: #D1D5DB;
  background: #FAFAFA;
}

.custom-dropdown-trigger:focus-visible,
.custom-dropdown-wrap.active .custom-dropdown-trigger {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.06);
}

.custom-dropdown-value {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.84rem;
}

.custom-dropdown-arrow {
  flex-shrink: 0;
  color: var(--text-muted);
  transition: transform 0.2s var(--ease);
}

.custom-dropdown-wrap.active .custom-dropdown-arrow {
  transform: rotate(180deg);
}

.custom-dropdown-menu {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  width: 100%;
  min-width: 250px;
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 28px -4px rgba(0, 0, 0, 0.12), 0 6px 12px -2px rgba(0, 0, 0, 0.06);
  z-index: 1000;
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: dropdownPop 0.14s ease-out;
}

@keyframes dropdownPop {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.custom-dropdown-wrap.active {
  z-index: 1005;
}

.custom-dropdown-wrap.active .custom-dropdown-menu {
  display: flex;
}

.custom-dropdown-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-secondary);
}

.custom-dropdown-search-wrap svg {
  flex-shrink: 0;
  color: var(--text-muted);
}

.custom-dropdown-search {
  width: 100%;
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.82rem;
  color: var(--text-main);
}

.custom-dropdown-list {
  max-height: 240px;
  overflow-y: auto;
  padding: 4px;
}

.custom-dropdown-list::-webkit-scrollbar {
  width: 5px;
}
.custom-dropdown-list::-webkit-scrollbar-track {
  background: transparent;
}
.custom-dropdown-list::-webkit-scrollbar-thumb {
  background: #E5E7EB;
  border-radius: 9999px;
}
.custom-dropdown-list::-webkit-scrollbar-thumb:hover {
  background: #D1D5DB;
}

.custom-dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.1s ease;
  user-select: none;
}

.custom-dropdown-item:hover {
  background: var(--bg-tertiary);
}

.custom-dropdown-item.selected {
  background: #F3F4F6;
  font-weight: 600;
}

.custom-dropdown-item-left {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.custom-dropdown-item-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.custom-dropdown-item-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.star-trending-icon {
  display: inline-flex;
  align-items: center;
  color: #F59E0B;
  flex-shrink: 0;
}

.voice-badge-gender {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.02em;
}

.voice-badge-gender.female {
  background: rgba(236, 72, 153, 0.08);
  color: #DB2777;
}

.voice-badge-gender.male {
  background: rgba(59, 130, 246, 0.08);
  color: #2563EB;
}

.voice-badge-count {
  font-size: 0.72rem;
  color: var(--text-muted);
  background: var(--bg-tertiary);
  padding: 1px 6px;
  border-radius: 4px;
}

.custom-dropdown-check {
  color: #10B981;
  opacity: 0;
  flex-shrink: 0;
  transition: opacity 0.1s ease;
}

.custom-dropdown-item.selected .custom-dropdown-check {
  opacity: 1;
}

.custom-dropdown-empty {
  padding: 20px 12px;
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.voice-select-action-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.voice-select-action-wrap .voice-custom-select {
  flex: 1;
  min-width: 0;
}

.btn-preview-voice {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 38px;
  padding: 0 12px;
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  color: var(--text-main);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.18s var(--ease);
}

.btn-preview-voice:hover {
  background: var(--bg-tertiary);
  border-color: #CBD5E1;
}

.btn-preview-voice.is-playing {
  background: #0F172A;
  color: #FFFFFF;
  border-color: #0F172A;
}

.btn-preview-voice.is-playing svg {
  animation: audioPulse 0.7s infinite alternate ease-in-out;
}

.btn-preview-voice.is-loading {
  background: var(--bg-tertiary);
  opacity: 0.8;
  cursor: pointer;
}

.btn-preview-voice.is-loading svg {
  animation: previewSpin 0.7s linear infinite;
}

@keyframes previewSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes audioPulse {
  0% {
    transform: scale(0.9);
    opacity: 0.8;
  }

  100% {
    transform: scale(1.15);
    opacity: 1;
  }
}

/* Audio Sliders Header & Reset */
.sliders-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
  margin-bottom: 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border-light);
}

.sliders-title {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.btn-reset-sliders {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  font-size: 0.76rem;
  font-weight: 600;
  color: #64748B;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.18s var(--ease);
}

.btn-reset-sliders:hover {
  background: #F1F5F9;
  color: #0F172A;
  border-color: #CBD5E1;
}

/* Real-time Generation Progress Bar (Identical location & dimensions to Master Export Bar) */
.generation-loading-bar {
  margin-top: 24px;
  background: #0B0F19;
  color: #FFFFFF;
  border-radius: var(--radius-lg);
  padding: 22px 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--shadow-elevated);
  animation: slideUp 0.3s var(--ease) forwards;
  width: 100%;
  box-sizing: border-box;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.loading-bar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.loading-bar-title-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
}

.loading-bar-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(255, 255, 255, 0.15);
  border-top-color: #38BDF8;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

.loading-bar-title {
  color: #FFFFFF;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.loading-bar-subtitle {
  color: #94A3B8;
  font-size: 0.8rem;
  margin-top: 2px;
}

.loading-bar-percent {
  font-size: 1.35rem;
  font-weight: 800;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: #38BDF8;
  flex-shrink: 0;
  letter-spacing: -0.02em;
}

.progress-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #38BDF8, #818CF8, #6366F1);
  border-radius: var(--radius-full);
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.5);
}

/* Audio Sliders Grid */
.sliders-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.slider-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.slider-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.slider-val {
  font-weight: 700;
  color: var(--text-main);
}

.custom-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: var(--border-light);
  border-radius: var(--radius-full);
  outline: none;
}

.custom-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #000000;
  cursor: pointer;
  transition: transform 0.1s var(--ease);
}

.custom-range::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

/* Pro Feature Toggle Row */
.pro-feature-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  margin-top: 10px;
  transition: all 0.2s var(--ease);
}

.pro-feature-toggle-row:hover {
  background: #F3F4F6;
  border-color: #D1D5DB;
}

.pro-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
}

.pro-checkbox-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.pro-checkbox-custom {
  width: 17px;
  height: 17px;
  border: 1.8px solid #9CA3AF;
  border-radius: 4px;
  background: #FFFFFF;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  position: relative;
  flex-shrink: 0;
}

.pro-checkbox-input:checked+.pro-checkbox-custom {
  background: #000000;
  border-color: #000000;
}

.pro-checkbox-input:checked+.pro-checkbox-custom::after {
  content: "";
  display: block;
  width: 5px;
  height: 9px;
  border: solid #FFFFFF;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translate(-0.5px, -1px);
}

.pro-checkbox-text {
  letter-spacing: -0.01em;
}

.pro-badge-tag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  padding: 2px 6px;
  border-radius: 4px;
  background: #F3E8FF;
  color: #7E22CE;
  border: 1px solid #E9D5FF;
  text-transform: uppercase;
  line-height: 1;
}

.pro-toggle-hint {
  font-size: 0.74rem;
  color: var(--text-muted);
  text-align: right;
  line-height: 1.3;
}

/* Studio Actions Group */
.studio-actions-group {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}

.btn-primary-action {
  flex: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--primary-btn-bg);
  color: var(--primary-btn-text);
  border: none;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
  transition: all 0.2s var(--ease);
}

.btn-primary-action:hover:not(:disabled) {
  background: var(--primary-btn-hover);
  transform: translateY(-1px);
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.12);
}

.btn-primary-action:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-secondary-action {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #FFFFFF;
  color: var(--text-main);
  border: 1px solid var(--border-light);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s var(--ease);
}

.btn-secondary-action:hover {
  background: var(--bg-secondary);
  border-color: #D1D5DB;
}

.btn-icon-action {
  background: #FFFFFF;
  color: var(--text-muted);
  border: 1px solid var(--border-light);
  padding: 10px 12px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s var(--ease);
}

.btn-icon-action:hover {
  color: var(--text-main);
  background: var(--bg-secondary);
}

/* ==================== RIGHT COLUMN: DUAL TABS ==================== */
.tabs-header-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 14px;
}

.tabs-nav {
  display: inline-flex;
  align-items: center;
  background: #F1F5F9;
  padding: 4px;
  border-radius: var(--radius-md);
  gap: 5px;
  border: 1px solid #CBD5E1;
}

.tab-btn {
  background: transparent;
  border: 1px solid transparent;
  padding: 7px 15px;
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  transition: all 0.18s var(--ease);
}

.tab-btn:hover {
  color: #0F172A;
  background: rgba(255, 255, 255, 0.85);
}

.tab-btn.active {
  color: #FFFFFF;
  background: #0F172A;
  font-weight: 700;
  border-color: #0F172A;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.18);
}

.tabs-actions {
  display: flex;
  gap: 6px;
}

.tab-tool-btn {
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  border-radius: var(--radius-sm);
  padding: 5px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  transition: all 0.15s var(--ease);
}

.tab-tool-btn:hover {
  background: #F8FAFC;
  color: #0F172A;
  border-color: #94A3B8;
}

.tab-pane {
  display: none;
  flex-direction: column;
  gap: 12px;
  min-height: 480px;
  max-height: 600px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
  min-width: 0;
  width: 100%;
}

.tab-pane.active {
  display: flex;
}

#timelineContent {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 420px;
  text-align: center;
  color: var(--text-muted);
  gap: 12px;
}

.empty-icon {
  font-size: 2.4rem;
  opacity: 0.5;
}

/* Timeline Cards */
.timeline-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  transition: all 0.15s var(--ease);
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow: hidden;
}

.timeline-item:hover {
  background: #FFFFFF;
  border-color: #D1D5DB;
  box-shadow: var(--shadow-subtle);
}

.timeline-stamp {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.78rem;
  font-weight: 700;
  background: var(--border-light);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  color: var(--text-main);
  white-space: nowrap;
  flex-shrink: 0;
}

.timeline-text {
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text-main);
  flex: 1;
  min-width: 0;
  max-width: 100%;
  word-break: break-word;
  overflow-wrap: anywhere;
  white-space: normal;
}

.timeline-item .btn-table-action {
  flex-shrink: 0;
}

/* Sentences Table */
.sentences-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.sentences-table th {
  text-align: left;
  padding: 8px 12px;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-light);
}

.sentences-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}

.editable-text {
  outline: none;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  word-break: break-word;
  overflow-wrap: anywhere;
  transition: all 0.15s var(--ease);
}

.editable-text:hover {
  background: var(--bg-secondary);
  border-color: var(--border-light);
}

.editable-text:focus {
  background: #FFFFFF;
  border-color: var(--border-focus);
}

.cell-actions {
  display: flex;
  gap: 6px;
}

.btn-table-action {
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s var(--ease);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.btn-table-action:hover {
  background: var(--bg-tertiary);
  border-color: #CBD5E1;
}

.timeline-item.is-playing {
  background: #F0FDF4;
  border-color: #86EFAC;
  box-shadow: 0 0 0 1px #86EFAC;
}

.sentences-table tr.is-playing {
  background: #F0FDF4 !important;
}

.btn-table-action.is-playing {
  background: #059669;
  color: #FFFFFF;
  border-color: #059669;
  box-shadow: 0 2px 6px rgba(5, 150, 105, 0.25);
}

.btn-table-action.is-playing svg {
  color: #FFFFFF;
}

.audio-wave-bars {
  display: inline-flex;
  align-items: center;
  gap: 1.5px;
  height: 12px;
}

.audio-wave-bars span {
  display: block;
  width: 2px;
  background-color: currentColor;
  border-radius: 1px;
  animation: waveBar 0.8s ease-in-out infinite alternate;
}

.audio-wave-bars span:nth-child(1) {
  height: 6px;
  animation-delay: 0s;
}

.audio-wave-bars span:nth-child(2) {
  height: 12px;
  animation-delay: 0.2s;
}

.audio-wave-bars span:nth-child(3) {
  height: 8px;
  animation-delay: 0.4s;
}

@keyframes waveBar {
  0% {
    transform: scaleY(0.4);
  }

  100% {
    transform: scaleY(1);
  }
}

/* ==================== MASTER EXPORT BAR ==================== */
.master-export-bar {
  margin-top: 24px;
  background: #000000;
  color: #FFFFFF;
  border-radius: var(--radius-lg);
  padding: 20px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  box-shadow: var(--shadow-elevated);
  animation: slideUp 0.3s var(--ease) forwards;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.export-player-wrapper {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
}

.btn-master-play {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #FFFFFF;
  color: #000000;
  border: none;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s var(--ease);
}

.btn-master-play:hover {
  transform: scale(1.08);
}

.master-track-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.master-track-title {
  font-size: 0.92rem;
  font-weight: 700;
}

.master-scrubber-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.78rem;
  font-family: ui-monospace, monospace;
}

.master-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: var(--radius-full);
  background: #374151;
  outline: none;
}

.master-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #FFFFFF;
  cursor: pointer;
}

.export-buttons-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-download-tag {
  background: rgba(255, 255, 255, 0.12);
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s var(--ease);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-download-tag:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.4);
}

.btn-download-zip {
  background: #FFFFFF;
  color: #000000;
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 0.84rem;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s var(--ease);
}

.btn-download-zip:hover {
  background: #F3F4F6;
  transform: translateY(-1px);
}

.btn-download-zip.locked {
  background: rgba(255, 255, 255, 0.1);
  color: #E5E7EB;
  border: 1px dashed rgba(255, 255, 255, 0.35);
  cursor: pointer;
  position: relative;
  transition: all 0.2s var(--ease);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-download-zip.locked:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.55);
  color: #FFFFFF;
  transform: translateY(-1px);
}

.btn-download-zip .pro-badge-tag {
  margin-left: 2px;
  vertical-align: middle;
}

/* ==================== MODALS ==================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.modal-overlay.active {
  display: flex;
}

.modal-box {
  background: #FFFFFF;
  border-radius: var(--radius-lg);
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #CBD5E1 transparent;
  padding: 32px;
  position: relative;
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.06);
  border: 1px solid var(--border-light);
  transform-origin: center center;
  animation: modalSpringIn 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.modal-box::-webkit-scrollbar {
  width: 6px;
}

.modal-box::-webkit-scrollbar-track {
  background: transparent;
  margin: 14px 0;
}

.modal-box::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 9999px;
}

.modal-box::-webkit-scrollbar-thumb:hover {
  background: #94A3B8;
}

.modal-box::-webkit-scrollbar-button {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

@keyframes modalSpringIn {
  0% {
    opacity: 0;
    transform: scale(0.94) translateY(12px);
  }

  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-box-auth {
  max-width: 440px;
  padding: 44px 32px 36px 32px;
}

.modal-box-contact {
  max-width: 480px;
  padding: 44px 32px 36px 32px;
}

.modal-box-confirm {
  max-width: 480px;
  padding: 38px 28px 28px;
  text-align: center;
}

.modal-confirm-icon-wrap {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #EF4444;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.modal-confirm-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 8px;
  line-height: 1.35;
}

.modal-confirm-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin: 0 0 18px;
}

.modal-confirm-points {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  text-align: left;
  margin-bottom: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-confirm-point {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.modal-confirm-point svg {
  flex-shrink: 0;
  margin-top: 2px;
  color: #10B981;
}

.modal-confirm-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.btn-confirm-dismiss {
  flex: 1;
  padding: 11px 16px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  background: #F1F5F9;
  color: #475569;
  border: 1px solid #CBD5E1;
  transition: all 0.2s var(--ease);
}

.btn-confirm-dismiss:hover {
  background: #E2E8F0;
  color: #0F172A;
}

.btn-confirm-danger {
  flex: 1.25;
  padding: 11px 16px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  background: #EF4444;
  color: #FFFFFF;
  border: 1px solid #DC2626;
  transition: all 0.2s var(--ease);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-confirm-danger:hover {
  background: #DC2626;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.28);
}

.btn-confirm-danger:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.modal-close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  background: #F1F5F9;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  cursor: pointer;
  color: #64748B;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
  transition: all 0.2s var(--ease);
  z-index: 20;
}

.modal-close-btn:hover {
  color: #0F172A;
  background: #E2E8F0;
  border-color: #CBD5E1;
  transform: scale(1.05);
}

/* Auth Tabs in Modal */
.auth-tabs-nav {
  display: flex;
  background: #F1F5F9;
  padding: 4px;
  border-radius: var(--radius-md);
  margin-top: 6px;
  margin-bottom: 24px;
  gap: 6px;
  border: 1px solid #E2E8F0;
}

.auth-tab-pill {
  flex: 1;
  padding: 9px 14px;
  font-size: 0.88rem;
  font-weight: 600;
  text-align: center;
  border: 1px solid transparent;
  background: transparent;
  color: #64748B;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s var(--ease);
}

.auth-tab-pill:hover {
  color: #0F172A;
  background: rgba(255, 255, 255, 0.6);
}

.auth-tab-pill.active {
  background: #0F172A;
  color: #FFFFFF;
  font-weight: 700;
  border-color: #0F172A;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.16);
}

/* Auth Form & Inputs */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  text-align: left;
}

.auth-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-main);
}

.auth-text-input {
  width: 100%;
  padding: 10px 14px;
  font-size: 0.9rem;
  font-family: var(--font-family);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  color: var(--text-main);
  outline: none;
  transition: all 0.2s var(--ease);
}

.auth-text-input:focus {
  background: #FFFFFF;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

.auth-otp-input {
  font-size: 1.75rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.06em !important;
  text-align: center !important;
  padding: 12px 14px !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;
  font-variant-numeric: tabular-nums !important;
  border: 1.5px solid var(--border-light) !important;
  background: var(--bg-secondary) !important;
  border-radius: var(--radius-md) !important;
  transition: all 0.2s var(--ease) !important;
}

.auth-otp-input::placeholder {
  letter-spacing: 0.06em !important;
  color: var(--text-muted) !important;
  opacity: 0.4 !important;
}

.auth-otp-input:focus {
  border-color: #000000 !important;
  background: #FFFFFF !important;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.08) !important;
}

.auth-alert-error {
  background: #FEF2F2;
  border: 1px solid #FCA5A5;
  color: #B91C1C;
  font-size: 0.82rem;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  line-height: 1.4;
  word-break: break-word;
}

.btn-auth-action {
  width: 100%;
  padding: 11px 16px;
  font-size: 0.92rem;
  font-weight: 600;
  color: #FFFFFF;
  background: #000000;
  border: 1px solid #000000;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s var(--ease);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  margin-top: 2px;
}

.btn-auth-action:hover {
  background: #262626;
  border-color: #262626;
  transform: translateY(-1px);
}

/* Auth Separator */
.auth-separator {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 18px 0 14px;
  color: var(--text-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.auth-separator::before,
.auth-separator::after {
  content: "";
  flex: 1;
  border-bottom: 1px solid var(--border-light);
}

.auth-separator span {
  padding: 0 12px;
}

/* Google OAuth Button inside Modal */
.btn-modal-google {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s var(--ease);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.btn-modal-google:hover {
  background: var(--bg-secondary);
  border-color: #CBD5E1;
  transform: translateY(-1px);
}

/* Auth Switch Link */
.auth-switch-box {
  margin-top: 16px;
  text-align: center;
  font-size: 0.84rem;
  color: var(--text-muted);
}

.auth-switch-link {
  font-weight: 700;
  color: var(--text-main);
  text-decoration: underline;
  margin-left: 5px;
  cursor: pointer;
}

.auth-switch-link:hover {
  color: #000000;
}

/* Contact Modal Details */
.contact-email-card {
  text-align: center;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 18px;
}

/* Pricing Grid in Modal */
.pricing-header {
  text-align: center;
  margin-bottom: 28px;
}

.pricing-title {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.pricing-subtitle {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin-top: 6px;
}

.pricing-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.pricing-card {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--bg-secondary);
  position: relative;
  transition: all 0.2s var(--ease);
}

.pricing-card:hover {
  transform: translateY(-2px);
  border-color: #D1D5DB;
  box-shadow: var(--shadow-card);
}

.pricing-card.featured {
  background: #000000;
  color: #FFFFFF;
  border-color: #000000;
}

.featured-badge {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  background: #0B1120;
  color: #34D399;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 4px 14px;
  border-radius: var(--radius-full);
  letter-spacing: 0.06em;
  border: 1.5px solid #10B981;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.plan-name {
  font-size: 1.15rem;
  font-weight: 700;
}

.plan-price-row {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.plan-price {
  font-size: 2rem;
  font-weight: 800;
}

.plan-credits-tag {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-success);
}

.pricing-card.featured .plan-credits-tag {
  color: #6EE7B7;
}

.plan-features-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.84rem;
  flex: 1;
}

.plan-features-list li {
  line-height: 1.45;
}

.plan-features-list li::before {
  content: "✓ ";
  font-weight: 800;
  color: #10B981;
  margin-right: 6px;
}

/* Inherited base feature: gray tick and subtle text */
.plan-features-list li.feature-base {
  color: #64748B;
}

.plan-features-list li.feature-base::before {
  color: #94A3B8;
  opacity: 0.85;
}

/* On featured dark card (Creator) */
.pricing-card.featured .plan-features-list li.feature-base {
  color: #94A3B8;
}

.pricing-card.featured .plan-features-list li.feature-base::before {
  color: #64748B;
  opacity: 0.85;
}

/* Unlocked new features: bold and bright green tick */
.plan-features-list li.feature-new {
  font-weight: 600;
  color: var(--text-main);
}

.plan-features-list li.feature-new::before {
  color: #10B981;
}

.pricing-card.featured .plan-features-list li.feature-new {
  color: #FFFFFF;
}

.pricing-card.featured .plan-features-list li.feature-new::before {
  color: #34D399;
}

.btn-plan-action {
  background: #000000;
  color: #FFFFFF;
  border: 1px solid #000000;
  padding: 12px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.15s var(--ease);
}

.btn-plan-action:hover:not(:disabled) {
  opacity: 0.9;
  transform: translateY(-1px);
}

.btn-plan-action:disabled {
  background: var(--bg-tertiary);
  color: var(--text-muted);
  border-color: var(--border-light);
  cursor: default;
  transform: none;
  opacity: 0.8;
}

.pricing-card.featured .btn-plan-action {
  background: #FFFFFF;
  color: #000000;
  border-color: #FFFFFF;
}

.pricing-card.featured .btn-plan-action:disabled {
  background: #374151;
  color: #9CA3AF;
  border-color: #374151;
}


/* FAQ Section */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 20px;
}

.faq-item {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px;
  background: var(--bg-secondary);
}

.faq-q {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}

.faq-a {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Legal text modal */
.legal-content {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.7;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.legal-content h3 {
  color: var(--text-main);
  font-size: 1.1rem;
  margin-top: 10px;
}

/* ==================== FOOTER ==================== */
.site-footer {
  border-top: 1px solid var(--border-light);
  background: var(--bg-secondary);
  padding: 32px 24px;
  margin-top: auto;
}

.footer-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.84rem;
  color: var(--text-muted);
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  row-gap: 8px;
  column-gap: 20px;
}

.footer-nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s var(--ease);
}

.footer-nav a:hover {
  color: var(--text-main);
}

/* Toast Notification */
.toast-notice {
  position: fixed;
  bottom: 24px;
  right: 24px;
  max-width: 500px;
  padding: 12px 14px 12px 18px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.25);
  z-index: 999;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  animation: slideInToast 0.25s var(--ease);
}

.toast-message {
  flex: 1;
  line-height: 1.4;
  word-break: break-word;
}

.toast-close-btn {
  background: transparent;
  border: none;
  color: currentColor;
  opacity: 0.75;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
  transition: opacity 0.15s ease, background 0.15s ease;
}

.toast-close-btn:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.2);
}

.toast-notice.toast-success {
  background: #065F46;
  color: #ECFDF5;
  border: 1px solid #10B981;
}

.toast-notice.toast-error {
  background: #991B1B;
  color: #FEF2F2;
  border: 1px solid #EF4444;
}

.toast-notice.toast-info {
  background: #0F172A;
  color: #FFFFFF;
  border: 1px solid #334155;
}

@keyframes slideInToast {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==================== ON-PAGE FAQ SECTION ==================== */
.faq-section {
  margin-top: 56px;
  padding-top: 40px;
  border-top: 1px solid var(--border-light);
}

.faq-header {
  text-align: center;
  max-width: 600px;
  margin: 0 auto 36px;
}

.faq-title {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.faq-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-top: 8px;
  line-height: 1.5;
}

.faq-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.faq-card {
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all 0.25s var(--ease);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq-card:hover {
  transform: translateY(-2px);
  border-color: #D1D5DB;
  box-shadow: var(--shadow-card);
}

.faq-card-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.faq-card-icon {
  font-size: 1.3rem;
  line-height: 1;
}

.faq-q {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.4;
  margin: 0;
}

.faq-a {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}

/* ==================== RESPONSIVE: TABLET (max-width: 960px) ==================== */
@media (max-width: 960px) {
  .studio-grid {
    grid-template-columns: 1fr;
  }

  .pricing-cards-grid {
    grid-template-columns: 1fr;
  }

  .faq-grid {
    grid-template-columns: 1fr 1fr;
  }

  .master-export-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .export-buttons-group {
    width: 100%;
    justify-content: flex-start;
  }
}

/* ==================== RESPONSIVE: MOBILE (max-width: 768px) ==================== */
@media (max-width: 768px) {

  /* --- ANTI-ZOOM FOR MOBILE FORMS (iOS Safari & Android Chrome) --- */
  /* Setting 16px computed font-size prevents mobile browsers from zooming in on focus */
  input[type="text"]:not(.auth-otp-input):not(#adminOtpCode),
  input[type="password"],
  input[type="email"],
  input[type="number"],
  input[type="search"],
  input[type="tel"],
  input[type="url"],
  input[type="datetime-local"],
  select,
  textarea,
  .script-textarea,
  .custom-dropdown-search,
  .auth-text-input:not(.auth-otp-input),
  .account-form-input,
  .admin-form-input:not(#adminOtpCode),
  .admin-search-input,
  .webmail-search-input,
  .reply-textarea {
    font-size: 16px !important;
  }

  /* --- HEADER --- */
  .site-header {
    height: auto;
    min-height: 56px;
  }

  .header-container {
    padding: 10px 14px;
    flex-wrap: wrap;
    gap: 10px;
  }

  .brand-wrapper {
    gap: 8px;
  }

  .brand-logo {
    width: 30px;
    height: 30px;
  }

  .brand-text {
    font-size: 1rem;
  }

  .brand-badge {
    font-size: 0.58rem;
    padding: 1px 5px;
  }

  .header-actions {
    width: 100%;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
    order: 2;
  }

  /* Layout: balance pill full row on top, lang on left & account on right below */
  .balance-pill {
    order: 1;
    width: 100%;
    justify-content: space-between;
    padding: 6px 12px;
    font-size: 0.78rem;
    gap: 6px;
  }

  /* Group "Số Dư:" and count tightly on the left, button on the right */
  .balance-pill .count {
    margin-right: auto;
    margin-left: 2px;
  }

  /* On account page with back-link, keep balance-pill compact beside back-link */
  .account-back-link {
    order: 1;
  }

  .account-back-link ~ .balance-pill {
    order: 2;
    width: auto;
    justify-content: flex-start;
    padding: 5px 8px;
    font-size: 0.76rem;
  }

  .account-back-link ~ .balance-pill .count {
    margin-right: 0;
    margin-left: 0;
  }

  .account-back-link ~ .lang-selector-wrapper {
    order: 3;
    margin-left: auto;
  }

  .account-back-link ~ #authContainer {
    order: 4;
    gap: 6px;
  }

  .lang-selector-wrapper {
    order: 2;
  }

  #authContainer {
    order: 3;
    gap: 6px;
  }

  .lang-btn {
    padding: 5px 8px;
    font-size: 0.78rem;
    gap: 4px;
  }

  /* Language dropdown: opens from right edge inward to the left to avoid screen overflow */
  .lang-dropdown {
    right: 0;
    left: auto;
    width: 170px;
    max-width: calc(100vw - 24px);
  }

  /* User dropdown: opens from right edge inward to the left */
  .user-dropdown-menu {
    right: 0;
    left: auto;
    width: 230px;
    max-width: calc(100vw - 20px);
  }

  .btn-upgrade-sm {
    padding: 4px 8px;
    font-size: 0.72rem;
  }

  .btn-auth-signin,
  .btn-auth-signup {
    padding: 5px 10px;
    font-size: 0.78rem;
  }

  .btn-demo-pill {
    padding: 5px 8px;
    font-size: 0.76rem;
  }

  .user-pill-btn {
    padding: 4px 8px 4px 4px;
    gap: 6px;
  }

  .user-pill-name {
    font-size: 0.78rem;
    max-width: 80px;
  }

  .user-avatar {
    width: 28px;
    height: 28px;
  }

  /* --- MAIN WORKSPACE --- */
  .main-wrapper {
    padding: 14px 12px;
  }

  .studio-card {
    padding: 14px 14px;
    gap: 10px;
    border-radius: var(--radius-md);
  }

  .card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .card-title {
    font-size: 0.95rem;
  }

  .presets-bar {
    width: 100%;
  }

  .btn-file-upload {
    width: 100%;
    justify-content: center;
    padding: 8px 12px;
  }

  /* --- TEXTAREA --- */
  .script-textarea {
    min-height: 140px;
    font-size: 16px !important;
    padding: 12px;
  }

  .textarea-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    font-size: 0.74rem;
  }

  .counts-group {
    gap: 10px;
    flex-wrap: wrap;
  }

  /* --- VOICE PICKER --- */
  .voice-picker-panel {
    padding: 10px;
  }

  .voice-picker-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .voice-custom-select {
    height: 40px;
    font-size: 0.86rem;
  }

  .custom-dropdown-trigger {
    height: 40px;
    font-size: 0.86rem;
  }

  .custom-dropdown-menu {
    min-width: 100%;
  }

  .btn-preview-voice {
    height: 40px;
    padding: 0 10px;
    font-size: 0.76rem;
  }

  /* --- SLIDERS --- */
  .sliders-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .sliders-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .slider-label {
    font-size: 0.8rem;
  }

  .custom-range::-webkit-slider-thumb {
    width: 20px;
    height: 20px;
  }

  /* --- PRO TOGGLE ROW --- */
  .pro-feature-toggle-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 10px 12px;
  }

  .pro-toggle-hint {
    text-align: left;
    font-size: 0.72rem;
  }

  /* --- STUDIO ACTIONS --- */
  .studio-actions-group {
    flex-direction: column;
    gap: 8px;
  }

  .btn-primary-action,
  .btn-secondary-action,
  .btn-icon-action {
    width: 100%;
    justify-content: center;
    padding: 12px 16px;
    font-size: 0.88rem;
  }

  /* --- TABS --- */
  .tabs-header-wrapper {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding-bottom: 10px;
  }

  .tabs-nav {
    width: 100%;
  }

  .tab-btn {
    flex: 1;
    text-align: center;
    padding: 8px 10px;
    font-size: 0.8rem;
  }

  .tabs-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .tab-pane {
    min-height: 300px;
    max-height: 450px;
  }

  .empty-state {
    height: 280px;
    gap: 10px;
  }

  .empty-icon {
    font-size: 2rem;
  }

  /* --- TIMELINE ITEMS --- */
  .timeline-item {
    padding: 8px 10px;
    gap: 8px;
    flex-wrap: wrap;
  }

  .timeline-stamp {
    font-size: 0.72rem;
    padding: 2px 6px;
  }

  .timeline-text {
    font-size: 0.84rem;
    width: 100%;
    order: 3;
  }

  /* --- SENTENCES TABLE --- */
  .sentences-table {
    font-size: 0.78rem;
  }

  .sentences-table th,
  .sentences-table td {
    padding: 8px 8px;
  }

  /* --- MASTER EXPORT BAR --- */
  .master-export-bar {
    padding: 16px;
    border-radius: var(--radius-md);
    gap: 14px;
  }

  .export-player-wrapper {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
  }

  .btn-master-play {
    width: 40px;
    height: 40px;
  }

  .master-track-info {
    width: 100%;
  }

  .master-track-title {
    font-size: 0.86rem;
  }

  .export-buttons-group {
    width: 100%;
    flex-direction: column;
  }

  .btn-download-tag,
  .btn-download-zip {
    width: 100%;
    justify-content: center;
    padding: 10px 14px;
  }

  /* --- GENERATION LOADING BAR --- */
  .generation-loading-bar {
    padding: 16px;
    border-radius: var(--radius-md);
  }

  .loading-bar-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .loading-bar-percent {
    font-size: 1.1rem;
  }

  /* --- MODALS --- */
  .modal-overlay {
    padding: max(16px, env(safe-area-inset-top, 16px)) 14px max(24px, env(safe-area-inset-bottom, 24px)) 14px;
    align-items: flex-start;
    justify-content: center;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .modal-box {
    padding: 26px 18px 24px 18px;
    border-radius: var(--radius-lg);
    max-height: calc(100dvh - 36px);
    max-height: min(88vh, calc(100dvh - 36px));
    margin: auto 0;
    animation: modalSlideUp 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }

  @keyframes modalSlideUp {
    0% {
      opacity: 0;
      transform: scale(0.95) translateY(12px);
    }

    100% {
      opacity: 1;
      transform: scale(1) translateY(0);
    }
  }

  .modal-box-auth {
    max-width: 420px;
    width: 100%;
    padding: 28px 18px 24px 18px;
  }

  .modal-box-contact {
    max-width: 100%;
    padding: 28px 18px 24px 18px;
  }

  .modal-close-btn {
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    z-index: 30;
  }

  /* --- PRICING MODAL --- */
  #pricingModal .modal-box {
    max-height: min(86vh, calc(100dvh - 36px));
    padding: 28px 18px 24px 18px;
  }

  .pricing-header {
    margin-bottom: 18px;
    padding-right: 36px;
    text-align: left;
  }

  .pricing-title {
    font-size: 1.3rem;
    line-height: 1.25;
  }

  .pricing-subtitle {
    font-size: 0.84rem;
    margin-top: 4px;
  }

  .pricing-cards-grid {
    gap: 16px;
  }

  .pricing-card {
    padding: 18px 16px;
  }

  .plan-name {
    font-size: 1.05rem;
  }

  .plan-price {
    font-size: 1.7rem;
  }

  .plan-features-list {
    font-size: 0.8rem;
  }

  /* --- FAQ GRID --- */
  .faq-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .faq-section {
    margin-top: 36px;
    padding-top: 28px;
  }

  .faq-title {
    font-size: 1.4rem;
  }

  .faq-subtitle {
    font-size: 0.86rem;
  }

  .faq-card {
    padding: 18px;
  }

  /* --- FOOTER --- */
  .site-footer {
    padding: 24px 14px;
  }

  .footer-container {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
    font-size: 0.8rem;
  }

  .footer-nav {
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px;
  }

  /* --- TOAST --- */
  .toast-notice {
    left: 12px;
    right: 12px;
    bottom: 12px;
    max-width: none;
    min-width: auto;
    font-size: 0.84rem;
    padding: 10px 12px;
  }

  /* --- AUTH TABS --- */
  .auth-tabs-nav {
    gap: 4px;
  }

  .auth-tab-pill {
    padding: 8px 10px;
    font-size: 0.82rem;
  }

  .auth-text-input {
    padding: 10px 12px;
    font-size: 16px !important;
  }

  .btn-auth-action {
    padding: 12px 16px;
    font-size: 0.88rem;
  }

  /* --- ACCOUNT BACK LINK (in header) --- */
  .account-back-link {
    font-size: 0.78rem;
    padding: 5px 8px;
  }

  /* --- ACCOUNT PAGE --- */
  .account-wrapper {
    padding: 20px 12px 40px 12px;
  }

  .account-header-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .account-title {
    font-size: 1.45rem;
  }

  .account-subtitle {
    font-size: 0.86rem;
  }

  .account-user-hero {
    flex-direction: column;
    text-align: center;
    gap: 10px;
  }

  .account-user-hero img {
    width: 48px;
    height: 48px;
  }

  .account-info-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 8px 0;
  }

  .account-card {
    padding: 18px;
    border-radius: 12px;
  }

  .account-card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .account-metric-huge {
    font-size: 1.9rem;
  }

  .account-table-wrapper {
    border-radius: 10px;
  }

  .account-table {
    font-size: 0.78rem;
  }

  .account-table th,
  .account-table td {
    padding: 10px 10px;
  }

  .account-form-actions {
    flex-direction: column;
  }

  .account-form-actions .btn-card-action {
    width: 100%;
  }

  .btn-card-action {
    padding: 12px 16px;
    font-size: 0.86rem;
  }
}

/* ==================== RESPONSIVE: SMALL MOBILE (max-width: 480px) ==================== */
@media (max-width: 480px) {

  .header-container {
    padding: 8px 10px;
  }

  .brand-text {
    font-size: 0.92rem;
  }

  .brand-badge {
    display: none;
  }

  .header-actions {
    gap: 6px;
  }

  /* Stack balance + auth vertically on very small screens */
  .lang-btn {
    padding: 4px 6px;
    font-size: 0.74rem;
  }

  .balance-pill {
    padding: 5px 10px;
    font-size: 0.74rem;
    gap: 4px;
  }

  .btn-upgrade-sm {
    padding: 3px 6px;
    font-size: 0.68rem;
  }

  .btn-auth-signin,
  .btn-auth-signup {
    padding: 4px 8px;
    font-size: 0.74rem;
  }

  .btn-demo-pill {
    padding: 4px 6px;
    font-size: 0.72rem;
  }

  /* Workspace extra compact */
  .main-wrapper {
    padding: 10px 8px;
  }

  .studio-card {
    padding: 12px 10px;
  }

  .script-textarea {
    min-height: 120px;
    font-size: 16px !important;
    padding: 10px;
  }

  .voice-picker-label {
    font-size: 0.7rem;
  }

  /* Slider touch targets */
  .custom-range::-webkit-slider-thumb {
    width: 22px;
    height: 22px;
  }

  .custom-range {
    height: 6px;
  }

  /* Modal full width */
  .modal-overlay {
    padding: max(12px, env(safe-area-inset-top, 12px)) 10px max(20px, env(safe-area-inset-bottom, 20px)) 10px;
    align-items: flex-start;
    justify-content: center;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .modal-box {
    padding: 22px 14px 20px 14px;
    border-radius: 16px;
    max-height: calc(100dvh - 24px);
    max-height: min(86vh, calc(100dvh - 24px));
    margin: auto 0;
  }

  #pricingModal .modal-box {
    max-height: min(84vh, calc(100dvh - 24px));
    padding: 22px 14px 20px 14px;
  }

  #pricingModal .pricing-header {
    margin-bottom: 16px;
    padding-right: 36px;
    text-align: left;
  }

  /* Export bar */
  .master-export-bar {
    padding: 14px 12px;
    gap: 12px;
  }

  .master-scrubber-row {
    font-size: 0.72rem;
  }

  /* Pricing */
  .pricing-title {
    font-size: 1.18rem;
    line-height: 1.25;
  }

  .plan-price {
    font-size: 1.5rem;
  }

  .pricing-card {
    padding: 16px 14px;
    gap: 12px;
  }

  .featured-badge {
    font-size: 0.65rem;
    padding: 3px 10px;
  }

  /* FAQ */
  .faq-title {
    font-size: 1.2rem;
  }

  .faq-card {
    padding: 14px;
  }

  /* Footer */
  .footer-nav {
    gap: 10px;
    font-size: 0.78rem;
  }

  /* Toast */
  .toast-notice {
    left: 8px;
    right: 8px;
    bottom: 8px;
    padding: 10px 10px;
    font-size: 0.82rem;
    border-radius: 10px;
  }

  /* Account page */
  .account-wrapper {
    padding: 16px 10px 40px 10px;
  }

  .account-title {
    font-size: 1.35rem;
  }

  .account-subtitle {
    font-size: 0.84rem;
  }

  .account-card {
    padding: 16px;
    border-radius: 12px;
  }

  .account-metric-huge {
    font-size: 1.8rem;
  }

  .account-table th,
  .account-table td {
    padding: 8px 10px;
    font-size: 0.78rem;
  }

  .tx-id-code {
    font-size: 0.7rem;
    padding: 2px 4px;
  }
}

.account-wrapper {
  max-width: 1000px;
  margin: 0 auto;
  padding: 36px 20px 60px 20px;
  width: 100%;
  flex: 1;
}

.account-header {
  margin-bottom: 28px;
}

.account-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  flex-wrap: wrap;
  gap: 12px;
}

.account-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 8px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  transition: all 0.2s ease;
}

.account-back-link:hover {
  color: var(--text-main);
  background: var(--bg-tertiary);
  border-color: #CBD5E1;
}

.account-title {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.account-subtitle {
  font-size: 0.94rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.account-cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 28px;
}

@media (max-width: 768px) {
  .account-cards-grid {
    grid-template-columns: 1fr;
  }
}

.account-card {
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
}

.account-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-light);
}

.account-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.account-user-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.account-user-hero img {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-full);
  border: 2px solid var(--border-light);
}

.account-user-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
}

.account-user-email {
  font-size: 0.86rem;
  color: var(--text-muted);
}

.account-info-rows {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
  flex: 1;
}

.account-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.88rem;
  padding: 6px 0;
  border-bottom: 1px dashed #F1F5F9;
}

.account-info-label {
  color: var(--text-secondary);
}

.account-info-value {
  font-weight: 600;
  color: var(--text-main);
}

.account-metric-huge {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #0F172A;
  margin: 6px 0 16px 0;
}

.account-metric-unit {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-left: 6px;
}

.btn-card-action {
  width: 100%;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
}

.btn-card-action.primary {
  background: #000000;
  color: #FFFFFF;
  border: 1px solid #000000;
}

.btn-card-action.primary:hover {
  background: #1F2937;
}

.btn-card-action.danger-subtle {
  background: #FEF2F2;
  color: #DC2626;
  border: 1px solid #FCA5A5;
  margin-top: 10px;
}

.btn-card-action.danger-subtle:hover {
  background: #FEE2E2;
}

/* Account Form Elements */
.account-form-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

@media (max-width: 820px) {
  .account-form-grid {
    grid-template-columns: 1fr;
  }
}

.account-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.account-form-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.account-form-input {
  width: 100%;
  height: 42px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background: var(--bg-primary);
  font-size: 0.88rem;
  color: var(--text-main);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.account-form-input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

.account-form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.account-table-wrapper {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--border-light);
  margin-top: 12px;
}

.account-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  text-align: left;
}

.account-table th {
  background: #F8FAFC;
  padding: 12px 16px;
  color: var(--text-secondary);
  font-weight: 600;
  border-bottom: 1px solid var(--border-light);
  white-space: nowrap;
}

.account-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #F1F5F9;
  color: var(--text-main);
  white-space: nowrap;
}

.account-table tr:last-child td {
  border-bottom: none;
}

.account-empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.status-badge-completed {
  display: inline-flex;
  align-items: center;
  background: #DCFCE7;
  color: #166534;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.tx-id-code {
  background: #F1F5F9;
  padding: 3px 6px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: var(--text-secondary);
}

/* ==================== TOAST NOTICES ==================== */
.toast-notice {
  position: fixed;
  bottom: 28px;
  right: 28px;
  min-width: 300px;
  max-width: 480px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.12), 0 8px 10px -6px rgba(0, 0, 0, 0.06);
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  z-index: 999999;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-main);
  animation: toastSlideUp 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: all 0.2s ease;
}

.toast-notice.active {
  display: flex !important;
}

@keyframes toastSlideUp {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.96);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.toast-notice.success,
.toast-notice.toast-success {
  background: #F0FDF4;
  border-color: #86EFAC;
  color: #166534;
}

.toast-notice.error,
.toast-notice.toast-error {
  background: #FEF2F2;
  border-color: #FECACA;
  color: #991B1B;
}

.toast-notice.info,
.toast-notice.toast-info {
  background: #F8FAFC;
  border-color: #CBD5E1;
  color: #1E293B;
}

.toast-notice.warning,
.toast-notice.toast-warning {
  background: #FFFBEB;
  border-color: #FCD34D;
  color: #B45309;
}

.toast-message {
  flex: 1;
  line-height: 1.45;
  display: flex;
  align-items: center;
  gap: 8px;
}

.toast-close-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: currentColor;
  opacity: 0.65;
  transition: opacity 0.15s, background-color 0.15s;
  font-size: 1.25rem;
  line-height: 1;
}

.toast-close-btn:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.08);
}