/* Voice companion (voice.js), rendered inline in the Voice section. Tokens from theme.css. */

.voice-bar { display: flex; gap: 0; border: 1px solid var(--rule); background: var(--paper-2); width: fit-content; }
.voice-bar .ghost { border: 0; border-right: 1px solid var(--rule); }
.voice-bar .ghost:last-child { border-right: 0; }
.voice-bar [aria-pressed="true"], .voice-talk[aria-pressed="true"] {
  color: var(--accent); box-shadow: inset 0 -2px 0 var(--accent); background: var(--paper-3);
}
.voice-talk { display: inline-flex; align-items: center; gap: 8px; touch-action: none; user-select: none; }
.voice-talk::before { content: ""; width: 7px; height: 7px; transform: rotate(45deg); background: var(--rule-strong); flex: none; }
.voice-talk[aria-pressed="true"]::before { background: var(--accent); animation: voice-pulse 1s var(--ease-in-out) infinite; }
@keyframes voice-pulse { 50% { opacity: 0.35; } }
body.voice-speaking .voice-dock { border-color: var(--accent); }

.voice-dock { background: var(--paper-2); border: 1px solid var(--rule); padding: 14px 16px; display: grid; gap: 8px; }
.voice-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.voice-head .kicker { margin: 0; }
.voice-links { display: flex; gap: 14px; }
.voice-head .link[aria-pressed="true"] { color: var(--accent); text-decoration-color: var(--accent); }
#voice-status { color: var(--accent); margin-left: 8px; }
.voice-log { list-style: none; margin: 0; padding: 0; max-height: 180px; overflow-y: auto; display: grid; gap: 6px; font-size: 13px; line-height: 1.45; }
.voice-log:empty::before { content: "Captions appear here. Press Talk, or type below."; color: var(--faint); font: 12px var(--mono); }
.cap strong { font: 500 10.5px/1.9 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-right: 8px; }
.cap-you strong { color: var(--ink); }
.cap-safety strong, .cap-evidence strong, .cap-simulation strong, .cap-consent strong, .cap-assistant strong { color: var(--accent); }
.cap-notice span { color: var(--muted); }
.voice-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.voice-meta { margin: 0; font: 11px/1.4 var(--mono); color: var(--faint); min-height: 1.4em; font-variant-numeric: tabular-nums; }

.voice-consent {
  width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow: auto; padding: 22px;
  background: var(--paper-2); color: var(--ink); border: 1px solid var(--rule-strong); border-radius: 0;
}
.voice-consent::backdrop { background: color-mix(in oklch, oklch(0% 0 0) 62%, transparent); }
.voice-consent h2 { margin: 0 0 8px; font: 700 22px/1.15 var(--display); letter-spacing: -0.02em; }
.voice-privacy { margin: 0 0 14px; color: var(--muted); font-size: 13px; border-left: 2px solid var(--accent); padding-left: 10px; }
.consent-script { margin: 0 0 12px; font-size: 16px; line-height: 1.6; }
.consent-script:empty { display: none; }
.voice-consent .voice-talk { width: 100%; justify-content: center; padding: 12px; margin-bottom: 8px; font-size: 15px; }
.voice-consent .field { margin-bottom: 14px; }
.consent-heard { margin: 0 0 4px; font: 13px var(--mono); color: var(--ink); }
.consent-status { margin: 0 0 12px; color: var(--muted); font-size: 14px; }
.consent-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 14px; }
.consent-foot form { margin: 0; }

/* Public dossier narration (narration.js): Voice section and Research services. */
.voice-narration { background: var(--paper-2); border: 1px solid var(--rule); padding: 14px 16px; display: grid; gap: 8px; margin-top: 16px; }
.voice-narration .field { max-width: 500px; }
.narration { display: grid; gap: 8px; max-width: 75ch; }
.narration h2, .narration h3 { margin: 0; font: 700 18px/1.25 var(--display); }
.narration-label { margin: 0; color: var(--muted); font-size: 13.5px; border-left: 2px solid var(--rule-strong); padding-left: 10px; }
.narration > button { justify-self: start; min-height: 44px; }
.narration audio { width: 100%; max-width: 560px; margin: 4px 0; }
.narration-kicker { margin: 8px 0 0; font: 500 10.5px/1.6 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.narration-transcript { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; }
.narration-sources { margin: 0; padding-left: 18px; }
.narration-sources a { color: var(--accent); overflow-wrap: anywhere; }
.narration-result .receipt dd { font-variant-numeric: tabular-nums; }
