/* Voice Documentation — floating FAB, recording sheet, library */

.voice-fab {
  position: fixed;
  right: 22px; bottom: 22px;
  z-index: 40;
  display: inline-flex; align-items: center; gap: 10px;
  height: 48px; padding: 0 18px 0 14px;
  border: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: var(--accent-fg);
  border-radius: 999px;
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 24px oklch(0% 0 0 / 0.22), 0 2px 4px oklch(0% 0 0 / 0.12), inset 0 1px 0 oklch(100% 0 0 / 0.2);
  position: fixed;
}
.voice-fab:hover { transform: translateY(-1px); }
.voice-fab .mic-glow {
  position: absolute; inset: -4px;
  border-radius: inherit;
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
  opacity: 0.3;
  animation: voicepulse 2s ease-in-out infinite;
  pointer-events: none; z-index: -1;
}
@keyframes voicepulse {
  0%, 100% { opacity: 0.25; transform: scale(1); }
  50%      { opacity: 0.45; transform: scale(1.15); }
}
.voice-fab .label { letter-spacing: 0.01em; }
.voice-fab .shortcut {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 6px;
  background: oklch(0% 0 0 / 0.18);
  border-radius: 4px;
  border: 1px solid oklch(100% 0 0 / 0.18);
}

.voice-backdrop {
  position: fixed; inset: 0;
  background: oklch(0% 0 0 / 0.48);
  backdrop-filter: blur(6px);
  z-index: 50;
  display: grid; place-items: center;
  padding: 20px;
  animation: fadein 0.18s ease-out;
}
@keyframes fadein { from { opacity: 0 } to { opacity: 1 } }

.voice-sheet {
  width: min(820px, 100%);
  max-height: 90vh;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 30px 80px oklch(0% 0 0 / 0.4);
  overflow: hidden;
  display: flex; flex-direction: column;
  animation: slideup 0.22s cubic-bezier(.2,.8,.2,1);
}
@keyframes slideup { from { transform: translateY(16px); opacity: 0 } to { transform: translateY(0); opacity: 1 } }

.voice-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, var(--bg-sunken), var(--bg));
}
.voice-head .ttl { font-size: 15px; font-weight: 600; }
.voice-head .sub { font-size: 11px; color: var(--fg-muted); }
.voice-brand {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: var(--accent-fg);
  display: grid; place-items: center;
  box-shadow: 0 2px 6px oklch(0% 0 0 / 0.12);
}
.voice-close {
  width: 28px; height: 28px; border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-raised);
  cursor: pointer; color: var(--fg-muted);
  display: grid; place-items: center;
}

.voice-meta {
  padding: 14px 20px;
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 14px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-sunken);
}
.voice-meta .field label {
  display: block;
  font-size: 11px; color: var(--fg-muted); text-transform: uppercase; letter-spacing: 0.06em;
  margin-bottom: 6px; font-weight: 600;
}
.voice-meta .seg {
  display: flex; gap: 4px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px;
}
.voice-meta .seg button {
  flex-shrink: 0;
  height: 24px; padding: 0 8px;
  background: transparent; border: 0;
  border-radius: 4px;
  font-size: 11px; font-weight: 500; color: var(--fg-muted);
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 4px;
}
.voice-meta .seg button.active { background: var(--accent); color: var(--accent-fg); }
.voice-meta .seg button:hover:not(.active) { background: var(--bg-hover); color: var(--fg); }

.voice-stage {
  padding: 24px 20px 20px;
  min-height: 340px;
  overflow: auto;
}

/* Ready */
.voice-ready { text-align: center; padding: 24px 0; }
.mic-big {
  width: 112px; height: 112px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, var(--accent-tint), var(--bg-raised));
  border: 2px solid var(--accent-border);
  color: var(--accent);
  display: grid; place-items: center;
  cursor: pointer;
  position: relative;
  transition: transform 0.15s;
}
.mic-big:hover { transform: scale(1.05); border-color: var(--accent); }
.mic-big::before {
  content: ""; position: absolute; inset: -8px;
  border: 1px solid var(--accent-border);
  border-radius: 50%;
  animation: pulsering 2.4s ease-out infinite;
}
@keyframes pulsering {
  0%   { transform: scale(0.9); opacity: 0.8; }
  100% { transform: scale(1.3); opacity: 0; }
}
.voice-ready .hint { font-size: 13px; color: var(--fg-muted); margin-bottom: 22px; }
.voice-ready .tips { display: grid; gap: 8px; max-width: 440px; margin: 0 auto; text-align: left; }
.voice-ready .tip {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 12px; color: var(--fg-muted);
}
.voice-ready .tip svg { color: var(--accent); flex-shrink: 0; }

/* Recording */
.voice-record { }
.rec-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 18px;
}
.rec-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--danger);
  animation: blink 1.3s ease-in-out infinite;
  box-shadow: 0 0 0 4px var(--danger-tint);
}
@keyframes blink { 0%, 100% { opacity: 1 } 50% { opacity: 0.35 } }
.rec-label { font-size: 13px; font-weight: 500; color: var(--danger); }
.rec-time {
  margin-left: auto;
  font-size: 22px; font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.rec-template {
  padding: 3px 8px;
  background: var(--accent-tint);
  border: 1px solid var(--accent-border);
  color: var(--accent);
  border-radius: 999px;
  font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.05em;
}

.wave {
  display: flex; align-items: center; gap: 2px;
  height: 88px; padding: 0 4px;
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 16px;
}
.wave .bar {
  flex: 1;
  background: linear-gradient(180deg, var(--accent), var(--accent-hover));
  border-radius: 2px;
  transition: height 0.12s ease-out;
  min-height: 8%;
}

.live-transcript {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 18px;
  max-height: 120px;
  overflow: auto;
}
.lt-label {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--fg-subtle); font-weight: 600;
  margin-bottom: 6px;
}
.lt-text {
  font-size: 13px; line-height: 1.55; color: var(--fg);
  font-family: var(--font-mono);
}
.caret {
  display: inline-block; width: 2px; height: 1em;
  background: var(--accent); margin-left: 2px; vertical-align: text-bottom;
  animation: blink 0.9s steps(2) infinite;
}

.rec-ctrl {
  display: flex; gap: 8px; justify-content: center;
}
.c-btn {
  height: 36px; padding: 0 14px;
  border: 1px solid var(--border-strong);
  background: var(--bg-raised);
  color: var(--fg);
  border-radius: 6px;
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
}
.c-btn:hover { background: var(--bg-hover); }
.c-btn.primary { background: var(--accent); color: var(--accent-fg); border-color: transparent; }
.c-btn.primary:hover { background: var(--accent-hover); }

/* Processing */
.voice-processing { text-align: center; padding: 20px 0; }
.proc-ring {
  width: 88px; height: 88px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, var(--accent), var(--accent-tint), var(--accent));
  color: var(--accent-fg);
  display: grid; place-items: center;
  animation: spin 1.6s linear infinite;
  position: relative;
}
.proc-ring::after {
  content: ""; position: absolute; inset: 6px;
  background: var(--bg); border-radius: 50%;
}
.proc-ring svg { position: relative; z-index: 1; color: var(--accent); }
@keyframes spin { to { transform: rotate(360deg); } }
.proc-title { font-size: 15px; font-weight: 600; margin-bottom: 16px; }
.proc-steps {
  list-style: none; padding: 0; margin: 0 auto;
  max-width: 420px;
  display: grid; gap: 8px;
  text-align: left;
}
.proc-steps li {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px; color: var(--fg-muted);
}
.proc-steps li.done { color: var(--fg); }
.proc-steps li.done svg { color: var(--success); }
.proc-steps li.active { border-color: var(--accent-border); background: var(--accent-tint); color: var(--fg); }
.proc-steps li .pulse {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent);
  animation: blink 1s ease-in-out infinite;
}

/* Draft */
.voice-draft { }
.draft-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 14px;
  gap: 16px;
}
.draft-head .ttl { font-size: 15px; font-weight: 600; margin-top: 4px; }

.soap {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-raised);
}
.soap-row {
  display: grid; grid-template-columns: 44px 1fr;
  border-bottom: 1px solid var(--border);
}
.soap-row:last-child { border-bottom: 0; }
.soap-key {
  background: var(--accent-tint);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 14px; font-weight: 700;
  display: grid; place-items: center;
  border-right: 1px solid var(--border);
}
.soap-val { padding: 10px 14px; }
.soap-lbl {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--fg-subtle); font-weight: 600; margin-bottom: 3px;
}
.soap-txt { font-size: 13px; line-height: 1.55; color: var(--fg); }

.draft-flags {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: 14px;
}
.flag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 11px; font-weight: 500;
  border: 1px solid var(--border);
  background: var(--bg-raised);
  color: var(--fg-muted);
}
.flag.tone-accent { background: var(--accent-tint); color: var(--accent); border-color: var(--accent-border); }
.flag.tone-warn { background: var(--warning-tint); color: var(--warning); border-color: var(--warning-border); }
.flag.tone-good { background: var(--success-tint); color: var(--success); border-color: var(--success-border); }
.flag.tone-info { background: var(--bg-sunken); }
.flag .flag-link { color: var(--fg-subtle); font-weight: 400; margin-left: 3px; }

.draft-actions {
  margin-top: 14px;
  padding: 12px 14px;
  background: var(--bg-sunken);
  border: 1px dashed var(--border-strong);
  border-radius: 8px;
}
.da-label {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--fg-subtle); font-weight: 600; margin-bottom: 8px;
}
.da-label svg { color: var(--accent); }
.da-row {
  display: flex; align-items: center; gap: 10px;
  font-size: 12px; color: var(--fg);
  padding: 4px 0;
}

.draft-ctrl {
  display: flex; gap: 8px; justify-content: flex-end;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

/* Saved */
.voice-saved { text-align: center; padding: 40px 0; }
.saved-ring {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: var(--success-tint);
  color: var(--success);
  display: grid; place-items: center;
  margin: 0 auto 14px;
  animation: popin 0.4s cubic-bezier(.2,1.4,.3,1);
}
@keyframes popin { from { transform: scale(0.5); opacity: 0 } to { transform: scale(1); opacity: 1 } }
.saved-title { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.saved-sub { font-size: 12px; color: var(--fg-muted); }

/* Library */
.voice-list-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.voice-list-item:hover { background: var(--bg-hover); }
.voice-list-item.active { background: var(--accent-tint); border-left: 3px solid var(--accent); padding-left: 13px; }
.vli-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 4px;
}
.vli-tpl {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--fg-muted);
}
.vli-time {
  font-size: 11px; color: var(--fg-subtle);
  padding: 1px 6px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 3px;
}
.vli-bew { font-size: 13px; font-weight: 500; margin-bottom: 4px; }
.vli-excerpt {
  font-size: 11.5px; color: var(--fg-muted); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 6px;
}
.vli-foot {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--fg-muted);
}

.audio-player {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.ap-play {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--accent); color: var(--accent-fg);
  border: 0; display: grid; place-items: center; cursor: pointer;
  box-shadow: 0 2px 4px oklch(0% 0 0 / 0.12);
}
.ap-wave {
  flex: 1;
  display: flex; align-items: center; gap: 1.5px;
  height: 32px;
}
.ap-bar {
  flex: 1; background: var(--accent); border-radius: 1px;
  min-height: 10%;
}
