/* ==========================================================================
   TABLE OF CONTENTS
   ==========================================================================
    1. CSS Variables & Theme ................. line 52
    2. Base & Reset .......................... line 76
    3. Views ................................. line 89
    4. Auth .................................. line 96
    5. Site Header ........................... line 156
    6. Layout (Container, Card, Dashboard) ... line 208
    7. Tool Grid ............................. line 247
    8. Section Headings ...................... line 364
    9. Forms ................................. line 374
   10. Buttons ............................... line 409
   11. Errors ................................ line 467
   12. Episode List .......................... line 494
   13. Transcript (Banner, View, Speakers) ... line 584
   14. Header Actions & Dropdown ............. line 741
   15. Copy Success .......................... line 786
   16. Footer ................................ line 795
   17. PUC Styles ............................ line 817
       - Mode Cards .......................... line 820
       - Keyword Tag Input ................... line 868
       - State Dropdown ...................... line 931
       - State Checkbox List ................. line 1024
       - Result Cards ........................ line 1064
       - Result Footer ....................... line 1137
       - Snippet ............................. line 1144
       - Summary ............................. line 1162
       - Full Summary ........................ line 1197
       - State Warnings ...................... line 1234
       - Empty State ......................... line 1246
   18. Spinner ............................... line 1255
   19. Date Input & Grid ..................... line 1270
   20. Header Spacer ......................... line 1296
   21. Upload (Tabs, Dropzone, Paste Zone) ... line 1304
       - Tabs ................................ line 1307
       - Dropzone ............................ line 1342
       - Zones Container ..................... line 1388
       - Paste Zone .......................... line 1400
       - File Info ........................... line 1563
       - Privacy Note ........................ line 1596
       - Model Row ........................... line 1608
       - Label Hint .......................... line 1620
   22. Email Modal ........................... line 1629
   23. Model Hint (mobile only) .............. line 1769
   24. Transcribe Button Tooltips ............ line 1787
   25. Utilities ............................. line 1824
   26. Mobile Overrides (≤600px) ............. line 1829
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. CSS Variables & Theme
   -------------------------------------------------------------------------- */

/* Reset & base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:           #0d1626;
  --surface:      #1a2a40;
  --surface2:     #1e2d42;
  --border:       #243650;
  --border-light: #2e445e;
  --text:         #ffffff;
  --text-muted:   #7a95b0;
  --accent:       #c8973a;
  --accent-hover: #e8b55a;
  --accent-dim:   rgba(200, 151, 58, 0.15);
  --text-dim:     #4a6080;
  --danger:       #f75a5a;
  --success:      #4caf7d;
  --radius:       10px;
  --font:         'DM Sans', system-ui, sans-serif;
  --serif:        'Playfair Display', Georgia, serif;

  /* Design-system aliases */
  --ink:          #0f1623;
  --ink-mid:      #1e2d42;
  --gold:         #c8973a;
  --gold-lt:      #e8b55a;
  --teal:         #1e7b74;
  --paper:        #f5f3ef;
  --fog:          #8fa3bb;
  --slate:        #4a6080;
}

/* --------------------------------------------------------------------------
   2. Base & Reset
   -------------------------------------------------------------------------- */

html, body {
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
}

body {
  background: var(--bg);
}

.skip-nav {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--accent);
  color: var(--bg);
  padding: 8px 16px;
  z-index: 1000;
  font-weight: bold;
  text-decoration: none;
  border-radius: 0 0 4px 0;
  transition: top 0.2s;
}
.skip-nav:focus {
  top: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------------------------
   3. Views
   -------------------------------------------------------------------------- */
.view { display: none; min-height: 100vh; }
.view.active { display: block; }
.view.hidden { display: none; }

/* --------------------------------------------------------------------------
   4. Auth
   -------------------------------------------------------------------------- */
#view-auth {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

.login-page {
  position: relative;
  z-index: 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-page::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 80% at 90% 10%, rgba(200, 151, 58, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse 50% 60% at 10% 90%, rgba(30, 123, 116, 0.05) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

.login-container {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: stretch;
  gap: 72px;
  max-width: 880px;
  width: 100%;
}

.brand-panel {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-right: 8px;
}

.brand-logo-wrap {
  width: 240px;
  max-width: 100%;
  margin-bottom: 8px;
  position: relative;
}

.brand-logo-wrap::after {
  content: '';
  position: absolute;
  top: 10%;
  left: 50%;
  transform: translateX(-50%);
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(200, 151, 58, 0.06) 0%, transparent 70%);
  pointer-events: none;
}

.brand-logo {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 4px 24px rgba(200, 151, 58, 0.1));
}

.brand-divider {
  width: 48px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
  border: none;
  margin: 20px 0;
  border-radius: 1px;
}

.brand-blurb {
  font-size: 0.92rem;
  line-height: 1.75;
  color: var(--text-muted);
  max-width: 380px;
}

.brand-blurb + .brand-blurb {
  margin-top: 14px;
}

.form-panel {
  width: 380px;
  flex-shrink: 0;
}

.auth-card {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 36px 32px 32px;
  position: relative;
  overflow: hidden;
}

.auth-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 32px;
  right: 32px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.5;
  border-radius: 0 0 2px 2px;
}

.card-heading {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.card-subheading {
  font-size: 0.82rem;
  color: var(--text-dim);
  margin-bottom: 28px;
}

.input-wrap {
  position: relative;
}

.input-wrap svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-dim);
  pointer-events: none;
  transition: color 0.2s;
}

.input-wrap:focus-within svg {
  color: var(--accent);
}

.input-wrap input[type="email"],
.input-wrap input[type="password"],
.input-wrap input[type="text"] {
  padding-left: 42px;
}

.btn-signin {
  background: var(--accent);
  color: var(--bg);
  width: 100%;
  padding: 13px;
  font-size: 0.95rem;
  font-weight: 700;
  margin-top: 8px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.15s, background 0.15s;
  letter-spacing: 0.01em;
  font-family: var(--font);
}

.btn-signin:hover:not(:disabled) {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.btn-signin:active {
  transform: translateY(0);
}

.btn-signin:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.card-divider {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  margin: 24px 0 20px;
}

.auth-links {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.auth-links a {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}

.auth-links a:hover {
  color: var(--accent);
}

.auth-help {
  margin-top: 16px;
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-dim);
}

.auth-help a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}

.auth-help a:hover {
  color: var(--accent);
}

.auth-centered {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 420px;
  max-width: 100%;
}

.brand-logo-wrap--sm {
  width: 160px;
  margin-bottom: 20px;
}

/* Legacy auth classes used by register/forgot-password/reset-password pages */
.auth-bg-logo {
  width: 360px;
  max-width: calc(100vw - 48px);
  height: auto;
  flex-shrink: 0;
}

.auth-content {
  width: 360px;
  max-width: calc(100vw - 48px);
  margin-top: -40px;
}

.auth-content--wide {
  width: 400px;
  max-width: calc(100vw - 48px);
  margin-top: -40px;
}

.auth-success {
  text-align: center;
  padding: 12px 0;
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.6;
}

/* Auth page nav (public pages: login, register, forgot/reset password) */
.auth-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.auth-nav-logo {
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.02em;
  text-decoration: none;
}

.auth-nav-logo span { color: var(--accent); }

.auth-nav-links {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.auth-nav-links a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.2s;
}

.auth-nav-links a:hover { color: var(--text); }

.auth-nav-cta {
  background: var(--accent) !important;
  color: var(--bg) !important;
  padding: 0.45rem 1.1rem;
  border-radius: 4px;
  font-weight: 600 !important;
}

.auth-nav-cta:hover {
  background: var(--accent-hover) !important;
}

.subtitle {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-bottom: 20px;
  text-align: center;
}

/* --------------------------------------------------------------------------
   5. Site Header
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
  height: 64px;
}

.site-header-inner {
  max-width: 1000px;
  margin: 0 auto;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 6px 10px 6px 6px;
  border-radius: 8px;
  transition: color 0.15s, background 0.15s;
  flex-shrink: 0;
}
.btn-back:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.site-home-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}
.site-home-link:hover { opacity: 0.85; }

.site-logo {
  width: 42px;
  height: 42px;
  object-fit: contain;
  flex-shrink: 0;
}

.site-title {
  flex: 1;
}

.site-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.01em;
}

.header-tool-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  flex: 1;
  text-align: center;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   6. Layout (Container, Card, Dashboard)
   -------------------------------------------------------------------------- */
.container {
  max-width: 700px;
  margin: 0 auto;
  padding: 32px 20px 60px;
}

.container--wide {
  max-width: 1000px;
}

/* ── Card ───────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px 24px;
}

/* ── Dashboard ──────────────────────────────── */
.dashboard-heading {
  margin-bottom: 28px;
}

.dashboard-heading h1 {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 4vw, 1.8rem);
  font-weight: 900;
  color: var(--text);
  margin-bottom: 4px;
}

.dashboard-heading p {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.65;
}

/* --------------------------------------------------------------------------
   7. Tool Grid
   -------------------------------------------------------------------------- */
.tool-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-auto-rows: 1fr;
  gap: 12px;
}

.tool-card {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 22px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}

.tool-card--active {
  cursor: pointer;
  border-color: var(--border);
}

.tool-card--active:hover {
  background: var(--border);
  border-color: var(--accent);
  transform: translateY(-2px);
}

.tool-card--active:hover .tool-icon {
  color: var(--accent);
  background: var(--accent-dim);
}

.tool-card--active:hover .tool-arrow {
  transform: translateX(4px);
  color: var(--accent);
}

.tool-card--soon {
  opacity: 0.55;
}

.tool-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text-muted);
  transition: background 0.15s, color 0.15s;
}

.tool-icon svg {
  width: 22px;
  height: 22px;
}

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

.tool-info h3 {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.tool-info p {
  font-size: 0.83rem;
  color: var(--text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tool-action {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.tool-arrow {
  color: var(--text-muted);
  width: 18px;
  height: 18px;
  transition: transform 0.15s, color 0.15s;
}

.tool-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.tool-badge--active {
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid var(--accent);
}

.tool-badge--soon {
  background: rgba(122, 156, 192, 0.08);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

/* --------------------------------------------------------------------------
   8. Section Headings
   -------------------------------------------------------------------------- */
.section-heading {
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-muted);
  margin: 28px 0 14px;
}

/* --------------------------------------------------------------------------
   9. Forms
   -------------------------------------------------------------------------- */
.field {
  margin-bottom: 14px;
}

label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

input[type="password"],
input[type="email"],
input[type="url"],
input[type="text"] {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.15s;
}

input:focus { border-color: var(--accent); }
input::placeholder { color: var(--text-muted); }

/* --------------------------------------------------------------------------
   10. Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border: none;
  border-radius: 8px;
  font-family: var(--font);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s, color 0.15s;
  text-decoration: none;
  white-space: nowrap;
}

.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--accent);
  color: var(--bg);
  width: 100%;
  padding: 12px;
  font-size: 0.95rem;
  font-weight: 700;
  margin-top: 4px;
}

.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }

.btn-secondary {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover:not(:disabled) { background: var(--border); }

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

.btn-ghost:hover:not(:disabled) { color: var(--text); background: var(--surface2); }

.btn-back {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  min-width: 80px;
}

/* --------------------------------------------------------------------------
   11. Errors
   -------------------------------------------------------------------------- */
.error {
  margin-top: 12px;
  padding: 10px 14px;
  background: rgba(247, 90, 90, 0.1);
  border: 1px solid rgba(247, 90, 90, 0.25);
  border-radius: 8px;
  color: var(--danger);
  font-size: 0.88rem;
}

/* ── Error support link ─────────────────────── */
.error-support {
  margin-top: 8px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.error-support a {
  color: var(--accent);
  text-decoration: none;
}

.error-support a:hover { text-decoration: underline; }

/* --------------------------------------------------------------------------
   12. Episode List
   -------------------------------------------------------------------------- */
#episode-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.episode-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  transition: border-color 0.15s;
}

.episode-card:hover { border-color: var(--accent); }

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

.episode-title {
  font-weight: 600;
  font-size: 0.93rem;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.episode-podcast-name {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-right: 10px;
  white-space: nowrap;
}

.episode-meta {
  display: flex;
  gap: 14px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.episode-description {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 5px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.episode-action {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-self: center;
}

.btn-transcribe {
  background: transparent;
  border: 1px solid var(--accent);
  padding: 7px 16px;
  font-size: 0.83rem;
  font-weight: 600;
  white-space: nowrap;
}

.btn-transcribe-fast,
.btn-transcribe-accurate {
  color: var(--accent);
}

.btn-transcribe-fast:hover:not(:disabled),
.btn-transcribe-accurate:hover:not(:disabled) {
  background: var(--accent);
  color: var(--bg);
}

/* --------------------------------------------------------------------------
   13. Transcript (Banner, View, Speakers)
   -------------------------------------------------------------------------- */

/* ── Transcript success banner ──────────────── */
.transcript-success {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(76, 175, 125, 0.1);
  border: 1px solid rgba(76, 175, 125, 0.25);
  border-radius: 8px;
  color: var(--success);
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 24px;
  animation: success-appear 0.4s ease;
}

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

/* ── Transcript ─────────────────────────────── */
.transcript-title {
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 20px;
  gap: 16px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.progress-bar-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 420px;
}

.progress-bar-track {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 99px;
  transition: width 1.8s ease;
}

.progress-pct {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  min-width: 36px;
  text-align: right;
}

#transcript-text {
  font-family: var(--font);
  font-size: 0.95rem;
  line-height: 1.85;
  color: var(--text);
}

#transcript-text p {
  margin-bottom: 1.2em;
}

#transcript-text p:last-child {
  margin-bottom: 0;
}

/* ── Speaker name panel ─────────────────────── */
.speaker-names {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px 16px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 24px;
}

.speaker-names-title {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  white-space: nowrap;
}

#speaker-names-inputs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  flex: 1;
}

.speaker-name-field {
  display: flex;
  align-items: center;
  gap: 7px;
}

.speaker-name-field input {
  width: 160px;
  max-width: 100%;
  padding: 6px 10px;
  font-size: 0.85rem;
}

/* ── Speaker labels ──────────────────────────── */
.speaker-label {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 2px 8px;
  border-radius: 4px;
  margin-right: 6px;
  vertical-align: middle;
  position: relative;
  top: -1px;
}

/* Cycle through distinct colors for up to 6 speakers */
.speaker-A { background: rgba(200,151,58,0.15); color: #c8973a; border: 1px solid rgba(200,151,58,0.3); }
.speaker-B { background: rgba(99,179,237,0.15); color: #63b3ed; border: 1px solid rgba(99,179,237,0.3); }
.speaker-C { background: rgba(104,211,145,0.15); color: #68d391; border: 1px solid rgba(104,211,145,0.3); }
.speaker-D { background: rgba(196,132,255,0.15); color: #c484ff; border: 1px solid rgba(196,132,255,0.3); }
.speaker-E { background: rgba(252,129,74,0.15);  color: #fc814a; border: 1px solid rgba(252,129,74,0.3); }
.speaker-F { background: rgba(129,230,217,0.15); color: #81e6d9; border: 1px solid rgba(129,230,217,0.3); }

/* --------------------------------------------------------------------------
   14. Header Actions & Dropdown
   -------------------------------------------------------------------------- */
.header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.btn-my-transcripts {
  margin-right: 0.5rem;
}

/* ── Dropdown ───────────────────────────────── */
.dropdown { position: relative; }

.dropdown-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  background: var(--surface2);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  min-width: 170px;
  max-width: calc(100vw - 24px);
  z-index: 100;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}

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

.dropdown-item {
  display: block;
  width: 100%;
  padding: 10px 16px;
  background: none;
  border: none;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.88rem;
  text-align: left;
  cursor: pointer;
  transition: background 0.1s;
}

.dropdown-item:hover { background: var(--border); }

/* --------------------------------------------------------------------------
   15. Copy Success
   -------------------------------------------------------------------------- */
.btn-copy-success {
  background: var(--success) !important;
  color: #fff !important;
  border-color: var(--success) !important;
}

/* --------------------------------------------------------------------------
   16. Footer
   -------------------------------------------------------------------------- */
.site-footer {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: left;
  line-height: 1.6;
}

.site-footer a {
  color: var(--accent);
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   17. PUC Styles
   -------------------------------------------------------------------------- */

/* ── PUC Mode Cards ─────────────────────────── */
.puc-mode-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 8px;
}

@media (max-width: 540px) {
  .puc-mode-grid { grid-template-columns: 1fr; }
}

.puc-mode-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.puc-mode-card:hover {
  border-color: var(--accent);
  background: var(--surface2);
}

.puc-mode-card:hover .tool-icon {
  color: var(--accent);
  background: var(--accent-dim);
}

.puc-mode-card h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-top: 4px;
}

.puc-mode-card p {
  font-size: 0.83rem;
  color: var(--text-muted);
  line-height: 1.5;
  flex: 1;
}

/* ── Keyword Tag Input ──────────────────────── */
.tag-input-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  min-height: 44px;
  cursor: text;
  transition: border-color 0.15s;
}

.tag-input-wrap:focus-within { border-color: var(--accent); }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}

.tag-remove {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  padding: 0;
  font-size: 1rem;
  line-height: 1;
  opacity: 0.7;
}

.tag-remove:hover { opacity: 1; }

.tag-input-field {
  border: none !important;
  background: transparent !important;
  padding: 2px 4px !important;
  min-width: 120px;
  flex: 1;
  color: var(--text);
  font-size: 0.88rem;
}

.tag-input-field:focus { outline: none; }

.tag-limit-warning {
  display: block;
  margin-top: 6px;
  font-size: 0.78rem;
  color: var(--danger);
}

/* ── State Dropdown ─────────────────────────── */
.state-dropdown {
  position: relative;
}

.state-dropdown-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 11px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.88rem;
  cursor: pointer;
  transition: border-color 0.15s;
  text-align: left;
}

.state-dropdown-toggle:hover,
.state-dropdown-toggle.open { border-color: var(--accent); }

.state-dropdown-toggle svg {
  flex-shrink: 0;
  color: var(--text-muted);
  transition: transform 0.15s;
}

.state-dropdown-toggle.open svg { transform: rotate(180deg); }

.state-dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  z-index: 100;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  overflow: hidden;
}

.state-search-wrap {
  padding: 8px;
  border-bottom: 1px solid var(--border);
}

.state-search-input {
  width: 100%;
  padding: 7px 10px !important;
  font-size: 0.85rem !important;
  background: var(--bg) !important;
  border: 1px solid var(--border) !important;
  border-radius: 6px !important;
  color: var(--text) !important;
}

.state-search-input:focus {
  border-color: var(--accent) !important;
  outline: none;
}

.state-dropdown-controls {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
}

.state-ctrl-btn {
  flex: 1;
  padding: 9px 12px;
  background: none;
  border: none;
  color: var(--accent);
  font-family: var(--font);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.1s;
  text-align: center;
}

.state-ctrl-btn:hover { background: var(--surface2); }

.state-ctrl-btn + .state-ctrl-btn {
  border-left: 1px solid var(--border);
}

/* ── State Checkbox List ────────────────────── */
.state-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  max-height: 200px;
  overflow-y: auto;
  padding: 6px;
}

@media (max-width: 480px) {
  .state-list { grid-template-columns: 1fr; }
}

.state-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.1s;
}

.state-checkbox:hover { background: var(--surface2); }

.state-checkbox input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}

.state-checkbox-label {
  font-size: 0.85rem;
  color: var(--text);
  cursor: pointer;
}

/* ── PUC Result Cards ───────────────────────── */
.puc-result-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.15s;
}

.puc-result-card:hover { border-color: var(--accent); }

.puc-result-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.puc-state-badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(99, 179, 237, 0.15);
  color: #63b3ed;
  border: 1px solid rgba(99, 179, 237, 0.3);
  flex-shrink: 0;
  white-space: nowrap;
}

.puc-result-title {
  font-weight: 600;
  font-size: 0.93rem;
  color: var(--text);
  flex: 1;
  min-width: 0;
}

.puc-result-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.puc-keyword-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.puc-keyword-chip {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  background: rgba(104, 211, 145, 0.15);
  color: #68d391;
  border: 1px solid rgba(104, 211, 145, 0.3);
}

.puc-snippet-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-style: italic;
  align-self: center;
}

/* ── PUC Result Footer ──────────────────────── */
.puc-result-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.puc-result-footer .btn {
  font-size: 0.8rem;
  padding: 6px 14px;
}

.puc-summary-spinner {
  width: 18px;
  height: 18px;
  border-width: 2px;
}

/* ── PUC Snippet ────────────────────────────── */
.puc-snippet {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.6;
  padding: 10px 12px;
  background: var(--bg);
  border-left: 2px solid var(--border-light);
  border-radius: 0 6px 6px 0;
}

mark.kw-highlight {
  background: var(--accent-dim);
  color: var(--accent);
  border-radius: 2px;
  padding: 0 1px;
}

/* ── PUC Summary ────────────────────────────── */
.puc-summary {
  padding: 12px 14px;
  background: rgba(99, 179, 237, 0.07);
  border: 1px solid rgba(99, 179, 237, 0.2);
  border-radius: 8px;
}

.puc-summary-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 0.83rem;
}

.puc-summary-text {
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.65;
  margin: 0;
}

.puc-summary-error {
  font-size: 0.83rem;
  color: var(--danger);
  margin: 0;
}

.puc-retry-btn {
  margin-top: 8px;
  font-size: 0.8rem;
  padding: 6px 14px;
}

/* ── PUC Full Summary ───────────────────────── */
.puc-full-summary {
  padding: 16px 18px;
  background: rgba(196, 132, 255, 0.07);
  border: 1px solid rgba(196, 132, 255, 0.2);
  border-radius: 8px;
}

.puc-full-summary-text {
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.7;
}

.puc-full-summary-text strong {
  color: var(--text);
  font-size: 0.88rem;
}

.puc-full-summary-text ul {
  margin: 6px 0 12px 18px;
  padding: 0;
}

.puc-full-summary-text li {
  margin-bottom: 4px;
}

.puc-full-summary-text p {
  margin: 0 0 6px;
}

.puc-full-summary-text br {
  display: block;
  margin: 4px 0;
}

/* ── PUC State Warnings ─────────────────────── */
.puc-state-warning {
  background: rgba(255, 193, 7, 0.12);
  border-left: 3px solid #ffc107;
  padding: 10px 14px;
  margin-bottom: 10px;
  border-radius: 6px;
  font-size: 0.83rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* ── PUC Empty State ────────────────────────── */
.puc-empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* --------------------------------------------------------------------------
   18. Spinner
   -------------------------------------------------------------------------- */
.spinner {
  width: 26px;
  height: 26px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

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

/* --------------------------------------------------------------------------
   19. Date Input & Grid
   -------------------------------------------------------------------------- */
input[type="date"] {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.15s;
  color-scheme: dark;
}

input[type="date"]:focus { border-color: var(--accent); }

/* ── Date grid ─────────────────────────────── */
.date-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* --------------------------------------------------------------------------
   20. Header Spacer
   -------------------------------------------------------------------------- */
.header-spacer {
  width: 80px;
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   21. Upload (Tabs, Dropzone, Paste Zone)
   -------------------------------------------------------------------------- */

/* ── Upload Tabs ───────────────────────────── */
.input-tabs {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 18px;
}

.input-tab {
  flex: 1;
  padding: 10px 16px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.input-tab:not(:last-child) {
  border-right: 1px solid var(--border);
}

.input-tab:hover:not(.active) {
  background: var(--surface2);
}

.input-tab.active {
  background: var(--accent-dim);
  color: var(--accent);
}

/* ── Upload Dropzone ───────────────────────── */
.upload-dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 36px 20px;
  border: 2px dashed var(--border-light);
  border-radius: var(--radius);
  color: var(--text-muted);
  text-align: center;
  transition: border-color 0.15s, background 0.15s;
  cursor: pointer;
}

.upload-dropzone:hover,
.upload-dropzone.dragover {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.upload-dropzone-text {
  font-size: 0.9rem;
}

.upload-dropzone-text strong {
  color: var(--accent);
}

.upload-dropzone-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  opacity: 0.7;
}

.upload-file-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

/* ── Upload Zones Container ──────────────────── */
.upload-zones {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* When paste zone is hidden (podcast upload), dropzone spans full width */
.upload-zones:has(.upload-paste-zone.hidden) {
  grid-template-columns: 1fr;
}

/* ── Upload Paste Zone ───────────────────────── */
.upload-paste-zone {
  position: relative;
  display: flex;
  flex-direction: column;
  border: 2px dashed var(--border-light);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, opacity 0.2s;
  outline: none;
  touch-action: manipulation;
}

.upload-paste-zone-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 36px 20px;
  width: 100%;
  color: var(--text-muted);
  text-align: center;
  outline: none;
  -webkit-user-select: none;
  user-select: none;
  caret-color: transparent;
  overflow: hidden;
}

.paste-zone-icon {
  transition: color 0.2s, transform 0.2s;
}

.upload-paste-zone-text {
  font-size: 0.9rem;
  transition: color 0.2s;
}

.upload-paste-zone-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  opacity: 0.7;
  transition: opacity 0.2s;
}

/* ── State: hover (idle) ─────────────────────── */
.upload-paste-zone:hover:not(.paste-disabled) {
  border-color: var(--accent);
  background: var(--accent-dim);
}

/* ── State: focused / active ─────────────────── */
.upload-paste-zone:focus-within:not(.paste-disabled) {
  border-color: var(--accent);
  border-style: solid;
  background: var(--accent-dim);
}

.upload-paste-zone:focus-within:not(.paste-disabled) .paste-zone-icon {
  color: var(--accent);
  transform: scale(1.08);
}

.upload-paste-zone:focus-within:not(.paste-disabled) .upload-paste-zone-text {
  color: var(--accent);
  font-weight: 600;
}

.upload-paste-zone:focus-within:not(.paste-disabled) .upload-paste-zone-hint {
  opacity: 1;
}

/* ── State: processing (brief "Got it!") ─────── */
.upload-paste-zone.paste-processing {
  border-color: var(--success);
  border-style: solid;
  background: rgba(76, 175, 125, 0.10);
  pointer-events: none;
}

.upload-paste-zone.paste-processing .paste-zone-icon {
  color: var(--success);
}

.upload-paste-zone.paste-processing .upload-paste-zone-text {
  color: var(--success);
  font-weight: 600;
}

.upload-paste-zone.paste-processing .upload-paste-zone-hint {
  opacity: 1;
}

/* ── State: error ────────────────────────────── */
.upload-paste-zone.paste-error-state {
  border-color: var(--danger);
  background: rgba(247, 90, 90, 0.06);
}

.upload-paste-zone.paste-error-state .paste-zone-icon {
  color: var(--danger);
}

/* ── State: disabled ─────────────────────────── */
.upload-paste-zone.paste-disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

/* ── Paste zone: inline error ────────────────── */
.paste-zone-error {
  font-size: 0.8rem;
  color: var(--danger);
  text-align: center;
  padding: 0 16px 10px;
  line-height: 1.4;
}

/* ── Paste zone: help button & tooltip ───────── */
.paste-zone-help-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: none;
  border: none;
  color: var(--text-muted);
  opacity: 0.5;
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  transition: opacity 0.15s, background 0.15s;
  line-height: 0;
}

.paste-zone-help-btn:hover,
.paste-zone-help-btn:focus {
  opacity: 1;
  background: var(--surface2);
  outline: none;
}

.paste-zone-tooltip {
  position: absolute;
  top: 32px;
  right: 8px;
  width: 240px;
  padding: 10px 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.78rem;
  color: var(--text);
  line-height: 1.5;
  z-index: 10;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.paste-zone-tooltip strong {
  color: var(--accent);
}

/* ── Upload File Info ──────────────────────── */
.upload-file-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.upload-file-name {
  flex: 1;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.upload-file-size {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.upload-clear-btn {
  font-size: 1.2rem;
  padding: 4px 8px;
  line-height: 1;
}

/* ── Upload Privacy Note ──────────────────── */
.upload-privacy-note {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin: 14px 0 4px;
  padding: 12px 14px;
  background: rgba(76, 175, 125, 0.08);
  border: 1px solid rgba(76, 175, 125, 0.2);
  border-radius: 8px;
}

/* ── Upload Model Row ──────────────────────── */
.upload-model-row {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.upload-model-row .btn {
  flex: 1;
  text-align: center;
}

/* ── Label Optional Hint ───────────────────── */
.label-optional {
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
  opacity: 0.7;
}

/* --------------------------------------------------------------------------
   22. Email Modal
   -------------------------------------------------------------------------- */

.email-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}

.email-modal-backdrop.hidden { display: none; }

.email-modal {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 24px;
  width: 100%;
  max-width: 480px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
}

.email-modal-title {
  color: var(--text);
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 16px;
}

.email-modal-label {
  display: block;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.email-modal-input {
  display: block;
  width: 100%;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.9rem;
  margin-bottom: 12px;
  outline: none;
  transition: border-color 0.15s;
  box-sizing: border-box;
}

.email-modal-input:focus {
  border-color: var(--accent);
}

.email-modal-input.invalid {
  border-color: var(--danger);
}

.email-modal-error {
  color: var(--danger);
  font-size: 0.78rem;
  margin: -8px 0 12px;
}

.email-modal-preview-toggle {
  margin-bottom: 16px;
}

.email-modal-preview-toggle summary {
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  user-select: none;
  padding: 4px 0;
}

.email-modal-preview-toggle summary:hover {
  color: var(--text);
}

.email-modal-preview {
  background: #ffffff;
  color: #1a1a1a;
  border-radius: 8px;
  padding: 16px;
  margin-top: 8px;
  max-height: 200px;
  overflow-y: auto;
  font-family: var(--font);
  font-size: 0.85rem;
  line-height: 1.8;
}

.email-modal-preview p {
  margin: 0 0 1em;
}

.email-modal-preview .email-speaker {
  font-weight: 700;
  color: #1a3a6e;
}

.email-modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.email-modal-send {
  min-width: 80px;
  position: relative;
}

.email-modal-send--loading {
  color: transparent !important;
}

.email-modal-send--loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(13, 22, 38, 0.3);
  border-top-color: var(--bg);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* --------------------------------------------------------------------------
   23. Model Hint (mobile only)
   -------------------------------------------------------------------------- */
.model-hint {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-top: 14px;
}

.model-hint strong {
  color: var(--text);
}

@media (hover: hover) {
  .model-hint { display: none; }
}

.ai-disclaimer {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-family: var(--font);
  font-size: 0.82rem;
  color: var(--color-body);
  opacity: 0.7;
  padding: 0.75rem 0;
  margin-top: 0.75rem;
  border-top: 1px solid rgba(var(--color-gold-rgb, 200, 151, 58), 0.25);
}

.ai-disclaimer svg {
  flex-shrink: 0;
  margin-top: 2px;
}

/* --------------------------------------------------------------------------
   24. Transcribe Button Tooltips (desktop only)
   -------------------------------------------------------------------------- */
@media (hover: hover) {
  .btn-transcribe[data-tooltip] {
    position: relative;
  }

  .btn-transcribe[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    width: 240px;
    padding: 10px 12px;
    background: var(--surface2);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 400;
    color: var(--text);
    line-height: 1.5;
    z-index: 10;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    white-space: normal;
    text-align: left;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s;
  }

  .btn-transcribe[data-tooltip]:hover::after {
    opacity: 1;
  }
}

/* --------------------------------------------------------------------------
   25. Utilities
   -------------------------------------------------------------------------- */
.hidden { display: none !important; }

/* --------------------------------------------------------------------------
   26. Notification Settings
   -------------------------------------------------------------------------- */

.notification-settings {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding: 8px 12px;
  border-top: 1px solid var(--border);
}

.notification-settings-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.notification-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.notification-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  cursor: pointer;
  user-select: none;
}

.notification-toggle input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-icon {
  font-size: 1.1rem;
  opacity: 0.8;
  transition: opacity 0.15s;
}

.notification-toggle input:not(:checked) + .toggle-icon {
  opacity: 0.3;
}

.volume-slider {
  width: 80px;
  height: 44px;
  cursor: pointer;
  accent-color: var(--accent);
}

/* --------------------------------------------------------------------------
   27. My Transcripts
   -------------------------------------------------------------------------- */

.header-right {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.btn-back-list {
  min-width: 44px;
  min-height: 44px;
}

.btn-sm {
  padding: 6px 10px;
  font-size: 0.8rem;
}

.ts-search-wrap {
  margin-bottom: 20px;
}

.ts-search {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.15s;
}

.ts-search:focus {
  border-color: var(--accent);
}

.ts-search::placeholder {
  color: var(--text-muted);
}

.ts-card {
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.15s;
  margin-bottom: 10px;
  min-height: 44px;
}

.ts-card:hover,
.ts-card:focus-visible {
  border-color: var(--accent);
  outline: none;
}

.ts-card-header {
  margin-bottom: 8px;
}

.ts-card-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.4;
}

.ts-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.ts-podcast-name {
  color: var(--accent);
}

.ts-card-preview {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ts-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.ts-empty a {
  color: var(--accent);
  text-decoration: none;
}

.ts-empty a:hover {
  text-decoration: underline;
}

.ts-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 24px;
  padding-bottom: 24px;
}

.ts-page-info {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.ts-loading {
  text-align: center;
  color: var(--text-muted);
  padding: 40px 0;
}

.ts-detail-meta {
  margin-bottom: 24px;
}

.ts-detail-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.ts-detail-info {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.ts-delete-btn {
  color: var(--danger) !important;
}

.ts-delete-btn:hover:not(:disabled) {
  background: rgba(247, 90, 90, 0.1) !important;
}

/* --------------------------------------------------------------------------
   28b. My Account
   -------------------------------------------------------------------------- */

.acct-container {
  max-width: 500px;
}

.acct-section {
  margin-bottom: 20px;
}

.acct-heading {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.acct-info {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.acct-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.acct-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.acct-value {
  font-size: 0.95rem;
  color: var(--text);
}

.acct-loading {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.acct-success {
  margin-top: 12px;
  padding: 10px 14px;
  background: rgba(76, 175, 125, 0.1);
  border: 1px solid rgba(76, 175, 125, 0.25);
  border-radius: 8px;
  color: var(--success);
  font-size: 0.88rem;
}

.pw-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.pw-input-wrap input {
  width: 100%;
  padding-right: 44px;
}

.pw-toggle {
  position: absolute;
  right: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
}

.pw-toggle:hover {
  color: var(--accent);
}

/* --------------------------------------------------------------------------
   28. Mobile Overrides (≤600px)
   -------------------------------------------------------------------------- */
@media (max-width: 600px) {

  /* Tighter container and card padding */
  .container {
    padding: 20px 16px 40px;
  }

  .card {
    padding: 20px 16px;
  }

  /* Narrower header side padding */
  .site-header-inner {
    padding: 0 12px;
    gap: 8px;
  }

  /* Transcript header: shrink action buttons so they fit */
  .header-actions {
    gap: 4px;
  }

  .header-actions .btn {
    padding: 7px 8px;
    font-size: 0.76rem;
  }

  .btn-my-transcripts {
    display: none;
  }

  .ai-disclaimer {
    font-size: 0.78rem;
    padding: 0.5rem 0;
  }

  /* Back button: larger tap target on mobile */
  .btn-back {
    min-width: 60px;
    min-height: 44px;
    padding: 8px 16px;
    margin: -8px;
  }

  /* Episodes section: more breathing room on mobile */
  #episodes-section .section-heading {
    margin: 32px 0 10px;
  }

  #episodes-section .model-hint {
    margin-top: 10px;
    margin-bottom: 20px;
  }

  #episode-list {
    gap: 16px;
  }

  /* Episode card: stack vertically and allow title to wrap */
  .episode-card {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    padding: 18px 16px;
  }

  .episode-title {
    white-space: normal;
  }

  /* Transcribe buttons: spread side-by-side across full width */
  .episode-action {
    flex-direction: row;
  }

  .btn-transcribe {
    flex: 1;
    text-align: center;
  }

  /* Header spacer: shrink to match smaller back button */
  .header-spacer {
    width: 60px;
  }

  /* Speaker name inputs: full width on mobile */
  .speaker-names {
    gap: 10px;
  }

  .speaker-name-field {
    width: 100%;
  }

  .speaker-name-field input {
    width: 100%;
    flex: 1;
  }

  /* Date grid: stack vertically */
  .date-grid {
    grid-template-columns: 1fr;
  }

  /* Tag input: reduce minimum width */
  .tag-input-field {
    min-width: 80px;
  }

  /* Tool grid: single column on mobile, active tools first */
  .tool-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
  }

  #tool-transcriber { order: 1; }
  #tool-audio-transcriber { order: 2; }

  /* "Coming soon" cards follow in source order (3, 4) */
  .tool-card--soon { order: 5; }

  /* Tool card: tighter padding */
  .tool-card {
    padding: 12px 14px;
    gap: 12px;
  }

  /* Input tabs: smaller text on mobile */
  .input-tab {
    padding: 9px 10px;
    font-size: 0.8rem;
  }

  /* Upload zones: stack vertically on mobile, paste zone first */
  .upload-zones {
    grid-template-columns: 1fr;
  }

  .upload-paste-zone {
    order: -1;
  }

  .upload-paste-zone-inner {
    padding: 28px 16px;
  }

  /* Upload buttons: stack vertically on mobile */
  .upload-model-row {
    flex-direction: column;
  }

  /* PUC mode grid: already stacks at 540px via its own query */

  /* PUC result header: allow wrapping */
  .puc-result-header {
    flex-wrap: wrap;
  }

  /* PUC result footer: stack buttons vertically */
  .puc-result-footer {
    flex-direction: column;
  }

  .puc-result-footer .btn {
    width: 100%;
    text-align: center;
  }

  /* PUC result cards: tighter padding */
  .puc-result-card {
    padding: 14px;
  }

  /* Email modal: mobile overrides */
  .email-modal {
    padding: 20px 16px;
    max-height: 85vh;
  }

  .email-modal-actions {
    flex-direction: column-reverse;
  }

  .email-modal-actions .btn {
    width: 100%;
  }

  /* Auth pages: mobile */
  .login-container {
    flex-direction: column;
    gap: 36px;
    align-items: center;
    text-align: center;
  }

  .brand-panel {
    align-items: center;
    padding-right: 0;
  }

  .brand-logo-wrap {
    width: 200px;
    margin-bottom: 12px;
  }

  .brand-divider {
    margin: 16px auto;
  }

  .brand-blurb {
    font-size: 0.88rem;
    max-width: 320px;
  }

  .form-panel {
    width: 100%;
    max-width: calc(100vw - 32px);
  }

  .auth-card {
    padding: 28px 22px 24px;
    border-radius: 16px;
  }

  .auth-links {
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }

  .auth-content--wide {
    width: 100%;
    max-width: calc(100vw - 32px);
  }

  .auth-centered {
    width: 100%;
    max-width: calc(100vw - 32px);
  }

  .brand-logo-wrap--sm {
    width: 130px;
  }

  /* My Transcripts: mobile */
  .ts-card {
    padding: 14px 12px;
  }

  .header-right {
    gap: 2px;
  }

  .header-right .btn {
    padding: 6px 8px;
    font-size: 0.78rem;
  }

  .ts-detail-meta {
    margin-bottom: 16px;
  }

  /* Notification settings: mobile */
  .volume-slider {
    width: 60px;
  }

}
