/* Full speak mode: the same terminal, with only TBot's eyes on the stage. */
.mode-bar { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 24px; border-top: 1px solid var(--accent-faint); font-size: 12px; background: var(--bg-window); }
.mode-label { color: var(--grey); }
.mode-switch { display: inline-flex; align-items: center; gap: 10px; background: none; border: 0; color: var(--text); font: inherit; cursor: pointer; min-height: 30px; }
.switch-track { width: 34px; height: 20px; border: 1px solid var(--grey); border-radius: 20px; display: inline-flex; align-items: center; padding: 3px; transition: background .2s; }
.switch-track::after { content: ''; width: 12px; height: 12px; border-radius: 50%; background: var(--grey); transition: transform .2s; }
.mode-switch[aria-checked=true] .switch-track { background: var(--accent); border-color: var(--accent); }
.mode-switch[aria-checked=true] .switch-track::after { transform: translateX(13px); background: var(--bg-window); }
.voice-surface { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; padding: 18px 28px 24px; }
.speak-mode .window { height: min(760px, calc(100dvh - 48px)); }
.voice-topline { display: flex; align-items: center; justify-content: space-between; gap: 16px; color: var(--grey); font-size: 11px; }
.voice-status { display: inline-flex; align-items: center; gap: 7px; }
.voice-status::before { content: ''; height: 5px; width: 5px; background: var(--grey); border-radius: 50%; }
.voice-surface[data-state=listening] .voice-status::before { background: #7eddaf; }
.voice-surface[data-state=speaking] .voice-status::before { background: var(--accent); }
.eyes-stage { display: grid; place-items: center; flex: 1 0 300px; min-height: 300px; position: relative; }
/* Geometry follows the supplied 800px reference: 191px outer rings,
   236px between centers, and a 19px stroke on a pure black square. */
.tbot-eyes { display: block; width: 280px; height: 280px; flex-shrink: 0; border: 1px solid color-mix(in srgb, var(--text) 25%, var(--bg-window)); background: #000; }
.tbot-eye { fill: #f5f7f9; }
.tbot-pupils { fill: #000; animation: tbot-look 24s ease-in-out infinite; }
/* The outer eyes never move or change shape. A blink is a hard 100ms cut
   to black, once every 5 seconds — no squash, fade, or scaling. */
.tbot-pair { animation: tbot-blink 5s step-end infinite; }
@keyframes tbot-blink {
  0%, 100% { opacity: 1; }
  98% { opacity: 0; }
}
/* Move the black centers beyond the 19px white rim to create open crescents.
   The white outer circles remain fixed, with neutral rests between glances. */
@keyframes tbot-look {
  0%, 10%, 20.5%, 35%, 45.5%, 60%, 70.5%, 85%, 95.5%, 100% { transform: translate(0, 0); }
  10.5%, 20% { transform: translate(-32px, 0); }
  35.5%, 45% { transform: translate(32px, 0); }
  60.5%, 70% { transform: translate(0, -32px); }
  85.5%, 95% { transform: translate(0, 32px); }
}
.voice-caption { min-height: 44px; font-size: 13px; text-align: center; max-width: 600px; margin: 0 auto 12px; color: var(--text); }
.voice-notice { font-size: 11px; color: var(--grey); text-align: center; margin: 12px auto 0; max-width: 530px; }
.voice-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; }
.voice-controls button, .topic-buttons button, .voice-question button, .context-close { font: inherit; border: 1px solid var(--accent-faint); border-radius: 5px; cursor: pointer; color: var(--text); background: transparent; padding: 10px 15px; min-height: 42px; }
.voice-controls .voice-primary { color: var(--bg-window); background: var(--accent); border-color: var(--accent); }
.voice-controls button:disabled, .voice-question button:disabled { opacity: .5; cursor: wait; }
.voice-controls button:hover, .topic-buttons button:hover { border-color: var(--grey); }
.voice-controls button[aria-pressed=true] { border-color: var(--accent); }
.topic-buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 16px; }
.topic-buttons button { font-size: 11px; padding: 7px 10px; min-height: 34px; color: var(--grey); }
.voice-question { display: flex; gap: 8px; margin-top: 14px; }
.voice-question input { min-width: 0; flex: 1; font: inherit; font-size: 13px; color: var(--text); background: var(--bg); border: 1px solid var(--accent-faint); padding: 10px 12px; border-radius: 5px; }
.voice-question button { font-size: 12px; }
.voice-transcript { margin-top: 12px; font-size: 12px; color: var(--grey); }
.voice-transcript summary { cursor: pointer; }
.transcript-log { max-height: 160px; overflow-y: auto; margin-top: 8px; }
.transcript-log p { margin: 8px 0; }
.context-panel { border-top: 1px solid var(--accent-faint); margin: 8px 0 16px; padding-top: 16px; }
.context-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.context-header h2 { font-size: 14px; font-weight: 500; }
.context-close { font-size: 12px; padding: 2px 9px; min-height: 28px; }
.context-body { font-size: 13px; }
.context-body p { margin: 8px 0; }
.context-body a { color: var(--accent); }
.context-body ul { padding-left: 18px; }
.context-body li { margin: 7px 0; }
.voice-person { display: flex; gap: 14px; align-items: center; margin: 12px 0; }
.voice-person img { height: 60px; width: 60px; object-fit: cover; border-radius: 5px; filter: grayscale(1); }
.voice-person strong { display: block; }
.context-panel:focus { outline: none; }
@media (prefers-reduced-motion: reduce) {
  .tbot-pupils, .tbot-pair { animation: none; transform: none; opacity: 1; }
}

/* A square stage that opens sideways when the guide displays information. */
.speak-mode .window { width: min(860px, 100%); height: min(740px, calc(100dvh - 102px)); transition: width .35s ease; }
.speak-mode.speak-context .window { width: min(1140px, 100%); }
.voice-surface { padding: 18px 24px 22px; overflow: hidden; gap: 16px; }
.voice-topline { flex: 0 0 auto; }
.voice-layout { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr); align-items: center; }
.voice-character { min-width: 0; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; }
.eyes-stage { flex: none; min-height: 0; width: min(100%, 420px, calc(100dvh - 340px)); aspect-ratio: 1; }
.tbot-eyes { width: 100%; height: 100%; }
.voice-controls { flex: 0 0 auto; gap: 8px; }
.voice-controls button { font-size: 12px; min-height: 40px; padding: 9px 16px; }
.voice-controls .voice-primary { padding: 12px 24px; font-size: 14px; }
.voice-caption { flex: 0 0 auto; min-height: 0; width: 100%; max-width: 440px; margin: 0; font-size: 12px; line-height: 1.6; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.voice-surface[data-state=ready] .voice-caption { display: none; }
.voice-notice { flex: 0 0 auto; margin: 0; font-size: 10px; max-width: 330px; line-height: 1.6; }
.voice-surface:is([data-state=listening], [data-state=speaking]) .voice-notice { display: none; }
.voice-surface.has-context .voice-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 32px; }
.voice-surface.has-context .eyes-stage { width: min(100%, 360px, calc(100dvh - 340px)); min-height: 0; flex: none; }
.voice-surface.has-context .tbot-eyes { width: 100%; height: 100%; }
.context-panel { min-width: 0; min-height: 0; max-height: 100%; align-self: stretch; overflow-y: auto; border-top: 0; border-left: 1px solid var(--accent-faint); padding: 12px 0 12px 28px; margin: 0; }
.context-header { gap: 16px; margin: 0 0 20px; }
.context-header h2 { font-size: 18px; line-height: 1.4; margin: 0; }
.context-body { font-size: 13px; line-height: 1.8; }
.context-body li { margin: 12px 0; }
.voice-question, .voice-transcript { display: none; }
@media (max-width: 620px) {
  .mode-bar { padding: 10px 14px; }
  .mode-label { font-size: 9px; }
  .voice-surface { padding: 14px; gap: 12px; }
  .voice-topline { font-size: 9px; gap: 8px; }
  .voice-surface.has-context .voice-layout { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 12px; }
  .voice-surface.has-context .voice-character { gap: 10px; }
  .voice-surface.has-context .context-panel { padding: 8px 0 8px 12px; }
  .voice-surface.has-context .context-header h2 { font-size: 14px; }
  .voice-surface.has-context .context-body { font-size: 11px; }
  .voice-surface.has-context .voice-controls { flex-direction: column; }
  .voice-surface.has-context .voice-controls button { font-size: 10px; padding: 6px 8px; }
  .voice-surface.has-context .voice-caption { font-size: 10px; -webkit-line-clamp: 2; }
}
@media (prefers-reduced-motion: reduce) { .speak-mode .window { transition: none; } }

/* Match the reading terminal width until event content opens beside TBot. */
.voice-notice { display: none; }
.voice-surface:is([data-state=listening], [data-state=speaking]) .voice-caption { display: none; }

.speak-mode .window, .dock-page.speak-mode .window { height: min(550px, calc(100dvh - 102px - env(safe-area-inset-bottom))); }
@media (max-width: 620px) {
  .speak-mode .window, .dock-page.speak-mode .window { height: min(550px, calc(100dvh - 80px - env(safe-area-inset-bottom))); }
}

/* Keep the existing terminal frame; size the character within its available body. */
.voice-layout { container-type: size; }
.eyes-stage, .voice-surface.has-context .eyes-stage {
  width: min(420px, 100%, max(80px, calc(100cqh - 110px)));
  height: auto;
  min-height: 0;
  aspect-ratio: 1;
}
.voice-character { max-height: 100%; gap: 12px; }
