* { margin: 0; padding: 0; box-sizing: border-box; cursor: default; -webkit-user-select: none; user-select: none; }
input, textarea, [contenteditable] { cursor: text; -webkit-user-select: auto; user-select: auto; }
select { cursor: pointer; -webkit-user-select: auto; user-select: auto; }
button { cursor: pointer; }

:root {
  --bg: #f5f0eb;
  --surface: #ffffff;
  --accent: #e94560;
  --accent-glow: rgba(233, 69, 96, 0.2);
  --text: #2d2d2d;
  --text-muted: #888;
  --border: rgba(0,0,0,0.06);
}

/* Onboarding */

.onboarding {
  min-height: 100dvh;
  background: var(--bg);
}

.onboarding.hidden { display: none; }

.ob-step {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ob-step.hidden { display: none; }

.ob-content {
  max-width: 360px;
  width: 100%;
  padding: 40px 32px;
  text-align: center;
}

.ob-icon {
  margin-bottom: 24px;
}

.ob-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
}

.ob-text {
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.6;
  margin-bottom: 32px;
}

.ob-text-small {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.ob-input {
  width: 100%;
  padding: 12px 16px;
  margin-bottom: 10px;
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
}

.ob-select {
  appearance: none;
  -webkit-appearance: none;
}

.ob-select option {
  padding: 8px 12px;
}

.ob-bio {
  resize: vertical;
  font-family: inherit;
  font-size: 1rem;
  min-height: 100px;
}

.ob-btn {
  width: 100%;
  padding: 14px;
  margin-top: 8px;
  border: none;
  border-radius: 12px;
  background: var(--accent);
  color: white;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}

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

.ob-btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid rgba(0,0,0,0.1);
}

.ob-link {
  display: block;
  margin-top: 16px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  text-decoration: underline;
}

.ob-error {
  color: var(--accent);
  font-size: 0.85rem;
  margin-top: 10px;
}

.ob-error.hidden { display: none; }

.ob-divider {
  border: none;
  border-top: 1px solid rgba(0,0,0,0.08);
  margin: 20px 0;
}

.ob-mic-help {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 12px;
  line-height: 1.5;
}

.ob-mic-help.hidden { display: none; }

.app.hidden { display: none; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.mic-banner {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  background: #fff3cd;
  border-bottom: 1px solid #eed07a;
  cursor: pointer;
}

.mic-banner.hidden { display: none; }

.mic-banner-icon {
  color: #b8860b;
  flex-shrink: 0;
}

.mic-banner-text {
  font-size: 0.85rem;
  line-height: 1.4;
  color: #664d03;
}

.mic-banner-text strong {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 2px;
}

.header {
  padding: 24px 24px 0;
  text-align: center;
  position: relative;
  display: flex;
  align-items: center;
}

.build-info {
  position: fixed;
  top: 8px;
  left: 12px;
  font-size: 0.6rem;
  color: #ccc;
  z-index: 200;
}

.menu-toggle {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 200;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 18px 20px;
  -webkit-tap-highlight-color: transparent;
}

.menu-toggle svg {
  width: 28px;
  height: 28px;
}

.menu-toggle:hover { color: var(--text); }

#refreshBtn {
  right: 52px;
}

.menu-panel {
  position: fixed;
  top: 56px;
  right: 12px;
  z-index: 150;
  width: 280px;
  max-height: calc(100dvh - 70px);
  overflow-y: auto;
  background: var(--surface);
  border-radius: 14px;
  padding: 16px 20px 20px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.12);
}

.menu-panel::before {
  content: '';
  position: absolute;
  top: -8px;
  right: 18px;
  width: 16px;
  height: 16px;
  background: var(--surface);
  transform: rotate(45deg);
  box-shadow: -2px -2px 4px rgba(0,0,0,0.04);
}

.menu-panel.hidden { display: none; }

.menu-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

.auth-section {
  width: 100%;
  padding: 0 24px 16px;
}

.auth-card {
  background: var(--surface);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.profile-name-btn {
  width: 100%;
  padding: 12px 16px;
  background: var(--surface);
  border: none;
  border-radius: 14px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.profile-name-btn::after {
  content: '\25BE';
  color: var(--text-muted);
  font-size: 0.8rem;
}

.profile-details {
  background: var(--surface);
  border-radius: 0 0 14px 14px;
  padding: 0 16px 16px;
  margin-top: -14px;
  padding-top: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.profile-details.hidden { display: none; }

.auth-textarea {
  resize: vertical;
  min-height: 60px;
  font-family: inherit;
}

.auth-select {
  appearance: none;
  -webkit-appearance: none;
}

.auth-input {
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 8px;
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-size: 0.9rem;
}

.auth-user {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.auth-error {
  font-size: 0.8rem;
  color: var(--accent);
  margin-top: 8px;
}

.auth-error.hidden { display: none; }

.pw-success {
  font-size: 0.8rem;
  color: #2e7d32;
  margin-top: 8px;
}

.pw-success.hidden { display: none; }

.menu-tabs {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 16px;
}

.menu-tabs.hidden { display: none; }

.menu-tab {
  width: 100%;
  padding: 10px 12px;
  border: none;
  background: none;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  text-align: left;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.menu-tab svg {
  flex-shrink: 0;
}

.menu-tab:hover {
  background: rgba(0,0,0,0.04);
}

.menu-tab.active {
  color: var(--accent);
}

.menu-tab-logout {
  margin-top: 8px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
  color: var(--text-muted);
}

.menu-back {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 6px 0;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.menu-back:hover { color: var(--text); }
.menu-back.hidden { display: none; }

.menu-tab-content {
  padding-bottom: 8px;
}

.menu-tab-content.hidden { display: none; }

.hidden { display: none; }

.menu-toggle-row {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.menu-setting { margin-bottom: 14px; }
.menu-setting-label { display: block; font-size: 0.75rem; color: var(--text-muted); margin-bottom: 6px; }
.menu-setting-btns { display: flex; gap: 8px; }

.ob-lang-toggle { display: flex; gap: 8px; justify-content: center; margin-top: 12px; }

.mode-btn {
  flex: 1;
  padding: 8px;
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
}

.mode-btn-disabled {
  opacity: 0.35;
}

.mode-btn.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.reset-btn {
  margin-top: 8px;
  padding: 6px 14px;
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  float: right;
}

.menu-slider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.menu-slider span:first-child {
  min-width: 36px;
}

.menu-slider input[type="range"] {
  flex: 1;
  accent-color: var(--accent);
}

.menu-slider span:last-child {
  min-width: 32px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.header h1 {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 200;
  padding: 18px 20px;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text);
  margin: 0;
}

.header-link {
  color: inherit;
  text-decoration: none;
}

.greeting {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 28px;
}

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero {
  text-align: center;
  padding: 32px 24px 24px;
}

.hero-text {
  color: var(--text-muted);
  margin-bottom: 36px;
  font-size: 1.05rem;
}

.record-btn {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: white;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 24px var(--accent-glow);
  transition: transform 0.08s ease-out, box-shadow 0.08s ease-out;
}

.record-btn:active {
  transform: scale(0.92);
}

.record-btn.preparing {
  opacity: 0.6;
  animation: breathe 1s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 0.8; }
}

.record-btn.recording {
  opacity: 1;
  transition: transform 0.08s ease-out, box-shadow 0.08s ease-out;
}

.record-label {
  margin-top: 12px;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
  min-height: 1.3em;
}

.mic-help {
  margin-top: 24px;
  padding: 16px 20px;
  background: rgba(233, 69, 96, 0.08);
  border: 1px solid rgba(233, 69, 96, 0.2);
  border-radius: 12px;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text);
  text-align: left;
  display: none;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}

.mic-help.visible { display: block; }

.mic-help strong {
  display: block;
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 0.9rem;
}

/* Recordings list */

.recordings {
  width: 100%;
  padding: 0 16px 40px;
  transition: transform 0.4s ease, opacity 0.4s ease;
  transform-origin: top center;
}

/* recordings-mini class: no animation needed, transitions on children handle it */

.recordings-title-row {
  max-width: 460px;
  margin: 0 auto 8px;
  padding: 0 16px;
}

.rec-header-line {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.recordings-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.rec-collapse-toggle {
  margin-left: auto;
  margin-right: 0;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px;
  display: flex;
  align-items: center;
  transition: color 0.15s;
  flex-shrink: 0;
  width: 20px;
  justify-content: center;
}

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

.rec-tag-toggle {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 1px 5px 1px 7px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: none;
  color: var(--text-muted);
  font-size: 0.55rem;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}

.rec-tag-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.rec-tag-toggle.has-filter {
  border-color: var(--accent);
  color: var(--accent);
}

.rec-tag-toggle svg {
  transition: transform 0.2s;
}

.rec-tag-toggle.open svg {
  transform: rotate(180deg);
}

.rec-tag-chips {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  padding-top: 6px;
  padding-left: 0;
}

.rec-tag-chips.hidden { display: none; }

.rec-tag-chip {
  padding: 2px 7px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: none;
  color: var(--text-muted);
  font-size: 0.55rem;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.rec-tag-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.rec-tag-chip.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.recording-card {
  background: var(--surface);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  max-width: 460px;
}

.recording-header {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  margin-top: 2px;
  font-size: 0.8rem;
  color: var(--text-muted);
  min-height: 20px;
}

.recording-header .recording-date {
  flex-shrink: 0;
  cursor: pointer;
  max-width: 55%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recording-header .recording-date:hover {
  color: var(--text);
}

.recording-header .recording-date-titled {
  color: var(--text);
  font-weight: 500;
}

.recording-header .recording-date-titled:hover {
  overflow: visible;
  position: relative;
}

.recording-header .recording-date-titled:hover::after {
  content: attr(data-recdate);
  position: absolute;
  bottom: 100%;
  left: 0;
  margin-bottom: 4px;
  background: var(--text);
  color: var(--surface);
  font-size: 0.7rem;
  font-weight: 400;
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 10;
}

.recording-header .title-edit {
  border: none;
  border-bottom: 1px solid var(--accent);
  background: transparent;
  font-size: 0.8rem;
  color: var(--text);
  outline: none;
  padding: 0 0 1px 0;
  max-width: 55%;
  flex-shrink: 0;
}

.rec-header-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 0.7rem;
  color: var(--text-muted);
  flex-shrink: 0;
  background: transparent;
  cursor: default;
}

.rec-header-badge svg {
  opacity: 0.5;
}

.recording-header .waveform-time {
  flex: 1;
  text-align: center;
}

.speed-btn {
  cursor: pointer;
  font-size: 0.7rem;
  padding: 1px 5px;
  cursor: pointer;
  flex-shrink: 0;
}
.speed-btn:hover { color: var(--accent); border-color: var(--accent); }

.lang-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-muted);
  font-size: 0.7rem;
  padding: 1px 2px;
  cursor: pointer;
  flex-shrink: 0;
  appearance: none;
  -webkit-appearance: none;
  text-align: center;
}
.lang-btn:focus { outline: none; }
.lang-btn:hover { color: var(--accent); border-color: var(--accent); }
.lang-btn.lang-pending { border-color: var(--accent); color: var(--accent); }

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

.play-btn {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px var(--accent-glow);
}

.play-btn:active {
  transform: scale(0.92);
}

.waveform-right {
  flex: 1;
  min-width: 0;
}

.waveform-canvas {
  width: 100%;
  height: 48px;
  display: block;
  cursor: pointer;
}

.waveform-time {
  text-align: right;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}


.transcript-body {
  max-height: 0;
  margin-top: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.5s ease, opacity 0.3s ease, margin-top 0.5s ease;
}

.transcript-body.open {
  max-height: 500px;
  opacity: 1;
  margin-top: 10px;
  transition: max-height 0.5s ease, opacity 0.3s ease, margin-top 0.5s ease;
}

.transcript-body .recording-transcript {
  margin-top: 0;
}

.transcript-btn {
  background: transparent;
  border: none;
  color: #bbb;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
}

.transcript-btn:hover { color: var(--accent); }

.recording-transcript.hidden { display: none; }

.recording-transcript {
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text);
  margin-top: 10px;
  padding: 10px 12px;
  background: var(--bg);
  border-radius: 10px;
}

.transcript-edit {
  width: 100%;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text);
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--accent);
  border-radius: 10px;
  font-family: inherit;
  resize: none;
  overflow: hidden;
  box-sizing: border-box;
  outline: none;
}

.ts { transition: background 0.3s ease, color 0.3s ease; border-radius: 3px; padding: 1px 2px; margin: -1px -2px; }
.ts-active { background: var(--accent); color: #fff; }

.recording-transcribing {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 8px;
  animation: blink 1.5s ease-in-out infinite;
}

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

/* Recording row */

.recording-row {
  margin-bottom: 10px;
}

.recording-row .recording-card {
  margin-bottom: 12px;
}

/* Card layout: content left, icons right */

.card-layout {
  display: flex;
  gap: 8px;
}

.card-content {
  flex: 1;
  min-width: 0;
}

.card-icons {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
  padding-top: 2px;
  justify-content: flex-start;
}

.icon-btn.icon-extra-del {
  display: none !important;
  position: absolute;
  right: 14px;
}

.icon-btn.icon-extra-del.visible {
  display: flex !important;
}

.transcript-icon-slot {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.icon-btn.icon-retranscribe {
  display: none !important;
}
.icon-btn.icon-retranscribe.visible {
  display: flex !important;
}

.recording-card {
  position: relative;
}

.icon-extra.hidden, .icon-extra-del.hidden { display: none; }

.icon-btn {
  background: transparent;
  border: none;
  color: #bbb;
  padding: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
}

.icon-btn:hover { color: var(--accent); }
.icon-btn.icon-active { color: var(--accent); }
.icon-btn.icon-open {
  background: rgba(0,0,0,0.06);
  border-radius: 50%;
}
.icon-btn.icon-spin svg { animation: spin 1s linear infinite; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.icon-btn.icon-fadein { animation: iconFadeIn 0.4s ease forwards; }
@keyframes iconFadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Tag card — slide out */

.tag-card {
  max-height: 0;
  margin-top: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.5s ease, opacity 0.3s ease, margin-top 0.5s ease;
}

.tag-card.open {
  max-height: 300px;
  opacity: 1;
  margin-top: 12px;
  transition: max-height 0.5s ease, opacity 0.3s ease, margin-top 0.5s ease;
}

.tag-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.tag-chip {
  padding: 3px 8px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.1);
  background: var(--bg);
  color: var(--text-muted);
  font-size: 0.7rem;
  cursor: pointer;
}

.tag-chip.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.tag-input {
  padding: 3px 8px;
  border: 1px dashed rgba(0,0,0,0.15);
  border-radius: 12px;
  font-size: 0.7rem;
  background: transparent;
  color: var(--text);
  width: 80px;
  outline: none;
}

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

.tag-clear {
  background: none;
  border: none;
  color: #ccc;
  font-size: 1rem;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

.tag-clear:hover { color: var(--accent); }

.delete-btn {
  background: transparent;
  border: none;
  color: #bbb;
  padding: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
}

.delete-btn:hover {
  color: var(--accent);
}

/* Live recording card */

.live-card {
  border: 1px solid var(--accent);
  max-width: 460px;
}

.live-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 600;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: blink 1.2s ease-in-out infinite;
}

.live-waveform {
  width: 100%;
  height: 48px;
  display: block;
}

/* Help tab */

.help-section {
  margin-bottom: 12px;
}

.help-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

.help-text {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* --- + Button --- */

/* --- Orbit Layout --- */

.orbit-wrap {
  position: relative;
  width: 260px;
  height: 260px;
  margin: 0 auto;
}

/* Record button centered (no transform — VU meter uses transform for scale) */
.orbit-wrap .record-btn {
  position: absolute;
  top: calc(50% - 44px);
  left: calc(50% - 44px);
  z-index: 5;
}

/* 8 orbit slot buttons — + icons at clock positions, visible on hover */
.orbit-slot-btn {
  position: absolute;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1.5px dashed rgba(0,0,0,0.15);
  background: none;
  color: rgba(0,0,0,0.12);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 2;
}

.orbit-slot-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(233,69,96,0.04);
  border-style: solid;
}

/* Clock positions: center=130,130  radius=100  slot=38px (offset -19) */
.orbit-slot-btn[data-pos="0"] { top: 11px;  left: 111px; }
.orbit-slot-btn[data-pos="1"] { top: 40px;  left: 182px; }
.orbit-slot-btn[data-pos="2"] { top: 111px; left: 211px; }
.orbit-slot-btn[data-pos="3"] { top: 182px; left: 182px; }
.orbit-slot-btn[data-pos="4"] { top: 211px; left: 111px; }
.orbit-slot-btn[data-pos="5"] { top: 182px; left: 40px; }
.orbit-slot-btn[data-pos="6"] { top: 111px; left: 11px; }
.orbit-slot-btn[data-pos="7"] { top: 40px;  left: 40px; }

/* Orbit peer (filled slot) */
.orbit-peer {
  position: absolute;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  background: var(--surface);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 3;
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.orbit-peer:hover {
  background: var(--accent);
  color: white;
  box-shadow: 0 2px 12px var(--accent-glow);
}

/* No wobble — peer stays calm, only minus button appears */

/* Minus button on extended line */
.orbit-minus-btn {
  position: absolute;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1.5px dashed var(--accent);
  background: var(--surface);
  color: var(--accent);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 4;
  transition: all 0.15s;
  animation: fadeInMinus 0.2s ease;
}

.orbit-minus-btn:hover {
  background: var(--accent);
  color: white;
  border-style: solid;
}

@keyframes fadeInMinus {
  from { opacity: 0; transform: scale(0.5); }
  to { opacity: 1; transform: scale(1); }
}

/* Extended delete line */
.orbit-delete-line {
  stroke: var(--accent);
  stroke-width: 1;
  stroke-dasharray: 4 3;
  opacity: 0.4;
}

.orbit-peer-active {
  background: var(--accent);
  color: white;
  box-shadow: 0 2px 12px var(--accent-glow);
}

.orbit-peer .orbit-peer-label {
  position: absolute;
  bottom: -14px;
  font-size: 0.5rem;
  color: var(--text-muted);
  white-space: nowrap;
  text-align: center;
  width: 60px;
  left: 50%;
  transform: translateX(-50%);
}

/* Connection lines (SVG drawn by JS) */
.orbit-lines {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.orbit-lines line {
  stroke: var(--accent);
  stroke-width: 1;
  opacity: 0.2;
}

/* Occupied slots are hidden */
.orbit-slot-btn.occupied {
  display: none;
}

/* Add menu (appears below orbit) */
.orbit-add-menu {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
}

.orbit-add-menu.hidden { display: none; }

.orbit-add-option {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border: 1.5px solid var(--accent);
  border-radius: 20px;
  background: var(--surface);
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.orbit-add-option:hover {
  background: var(--accent);
  color: white;
}

/* Orbit panels (topic picker, invite form) */
.orbit-panel {
  margin-top: 12px;
  text-align: center;
}

.orbit-panel.hidden { display: none; }

.topic-prompt {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

/* Invite form */
.invite-input {
  width: 100%;
  max-width: 200px;
  padding: 6px 10px;
  margin-bottom: 6px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.75rem;
  outline: none;
}

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

.invite-btn {
  padding: 6px 14px;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

.invite-msg { font-size: 0.7rem; color: var(--accent); margin-top: 4px; }
.invite-msg.hidden { display: none; }

.topic-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}

.topic-chip {
  padding: 5px 10px;
  border: 1.5px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.7rem;
  cursor: pointer;
  transition: opacity 0.3s ease, transform 0.3s ease, background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.topic-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.topic-chip.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}


/* --- Modals --- */

.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.modal-overlay.hidden { display: none; }

.modal-card {
  background: var(--surface);
  border-radius: 18px;
  padding: 28px 24px;
  max-width: 340px;
  width: 100%;
  position: relative;
  box-shadow: 0 8px 40px rgba(0,0,0,0.15);
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 16px;
  text-align: center;
  color: var(--text);
}

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

.modal-btn {
  width: 100%;
  padding: 14px 16px;
  margin-bottom: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.modal-btn-primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 14px;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
}

/* --- Style Picker --- */

.style-option {
  width: 100%;
  padding: 14px 16px;
  margin-bottom: 8px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  cursor: pointer;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 14px;
}

.style-option:hover {
  border-color: var(--accent);
  background: rgba(233, 69, 96, 0.03);
}

.style-option:active {
  transform: scale(0.98);
}

.style-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.style-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.style-label {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
}

.style-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* --- Interview Mode --- */

.iv-section {
  width: 100%;
  padding: 0 8px;
}

.iv-section.hidden { display: none; }

.interview-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px 8px;
  border-bottom: 1px solid var(--border);
  margin-top: 4px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.interview-header .interview-end-btn {
  margin-left: auto;
  flex-shrink: 0;
}

.iv-more-btn {
  padding: 3px 6px;
  border-radius: 10px;
  border: 1.5px dashed var(--text-muted);
  background: none;
  color: var(--text-muted);
  font-size: 0.6rem;
  cursor: pointer;
  transition: all 0.15s;
}

.iv-more-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}


.iv-tag-filter {
  padding: 3px 8px;
  border-radius: 10px;
  border: 1.5px solid var(--accent);
  background: none;
  color: var(--accent);
  font-size: 0.65rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.iv-tag-filter.active {
  background: var(--accent);
  color: white;
}

.interview-style-badge {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}

.interview-end-btn {
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.7rem;
  cursor: pointer;
  margin-left: 0;
}

.interview-end-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.interview-chat {
  display: flex;
  flex-direction: column;
  width: 100%;
  align-self: stretch;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 16px;
  max-width: 480px;
  margin-left: 0;
  margin-right: auto;
  max-height: calc(100dvh - 340px);
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
}

/* KI bubble (left-aligned, tail bottom-left) — used for error/info messages in chat */
.ki-bubble {
  width: 90%;
  min-width: 90%;
  max-width: 90%;
  margin-right: auto;
  padding: 12px 14px;
  margin-bottom: 18px;
  background: var(--surface);
  border-radius: 16px 16px 16px 4px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text);
  box-sizing: border-box;
  position: relative;
}

.ki-bubble::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 12px;
  width: 12px;
  height: 12px;
  background: var(--surface);
  clip-path: polygon(0 0, 100% 0, 0 100%);
}

.ki-bubble-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.ki-label {
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.ki-voice-select {
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  -webkit-appearance: none;
  appearance: none;
}

.ki-play-btn {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  padding: 2px 4px;
  opacity: 0.6;
  transition: opacity 0.15s;
}

.ki-play-btn:hover,
.ki-play-btn:active {
  opacity: 1;
}

.ki-bubble-text {
  line-height: 1.5;
}

.ki-bubble .chapter-badge {
  display: inline-block;
  margin-top: 8px;
  padding: 2px 8px;
  background: rgba(233, 69, 96, 0.06);
  border-radius: 6px;
  font-size: 0.7rem;
  color: var(--accent);
}

/* User bubble (right-aligned, tail bottom-right) */
.user-bubble {
  width: 90%;
  margin-left: auto;
  padding: 12px 14px;
  margin-bottom: 18px;
  background: var(--accent);
  color: white;
  border-radius: 16px 16px 4px 16px;
  font-size: 0.85rem;
  line-height: 1.5;
  box-sizing: border-box;
  position: relative;
}

.user-bubble::after {
  content: '';
  position: absolute;
  bottom: -6px;
  right: 12px;
  width: 12px;
  height: 12px;
  background: var(--accent);
  clip-path: polygon(100% 0, 0 0, 100% 100%);
}

/* Accept / Redo buttons inside user bubble */
.iv-actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
  justify-content: flex-end;
}

.iv-action-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s;
}

.iv-action-btn:active {
  transform: scale(0.9);
}

.iv-accept {
  background: rgba(255,255,255,0.3);
  color: white;
}

.iv-accept:hover {
  background: rgba(255,255,255,0.5);
}

.iv-redo {
  background: rgba(0,0,0,0.15);
  color: rgba(255,255,255,0.8);
}

.iv-redo:hover {
  background: rgba(0,0,0,0.25);
}

.user-bubble-pending {
  background: rgba(233, 69, 96, 0.1);
  color: var(--text-muted);
  font-style: italic;
}

/* Completed interview turn — compact recording row */
.iv-completed-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 6px;
  background: var(--surface);
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.iv-row-play {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.15s;
}

.iv-row-play:active { transform: scale(0.9); }

.iv-row-title {
  flex: 1;
  font-size: 0.8rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.iv-row-tag {
  font-size: 0.6rem;
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

/* KI typing indicator */
.ki-typing {
  max-width: 80px;
  padding: 14px 18px;
  margin-bottom: 14px;
  background: var(--surface);
  border-radius: 16px 16px 16px 4px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.ki-typing .dots {
  display: flex;
  gap: 5px;
}

.ki-typing .dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: typingDot 1.2s ease-in-out infinite;
}

.ki-typing .dots span:nth-child(2) { animation-delay: 0.2s; }
.ki-typing .dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingDot {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-4px); }
}

.iv-auto-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 4px;
  animation: fadeInHint 0.5s ease;
}

.iv-auto-hint.hidden { display: none; }

@keyframes fadeInHint {
  from { opacity: 0; }
  to { opacity: 1; }
}

.recordings.iv-hidden { display: none; }

/* --- Dual-wrap: both full card and mini row rendered, CSS toggles visibility --- */

.rec-dual-wrap {
  overflow: hidden;
  margin-bottom: 4px;
  max-width: 460px;
  background: var(--surface);
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.rec-dual-wrap .rec-full {
  transition: max-height 0.4s ease, opacity 0.3s ease, padding 0.3s ease;
  max-height: 500px; /* large enough for any card */
  opacity: 1;
  overflow: hidden;
}

.rec-dual-wrap .rec-full .recording-card {
  margin-bottom: 0;
  box-shadow: none;
  border-radius: 0;
  max-width: none;
}

.rec-dual-wrap .rec-mini-view {
  transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  padding: 0 16px;
  cursor: pointer;
}

.rec-dual-wrap .rec-mini-view:hover {
  background: rgba(0,0,0,0.02);
}

/* Mini mode: swap visibility */
.recordings.recordings-mini .rec-dual-wrap .rec-full {
  max-height: 0;
  opacity: 0;
  padding: 0;
}

.recordings.recordings-mini .rec-dual-wrap .rec-mini-view {
  max-height: 50px;
  opacity: 1;
  padding: 8px 16px;
}

/* Individual expand in mini mode: show full card for this specific wrap */
.recordings.recordings-mini .rec-dual-wrap.rec-expanded .rec-full {
  max-height: 500px;
  opacity: 1;
  padding: 0;
}

.recordings.recordings-mini .rec-dual-wrap.rec-expanded .rec-mini-view {
  max-height: 0;
  opacity: 0;
  padding: 0;
}

/* Close bar: separate framed box ABOVE the card */
.rec-card-close-bar {
  display: none;
  justify-content: flex-end;
  align-items: center;
  padding: 5px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 4px;
}

.recordings.recordings-mini .rec-dual-wrap.rec-expanded .rec-card-close-bar {
  display: flex;
}

.rec-card-collapse {
  width: 20px;
  height: 20px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s;
}

.rec-card-collapse:hover {
  color: var(--accent);
}

/* Red bar: accent close-bar after accepting a recording */
.rec-card-close-bar.rec-bar-red {
  background: var(--accent);
  border-color: var(--accent);
  border-radius: 10px;
  width: 90%;
  margin-left: auto;
  animation: redBarSlideIn 0.4s ease;
}

.rec-card-close-bar.rec-bar-red .rec-card-collapse {
  color: white;
}

.rec-card-close-bar.rec-bar-red .rec-card-collapse:hover {
  color: rgba(255,255,255,0.7);
}

@keyframes redBarSlideIn {
  from { transform: translateY(-20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Stagger animation delays */
.rec-dual-wrap:nth-child(2) .rec-full, .rec-dual-wrap:nth-child(2) .rec-mini-view { transition-delay: 0.03s; }
.rec-dual-wrap:nth-child(3) .rec-full, .rec-dual-wrap:nth-child(3) .rec-mini-view { transition-delay: 0.06s; }
.rec-dual-wrap:nth-child(4) .rec-full, .rec-dual-wrap:nth-child(4) .rec-mini-view { transition-delay: 0.09s; }
.rec-dual-wrap:nth-child(5) .rec-full, .rec-dual-wrap:nth-child(5) .rec-mini-view { transition-delay: 0.12s; }
.rec-dual-wrap:nth-child(6) .rec-full, .rec-dual-wrap:nth-child(6) .rec-mini-view { transition-delay: 0.15s; }
.rec-dual-wrap:nth-child(7) .rec-full, .rec-dual-wrap:nth-child(7) .rec-mini-view { transition-delay: 0.18s; }
.rec-dual-wrap:nth-child(8) .rec-full, .rec-dual-wrap:nth-child(8) .rec-mini-view { transition-delay: 0.21s; }
.rec-dual-wrap:nth-child(9) .rec-full, .rec-dual-wrap:nth-child(9) .rec-mini-view { transition-delay: 0.24s; }
.rec-dual-wrap:nth-child(10) .rec-full, .rec-dual-wrap:nth-child(10) .rec-mini-view { transition-delay: 0.27s; }
.rec-dual-wrap:nth-child(11) .rec-full, .rec-dual-wrap:nth-child(11) .rec-mini-view { transition-delay: 0.3s; }

/* --- Mini row styles --- */
.rec-mini-play {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: white;
  cursor: pointer;
  display: flex;
  order: 1;
  margin-right: 8px;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.15s;
}
.rec-mini-play:active { transform: scale(0.9); }

.rec-mini-title {
  flex: 1;
  font-size: 0.8rem;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  order: 2;
}

.rec-mini-view .title-edit {
  flex: 1;
  font-size: 0.8rem;
  padding: 0;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  order: 2;
}

.rec-mini-expand {
  width: 22px;
  height: 22px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.2s;
  order: 3;
}
.rec-mini-expand:hover { color: var(--text); }

.rec-dual-wrap.rec-expanded .rec-mini-expand { transform: rotate(180deg); }

.rec-mini-more {
  display: block;
  width: 100%;
  padding: 10px;
  margin-top: 6px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s;
  max-width: 460px;
}
.rec-mini-more:hover { background: var(--accent); color: white; }

/* Recordings mini mode padding */
.recordings.recordings-mini {
  padding-bottom: 16px;
}

/* --- Waveform Card (pending answer, replaces text bubble) --- */
.iv-waveform-card {
  max-width: 70%;
  margin-left: auto;
  padding: 12px 14px;
  margin-bottom: 18px;
  background: var(--accent);
  color: white;
  border-radius: 16px 16px 4px 16px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.iv-waveform-card::after {
  content: '';
  position: absolute;
  bottom: -6px;
  right: 12px;
  width: 12px;
  height: 12px;
  background: var(--accent);
  clip-path: polygon(100% 0, 0 0, 100% 100%);
}

.iv-waveform-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.iv-waveform-play {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.25);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}

.iv-waveform-play:hover { background: rgba(255,255,255,0.4); }
.iv-waveform-play:active { transform: scale(0.9); }

.iv-waveform-dur {
  font-size: 0.75rem;
  opacity: 0.8;
  font-variant-numeric: tabular-nums;
}

.iv-waveform-vis {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 2px;
  height: 24px;
}

.iv-waveform-vis span {
  flex: 1;
  background: rgba(255,255,255,0.5);
  border-radius: 2px;
  min-width: 2px;
}

.iv-waveform-actions {
  display: flex;
  gap: 10px;
}

/* Animate card sliding down into recordings-mini */
@keyframes ivCardSlideDown {
  0% { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(40px); opacity: 0; }
}

.iv-waveform-card.slide-down {
  animation: ivCardSlideDown 0.4s ease forwards;
}

/* Recordings expand/collapse transition */
.recordings {
  transition: max-height 0.4s ease, padding 0.4s ease;
}

.menu-setting-hint {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.voice-btns {
  flex-wrap: wrap;
}


/* --- Shared Question Card (reused for KI, Katalog, Interview, Freund) --- */

.question-card-wrap {
  display: none;
  width: 100%;
  max-width: 480px;
  align-self: stretch;
  padding: 0 16px 8px;
  margin-left: 0;
  margin-right: auto;
}

.question-card-wrap.visible {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.question-card {
  display: block;
  width: 90%;
  min-width: 90%;
  max-width: 90%;
  margin-right: auto;
  box-sizing: border-box;
  background: var(--surface);
  border-radius: 16px 16px 16px 4px;
  padding: 12px 14px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  position: relative;
  margin-bottom: 6px;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text);
}

/* Tail */
.question-card::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 12px;
  width: 12px;
  height: 12px;
  background: var(--surface);
  clip-path: polygon(0 0, 100% 0, 0 100%);
}

.question-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.question-card-text {
  line-height: 1.5;
}

.question-card .chapter-badge {
  display: inline-block;
  margin-top: 8px;
  padding: 2px 8px;
  background: rgba(233, 69, 96, 0.06);
  border-radius: 6px;
  font-size: 0.7rem;
  color: var(--accent);
}

/* Arrows: below card, left-aligned */
.question-card-nav {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  justify-content: flex-start;
  position: relative;
}

.question-card-nav.hidden {
  display: none;
}

/* Arrow collision animation: both slide to center, shrink, disappear */
.question-card-nav.colliding #qCardPrev {
  animation: arrowCollideLeft 0.4s ease forwards;
}
.question-card-nav.colliding #qCardNext {
  animation: arrowCollideRight 0.4s ease forwards;
}

@keyframes arrowCollideLeft {
  0% { transform: translateX(0) scale(1); opacity: 1; }
  70% { transform: translateX(18px) scale(1); opacity: 1; }
  100% { transform: translateX(18px) scale(0); opacity: 0; }
}

@keyframes arrowCollideRight {
  0% { transform: translateX(0) scale(1); opacity: 1; }
  70% { transform: translateX(-18px) scale(1); opacity: 1; }
  100% { transform: translateX(-18px) scale(0); opacity: 0; }
}

/* Nav closing gap after arrows disappear */
.question-card-nav.collapsed {
  gap: 0;
  margin-top: 0;
  max-height: 0;
  overflow: hidden;
  transition: all 0.3s ease;
}

/* Arrows rebuilding from center outward */
@keyframes arrowBuildLeft {
  0% { transform: translateX(18px) scale(0); opacity: 0; }
  30% { transform: translateX(18px) scale(1); opacity: 1; }
  100% { transform: translateX(0) scale(1); opacity: 1; }
}

@keyframes arrowBuildRight {
  0% { transform: translateX(-18px) scale(0); opacity: 0; }
  30% { transform: translateX(-18px) scale(1); opacity: 1; }
  100% { transform: translateX(0) scale(1); opacity: 1; }
}

.catalog-arrow {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s;
}

.catalog-arrow:hover { border-color: var(--accent); color: var(--accent); }
.catalog-arrow:active { transform: scale(0.9); }

/* --- Live Recording Speech Card (interview/catalog) --- */
.iv-rec-card {
  width: 90%;
  margin-left: auto;
  box-sizing: border-box;
  background: var(--accent);
  color: white;
  border-radius: 16px 16px 4px 16px;
  padding: 12px 14px;
  margin-bottom: 18px;
  position: relative;
}

.iv-rec-card::after {
  content: '';
  position: absolute;
  bottom: -6px;
  right: 12px;
  width: 12px;
  height: 12px;
  background: var(--accent);
  clip-path: polygon(100% 0, 0 0, 100% 100%);
}

.iv-rec-top {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}

.iv-rec-stop {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid white;
  background: transparent;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.7rem;
  transition: background 0.15s;
}

.iv-rec-stop:hover {
  background: rgba(255,255,255,0.15);
}

.iv-rec-stop:active {
  transform: scale(0.9);
}

.iv-rec-wave {
  flex: 1;
  height: 32px;
  display: block;
}

.iv-rec-time {
  font-size: 0.75rem;
  font-weight: 600;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.iv-rec-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 10px;
  transition: opacity 0.4s ease;
}

.iv-rec-actions.hidden {
  opacity: 0;
  pointer-events: none;
}

.iv-rec-card.slide-down {
  animation: ivCardSlideDown 0.4s ease forwards;
}

