/* ============================================================
   MZX-Cupertino Tech-Minimalism Design System
   ============================================================ */

:root {
  --bg-base: #FAFAFB;
  --bg-surface: #FFFFFF;
  --text-primary: #050505;
  --text-secondary: #8A8A8E;
  --accent-blue: #0071E3;
  --accent-purple: #7828C8;
  --border-subtle: rgba(0, 0, 0, 0.04);
  --search-active-bg: #0A0A0A;
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --spring: cubic-bezier(0.175, 0.885, 0.32, 1.05);
  --ease-smooth: cubic-bezier(0.16, 1, 0.3, 1);
  --shadow-default: 0 4px 12px rgba(0,0,0,0.02);
  --shadow-hover: 0 16px 32px rgba(0,0,0,0.06);
  --blur-bg: rgba(250, 250, 251, 0.7);
  --transition-fast: 0.2s var(--ease-smooth);
  --transition-medium: 0.35s var(--ease-smooth);
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  font-weight: 400;
  transition: background 0.5s var(--ease-smooth);
}

body.search-active {
  background: var(--search-active-bg);
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  outline: none;
}

input, textarea, select {
  font-family: inherit;
  border: none;
  outline: none;
}

/* ============================================================
   Navigation - Glassmorphic Header
   ============================================================ */

.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  background: var(--blur-bg);
  border-bottom: 1px solid var(--border-subtle);
  transition: var(--transition-medium);
}

body.search-active .nav {
  background: rgba(10, 10, 10, 0.7);
  border-bottom-color: rgba(255,255,255,0.06);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 8px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-logo {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 800;
  font-size: 13px;
}

.nav-title {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  transition: color 0.5s var(--ease-smooth);
}

body.search-active .nav-title {
  color: #fff;
}

.nav-tabs {
  display: flex;
  gap: 2px;
  background: rgba(0,0,0,0.03);
  border-radius: 10px;
  padding: 3px;
  transition: var(--transition-medium);
}

body.search-active .nav-tabs {
  background: rgba(255,255,255,0.06);
}

.nav-tab {
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
  color: var(--text-secondary);
  background: transparent;
  transition: all 0.2s var(--ease-smooth);
  white-space: nowrap;
}

.nav-tab:hover {
  color: var(--text-primary);
}

.nav-tab.active {
  background: var(--bg-surface);
  color: var(--text-primary);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

body.search-active .nav-tab {
  color: rgba(255,255,255,0.5);
}

body.search-active .nav-tab.active {
  background: rgba(255,255,255,0.12);
  color: #fff;
  box-shadow: none;
}

body.search-active .nav-tab:hover {
  color: rgba(255,255,255,0.8);
}

/* ============================================================
   Main Layout
   ============================================================ */

.main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px;
  transition: var(--transition-medium);
}

body.search-active .main {
  filter: brightness(0.3) blur(4px);
  transform: scale(0.96);
  pointer-events: none;
  user-select: none;
}

/* ============================================================
   Bento Card Base
   ============================================================ */

.card {
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-default);
  transition: box-shadow 0.3s var(--ease-smooth), transform 0.2s var(--ease-smooth);
  overflow: hidden;
}

.card:hover {
  box-shadow: var(--shadow-hover);
}

.card-header {
  padding: 20px 24px 0;
}

.card-body {
  padding: 20px 24px;
}

.card-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.card-title {
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.card-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ============================================================
   Two-Column Grid
   ============================================================ */

.layout-2col {
  display: grid;
  grid-template-columns: 3fr 1fr;
  gap: 32px;
  align-items: start;
}

.layout-full {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (max-width: 960px) {
  .layout-2col {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   Form Elements
   ============================================================ */

.field {
  margin-bottom: 16px;
}

.field-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.field-input,
.field-textarea,
.field-select {
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 10px;
  background: var(--bg-base);
  color: var(--text-primary);
  transition: all 0.2s var(--ease-smooth);
}

.field-input:focus,
.field-textarea:focus,
.field-select:focus {
  border-color: var(--accent-blue);
  background: var(--bg-surface);
  box-shadow: 0 0 0 3px rgba(0,113,227,0.1);
}

.field-textarea {
  resize: vertical;
  min-height: 80px;
  line-height: 1.5;
}

/* ============================================================
   Buttons
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  border-radius: 10px;
  transition: all 0.2s var(--ease-smooth);
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--accent-blue);
  color: #fff;
}

.btn-primary:hover {
  background: #0066CC;
  box-shadow: 0 4px 14px rgba(0,113,227,0.3);
}

.btn-secondary {
  background: rgba(0,0,0,0.04);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: rgba(0,0,0,0.08);
}

.btn-danger {
  background: rgba(255,59,48,0.08);
  color: #FF3B30;
}

.btn-danger:hover {
  background: rgba(255,59,48,0.15);
}

.btn-ghost {
  background: transparent;
  color: var(--accent-blue);
  padding: 8px 12px;
}

.btn-ghost:hover {
  background: rgba(0,113,227,0.06);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 8px;
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

/* ============================================================
   Voice Line / Dialogue Row (Bento Card inside TTS)
   ============================================================ */

.dialogue-lines {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.dialogue-line {
  background: var(--bg-base);
  border: 1px solid rgba(0,0,0,0.04);
  border-radius: var(--radius-md);
  padding: 20px;
  position: relative;
  transition: all 0.2s var(--ease-smooth);
}

.dialogue-line:hover {
  border-color: rgba(0,113,227,0.15);
}

.dialogue-line-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.dialogue-line-number {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.dialogue-line-voice {
  flex: 1;
  min-width: 0;
}

.dialogue-line-actions {
  display: flex;
  gap: 4px;
}

.dialogue-line-remove {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all 0.15s var(--ease-smooth);
}

.dialogue-line-remove:hover {
  background: rgba(255,59,48,0.08);
  color: #FF3B30;
}

.dialogue-line-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 640px) {
  .dialogue-line-body {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   Advanced Params Toggle Section
   ============================================================ */

.advanced-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 6px 10px;
  border-radius: 8px;
  background: transparent;
  transition: all 0.15s var(--ease-smooth);
  margin-top: 12px;
}

.advanced-toggle:hover {
  color: var(--accent-blue);
  background: rgba(0,113,227,0.04);
}

.advanced-toggle-icon {
  font-size: 14px;
  transition: transform 0.3s var(--spring);
}

.advanced-toggle.open .advanced-toggle-icon {
  transform: rotate(180deg);
}

.advanced-params {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.4s var(--ease-smooth), opacity 0.3s var(--ease-smooth), margin 0.3s var(--ease-smooth);
  margin-top: 0;
}

.advanced-params.show {
  max-height: 600px;
  opacity: 1;
  margin-top: 14px;
}

.advanced-params-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  padding: 14px;
  background: var(--bg-surface);
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,0.04);
}

/* ============================================================
   Emotion Sliders
   ============================================================ */

.emotion-sliders {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.emotion-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 50px;
}

.emotion-emoji {
  font-size: 20px;
}

.emotion-input {
  width: 100%;
  accent-color: var(--accent-blue);
}

.emotion-value {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-secondary);
}

/* ============================================================
   Voice Picker Dropdown
   ============================================================ */

.voice-picker {
  position: relative;
}

.voice-picker-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 10px;
  background: var(--bg-surface);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  transition: all 0.2s var(--ease-smooth);
  text-align: left;
}

.voice-picker-trigger:hover {
  border-color: var(--accent-blue);
}

.voice-picker-avatar {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  object-fit: cover;
  background: linear-gradient(135deg, #E8ECF0, #D5DAE0);
}

.voice-picker-avatar-placeholder {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
}

.voice-picker-name {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.voice-picker-chevron {
  color: var(--text-secondary);
  font-size: 12px;
  flex-shrink: 0;
}

.voice-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 50;
  background: var(--bg-surface);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.08);
  max-height: 280px;
  overflow-y: auto;
  display: none;
}

.voice-dropdown.open {
  display: block;
}

.voice-dropdown-search {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  background: var(--bg-surface);
  border-radius: 12px 12px 0 0;
}

.voice-dropdown-search input {
  width: 100%;
  padding: 8px 10px;
  font-size: 12px;
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 8px;
  background: var(--bg-base);
}

.voice-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
  transition: background 0.1s var(--ease-smooth);
}

.voice-dropdown-item:hover {
  background: rgba(0,113,227,0.04);
}

.voice-dropdown-item.selected {
  background: rgba(0,113,227,0.06);
}

.voice-dropdown-item-info {
  flex: 1;
  min-width: 0;
}

.voice-dropdown-item-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.voice-dropdown-item-meta {
  font-size: 11px;
  color: var(--text-secondary);
  display: flex;
  gap: 6px;
}

.voice-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.voice-tag-v2 {
  background: rgba(120,40,200,0.08);
  color: var(--accent-purple);
}

.voice-tag-v3 {
  background: rgba(0,113,227,0.08);
  color: var(--accent-blue);
}

/* ============================================================
   Task List
   ============================================================ */

.task-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.task-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: all 0.2s var(--ease-smooth);
}

.task-item:hover {
  border-color: rgba(0,0,0,0.08);
  box-shadow: var(--shadow-default);
}

.task-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.task-status-dot.pending {
  background: #FFD60A;
  box-shadow: 0 0 8px rgba(255,214,10,0.3);
}

.task-status-dot.processing {
  background: var(--accent-blue);
  box-shadow: 0 0 8px rgba(0,113,227,0.3);
  animation: pulse 1.5s infinite;
}

.task-status-dot.generated {
  background: #30D158;
  box-shadow: 0 0 8px rgba(48,209,88,0.3);
}

.task-status-dot.failed {
  background: #FF3B30;
  box-shadow: 0 0 8px rgba(255,59,48,0.3);
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

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

.task-id {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  font-family: 'SF Mono', 'Fira Code', monospace;
  letter-spacing: -0.01em;
}

.task-meta {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.task-audio {
  flex-shrink: 0;
}

.task-audio audio {
  height: 32px;
  border-radius: 8px;
}

.status-filter {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.status-filter-chip {
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 8px;
  background: rgba(0,0,0,0.03);
  color: var(--text-secondary);
  transition: all 0.15s var(--ease-smooth);
}

.status-filter-chip:hover {
  background: rgba(0,0,0,0.06);
}

.status-filter-chip.active {
  background: var(--accent-blue);
  color: #fff;
}

/* ============================================================
   Voice Changer Upload Area
   ============================================================ */

.upload-zone {
  border: 2px dashed rgba(0,0,0,0.08);
  border-radius: var(--radius-md);
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s var(--ease-smooth);
  background: var(--bg-base);
}

.upload-zone:hover,
.upload-zone.drag-over {
  border-color: var(--accent-blue);
  background: rgba(0,113,227,0.02);
}

.upload-zone-icon {
  font-size: 40px;
  margin-bottom: 12px;
  display: block;
}

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

.upload-zone-hint {
  font-size: 12px;
  color: var(--text-secondary);
}

.upload-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--bg-base);
  border-radius: 12px;
  margin-top: 12px;
}

.upload-preview-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 18px;
  flex-shrink: 0;
}

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

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

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

/* ============================================================
   Recording UI
   ============================================================ */

.recorder-card {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-base);
}

.recorder-controls {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
}

.recorder-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: all 0.25s var(--spring);
  flex-shrink: 0;
  position: relative;
}

.recorder-btn.recording {
  background: rgba(255,59,48,0.12);
  color: #FF3B30;
  box-shadow: 0 0 0 0 rgba(255,59,48,0.3);
  animation: record-pulse 1.5s infinite;
}

.recorder-btn.recording:hover {
  background: rgba(255,59,48,0.18);
}

.recorder-btn:not(.recording) {
  background: var(--accent-blue);
  color: #fff;
  box-shadow: 0 4px 12px rgba(0,113,227,0.25);
}

.recorder-btn:not(.recording):hover {
  transform: scale(1.06);
  box-shadow: 0 6px 20px rgba(0,113,227,0.35);
}

.recorder-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

@keyframes record-pulse {
  0% { box-shadow: 0 0 0 0 rgba(255,59,48,0.35); }
  50% { box-shadow: 0 0 0 10px rgba(255,59,48,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,59,48,0); }
}

.recorder-timer {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
  font-family: 'SF Mono', 'Fira Code', monospace;
  min-width: 80px;
}

.recorder-timer.recording {
  color: #FF3B30;
}

.recorder-status {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  flex: 1;
  min-width: 0;
}

.recorder-status.recording {
  color: #FF3B30;
}

.recorder-waveform {
  height: 48px;
  margin: 0 20px 12px;
  display: block;
  border-radius: 8px;
  background: var(--bg-surface);
  width: calc(100% - 40px);
}

.recorder-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.recorder-divider::before,
.recorder-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}

/* ============================================================
   Settings Page
   ============================================================ */

.settings-card {
  max-width: 520px;
}

.apikey-display {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--bg-base);
  border-radius: 10px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 13px;
  color: var(--text-secondary);
}

.apikey-display.has-key {
  color: #30D158;
  font-weight: 600;
}

/* ============================================================
   Toast / Notification
   ============================================================ */

.toast-container {
  position: fixed;
  top: 72px;
  right: 32px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 12px 20px;
  border-radius: 12px;
  background: var(--bg-surface);
  border: 1px solid rgba(0,0,0,0.08);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  font-size: 13px;
  font-weight: 600;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  animation: toast-in 0.35s var(--spring);
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 360px;
}

.toast.success { color: #30D158; }
.toast.error { color: #FF3B30; }
.toast.info { color: var(--accent-blue); }

.toast.removing {
  animation: toast-out 0.3s var(--ease-smooth) forwards;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(20px) scale(0.95); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes toast-out {
  from { opacity: 1; transform: translateX(0) scale(1); }
  to { opacity: 0; transform: translateX(20px) scale(0.95); }
}

/* ============================================================
   Loading Spinner
   ============================================================ */

.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(0,0,0,0.1);
  border-top-color: var(--accent-blue);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

/* ============================================================
   Empty State
   ============================================================ */

.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-secondary);
}

.empty-state-icon {
  font-size: 48px;
  display: block;
  margin-bottom: 12px;
  opacity: 0.6;
}

.empty-state-text {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
}

.empty-state-hint {
  font-size: 13px;
}

/* ============================================================
   Section Heading
   ============================================================ */

.section-heading {
  font-weight: 700;
  font-size: 28px;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--text-primary);
  margin-bottom: 20px;
}

.section-subheading {
  font-weight: 500;
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 24px;
  margin-top: -16px;
}

/* ============================================================
   Modal
   ============================================================ */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: rgba(0,0,0,0.3);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fade-in 0.2s var(--ease-smooth);
}

.modal {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 64px rgba(0,0,0,0.12);
  width: 90%;
  max-width: 560px;
  max-height: 85vh;
  overflow-y: auto;
  animation: modal-in 0.35s var(--spring);
}

.modal-header {
  padding: 24px 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.02em;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0,0,0,0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--text-secondary);
  transition: all 0.15s var(--ease-smooth);
}

.modal-close:hover {
  background: rgba(0,0,0,0.08);
  color: var(--text-primary);
}

.modal-body {
  padding: 20px 24px 24px;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modal-in {
  from { opacity: 0; transform: scale(0.92) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* ============================================================
   Checkbox & Toggle
   ============================================================ */

.toggle-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.toggle-switch {
  position: relative;
  width: 40px;
  height: 22px;
  border-radius: 11px;
  background: rgba(0,0,0,0.12);
  transition: background 0.2s var(--ease-smooth);
  flex-shrink: 0;
}

.toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  transition: transform 0.2s var(--spring);
}

input:checked + .toggle-switch {
  background: var(--accent-blue);
}

input:checked + .toggle-switch::after {
  transform: translateX(18px);
}

input[type="range"].field-range {
  width: 100%;
  accent-color: var(--accent-blue);
}

/* ============================================================
   Scrollbar
   ============================================================ */

::-webkit-scrollbar {
  width: 5px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.1);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0,0,0,0.2);
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 768px) {
  .main { padding: 20px 16px; }
  .nav-inner { padding: 0 16px; }
  .section-heading { font-size: 24px; }
  .toast-container { right: 16px; left: 16px; }
  .toast { max-width: none; }
  .task-item { flex-wrap: wrap; }
  .task-audio { width: 100%; }
  .task-audio audio { width: 100%; }
}
