/* ==========================================================================
   LANFACTORY MOSS VOICE STUDIO - CYBER STYLESHEET
   Electric Crimson Red (#ff202e), Obsidian Dark (#0a0a0f), Stark White (#fff)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Chakra+Petch:ital,wght@0,400;0,600;0,700;1,700&family=Inter:wght@300;400;500;600;700&family=Rajdhani:wght@500;600;700&family=Orbitron:wght@700;900&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* Brand Theme Colors */
  --bg-main: #07070b;
  --bg-surface: #0e0e14;
  --bg-card: #13131c;
  --bg-card-hover: #1b1b26;
  --bg-elevated: #212130;
  --bg-input: #0b0b10;

  --red-primary: #ff202e;
  --red-hover: #ff4754;
  --red-deep: #b80d19;
  --red-glow: rgba(255, 32, 46, 0.45);
  --red-subtle: rgba(255, 32, 46, 0.12);
  --red-border: rgba(255, 32, 46, 0.28);

  --cyan-accent: #00f0ff;
  --cyan-glow: rgba(0, 240, 255, 0.4);
  --green-online: #10b981;
  --amber-warn: #f59e0b;

  --text-primary: #ffffff;
  --text-secondary: #e2e8f0;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);

  --font-display: 'Chakra Petch', 'Orbitron', sans-serif;
  --font-heading: 'Rajdhani', sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.7);
  --shadow-glow: 0 0 24px var(--red-glow);
  --shadow-cyan-glow: 0 0 24px var(--cyan-glow);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-pill: 9999px;

  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  background-color: var(--bg-main);
  background-image: 
    radial-gradient(circle at 50% 0%, rgba(255, 32, 46, 0.12) 0%, transparent 55%),
    radial-gradient(circle at 90% 40%, rgba(0, 240, 255, 0.04) 0%, transparent 45%),
    linear-gradient(to bottom, #07070b 0%, #040407 100%);
  background-attachment: fixed;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
::-webkit-scrollbar-track {
  background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
  background: var(--bg-elevated);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--red-primary);
}

/* Container */
.container {
  width: 100%;
  max-width: 1380px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header & Top Bar */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(7, 7, 11, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  gap: 1.5rem;
}

.logo-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.logo-img-badge {
  border-radius: 50%;
  box-shadow: 0 0 14px var(--red-glow);
  object-fit: cover;
  transition: var(--transition);
}

.logo-brand:hover .logo-img-badge {
  transform: scale(1.06) rotate(4deg);
}

.logo-text-group {
  display: flex;
  flex-direction: column;
}

.logo-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--text-primary);
  line-height: 1.1;
}

.logo-title span {
  color: var(--red-primary);
  text-shadow: 0 0 10px var(--red-glow);
}

.logo-sub {
  font-size: 0.68rem;
  letter-spacing: 1px;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* Top Nav Links */
.header-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-link:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
  color: var(--red-primary);
  background: var(--red-subtle);
  border: 1px solid var(--red-border);
}

/* Server Status Pill in Header */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  background: rgba(18, 18, 26, 0.9);
  border: 1px solid var(--border-subtle);
  font-size: 0.78rem;
  font-family: var(--font-mono);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}

.status-pill:hover {
  border-color: var(--border-strong);
  background: var(--bg-card);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-dim);
}

.status-dot.online {
  background: var(--green-online);
  box-shadow: 0 0 8px var(--green-online);
  animation: pulse-online 2s infinite ease-in-out;
}

.status-dot.offline {
  background: var(--red-primary);
  box-shadow: 0 0 8px var(--red-primary);
}

@keyframes pulse-online {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.65; transform: scale(1.25); }
}

/* Studio Hero Banner */
.studio-hero {
  padding: 2.2rem 0 1.2rem;
}

.hero-header-box {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.hero-title-group h1 {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  line-height: 1.1;
  color: var(--text-primary);
}

.hero-title-group h1 span {
  color: var(--red-primary);
  text-shadow: 0 0 18px var(--red-glow);
}

.hero-subtitle {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-top: 0.35rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  background: var(--red-subtle);
  color: var(--red-primary);
  border: 1px solid var(--red-border);
}

/* Studio Layout Grid */
.studio-grid {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 1.75rem;
  padding: 1.5rem 0 3.5rem;
  align-items: start;
}

@media (max-width: 1100px) {
  .studio-grid {
    grid-template-columns: 1fr;
  }
}

/* Glass Panels */
.glass-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.6rem;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.glass-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255, 32, 46, 0.4), transparent);
}

/* Studio Navigation Tabs */
.studio-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  background: var(--bg-card);
  padding: 5px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}

.tab-btn {
  flex: 1;
  min-width: 140px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.tab-btn.active {
  color: #fff;
  background: var(--red-primary);
  box-shadow: 0 0 16px var(--red-glow);
}

/* Tab Content */
.tab-pane {
  display: none;
}
.tab-pane.active {
  display: block;
  animation: fadeIn 0.25s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Section Subheaders */
.pane-header {
  margin-bottom: 1.25rem;
}
.pane-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}
.pane-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Audio Source Switcher (Mic vs File vs Library) */
.clone-source-switcher {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.source-opt {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 12px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
}

.source-opt:hover {
  border-color: var(--border-strong);
  background: var(--bg-card-hover);
}

.source-opt.active {
  border-color: var(--red-primary);
  background: var(--red-subtle);
  box-shadow: inset 0 0 12px rgba(255, 32, 46, 0.15);
}

.source-opt-icon {
  font-size: 1.5rem;
  margin-bottom: 6px;
}

.source-opt-label {
  font-size: 0.88rem;
  font-weight: 600;
  font-family: var(--font-heading);
  letter-spacing: 0.5px;
}

/* Microphone Recording HUD */
.record-hud {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  text-align: center;
  margin-bottom: 1.25rem;
}

.record-hud-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

/* Oscilloscope Canvas */
.oscilloscope-canvas {
  width: 100%;
  max-width: 520px;
  height: 70px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Big Mic Record Button */
.btn-record {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 2px solid var(--red-primary);
  color: var(--red-primary);
  font-size: 1.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  box-shadow: 0 0 15px rgba(255, 32, 46, 0.2);
}

.btn-record:hover {
  transform: scale(1.08);
  background: var(--red-primary);
  color: #fff;
  box-shadow: 0 0 25px var(--red-glow);
}

.btn-record.recording {
  background: var(--red-primary);
  color: #fff;
  animation: pulse-recording 1.2s infinite ease-in-out;
  box-shadow: 0 0 35px var(--red-glow);
}

@keyframes pulse-recording {
  0%, 100% { transform: scale(1); box-shadow: 0 0 20px var(--red-glow); }
  50% { transform: scale(1.1); box-shadow: 0 0 45px rgba(255, 32, 46, 0.8); }
}

.record-timer {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--text-primary);
}

.record-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Drag & Drop Upload Zone */
.drop-zone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-md);
  background: rgba(18, 18, 26, 0.4);
  padding: 2rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 1.25rem;
}

.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--red-primary);
  background: var(--red-subtle);
}

.drop-zone-icon {
  font-size: 2.2rem;
  color: var(--red-primary);
  margin-bottom: 8px;
}

.drop-zone-text {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.drop-zone-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Audio Source Selected Preview Pill */
.source-preview-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--red-border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  margin-bottom: 1.25rem;
}

.source-preview-info {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
}

.source-preview-audio {
  height: 34px;
  max-width: 240px;
}

/* Form Groups & Inputs */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-counter {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.form-control {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.92rem;
  outline: none;
  transition: var(--transition);
  resize: vertical;
}

.form-control:focus {
  border-color: var(--red-primary);
  box-shadow: 0 0 12px var(--red-glow);
  background: #0d0d14;
}

/* Prompt Sample Badges */
.sample-prompts-bar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.sample-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  padding: 3px 10px;
  font-size: 0.75rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.sample-chip:hover {
  background: var(--red-subtle);
  color: var(--text-primary);
  border-color: var(--red-border);
}

/* Voice Preset Grid */
.voice-filters {
  display: flex;
  gap: 6px;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.voice-filter-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  padding: 4px 12px;
  font-size: 0.78rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.voice-filter-btn:hover {
  color: #fff;
  border-color: var(--border-strong);
}

.voice-filter-btn.active {
  background: var(--red-primary);
  color: #fff;
  border-color: var(--red-primary);
  box-shadow: 0 0 10px var(--red-glow);
}

.voices-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75rem;
  max-height: 380px;
  overflow-y: auto;
  padding-right: 4px;
  margin-bottom: 1.25rem;
}

.voice-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.voice-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.voice-card.selected {
  border-color: var(--red-primary);
  background: var(--red-subtle);
  box-shadow: 0 0 16px rgba(255, 32, 46, 0.2);
}

.voice-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.voice-card-flag {
  font-size: 1.1rem;
}

.voice-card-gender {
  font-size: 0.68rem;
  text-transform: uppercase;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

.voice-card-name {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}

.voice-card-tag {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Voice Library Grid */
.library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

.lib-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: var(--transition);
}

.lib-card:hover {
  border-color: var(--border-strong);
  background: var(--bg-card-hover);
}

.lib-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.lib-card-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
}

.lib-card-meta {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

.lib-card-actions {
  display: flex;
  gap: 6px;
  margin-top: auto;
}

/* Sliders and Options */
.options-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.range-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

input[type="range"] {
  flex: 1;
  accent-color: var(--red-primary);
  background: var(--bg-input);
}

/* Primary CTA Button */
.btn-cta {
  width: 100%;
  background: linear-gradient(135deg, var(--red-primary) 0%, var(--red-deep) 100%);
  border: 1px solid var(--red-hover);
  color: #fff;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 4px 20px var(--red-glow);
}

.btn-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 30px rgba(255, 32, 46, 0.7);
  background: linear-gradient(135deg, var(--red-hover) 0%, var(--red-primary) 100%);
}

.btn-cta:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Secondary Button */
.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-sm:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: var(--border-strong);
}

.btn-sm-danger {
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.3);
}
.btn-sm-danger:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: #ef4444;
}

/* Spinner */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

/* ==========================================================================
   RIGHT COLUMN: AUDIO PLAYER & STUDIO OUTPUT DECK
   ========================================================================== */
.output-deck {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Player Card */
.player-card {
  background: var(--bg-surface);
  border: 1px solid var(--red-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: 0 0 30px rgba(255, 32, 46, 0.15);
  position: relative;
  overflow: hidden;
}

.player-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--red-primary);
  box-shadow: 0 0 10px var(--red-primary);
}

.player-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.player-badge {
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--red-primary);
  text-transform: uppercase;
}

.player-voice-name {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.player-prompt-quote {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 1.25rem;
  max-height: 60px;
  overflow-y: auto;
}

/* Waveform Visualizer Canvas */
.waveform-canvas {
  width: 100%;
  height: 80px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  margin-bottom: 1rem;
  display: block;
}

/* Player Controls */
.player-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.btn-play-pause {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--red-primary);
  border: none;
  color: #fff;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 0 14px var(--red-glow);
  flex-shrink: 0;
}

.btn-play-pause:hover {
  transform: scale(1.08);
  box-shadow: 0 0 22px var(--red-glow);
}

.scrub-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.scrub-slider {
  width: 100%;
  accent-color: var(--red-primary);
  cursor: pointer;
}

.time-row {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Player Action Bar */
.player-actions {
  display: flex;
  gap: 8px;
  margin-top: 1rem;
  border-top: 1px solid var(--border-subtle);
  padding-top: 1rem;
}

/* Generation History Panel */
.history-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
}

.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.history-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 450px;
  overflow-y: auto;
  padding-right: 4px;
}

.history-item {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.history-item:hover {
  border-color: var(--border-strong);
  background: var(--bg-card-hover);
}

.history-item-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.history-item-voice {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.history-item-time {
  font-size: 0.72rem;
  font-family: var(--font-mono);
  color: var(--text-dim);
}

.history-item-text {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.history-item-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: 4px;
}

/* Diagnostics Modal / Drawer */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-dialog {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  max-width: 620px;
  width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9);
  transform: translateY(20px);
  transition: transform 0.25s ease;
}

.modal-overlay.open .modal-dialog {
  transform: translateY(0);
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}

.modal-close:hover {
  color: #fff;
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.code-box {
  background: #000;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: #a7f3d0;
  overflow-x: auto;
  margin: 10px 0;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideIn 0.3s ease-out;
  max-width: 380px;
}

.toast.toast-error {
  border-color: var(--red-primary);
  background: #1f0b0e;
  box-shadow: 0 0 16px var(--red-glow);
}

.toast.toast-success {
  border-color: var(--green-online);
  background: #0b1f14;
}

@keyframes slideIn {
  from { transform: translateX(50px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Footer */
.site-footer {
  margin-top: auto;
  background: #040407;
  border-top: 1px solid var(--border-subtle);
  padding: 2rem 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}
