/* === Quotespeak — Colorful Playful Theme (Enhanced UX) === */
:root {
  --bg: #0B1020;
  --surface: rgba(18,26,51,0.72);
  --surface-2: rgba(15,23,48,0.65);
  --text: #EAF0FF;
  --muted: #A9B4D0;
  --border: rgba(234,240,255,0.10);
  --primary: #FF4D8D;
  --primary-glow: rgba(255,77,141,0.35);
  --primary-contrast: #0B1020;
  --accent: #36CFC9;
  --accent-glow: rgba(54,207,201,0.3);
  --danger: #FF5A5F;
  --success: #2CE59B;
  --warning: #FFD166;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --shadow-1: 0 12px 35px rgba(0,0,0,0.35);
  --shadow-2: 0 26px 70px rgba(0,0,0,0.55);
  --shadow-glow: 0 0 40px var(--primary-glow);
  --ring: rgba(255,77,141,0.45);
  --font-sans: ui-rounded, system-ui, -apple-system, "SF Pro Rounded", "Apple SD Gothic Neo", "Noto Sans KR", Arial, sans-serif;
  --glass-border: 1px solid rgba(255,255,255,0.08);
  --glass-blur: blur(20px);
}

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

html {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-tap-highlight-color: transparent;
}

/* === Animated background === */
body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background:
    radial-gradient(ellipse 80% 50% at 20% 30%, rgba(255,77,141,0.08) 0%, transparent 60%),
    radial-gradient(ellipse 60% 60% at 80% 70%, rgba(54,207,201,0.06) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 50% 90%, rgba(124,58,237,0.05) 0%, transparent 50%),
    var(--bg);
  position: relative;
}

/* Animated floating orbs */
body::before,
body::after {
  content: '';
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  filter: blur(80px);
  opacity: 0.4;
}
body::before {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, var(--primary-glow), transparent 60%);
  top: -100px;
  left: -100px;
  animation: orb-float-1 20s ease-in-out infinite;
}
body::after {
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, var(--accent-glow), transparent 60%);
  bottom: -80px;
  right: -80px;
  animation: orb-float-2 25s ease-in-out infinite;
}
@keyframes orb-float-1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(60px, 80px) scale(1.15); }
  66% { transform: translate(-30px, 50px) scale(0.9); }
}
@keyframes orb-float-2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(-50px, -60px) scale(1.1); }
  66% { transform: translate(40px, -30px) scale(0.95); }
}

#particle-canvas {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 0;
  pointer-events: none;
}

/* Everything above particles */
.appbar, .step-indicator, .main-content, .toast-container {
  position: relative;
  z-index: 1;
}

/* === AppBar — Glass === */
.appbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(18,26,51,0.65);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: var(--glass-border);
  min-height: 72px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.appbar-title {
  font-size: 22px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.appbar-title .logo-icon {
  font-size: 28px;
  -webkit-text-fill-color: initial;
  animation: logo-bounce 3s ease-in-out infinite;
}
@keyframes logo-bounce {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-3px) rotate(-5deg); }
  75% { transform: translateY(2px) rotate(3deg); }
}
.appbar-actions {
  display: flex;
  gap: 8px;
}

/* === Main Content === */
.main-content {
  flex: 1;
  padding: 16px;
  max-width: 480px;
  margin: 0 auto;
  width: 100%;
}

/* === Step Indicator === */
.step-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 0;
}
.step-dot {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface-2);
  backdrop-filter: var(--glass-blur);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.step-dot.active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--primary-contrast);
  box-shadow: 0 0 20px var(--primary-glow), 0 0 60px rgba(255,77,141,0.15);
  transform: scale(1.15);
}
.step-dot.done {
  background: var(--success);
  border-color: var(--success);
  color: var(--primary-contrast);
  box-shadow: 0 0 12px rgba(44,229,155,0.3);
}
.step-line {
  width: 48px;
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  transition: all 0.4s ease-out;
  position: relative;
  overflow: hidden;
}
.step-line.done {
  background: linear-gradient(90deg, var(--success), var(--accent));
}
.step-line.done::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent);
  animation: shimmer 2s ease-in-out infinite;
}
@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* === Card — Glass Morphism === */
.card {
  background: var(--surface);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-1);
  transition: transform 0.25s ease-out, box-shadow 0.25s ease-out, opacity 0.4s ease-out;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-2);
}
.card-title {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text);
  letter-spacing: -0.01em;
}

/* === Buttons — Gradient + Glow === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  -webkit-user-select: none;
  user-select: none;
  font-family: var(--font-sans);
  position: relative;
  overflow: hidden;
}
.btn::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent 60%);
  opacity: 0;
  transition: opacity 0.2s;
}
.btn:hover::after { opacity: 1; }
.btn:active { transform: scale(0.95); }
.btn:disabled { opacity: 0.35; pointer-events: none; }

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #FF6B9D);
  color: var(--primary-contrast);
  box-shadow: 0 4px 20px var(--primary-glow);
}
.btn-primary:hover {
  box-shadow: 0 6px 30px var(--primary-glow), 0 0 60px rgba(255,77,141,0.15);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border: var(--glass-border);
  backdrop-filter: var(--glass-blur);
}
.btn-secondary:hover { background: var(--surface); }

.btn-accent {
  background: linear-gradient(135deg, var(--accent), #4DD9D2);
  color: var(--primary-contrast);
  box-shadow: 0 4px 20px var(--accent-glow);
}
.btn-accent:hover {
  box-shadow: 0 6px 30px var(--accent-glow);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
}
.btn-ghost:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.btn-ghost::after { display: none; }

.btn-block { width: 100%; }
.btn-sm { min-height: 40px; padding: 8px 16px; font-size: 14px; }

/* === Recording UI — Premium Feel === */
.recorder-circle {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(255,255,255,0.06), var(--surface-2));
  border: 3px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 24px auto;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}
/* Idle breathing glow */
.recorder-circle::before {
  content: '';
  position: absolute;
  top: -8px; left: -8px; right: -8px; bottom: -8px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--primary-glow), transparent 70%);
  opacity: 0;
  transition: opacity 0.3s;
  animation: breathe 3s ease-in-out infinite;
}
.recorder-circle:hover::before { opacity: 0.6; }

@keyframes breathe {
  0%, 100% { transform: scale(0.95); opacity: 0.3; }
  50% { transform: scale(1.05); opacity: 0.6; }
}

.recorder-circle:hover {
  transform: scale(1.05);
  border-color: var(--primary);
}
.recorder-circle:active { transform: scale(0.97); }

.recorder-circle.recording {
  border-color: var(--danger);
  background: radial-gradient(circle at 35% 35%, rgba(255,90,95,0.15), var(--surface-2));
  animation: pulse-ring 1.5s infinite;
}
.recorder-circle.recording::before {
  background: radial-gradient(circle, rgba(255,90,95,0.4), transparent 70%);
  opacity: 0.8;
  animation: breathe-recording 0.8s ease-in-out infinite;
}
@keyframes breathe-recording {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.15); opacity: 0.8; }
}

.recorder-circle .mic-icon {
  font-size: 48px;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.3));
  transition: transform 0.3s;
}
.recorder-circle:hover .mic-icon { transform: scale(1.1); }
.recorder-circle.recording .mic-icon { animation: mic-pulse 0.6s ease-in-out infinite alternate; }
@keyframes mic-pulse {
  from { transform: scale(1); }
  to { transform: scale(1.12); }
}

@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(255,90,95,0.5); }
  70% { box-shadow: 0 0 0 24px rgba(255,90,95,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,90,95,0); }
}

.recorder-timer {
  text-align: center;
  font-size: 32px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}
.recorder-hint {
  text-align: center;
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 16px;
}

/* Level meter — rainbow gradient bars */
.level-meter {
  display: flex;
  gap: 3px;
  justify-content: center;
  height: 40px;
  align-items: flex-end;
  margin-bottom: 16px;
}
.level-bar {
  width: 5px;
  border-radius: 3px;
  transition: height 0.06s ease-out;
  min-height: 4px;
}
/* Gradient bars from accent to primary */
.level-bar:nth-child(1)  { background: #36CFC9; }
.level-bar:nth-child(2)  { background: #3EC5CB; }
.level-bar:nth-child(3)  { background: #4FBBCF; }
.level-bar:nth-child(4)  { background: #65AFD2; }
.level-bar:nth-child(5)  { background: #7FA3D4; }
.level-bar:nth-child(6)  { background: #9A96D6; }
.level-bar:nth-child(7)  { background: #B488D8; }
.level-bar:nth-child(8)  { background: #CB7AD8; }
.level-bar:nth-child(9)  { background: #DB6FCC; }
.level-bar:nth-child(10) { background: #E764BE; }
.level-bar:nth-child(11) { background: #F059AD; }
.level-bar:nth-child(12) { background: #F5519F; }
.level-bar:nth-child(13) { background: #FA4C93; }
.level-bar:nth-child(14) { background: #FF4D8D; }
.level-bar:nth-child(15) { background: #FF5A7A; }
.level-bar:nth-child(16) { background: #FF6B6B; }

/* === Voice Profile Bar === */
.profile-bar {
  padding: 12px 16px;
  margin-bottom: 12px;
  background: var(--surface);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-1);
}
.profile-bar-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--muted);
  margin-bottom: 8px;
}
.profile-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.profile-chip {
  padding: 7px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  color: var(--muted);
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  font-family: var(--font-sans);
}
.profile-chip:hover {
  background: rgba(255,255,255,0.08);
  color: var(--text);
  transform: translateY(-1px);
}
.profile-chip.active {
  background: linear-gradient(135deg, var(--accent), #4DD9D2);
  color: var(--primary-contrast);
  border-color: transparent;
  box-shadow: 0 4px 16px var(--accent-glow);
}
.profile-chip-add {
  background: rgba(255,255,255,0.06);
  border-style: dashed;
  font-size: 18px;
  font-weight: 700;
  min-width: 36px;
  justify-content: center;
  color: var(--accent);
}
.profile-chip-add:hover {
  background: rgba(54,207,201,0.12);
  color: var(--accent);
  border-color: var(--accent);
}

/* === Consent === */
.consent-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: var(--radius-sm);
  margin-top: 16px;
  transition: background 0.2s;
}
.consent-row:hover { background: rgba(255,255,255,0.05); }
.consent-row input[type="checkbox"] {
  width: 24px;
  height: 24px;
  min-width: 24px;
  accent-color: var(--primary);
  margin-top: 2px;
  cursor: pointer;
}
.consent-row label {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
  cursor: pointer;
}

/* === Quotes === */
.category-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.chip {
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  color: var(--muted);
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  min-height: 40px;
  display: inline-flex;
  align-items: center;
}
.chip:hover {
  background: rgba(255,255,255,0.08);
  color: var(--text);
  transform: translateY(-1px);
}
.chip.active {
  background: linear-gradient(135deg, var(--primary), #FF6B9D);
  color: var(--primary-contrast);
  border-color: transparent;
  box-shadow: 0 4px 16px var(--primary-glow);
}

.quote-list {
  max-height: 420px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
  padding-right: 4px;
}
.quote-item {
  padding: 16px 18px 16px 20px;
  background: rgba(255,255,255,0.05);
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 2px solid rgba(255,255,255,0.06);
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 72px;
}
.quote-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
  opacity: 0;
  transition: opacity 0.2s;
}
.quote-item:hover {
  border-color: rgba(54,207,201,0.3);
  background: rgba(54,207,201,0.06);
  transform: translateX(4px);
}
.quote-item:hover::before { opacity: 1; }
.quote-item.selected {
  border-color: var(--primary);
  background: rgba(255,77,141,0.10);
  box-shadow: 0 0 20px rgba(255,77,141,0.1);
}
.quote-item.selected::before {
  background: var(--primary);
  opacity: 1;
}
.quote-item .q-text {
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 6px;
  line-height: 1.6;
  color: #fff;
}
.quote-item .q-author {
  font-size: 13px;
  color: var(--muted);
  font-style: italic;
}

.search-input, .text-input {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  color: var(--text);
  font-size: 15px;
  font-family: var(--font-sans);
  outline: none;
  transition: all 0.2s ease-out;
}
.search-input:focus, .text-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--ring), 0 0 20px rgba(255,77,141,0.1);
  background: rgba(255,77,141,0.03);
}
.text-input { resize: vertical; min-height: 80px; }
.char-counter {
  text-align: right;
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}
.char-counter.over { color: var(--danger); font-weight: 600; }

/* Daily quote — Animated gradient + sparkle */
.daily-banner {
  background: linear-gradient(135deg, #7C3AED, var(--primary), var(--accent));
  background-size: 200% 200%;
  animation: gradient-shift 6s ease infinite;
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 16px;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(124,58,237,0.2);
}
@keyframes gradient-shift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
.daily-banner::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.12) 0%, transparent 50%, rgba(255,255,255,0.06) 100%);
}
.daily-banner:hover {
  transform: scale(1.02) translateY(-2px);
  box-shadow: 0 12px 40px rgba(124,58,237,0.3);
}
.daily-banner .daily-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 10px;
  color: rgba(255,255,255,0.85);
  position: relative;
}
.daily-banner .daily-text {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  position: relative;
  line-height: 1.5;
  text-shadow: 0 1px 8px rgba(0,0,0,0.2);
}

/* Language toggle */
.lang-toggle {
  display: flex;
  gap: 4px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 22px;
  padding: 4px;
  margin-bottom: 12px;
  width: fit-content;
}
.lang-btn {
  padding: 6px 18px;
  border: none;
  border-radius: 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  background: transparent;
  color: var(--muted);
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  font-family: var(--font-sans);
}
.lang-btn.active {
  background: linear-gradient(135deg, var(--primary), #FF6B9D);
  color: var(--primary-contrast);
  box-shadow: 0 2px 12px var(--primary-glow);
}

/* === Result/Share Step === */
.audio-player {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
}
.play-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #FF6B9D);
  color: var(--primary-contrast);
  border: none;
  cursor: pointer;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 20px var(--primary-glow);
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.play-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 30px var(--primary-glow);
}
.play-btn:active { transform: scale(0.95); }

.audio-waveform {
  flex: 1;
  height: 44px;
  display: flex;
  gap: 2px;
  align-items: center;
}
.audio-waveform .wave-bar {
  width: 3px;
  background: linear-gradient(180deg, var(--accent), var(--primary));
  border-radius: 2px;
  min-height: 4px;
  transition: height 0.15s ease-out;
}

/* Card preview */
.card-preview-container {
  position: relative;
  width: 100%;
  padding-top: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 12px;
  background: var(--surface-2);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}
.card-preview-container canvas {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
}

.template-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
.tmpl-thumb {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
}
.tmpl-thumb:hover {
  transform: scale(1.05);
  border-color: rgba(255,255,255,0.2);
}
.tmpl-thumb canvas { width: 100%; height: 100%; display: block; }
.tmpl-thumb.active {
  border-color: var(--primary);
  box-shadow: 0 0 16px var(--primary-glow);
  transform: scale(1.05);
}

/* Share buttons */
.share-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

/* Duration toggle */
.duration-toggle {
  display: flex;
  gap: 4px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 22px;
  padding: 4px;
  margin-bottom: 12px;
  width: fit-content;
}

/* === Toast — Glass === */
.toast-container {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  width: 90%;
  max-width: 400px;
}
.toast {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  pointer-events: auto;
  animation: toast-in 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: var(--shadow-2);
  backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
}
.toast.info {
  background: rgba(18,26,51,0.85);
  color: var(--text);
}
.toast.success {
  background: rgba(44,229,155,0.9);
  color: #000;
}
.toast.error {
  background: rgba(255,90,95,0.9);
  color: #fff;
}
.toast.warning {
  background: rgba(255,209,102,0.9);
  color: #000;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(-20px) scale(0.9); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* === Spinner — Dual ring === */
.spinner {
  width: 44px;
  height: 44px;
  border: 4px solid rgba(255,255,255,0.08);
  border-top-color: var(--primary);
  border-bottom-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 24px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

.generating-status {
  text-align: center;
  padding: 24px;
}
.generating-status p {
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
}

/* === Step Panel === */
.step-panel {
  display: none;
}
.step-panel.active {
  display: block;
}

/* === Delete data === */
.danger-zone {
  border: 1px solid rgba(255,90,95,0.3);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-top: 24px;
  background: rgba(255,90,95,0.04);
}
.danger-zone .card-title { color: var(--danger); }

/* === Nav buttons === */
.nav-row {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}
.nav-row .btn { flex: 1; }

/* === Scroll — Thin stylish === */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--primary), var(--accent));
  border-radius: 3px;
}

/* === Responsive === */
@media (min-width: 640px) {
  .main-content { padding: 24px; }
  .template-selector { grid-template-columns: repeat(6, 1fr); }
}

/* hidden helper */
.hidden { display: none !important; }

/* === Icon buttons in appbar === */
.icon-btn {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  color: var(--muted);
  cursor: pointer;
  font-size: 20px;
  transition: all 0.2s;
}
.icon-btn:hover {
  color: var(--text);
  background: rgba(255,255,255,0.08);
  transform: scale(1.05);
}
.icon-btn:active { transform: scale(0.95); }

/* === Audio preview — Glassmorphism === */
.audio-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 14px;
  background: rgba(44,229,155,0.06);
  border: 1px solid rgba(44,229,155,0.15);
  border-radius: var(--radius-sm);
  animation: preview-in 0.3s ease-out;
}
@keyframes preview-in {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}
.audio-preview .btn { min-height: 40px; padding: 8px 16px; }

/* === Selection glow === */
::selection {
  background: var(--primary);
  color: var(--primary-contrast);
}

/* === Focus visible === */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
