/* ==========================================================================
   Soniox Real-Time Diarization - Conversational Timeline CSS
   Chronological Multi-Speaker Chat Stream (Speaker 1 Left / Speaker 2 Right)
   Powered by Soniox Speech-to-Text WebSocket API
   ========================================================================== */

:root {
  /* Core Color Palette - Deep Dark Mode */
  --bg-app: #080c14;
  --bg-chat: #0b111e;
  --bg-card: #131c2e;
  --bg-card-hover: #19253d;
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-active: rgba(255, 255, 255, 0.18);

  /* Soniox Brand Accent */
  --soniox-blue: #1881ff;
  /* The blue behind white text (buttons, the chosen step): dark enough for 4.5:1, which --soniox-blue (3.7:1) is not. --soniox-blue stays for borders, lines and blue text on the dark background. */
  --accent-fill: #0b66d9;
  /* Blue used as text or a link on the dark panels: light enough for 4.5:1 (--soniox-blue gives about 3.4 to 4.2 on them) */
  --accent-text: #4da3ff;
  --soniox-gradient: linear-gradient(135deg, #1881ff 0%, #38bdf8 100%);

  /* Speaker colours are set per row via --spk-primary / --spk-bg / --spk-border (see TranscriptView) */
  --spk-primary: #34d399;
  --spk-bg: rgba(52, 211, 153, 0.12);
  --spk-border: rgba(52, 211, 153, 0.4);

  /* Typography */
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #8b9bb2;   /* was #64748b: 3.3:1 on the cards; now over 4.5:1 and still dimmer than --text-muted */
  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Font Scale Presets */
  --caption-font-size: 1.25rem;
  --caption-line-height: 1.6;

  /* Layout Dimensions */
  --header-height: 62px;
  --toolbar-height: 52px;
  --legend-height: 38px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --shadow-bubble: 0 4px 20px rgba(0, 0, 0, 0.35);
}

/* Font scale classes */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-app);
  color: var(--text-main);
  font-family: var(--font-main);
  -webkit-font-smoothing: antialiased;
}

.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  width: 100%;
  background: radial-gradient(circle at 50% 0%, #152038 0%, #080c14 70%);
}

/* ==========================================================================
   Header Bar
   ========================================================================== */
.top-bar {
  height: var(--header-height);
  min-height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  background: rgba(11, 17, 30, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 20;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.status-dot {
  position: relative;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: url('../favicon.svg') center / contain no-repeat;
  flex: none;
}

/* the connection state sits on the icon as a small dot, in the same colours as before */
.status-dot::after {
  content: '';
  position: absolute;
  right: -3px;
  bottom: -3px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #64748b;
  border: 2px solid var(--bg-app, #080c14);
  box-sizing: content-box;
  transition: all 0.25s ease;
}

.status-dot.connected::after {
  background: #34d399;
  box-shadow: 0 0 10px rgba(52, 211, 153, 0.8);
}

.status-dot.streaming::after {
  background: #38bdf8;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.9);
  animation: pulse-dot 1.2s infinite ease-in-out;
}

.status-dot.error::after {
  background: #ef4444;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.8);
}

@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.7; }
}

.app-title {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0;   /* "Zumi" and "Scribe" read as one word, in two colours */
}

.app-title span {
  background: var(--soniox-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.soniox-badge {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  background: rgba(24, 129, 255, 0.16);
  color: #60a5fa;
  border: 1px solid rgba(56, 189, 248, 0.35);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  text-decoration: none;
}

/* Diarization Center HUD */
.diarization-hud {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: rgba(255, 255, 255, 0.04);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
}

.hud-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 80px;
}

.hud-label {
  font-size: 0.6rem;
  font-family: var(--font-mono);
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1;
  margin-bottom: 2px;
}

.hud-value {
  font-size: 0.75rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-muted);
  white-space: nowrap;
  transition: color 0.15s ease;
}

.spectral-canvas {
  width: 100px;
  height: 22px;
  border-radius: 4px;
  background: #050810;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

/* ==========================================================================
   Controls Toolbar
   ========================================================================== */
.controls-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1.25rem;
  background: rgba(8, 12, 20, 0.95);
  border-bottom: 1px solid var(--border-subtle);
  gap: 0.75rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-main);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, #0b66d9 0%, #0052b8 100%);
  color: #fff;
  border: 1px solid rgba(56, 189, 248, 0.4);
  box-shadow: 0 4px 14px rgba(24, 129, 255, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #0f6cde 0%, #0059c2 100%);
  box-shadow: 0 6px 18px rgba(24, 129, 255, 0.45);
  transform: translateY(-1px);
}

.btn-primary.recording {
  background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
  border-color: rgba(248, 113, 113, 0.5);
  box-shadow: 0 0 18px rgba(239, 68, 68, 0.5);
  animation: pulse-rec-btn 1.6s infinite ease-in-out;
}

@keyframes pulse-rec-btn {
  0%, 100% { box-shadow: 0 0 16px rgba(239, 68, 68, 0.4); }
  50% { box-shadow: 0 0 24px rgba(239, 68, 68, 0.75); }
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-active);
}

.btn-icon {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

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

.btn-sm {
  padding: 0.42rem 0.8rem;
  font-size: 0.8rem;
}

.secondary-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ==========================================================================
   Speaker Legend Bar
   ========================================================================== */
.chat-legend-bar {
  height: var(--legend-height);
  min-height: var(--legend-height);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 1.5rem;
  overflow-x: auto;
  scrollbar-width: none;
  background: rgba(11, 17, 30, 0.7);
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.75rem;
  font-family: var(--font-mono);
  font-weight: 600;
}

.chat-legend-bar::-webkit-scrollbar {
  display: none;
}

.legend-hint {
  color: var(--text-dim);
  font-size: 0.7rem;
  white-space: nowrap;
}

.legend-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex: 0 0 auto;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--spk-border);
  background: var(--spk-bg);
  color: var(--spk-primary);
  font: inherit;
  cursor: pointer;
  white-space: nowrap;
}

.legend-chip:hover {
  border-color: var(--spk-primary);
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--spk-primary);
  box-shadow: 0 0 8px var(--spk-primary);
  flex: 0 0 auto;
}

/* ==========================================================================
   Chat Stream & Conversation Timeline
   ========================================================================== */
.chat-viewport {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1.25rem 1rem;
  /* Instant (not smooth) scrolling: a smooth scroll in flight would look like the
     user scrolling away and wrongly pause auto-scroll. */
  overflow-anchor: none;
}

.chat-viewport::-webkit-scrollbar {
  width: 6px;
}

.chat-viewport::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

.chat-stream {
  position: relative;   /* where the words being dragged between bubbles are placed (transcript-view.js, _liftText) */
  max-width: var(--stream-max, 900px);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  min-height: 100%;
}

/* Empty State */
.empty-state {
  margin: auto;
  text-align: center;
  max-width: 440px;
  padding: 2.5rem 1.5rem;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.02);
}

.empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(24, 129, 255, 0.12);
  color: var(--accent-text);
  margin-bottom: 1rem;
}
/* the empty transcript's microphone: a Record button */
button.empty-icon { border: 0; padding: 0; font: inherit; cursor: pointer; transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease; }
button.empty-icon:hover { background: rgba(24, 129, 255, 0.22); transform: scale(1.06); box-shadow: 0 0 0 6px rgba(24, 129, 255, 0.08); }
button.empty-icon:active { transform: scale(0.97); }
button.empty-icon:focus-visible { outline: 2px solid var(--soniox-blue); outline-offset: 3px; }

.empty-state h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.empty-state p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.55;
}

/* Whole-file transcription progress: a card in the middle of an empty screen, a banner above the text */
.file-progress {
  width: 100%;
  max-width: 480px;
  margin: auto;
  padding: 1.5rem;
  border: 1px solid var(--border-active);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
}
.file-progress[hidden] { display: none; }
.file-progress-head { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; }
.file-progress-head strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-progress-stage { margin: 0.6rem 0 0.5rem; color: var(--text-muted); font-size: 0.9rem; }
.file-progress-track { height: 8px; border-radius: 4px; background: rgba(255, 255, 255, 0.08); overflow: hidden; position: relative; }
.file-progress-track i { display: block; height: 100%; width: 0; background: var(--soniox-gradient); border-radius: 4px; transition: width 0.4s ease; }
.file-progress-track.indeterminate i { width: 35%; position: absolute; animation: file-progress-slide 1.3s ease-in-out infinite; transition: none; }
@keyframes file-progress-slide { 0% { left: -35%; } 100% { left: 100%; } }
.file-progress-notice { margin: 0 0 0.5rem; font-size: 0.78rem; color: #fbbf24; }
.file-progress-note { margin: 0.7rem 0 0; font-size: 0.82rem; color: var(--text-muted); line-height: 1.45; }
.file-progress-note:empty { display: none; }
.file-progress[data-mode="slim"] {
  position: sticky;
  top: 0;
  z-index: 5;
  max-width: none;
  margin: 0 0 0.25rem;
  padding: 0.6rem 0.9rem;
}
.file-progress[data-mode="slim"] .file-progress-stage { margin: 0.25rem 0 0.4rem; }
.file-progress[data-mode="slim"] .file-progress-track { height: 5px; }
.file-progress[data-mode="slim"] .file-progress-note { margin-top: 0.4rem; }

/* Chat Message Rows */
.chat-message-row {
  display: flex;
  width: 100%;
  animation: fadeInRow 0.22s ease-out;
}

@keyframes fadeInRow {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
/* A card that takes over words already on screen (the live bubble becoming final) does not fade in from nothing */
.chat-message-row.no-enter { animation: none; }
/* Live bubbles (transcript-view.js, _holdHeight and _setLiveText): the bubble with the live words is full width, so it does
   not narrow and widen as they change; it eases back to the size of its text when they move on */
.chat-bubble.is-live { width: var(--bubble-max, 82%); }
.chat-bubble.height-releasing { transition: min-height 0.8s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.2s ease, background 0.2s ease; }
/* Words moving to a new bubble (_liftText, _landWords): a copy of them, inside the transcript so it scrolls with it, is
   dragged from where they were to where they now are; the words in the new bubble show as it lands */
.word-flyer { visibility: hidden; pointer-events: none; z-index: 60; }
.word-flyer .fly-words { visibility: visible; }
.bubble-text, .bubble-tail { transition: opacity 0.3s ease; }
.words-arriving { opacity: 0; transition: none; }
/* Rewritten live words cross-fade: a copy of the text laid over it shows only the old words, fading out, while the new
   ones fade in */
.bubble-body, .interim-text { position: relative; }
/* (staggered: the old words go a little ahead of the new ones arriving, so the two are rarely both half there) */
.live-ghost { position: absolute; inset: 0; margin: 0; visibility: hidden; pointer-events: none; animation: live-out 0.3s ease-out forwards; }
.live-ghost .ghost-old { visibility: visible; }
.live-new { animation: live-in 0.45s ease-in 0.12s both; }
@keyframes live-out { to { opacity: 0; } }
@keyframes live-in { from { opacity: 0; } }
html.no-motion .live-new, html.no-motion .live-ghost { animation: none; }

/* Speech Bubbles - colours come from --spk-* set per row in JS */
.chat-bubble {
  max-width: var(--bubble-max, 82%);
  border-radius: var(--radius-lg);
  border-top-left-radius: 4px;
  padding: 1rem 1.25rem;
  background: var(--spk-bg);
  border: 1.5px solid var(--spk-border);
  box-shadow: var(--shadow-bubble);
  position: relative;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.bubble-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.6rem;
  margin-bottom: 0.45rem;
  font-size: 0.75rem;
  font-family: var(--font-mono);
}

.bubble-speaker {
  font-weight: 800;
  letter-spacing: 0.03em;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--spk-primary);
}


.bubble-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
  color: var(--text-dim);
  font-size: 0.72rem;
}

.btn-flip-speaker {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-flip-speaker:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.bubble-header { flex-wrap: wrap; }

/* One-tap speaker swap: a small coloured chip per possible speaker, with the full name on hover */
.swap-chips {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin-left: 0.4rem;
  opacity: 0.55;
  transition: opacity 0.15s ease;
}
.chat-message-row:hover .swap-chips,
.swap-chips:focus-within,
.interim-row .swap-chips { opacity: 1; }
@media (pointer: coarse) { .swap-chips { opacity: 1; } }
.swap-chip {
  min-width: 26px;
  height: 26px;
  padding: 0 6px;
  border-radius: 999px;
  border: 1.5px solid var(--spk-primary, var(--border-active));
  background: var(--spk-bg, transparent);
  color: var(--spk-primary, var(--text-muted));
  font: 700 0.68rem var(--font-mono);
  line-height: 1;
  cursor: pointer;
  transition: transform 0.1s ease, background 0.15s ease;
}
.swap-chip:hover { transform: scale(1.12); background: var(--spk-primary, rgba(255, 255, 255, 0.2)); color: #0b111e; }
.swap-chip.current { background: var(--spk-primary); color: #0b111e; cursor: default; transform: none; }
.swap-chip.unassigned { border-style: dashed; }
.swap-chip.new { --spk-primary: var(--text-muted); border-style: dashed; font-size: 0.85rem; }

.bubble-text {
  font-size: var(--caption-font-size);
  line-height: var(--caption-line-height);
  font-weight: 500;
  color: #fff;
  word-break: break-word;
  white-space: pre-wrap; /* keeps the double spaces and paragraph breaks from _formatText */
}

/* In-Flow Live Interim Bubble */
.interim-row {
  opacity: 0.94;
  cursor: pointer;
}

.interim-bubble {
  border-style: dashed !important;
  background: rgba(255, 255, 255, 0.03) !important;
}

.interim-speaker-tag {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pulsing-mic {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.8);
  animation: pulse-mic 0.8s infinite ease-in-out;
}

@keyframes pulse-mic {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.4; }
}

.interim-text {
  color: #e2e8f0;
  font-style: italic;
}

/* ==========================================================================
   Modals
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(5, 8, 16, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1.25rem;
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-active);
  border-radius: var(--radius-lg);
  max-width: 520px;
  width: 100%;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

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

.modal-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
}

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

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

.modal-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-height: 75vh;
  overflow-y: auto;
}

.modal-info {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.form-group label {
  font-size: 0.78rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  font-weight: 600;
  display: flex;
  justify-content: space-between;
}

.form-input, .form-select {
  background: #0b111e;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: #fff;
  padding: 0.6rem 0.85rem;
  font-size: 0.9rem;
  font-family: var(--font-mono);
  outline: none;
  transition: border-color 0.15s ease;
}

.form-input:focus, .form-select:focus {
  border-color: var(--soniox-blue);
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  background: rgba(0, 0, 0, 0.15);
}

.btn-text {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0.5rem 0.8rem;
}

.btn-text:hover {
  color: #fff;
}

/* Toast notification */
.toast-msg {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(19, 28, 46, 0.95);
  border: 1px solid var(--soniox-blue);
  color: #fff;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: toastIn 0.25s ease-out;
}

@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* Mobile Responsiveness */
@media (max-width: 640px) {
  .top-bar {
    padding: 0 0.85rem;
  }
  .app-title span {
    display: none;
  }
  .diarization-hud {
    padding: 0.25rem 0.5rem;
    gap: 0.5rem;
  }
  .spectral-canvas {
    width: 60px;
  }
  .controls-toolbar {
    padding: 0.4rem 0.85rem;
  }
  .chat-bubble {
    max-width: 92%;
    padding: 0.85rem 1rem;
  }
}

.form-hint {
  display: block;
  margin-top: 6px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Provider notices (js/provider-notices.js): a labelled row per thing to know about a transcriber */
.provider-notices { display: grid; gap: 6px; margin-top: 8px; }
.notice-row { display: grid; grid-template-columns: auto 1fr; gap: 8px; align-items: baseline; font-size: 0.75rem; color: var(--text-muted); line-height: 1.45; }
.notice-label {
  display: inline-block;
  padding: 1px 8px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-active);
  font-size: 0.68rem;
  font-weight: 600;
  white-space: nowrap;
  color: var(--text-main);
}
.notice-row[data-tone="warn"] .notice-label, .notice-label[data-tone="warn"] { color: #fbbf24; border-color: rgba(251, 191, 36, 0.45); background: rgba(251, 191, 36, 0.08); }
.notice-row[data-tone="good"] .notice-label, .notice-label[data-tone="good"] { color: var(--spk-primary); border-color: var(--spk-border); background: var(--spk-bg); }
.notice-text a { color: var(--accent-text); text-decoration: none; }
.notice-text a:hover { text-decoration: underline; }
.notice-labels { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.provider-preload { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.provider-preload .form-hint { margin-top: 0; }
.provider-notices[hidden], .provider-preload[hidden] { display: none; }
.dialog-body .modal-info { white-space: pre-line; }

.form-hint a {
  color: var(--accent-text);
  text-decoration: none;
}

.form-hint a:hover {
  text-decoration: underline;
}

/* Speaker assign menu */
.speaker-menu {
  position: fixed;
  z-index: 200;
  min-width: 190px;
  max-height: 60vh;
  overflow-y: auto;
  padding: 0.35rem;
  background: #0f1626;
  border: 1px solid var(--border-active);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.speaker-menu[hidden] {
  display: none;
}

.speaker-menu-heading {
  padding: 0.3rem 0.6rem;
  color: var(--text-dim);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.speaker-menu-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  padding: 0.55rem 0.6rem;
  background: none;
  border: 0;
  border-radius: 6px;
  color: var(--text-main);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.speaker-menu-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.speaker-menu-item.current {
  color: var(--spk-primary);
  font-weight: 700;
}

.speaker-menu-divider {
  height: 1px;
  margin: 0.3rem 0;
  background: var(--border-subtle);
}

@media (max-width: 640px) {
  .chat-legend-bar {
    padding: 0 0.85rem;
  }
}

/* Shown while auto-scroll is paused */
.jump-latest-btn {
  position: fixed;
  left: 50%;
  bottom: 1.25rem;
  transform: translateX(-50%);
  z-index: 50;
  padding: 0.6rem 1.1rem;
  border: 1px solid var(--border-active);
  border-radius: 999px;
  background: var(--accent-fill);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  cursor: pointer;
}

.jump-latest-btn[hidden] {
  display: none;
}

/* Custom dialogs (js/dialog.js) */
.dialog-overlay {
  z-index: 300;
}

.dialog-card {
  max-width: 420px;
}

.dialog-body {
  gap: 1rem;
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
  color: #fff;
  border: 1px solid rgba(248, 113, 113, 0.5);
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  background: linear-gradient(135deg, #f55a5a 0%, #c92a2a 100%);
  transform: translateY(-1px);
}

/* Intro splash */
.splash-overlay {
  z-index: 250;
}

.splash-card {
  max-width: 720px;
  max-height: 92vh;
}

.splash-scroll {
  padding: 1.75rem 2rem 1rem;
  overflow-y: auto;
}

.splash-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-text);
  margin-bottom: 0.5rem;
}

.splash-title {
  font-size: 1.6rem;
  line-height: 1.2;
  font-weight: 800;
  color: #fff;
  margin-bottom: 0.85rem;
}

.splash-lead {
  font-size: 0.98rem;
  line-height: 1.6;
  color: var(--text-muted);
  margin-bottom: 1.1rem;
}

.splash-points {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.4rem;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.splash-points li {
  padding-left: 1.1rem;
  position: relative;
}

.splash-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-fill);
}

.splash-points strong,
.splash-key-box h3 {
  color: #fff;
}

.splash-key-box {
  padding: 1rem 1.15rem;
  margin-bottom: 1.1rem;
  border: 1px solid rgba(24, 129, 255, 0.4);
  background: rgba(24, 129, 255, 0.08);
  border-radius: var(--radius-sm);
}

.splash-key-box h3 {
  font-size: 1rem;
  margin-bottom: 0.4rem;
}

.splash-key-box p {
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--text-muted);
}

.splash-providers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
  margin-bottom: 1rem;
}

.splash-provider {
  padding: 1rem 1.1rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.025);
}

.splash-provider h4 {
  font-size: 0.95rem;
  color: #fff;
  margin-bottom: 0.55rem;
}

.splash-provider ol {
  padding-left: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.splash-links {
  margin-top: 0.7rem;
  font-size: 0.78rem;
  color: var(--text-dim);
}

.splash-card a {
  color: #5eb0ff;
  text-decoration: none;
}

.splash-card a:hover {
  text-decoration: underline;
}

.splash-video { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.35rem; text-align: center; min-height: 7rem; margin: 0.75rem 0; padding: 1rem; border: 2px dashed var(--border-color, rgba(255,255,255,0.25)); border-radius: 12px; background: rgba(255,255,255,0.03); }
.splash-video span { opacity: 0.75; font-size: 0.85rem; max-width: 28rem; }
.splash-video-play { width: 0; height: 0; border-left: 22px solid currentColor; border-top: 13px solid transparent; border-bottom: 13px solid transparent; opacity: 0.55; margin-bottom: 0.25rem; }
.splash-tour { margin: 0 0 0.5rem 1.2rem; padding: 0; display: grid; gap: 0.5rem; font-size: 0.9rem; }
.splash-footnote {
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--text-dim);
}

.splash-footer {
  justify-content: space-between;
}

@media (max-width: 640px) {
  .splash-scroll {
    padding: 1.25rem 1.1rem 0.75rem;
  }
  .splash-title {
    font-size: 1.3rem;
  }
  .splash-providers {
    grid-template-columns: 1fr;
  }
}

/* Font size slider + live preview */
.font-size-value {
  color: var(--accent-text);
  font-weight: 700;
}

.font-size-range {
  width: 100%;
  accent-color: var(--soniox-blue);
  cursor: pointer;
}

.font-preview {
  max-height: 34vh;
  overflow: auto;
  padding: 0.75rem 1rem;
  background: #0b111e;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

.font-preview-label {
  margin-bottom: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.font-preview-text {
  font-size: var(--preview-font-size, 1.35rem);
  line-height: var(--preview-line-height, 1.65);
  font-weight: 500;
  color: #fff;
  word-break: break-word;
}

/* Cross-session name suggestions */
.recall-bar {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.55rem 1.5rem;
  background: rgba(24, 129, 255, 0.07);
  border-bottom: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.recall-bar[hidden] {
  display: none;
}

.recall-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.recall-label {
  color: var(--spk-primary);
  font-weight: 700;
  margin-right: 0.2rem;
}

.recall-chip,
.recall-other,
.recall-dismiss {
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--spk-border);
  background: var(--spk-bg);
  color: #fff;
  font: inherit;
  cursor: pointer;
}

.recall-chip.likely {
  border-color: var(--spk-primary);
  font-weight: 700;
}

.recall-chip.likely::after {
  content: " \2713?";
  color: var(--spk-primary);
}

.recall-chip:hover,
.recall-other:hover {
  border-color: var(--spk-primary);
}

.recall-other { border-style: dashed; }

.recall-dismiss {
  background: none;
  border-color: var(--border-subtle);
  color: var(--text-muted);
}

.recall-dismiss:hover {
  color: #fff;
}

@media (max-width: 640px) {
  .recall-bar {
    padding: 0.55rem 0.85rem;
  }
}

.splash-more {
  margin-bottom: 0.8rem;
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--text-muted);
}

.key-lock-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* Inline editing of transcript text */
.chat-bubble .bubble-text[contenteditable] {
  cursor: text;
  outline: none;
  border-radius: 6px;
  margin: 0 -0.35rem;
  padding: 0 0.35rem;
  transition: background 0.12s ease, box-shadow 0.12s ease;
}

.chat-bubble .bubble-text[contenteditable]:hover {
  background: rgba(255, 255, 255, 0.04);
}

.chat-bubble .bubble-text[contenteditable]:focus {
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 0 2px var(--spk-border);
}

.bubble-text::selection {
  background: var(--spk-primary);
  color: #04110c;
}

.replace-toast {
  position: fixed;
  left: 50%;
  bottom: 4.5rem;
  transform: translateX(-50%);
  z-index: 120;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  max-width: calc(100vw - 2rem);
  padding: 0.6rem 0.9rem;
  background: #0f1626;
  border: 1px solid var(--border-active);
  border-radius: 999px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
  font-size: 0.8rem;
  color: var(--text-main);
}

.replace-toast[hidden] {
  display: none;
}

.replace-toast-yes {
  padding: 0.3rem 0.8rem;
  border: 0;
  border-radius: 999px;
  background: var(--accent-fill);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.replace-toast-no {
  background: none;
  border: 0;
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

/* In-place speaker rename */
.inline-rename {
  min-width: 8ch;
  padding: 0.1rem 0.4rem;
  border: 1px solid var(--spk-primary, #38bdf8);
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font: inherit;
  letter-spacing: inherit;
  text-transform: none;
  outline: none;
}

.bubble-speaker {
  cursor: pointer;
}

/* Live text: earlier sentences are editable, the sentence being spoken is not */
.interim-stable[contenteditable] {
  cursor: text;
  outline: none;
  border-radius: 6px;
  margin: 0 -0.35rem;
  padding: 0 0.35rem;
  font-style: normal;
  transition: background 0.12s ease, box-shadow 0.12s ease;
}

.interim-stable[contenteditable]:hover {
  background: rgba(255, 255, 255, 0.05);
}

.interim-stable[contenteditable]:focus {
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 2px var(--spk-border);
}

/* Recording title */
.title-bar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 1.5rem 0.35rem;
  background: rgba(11, 17, 30, 0.7);
  border-bottom: 1px solid var(--border-subtle);
}

.title-main {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
}

.recording-title {
  width: 100%;
  padding: 0.2rem 0.4rem;
  margin-left: -0.4rem;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  outline: none;
  text-overflow: ellipsis;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.recording-title::placeholder {
  color: var(--text-dim);
  font-weight: 600;
}

.recording-title:hover {
  background: rgba(255, 255, 255, 0.05);
}

.recording-title:focus {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--soniox-blue);
}

/* The shrinking bar: how long the default title stays before it is kept */
.title-countdown {
  height: 3px;
  margin-top: 2px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.title-countdown[hidden] {
  display: none;
}

.title-countdown span {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--accent-fill);
  transform-origin: left center;
}

.title-countdown span.run {
  animation: title-countdown 5s linear forwards;
}

@keyframes title-countdown {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

.title-status {
  flex: 0 1 auto;
  max-width: 45%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-dim);
}

@media (max-width: 640px) {
  .title-bar {
    flex-direction: column;
    gap: 0.1rem;
    padding: 0.45rem 0.85rem 0.3rem;
  }
  .title-status {
    max-width: 100%;
  }
}

/* Deleting speech: in the bubble menu, or the Delete key on a selected bubble */

.speaker-menu-item.danger {
  color: #fca5a5;
}

.speaker-menu-item.danger:hover {
  background: rgba(239, 68, 68, 0.18);
}

/* Expected speakers (panel) */
.legend-chip.roster-chip {
  border-style: dashed;
  border-color: var(--border-active);
  background: none;
  color: var(--text-muted);
  opacity: 0.8;
}

.legend-chip.roster-chip:hover {
  opacity: 1;
  color: #fff;
}

.legend-chip.roster-add {
  color: var(--accent-text);
  border-color: rgba(24, 129, 255, 0.5);
}

.roster-text {
  display: block;
  width: min(280px, 80vw);
  margin: 0.2rem 0.3rem;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  background: #0b111e;
  color: #fff;
  font: inherit;
  font-size: 0.85rem;
  resize: vertical;
  outline: none;
}

.roster-text:focus {
  border-color: var(--soniox-blue);
}

.roster-hint {
  padding: 0.2rem 0.6rem 0.4rem;
  color: var(--text-dim);
  font-size: 0.7rem;
}

.roster-done {
  justify-content: center;
  font-weight: 700;
  color: var(--accent-text);
}

/* Live status: is audio heard, is the service answering */
.live-status {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.3rem 1.5rem;
  background: rgba(11, 17, 30, 0.7);
  border-bottom: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
}

.live-status[hidden] {
  display: none;
}

.live-status[data-state="warn"] {
  background: rgba(245, 158, 11, 0.12);
  color: #fcd34d;
}

.live-meter {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 14px;
}

.live-meter i {
  display: block;
  width: 4px;
  height: 100%;
  border-radius: 1px;
  background: rgba(255, 255, 255, 0.15);
}

.live-meter i:nth-child(1) { height: 30%; }
.live-meter i:nth-child(2) { height: 45%; }
.live-meter i:nth-child(3) { height: 60%; }
.live-meter i:nth-child(4) { height: 75%; }
.live-meter i:nth-child(5) { height: 90%; }
.live-meter i:nth-child(6) { height: 100%; }

.live-meter i.on {
  background: #34d399;
}

.live-status[data-state="warn"] .live-meter i.on {
  background: #f59e0b;
}

.check-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.4rem;
  font-weight: 500;
}

.check-row input {
  width: auto;
}

@media (max-width: 640px) {
  .live-status {
    padding: 0.3rem 0.85rem;
  }
}

/* One bubble per stretch of speech: the finished text, then the uncertain words in italics */
.bubble-body {
  display: block;
  font-size: var(--caption-font-size);
  line-height: var(--caption-line-height);
}

.bubble-body .bubble-text,
.bubble-body .bubble-tail {
  display: inline;
}

.bubble-tail {
  font-size: var(--caption-font-size);
  line-height: var(--caption-line-height);
  font-weight: 500;
  font-style: italic;
  color: #cbd5e1;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Waiting dots: speech heard, words not back yet */
.typing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  vertical-align: middle;
}

.typing i {
  display: block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--spk-primary, #94a3b8);
  opacity: 0.35;
  animation: typing-pulse 1.1s infinite ease-in-out;
}

.typing i:nth-child(2) { animation-delay: 0.18s; }
.typing i:nth-child(3) { animation-delay: 0.36s; }

@keyframes typing-pulse {
  0%, 70%, 100% { opacity: 0.3; transform: translateY(0); }
  35% { opacity: 1; transform: translateY(-3px); }
}

.waiting-bubble {
  padding: 0.7rem 1rem;
  width: auto;
  max-width: none;
}

@media (prefers-reduced-motion: reduce) {
  .typing i { animation: none; opacity: 0.8; }
}

/* ==========================================================================
   New recording setup (call / meeting / panel)
   ========================================================================== */
.setup-card { max-width: 580px; }
.setup-modes { display: grid; gap: 0.5rem; }
.setup-mode {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  cursor: pointer;
}
.setup-mode:has(input:checked) { border-color: var(--soniox-blue); background: rgba(24, 129, 255, 0.1); }
.setup-mode input { margin-top: 0.3rem; accent-color: var(--soniox-blue); }
.setup-mode strong { display: block; font-size: 0.95rem; }
.setup-mode small { display: block; margin-top: 0.15rem; color: var(--text-muted); line-height: 1.4; }
.setup-members[hidden] { display: none; }
.setup-members { margin-top: 0.9rem; }
.setup-members-label { display: block; }
.setup-caption { font-size: 0.85rem; font-weight: 600; margin-bottom: 0.4rem; }
.setup-area { width: 100%; resize: vertical; }
.setup-count { margin: 0.45rem 0 0.3rem; font-size: 0.8rem; color: var(--text-muted); }
.setup-count[data-over="true"] { color: #fbbf24; }
.setup-preview { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.setup-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.15rem 0.2rem 0.15rem 0.6rem;
  border: 1px solid var(--border-active);
  border-radius: 999px;
  font-size: 0.82rem;
  background: rgba(255, 255, 255, 0.04);
}
.setup-chip button {
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}
.setup-chip button:hover { background: rgba(255, 255, 255, 0.14); color: #fff; }
.setup-hint { display: block; margin-top: 0.5rem; color: var(--text-dim); font-size: 0.75rem; }

.legend-chip.mode-chip { border-color: var(--border-active); background: rgba(255, 255, 255, 0.06); color: var(--text); font-weight: 600; }
.legend-chip.mode-chip.roster-chip { color: var(--text-muted); font-weight: 400; }
.swap-chip.swap-call { padding: 0 10px; }

/* ==========================================================================
   Stage 3: quieter header (one notice, one prompt, people-only legend)
   ========================================================================== */
.notice-stack { position: relative; }
.notice-stack > .recall-bar:not([hidden]) ~ .recall-bar:not([hidden]) { display: none; }
.notice-stack .recall-row { flex-wrap: nowrap; }
.notice-stack .recall-label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notice-stack .recall-chip, .notice-stack .recall-dismiss { flex: 0 0 auto; }
.notice-stack[data-more]:not([data-more=""])::after {
  content: "+" attr(data-more) " more";
  position: absolute;
  right: 0.75rem;
  top: -0.35rem;
  padding: 0 0.4rem;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid var(--border-active);
  color: var(--text-muted);
  font-size: 0.68rem;
}

.recall-prompt { align-items: center; }
.recall-said { color: var(--text-muted); font-style: italic; font-size: 0.85rem; flex: 1 1 14rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recall-waiting { margin-left: auto; color: var(--text-muted); font-size: 0.72rem; white-space: nowrap; }

.legend-speaking { display: none; align-items: center; color: var(--spk-primary); }
.legend-chip.speaking .legend-speaking { display: inline-flex; animation: legend-speaking-pulse 1.1s ease-in-out infinite; }
.legend-chip.speaking .legend-dot { display: none; }
.legend-chip.speaking { border-color: var(--spk-primary); }
@keyframes legend-speaking-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
.legend-voices { font-size: 0.68rem; opacity: 0.8; padding: 0 0.3rem; border-radius: 999px; background: rgba(255, 255, 255, 0.1); }


/* Auto-corrections (Settings) */
.corrections-list { display: flex; flex-direction: column; gap: 0.3rem; margin: 0.4rem 0; }
.corrections-empty { color: var(--text-dim); font-size: 0.8rem; }
.corrections-item { display: flex; align-items: center; gap: 0.5rem; padding: 0.3rem 0.5rem; border: 1px solid var(--border-subtle); border-radius: 8px; font-size: 0.88rem; }
.corrections-item.off { opacity: 0.5; }
.corrections-item .corrections-text { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.corrections-item .corrections-arrow { color: var(--text-muted); padding: 0 0.3rem; }
.corrections-item button { border: 0; background: transparent; color: var(--text-muted); cursor: pointer; font-size: 1.1rem; line-height: 1; padding: 0 0.3rem; }
.corrections-item button:hover { color: #fff; }
.corrections-add { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.corrections-add .form-input { flex: 1 1 11rem; min-width: 0; }
.replace-toast-always { background: transparent; border: 1px solid var(--border-active); }

/* "I hear them now": the pinned speaker, and the small menu button that replaces the tap while recording */
.legend-pin { display: inline-flex; align-items: center; color: var(--spk-primary); }
.legend-chip.pinned { background: var(--spk-primary); color: #0b111e; border-color: var(--spk-primary); }
.legend-chip.pinned .legend-pin, .legend-chip.pinned .legend-speaking { color: #0b111e; }
.legend-chip.pinned .legend-voices { background: rgba(0, 0, 0, 0.15); }
.legend-menu-btn { display: none; border: 0; background: transparent; color: inherit; opacity: 0.7; cursor: pointer; font-size: 1rem; line-height: 1; padding: 0 0.2rem; }
.legend-menu-btn:hover { opacity: 1; }
.chat-legend-bar.is-listening .legend-menu-btn { display: inline-block; min-width: 24px; min-height: 24px; }

/* The waiting dots float just after the last word without taking any space, so they cause no vertical shift */
.typing-anchor { position: relative; display: inline-block; width: 0; height: 0; overflow: visible; }
.typing-anchor .typing { position: absolute; left: 0.35em; top: -0.35em; white-space: nowrap; }

/* The detected voice, next to a bubble's title */
.bubble-voice { font-size: 0.68rem; padding: 0 0.45rem; border-radius: 999px; border: 1px solid var(--border-active); color: var(--text-muted); white-space: nowrap; line-height: 1.5; }
.bubble-voice[hidden] { display: none; }
.bubble-voice.moved { border-style: dashed; }

/* ==========================================================================
   Assignment panel: select a bubble, click a name on the right
   ========================================================================== */
.workspace { flex: 1; display: flex; min-height: 0; }
.workspace > .chat-viewport { flex: 1; min-width: 0; }

.assign-panel {
  flex: 0 0 270px;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 0.9rem 0.8rem;
  border-left: 1px solid var(--border-subtle);
  background: rgba(8, 12, 20, 0.6);
  overflow-y: auto;
  font-size: 0.85rem;
}
.assign-panel.collapsed { flex-basis: 40px; padding: 0.6rem 0.3rem; align-items: center; overflow: hidden; }
.assign-panel.collapsed > :not(.assign-collapse) { display: none; }
.assign-head { display: flex; align-items: center; justify-content: space-between; gap: 0.4rem; }
.assign-head h3 { font-size: 0.95rem; margin: 0; }
.assign-collapse { border: 0; background: transparent; color: var(--text-muted); cursor: pointer; font-size: 1rem; padding: 0.1rem 0.3rem; border-radius: 6px; }
.assign-collapse:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.assign-selected { font-weight: 700; }
.assign-hint { color: var(--text-muted); font-size: 0.78rem; line-height: 1.45; margin: 0; }
.assign-scope { display: flex; border: 1px solid var(--border-active); border-radius: 8px; overflow: hidden; }
.assign-scope button { flex: 1; border: 0; background: transparent; color: var(--text-muted); padding: 0.35rem 0.4rem; font: inherit; font-size: 0.78rem; cursor: pointer; }
.assign-scope button[aria-pressed="true"] { background: var(--accent-fill); color: #fff; font-weight: 700; }
.assign-section { margin: 0.2rem 0 0; font-size: 0.7rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-dim); }
.assign-list { display: flex; flex-direction: column; gap: 4px; }
.assign-target {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--spk-border, var(--border-subtle));
  border-radius: 10px;
  background: var(--spk-bg, transparent);
  color: var(--text-main);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.assign-target:hover:not(:disabled) { border-color: var(--spk-primary, var(--border-active)); }
.assign-target:disabled { cursor: default; opacity: 0.55; }
.assign-target.current { border-color: var(--spk-primary); opacity: 1; }
.assign-target.unmatched { border-style: dashed; }
.assign-dot { flex: 0 0 auto; width: 10px; height: 10px; border-radius: 50%; background: var(--spk-primary, #94a3b8); }
.assign-name { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; font-weight: 600; }
.assign-meta { flex: 0 0 auto; color: var(--text-muted); font-size: 0.72rem; }
.assign-speaking { color: var(--spk-primary); display: inline-flex; }
.assign-add { display: flex; gap: 0.35rem; margin-top: 0.2rem; }
.assign-add input { flex: 1 1 auto; min-width: 0; background: #0b111e; color: #fff; border: 1px solid var(--border-active); border-radius: 8px; padding: 0.4rem 0.55rem; font: inherit; font-size: 0.82rem; }
.assign-add button { border: 1px solid var(--border-active); background: transparent; color: var(--text-main); border-radius: 8px; padding: 0 0.7rem; font: inherit; cursor: pointer; }

/* A selected bubble, and the circle that selects it */
.bubble-select { flex: 0 0 auto; width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--spk-primary, var(--border-active)); background: transparent; cursor: pointer; padding: 0; opacity: 0.6; }
.bubble-select:hover { opacity: 1; background: var(--spk-bg); }
.chat-message-row.selected .bubble-select { background: var(--spk-primary); opacity: 1; }
.chat-message-row.selected .chat-bubble,
.interim-row.selected .interim-bubble { outline: 2px solid var(--spk-primary); outline-offset: 2px; }
.swap-chips:empty { display: none; }

/* Phones and narrow windows: the panel becomes a sheet at the bottom, shown when a bubble is selected */
@media (max-width: 900px) {
  .assign-panel {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 120;
    flex: none;
    max-height: 48vh;
    border-left: 0;
    border-top: 1px solid var(--border-active);
    border-radius: 14px 14px 0 0;
    background: var(--bg-card);
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.45);
    padding-bottom: calc(0.9rem + env(safe-area-inset-bottom, 0px));
    transform: translateY(105%);
    transition: transform 0.18s ease;
  }
  .assign-panel.has-selection { transform: none; }
  .assign-panel.collapsed { flex-basis: auto; padding: 0.9rem 0.8rem; align-items: stretch; overflow-y: auto; }
  .assign-panel.collapsed > :not(.assign-collapse) { display: revert; }
  .assign-collapse { display: none; }
}

.assign-panel > * { flex-shrink: 0; }
.assign-scope button { min-height: 34px; }


/* Selected text, offered in the panel */
.assign-quote { display: flex; align-items: flex-start; gap: 0.4rem; }
.assign-quote q { flex: 1 1 auto; min-width: 0; color: var(--text-muted); font-style: italic; font-size: 0.8rem; quotes: "\201c" "\201d"; overflow-wrap: anywhere; }
.assign-quote-clear { flex: 0 0 auto; width: 24px; height: 24px; margin: -4px -4px 0 0; border: 0; border-radius: 6px; background: transparent; color: var(--text-muted); font-size: 1.15rem; line-height: 1; cursor: pointer; }
.assign-quote-clear:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.assign-snap { align-self: flex-start; border: 0; background: transparent; color: var(--text-dim); font: inherit; font-size: 0.72rem; text-decoration: underline; cursor: pointer; padding: 0; }
.assign-snap:hover { color: var(--text-main); }

/* The burger menu button at the top right of a bubble */
.btn-flip-speaker.bubble-menu { display: inline-flex; align-items: center; justify-content: center; padding: 0.2rem 0.4rem; line-height: 0; }
.bubble-speaker { flex: 0 1 auto; text-align: left; }

/* Speakers and their menus now live in the panel; the strip above the transcript is gone */
.chat-legend-bar { display: none !important; }
.assign-setup { align-self: flex-start; border: 1px solid var(--border-active); background: rgba(255, 255, 255, 0.06); color: var(--text-main); border-radius: 999px; padding: 0.25rem 0.75rem; font: inherit; font-size: 0.8rem; font-weight: 600; cursor: pointer; }
.assign-setup:hover { border-color: var(--text-muted); }
.assign-item { display: flex; align-items: stretch; gap: 4px; }
.assign-item .assign-target { flex: 1 1 auto; min-width: 0; width: auto; }
.assign-more { flex: 0 0 auto; min-width: 30px; border: 1px solid var(--border-subtle); background: transparent; color: var(--text-muted); border-radius: 10px; font: inherit; font-size: 1rem; line-height: 1; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 0 0.3rem; }
.assign-more:hover { color: #fff; border-color: var(--text-muted); }
.assign-pin[aria-pressed="true"] { background: var(--accent-fill); color: #fff; border-color: var(--soniox-blue); }
.assign-swap { align-self: flex-start; border: 1px dashed var(--border-active); background: transparent; color: var(--text-muted); border-radius: 999px; padding: 0.25rem 0.75rem; font: inherit; font-size: 0.78rem; cursor: pointer; }
.assign-add { align-items: stretch; }
.assign-add textarea { flex: 1 1 auto; min-width: 0; resize: vertical; background: #0b111e; color: #fff; border: 1px solid var(--border-active); border-radius: 8px; padding: 0.4rem 0.55rem; font: inherit; font-size: 0.82rem; }

/* Paint mode and auto-advance */
.assign-paint { align-self: flex-start; border: 1px solid var(--border-active); background: transparent; color: var(--text-main); border-radius: 999px; padding: 0.25rem 0.75rem; font: inherit; font-size: 0.8rem; cursor: pointer; }
.assign-paint[aria-pressed="true"] { background: var(--accent-fill); border-color: var(--soniox-blue); color: #fff; font-weight: 700; }
.assign-target.armed { border-color: var(--spk-primary); box-shadow: 0 0 0 2px var(--spk-primary); }
.assign-check { display: flex; align-items: center; gap: 0.35rem; color: var(--text-muted); font-size: 0.78rem; cursor: pointer; }
.chat-stream.painting .chat-message-row { cursor: crosshair; }

/* Phones: the People button, the sheet's close button, room under the transcript for the open sheet */
.assign-fab, .assign-close { display: none; }
@media (max-width: 900px) {
  .assign-fab { display: inline-flex; position: fixed; right: 12px; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); z-index: 110; padding: 0.55rem 1rem; border: 1px solid var(--border-active); border-radius: 999px; background: var(--bg-card); color: var(--text-main); font: inherit; font-size: 0.85rem; font-weight: 600; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4); }
  body.sheet-open .assign-fab { display: none; }
  .assign-close { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; margin: -4px -4px 0 auto; border: 0; border-radius: 8px; background: transparent; color: var(--text-muted); font-size: 1.4rem; line-height: 1; cursor: pointer; }
  .assign-close:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
  body.sheet-open .chat-stream { padding-bottom: 50vh; }
  body.sheet-open .jump-latest-btn { display: none; }
  .assign-item .assign-more { min-width: 40px; min-height: 40px; }
  .assign-target { min-height: 40px; }
  /* A compact sheet leaves room to see the selected bubble above it */
  .assign-panel { max-height: 40vh; gap: 0.45rem; padding-top: 0.6rem; }
  .assign-panel .assign-hint, .assign-panel .assign-check, .assign-panel .assign-setup, .assign-panel .assign-snap { display: none; }
  .assign-panel .assign-list { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
  .assign-panel .assign-meta { display: none; }
}

/* The three controls: Record / Pause / Resume, and Stop beside it while recording or paused */
.btn .btn-glyph { display: inline-flex; align-items: center; }
.btn-stop { background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%); border-color: rgba(248, 113, 113, 0.5); color: #fff; }
.btn-stop:hover { background: linear-gradient(135deg, #f87171 0%, #dc2626 100%); box-shadow: 0 6px 18px rgba(239, 68, 68, 0.45); }
.btn-stop.recording { animation: pulse-rec-btn 1.6s infinite ease-in-out; }
html.no-motion .btn-stop.recording { animation: none; }

/* Start, the kind-of-recording arrow and Pause sit together */
.start-group { display: flex; align-items: center; gap: 0.35rem; flex-wrap: wrap; }
.start-group .btn[hidden] { display: none; }

/* Library drawer */
.library-head { display: flex; align-items: center; gap: 0.4rem; padding: 0.8rem 0.9rem 0.3rem; }
.library-head h3 { flex: 1 1 auto; margin: 0; font-size: 1rem; }
.library-head button { border: 0; background: transparent; color: var(--text-muted); font-size: 1.2rem; line-height: 1; cursor: pointer; padding: 0.2rem 0.45rem; border-radius: 6px; min-width: 32px; min-height: 32px; }
.library-head button:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.library-sub { display: flex; justify-content: space-between; gap: 0.5rem; padding: 0 0.9rem 0.5rem; color: var(--text-dim); font-size: 0.75rem; }
.library-folder { font-weight: 600; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.library-body { flex: 1 1 auto; overflow-y: auto; padding: 0 0.6rem 1rem; display: flex; flex-direction: column; gap: 0.6rem; }
.library-empty { color: var(--text-muted); font-size: 0.85rem; line-height: 1.5; margin: 0.4rem 0.3rem; }
.library-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.library-item { position: relative; display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left; padding: 0.55rem 0.7rem; border: 1px solid var(--border-subtle); border-radius: 10px; background: transparent; color: var(--text-main); font: inherit; cursor: pointer; }
.library-item:hover { border-color: var(--border-active); background: rgba(255, 255, 255, 0.05); }
.library-title { font-weight: 600; font-size: 0.88rem; overflow-wrap: anywhere; padding-right: 3.5rem; }
.library-meta { color: var(--text-dim); font-size: 0.72rem; }
.library-badge { position: absolute; top: 0.5rem; right: 0.6rem; font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--accent-text); border: 1px solid var(--soniox-blue); border-radius: 999px; padding: 0 0.4rem; }

/* Library: search, sort, rename, delete */
.library-tools { display: flex; gap: 0.4rem; padding: 0 0.6rem 0.5rem; }
.library-search { flex: 1 1 auto; min-width: 0; background: #0b111e; color: #fff; border: 1px solid var(--border-active); border-radius: 8px; padding: 0.4rem 0.6rem; font: inherit; font-size: 0.82rem; }
.library-sort { flex: 0 0 auto; background: #0b111e; color: #fff; border: 1px solid var(--border-active); border-radius: 8px; padding: 0.35rem 0.4rem; font: inherit; font-size: 0.8rem; }
.library-row { position: relative; }
.library-actions { position: absolute; right: 0.4rem; bottom: 0.35rem; display: flex; gap: 2px; opacity: 0; transition: opacity 0.12s; }
.library-row:hover .library-actions, .library-row:focus-within .library-actions { opacity: 1; }
@media (hover: none) { .library-actions { opacity: 1; } }
.library-act { border: 0; background: transparent; color: var(--text-muted); cursor: pointer; border-radius: 6px; min-width: 28px; min-height: 28px; display: inline-flex; align-items: center; justify-content: center; }
.library-act:hover { background: rgba(255, 255, 255, 0.14); color: #fff; }
.library-delete:hover { color: #ff8a8a; }
.library-rename-input { width: 100%; background: #0b111e; color: #fff; border: 1px solid var(--border-active); border-radius: 6px; padding: 0.15rem 0.35rem; font: inherit; font-size: 0.88rem; font-weight: 600; }

.library-note { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.8rem; padding: 0.45rem 0.6rem; border: 1px dashed var(--border-active); border-radius: 10px; color: var(--text-muted); font-size: 0.78rem; }
.library-note .btn-text { padding: 0; }
.library-actions { gap: 0; }

/* Source and Type, beside Start recording */
.start-field { display: inline-flex; align-items: center; gap: 0.4rem; color: var(--text-muted); font-size: 0.78rem; }
.start-field .form-select { padding: 0.35rem 0.5rem; font-size: 0.82rem; max-width: 12.5rem; }
.start-field .form-select:disabled { opacity: 0.55; cursor: not-allowed; }
@media (max-width: 600px) { .start-field span { display: none; } .start-field .form-select { max-width: 9.5rem; } }

/* ---- Tabs and views ---- */
.tab-bar { display: flex; align-items: center; gap: 0.15rem; padding: 0 1.25rem; background: rgba(8, 12, 20, 0.95); border-bottom: 1px solid var(--border-subtle); overflow-x: auto; }
.tab { background: none; border: 0; border-bottom: 2px solid transparent; color: var(--text-muted); font: inherit; font-weight: 600; font-size: 0.9rem; padding: 0.65rem 0.95rem; cursor: pointer; white-space: nowrap; }
.tab:hover { color: var(--text-main); }
.tab[aria-selected="true"] { color: #fff; border-bottom-color: var(--soniox-blue); }
.tab-spacer { flex: 1 1 auto; }
/* "Transcribe live" and "Transcribe a recording" are "Live" and "Recording" where there is no room for the long names */
.tab .tab-short { display: none; }
@media (max-width: 640px) {
  .tab .tab-long { display: none; }
  .tab .tab-short { display: inline; }
}
.tab-bar .btn { flex: 0 0 auto; }
.view { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }
.view[hidden] { display: none; }
.transcript-host, .transcript-area { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }
.page { flex: 1 1 auto; overflow-y: auto; padding: 1.25rem 1.25rem 3rem; width: 100%; }
.page h2 { margin: 0 0 0.3rem; font-size: 1.25rem; }
.page-lead { color: var(--text-muted); margin: 0 0 1.1rem; line-height: 1.5; }
.page-narrow { max-width: 780px; margin: 0 auto; }
.card { background: rgba(255, 255, 255, 0.04); border: 1px solid var(--border-subtle); border-radius: 14px; padding: 1rem 1.15rem; margin-bottom: 0.9rem; }
.card h3 { margin: 0 0 0.35rem; font-size: 1rem; }
.card p { margin: 0 0 0.8rem; color: var(--text-muted); font-size: 0.88rem; line-height: 1.55; }
.card-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }

/* Library as a page */
.library-page { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; width: 100%; max-width: 980px; margin: 0 auto; padding: 1rem 1.25rem 0; }
.library-page[hidden] { display: none; }
.library-head { display: flex; align-items: center; gap: 0.4rem; padding: 0 0 0.3rem; }
.library-head h2 { flex: 1 1 auto; margin: 0; font-size: 1.25rem; }
.library-sub { padding: 0 0 0.6rem; }
.library-tools { padding: 0 0 0.6rem; }
.library-body { padding: 0 0 2rem; }
.library-actions { opacity: 0.55; }
.editor-wrap { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }
.editor-wrap[hidden] { display: none; }
.editor-bar { display: flex; align-items: center; gap: 0.75rem; padding: 0.5rem 1.25rem; border-bottom: 1px solid var(--border-subtle); background: rgba(8, 12, 20, 0.7); }
.play-from-btn { display: inline-flex; align-items: center; gap: 0.3rem; }
.play-from-btn:disabled { opacity: 0.4; cursor: default; }
.play-from-btn.is-on { background: var(--accent-fill); border-color: transparent; color: #fff; }
.editor-bar-title { flex: 1 1 auto; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-muted); }

/* Settings as a page */
.page-settings { max-width: 1280px; margin: 0 auto; }
/* wider for the transcriber table; text and forms keep a readable measure */
.settings-section > p, .settings-section .form-hint, .settings-section .provider-notices, .settings-section .form-group:not(.form-group-wide) { max-width: 760px; }
.settings-wrap .modal-card { max-width: none; width: 100%; box-shadow: none; overflow: visible; }
.settings-wrap .modal-body { max-height: none; overflow: visible; }
.settings-wrap .modal-header .btn-close { display: none; }
.settings-wrap .modal-footer { position: sticky; bottom: 0; background: var(--bg-card); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }

/* Welcome: the folder step */
.splash-folder-box { border-color: var(--soniox-blue); }
.splash-folder-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 0.75rem; }
.splash-folder-status { color: var(--text-muted); font-size: 0.85rem; }
.splash-folder-status.ok { color: #7bd88f; }
.form-group[hidden] { display: none; }

/* A person who has left the meeting */
.assign-target.left { opacity: 0.6; border-style: dotted; }
.assign-left { flex: 0 0 auto; font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); border: 1px solid var(--border-active); border-radius: 999px; padding: 0 0.4rem; }

/* The header and the tabs never shrink or scroll away: only the view below them gives way */
.app-container { overflow: hidden; }
.app-container > .top-bar, .app-container > .tab-bar { flex: 0 0 auto; }
.tab-bar { min-height: 2.6rem; }
.view > .controls-toolbar, .view > .editor-bar { flex: 0 0 auto; }
.transcript-area > * { flex-shrink: 0; }
.transcript-area > .workspace { flex-shrink: 1; }

/* Settings sections */
.settings-nav { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; gap: 0.4rem; padding: 0.55rem 0; background: var(--bg-card); border-bottom: 1px solid var(--border-subtle); }
.settings-nav-btn { border: 1px solid var(--border-subtle); background: transparent; color: var(--text-muted); border-radius: 999px; padding: 0.3rem 0.85rem; font: inherit; font-size: 0.82rem; font-weight: 600; cursor: pointer; }
.settings-nav-btn:hover { color: var(--text-main); border-color: var(--border-active); }
.settings-nav-btn.active { color: #fff; background: var(--accent-fill); border-color: var(--soniox-blue); }
.settings-section { display: flex; flex-direction: column; gap: 1.25rem; padding: 1.1rem 1.15rem 1.25rem; border: 1px solid var(--border-subtle); border-radius: 14px; background: rgba(255, 255, 255, 0.03); scroll-margin-top: 3.4rem; }
.settings-section-title { margin: 0; font-size: 1.05rem; }
.settings-section-intro { margin: -0.85rem 0 0; color: var(--text-muted); font-size: 0.85rem; }
.settings-section[hidden] { display: none; }

/* The service in use sits in the middle of the header */
.hud-service { text-decoration: none; }
.hud-service:hover { text-decoration: underline; }

/* ---- Recording indicator (middle of the header) ---- */
.rec-indicator { display: flex; align-items: center; gap: 0.45rem; padding: 0 0.7rem 0 0.2rem; font-family: var(--font-mono); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; color: #ff6b6b; }
.rec-indicator[hidden] { display: none; }
.rec-dot { width: 0.62rem; height: 0.62rem; border-radius: 50%; background: #ff4d4d; box-shadow: 0 0 0 0 rgba(255, 77, 77, 0.6); animation: rec-pulse 1.5s ease-out infinite; }
.rec-time { color: var(--text-main); font-variant-numeric: tabular-nums; min-width: 2.4em; }
.rec-indicator[data-state="paused"] { color: #fbbf24; }
.rec-indicator[data-state="paused"] .rec-dot { background: #fbbf24; animation: none; }
.rec-indicator[data-state="file"] { color: #60a5fa; }
.rec-indicator[data-state="file"] .rec-dot { background: #60a5fa; animation-name: rec-pulse-blue; }
.diarization-hud { transition: border-color 0.25s ease, box-shadow 0.25s ease; }
.diarization-hud.is-recording { border-color: rgba(255, 77, 77, 0.45); box-shadow: 0 0 18px rgba(255, 77, 77, 0.12); }
.diarization-hud.is-paused { border-color: rgba(251, 191, 36, 0.4); }
@keyframes rec-pulse { 0% { box-shadow: 0 0 0 0 rgba(255, 77, 77, 0.6); } 70% { box-shadow: 0 0 0 0.5rem rgba(255, 77, 77, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 77, 77, 0); } }
@keyframes rec-pulse-blue { 0% { box-shadow: 0 0 0 0 rgba(96, 165, 250, 0.6); } 70% { box-shadow: 0 0 0 0.5rem rgba(96, 165, 250, 0); } 100% { box-shadow: 0 0 0 0 rgba(96, 165, 250, 0); } }

/* ---- Polish: view transitions and small movements ---- */
/* The header and the tabs stay still while the page under them cross-fades */
.top-bar { view-transition-name: zs-header; }
.tab-bar { view-transition-name: zs-tabs; }
::view-transition-group(zs-header), ::view-transition-group(zs-tabs) { animation-duration: 0s; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.18s; animation-timing-function: ease; }

.btn, .tab, .library-item, .assign-target, .settings-nav-btn, .library-act, .assign-more, .recall-chip {
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease, opacity 0.15s ease;
}
.btn:active:not(:disabled), .settings-nav-btn:active, .assign-target:active:not(:disabled) { transform: translateY(1px); }
.library-item:hover { transform: translateY(-1px); }
.tab { transition: color 0.15s ease, border-color 0.2s ease; }
:is(button, select, input, textarea, a, [tabindex="0"]):focus-visible { outline: 2px solid var(--soniox-blue); outline-offset: 2px; }

@keyframes fade-up { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.settings-section:not([hidden]), .card { animation: fade-up 0.2s ease-out both; }
.dialog-overlay, .modal-overlay { animation: fade-in 0.15s ease-out both; }
.dialog-card, .modal-overlay .modal-card { animation: pop-in 0.18s ease-out both; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(8px) scale(0.985); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}

.card-note { margin: -0.3rem 0 0.8rem; font-size: 0.82rem; color: var(--text-dim); }
.card p.card-note { color: var(--text-dim); }

/* Notices */
.mini-label { display: block; margin-top: 0.6rem; font-size: 0.78rem; color: var(--text-muted); }
.form-group textarea.form-input { resize: vertical; min-height: 3rem; font: inherit; }
.notice-banner { flex: 0 0 auto; padding: 0.35rem 1.25rem; font-size: 0.82rem; color: #fca5a5; background: rgba(239, 68, 68, 0.08); border-bottom: 1px solid rgba(239, 68, 68, 0.25); }
.notice-banner[hidden] { display: none; }
#announceBtn.is-speaking { background: var(--accent-fill); border-color: var(--soniox-blue); color: #fff; }

/* Live log */
.live-log { position: fixed; left: 12px; bottom: 12px; z-index: 90; width: min(560px, calc(100vw - 24px)); max-height: 38vh; display: flex; flex-direction: column; background: rgba(8, 12, 20, 0.94); border: 1px solid var(--border-active); border-radius: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); }
.live-log[hidden] { display: none; }
.live-log-head { display: flex; align-items: center; gap: 0.5rem; padding: 0.4rem 0.6rem; border-bottom: 1px solid var(--border-subtle); font-size: 0.78rem; }
.live-log-hint { flex: 1 1 auto; min-width: 0; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-log-body { overflow: auto; padding: 0.4rem 0.6rem; font-family: var(--font-mono); font-size: 0.72rem; line-height: 1.5; white-space: pre; }
.live-log-line { color: var(--text-muted); }
.live-log-final { color: #7bd88f; }
.live-log-held { color: #fbbf24; }
.live-log-label { color: #f9a8d4; }
.live-log-live { color: var(--text-main); }

/* Live words whose speaker is not known yet */
.interim-row.unknown-speaker .interim-bubble { border-style: dashed !important; }
.interim-row.unknown-speaker .swap-chips, .interim-row.unknown-speaker .bubble-meta { display: none; }
.interim-row.unknown-speaker .pulsing-mic { background: var(--text-dim); }

/* A file-only provider is selected: the recording controls are greyed out and a note says why */
.live-unavailable { flex: 0 0 auto; padding: 0.45rem 1.25rem; font-size: 0.85rem; color: var(--text-muted); background: rgba(245, 158, 11, 0.10); border-bottom: 1px solid rgba(245, 158, 11, 0.30); }
.live-unavailable[hidden] { display: none; }
.live-unavailable a { margin-left: 0.4rem; color: inherit; font-weight: 600; text-decoration: underline; }
.start-group.live-off { opacity: 0.5; }
.start-group.live-off, .start-group.live-off * { cursor: not-allowed; }

.live-log-head { cursor: grab; touch-action: none; user-select: none; }
.live-log.dragging .live-log-head { cursor: grabbing; }

#fileSoundBtn.is-off { opacity: 0.7; }

/* Play this part of the audio: shown on every bubble once the transcript has a recording */
.bubble-play { display: none; align-items: center; justify-content: center; width: 1.7rem; height: 1.5rem; padding: 0; border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 4px; background: rgba(255, 255, 255, 0.08); color: var(--text-muted); cursor: pointer; transition: all 0.15s ease; }
.has-audio .bubble-play { display: inline-flex; }
.bubble-play:hover { background: rgba(255, 255, 255, 0.16); color: #fff; }
.chat-message-row.is-playing .bubble-play { background: var(--accent-fill); border-color: transparent; color: #fff; }
.chat-message-row.is-playing .chat-bubble { box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.45); }


/* ---- Motion: pages slide and settle with a little bounce, the tab underline springs, pop-ups pop ---- */
:root { --spring: cubic-bezier(0.34, 1.56, 0.64, 1); --settle: cubic-bezier(0.22, 1, 0.36, 1); }

/* Each page is its own layer, so the header and the tab bar stay still while the page under them moves */
.view:not([hidden]) { view-transition-name: zs-page; }
.settings-section:not([hidden]) { view-transition-name: zs-section; }
::view-transition-group(zs-page), ::view-transition-group(zs-section) { animation-duration: 0.01s; }

@keyframes zs-out-left  { to { opacity: 0; transform: translateX(-36px) scale(0.985); } }
@keyframes zs-out-right { to { opacity: 0; transform: translateX(36px) scale(0.985); } }
@keyframes zs-in-right  { from { opacity: 0; transform: translateX(56px); } 55% { opacity: 1; } to { opacity: 1; transform: none; } }
@keyframes zs-in-left   { from { opacity: 0; transform: translateX(-56px); } 55% { opacity: 1; } to { opacity: 1; transform: none; } }
@keyframes zs-rise      { from { opacity: 0; transform: translateY(18px) scale(0.99); } 60% { opacity: 1; } to { opacity: 1; transform: none; } }
@keyframes zs-sink      { to { opacity: 0; transform: translateY(-8px); } }

::view-transition-old(zs-page) { animation: zs-sink 0.16s ease-in both; }
::view-transition-new(zs-page) { animation: zs-rise 0.45s var(--spring) both; }
html[data-vt="tab-forward"]::view-transition-old(zs-page) { animation: zs-out-left 0.17s ease-in both; }
html[data-vt="tab-forward"]::view-transition-new(zs-page) { animation: zs-in-right 0.48s var(--spring) both; }
html[data-vt="tab-back"]::view-transition-old(zs-page)    { animation: zs-out-right 0.17s ease-in both; }
html[data-vt="tab-back"]::view-transition-new(zs-page)    { animation: zs-in-left 0.48s var(--spring) both; }

/* Moving between settings sections: only the section moves, the page and the pills stay */
html[data-vt^="section"]::view-transition-old(zs-page), html[data-vt^="section"]::view-transition-new(zs-page) { animation: none; }
html[data-vt="section-forward"]::view-transition-old(zs-section) { animation: zs-out-left 0.15s ease-in both; }
html[data-vt="section-forward"]::view-transition-new(zs-section) { animation: zs-in-right 0.42s var(--spring) both; }
html[data-vt="section-back"]::view-transition-old(zs-section)    { animation: zs-out-right 0.15s ease-in both; }
html[data-vt="section-back"]::view-transition-new(zs-section)    { animation: zs-in-left 0.42s var(--spring) both; }
/* Without view transitions (or when the section did not get one) the new section still arrives with a small bounce */
.settings-section:not([hidden]) { animation: zs-rise 0.4s var(--spring) both; }

/* The tab underline grows from the middle with a spring, and the label gives a small hop */
.tab { position: relative; border-bottom-color: transparent !important; }
.tab::after { content: ''; position: absolute; left: 0.5rem; right: 0.5rem; bottom: -1px; height: 2px; border-radius: 2px; background: var(--soniox-blue); transform: scaleX(0); transition: transform 0.38s var(--spring); }
.tab[aria-selected="true"]::after { transform: scaleX(1); }
.tab[aria-selected="true"] { animation: tab-hop 0.45s var(--spring); }
@keyframes tab-hop { 0% { transform: translateY(0); } 35% { transform: translateY(-3px); } 100% { transform: translateY(0); } }
.tab:active { transform: scale(0.96); }

/* Settings pills: the chosen one pops, and every pill springs when pressed */
.settings-nav-btn { transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.25s var(--spring), box-shadow 0.2s ease; }
.settings-nav-btn.active { animation: pill-pop 0.4s var(--spring); box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35); }
@keyframes pill-pop { 0% { transform: scale(0.9); } 60% { transform: scale(1.07); } 100% { transform: scale(1); } }
.settings-nav-btn:active { transform: scale(0.94); }

/* Buttons and rows spring back; dialogs, pop-ups and toasts arrive with a bounce */
.btn:not(:disabled):active { transform: scale(0.96); }
.btn { transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.22s var(--spring), opacity 0.15s ease; }
.library-item { transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.25s var(--spring), box-shadow 0.2s ease; }
.library-item:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25); }
@keyframes pop-bounce { 0% { opacity: 0; transform: translateY(14px) scale(0.94); } 60% { opacity: 1; transform: translateY(-2px) scale(1.012); } 100% { opacity: 1; transform: none; } }
.dialog-card, .modal-overlay .modal-card { animation: pop-bounce 0.38s var(--settle) both; }
.chat-message-row.just-added { animation: bubble-in 0.4s var(--spring) both; }
/* A bubble with its own entrance (transcript-view.js, _appearIn), or one taking over words already on screen: not this one */
.chat-message-row.just-added.no-enter { animation: none; }
@keyframes bubble-in { from { opacity: 0; transform: translateY(10px) scale(0.97); } to { opacity: 1; transform: none; } }
.bubble-play, .bubble-select, .btn-flip-speaker { transition: background-color 0.15s ease, color 0.15s ease, transform 0.22s var(--spring); }
.bubble-play:active { transform: scale(0.88); }
.chat-message-row.is-playing .bubble-play { animation: pill-pop 0.4s var(--spring); }

@media (prefers-reduced-motion: reduce) {
  .tab::after, .settings-nav-btn, .btn, .library-item { transition: none !important; }
  .tab[aria-selected="true"], .settings-nav-btn.active, .settings-section:not([hidden]), .chat-message-row.just-added, .dialog-card, .glossary-pop { animation: none !important; }
}
html.no-motion .tab[aria-selected="true"], html.no-motion .settings-nav-btn.active, html.no-motion .settings-section:not([hidden]), html.no-motion .chat-message-row.just-added, html.no-motion .glossary-pop { animation: none !important; }

/* ---- Glossary: abbreviations are underlined with a wave and explained in a pop-up when clicked ---- */
.glossary-term { text-decoration: underline wavy; text-decoration-color: rgba(147, 197, 253, 0.85); text-decoration-thickness: 1px; text-underline-offset: 4px; cursor: help; transition: background-color 0.15s ease; border-radius: 3px; }
.glossary-term:hover { background: rgba(147, 197, 253, 0.16); text-decoration-color: #93c5fd; }
.glossary-pop { position: fixed; z-index: 120; width: min(26rem, calc(100vw - 16px)); max-height: min(60vh, 28rem); display: flex; flex-direction: column; background: rgba(12, 18, 30, 0.98); border: 1px solid var(--border-active); border-radius: 12px; box-shadow: 0 14px 40px rgba(0, 0, 0, 0.55); font-size: 0.88rem; transform-origin: top left; animation: glossary-pop 0.34s var(--spring) both; }
.glossary-pop.above { transform-origin: bottom left; }
@keyframes glossary-pop { from { opacity: 0; transform: scale(0.88) translateY(-6px); } to { opacity: 1; transform: none; } }
.glossary-pop-head { display: flex; align-items: center; gap: 0.6rem; padding: 0.55rem 0.75rem; border-bottom: 1px solid var(--border-subtle); }
.glossary-pop-head strong { font-size: 1rem; }
.glossary-pop-source { flex: 1 1 auto; min-width: 0; color: var(--text-dim); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; }
.glossary-pop-body { overflow: auto; padding: 0.6rem 0.75rem; }
.glossary-pop-body h4 { margin: 0.4rem 0 0.15rem; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-dim); }
.glossary-pop-body h4:first-child { margin-top: 0; }
.glossary-pop-body ol { margin: 0; padding-left: 1.2rem; }
.glossary-pop-body li { margin: 0.25rem 0; line-height: 1.45; }
.glossary-pop-body a, .glossary-pop-foot a { color: #93c5fd; }
.glossary-example { color: var(--text-dim); font-style: italic; font-size: 0.8rem; }
.glossary-note { color: var(--text-dim); font-size: 0.8rem; margin: 0.25rem 0 0; }
.glossary-pop-foot { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.45rem 0.75rem; border-top: 1px solid var(--border-subtle); color: var(--text-dim); font-size: 0.75rem; }
.glossary-pop-foot:empty { display: none; }

/* ---- Search the transcript ---- */
.search-bar { flex: 0 0 auto; display: flex; align-items: center; gap: 0.5rem; padding: 0.4rem 1.25rem; background: rgba(8, 12, 20, 0.95); border-bottom: 1px solid var(--border-subtle); animation: fade-up 0.25s var(--spring) both; }
.search-bar[hidden] { display: none; }
.search-bar input[type="search"] { flex: 1 1 14rem; min-width: 8rem; max-width: 26rem; }
.search-bar.no-match input[type="search"] { border-color: #f87171; }
.search-count { color: var(--text-muted); font-size: 0.8rem; min-width: 7rem; white-space: nowrap; }
.search-case { display: inline-flex; align-items: center; gap: 0.25rem; color: var(--text-muted); font-size: 0.8rem; cursor: pointer; }
::highlight(zs-search) { background-color: rgba(250, 204, 21, 0.35); color: inherit; }
::highlight(zs-search-current) { background-color: #facc15; color: #111827; }
.chat-message-row.search-current .chat-bubble { box-shadow: 0 0 0 2px rgba(250, 204, 21, 0.55); }
html.no-motion .search-bar { animation: none; }
@media (max-width: 600px) { .search-count { min-width: 0; } .search-case { display: none; } }

.search-bar { flex-wrap: wrap; }
.search-replace-row { flex: 1 0 100%; display: flex; align-items: center; gap: 0.5rem; }
.search-replace-row[hidden] { display: none; }
.search-replace-row input { flex: 1 1 14rem; min-width: 8rem; max-width: 26rem; }

/* Saved sets of attendees, in the setup dialog */
.setup-sets { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-bottom: 0.3rem; }
.setup-sets .form-select { max-width: 15rem; }
.setup-sets .form-input { flex: 1 1 12rem; min-width: 8rem; }
.setup-sets [hidden] { display: none; }

/* ---- Sharing live captions ---- */
#shareBtn.sharing { color: #fff; background: #dc2626; border-color: #dc2626; animation: rec-pulse 2s infinite; }
#shareBtn.share-error { color: #fbbf24; border-color: #fbbf24; }
#shareBtn.is-off { opacity: 0.45; cursor: not-allowed; }
#shareBtn.is-off:hover { transform: none; box-shadow: none; }
.share-card { max-width: 30rem; }
.share-status { margin: 0 0 0.6rem; font-weight: 600; }
.share-status[data-state="error"] { color: #fbbf24; }
.share-links { display: flex; flex-direction: column; gap: 0.5rem; }
.share-link { display: grid; grid-template-columns: 1fr auto; gap: 0.3rem 0.5rem; align-items: center; }
.share-link-label { grid-column: 1 / -1; font-size: 0.75rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.04em; }
.share-link.chosen .share-link-label { color: var(--accent-text); }
.share-qr { display: flex; justify-content: center; margin: 0.9rem 0 0.5rem; }
.share-qr svg { width: 11rem; height: 11rem; background: #fff; border-radius: 8px; padding: 4px; }
html.no-motion #shareBtn.sharing { animation: none; }

/* Merge bubbles, and the suggestion to merge a stray voice */
.assign-merge { margin: 0.3rem 0 0.6rem; width: 100%; padding: 0.4rem 0.6rem; border-radius: 8px; border: 1px solid var(--border-active); background: transparent; color: var(--text-main); font: inherit; font-size: 0.85rem; cursor: pointer; }
.assign-merge:hover { background: rgba(255, 255, 255, 0.08); }
.assign-suggest { margin: 0.6rem 0; padding: 0.6rem 0.7rem; border: 1px solid rgba(251, 191, 36, 0.4); border-radius: 10px; background: rgba(251, 191, 36, 0.07); }
.assign-suggest-title { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: #fbbf24; margin-bottom: 0.3rem; }
.assign-suggest-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; margin-top: 0.35rem; font-size: 0.82rem; }
.assign-suggest-text { flex: 1 1 100%; color: var(--text-muted); }

/* ---- Summary ---- */
.summary-card { max-width: 38rem; width: calc(100vw - 2rem); }
.summary-body { max-height: 65vh; overflow-y: auto; overflow-x: hidden; }
.summary-text h4 { margin: 0.9rem 0 0.25rem; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent-text); }
.summary-text h4:first-child { margin-top: 0; }
.summary-text p { margin: 0.2rem 0; line-height: 1.5; }
.summary-text ul { margin: 0.2rem 0 0.2rem 1.1rem; padding: 0; }
.summary-text li { margin: 0.2rem 0; line-height: 1.45; }
.summary-text a { color: #93c5fd; }
.summary-progress { display: flex; flex-direction: column; gap: 0.45rem; color: var(--text-muted); font-size: 0.85rem; }
.summary-bar { position: relative; height: 4px; border-radius: 999px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.summary-bar i { position: absolute; top: 0; bottom: 0; left: -35%; width: 35%; border-radius: 999px; background: var(--soniox-blue); animation: summary-slide 1.3s ease-in-out infinite; }
@keyframes summary-slide { 0% { left: -35%; } 100% { left: 100%; } }
html.no-motion .summary-bar i { animation: none; left: 0; width: 100%; opacity: 0.5; }
.summary-error { color: #fbbf24; font-size: 0.9rem; }

.summary-format { margin: 0.8rem 0 0; display: flex; flex-direction: column; gap: 0.25rem; }
.summary-format label { display: flex; align-items: center; gap: 0.6rem; font-size: 0.85rem; color: var(--text-muted); }
.summary-format select { max-width: 17rem; }
.summary-custom { width: 100%; resize: vertical; margin: 0.3rem 0 0.4rem; }

/* ---- Notes on bubbles ---- */
.bubble-note-btn { display: inline-flex; align-items: center; justify-content: center; width: 1.7rem; height: 1.5rem; padding: 0; border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 4px; background: rgba(255, 255, 255, 0.08); color: var(--text-muted); cursor: pointer; opacity: 0.55; transition: opacity 0.15s ease, background-color 0.15s ease, color 0.15s ease, transform 0.22s var(--spring); }
.chat-message-row:hover .bubble-note-btn, .bubble-note-btn.has-note, .bubble-note-btn:focus-visible { opacity: 1; }
.bubble-note-btn:hover { background: rgba(250, 204, 21, 0.2); color: #fde68a; }
.bubble-note-btn.has-note { background: rgba(250, 204, 21, 0.22); border-color: rgba(250, 204, 21, 0.5); color: #fde68a; }
.bubble-note-btn:active { transform: scale(0.88); }
.bubble-note { display: flex; align-items: flex-start; gap: 0.5rem; margin: 0.45rem 0 0; padding: 0.4rem 0.6rem; border-radius: 8px; background: rgba(250, 204, 21, 0.1); border: 1px dashed rgba(250, 204, 21, 0.45); }
.bubble-note[hidden] { display: none; }
.bubble-note-label { flex: 0 0 auto; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.06em; color: #fbbf24; padding-top: 0.15rem; }
.bubble-note-text { flex: 1 1 auto; text-align: left; background: none; border: 0; padding: 0; color: var(--text-main); font: inherit; font-size: 0.9rem; cursor: text; overflow-wrap: anywhere; }
.bubble-note-input { flex: 1 1 auto; min-width: 0; resize: vertical; font: inherit; font-size: 0.9rem; color: var(--text-main); background: rgba(0, 0, 0, 0.25); border: 1px solid rgba(250, 204, 21, 0.5); border-radius: 6px; padding: 0.3rem 0.5rem; }
.chat-message-row.note-flash .chat-bubble { animation: note-flash 2.2s ease-out; }
@keyframes note-flash { 0%, 30% { box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.85); } 100% { box-shadow: 0 0 0 0 rgba(250, 204, 21, 0); } }
html.no-motion .chat-message-row.note-flash .chat-bubble { animation: none; box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.85); }
#notesBtn.has-notes, #editorNotesBtn.has-notes { border-color: rgba(250, 204, 21, 0.55); color: #fde68a; }
.notes-card { max-width: 34rem; width: calc(100vw - 2rem); }
.notes-list { display: flex; flex-direction: column; gap: 0.5rem; max-height: 55vh; overflow: auto; }
.notes-item { display: flex; flex-direction: column; gap: 0.1rem; text-align: left; font: inherit; color: var(--text-main); background: rgba(250, 204, 21, 0.08); border: 1px solid rgba(250, 204, 21, 0.35); border-radius: 10px; padding: 0.5rem 0.7rem; cursor: pointer; transition: background-color 0.15s ease, transform 0.22s var(--spring); }
.notes-item:hover { background: rgba(250, 204, 21, 0.16); transform: translateY(-1px); }
.notes-meta { font-size: 0.72rem; color: var(--text-dim); }
.notes-text { font-size: 0.95rem; }
.notes-quote { font-size: 0.78rem; color: var(--text-muted); font-style: italic; }

/* "A new speaker starts here": a small button after each sentence of the newest bubble. It holds no text, so the words
   (and copying them) are unchanged; the arrow is drawn by CSS. */
.bubble-text .sb-break {
  visibility: hidden;   /* the space stays; the button shows on the newest and selected bubbles, under the pointer, or everywhere by setting */
  display: inline-block;
  position: relative;
  box-sizing: border-box;
  font: inherit;               /* a button does not inherit its size: the em sizes below are the text's */
  width: 0.75em;
  height: 0.75em;
  margin: 0 -0.2em 0 0.1em;    /* the two spaces after a sentence already give the room: the gap is about the button plus a few pixels */
  padding: 0;
  vertical-align: -0.12em;
  border: 1px solid currentColor;
  border-radius: 50%;
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  opacity: 0.6;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  transition: opacity 0.12s ease, transform 0.12s ease, background-color 0.12s ease;
}
.bubble-text .sb-break::before {
  content: '\21B5';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6em;
  line-height: 1;
  font-style: normal;
  font-weight: 700;
}
.bubble-text .sb-break:hover,
.bubble-text .sb-break:focus-visible {
  opacity: 1;
  background: rgba(255, 255, 255, 0.16);
  transform: scale(1.18);
}
.bubble-text .sb-break.sb-end { border-style: dashed; }
.speaker-menu-cut { text-transform: none; font-style: italic; opacity: 0.85; }
.no-motion .bubble-text .sb-break { transition: none; }

/* The grey live line when the engine has not said who is speaking: the label is a button */
.bubble-speaker.who-btn {
  cursor: pointer;
  color: #93c5fd;
  text-decoration: underline dotted;
  text-underline-offset: 3px;
}
.bubble-speaker.who-btn:hover { color: #bfdbfe; }

/* The mark placed inside the live line: who the words after it belong to (the name is drawn by CSS, so the text is unchanged) */
.interim-text .sb-chip {
  display: inline-block;
  margin: 0 0.3em;
  padding: 0 0.5em;
  border: 1px solid currentColor;
  border-radius: 999px;
  background: rgba(147, 197, 253, 0.16);
  color: #93c5fd;
  font-size: 0.55em;
  font-style: normal;
  font-weight: 600;
  line-height: 1.6;
  vertical-align: 0.25em;
  cursor: pointer;
}
.interim-text .sb-chip::after { content: '\25B8  ' attr(data-name) ' starts here'; }
.interim-text .sb-break { /* same look as in a bubble */
  display: inline-block;
  position: relative;
  box-sizing: border-box;
  font: inherit;               /* a button does not inherit its size: the em sizes below are the text's */
  width: 0.75em;
  height: 0.75em;
  margin: 0 -0.2em 0 0.1em;    /* the two spaces after a sentence already give the room: the gap is about the button plus a few pixels */
  padding: 0;
  vertical-align: -0.12em;
  border: 1px solid currentColor;
  border-radius: 50%;
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  opacity: 0.6;
  cursor: pointer;
}
.interim-text .sb-break::before { content: '\21B5'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 0.6em; line-height: 1; font-weight: 700; }
.interim-text .sb-break:hover { opacity: 1; background: rgba(255, 255, 255, 0.16); }

.chat-message-row.show-breaks .bubble-text .sb-break,
.chat-message-row.is-playing .bubble-text .sb-break,
.chat-bubble:hover .bubble-text .sb-break,
.chat-bubble:focus-within .bubble-text .sb-break,
.interim-bubble:hover .bubble-text .sb-break,
.interim-bubble:focus-within .bubble-text .sb-break { visibility: visible; }   /* otherwise hidden, but their space stays, so the words never move */

/* A transcript with sound saved beside it shows a small speaker after its title */
.library-head { display: flex; align-items: center; gap: 0.45rem; min-width: 0; }
.library-audio { display: inline-flex; flex: 0 0 auto; color: var(--text-muted); }
.library-item:hover .library-audio { color: var(--text-main); }

/* The recording toolbar in three groups: the session (New Session, Source, Type), recording (Record/Pause, Stop, Announce, Share), the transcript tools */
.controls-toolbar { justify-content: flex-start; row-gap: 0.4rem; column-gap: 1.1rem; }
.tb-group { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.tb-group[hidden] { display: none; }
.controls-toolbar .secondary-controls { margin-left: auto; }

/* Notes and actions: the label at the left is a choice, and an action also says who it is for and when it is due */
.bubble-note-main { display: flex; align-items: flex-start; gap: 0.5rem; flex: 1 1 auto; min-width: 0; }
.bubble-note { flex-wrap: wrap; }
.bubble-note-kind { flex: 0 0 auto; font: inherit; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: #fbbf24; background: rgba(0, 0, 0, 0.25); border: 1px solid rgba(250, 204, 21, 0.4); border-radius: 6px; padding: 0.15rem 0.3rem; cursor: pointer; }
.bubble-note-action { flex: 1 0 100%; display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem; padding-left: 0.1rem; }
.bubble-note-action[hidden] { display: none; }
.bubble-note-owner, .bubble-note-due { font: inherit; font-size: 0.85rem; color: var(--text-main); background: rgba(0, 0, 0, 0.25); border: 1px solid rgba(250, 204, 21, 0.4); border-radius: 6px; padding: 0.25rem 0.4rem; }
.bubble-note-due { width: 13rem; max-width: 100%; }
.bubble-note-preview { font-size: 0.8rem; color: #fde68a; }
.bubble-note-preview.bad { color: #fca5a5; }
.bubble-note-meta { flex: 0 0 auto; align-self: center; font-size: 0.75rem; color: #fde68a; background: rgba(250, 204, 21, 0.14); border-radius: 999px; padding: 0.05rem 0.55rem; }
.bubble-note.is-action { background: rgba(96, 165, 250, 0.1); border-color: rgba(96, 165, 250, 0.45); }
.bubble-note.is-action .bubble-note-label, .bubble-note.is-action .bubble-note-kind { color: #93c5fd; border-color: rgba(96, 165, 250, 0.5); }
.bubble-note.is-action .bubble-note-meta { color: #bfdbfe; background: rgba(96, 165, 250, 0.16); }
.bubble-note-btn.is-action { background: rgba(96, 165, 250, 0.22); border-color: rgba(96, 165, 250, 0.5); color: #bfdbfe; }
.notes-item.is-action { background: rgba(96, 165, 250, 0.08); border-color: rgba(96, 165, 250, 0.4); }

/* ---- Large captions for this computer's own screen ---- */
.captions-view { position: fixed; inset: 0; z-index: 400; display: flex; flex-direction: column; background: #05080f; color: #f4f7ff; --cv-size: 7vmin; }
.captions-view[hidden] { display: none; }
.captions-view.cv-light { background: #ffffff; color: #0b1220; }
.cv-bar { flex: 0 0 auto; display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; padding: 0.6rem 0.9rem; background: rgba(255, 255, 255, 0.08); border-bottom: 1px solid rgba(255, 255, 255, 0.14); transition: opacity 0.5s ease; }
.cv-light .cv-bar { background: rgba(0, 0, 0, 0.06); border-color: rgba(0, 0, 0, 0.14); }
.captions-view.cv-quiet .cv-bar { opacity: 0; pointer-events: none; }
.captions-view.cv-quiet { cursor: none; }
.cv-title { font-weight: 700; margin-right: auto; }
.cv-bar button { font: inherit; color: inherit; background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 8px; padding: 0.3rem 0.7rem; cursor: pointer; }
.cv-light .cv-bar button { background: rgba(0, 0, 0, 0.05); border-color: rgba(0, 0, 0, 0.25); }
.cv-bar button[aria-pressed="true"] { background: var(--accent-fill); border-color: #1881ff; color: #fff; }
.cv-bar input[type="range"] { width: 9rem; }
.cv-size-label { min-width: 3.2rem; text-align: right; font-variant-numeric: tabular-nums; opacity: 0.8; }
.cv-history { flex: 0 0 auto; max-height: 34%; overflow: hidden; display: none; flex-direction: column; justify-content: flex-end; gap: 0.5em; padding: 1.2vmin 3vmin 0; font-size: calc(var(--cv-size) * 0.42); line-height: 1.3; opacity: 0.6; }
.cv-history-on .cv-history { display: flex; }
.cv-past { display: block; }
.cv-past-who { color: var(--spk-primary, #7fb4ff); font-weight: 700; margin-right: 0.6em; }
.cv-stage { flex: 1 1 auto; min-height: 0; overflow: hidden; padding: 2.5vmin 3vmin; text-align: left; border-left: 1.2vmin solid var(--spk-primary, #1881ff); margin: 1.5vmin 0 1.5vmin 3vmin; padding-left: 2.5vmin; }
.cv-who { font-size: calc(var(--cv-size) * 0.4); font-weight: 700; color: var(--spk-primary, #7fb4ff); min-height: 1.2em; line-height: 1.2; margin-bottom: 0.3em; }
.cv-names-off .cv-who { display: none; }
.cv-text { font-size: var(--cv-size); line-height: 1.22; font-weight: 600; overflow-wrap: anywhere; }
.cv-text[data-empty] { opacity: 0.45; font-weight: 500; }
/* Words come in one at a time (caption-feed.js); the ones the service may still change are italic and a little dimmer, and
   settle to upright as they are confirmed. A "..." follows while more is coming. */
.cv-w { transition: opacity 0.5s ease; animation: cv-word-in 0.35s ease-out; }
.cv-w.cv-old { animation: none; }
.cv-w.cv-tent { font-style: italic; opacity: 0.72; }
.cv-smooth .cv-text { overflow: hidden; height: calc(var(--cv-size) * 1.22 * 2); }
.cv-smooth.cv-history-on .cv-text { height: calc(var(--cv-size) * 1.22 * 4); }
.cv-w.cv-brk::before { content: "\A"; white-space: pre; }
.cv-more { opacity: 0.55; animation: cv-more 1.3s ease-in-out infinite; }
@keyframes cv-word-in { from { opacity: 0; transform: translateY(0.12em); } }
@keyframes cv-more { 0%, 100% { opacity: 0.2; } 50% { opacity: 0.75; } }
html.no-motion .cv-w, html.no-motion .cv-more { animation: none; }
@media (prefers-reduced-motion: reduce) { .cv-w, .cv-more { animation: none; } }

/* ---- Pictures, files and links left on a bubble ---- */
.bubble-attach { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.5rem 0 0; }
.bubble-attach[hidden] { display: none; }
.attach { position: relative; display: inline-flex; align-items: center; }
.attach-thumb { padding: 0; border: 1px solid rgba(255, 255, 255, 0.18); border-radius: 8px; background: rgba(0, 0, 0, 0.25); cursor: zoom-in; overflow: hidden; line-height: 0; }
.attach-thumb img { display: block; height: 86px; max-width: 170px; width: auto; object-fit: cover; }
.attach-thumb:hover { border-color: var(--soniox-blue); }
.attach-chip { display: inline-block; max-width: 22rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0.25rem 1.5rem 0.25rem 0.7rem; border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.18); background: rgba(255, 255, 255, 0.07); font-size: 0.85rem; color: var(--text-main); text-decoration: none; }
a.attach-chip:hover { border-color: var(--soniox-blue); }
.attach-x { position: absolute; top: -6px; right: -6px; width: 1.2rem; height: 1.2rem; padding: 0; line-height: 1; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.3); background: #0b1220; color: #fff; font-size: 0.8rem; cursor: pointer; opacity: 0; transition: opacity 0.12s; }
.attach:hover .attach-x, .attach-x:focus-visible { opacity: 1; }
.attach-chip + .attach-x { top: 50%; right: 4px; transform: translateY(-50%); background: transparent; border: 0; }
.chat-message-row.attach-drop .chat-bubble { outline: 2px dashed var(--soniox-blue); outline-offset: 3px; }
.attach-card { max-width: min(92vw, 1000px); width: auto; }
.attach-card img { display: block; max-width: 100%; max-height: 72vh; margin: 0 auto; border-radius: 8px; }
.attach-caption { padding: 0.6rem 1rem 0; font-size: 0.85rem; color: var(--text-dim); }

/* ---- Speaker mode pill and the Manual strip ---- */
.mode-pill { display: inline-flex; flex: 0 0 auto; border: 1px solid var(--border, #444); border-radius: 999px; overflow: hidden; }
.mode-pill-btn { font: inherit; font-size: 0.72rem; padding: 0.15rem 0.6rem; background: transparent; color: var(--text-dim); border: 0; cursor: pointer; }
.mode-pill-btn + .mode-pill-btn { border-left: 1px solid var(--border, #444); }
.mode-pill-btn.is-on { background: var(--accent-fill); color: #fff; }
.manual-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--border, #333); }
.manual-strip[hidden] { display: none; }
.manual-btn { display: inline-flex; align-items: center; gap: 0.5rem; font: inherit; font-size: 1.05rem; font-weight: 600; padding: 0.55rem 1.1rem; border-radius: 12px; border: 2px solid var(--spk-border); background: var(--spk-bg); color: var(--spk-primary); cursor: pointer; min-height: 2.8rem; }
.manual-btn kbd { font: inherit; font-size: 0.75rem; opacity: 0.7; border: 1px solid currentColor; border-radius: 4px; padding: 0 0.3rem; }
.manual-btn.is-held { background: var(--spk-primary); color: #fff; box-shadow: 0 0 0 3px var(--spk-border); }
.manual-btn.is-held kbd { opacity: 0.9; }
.manual-back { font: inherit; padding: 0.5rem 0.9rem; border-radius: 10px; border: 1px solid var(--border, #555); background: transparent; color: inherit; cursor: pointer; }
.manual-back:disabled { opacity: 0.4; cursor: default; }
.manual-hint { font-size: 0.85rem; color: var(--text-dim); }
.setup-ics { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin: 0.4rem 0; }
.setup-ics .setup-hint { margin-top: 0; flex: 1 1 14rem; }
.settings-subtitle { margin: 1.4rem 0 0.2rem; font-size: 0.95rem; }
.has-audio .bubble-time { cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
.player-bar { position: fixed; left: 50%; bottom: 1rem; transform: translateX(-50%); z-index: 60; display: flex; align-items: center; gap: 0.6rem; padding: 0.4rem 0.8rem; border-radius: 999px; background: var(--surface-2, #1e2530); border: 1px solid var(--border, #444); box-shadow: 0 6px 24px rgba(0,0,0,0.35); font-size: 0.85rem; }
.player-bar[hidden] { display: none; }
.player-bar button, .player-bar select { font: inherit; background: transparent; color: inherit; border: 1px solid var(--border, #555); border-radius: 8px; padding: 0.15rem 0.55rem; cursor: pointer; }
.player-bar .player-time { font-variant-numeric: tabular-nums; min-width: 4.5rem; text-align: center; }
.player-bar label { display: inline-flex; align-items: center; gap: 0.3rem; cursor: pointer; }
.manual-lengths { display: inline-flex; border: 1px solid var(--border, #555); border-radius: 999px; overflow: hidden; margin-left: auto; }
.manual-length { font: inherit; font-size: 0.78rem; padding: 0.3rem 0.7rem; background: transparent; color: var(--text-dim); border: 0; cursor: pointer; }
.manual-length + .manual-length { border-left: 1px solid var(--border, #555); }
.manual-length.is-on { background: var(--accent-fill); color: #fff; }
.setup-title { margin: 0 0 0.8rem; }
.setup-title label { display: block; font-size: 0.85rem; }
.setup-title .form-input { display: block; width: 100%; margin-top: 0.25rem; }
.setup-title-choices { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 0.5rem; margin-top: 0.3rem; }
.setup-title-choice { font-size: 0.8rem; padding: 0.1rem 0.5rem; border: 1px dashed var(--border, #555); border-radius: 999px; }
.setup-result, .services-result { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.5rem; margin: 0.1rem 0 0.6rem; padding: 0.4rem 0.7rem; border-radius: 8px; background: rgba(148, 163, 184, 0.12); border-left: 3px solid var(--text-dim, #94a3b8); font-size: 0.9rem; }
.setup-result[hidden], .services-result[hidden] { display: none; }
.setup-result[data-state="ok"], .services-result[data-state="ok"] { border-left-color: #22c55e; }
.setup-result[data-state="warn"], .services-result[data-state="warn"] { border-left-color: #f59e0b; }
.setup-result[data-state="error"], .services-result[data-state="error"] { border-left-color: #ef4444; }
.setup-result-main { font-weight: 600; }
.setup-result-detail { flex-basis: 100%; color: var(--text-dim); font-size: 0.78rem; }
.setup-mark { font-weight: 700; }
.setup-result[data-state="ok"] .setup-mark { color: #22c55e; }
.setup-result[data-state="warn"] .setup-mark { color: #f59e0b; }
.setup-result[data-state="error"] .setup-mark { color: #ef4444; }
.setup-spinner { width: 0.95rem; height: 0.95rem; border: 2px solid rgba(148, 163, 184, 0.35); border-top-color: var(--accent, #3b82f6); border-radius: 50%; animation: setup-spin 0.8s linear infinite; }
@keyframes setup-spin { to { transform: rotate(360deg); } }
.no-motion .setup-spinner { animation-duration: 3s; }
@media (prefers-reduced-motion: reduce) { .setup-spinner { animation-duration: 3s; } }

/* ---- Ask your meetings ---- */
.library-ask { display: flex; gap: 0.5rem; margin: 0.4rem 0; }
.library-ask-input { flex: 1; font: inherit; padding: 0.4rem 0.7rem; border-radius: 8px; border: 1px solid var(--border, #444); background: transparent; color: inherit; }
.library-answer { margin: 0.4rem 0 0.8rem; padding: 0.6rem 0.9rem; border-radius: 10px; background: rgba(148, 163, 184, 0.1); border-left: 3px solid var(--text-dim, #94a3b8); }
.library-answer[hidden] { display: none; }
.library-answer[data-state="ok"] { border-left-color: #22c55e; } .library-answer[data-state="error"] { border-left-color: #ef4444; } .library-answer[data-state="busy"] { border-left-color: var(--accent, #3b82f6); }
.library-answer p { margin: 0.3rem 0; }
.ask-note { color: var(--text-dim); font-size: 0.82rem; } .ask-heading { font-weight: 600; margin-top: 0.7rem !important; }
.ask-cite { font: inherit; font-size: 0.72rem; padding: 0 0.35rem; margin: 0 0.1rem; border-radius: 6px; border: 1px solid var(--accent, #3b82f6); background: transparent; color: var(--accent, #3b82f6); cursor: pointer; vertical-align: super; line-height: 1.2; }
.ask-sources { list-style: none; padding: 0; margin: 0.2rem 0; }
.ask-sources li { padding: 0.25rem 0.4rem; border-radius: 6px; } .ask-sources li.is-hit { background: rgba(59, 130, 246, 0.18); }
.ask-quote { color: var(--text-dim); font-size: 0.8rem; }
.setup-brief-list { margin: 0 0 0.6rem; } .brief-card { padding: 0.4rem 0.7rem; margin: 0.3rem 0; border-radius: 8px; background: rgba(148, 163, 184, 0.1); font-size: 0.88rem; }
.brief-card p { margin: 0.25rem 0; color: var(--text-dim); } .brief-card ul { margin: 0.1rem 0 0.2rem 1.1rem; padding: 0; }

/* ---- Check speakers: the review card ---- */
.review-card { position: fixed; right: 1rem; bottom: 1rem; z-index: 70; width: min(380px, calc(100vw - 2rem)); padding: 0.8rem 1rem; border-radius: 12px; background: var(--surface-2, #1e2530); border: 1px solid var(--border, #444); box-shadow: 0 8px 28px rgba(0,0,0,0.4); font-size: 0.9rem; }
.review-card[hidden] { display: none; }
.review-title { font-weight: 600; } .review-msg { margin: 0.35rem 0; } .review-detail { margin: 0.2rem 0 0.5rem; color: var(--text-dim); font-size: 0.8rem; }
.review-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; } .review-nav { display: flex; gap: 0.8rem; margin-top: 0.5rem; }

/* ---- The two ways to start, on the welcome ---- */
.splash-ways { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; margin: 0.9rem 0; }
.splash-ways section { border: 1px solid var(--border-subtle, rgba(255,255,255,0.12)); border-radius: 12px; padding: 0.7rem 0.9rem; background: rgba(255, 255, 255, 0.04); }
.splash-ways h3 { margin: 0 0 0.3rem; font-size: 0.95rem; } .splash-ways p { margin: 0.2rem 0; font-size: 0.85rem; }
@media (max-width: 640px) { .splash-ways { grid-template-columns: 1fr; } }

/* ---- The welcome as three steps ---- */
.splash-head { padding: 1.5rem 2rem 0.2rem; }
.splash-head .splash-lead { margin-bottom: 0.8rem; }
.splash-steps { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4rem; padding: 0; margin: 0 0 0.3rem; }
.splash-step-btn { font: inherit; font-size: 0.8rem; padding: 0.3rem 0.75rem; border-radius: 999px; border: 1px solid var(--border-subtle, rgba(255,255,255,0.14)); background: transparent; color: var(--text-muted); cursor: pointer; }
.splash-step-btn.is-on { background: var(--accent-fill); border-color: transparent; color: #fff; }
.splash-step-btn small { opacity: 0.8; }
.splash-step[hidden] { display: none; }
.splash-h { font-size: 1.1rem; margin: 0.2rem 0 0.5rem; color: #fff; } .splash-h small { font-weight: 400; color: var(--text-muted); }
.splash-p { font-size: 0.9rem; line-height: 1.55; color: var(--text-muted); margin: 0.3rem 0 0.7rem; } .splash-p.small { font-size: 0.78rem; }
.splash-sub { margin: 1rem 0 0.4rem; font-size: 0.95rem; }
.splash-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; margin: 0.6rem 0; }
.splash-choices > section:only-child { grid-column: 1 / -1; }
.splash-card-choice { border: 1px solid var(--border-subtle, rgba(255,255,255,0.14)); border-radius: 12px; padding: 0.8rem 1rem; background: rgba(255,255,255,0.04); display: flex; flex-direction: column; gap: 0.3rem; }
.splash-card-choice h4 { margin: 0 0 0.2rem; font-size: 0.98rem; } .splash-card-choice p { margin: 0.15rem 0; font-size: 0.85rem; line-height: 1.5; color: var(--text-muted); }
.splash-card-choice .splash-pick { margin-top: auto; align-self: flex-start; }
.splash-card-choice.is-picked { border-color: #22c55e; box-shadow: 0 0 0 2px rgba(34,197,94,0.4); background: rgba(34,197,94,0.07); }
.splash-card-choice.is-picked .btn.splash-pick { background: #16a34a !important; border-color: #16a34a; color: #fff; }
.splash-card-choice.is-picked .splash-pick::before { content: "\2713\00a0"; font-weight: 800; }
.splash-local { border-left: 4px solid #22c55e; } .splash-cloud { border-left: 4px solid #f59e0b; }
.splash-pill { display: inline-block; font-size: 0.68rem; letter-spacing: 0.06em; padding: 0.1rem 0.5rem; border-radius: 999px; font-weight: 700; vertical-align: middle; }
.splash-pill.local { background: rgba(34,197,94,0.18); color: #86efac; } .splash-pill.cloud { background: rgba(245,158,11,0.18); color: #fcd34d; }
.splash-uses { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 0.6rem; }
.splash-uses .splash-card-choice h4 i { color: var(--accent, #7aa7ff); margin-right: 0.2rem; }
.splash-use-tag { align-self: flex-start; margin-top: auto; font-size: 0.74rem; padding: 0.05rem 0.55rem; border-radius: 999px; border: 1px solid var(--border-subtle, rgba(255,255,255,0.18)); color: var(--text-muted); }
.splash-use-tag.needs-app { border-color: rgba(240, 195, 90, 0.6); color: #f0c35a; }
.splash-tag { font-weight: 400; font-size: 0.78rem; color: var(--text-muted); margin-left: 0.3rem; }
.splash-table-wrap { overflow-x: auto; }
.splash-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.splash-table th, .splash-table td { text-align: left; padding: 0.35rem 0.5rem; border-bottom: 1px solid var(--border-subtle, rgba(255,255,255,0.1)); vertical-align: top; color: var(--text-muted); }
.splash-table th { color: #fff; font-weight: 600; }
.splash-table td strong { color: #fff; }
.splash-more-steps { margin: 0.6rem 0; } .splash-more-steps summary { cursor: pointer; color: var(--text-muted); font-size: 0.85rem; }
.splash-footer-spacer { flex: 1; }
.splash-footer { gap: 0.5rem; }
@media (max-width: 640px) { .splash-choices { grid-template-columns: 1fr; } .splash-head { padding: 1.1rem 1.1rem 0.2rem; } }

/* ---- Settings, Services: the choices (one label each, so nothing spreads across the row) ---- */
.form-group label.check-row { justify-content: flex-start; }
.services-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.8rem; margin: 0.6rem 0; }
.services-actions .btn { width: auto; }
#servicesPortRow, #servicesServerRow { margin: 0.5rem 0 0 1.6rem; }

.splash-footer [hidden] { display: none; }


/* Settings, Transcriber: the table of transcribers (js/provider-table.js) */
.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; }
.provider-table-box { display: flex; flex-direction: column; gap: 0.6rem; }
.provider-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.provider-chip { border: 1px solid var(--border-subtle); background: transparent; color: var(--text-muted); border-radius: 999px; padding: 0.25rem 0.75rem; font: inherit; font-size: 0.78rem; font-weight: 600; cursor: pointer; }
.provider-chip:hover { color: var(--text-main); border-color: var(--border-active); }
.provider-chip[aria-pressed="true"] { color: #fff; background: rgba(24, 129, 255, 0.25); border-color: var(--soniox-blue); }
.provider-chip[aria-pressed="true"]::before { content: "\2713  "; }
.provider-reset { border-style: dashed; }
.provider-reset:disabled { opacity: 0.4; cursor: default; }
.provider-count { margin-left: auto; font-size: 0.75rem; color: var(--text-dim); }
.provider-table-scroll { overflow-x: auto; border: 1px solid var(--border-subtle); border-radius: 12px; }
.provider-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; line-height: 1.35; }
.provider-table th { position: sticky; top: 0; background: var(--bg-card); text-align: left; padding: 0; border-bottom: 1px solid var(--border-active); white-space: nowrap; }
.provider-sort { width: 100%; text-align: left; border: 0; background: transparent; color: var(--text-muted); font: inherit; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; padding: 0.55rem 0.45rem; cursor: pointer; }
.provider-sort:hover { color: var(--text-main); }
.provider-table th[aria-sort="ascending"] .provider-sort::after { content: " \25B2"; font-size: 0.6rem; }
.provider-table th[aria-sort="descending"] .provider-sort::after { content: " \25BC"; font-size: 0.6rem; }
.provider-table td { padding: 0.5rem 0.45rem; border-bottom: 1px solid var(--border-subtle); color: var(--text-muted); vertical-align: top; }
.provider-table tbody tr { cursor: pointer; transition: background 0.12s; }
.provider-table tbody tr:last-child td { border-bottom: 0; }
.provider-table tbody tr:hover { background: rgba(255, 255, 255, 0.07); }
.provider-table tbody tr.is-selected:hover { background: rgba(24, 129, 255, 0.22); }
.provider-table input[type="radio"] { accent-color: var(--soniox-blue); cursor: pointer; }
.provider-table tbody tr.is-selected { background: rgba(24, 129, 255, 0.16); box-shadow: inset 3px 0 0 var(--soniox-blue); }
.provider-table tbody tr.is-selected td { color: var(--text-main); }
.provider-table td.provider-pick { width: 1.8rem; padding-right: 0; }
.provider-table td[data-key="name"] { min-width: 10rem; }
.provider-name { font-weight: 700; color: var(--text-main); cursor: pointer; }
.provider-site { font-size: 0.72rem; margin-left: 0.25rem; color: var(--accent-text); }
.provider-table td[data-key="needs"] { min-width: 8rem; }
.provider-table td[data-tone="ok"] { color: #7bd88f; }
.provider-table td[data-tone="warn"][data-key="ready"] { color: #fbbf24; }
.provider-table td[data-tone="warn"][data-key="tracking"] { color: #fbbf24; }
.provider-table td[data-tone="wait"] { color: var(--text-dim); }
.provider-table td[data-tone="cloud"] { color: #fbbf24; }
.provider-table td[data-tone="browser"], .provider-table td[data-tone="mac"], .provider-table td[data-tone="phone"] { color: #7bd88f; }

/* On a phone: each transcriber is a card */
@media (max-width: 760px) {
  .provider-count { margin-left: 0; width: 100%; }
  .provider-table-scroll { border: 0; overflow: visible; }
  .provider-table thead { display: none; }
  .provider-table, .provider-table tbody { display: block; }
  .provider-table tbody tr { display: grid; grid-template-columns: 1.8rem 1fr; column-gap: 0.4rem; padding: 0.6rem 0.7rem; margin-bottom: 0.5rem; border: 1px solid var(--border-subtle); border-radius: 12px; }
  .provider-table td { display: flex; gap: 0.5rem; grid-column: 2; padding: 0.12rem 0; border: 0; }
  .provider-table td.provider-pick { grid-column: 1; grid-row: 1; padding: 0.1rem 0 0; }
  .provider-table td[data-empty] { display: none; }
  .provider-table td[data-key="name"] { grid-row: 1; min-width: 0; font-size: 0.95rem; }
  .provider-table td:not(.provider-pick):not([data-key="name"])::before { content: attr(data-label); flex: 0 0 6.5rem; color: var(--text-dim); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.03em; }
}
.form-group .form-label { font-size: 0.78rem; font-family: var(--font-mono); color: var(--text-muted); font-weight: 600; }
.provider-table label.provider-name { display: inline; font-family: inherit; font-size: inherit; color: var(--text-main); }
.provider-chosen { margin: 0; font-size: 0.95rem; color: var(--text-main); }
.provider-table td[data-key="where"], .provider-table td[data-key="cost"] { white-space: nowrap; }
.provider-table td[data-tone="warn"][data-key="phones"] { color: #fbbf24; }
.provider-table td[data-key="ready"] { min-width: 7rem; }
.provider-table td[data-key="works"] { min-width: 5rem; }
.provider-table td[data-key="tracking"] { min-width: 6.5rem; }
@media (max-width: 760px) { .provider-table td[data-key] { white-space: normal; } }
.provider-table td[data-key="limit"] { min-width: 6rem; }
.speaker-menu-hint { font-size: 0.7rem; opacity: 0.75; border-top: 1px solid var(--border-subtle); margin-top: 0.25rem; padding-top: 0.35rem; }
.glossary-more { color: var(--text-muted); }
.glossary-pop-foot .glossary-more + .btn-text { margin-left: auto; }
.glossary-pop-foot { flex-wrap: wrap; }

/* A dialog's folded technical details (Dialog.choice({ details })) */
.dialog-details { margin-top: 0.6rem; font-size: 0.78rem; color: var(--text-dim); }
.dialog-details summary { cursor: pointer; }
.dialog-details code { display: block; margin-top: 0.35rem; padding: 0.45rem 0.6rem; border-radius: 8px; background: rgba(255, 255, 255, 0.05); white-space: pre-wrap; word-break: break-word; font-family: var(--font-mono); }
/* Record while a recording is starting: the label says the step ("Connecting to Soniox..."), the dot pulses */
#toggleMicBtn.is-starting { opacity: 1; cursor: progress; }
#toggleMicBtn.is-starting .icon { animation: start-pulse 1s ease-in-out infinite; }
@keyframes start-pulse { 50% { opacity: 0.35; transform: scale(0.8); } }
@media (prefers-reduced-motion: reduce) { #toggleMicBtn.is-starting .icon { animation: none; } }

/* No live recording with this transcriber and nothing in the transcript: only the notices and the warning */
#viewRecord.live-off-empty .transcript-host,
#viewRecord.live-off-empty .controls-toolbar { display: none; }
#viewRecord.live-off .controls-toolbar .start-field,
#viewRecord.live-off .controls-toolbar .start-group { display: none; }

/* Clean-up (js/cleanup.js): masked swear words and hidden filler words. The real words stay in the bubble and show
   while it is being edited */
.cleanup-gone, .cleanup-real { display: none; }
.cleanup-mask::before { content: attr(data-shown); }
.cleanup-cap { text-transform: uppercase; }
[contenteditable]:focus .cleanup-gone, [contenteditable]:focus .cleanup-real { display: inline; }
[contenteditable]:focus .cleanup-mask::before { content: none; }
[contenteditable]:focus .cleanup-cap { text-transform: none; }
.chat-message-row.cleanup-empty { display: none; }
.cleanup-words { width: 100%; max-width: 24rem; resize: vertical; font-family: var(--font-mono, ui-monospace, monospace); font-size: 0.85rem; }
#snapshotBtn.is-snapping { opacity: 0.6; cursor: progress; }
.snapshot-auto { width: auto; padding: 0.3rem 1.8rem 0.3rem 0.55rem; font-size: 0.8rem; }
.snapshot-auto[hidden] { display: none; }
.start-field[hidden] { display: none; }   /* the App menu, shown only for "An app on this Mac" */

/* Assign panel, while recording: "Talking now" holds the person tapped */
.assign-talking { margin: 0.6rem 0 0.2rem; padding: 0.55rem 0.6rem 0.35rem; border: 1px solid var(--border-subtle); border-radius: 10px; background: rgba(255, 255, 255, 0.02); }
.assign-talking .assign-section { margin-top: 0; }
.assign-talking-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0.35rem 0 0.2rem; }
.assign-talk { padding: 0.3rem 0.7rem; border-radius: 999px; border: 1px solid var(--spk-border, var(--border-subtle)); background: transparent; color: var(--spk-primary, var(--text-main)); font: inherit; font-size: 0.82rem; font-weight: 600; cursor: pointer; }
.assign-talk:hover { background: var(--spk-bg, rgba(255, 255, 255, 0.06)); }
.assign-talk.held { background: var(--spk-primary, #1881ff); border-color: var(--spk-primary, #1881ff); color: #0b0f17; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.15); }
.assign-talk { display: inline-flex; align-items: center; gap: 0.3rem; }
.assign-pin[aria-pressed="true"] { color: var(--spk-primary, #1881ff); }

/* Phones: a compact sheet. While a bubble is being given to someone it shows just what is needed for that (what is
   selected, the scope and the names, as chips); "Talking now" and each person's pin and menu are there when the sheet
   is opened with the People button */
@media (max-width: 900px) {
  .assign-panel { gap: 0.35rem; padding: 0.5rem 0.7rem calc(0.6rem + env(safe-area-inset-bottom, 0px)); }
  .assign-panel .assign-head h3 { font-size: 0.95rem; margin: 0; }
  .assign-panel .assign-section { margin: 0.2rem 0 0; font-size: 0.66rem; }
  .assign-panel .assign-selected { font-size: 0.85rem; }
  .assign-panel .assign-list { display: flex; flex-direction: row; flex-wrap: wrap; gap: 6px; }
  .assign-panel .assign-item { flex: 0 1 auto; }
  .assign-panel .assign-target { width: auto; min-height: 36px; padding: 0.3rem 0.7rem; border-radius: 999px; font-size: 0.85rem; }
  .assign-panel .assign-item .assign-more { min-width: 36px; min-height: 36px; border-radius: 999px; }
  .assign-panel .assign-scope button { min-height: 30px; font-size: 0.76rem; padding: 0 0.4rem; }
  .assign-panel .assign-talking { margin: 0.2rem 0 0; padding: 0.4rem 0.5rem 0.3rem; }
  .assign-panel .assign-talk { padding: 0.35rem 0.75rem; min-height: 34px; }
  .assign-panel.picking .assign-talking,
  .assign-panel.picking .assign-item .assign-more,
  .assign-panel.picking .assign-add,
  .assign-panel.picking .assign-paint,
  .assign-panel.picking .assign-suggest { display: none; }
  .assign-panel.talking > .assign-section,
  .assign-panel.talking > .assign-list,
  .assign-panel.talking > .assign-paint,
  .assign-panel.talking > .assign-add { display: none; }
}

/* A picture being taken: a placeholder the size of a thumbnail, with a spinner, until the picture replaces it */
.attach-pending { justify-content: center; width: 152px; height: 86px; border: 1px dashed rgba(255, 255, 255, 0.3); border-radius: 8px; background: linear-gradient(110deg, rgba(255, 255, 255, 0.04) 30%, rgba(255, 255, 255, 0.12) 50%, rgba(255, 255, 255, 0.04) 70%) 0 0 / 200% 100%; animation: attach-shimmer 1.2s linear infinite; }
.attach-spinner { width: 22px; height: 22px; border: 3px solid rgba(255, 255, 255, 0.25); border-top-color: var(--soniox-blue, #1881ff); border-radius: 50%; animation: attach-spin 0.8s linear infinite; }
@keyframes attach-spin { to { transform: rotate(360deg); } }
@keyframes attach-shimmer { to { background-position: -200% 0; } }
html.no-motion .attach-pending, html.no-motion .attach-spinner { animation: none; }
@media (prefers-reduced-motion: reduce) { .attach-pending, .attach-spinner { animation: none; } }
.snapshot-auto.stalled { border-color: #f59e0b; color: #fbbf24; }

/* ---- The Live tab before a recording: the steps of starting, as tiles (js/start-wizard.js) ---- */
#viewRecord.wizard-on .controls-toolbar,
#viewRecord.wizard-on .transcript-host,
#viewRecord.wizard-on .notice-banner { display: none; }
.start-wizard { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 1.1rem 1.25rem 2rem; }
.start-wizard[hidden] { display: none; }
.sw-inner { max-width: 44rem; margin: 0 auto; display: flex; flex-direction: column; gap: 1.1rem; }
.sw-title { font-size: 1.25rem; font-weight: 700; }
.sw-step h3 { display: flex; align-items: center; gap: 0.55rem; font-size: 0.95rem; font-weight: 650; margin-bottom: 0.55rem; }
.sw-step h3 span { display: inline-flex; align-items: center; justify-content: center; width: 1.5rem; height: 1.5rem; border-radius: 50%; background: var(--accent-fill); color: #fff; font-size: 0.78rem; }
.sw-step h3 em { font-style: normal; font-weight: 500; font-size: 0.78rem; color: var(--text-dim); }
.sw-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr)); gap: 0.55rem; }
.sw-tile, .sw-has-icon .sw-icon { corner-shape: squircle; }
.sw-tile { display: flex; flex-direction: column; gap: 0.15rem; text-align: left; padding: 0.7rem 0.85rem; border-radius: var(--radius-md); border: 1.5px solid var(--border-subtle); background: var(--bg-card); color: var(--text-main); font: inherit; cursor: pointer; min-height: 3.2rem; }
.sw-tile:hover { background: var(--bg-card-hover); }
.sw-tile strong { font-size: 0.95rem; font-weight: 650; }
.sw-tile small { font-size: 0.76rem; color: var(--text-muted); line-height: 1.3; }
.sw-has-icon { display: grid; grid-template-columns: 2.1rem 1fr; column-gap: 0.65rem; align-items: start; }
.sw-has-icon .sw-icon { grid-row: 1 / span 2; width: 2.1rem; height: 2.1rem; padding: 0.45rem; border-radius: 0.6rem; background: rgba(24, 129, 255, 0.12); color: var(--accent-text); box-sizing: border-box; }
.sw-has-icon small { grid-column: 2; }
.sw-tile[aria-pressed="true"] .sw-icon { background: var(--accent-fill); color: #fff; }
.sw-seg .sw-has-icon { display: inline-flex; flex-direction: column; align-items: center; gap: 0.2rem; }
.sw-seg .sw-has-icon .sw-icon { width: 1.3rem; height: 1.3rem; padding: 0; background: none; color: inherit; }
.sw-tile:disabled .sw-icon { color: var(--text-muted); background: transparent; }
.sw-tile:disabled { opacity: 0.5; cursor: not-allowed; background: transparent; }
.sw-tile[aria-pressed="true"] { border-color: var(--soniox-blue); background: rgba(24, 129, 255, 0.14); box-shadow: 0 0 0 1px var(--soniox-blue) inset; }
.sw-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.6rem 0.85rem; border-radius: var(--radius-md); border: 1.5px dashed var(--border-active); }
.sw-attendees { font-size: 0.85rem; color: var(--text-muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.sw-pictures { display: flex; align-items: center; flex-wrap: wrap; gap: 0.55rem; margin-top: 0.55rem; }
.sw-pictures[hidden] { display: none; }
.sw-label { font-size: 0.85rem; color: var(--text-muted); }
.sw-seg { display: inline-flex; gap: 0.4rem; flex-wrap: wrap; }
.sw-seg .sw-tile { min-height: 0; padding: 0.45rem 0.8rem; border-radius: 0.8rem; }
.sw-seg .sw-has-icon { flex-direction: column; gap: 0.15rem; }
.sw-seg .sw-tile strong { font-size: 0.82rem; font-weight: 600; }
.sw-privacy { margin-top: 0.7rem; font-size: 0.78rem; line-height: 1.45; color: var(--text-dim); }
.sw-start { align-self: stretch; justify-content: center; gap: 0.6rem; padding: 0.9rem 1rem; font-size: 1rem; }
.sw-dot { width: 0.8rem; height: 0.8rem; border-radius: 50%; background: #ef4444; box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.3); }
@media (max-width: 640px) {
  .start-wizard { padding: 0.9rem 0.85rem 1.5rem; }
  .sw-tiles { grid-template-columns: 1fr 1fr; }
}

/* ---- A phone while recording: everything that is not the transcript takes as little room as it can ---- */
@media (max-width: 640px) {
  body.is-recording .top-bar { min-height: 0; height: 2.6rem; padding: 0 0.6rem; }
  body.is-recording .hud-item, body.is-recording .spectral-canvas { display: none; }
  body.is-recording .diarization-hud { padding: 0; gap: 0.4rem; }
  body.is-recording .tab-bar { min-height: 2.1rem; padding: 0 0.5rem; }
  body.is-recording .tab-bar .tab { padding: 0.3rem 0.7rem; font-size: 0.82rem; }
  body.is-recording .tab-bar .btn-icon { display: none; }
  /* one row that scrolls sideways: Pause, Stop, then the transcript's tools */
  body.is-recording .controls-toolbar { flex-wrap: nowrap; overflow-x: auto; gap: 0.4rem; padding: 0.3rem 0.6rem; scrollbar-width: none; }
  body.is-recording .controls-toolbar::-webkit-scrollbar { display: none; }
  body.is-recording .controls-toolbar .tb-group { flex-wrap: nowrap; flex: 0 0 auto; gap: 0.35rem; }
  body.is-recording .controls-toolbar .tb-session { display: none; }
  body.is-recording .controls-toolbar .secondary-controls { margin-left: 0; }
  body.is-recording .controls-toolbar .btn { padding: 0.35rem 0.7rem; font-size: 0.85rem; min-height: 0; white-space: nowrap; }
  body.is-recording #announceBtnText { display: none; }
  body.is-recording .notice-stack .recall-bar, body.is-recording .notice-banner, body.is-recording .live-status, body.is-recording .title-status { font-size: 0.74rem; padding-top: 0.2rem; padding-bottom: 0.2rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  body.is-recording .notice-stack .recall-row { flex-wrap: nowrap; gap: 0.4rem; }
  body.is-recording .notice-stack .recall-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1 1 auto; }
  body.is-recording .title-bar { padding-top: 0.2rem; padding-bottom: 0.2rem; }
  body.is-recording .recording-title { font-size: 1.05rem; }
}

/* bookmarks and the notes dialog's tabs */
.bubble-mark-btn { display: inline-flex; align-items: center; justify-content: center; width: 1.7rem; height: 1.5rem; padding: 0; border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 4px; background: rgba(255, 255, 255, 0.08); color: var(--text-muted); cursor: pointer; opacity: 0.55; transition: opacity 0.15s ease, background-color 0.15s ease, color 0.15s ease; }
.chat-message-row:hover .bubble-mark-btn, .bubble-mark-btn.has-mark, .bubble-mark-btn:focus-visible { opacity: 1; }
.bubble-mark-btn:hover { background: rgba(244, 114, 182, 0.2); color: #fbcfe8; }
.bubble-mark-btn.has-mark { background: rgba(244, 114, 182, 0.24); border-color: rgba(244, 114, 182, 0.55); color: #fbcfe8; }
.bubble-mark-btn.has-mark svg { fill: currentColor; }
.chat-message-row.is-marked .chat-bubble { box-shadow: -3px 0 0 0 rgba(244, 114, 182, 0.85); }
.notes-tabs { display: flex; gap: 0.3rem; padding: 0 1rem; border-bottom: 1px solid var(--border-subtle); }
.notes-tab { font: inherit; font-size: 0.85rem; color: var(--text-muted); background: none; border: 0; border-bottom: 2px solid transparent; padding: 0.5rem 0.7rem; cursor: pointer; }
.notes-tab[aria-selected="true"] { color: var(--text-main); border-bottom-color: var(--soniox-blue); font-weight: 600; }
.notes-item.is-mark { background: rgba(244, 114, 182, 0.08); border-color: rgba(244, 114, 182, 0.4); }
.notes-item.is-mark:hover { background: rgba(244, 114, 182, 0.16); }
.notes-hint { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 0.5rem; }
.notes-memo { width: 100%; min-height: 12rem; resize: vertical; font: inherit; line-height: 1.5; padding: 0.7rem 0.8rem; border-radius: 10px; border: 1px solid var(--border-subtle); background: var(--bg-card); color: var(--text-main); box-sizing: border-box; }

.cv-bar select { font: inherit; color: inherit; background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 8px; padding: 0.3rem 0.5rem; }
.cv-bar select option { color: #111; }
.cv-light .cv-bar select { background: rgba(0, 0, 0, 0.05); border-color: rgba(0, 0, 0, 0.25); }
.cv-lang-note { font-size: 0.8rem; opacity: 0.8; }

/* the transcript translated on screen: under the words, which stay as they were said */
.bubble-translation { margin: 0.45rem 0 0; padding-top: 0.45rem; border-top: 1px dashed var(--border-subtle, rgba(255, 255, 255, 0.18)); color: var(--text-muted); font-style: italic; font-size: 0.94em; white-space: pre-wrap; }
/* with translation on, the translation is the large text (first) and the words as said are smaller under it */
.chat-bubble.has-translation { display: flex; flex-direction: column; }
.chat-bubble.has-translation > * { order: 3; }
.chat-bubble.has-translation > .bubble-header { order: 0; }
.chat-bubble.has-translation > .bubble-translation { order: 1; margin: 0.15rem 0 0.5rem; padding-top: 0; border-top: 0; color: #fff; font-style: normal; font-weight: 500; font-size: var(--caption-font-size); line-height: var(--caption-line-height); }
.chat-bubble.has-translation > .bubble-body { order: 2; padding-top: 0.45rem; border-top: 1px dashed var(--border-subtle, rgba(255, 255, 255, 0.18)); }
.chat-bubble.has-translation > .bubble-body, .chat-bubble.has-translation > .bubble-body .bubble-text, .chat-bubble.has-translation > .bubble-body .bubble-tail { font-size: calc(var(--caption-font-size) * 0.72); font-weight: 400; color: var(--text-muted); }
#translateBtn[aria-pressed="true"] { border-color: var(--soniox-blue); background: rgba(24, 129, 255, 0.18); color: var(--text-main); }
.translate-field { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; padding: 0.3rem 0.8rem; font-size: 0.85rem; }
.translate-field select { min-width: 9rem; }
.translate-note { margin: 0.3rem 0.8rem 0.5rem; max-width: 17rem; font-size: 0.78rem; opacity: 0.8; }

/* The Live tab's steps: one at a time, the steps along the top, Start recording always at the foot */
.sw-nav { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0; padding: 0; }
.sw-nav button { display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.35rem 0.8rem 0.35rem 0.4rem; border-radius: 999px; border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.18)); background: transparent; color: var(--text-muted); font-size: 0.82rem; cursor: pointer; }
.sw-nav button span { display: inline-flex; align-items: center; justify-content: center; width: 1.3rem; height: 1.3rem; border-radius: 50%; background: rgba(255, 255, 255, 0.1); font-size: 0.74rem; font-weight: 700; }
.sw-nav button.is-on { background: var(--accent-fill); border-color: var(--soniox-blue); color: #fff; }
.sw-nav button.is-on span { background: rgba(255, 255, 255, 0.25); }
.sw-step[hidden] { display: none; }
.sw-field { display: flex; align-items: center; gap: 0.75rem; margin: 0 0 0.7rem; }
.sw-field label { min-width: 8.5rem; font-size: 0.85rem; color: var(--text-muted); }
.sw-field select { min-width: 12rem; }
.sw-app { margin-top: 1rem; flex-wrap: wrap; }
.sw-field[hidden], .sw-privacy[hidden] { display: none; }
.sw-first { margin-top: 0; margin-bottom: 0.8rem; }
.sw-foot { position: sticky; bottom: 0; display: flex; align-items: center; gap: 0.6rem; padding: 0.75rem 0 0.2rem; margin-top: 0.4rem; background: linear-gradient(to top, var(--bg-app) 70%, transparent); }
.sw-foot .sw-start { flex: 1 1 auto; align-self: auto; padding: 0.75rem 1rem; }
.sw-foot [hidden] { display: none; }
/* Button row: Back and Audio only on the left; Start and Next on the right, with Next last (nearest the thumb, and the natural "forward").
   While there is a step still to come, Next is the strong button and Start recording is quieter but always there; on the last step Start takes over. */
.sw-foot [data-act="back"] { order: 1; }
.sw-foot .sw-capture-btn { order: 2; }
.sw-foot .sw-start { order: 3; }
.sw-foot [data-act="next"] { order: 4; }
.sw-foot:has([data-act="next"]:not([hidden])) .sw-start { flex: 0 0 auto; margin-left: auto; background: transparent; color: var(--text-main); border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.28)); box-shadow: none; font-size: 0.9rem; padding: 0.55rem 0.9rem; }
.sw-foot:has([data-act="next"]:not([hidden])) .sw-start:hover { background: rgba(255, 255, 255, 0.08); }
.sw-foot:has([data-act="next"]:not([hidden])) [data-act="next"] { background: var(--accent-fill); border-color: var(--soniox-blue); color: #fff; padding: 0.7rem 1.6rem; font-weight: 600; }
@media (max-width: 640px) { .sw-foot { flex-wrap: wrap; } .sw-foot:has([data-act="next"]:not([hidden])) .sw-start { margin-left: 0; flex: 1 1 auto; } }

/* Capture area: the layouts, and the dialog to drag one */
.sw-area { margin-top: 0.9rem; }
.sw-area-tiles { grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); }
.sw-area-tile { position: relative; align-items: flex-start; }
.ca-thumb { color: var(--text-muted); margin-bottom: 0.25rem; }
.sw-area-tile[aria-pressed="true"] .ca-thumb { color: var(--text-main); }
.ca-draw { display: inline-flex; align-items: center; justify-content: center; width: 4rem; height: 2.5rem; margin-bottom: 0.25rem; border: 1.5px dashed var(--border-subtle, rgba(255, 255, 255, 0.3)); border-radius: 0.5rem; font-size: 1.4rem; color: var(--text-muted); }
.sw-del { position: absolute; top: 0.3rem; right: 0.45rem; font-size: 1.1rem; line-height: 1; color: var(--text-muted); cursor: pointer; }
.sw-del:hover { color: var(--text-main); }
.ca-card { max-width: 46rem; width: 94vw; }
.ca-stage { position: relative; width: 100%; max-height: 60vh; margin: 0.6rem 0; border-radius: 0.6rem; overflow: hidden; background: #0b1220; touch-action: none; }
.ca-backdrop, .ca-pic { position: absolute; inset: 0; width: 100%; height: 100%; }
.ca-plain { background: repeating-linear-gradient(45deg, #101826, #101826 10px, #131c2c 10px, #131c2c 20px); }
.ca-box { position: absolute; border: 2px solid #1881ff; background: rgba(24, 129, 255, 0.18); box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.45); cursor: move; outline: none; }
.ca-box:focus-visible { box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.45), 0 0 0 3px #fff; }
.ca-handle { position: absolute; width: 14px; height: 14px; background: #fff; border: 2px solid #1881ff; border-radius: 3px; }
.ca-handle[data-h="nw"] { left: -8px; top: -8px; cursor: nwse-resize; } .ca-handle[data-h="ne"] { right: -8px; top: -8px; cursor: nesw-resize; }
.ca-handle[data-h="sw"] { left: -8px; bottom: -8px; cursor: nesw-resize; } .ca-handle[data-h="se"] { right: -8px; bottom: -8px; cursor: nwse-resize; }
.ca-fields { display: flex; flex-wrap: wrap; align-items: center; gap: 0.8rem 1.2rem; }
.ca-fields label { display: flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; }
.ca-name { min-width: 15rem; }

/* Review voices */
.voices-card { max-width: 46rem; width: calc(100vw - 2rem); max-height: calc(100vh - 3rem); display: flex; flex-direction: column; }
.voices-card .vr-body { overflow: auto; flex: 1 1 auto; }
.vr-intro { font-size: 0.85rem; line-height: 1.5; color: var(--text-muted); margin: 0 0 0.6rem; }
.vr-bar { display: flex; justify-content: flex-end; margin-bottom: 0.5rem; }
.vr-select { max-width: 13rem; font-size: 0.82rem; padding: 0.25rem 0.5rem; }
.vr-voice { border: 1px solid var(--border-subtle, rgba(255,255,255,0.14)); border-radius: 12px; padding: 0.6rem 0.8rem; margin-bottom: 0.7rem; background: rgba(255,255,255,0.03); }
.vr-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.8rem; }
.vr-chip { cursor: default; }
.vr-stats { font-size: 0.78rem; color: var(--text-muted); flex: 1 1 12rem; }
.vr-tools { display: flex; gap: 0.4rem; align-items: center; }
.vr-list { list-style: none; margin: 0.5rem 0 0; padding: 0; }
.vr-item { display: grid; grid-template-columns: auto 3rem 1fr; gap: 0.2rem 0.6rem; align-items: start; padding: 0.4rem 0; border-top: 1px solid var(--border-subtle, rgba(255,255,255,0.1)); }
.vr-time { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-muted); padding-top: 0.3rem; }
.vr-text { font-size: 0.86rem; line-height: 1.45; padding-top: 0.15rem; }
.vr-acts { grid-column: 3; display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.vr-play { min-width: 3.4rem; }
.vr-play[aria-pressed="true"] { background: var(--accent-fill); color: #fff; }
.vr-more { margin-top: 0.3rem; }
.legend-review { margin-left: auto; font-size: 0.78rem; padding: 0.15rem 0.7rem; border-radius: 999px; border: 1px dashed var(--border-subtle, rgba(255,255,255,0.3)); background: transparent; color: var(--text-muted); cursor: pointer; }
.legend-review:hover { color: var(--text-main); border-style: solid; }

.assign-actions { display: flex; gap: 0.35rem; flex-wrap: wrap; margin: 0 0 0.6rem; }
.assign-actions .btn { flex: 1 1 auto; }

/* The toolbar's groups carry a small label; Record has its options arrow; Add, View and Record open small menus */
.controls-toolbar .tb-group[data-label] { position: relative; padding-top: 0.95rem; }
.controls-toolbar .tb-group[data-label]::before { content: attr(data-label); position: absolute; top: 0; left: 0.1rem; font-size: 0.62rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-muted); pointer-events: none; }
/* Keep audio is a switch of its own beside Record, not part of it: outlined, and tinted with a tick when it is on */
.keep-audio[aria-pressed="true"] { border-color: var(--soniox-blue); background: rgba(24, 129, 255, 0.18); color: var(--text-main); }
.keep-audio[aria-pressed="true"] .icon { color: var(--accent-text); }
.keep-audio[disabled] { opacity: 0.6; }
.tb-menu { position: fixed; z-index: 1300; min-width: 15rem; max-width: 22rem; background: var(--surface-popover, #1b2238); border: 1px solid var(--border-subtle, rgba(255,255,255,0.16)); border-radius: 12px; padding: 0.35rem; box-shadow: 0 10px 30px rgba(0,0,0,0.45); max-height: calc(100vh - 1.5rem); overflow: auto; }
.tb-menu-heading { font-size: 0.68rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-muted); padding: 0.4rem 0.6rem 0.2rem; }
.tb-menu-divider { height: 1px; background: var(--border-subtle, rgba(255,255,255,0.12)); margin: 0.3rem 0; }
.tb-menu-item { display: flex; align-items: flex-start; gap: 0.4rem; width: 100%; text-align: left; background: transparent; border: 0; color: var(--text-main); font: inherit; font-size: 0.86rem; padding: 0.4rem 0.6rem; border-radius: 8px; cursor: pointer; }
.tb-menu-item:hover:not([disabled]), .tb-menu-item:focus-visible { background: rgba(255,255,255,0.08); outline: none; }
.tb-menu-item[disabled] { opacity: 0.45; cursor: default; }
.tb-menu-mark { width: 1rem; flex: none; color: var(--accent, #7aa7ff); }
.tb-menu-text { display: flex; flex-direction: column; }
.tb-menu-text small { color: var(--text-muted); font-size: 0.74rem; line-height: 1.3; }
.tb-menu-seg { display: flex; margin: 0.2rem 0.4rem; border: 1px solid var(--border-subtle, rgba(255,255,255,0.2)); border-radius: 8px; overflow: hidden; }
.tb-menu-seg button { flex: 1; background: transparent; border: 0; color: var(--text-main); font: inherit; font-size: 0.86rem; padding: 0.35rem 0; cursor: pointer; }
.tb-menu-seg button[aria-pressed="true"] { background: var(--accent-fill); color: #fff; }
.tb-menu-slider { display: grid; grid-template-columns: 1fr auto; gap: 0.1rem 0.5rem; padding: 0.3rem 0.6rem; font-size: 0.84rem; }
.tb-menu-slider output { color: var(--text-muted); font-size: 0.78rem; }
.tb-menu-slider input { grid-column: 1 / -1; width: 100%; }

/* One line: every label sits at the same height above its control, and every control is the same height */
.controls-toolbar { align-items: flex-end; }
.controls-toolbar .tb-group { align-items: flex-end; }
body:not(.is-recording) .controls-toolbar .btn, body:not(.is-recording) .controls-toolbar .form-select { height: 2.25rem; min-height: 2.25rem; padding-top: 0; padding-bottom: 0; box-sizing: border-box; line-height: 1; }
body:not(.is-recording) .controls-toolbar .btn-icon { width: 2.25rem; padding-left: 0; padding-right: 0; }
.controls-toolbar .start-field { flex-direction: column; align-items: stretch; gap: 0; }
.controls-toolbar .start-field > span { height: 0.95rem; line-height: 0.95rem; font-size: 0.62rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-muted); }
body.is-recording .controls-toolbar .tb-group[data-label] { padding-top: 0; }
body.is-recording .controls-toolbar .tb-group[data-label]::before { display: none; }
body.is-recording .controls-toolbar .start-field > span { display: none; }
.tb-menu-check { display: flex; align-items: center; gap: 0.5rem; padding: 0.4rem 0.6rem; font-size: 0.8rem; color: var(--text-secondary); cursor: pointer; }
.controls-toolbar { column-gap: 0.8rem; padding-left: 0.9rem; padding-right: 0.9rem; }
.controls-toolbar .tb-group { gap: 0.35rem; }
.controls-toolbar .start-field .form-select { max-width: 9.5rem; }
body:not(.is-recording) .controls-toolbar .btn { padding-left: 0.7rem; padding-right: 0.7rem; }
.controls-toolbar { column-gap: 0.55rem; padding-left: 0.7rem; padding-right: 0.7rem; }

/* Words in the speaker's colour, so a change of voice shows at a glance (darker on the light background so it stays readable) */
.cv-colour .cv-text, .cv-colour .cv-past { color: var(--spk-primary, inherit); }
.cv-colour.cv-light .cv-text, .cv-colour.cv-light .cv-past { color: color-mix(in srgb, var(--spk-primary, #1881ff) 55%, #000); }
.cv-colour.cv-light .cv-who, .cv-colour.cv-light .cv-past-who { color: color-mix(in srgb, var(--spk-primary, #1881ff) 55%, #000); }

/* ==========================================================================
   Notes panel: the reader's own notes on the whole recording (rich text), beside the transcript.
   It can be open together with the Voices panel.
   ========================================================================== */
.notes-panel {
  flex: 0 0 320px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.9rem 0.8rem;
  border-left: 1px solid var(--border-subtle);
  background: rgba(8, 12, 20, 0.6);
  min-height: 0;
  font-size: 0.85rem;
}
.notes-panel[hidden] { display: none; }
.notes-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.notes-style { height: 2rem; max-width: 6rem; padding: 0 0.3rem; font-size: 0.78rem; }
.notes-bar { gap: 3px; }
.notes-tool { min-width: 1.85rem; padding: 0 0.3rem; }
.notes-tool {
  min-width: 2rem; height: 2rem; padding: 0 0.4rem;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border-subtle); border-radius: 6px;
  background: rgba(255, 255, 255, 0.05); color: var(--text-main, #e5e7eb);
  font: 600 0.85rem var(--font-main, inherit); cursor: pointer;
}
.notes-tool:hover { background: rgba(255, 255, 255, 0.12); }
.notes-tool.on { background: rgba(99, 102, 241, 0.35); border-color: var(--border-active, #6366f1); }
.notes-editor {
  flex: 1; min-height: 8rem; overflow-y: auto;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--border-subtle); border-radius: 8px;
  background: rgba(0, 0, 0, 0.25);
  line-height: 1.5; font-size: 0.92rem; outline: none;
  overflow-wrap: anywhere;
}
.notes-editor:focus { border-color: var(--border-active, #6366f1); }
.notes-editor:empty::before { content: attr(data-placeholder); color: var(--text-muted); pointer-events: none; }
.notes-editor h1 { font-size: 1.3rem; margin: 0.5rem 0 0.25rem; }
.notes-editor h2 { font-size: 1.12rem; margin: 0.5rem 0 0.25rem; }
.notes-editor h3 { font-size: 1rem; margin: 0.4rem 0 0.2rem; }
.notes-editor p, .notes-editor div { margin: 0 0 0.35rem; }
.notes-editor ul, .notes-editor ol { margin: 0.2rem 0 0.4rem; padding-left: 1.4rem; }
.notes-foot { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.notes-note { font-size: 0.7rem; color: var(--text-muted); }
:root[data-theme="light"] .notes-panel { background: rgba(255, 255, 255, 0.7); }
:root[data-theme="light"] .notes-editor { background: #fff; }

@media (max-width: 900px) {
  .notes-panel {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 125;
    flex: none; height: 52vh;
    border-left: 0; border-top: 1px solid var(--border-active);
    border-radius: 14px 14px 0 0;
    background: var(--bg-card);
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.45);
    padding-bottom: calc(0.9rem + env(safe-area-inset-bottom, 0px));
  }
}

/* ==========================================================================
   Side rail: on wide windows, a vertical tab at the right edge for each closed side panel (Notes, Voices).
   A click opens that panel again. The folded Voices panel gives its strip to the rail.
   ========================================================================== */
.side-rail {
  flex: 0 0 34px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0.6rem 4px;
  border-left: 1px solid var(--border-subtle);
  background: rgba(8, 12, 20, 0.6);
}
.side-rail[hidden], .side-rail-tab[hidden] { display: none; }
.side-rail-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 5.5rem;
  padding: 0.6rem 0;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  font: 600 0.78rem var(--font-main, inherit);
  letter-spacing: 0.04em;
  cursor: pointer;
}
.side-rail-tab span { writing-mode: vertical-rl; }
.side-rail-tab:hover, .side-rail-tab:focus-visible { background: rgba(255, 255, 255, 0.12); color: var(--text-main, #fff); border-color: var(--border-active); outline: none; }
:root[data-theme="light"] .side-rail { background: rgba(255, 255, 255, 0.7); }
:root[data-theme="light"] .side-rail-tab { background: rgba(0, 0, 0, 0.04); }
@media (min-width: 901px) {
  .workspace > .assign-panel.collapsed { display: none; }
}
@media (max-width: 900px) {
  .side-rail { display: none !important; }
}

/* a dialog whose choices are listed one per row (the sample recordings) */
.modal-footer.stacked { flex-direction: column; align-items: stretch; }
.modal-footer.stacked .btn { width: 100%; justify-content: center; text-align: center; }
.modal-footer.stacked .btn-text { align-self: center; }

/* ==========================================================================
   Audio recording ("Just capture the audio"): the sound against the timeline, and the files as they are saved
   ========================================================================== */
#viewRecord.audio-on .controls-toolbar,
#viewRecord.audio-on .transcript-host,
#viewRecord.audio-on .notice-banner,
#viewRecord.audio-on .start-wizard { display: none; }
.audio-recorder { --ar-speech: #38bdf8; --ar-quiet: #64748b; --ar-gap: rgba(148, 163, 184, 0.25); --ar-cut: #f59e0b; flex: 1; overflow-y: auto; padding: 1.2rem 1rem 2rem; }
.audio-recorder[hidden] { display: none; }
.ar-inner { max-width: 52rem; margin: 0 auto; display: flex; flex-direction: column; gap: 0.9rem; }
.ar-top { display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; }
.ar-dot { width: 12px; height: 12px; border-radius: 50%; background: #64748b; flex: none; }
.audio-recorder[data-state="recording"] .ar-dot { background: #ef4444; box-shadow: 0 0 10px rgba(239, 68, 68, 0.8); animation: pulse-mic 0.8s infinite ease-in-out; }
.audio-recorder[data-state="paused"] .ar-dot { background: #f59e0b; }
.ar-title { flex: 1; min-width: 12rem; font-size: 1.1rem; font-weight: 600; background: transparent; color: inherit; border: 0; border-bottom: 1px dashed var(--border-subtle); padding: 0.2rem 0; }
.ar-title:focus { outline: none; border-bottom-color: var(--border-active, #6366f1); }
.ar-state { font-size: 0.82rem; color: var(--text-muted); }
.ar-time { font: 600 3rem var(--font-mono, monospace); letter-spacing: 0.02em; line-height: 1; }
.ar-wave-wrap { border: 1px solid var(--border-subtle); border-radius: 10px; padding: 0.5rem 0.6rem 0.4rem; background: rgba(0, 0, 0, 0.25); }
.ar-wave { width: 100%; height: 140px; display: block; }
.ar-legend { display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; font-size: 0.72rem; color: var(--text-muted); margin-top: 0.3rem; }
.ar-k { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.ar-k.speech { background: var(--ar-speech); } .ar-k.quiet { background: var(--ar-quiet); } .ar-k.gap { background: var(--ar-gap); border: 1px solid var(--ar-quiet); } .ar-k.cut { background: var(--ar-cut); width: 3px; }
.ar-source { display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; font-size: 0.95rem; color: var(--text-muted); }
.ar-source-text { color: var(--text-main); }
.ar-source .btn[hidden], .ar-source:has(.ar-source-text:empty) { display: none; }
.ar-warn { margin: 0; padding: 0.5rem 0.7rem; border-radius: 8px; background: rgba(245, 158, 11, 0.15); border: 1px solid rgba(245, 158, 11, 0.5); font-size: 0.85rem; }
.ar-buttons { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.ar-buttons[hidden], .ar-done[hidden], .ar-warn[hidden] { display: none; }
.ar-done-text { margin: 0 0 0.6rem; font-size: 0.95rem; }
.ar-files h4 { margin: 0 0 0.4rem; font-size: 0.9rem; }
.ar-files h4 small { color: var(--text-muted); font-weight: 400; margin-left: 0.4rem; }
.ar-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.ar-list li { display: grid; grid-template-columns: 1fr auto auto; gap: 0.8rem; align-items: baseline; padding: 0.35rem 0.6rem; border: 1px solid var(--border-subtle); border-radius: 8px; font-size: 0.82rem; }
.ar-list li.live { border-color: rgba(239, 68, 68, 0.5); }
.ar-list li.saved .ar-status::before { content: "\2713  "; color: #22c55e; }
.ar-file { overflow-wrap: anywhere; font-family: var(--font-mono, monospace); }
.ar-dur, .ar-status { color: var(--text-muted); white-space: nowrap; }
:root[data-theme="light"] .audio-recorder { --ar-speech: #0284c7; --ar-quiet: #94a3b8; }
:root[data-theme="light"] .ar-wave-wrap { background: #fff; }

/* "Audio only" is chosen in the start steps: what only matters for a transcript is left out */
.start-wizard.sw-capture .sw-field:has([data-for="language"]),
.start-wizard.sw-capture [data-for="pictures"],
.start-wizard.sw-capture [data-for="area"],
.start-wizard.sw-capture [data-for="timer"] { display: none; }

.library-waiting { margin: 0 0 1.1rem; padding: 0.6rem 0.7rem; border: 1px solid rgba(245, 158, 11, 0.45); border-radius: 10px; background: rgba(245, 158, 11, 0.07); }
.library-waiting-head { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; margin-bottom: 0.4rem; }
.library-waiting-head h3 { margin: 0; font-size: 0.95rem; }
/* a long list scrolls inside its box: about five rows, with half of the next showing to say there is more */
.library-waiting .library-list { max-height: 19rem; overflow-y: auto; padding-right: 0.3rem; }
.library-waiting-row { align-items: center; }
.library-waiting-row .library-item { flex: 1; cursor: default; background: transparent; border: 0; }

.start-wizard .sw-capture-btn { display: inline-flex; align-items: center; gap: 0.45rem; }
.start-wizard .sw-capture-btn[hidden] { display: none; }

/* ==========================================================================
   Batch: files, transcribers, the queue, and Compare
   ========================================================================== */
.batch-page { max-width: 62rem; }
.batch-cols { display: grid; grid-template-columns: 1.4fr 1fr; gap: 1rem; }
@media (max-width: 800px) { .batch-cols { grid-template-columns: 1fr; } }
.batch-drop { display: flex; flex-direction: column; align-items: center; gap: 0.2rem; padding: 1.1rem; border: 2px dashed var(--border-subtle); border-radius: 12px; cursor: pointer; text-align: center; color: var(--text-muted); }
.batch-drop strong { color: var(--text-main); }
.batch-drop:hover, .batch-drop.over, .batch-drop:focus-visible { border-color: var(--border-active, #6366f1); background: rgba(99, 102, 241, 0.08); outline: none; }
.batch-file-actions { display: flex; align-items: center; gap: 0.7rem; margin: 0.7rem 0 0.3rem; flex-wrap: wrap; }
.batch-files-total { margin-left: auto; font-size: 0.8rem; color: var(--text-muted); }
.batch-files, .batch-trans { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
/* Every transcriber is shown (nothing hidden behind a scroll bar); the file list stretches to the same height and scrolls beyond that */
.batch-files-card, .batch-trans-card { display: flex; flex-direction: column; }
.batch-files { flex: 1 1 16rem; min-height: 16rem; max-height: 36rem; overflow-y: auto; }
.batch-files li, .batch-trans li { display: flex; align-items: center; gap: 0.4rem; padding: 0.2rem 0.3rem; border-radius: 6px; }
.batch-files li:hover, .batch-trans li:hover { background: rgba(255, 255, 255, 0.05); }
.batch-files li.off, .batch-trans li.off { opacity: 0.55; }
.batch-file, .batch-tr { display: flex; align-items: baseline; gap: 0.5rem; flex: 1; min-width: 0; cursor: pointer; font-size: 0.88rem; }
.batch-file-name, .batch-tr-name { overflow-wrap: anywhere; }
.batch-file small, .batch-tr small { color: var(--text-muted); white-space: nowrap; margin-left: auto; }
.batch-hint, .batch-note { font-size: 0.8rem; color: var(--text-muted); margin: 0 0 0.5rem; }
.batch-plan { margin: 0 0 0.7rem; font-size: 0.92rem; }
.batch-buttons { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; }
.batch-queue-card[hidden] { display: none; }
.batch-group { border: 1px solid var(--border-subtle); border-radius: 10px; padding: 0.4rem 0.7rem 0.5rem; margin-bottom: 0.6rem; }
.batch-group-head { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; padding: 0.2rem 0 0.3rem; }
.batch-group-head strong { overflow-wrap: anywhere; }
.batch-job { position: relative; display: grid; grid-template-columns: minmax(7rem, 1fr) minmax(8rem, 1.2fr) minmax(9rem, 2fr) auto; gap: 0.6rem; align-items: baseline; padding: 0.3rem 0; font-size: 0.85rem; border-top: 1px solid var(--border-subtle); }
.batch-job-state { overflow-wrap: anywhere; }
.batch-job.done .batch-job-state { color: #22c55e; }
.batch-job.failed .batch-job-state { color: #f87171; }
.batch-job.cancelled .batch-job-state, .batch-job.queued .batch-job-state { color: var(--text-muted); }
.batch-job-meta { color: var(--text-muted); font-size: 0.8rem; }
.batch-bar { position: absolute; left: 0; bottom: 0; height: 2px; background: var(--border-active, #6366f1); transition: width 0.3s ease; }
@media (max-width: 700px) { .batch-job { grid-template-columns: 1fr auto; } .batch-job-meta { grid-column: 1 / -1; } }
.batch-compare { padding: 1rem 1.25rem; max-width: min(96vw, 78rem); width: 96vw; max-height: 92vh; overflow-y: auto; }
.batch-compare-head { display: flex; align-items: center; justify-content: space-between; }
.batch-stats { width: 100%; border-collapse: collapse; margin: 0.4rem 0 0.8rem; font-size: 0.85rem; }
.batch-stats th, .batch-stats td { text-align: left; padding: 0.35rem 0.5rem; border-bottom: 1px solid var(--border-subtle); }
.batch-cols-text { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(16rem, 1fr); gap: 0.8rem; overflow-x: auto; }
.batch-col h4 { margin: 0 0 0.3rem; font-size: 0.9rem; }
.batch-col-text { max-height: 45vh; overflow-y: auto; padding: 0.5rem 0.6rem; border: 1px solid var(--border-subtle); border-radius: 8px; font-size: 0.85rem; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.batch-col-text mark { background: rgba(245, 158, 11, 0.3); color: inherit; border-radius: 3px; padding: 0 1px; }

.batch-left-card { border-color: rgba(245, 158, 11, 0.5); }
.batch-left-card[hidden] { display: none; }
.batch-left-head { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; }
.batch-left-head h3 { margin: 0; }
.batch-left { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.batch-left-row { display: flex; align-items: baseline; gap: 0.7rem; padding: 0.25rem 0; font-size: 0.88rem; }
.batch-left-name { overflow-wrap: anywhere; }
.batch-left-row small { color: var(--text-muted); margin-left: auto; }

/* A button that cannot be used right now looks it */
.btn:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; filter: saturate(0.6); }
/* Batch: the plan, the sound option and the buttons, spaced as three separate things */
.batch-plan-card .batch-plan { margin: 0 0 1rem; }
.batch-keep { margin: 0 0 1.1rem; padding: 0.7rem 0.85rem; border: 1px solid var(--border-subtle); border-radius: 10px; background: rgba(255, 255, 255, 0.03); }
.batch-keep-label { display: flex; align-items: flex-start; gap: 0.6rem; cursor: pointer; font-size: 0.95rem; line-height: 1.4; margin: 0; }
.batch-keep-label input { margin-top: 0.2rem; flex: none; }
.batch-keep-hint { margin: 0.25rem 0 0 1.65rem; font-size: 0.8rem; color: var(--text-muted); }
.batch-plan-card .batch-buttons { margin-top: 0.2rem; }
.batch-block-title { font-weight: 700; margin: 0 0 0.5rem; }
.batch-formats { display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; }
.batch-format { display: inline-flex; align-items: center; gap: 0.45rem; font-size: 0.95rem; cursor: pointer; }
.batch-format input:disabled + span { opacity: 0.5; }
.batch-dest-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 0.9rem; }
.batch-dest-name { overflow-wrap: anywhere; }
.batch-dest .batch-keep-hint, .batch-export .batch-keep-hint { margin-left: 0; }
.batch-toggle-all { font-weight: 600; }

/* Recording types have a picture each (images/start), so the start screen is not all words */
.sw-has-photo { display: flex; flex-direction: column; gap: 0; padding: 0; overflow: hidden; }
.sw-photo { display: block; aspect-ratio: 16 / 9; background: linear-gradient(135deg, #14233a, #1b6b8f) center / cover no-repeat; transition: filter 0.2s ease; filter: saturate(0.8) brightness(0.82); }
.sw-has-photo:hover .sw-photo, .sw-has-photo[aria-pressed="true"] .sw-photo { filter: none; }
.sw-has-photo strong { padding: 0.6rem 0.85rem 0.1rem; }
.sw-has-photo small { padding: 0 0.85rem 0.7rem; }
html.no-motion .sw-photo { transition: none; }
@media (prefers-reduced-motion: reduce) { .sw-photo { transition: none; } }

/* The tabs sit in their own tablist, with the About and Fullscreen buttons beside it (a tablist may hold only tabs); the wrappers add no box */
.tab-bar .tab-list { display: contents; }
#appMain { display: contents; }
