:root {
  --accent: #38bdf8;
  --accent-2: #818cf8;
  --accent-soft: rgba(56, 189, 248, .14);
  --bg: #0b0e14;
  --surface: rgba(19, 24, 38, .82);
  --surface-2: #1a2133;
  --surface-3: #222b42;
  --border: #283146;
  --text: #e7ecf5;
  --text-dim: #94a3b8;
  --danger: #f43f5e;
  --success: #34d399;
  --warning: #fbbf24;
  --radius: 18px;
  --shadow: 0 18px 50px rgba(0, 0, 0, .45);
  --glow-a: rgba(56, 189, 248, .16);
  --glow-b: rgba(129, 140, 248, .12);
}

:root[data-theme="light"] {
  --bg: #f2f5fb;
  --surface: rgba(255, 255, 255, .85);
  --surface-2: #eef2f9;
  --surface-3: #e3e9f4;
  --border: #d6deeb;
  --text: #16203a;
  --text-dim: #5b6b87;
  --shadow: 0 18px 50px rgba(40, 60, 110, .12);
  --glow-a: rgba(56, 189, 248, .18);
  --glow-b: rgba(129, 140, 248, .14);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

html { color-scheme: dark; }
html[data-theme="light"] { color-scheme: light; }

body {
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  transition: background .3s, color .3s;
}

.bg-glow {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(900px 480px at 85% -10%, var(--glow-a) 0%, transparent 60%),
    radial-gradient(700px 420px at -10% 30%, var(--glow-b) 0%, transparent 60%);
}

/* ---------- Welcome screen ---------- */
body.locked { overflow: hidden; }

.welcome {
  position: fixed; inset: 0; z-index: 200;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  overflow-y: auto; padding: 28px 18px;
  transition: opacity .55s ease, visibility .55s;
}
.welcome.dismissed { opacity: 0; visibility: hidden; pointer-events: none; }

.welcome-orbs { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.orb {
  position: absolute; border-radius: 50%; filter: blur(70px); opacity: .5;
  animation: drift 14s ease-in-out infinite alternate;
}
.o1 { width: 520px; height: 520px; top: -190px; left: 4%; background: var(--accent); opacity: .32; }
.o2 { width: 480px; height: 480px; bottom: -160px; right: 3%; background: var(--accent-2); opacity: .28; animation-delay: -5s; }
.o3 { width: 300px; height: 300px; top: 28%; left: 45%; background: #2563eb; opacity: .2; animation-delay: -9s; }
@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(60px, 40px) scale(1.15); }
}

.welcome::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(56,189,248,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56,189,248,.04) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(circle at 50% 36%, #000 0%, transparent 72%);
  -webkit-mask-image: radial-gradient(circle at 50% 36%, #000 0%, transparent 72%);
}

.welcome-inner {
  position: relative; width: min(1260px, 100%); margin: auto;
}
.welcome-panel {
  position: relative;
  overflow: hidden;
  min-height: min(82vh, 720px);
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, .92fr);
  border: 1px solid rgba(148, 197, 255, .34);
  border-radius: 28px;
  background:
    radial-gradient(circle at 28% 8%, rgba(56,189,248,.2), transparent 28%),
    linear-gradient(135deg, rgba(17, 26, 44, .92), rgba(8, 12, 23, .96) 54%, rgba(11, 18, 33, .98));
  box-shadow: 0 34px 110px rgba(0, 0, 0, .64), 0 0 0 1px rgba(255,255,255,.035) inset;
  opacity: 0;
  animation: wUp .75s cubic-bezier(.2,.7,.3,1) forwards;
}
.welcome-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(600px 240px at 30% 100%, rgba(56,189,248,.22), transparent 70%);
}
@keyframes wUp { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }

.welcome-copy {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 66px 56px 86px;
}
.welcome-mark {
  width: 124px;
  height: 124px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 30px;
  animation: logoFloat 5s ease-in-out 1s infinite;
}
.welcome-mark img {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 22px 52px rgba(56,189,248,.28));
}
@keyframes logoFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }

.welcome-title {
  font-size: clamp(3.2rem, 7vw, 5.25rem); font-weight: 850; letter-spacing: -3px; line-height: .98;
  text-shadow: 0 14px 48px rgba(0,0,0,.5);
}
.welcome-title span {
  background: linear-gradient(110deg, var(--accent) 20%, var(--accent-2) 40%, var(--accent) 60%);
  background-size: 200% auto;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shimmer 3s linear infinite;
}
@keyframes shimmer { to { background-position: -200% center; } }

.welcome-sub { color: rgba(226,232,240,.78); font-size: clamp(1.08rem, 2vw, 1.35rem); max-width: 520px; line-height: 1.45; margin: 20px 0 36px; }

.welcome-cta {
  position: relative;
  display: inline-flex; align-items: center; justify-content: space-between; gap: 18px;
  min-width: min(520px, 100%);
  background: linear-gradient(100deg, #22d3ee, #2563eb 58%, #4f46e5);
  color: #08101e; font: 700 1.05rem 'Inter', sans-serif;
  border: 1px solid rgba(186,230,253,.72); border-radius: 20px; padding: 18px 26px; cursor: pointer;
  box-shadow: 0 18px 52px rgba(37,99,235,.36), 0 0 0 4px rgba(56,189,248,.1);
  transition: transform .18s, box-shadow .18s;
  animation: wUp .7s cubic-bezier(.2,.7,.3,1) .62s forwards, ctaGlow 2.4s ease-in-out 1.6s infinite;
}
.welcome-cta:hover { transform: translateY(-2px) scale(1.02); }
.cta-spark {
  width: 22px;
  height: 22px;
  display: inline-block;
  background: currentColor;
  clip-path: polygon(50% 0, 61% 36%, 100% 50%, 61% 64%, 50% 100%, 39% 64%, 0 50%, 39% 36%);
}
.cta-arrow { transition: transform .2s; }
.welcome-cta:hover .cta-arrow { transform: translateX(4px); }
@keyframes ctaGlow {
  0%,100% { box-shadow: 0 12px 36px var(--accent-soft); }
  50% { box-shadow: 0 12px 52px var(--accent-soft), 0 0 0 6px var(--accent-soft); }
}

.welcome-trust {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px 20px;
  margin-top: 28px;
  color: rgba(226,232,240,.66);
  font-size: .88rem;
}
.welcome-trust span { display: inline-flex; align-items: center; gap: 8px; }
.welcome-trust i {
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  color: var(--accent);
  background: rgba(56,189,248,.08);
  font-style: normal;
}

.welcome-preview {
  position: relative;
  z-index: 1;
  padding: 40px 38px 72px;
  display: grid;
  align-content: center;
  gap: 16px;
  background: linear-gradient(180deg, rgba(2,6,23,.18), rgba(2,6,23,.52));
}
.preview-recording,
.preview-card {
  border: 1px solid rgba(148,163,184,.14);
  background: rgba(10, 16, 29, .72);
  box-shadow: 0 18px 50px rgba(0,0,0,.22), 0 0 0 1px rgba(255,255,255,.025) inset;
  backdrop-filter: blur(18px);
}
.preview-recording {
  display: grid;
  grid-template-columns: auto auto auto 1fr;
  align-items: center;
  gap: 10px;
  border-radius: 16px;
  padding: 14px 16px;
}
.preview-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 0 6px rgba(244,63,94,.1);
}
.preview-recording strong,
.preview-recording span { font-size: .84rem; }
.preview-wave,
.audio-bars {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}
.preview-wave i,
.audio-bars i {
  width: 3px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  opacity: .92;
}
.preview-wave i:nth-child(1), .audio-bars i:nth-child(2) { height: 14px; }
.preview-wave i:nth-child(2), .audio-bars i:nth-child(5) { height: 26px; }
.preview-wave i:nth-child(3), .audio-bars i:nth-child(8) { height: 18px; }
.preview-wave i:nth-child(4), .audio-bars i:nth-child(3) { height: 34px; }
.preview-wave i:nth-child(5), .audio-bars i:nth-child(10) { height: 22px; }
.preview-wave i:nth-child(6), .audio-bars i:nth-child(1) { height: 30px; }
.preview-wave i:nth-child(7), .audio-bars i:nth-child(7) { height: 16px; }
.preview-wave i:nth-child(8), .audio-bars i:nth-child(11) { height: 28px; }
.preview-wave i:nth-child(9), .audio-bars i:nth-child(4) { height: 12px; }
.preview-wave i:nth-child(10), .audio-bars i:nth-child(6) { height: 24px; }
.audio-bars i:nth-child(9), .audio-bars i:nth-child(12) { height: 18px; }
.preview-card {
  border-radius: 18px;
  padding: 18px;
}
.preview-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  color: var(--text);
  margin-bottom: 14px;
}
.preview-head strong { font-size: .9rem; }
.preview-head span { color: var(--text-dim); font-size: .74rem; }
.transcript-preview p {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 8px;
  color: rgba(226,232,240,.78);
  font-size: .82rem;
  line-height: 1.55;
  margin-bottom: 7px;
}
.transcript-preview time { color: var(--text-dim); font-size: .75rem; }
.transcript-preview b { color: #7dd3fc; font-weight: 700; }
.transcript-preview small { color: var(--success); font-size: .78rem; }
.summary-preview ul {
  display: grid;
  gap: 10px;
  list-style: none;
}
.summary-preview li {
  border: 1px solid rgba(148,163,184,.13);
  border-radius: 11px;
  padding: 9px 12px;
  color: rgba(226,232,240,.78);
  background: rgba(30,41,59,.42);
  font-size: .8rem;
}
.audio-preview {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px;
}
.audio-play {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(148,163,184,.14);
  color: var(--text);
}
.audio-preview span {
  grid-column: 2;
  justify-self: end;
  color: var(--success);
  font-size: .76rem;
}
.welcome-foot {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 22px;
  border-top: 1px solid rgba(148,163,184,.12);
  color: rgba(226,232,240,.66);
  background: rgba(2,6,23,.28);
  font-size: .9rem;
}
.welcome-foot span { color: var(--accent); }

.api-setup-notice {
  position: fixed;
  top: 18px;
  left: 50%;
  z-index: 80;
  transform: translateX(-50%);
  width: min(880px, calc(100vw - 28px));
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 18px;
  background: rgba(12, 17, 30, .92);
  box-shadow: 0 22px 60px rgba(0, 0, 0, .42);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  animation: api-setup-in .35s cubic-bezier(.2,.7,.3,1) both;
}
.api-setup-notice[hidden] { display: none; }
@keyframes api-setup-in {
  from { opacity: 0; transform: translate(-50%, -12px) scale(.98); }
  to { opacity: 1; transform: translate(-50%, 0) scale(1); }
}
.api-setup-mark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #08101e;
  font-weight: 900;
  letter-spacing: -.5px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 12px 30px var(--accent-soft);
}
.api-setup-copy { min-width: 0; }
.api-setup-copy strong { display: block; font-size: .95rem; margin-bottom: 3px; }
.api-setup-copy span { color: var(--text-dim); font-size: .84rem; line-height: 1.45; }
.api-setup-actions { display: flex; align-items: center; gap: 8px; }
.api-setup-actions .ghost-btn {
  text-decoration: none;
  white-space: nowrap;
}
.api-setup-actions .icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 12px;
}

@media (max-width: 560px) {
  .welcome { align-items: flex-start; padding: 12px; }
  .welcome-panel {
    min-height: auto;
    grid-template-columns: 1fr;
    border-radius: 22px;
  }
  .welcome-panel::before { background: radial-gradient(440px 240px at 50% 0%, rgba(56,189,248,.18), transparent 72%); }
  .welcome-copy { padding: 34px 22px 24px; }
  .welcome-mark { width: 82px; height: 82px; margin-bottom: 18px; }
  .welcome-title { font-size: clamp(2.45rem, 14vw, 3.6rem); letter-spacing: -1.8px; }
  .welcome-sub { margin: 14px 0 24px; font-size: 1rem; }
  .welcome-cta { min-width: 0; width: 100%; padding: 15px 18px; }
  .welcome-trust { gap: 10px; margin-top: 18px; font-size: .78rem; }
  .welcome-preview { padding: 6px 14px 72px; gap: 10px; }
  .preview-recording { grid-template-columns: auto auto auto; }
  .preview-wave { grid-column: 1 / -1; justify-content: flex-start; margin-top: 4px; }
  .preview-card { padding: 14px; border-radius: 15px; }
  .summary-preview { display: none; }
  .audio-preview { grid-template-columns: auto 1fr; }
  .welcome-foot { position: relative; padding: 16px 18px; text-align: center; font-size: .78rem; }
  .api-setup-notice { grid-template-columns: auto 1fr; align-items: flex-start; }
  .api-setup-actions { grid-column: 1 / -1; width: 100%; }
  .api-setup-actions .ghost-btn,
  .api-setup-actions .primary-btn { flex: 1; justify-content: center; }
}

/* ---------- Top bar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 22px 14px; max-width: 920px; margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 14px; }
.logo { width: 46px; height: 46px; filter: drop-shadow(0 4px 14px var(--accent-soft)); }
.brand h1 { font-size: 1.4rem; letter-spacing: .2px; font-weight: 800; }
.brand h1 span {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.tagline { font-size: .68rem; color: var(--text-dim); letter-spacing: 2px; text-transform: uppercase; font-weight: 600; }
.topbar-actions { display: flex; gap: 10px; }

.icon-btn {
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-dim);
  width: 42px; height: 42px; border-radius: 13px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; font-size: 1rem;
  transition: .2s;
}
.icon-btn:hover { color: var(--text); border-color: var(--accent); transform: translateY(-1px); }
.icon-btn svg { width: 20px; height: 20px; }

/* ---------- Layout ---------- */
main { max-width: 920px; margin: 0 auto; padding: 0 18px 40px; display: grid; gap: 18px; }

.card {
  background: var(--surface);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow);
  animation: rise .4s ease both;
}
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.card h2 { font-size: 1.12rem; font-weight: 700; }

/* ---------- Stats ---------- */
.stats-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.stat-card {
  background: var(--surface); backdrop-filter: blur(14px);
  border: 1px solid var(--border); border-radius: 16px;
  padding: 16px 18px; display: flex; flex-direction: column; gap: 2px;
  animation: rise .4s ease both;
}
.stat-num {
  font-size: 1.5rem; font-weight: 800; letter-spacing: -.5px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  font-variant-numeric: tabular-nums;
}
.stat-label { font-size: .72rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 1.2px; font-weight: 600; }

/* ---------- Mode tabs ---------- */
.mode-tabs {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 14px; padding: 6px; margin-bottom: 18px;
}
.mode-tab {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: none; border: none; border-radius: 10px;
  color: var(--text-dim); font: 600 .85rem 'Inter', sans-serif;
  padding: 11px 8px; cursor: pointer; transition: .2s;
}
.mode-tab svg { width: 17px; height: 17px; flex-shrink: 0; }
.mode-tab:hover { color: var(--text); }
.mode-tab:disabled {
  opacity: .45;
  cursor: not-allowed;
}
.mode-tab:disabled:hover {
  color: var(--text-dim);
  transform: none;
}
.mode-tab.active {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: #08101e; box-shadow: 0 6px 18px var(--accent-soft);
}

.mode-guide { min-height: 86px; }
.mobile-guide {
  margin: -4px 0 14px;
  padding: 12px 14px;
  border: 1px solid rgba(56,189,248,.35);
  border-radius: 13px;
  background: var(--accent-soft);
  color: var(--text);
  font-size: .86rem;
  line-height: 1.5;
}
.hint { color: var(--text-dim); font-size: .9rem; line-height: 1.55; }
.guide { margin: 10px 0 6px 18px; color: var(--text-dim); font-size: .88rem; line-height: 1.7; }
.guide strong { color: var(--text); }

/* ---------- Toggles ---------- */
.toggle {
  display: flex; align-items: center; gap: 10px; font-size: .9rem;
  margin: 16px 0 18px; cursor: pointer; user-select: none;
}
.toggle.small-toggle { margin: 12px 0 0; font-size: .85rem; }
.toggle input { display: none; }
.toggle .track {
  width: 42px; height: 24px; border-radius: 12px; background: var(--surface-3);
  border: 1px solid var(--border); position: relative; transition: .2s; flex-shrink: 0;
}
.toggle .thumb {
  position: absolute; top: 2px; left: 2px; width: 18px; height: 18px;
  border-radius: 50%; background: var(--text-dim); transition: .2s;
}
.toggle input:checked + .track { background: var(--accent-soft); border-color: var(--accent); }
.toggle input:checked + .track .thumb { left: 21px; background: var(--accent); }

/* ---------- Buttons ---------- */
.primary-btn {
  display: inline-flex; align-items: center; gap: 10px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: #08101e; font-weight: 700; font-size: 1rem; font-family: inherit;
  border: none; border-radius: 14px; padding: 14px 28px; cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}
.primary-btn:hover { transform: translateY(-1px); box-shadow: 0 10px 26px var(--accent-soft); }
.primary-btn.small { padding: 10px 20px; font-size: .88rem; }
.primary-btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }

.record-btn { position: relative; }
.rec-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 0 rgba(244,63,94,.5); animation: ring 2s infinite; }
@keyframes ring { 0% { box-shadow: 0 0 0 0 rgba(244,63,94,.45); } 70% { box-shadow: 0 0 0 9px rgba(244,63,94,0); } 100% { box-shadow: 0 0 0 0 rgba(244,63,94,0); } }

.ghost-btn {
  background: var(--surface-2); color: var(--text); border: 1px solid var(--border);
  border-radius: 12px; padding: 11px 18px; font: 500 .88rem 'Inter', sans-serif;
  cursor: pointer; transition: .2s;
}
.ghost-btn:hover { border-color: var(--accent); transform: translateY(-1px); }
.ghost-btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.danger-ghost { color: var(--danger); }
.danger-ghost:hover { border-color: var(--danger); }

.danger-btn {
  background: var(--danger); color: #fff; border: none;
  border-radius: 12px; padding: 11px 22px; font: 700 .9rem 'Inter', sans-serif; cursor: pointer;
}
.danger-btn:hover { filter: brightness(1.1); }

.consent-note {
  margin-top: 16px; font-size: .8rem; color: var(--warning);
  background: rgba(251,191,36,.08); border: 1px solid rgba(251,191,36,.25);
  border-radius: 10px; padding: 10px 14px; line-height: 1.5;
}

/* ---------- Live view ---------- */
.live-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.live-badge {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--danger); font-weight: 800; letter-spacing: 2.5px; font-size: .78rem;
}
.pulse { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); animation: pulse 1.2s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .3; } }
.timer { font-variant-numeric: tabular-nums; font-size: 1.45rem; font-weight: 700; }

.live-caption-bar {
  position: fixed;
  top: 8px;
  left: 50%;
  z-index: 45;
  transform: translateX(-50%);
  width: min(860px, calc(100vw - 28px));
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 14px;
  background: rgba(9, 13, 23, .9);
  color: #f8fafc;
  box-shadow: 0 18px 46px rgba(0, 0, 0, .42);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.live-caption-badge {
  flex-shrink: 0;
  border-radius: 999px;
  padding: 4px 9px;
  background: rgba(52,211,153,.16);
  border: 1px solid rgba(52,211,153,.42);
  color: var(--success);
  font-size: .7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .7px;
}
.live-caption-badge.waiting { color: var(--warning); border-color: rgba(251,191,36,.45); background: rgba(251,191,36,.14); }
.live-caption-badge.off { color: var(--text-dim); border-color: var(--border); background: var(--surface-3); }
.live-caption-badge.error { color: #fda4af; border-color: var(--danger); background: rgba(244,63,94,.16); }
.live-caption-text {
  min-width: 0;
  overflow: hidden;
  color: #f8fafc;
  font-size: .95rem;
  font-weight: 600;
  line-height: 1.45;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.live-caption-text.is-placeholder { color: rgba(248,250,252,.68); font-style: italic; font-weight: 500; }

.recording-health {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}
.health-card {
  min-width: 0;
  padding: 12px 13px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.015));
}
.health-card span {
  display: block;
  color: var(--text-dim);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .9px;
  text-transform: uppercase;
  margin-bottom: 5px;
}
.health-card strong {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: .88rem;
  font-weight: 800;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.health-card.good { border-color: rgba(52,211,153,.42); background: rgba(52,211,153,.09); }
.health-card.warn { border-color: rgba(251,191,36,.45); background: rgba(251,191,36,.1); }
.health-card.bad { border-color: rgba(244,63,94,.55); background: rgba(244,63,94,.12); }
.health-card.good strong { color: var(--success); }
.health-card.warn strong { color: var(--warning); }
.health-card.bad strong { color: #fda4af; }

.live-preview-wrap {
  position: relative;
  min-height: 220px;
  background: #000;
  border-radius: 14px;
  border: 1px solid var(--border);
  overflow: hidden;
}
.live-preview-wrap.audio-only {
  min-height: 0;
  background: var(--surface-2);
}
#livePreview {
  width: 100%; max-height: 360px; background: #000; display: block;
}
.live-preview-wrap.audio-only #livePreview { display: none; }
#levelCanvas { width: 100%; height: 64px; display: block; margin-top: 12px; border-radius: 10px; }

.audio-status { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.a-chip {
  font-size: .78rem; font-weight: 600; padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--border); color: var(--text-dim); background: var(--surface-2);
  line-height: 1.4;
}
.a-chip.good { color: var(--success); border-color: rgba(52,211,153,.4); background: rgba(52,211,153,.1); }
.a-chip.bad {
  color: #fda4af; border-color: var(--danger); background: rgba(244,63,94,.12);
  animation: pulse 1.2s infinite;
}

.live-transcript {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-2);
  overflow: hidden;
}
.live-transcript-overlay {
  position: absolute;
  left: 14px; right: 14px; bottom: 14px;
  margin-top: 0;
  background: rgba(10, 14, 24, .82);
  border-color: rgba(255,255,255,.18);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .35);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.live-preview-wrap.audio-only .live-transcript-overlay {
  position: static;
  background: var(--surface-2);
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.live-transcript-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 14px;
  padding: 13px 15px; border-bottom: 1px solid var(--border);
}
.live-transcript-head h3 { font-size: .94rem; font-weight: 700; margin-bottom: 3px; }
.live-transcript-head p { color: var(--text-dim); font-size: .78rem; line-height: 1.45; }
.lt-badge {
  flex-shrink: 0; border: 1px solid rgba(52,211,153,.4); color: var(--success);
  background: rgba(52,211,153,.1); border-radius: 999px; padding: 4px 10px;
  font-size: .72rem; font-weight: 700;
}
.lt-badge.waiting { color: var(--warning); border-color: rgba(251,191,36,.45); background: rgba(251,191,36,.1); }
.lt-badge.off { color: var(--text-dim); border-color: var(--border); background: var(--surface-3); }
.lt-badge.error { color: #fda4af; border-color: var(--danger); background: rgba(244,63,94,.12); }
.live-transcript-text {
  min-height: 76px; max-height: 150px; overflow-y: auto; padding: 15px;
  color: var(--text); font-size: .94rem; line-height: 1.65; white-space: pre-wrap;
}
.live-preview-wrap.audio-only .live-transcript-text { min-height: 110px; max-height: 190px; }
.live-transcript-text.is-placeholder { color: var(--text-dim); font-style: italic; }
.live-transcript-text .interim { color: var(--text-dim); }
.live-controls { display: flex; gap: 12px; margin-top: 16px; }

/* ---------- Recordings list ---------- */
.section-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.section-head h2 { margin: 0; }
.count-badge {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 999px; padding: 2px 11px; font-size: .76rem; color: var(--text-dim); font-weight: 600;
}
.search-wrap {
  margin-left: auto; display: flex; align-items: center; gap: 10px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 12px; padding: 8px 13px; min-width: 250px;
}
.search-wrap svg { width: 16px; height: 16px; color: var(--text-dim); flex: 0 0 16px; }
.search-wrap input {
  background: none; border: none; outline: none; color: var(--text);
  font: 400 .86rem 'Inter', sans-serif; width: 100%; min-width: 0; padding: 0;
}
.search-wrap:focus-within { border-color: var(--accent); }

.empty-msg { color: var(--text-dim); font-size: .9rem; line-height: 1.6; }

.rec-list { display: grid; gap: 14px; }
.rec-item {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 14px; padding: 16px;
  display: grid; grid-template-columns: 168px 1fr; gap: 18px;
  align-items: start;
  transition: border-color .2s, transform .2s, box-shadow .2s;
  animation: rise .3s ease both;
}
.rec-item:hover { border-color: var(--accent); transform: translateY(-1px); box-shadow: 0 12px 28px rgba(0,0,0,.25); }
.rec-item:hover .rec-thumb-play { opacity: 1; }

/* --- Thumbnail --- */
.rec-thumb {
  position: relative;
  width: 168px; height: 96px;
  border-radius: 12px; overflow: hidden;
  background: var(--surface-3);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 8px;
  transition: transform .2s;
}
.rec-thumb:hover { transform: scale(1.02); }
.rec-thumb:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.rec-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; position: absolute; inset: 0; }
.rec-thumb.audio {
  background: linear-gradient(135deg, var(--surface-3) 0%, var(--accent-soft) 100%);
}
.thumb-glyph {
  font-size: 1.9rem;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.3));
}
.rec-thumb.audio .thumb-glyph { color: var(--accent); }
.thumb-wave { display: flex; gap: 3px; height: 18px; align-items: center; }
.thumb-wave i {
  display: block; width: 3px; background: var(--accent);
  border-radius: 1px;
  animation: thumbWave 1.4s ease-in-out infinite;
}
.thumb-wave i:nth-child(1) { height: 40%; animation-delay: 0s; }
.thumb-wave i:nth-child(2) { height: 70%; animation-delay: .15s; }
.thumb-wave i:nth-child(3) { height: 100%; animation-delay: .3s; }
.thumb-wave i:nth-child(4) { height: 80%; animation-delay: .45s; }
.thumb-wave i:nth-child(5) { height: 55%; animation-delay: .6s; }
.thumb-wave i:nth-child(6) { height: 35%; animation-delay: .75s; }
@keyframes thumbWave {
  0%, 100% { transform: scaleY(.5); opacity: .6; }
  50% { transform: scaleY(1); opacity: 1; }
}
.rec-thumb-duration {
  position: absolute; bottom: 7px; right: 7px;
  background: rgba(0,0,0,.78); color: #fff;
  font-size: .7rem; font-weight: 700;
  padding: 2px 7px; border-radius: 4px;
  font-variant-numeric: tabular-nums;
  z-index: 2;
}
.rec-thumb-play {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.4);
  opacity: 0; transition: opacity .2s; z-index: 2;
}
.play-glyph {
  width: 42px; height: 42px; border-radius: 50%;
  background: rgba(255,255,255,.96); color: #08101e;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; padding-left: 3px;
  box-shadow: 0 6px 16px rgba(0,0,0,.4);
}
.rec-item.expanded .rec-thumb-play { opacity: 1; background: rgba(0,0,0,.55); }
.rec-item.expanded .play-glyph { padding-left: 0; font-size: 1.1rem; }
.rec-item.expanded .play-glyph::after { content: '⏸'; }
.rec-item.expanded .play-glyph::before { display: none; }
.rec-item.expanded .play-glyph > * { display: none; }

/* --- Body --- */
.rec-body { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.rec-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.rec-header-text { min-width: 0; }
.rec-name { font-weight: 600; font-size: .96rem; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; }
.rec-meta { color: var(--text-dim); font-size: .78rem; margin-top: 3px; }
.rec-chips { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.chip {
  font-size: .72rem; padding: 3px 10px; border-radius: 999px; font-weight: 600;
  border: 1px solid var(--border); color: var(--text-dim); background: var(--surface);
}
.chip.ok { color: var(--success); border-color: rgba(52,211,153,.4); background: rgba(52,211,153,.1); }
.rec-media-shell {
  position: relative; grid-column: 1 / -1;
  background: #000; border-radius: 12px; overflow: hidden;
  margin-top: 4px;
  animation: rise .25s ease both;
}
.rec-media-shell[hidden] { display: none; }
.rec-media { width: 100%; border-radius: 12px; background: #000; max-height: 320px; display: block; }
.rec-media-shell .rec-media { border-radius: 0; }
.rec-caption-overlay {
  position: absolute;
  left: 50%;
  bottom: 42px;
  transform: translateX(-50%);
  z-index: 3;
  width: min(86%, 760px);
  padding: 9px 14px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 12px;
  background: rgba(4, 8, 16, .78);
  color: #fff;
  font-size: clamp(.82rem, 2vw, 1.02rem);
  font-weight: 800;
  line-height: 1.4;
  text-align: center;
  text-shadow: 0 1px 4px rgba(0,0,0,.9);
  pointer-events: none;
  box-shadow: 0 12px 30px rgba(0,0,0,.35);
}
.rec-caption-overlay[hidden] { display: none; }
audio.rec-media { background: var(--surface-3); height: 44px; }
.rec-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.rec-actions button { padding: 8px 14px; font-size: .8rem; }
.rec-actions .icon-only { padding: 8px 12px; min-width: 36px; }
.rec-actions .primary-action {
  background: linear-gradient(90deg, var(--accent-soft) 0%, transparent 100%);
  color: var(--accent); border-color: var(--accent); font-weight: 600;
}
.rec-actions .primary-action:hover {
  background: var(--accent-soft);
  box-shadow: 0 6px 16px var(--accent-soft);
}
.rec-actions .danger-ghost { margin-left: auto; }

/* ---------- Modals ---------- */
.modal {
  position: fixed; inset: 0; background: rgba(4,7,12,.7); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; z-index: 50; padding: 18px;
}
.modal[hidden],
.modal-body[hidden],
.chat-body[hidden] { display: none !important; }
.modal-box {
  background: var(--surface); backdrop-filter: blur(20px);
  border: 1px solid var(--border); border-radius: var(--radius);
  width: 100%; max-width: 460px; max-height: 88vh; display: flex; flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow); animation: rise .25s ease both;
}
.modal-box.wide { max-width: 900px; }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px; border-bottom: 1px solid var(--border);
}
.modal-head h3 { font-size: 1.05rem; font-weight: 700; }
.modal-tabs { display: flex; gap: 6px; padding: 12px 24px 0; flex-wrap: wrap; }
.tab {
  background: none; border: 1px solid var(--border); color: var(--text-dim);
  border-radius: 999px; padding: 6px 16px; font: 600 .8rem 'Inter', sans-serif; cursor: pointer; transition: .2s;
}
.tab.active { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.modal-body {
  padding: 18px 24px; overflow-y: auto; flex: 1 1 auto;
  min-height: 0; font-size: .9rem; line-height: 1.6;
  overscroll-behavior: contain;
}
.modal-actions {
  display: flex; gap: 8px; padding: 14px 24px; border-top: 1px solid var(--border); flex-wrap: wrap;
}
.modal-actions button { font-size: .8rem; padding: 9px 14px; }
.modal-playback {
  display: grid;
  gap: 10px;
  padding: 14px 24px 0;
}
.modal-playback[hidden] { display: none; }
.modal-playback-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: var(--text-dim);
  font-size: .78rem;
}
.modal-playback-meta strong { color: var(--text); font-size: .86rem; }
.modal-media {
  width: 100%;
  max-height: min(220px, 26vh);
  border-radius: 14px;
  background: #020617;
  border: 1px solid var(--border);
  object-fit: contain;
}
audio.modal-media { height: 46px; }
.transcript-tools {
  position: sticky;
  top: -18px;
  z-index: 2;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin: -18px -24px 16px;
  padding: 14px 24px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.transcript-search {
  flex: 1;
  display: grid;
  gap: 6px;
  color: var(--text-dim);
  font-size: .76rem;
  font-weight: 700;
}
.transcript-search input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--text);
  padding: 10px 13px;
  outline: none;
  font: 600 .86rem 'Inter', sans-serif;
}
.transcript-search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.transcript-search-count {
  color: var(--text-dim);
  font-size: .78rem;
  white-space: nowrap;
  padding-bottom: 10px;
}

.seg { display: flex; gap: 12px; margin-bottom: 10px; }
.seg-time {
  color: var(--accent); font-variant-numeric: tabular-nums; font-size: .76rem; font-weight: 600;
  flex-shrink: 0; padding-top: 2px; width: 54px;
}
.seg-jump {
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  border-radius: 8px;
  padding: 2px 4px;
  margin-left: -4px;
}
.seg-jump:hover,
.seg-jump:focus-visible {
  background: var(--accent-soft);
  outline: none;
}
.transcript-full-text {
  white-space: pre-wrap;
  color: var(--text);
}
.seg-speaker {
  color: var(--accent);
  font-weight: 800;
  margin-right: 6px;
}
.seg.editing { align-items: flex-start; margin-bottom: 12px; }
.seg-edit-stack { flex: 1; display: grid; gap: 8px; }
.speaker-edit-input {
  width: min(220px, 100%);
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--text);
  padding: 7px 11px;
  font: 700 .78rem 'Inter', sans-serif;
  outline: none;
}
.transcript-edit-note {
  margin-bottom: 14px;
  color: var(--text-dim);
  font-size: .82rem;
  line-height: 1.55;
}
.transcript-edit-area {
  width: 100%;
  min-height: 56px;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-3);
  color: var(--text);
  padding: 10px 12px;
  font: 500 .9rem/1.55 'Inter', sans-serif;
  outline: none;
}
.transcript-edit-area:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.transcript-edit-area.full { min-height: 280px; }
.summary-content h4 { margin: 14px 0 6px; color: var(--accent); font-size: .92rem; }
.summary-content ul { margin: 0 0 0 18px; }
.summary-content li { margin-bottom: 4px; }
.intelligence-panel {
  display: grid;
  gap: 14px;
}
.intel-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-2);
  padding: 15px 16px;
}
.intel-card h4 { color: var(--accent); font-size: .92rem; margin-bottom: 8px; }
.intel-card p, .intel-card li { color: var(--text); line-height: 1.65; }
.intel-card ul { margin-left: 18px; }
.insights-hero {
  border: 1px solid color-mix(in srgb, var(--accent) 36%, var(--border));
  border-radius: 16px;
  background:
    radial-gradient(circle at 15% 15%, var(--accent-soft), transparent 34%),
    var(--surface-2);
  padding: 16px;
  margin-bottom: 14px;
}
.insights-hero div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.insights-hero strong { color: var(--text); font-size: 1rem; }
.insights-hero span,
.insights-hero p { color: var(--text-dim); font-size: .82rem; margin: 0; }
.chapter-list,
.action-list {
  display: grid;
  gap: 10px;
}
.chapter-row {
  display: grid;
  grid-template-columns: 116px 1fr;
  gap: 4px 12px;
  width: 100%;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface-3);
  color: var(--text);
  padding: 12px;
  cursor: pointer;
}
.chapter-row span {
  color: var(--accent);
  font-size: .76rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.chapter-row strong { font-size: .9rem; }
.chapter-row small {
  grid-column: 2;
  color: var(--text-dim);
  line-height: 1.45;
}
.chapter-row:hover,
.chapter-row:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  outline: none;
}
.action-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface-3);
  padding: 12px;
}
.action-item input { margin-top: 4px; accent-color: var(--accent); }
.action-item strong { display: block; color: var(--text); font-size: .88rem; }
.action-item small { display: block; color: var(--text-dim); margin-top: 4px; }
.quick-prompts {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.quick-prompts button {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--text);
  padding: 7px 11px;
  font: 700 .78rem 'Inter', sans-serif;
  cursor: pointer;
}
.quick-prompts button:hover,
.quick-prompts button:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
  outline: none;
}
.details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}
.details-grid .full { grid-column: 1 / -1; }
.set-field input,
.set-field textarea {
  background: var(--surface-3);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font: 500 .85rem 'Inter', sans-serif;
  outline: none;
}
.set-field textarea { min-height: 110px; resize: vertical; }
.set-field input:focus,
.set-field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* ---------- Ask AI chat ---------- */
.chat-body { display: flex; flex-direction: column; min-height: 320px; }
.chat-messages { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding-bottom: 12px; }
.bubble {
  max-width: 85%; padding: 10px 14px; border-radius: 14px; font-size: .88rem; line-height: 1.55;
  white-space: pre-wrap; word-wrap: break-word;
}
.bubble.user {
  align-self: flex-end; background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: #08101e; border-bottom-right-radius: 4px; font-weight: 500;
}
.bubble.ai {
  align-self: flex-start; background: var(--surface-3); border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}
.chat-input-row { display: flex; gap: 8px; padding-top: 10px; border-top: 1px solid var(--border); }
.chat-input-row input {
  flex: 1; background: var(--surface-3); border: 1px solid var(--border); color: var(--text);
  border-radius: 12px; padding: 11px 14px; font: 400 .88rem 'Inter', sans-serif; outline: none;
}
.chat-input-row input:focus { border-color: var(--accent); }

/* ---------- Settings ---------- */
.settings-box .modal-body { display: grid; gap: 22px; }

/* ============ HYPER-PREMIUM SETTINGS ============ */

.settings-pro {
  max-width: 880px; width: 100%;
  height: min(86vh, 760px); min-height: min(640px, calc(100vh - 36px));
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); position: relative;
  animation: rise .35s cubic-bezier(.2,.7,.3,1) both;
}
.settings-close {
  position: absolute; top: 18px; right: 18px; z-index: 5;
  background: rgba(15, 22, 40, .65); border: 1px solid rgba(255,255,255,.12);
  color: var(--text); width: 36px; height: 36px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; transition: .2s; backdrop-filter: blur(8px);
}
.settings-close:hover { background: rgba(244, 63, 94, .25); border-color: var(--danger); transform: rotate(90deg); }

/* --- Hero --- */
.settings-hero {
  position: relative; overflow: hidden;
  padding: 26px 32px 22px;
  background: linear-gradient(135deg, var(--surface-2) 0%, var(--surface) 100%);
  border-bottom: 1px solid var(--border);
}
.settings-hero-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: .18; mask-image: radial-gradient(800px 240px at 20% 0%, #000, transparent 70%);
  -webkit-mask-image: radial-gradient(800px 240px at 20% 0%, #000, transparent 70%);
}
.settings-hero-orbs { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.sh-orb { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .42; animation: drift 14s ease-in-out infinite alternate; }
.sho1 { width: 280px; height: 280px; top: -120px; left: -60px; background: var(--accent); }
.sho2 { width: 240px; height: 240px; bottom: -120px; right: -40px; background: var(--accent-2); animation-delay: -5s; }
.settings-hero-inner {
  position: relative; display: flex; align-items: center; gap: 18px; margin-bottom: 16px;
}
.settings-hero-icon {
  width: 56px; height: 56px; border-radius: 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; color: #08101e;
  box-shadow: 0 12px 28px var(--accent-soft);
  animation: gentlePulse 2.6s ease-in-out infinite;
}
@keyframes gentlePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}
.settings-hero-text h2 { font-size: 1.4rem; font-weight: 800; letter-spacing: -.4px; }
.settings-hero-text p { color: var(--text-dim); font-size: .88rem; margin-top: 2px; }

.settings-status-row {
  position: relative;
  display: flex; gap: 8px; flex-wrap: wrap;
}
.status-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .76rem; font-weight: 600;
  padding: 6px 12px; border-radius: 999px;
  background: var(--surface-3); border: 1px solid var(--border); color: var(--text-dim);
  transition: .2s;
}
.status-pill.ok { color: var(--success); border-color: rgba(52,211,153,.4); background: rgba(52,211,153,.08); }
.status-pill.warn { color: var(--warning); border-color: rgba(251,191,36,.4); background: rgba(251,191,36,.08); }
.status-pill.info { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.brand-icon {
  width: 18px;
  height: 18px;
  display: inline-block;
  object-fit: contain;
  flex: 0 0 auto;
  vertical-align: -4px;
}
.brand-icon-groq {
  border-radius: 5px;
  box-shadow: 0 0 0 1px rgba(255,255,255,.14), 0 6px 16px rgba(255,59,0,.24);
}
.brand-icon-openai {
  padding: 2px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(255,255,255,.22), 0 8px 18px rgba(2,6,23,.25);
}
.status-pill .brand-icon {
  width: 15px;
  height: 15px;
  margin-left: -3px;
  vertical-align: -3px;
}
.welcome-trust .brand-icon,
.about-links .brand-icon {
  width: 15px;
  height: 15px;
  vertical-align: -3px;
}
.set-title .brand-icon {
  width: 18px;
  height: 18px;
  margin-right: 2px;
  vertical-align: -4px;
}

/* --- Layout: sidebar + content --- */
.settings-layout {
  display: grid; grid-template-columns: 200px 1fr;
  flex: 1; min-height: 0; overflow: hidden;
}

.settings-nav {
  display: flex; flex-direction: column; gap: 4px;
  padding: 18px 12px;
  background: rgba(0,0,0,.18);
  border-right: 1px solid var(--border);
  overflow-y: auto;
}
:root[data-theme="light"] .settings-nav { background: rgba(0,0,0,.03); }

.snav {
  display: flex; align-items: center; gap: 11px;
  background: none; border: 1px solid transparent; border-radius: 11px;
  color: var(--text-dim); font: 600 .88rem 'Inter', sans-serif;
  padding: 10px 12px; cursor: pointer; transition: .2s;
  text-align: left;
}
.snav:hover { color: var(--text); background: var(--surface-2); }
.snav.active {
  color: #08101e;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: var(--accent);
  box-shadow: 0 6px 18px var(--accent-soft);
}
.snav.active .snav-ic { filter: drop-shadow(0 0 4px rgba(0,0,0,.2)); }
.snav-ic { font-size: 1rem; width: 20px; text-align: center; }

.settings-content {
  overflow-y: auto; padding: 24px 28px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
}

.spane {
  animation: paneIn .3s cubic-bezier(.2,.7,.3,1) both;
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.spane[hidden] { display: none !important; }
@keyframes paneIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Stylize all set-sections inside the pro layout */
.settings-pro .set-section {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 14px; padding: 18px 20px;
  transition: border-color .2s;
  width: 100%;
}
.settings-pro .spane > .set-section:only-child { flex: 1; }
.settings-pro .set-section:hover { border-color: rgba(56,189,248,.35); }
.settings-pro .set-section + .set-section { margin-top: 16px; }
.settings-pro .set-title {
  font-size: .98rem; font-weight: 700; margin-bottom: 14px;
  letter-spacing: -.2px;
  display: flex; align-items: center; gap: 8px;
}

/* "Saved" floating indicator */
.settings-saved {
  position: absolute; bottom: 20px; right: 24px; z-index: 4;
  background: var(--success); color: #08101e;
  padding: 8px 16px; border-radius: 999px;
  font: 700 .82rem 'Inter', sans-serif;
  opacity: 0; transform: translateY(8px) scale(.9);
  transition: opacity .25s, transform .25s;
  pointer-events: none;
  box-shadow: 0 8px 22px rgba(52,211,153,.4);
}
.settings-saved.show { opacity: 1; transform: translateY(0) scale(1); }

/* --- About card --- */
.about-card { padding: 28px !important; text-align: center; }
.about-hero { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-bottom: 22px; }
.about-logo { width: 64px; height: 64px; margin-bottom: 4px; filter: drop-shadow(0 8px 22px var(--accent-soft)); }
.about-hero h4 { font-size: 1.4rem; font-weight: 800; letter-spacing: -.3px; }
.about-hero h4 span {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.about-tag { color: var(--text-dim); font-size: .88rem; }
.about-version {
  font-size: .72rem; color: var(--text-dim);
  background: var(--surface-3); padding: 3px 10px; border-radius: 999px; border: 1px solid var(--border);
  margin-top: 6px; letter-spacing: .3px;
}
.about-bullets { display: grid; gap: 10px; text-align: left; margin: 12px 0 20px; }
.ab-row {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 14px; border-radius: 11px;
  background: var(--surface-3); border: 1px solid var(--border);
  font-size: .85rem; line-height: 1.5;
}
.ab-row strong { color: var(--text); }
.ab-row > span { font-size: 1.15rem; flex-shrink: 0; }
.brand-pair {
  display: inline-flex;
  align-items: center;
}
.brand-pair .brand-icon {
  width: 18px;
  height: 18px;
}
.brand-pair .brand-icon + .brand-icon { margin-left: -5px; }
.about-links {
  display: flex; gap: 10px; flex-wrap: wrap; justify-content: center;
  margin-bottom: 16px;
}
.about-links a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: .82rem; font-weight: 600;
  padding: 7px 14px; border-radius: 999px;
  background: var(--surface-3); border: 1px solid var(--border);
  color: var(--text); text-decoration: none; transition: .2s;
}
.about-links a:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.about-foot { font-size: .74rem; color: var(--text-dim); line-height: 1.6; }
.set-section { border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; background: var(--surface-2); }
.set-title { font-size: .9rem; font-weight: 700; margin-bottom: 12px; }
.set-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.set-field { display: flex; flex-direction: column; gap: 6px; font-size: .78rem; color: var(--text-dim); font-weight: 600; }
.set-field select {
  background: var(--surface-3); color: var(--text); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 12px; font: 500 .85rem 'Inter', sans-serif; outline: none; cursor: pointer;
}
.set-field select:focus { border-color: var(--accent); }
.key-row { display: flex; gap: 8px; margin-bottom: 8px; }
#apiKeyInput {
  flex: 1; background: var(--surface-3); color: var(--text); border: 1px solid var(--border);
  border-radius: 10px; padding: 11px 14px; font-size: .88rem; outline: none;
}
#apiKeyInput:focus { border-color: var(--accent); }
.modal-body a { color: var(--accent); }
.key-status { margin-top: 8px; font-size: .8rem; color: var(--success); }

/* ---------- Import card & drop overlay ---------- */
.import-card {
  border-style: dashed; padding: 22px;
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%);
  position: relative; overflow: hidden;
}
.import-card::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(120deg, transparent, var(--accent-soft) 50%, transparent);
  opacity: 0; transition: opacity .25s ease;
}
.import-card:hover::before { opacity: 1; }
.import-inner {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  position: relative; z-index: 1;
}
.import-text { flex: 1; min-width: 240px; display: flex; flex-direction: column; gap: 6px; }
.import-text h2 { font-size: 1.05rem; font-weight: 700; }
.import-card .hint.mini { color: var(--text-dim); font-size: .75rem; }

.drop-overlay {
  position: fixed; inset: 0; z-index: 250;
  background: rgba(4, 8, 16, .82); backdrop-filter: blur(14px);
  display: flex; align-items: center; justify-content: center;
  animation: dropFade .2s ease both; pointer-events: none;
}
.drop-overlay[hidden] { display: none; }
@keyframes dropFade { from { opacity: 0; } to { opacity: 1; } }
.drop-card {
  background: var(--surface); border: 2px dashed var(--accent);
  border-radius: 24px; padding: 48px 60px; text-align: center;
  box-shadow: 0 24px 60px var(--accent-soft);
  animation: dropPulse 1.6s ease-in-out infinite;
}
@keyframes dropPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 24px 60px var(--accent-soft); }
  50% { transform: scale(1.03); box-shadow: 0 30px 80px var(--accent-soft), 0 0 0 8px var(--accent-soft); }
}
.drop-icon { font-size: 3.4rem; margin-bottom: 8px; animation: dropBounce 1.6s ease-in-out infinite; }
@keyframes dropBounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.drop-card h2 { font-size: 1.6rem; font-weight: 800; margin-bottom: 6px; letter-spacing: -.3px; }
.drop-card p { color: var(--text-dim); line-height: 1.55; font-size: .92rem; }

/* ---------- AI provider picker ---------- */
.provider-pick { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.provider-card {
  background: var(--surface-3); border: 2px solid var(--border);
  border-radius: 13px; padding: 12px 14px; text-align: left;
  cursor: pointer; color: var(--text); font-family: inherit; transition: .2s;
  display: flex; flex-direction: column; gap: 4px;
}
.provider-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.provider-card.active {
  border-color: var(--accent);
  background: linear-gradient(135deg, var(--accent-soft), transparent 70%);
  box-shadow: 0 8px 22px var(--accent-soft);
}
.provider-card strong { font-size: .88rem; }
.provider-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.provider-title .brand-icon {
  width: 21px;
  height: 21px;
}
.provider-card small { color: var(--text-dim); font-size: .73rem; line-height: 1.45; }
.provider-panel { animation: fadeIn .25s ease both; }
.provider-panel input[type="text"], .provider-panel input[type="password"] {
  background: var(--surface-3); color: var(--text); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 12px; font: 500 .85rem 'Inter', sans-serif; outline: none;
}
.provider-panel input:focus { border-color: var(--accent); }
.provider-panel code { background: var(--surface-3); padding: 1px 6px; border-radius: 4px; font-size: .76rem; }

/* ---------- Active transcript segment ---------- */
.seg { transition: background .2s ease, border-color .2s ease; padding: 6px 8px; border-radius: 8px; border-left: 3px solid transparent; cursor: pointer; }
.seg:hover { background: var(--surface-2); }
.seg.active {
  background: var(--accent-soft);
  border-left-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-soft);
}
.seg.active .seg-time { color: var(--accent); }

/* ---------- Transcription engine picker ---------- */
.engine-pick {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px;
}
.engine-card {
  background: var(--surface-3); border: 2px solid var(--border);
  border-radius: 14px; padding: 14px; text-align: left; cursor: pointer;
  color: var(--text); font-family: inherit; transition: .2s;
  display: flex; flex-direction: column; gap: 6px;
}
.engine-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.engine-card.active {
  border-color: var(--accent);
  background: linear-gradient(135deg, var(--accent-soft), transparent 70%);
  box-shadow: 0 10px 28px var(--accent-soft);
}
.engine-card .ec-head { display: flex; align-items: center; gap: 8px; font-size: .95rem; }
.engine-card .brand-icon { width: 20px; height: 20px; }
.engine-card small { color: var(--text-dim); font-size: .78rem; line-height: 1.5; }
.ec-badge { font-size: .66rem; padding: 2px 8px; border-radius: 999px; font-weight: 800; letter-spacing: .5px; margin-left: auto; }
.ec-badge.fast { background: rgba(56,189,248,.18); color: var(--accent); }
.ec-badge.private {
  background: rgba(52,211,153,.18); color: var(--success);
  animation: privacy-glow 2.4s ease-in-out infinite;
}
@keyframes privacy-glow {
  0%,100% { box-shadow: 0 0 0 0 rgba(52,211,153,0); }
  50% { box-shadow: 0 0 0 4px rgba(52,211,153,.18); }
}

.engine-panel { animation: fadeIn .3s ease both; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.model-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 12px 0; }
.model-card {
  background: var(--surface-3); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px 10px; text-align: center;
  cursor: pointer; color: var(--text); font-family: inherit; transition: .2s;
  display: flex; flex-direction: column; gap: 4px; position: relative;
}
.model-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.model-card.active {
  border-color: var(--accent); background: var(--accent-soft);
  box-shadow: 0 0 0 1px var(--accent), 0 8px 22px var(--accent-soft);
}
.model-card.active::after {
  content: '✓'; position: absolute; top: 6px; right: 8px;
  color: var(--accent); font-weight: 800; font-size: .8rem;
}
.model-card strong { font-size: .9rem; }
.m-meta { font-size: .72rem; color: var(--accent); font-weight: 700; font-variant-numeric: tabular-nums; }
.model-card small { font-size: .7rem; color: var(--text-dim); line-height: 1.35; }

.model-status {
  padding: 10px 14px; border-radius: 11px;
  background: var(--surface-3); border: 1px solid var(--border);
  font-size: .82rem; margin: 10px 0; display: flex; align-items: center; gap: 12px;
}
.model-status.ready { color: var(--success); border-color: rgba(52,211,153,.35); background: rgba(52,211,153,.07); }
.model-status.downloading { color: var(--warning); border-color: rgba(251,191,36,.4); background: rgba(251,191,36,.06); }
.model-status .bar { flex: 1; height: 7px; background: var(--surface); border-radius: 4px; overflow: hidden; min-width: 100px; }
.model-status .bar > i {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width .25s ease; box-shadow: 0 0 12px var(--accent-soft);
}
.model-status .pct { font-variant-numeric: tabular-nums; font-weight: 700; }

.hint.mini { font-size: .76rem; line-height: 1.55; margin-top: 10px; }
.hint.mini strong { color: var(--success); }

/* In-progress transcription badge inside recording cards */
.rec-progress {
  margin-top: 10px; padding: 10px 14px; border-radius: 11px;
  background: var(--surface); border: 1px solid var(--accent);
  font-size: .82rem; display: flex; align-items: center; gap: 12px;
  animation: privacy-glow 2.4s ease-in-out infinite;
}
.rec-progress .bar { flex: 1; height: 5px; background: var(--surface-3); border-radius: 3px; overflow: hidden; min-width: 80px; }
.rec-progress .bar > i {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width .25s ease;
}

.appearance-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.seg-control {
  display: flex; background: var(--surface-3); border: 1px solid var(--border);
  border-radius: 12px; padding: 4px; gap: 4px;
}
.seg-control button {
  background: none; border: none; border-radius: 9px; padding: 8px 16px;
  color: var(--text-dim); font: 600 .82rem 'Inter', sans-serif; cursor: pointer; transition: .2s;
}
.seg-control button.active { background: linear-gradient(90deg, var(--accent), var(--accent-2)); color: #08101e; }
.accent-swatches { display: flex; gap: 10px; }
.swatch {
  width: 30px; height: 30px; border-radius: 50%; cursor: pointer;
  background: var(--sw); border: 2px solid transparent; transition: .2s;
}
.swatch[data-accent="sky"] { --sw: #38bdf8; }
.swatch[data-accent="violet"] { --sw: #a78bfa; }
.swatch[data-accent="emerald"] { --sw: #34d399; }
.swatch[data-accent="amber"] { --sw: #fbbf24; }
.swatch:hover { transform: scale(1.12); }
.swatch.active { border-color: var(--text); box-shadow: 0 0 0 3px var(--accent-soft); }

/* ---------- Toast & footer ---------- */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  padding: 12px 22px; border-radius: 13px; font-size: .88rem; z-index: 100;
  box-shadow: var(--shadow); max-width: 90vw; text-align: center;
  animation: toast-in .25s ease both;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }
.toast.error { border-color: var(--danger); color: #fda4af; }
.toast.has-undo { display: inline-flex; align-items: center; gap: 14px; padding-right: 8px; }
.undo-btn {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: #08101e; border: none; border-radius: 999px;
  padding: 6px 14px; font: 700 .82rem 'Inter', sans-serif;
  cursor: pointer; transition: transform .15s, box-shadow .15s;
}
.undo-btn:hover { transform: scale(1.04); box-shadow: 0 4px 14px var(--accent-soft); }

.confirm-dialog {
  position: fixed;
  inset: 0;
  z-index: 180;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background:
    radial-gradient(circle at 50% 40%, rgba(56, 189, 248, .16), transparent 34%),
    rgba(4, 7, 12, .68);
  backdrop-filter: blur(12px);
}
.confirm-card {
  width: min(500px, 100%);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  border: 1px solid color-mix(in srgb, var(--danger) 42%, var(--border));
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(26, 33, 51, .96), rgba(13, 18, 31, .98)),
    var(--surface);
  box-shadow: 0 26px 80px rgba(0, 0, 0, .58), 0 0 0 1px rgba(255,255,255,.03) inset;
  padding: 22px;
  animation: confirm-in .2s ease both;
}
.confirm-icon {
  width: 44px;
  height: 44px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 900;
  background: linear-gradient(135deg, var(--danger), #fb7185);
  box-shadow: 0 14px 36px rgba(244, 63, 94, .28);
}
.confirm-copy { min-width: 0; }
.confirm-eyebrow {
  color: #fda4af;
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 5px;
}
.confirm-card h3 {
  color: var(--text);
  font-size: 1.05rem;
  line-height: 1.3;
  margin-bottom: 8px;
}
.confirm-card p {
  color: var(--text-dim);
  font-size: .88rem;
  line-height: 1.55;
}
.confirm-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 8px;
}
.confirm-actions button {
  min-width: 118px;
  justify-content: center;
}
.confirm-actions .danger-btn {
  border-radius: 999px;
  padding: 10px 16px;
  font: 800 .86rem 'Inter', sans-serif;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(244, 63, 94, .22);
}
@keyframes confirm-in {
  from { opacity: 0; transform: translateY(10px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.footnote {
  text-align: center; color: var(--text-dim); font-size: .76rem;
  padding: 0 20px 30px; max-width: 920px; margin: 0 auto;
}

.spin {
  display: inline-block; width: 14px; height: 14px; border: 2px solid var(--text-dim);
  border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite;
  vertical-align: -2px; margin-right: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Responsive ---------- */
@media (max-width: 620px) {
  .engine-pick { grid-template-columns: 1fr; }
  .model-grid { grid-template-columns: 1fr; }
  .provider-pick { grid-template-columns: 1fr; }
  .import-inner { flex-direction: column; align-items: stretch; text-align: center; }
  .drop-card { padding: 32px 28px; }
  .settings-pro { max-height: 96vh; border-radius: 12px; }
  .settings-hero { padding: 20px 18px 16px; }
  .settings-hero-icon { width: 46px; height: 46px; font-size: 1.2rem; }
  .settings-hero-text h2 { font-size: 1.15rem; }
  .settings-hero-text p { font-size: .8rem; }
  .settings-layout { grid-template-columns: 1fr; }
  .settings-nav {
    flex-direction: row; overflow-x: auto; padding: 10px 12px;
    border-right: none; border-bottom: 1px solid var(--border);
    gap: 6px; scrollbar-width: none;
  }
  .settings-nav::-webkit-scrollbar { display: none; }
  .snav { padding: 8px 12px; white-space: nowrap; flex-shrink: 0; font-size: .8rem; }
  .snav-ic { display: none; }
  .settings-content { padding: 18px 16px; }
  .about-card { padding: 20px !important; }
  .topbar { padding: 14px 14px 10px; }
  main { padding-inline: 12px; }
  .card { padding: 18px; }
  .rec-item { grid-template-columns: 116px 1fr; gap: 12px; padding: 12px; }
  .rec-thumb { width: 116px; height: 70px; }
  .thumb-glyph { font-size: 1.4rem; }
  .play-glyph { width: 30px; height: 30px; font-size: .85rem; }
  .rec-actions .danger-ghost { margin-left: 0; }
  .stats-strip { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .stat-card { padding: 12px; }
  .stat-num { font-size: 1.15rem; }
  .mode-tab { font-size: .72rem; flex-direction: column; gap: 4px; padding: 9px 4px; }
  .primary-btn { width: 100%; justify-content: center; }
  .search-wrap { width: 100%; margin-left: 0; }
  .set-grid { grid-template-columns: 1fr; }
  .details-grid { grid-template-columns: 1fr; }
  .recording-health { grid-template-columns: 1fr 1fr; }
  .live-controls, .rec-actions { flex-wrap: wrap; }
  .modal { padding: 8px; align-items: stretch; }
  .modal-box { max-height: 94vh; }
  .modal-head,
  .modal-tabs,
  .modal-playback,
  .modal-actions { padding-inline: 14px; }
  .modal-body { padding: 16px 14px; min-height: 0; }
  .modal-media { max-height: 24vh; }
  .transcript-tools {
    margin: -16px -14px 14px;
    padding: 12px 14px;
    align-items: stretch;
    flex-direction: column;
  }
  .transcript-search-count { padding-bottom: 0; }
  .modal-playback-meta { align-items: flex-start; flex-direction: column; gap: 2px; }
  .chapter-row { grid-template-columns: 1fr; }
  .chapter-row small { grid-column: 1; }
  .insights-hero div { flex-direction: column; gap: 2px; }
  .confirm-card {
    grid-template-columns: 1fr;
    padding: 18px;
  }
  .confirm-actions {
    flex-direction: column-reverse;
  }
  .confirm-actions button {
    width: 100%;
  }
}
