:root {
  color-scheme: dark;
  font-family: Inter, 'Segoe UI', Arial, sans-serif;
  background: #090511;
  color: #f5efff;
  font-synthesis: none;
  --muted: #b8accb;
  --accent: #cf9cff;
}
.transcript[hidden] + .hint {
  margin-top: auto;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-height: 100svh;
  overflow-x: hidden;
  background: radial-gradient(
    ellipse at 50% 43%,
    #240d40 0,
    #0d0719 45%,
    #07050e 100%
  );
}
button,
select {
  font: inherit;
}
button {
  cursor: pointer;
}
button,
select {
  -webkit-tap-highlight-color: transparent;
}
button:focus-visible,
select:focus-visible {
  outline: 2px solid #e6bcff;
  outline-offset: 5px;
}
button:disabled {
  cursor: wait;
  opacity: 0.65;
}
svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
#nebula,
#orb,
.vignette {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
#nebula {
  opacity: 0.7;
}
#orb {
  z-index: 1;
}
.vignette {
  z-index: 2;
  background: linear-gradient(
    0deg,
    rgba(7, 5, 14, 0.8),
    transparent 26%,
    transparent 75%,
    rgba(7, 5, 14, 0.4)
  );
  box-shadow: inset 0 0 120px #08051055;
}
.topbar,
main,
footer {
  position: relative;
  z-index: 3;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 30px 42px;
  gap: 20px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand > svg {
  width: 35px;
  height: 35px;
  color: #c797ff;
  stroke-width: 0.9;
}
.brand .brand-core {
  fill: #e6ceff;
  stroke: none;
}
.brand > div {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.wordmark {
  font-size: 16px;
  letter-spacing: 0.32em;
  font-weight: 600;
}
.brand-caption {
  font-size: 12px;
  letter-spacing: 0.16em;
  color: #a99abf;
}
.top-actions {
  display: flex;
  gap: 25px;
  align-items: center;
}
.connection {
  font-size: 14px;
  color: var(--muted);
  display: flex;
  gap: 9px;
  align-items: center;
}
.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 100%;
  background: #a483be;
  box-shadow: 0 0 9px #9d61e950;
}
.listening .status-dot {
  background: #d69dff;
  box-shadow: 0 0 12px #ce79ff;
}
.icon-button {
  border: 1px solid #d9b1ff25;
  background: #1d11284d;
  color: #cbbddc;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
}
.icon-button:hover {
  background: #a261df25;
}
.words {
  position: absolute;
  top: calc(62svh - 106px);
  left: 50%;
  transform: translateX(-50%);
  width: min(88%, 920px);
  text-align: center;
}
.eyebrow {
  font-size: 12px;
  letter-spacing: 0.26em;
  color: #d1a8ed;
  margin-bottom: 11px;
}
.transcript {
  font-size: clamp(36px, 4.5vw, 64px);
  font-weight: 300;
  letter-spacing: -0.035em;
  line-height: 1.17;
  text-shadow: 0 0 40px #d4a8ff22;
  max-height: 17svh;
  overflow: auto;
  overflow-wrap: anywhere;
  scrollbar-width: thin;
  scrollbar-color: #86519f66 transparent;
  padding: 2px 8px 8px;
}
.transcript.long {
  font-size: clamp(23px, 3vw, 38px);
  line-height: 1.3;
  letter-spacing: -0.02em;
}
#interimWords {
  color: #c6a3e8;
}
.hint {
  font-size: 15px;
  font-weight: 400;
  color: #baa9cd;
  margin: 11px 0 0;
  line-height: 1.6;
}
.controls {
  position: absolute;
  top: calc(79svh - 106px);
  left: 50%;
  transform: translateX(-50%);
  width: min(94%, 650px);
  text-align: center;
}
.wave-status {
  height: 42px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
}
.waveform {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 19px;
  gap: 3px;
}
.waveform i {
  width: 2px;
  height: 3px;
  background: #d69bfb;
  border-radius: 2px;
  box-shadow: 0 0 8px #d59bff44;
  transform-origin: center;
  transition: height 0.08s linear;
}
.wave-status > span {
  font-size: 12px;
  letter-spacing: 0.18em;
  color: #af83cd;
}
.control-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 23px;
}
.mic-button {
  height: 54px;
  min-width: 205px;
  background: linear-gradient(110deg, #eee2ff, #e1c7ff);
  color: #241133;
  border: 1px solid #f8edff;
  border-radius: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  font-weight: 600;
  font-size: 15px;
  box-shadow:
    0 0 32px #b966ff26,
    inset 0 1px 0 #fff;
  transition:
    transform 0.18s,
    box-shadow 0.2s;
}
.mic-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 38px #b966ff55;
}
.mic-button:active {
  transform: translateY(0);
}
.mic-button .stop-icon {
  display: none;
  fill: currentColor;
  stroke: none;
}
.listening .mic-button {
  background: #352045cc;
  color: #f0d9ff;
  border-color: #c292ee88;
  box-shadow: 0 0 25px #b855ed33;
}
.listening .mic-icon {
  display: none;
}
.listening .stop-icon {
  display: block;
}
.language {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #bdb0cf;
}
.language svg {
  width: 17px;
  height: 17px;
}
.language select {
  color: #cfc1dc;
  background: transparent;
  border: 0;
  font-size: 14px;
  max-width: 100px;
  padding: 9px 2px;
  cursor: pointer;
}
.language option {
  background: #1c1128;
}
.clear-button {
  background: transparent;
  border: 0;
  color: #bdb0cf;
  display: flex;
  gap: 7px;
  align-items: center;
  font-size: 14px;
  padding: 12px 0;
}
.clear-button svg {
  width: 17px;
  height: 17px;
}
.clear-button:hover {
  color: white;
}
.help {
  color: #9c8aae;
  font-size: 13px;
  margin: 17px 0 0;
  line-height: 1.5;
}
.error-message {
  color: #f3c8e0;
  font-size: 14px;
  line-height: 1.6;
  margin: 12px auto 0;
  max-width: 510px;
}
footer {
  position: fixed;
  bottom: 24px;
  width: 100%;
  padding: 0 42px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: #806f93;
  font-size: 12px;
  letter-spacing: 0.15em;
}
footer .privacy {
  letter-spacing: 0.015em;
  font-size: 12px;
}
.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;
}
[hidden] {
  display: none !important;
}
@media (min-height: 1000px) {
  .words {
    top: calc(62svh - 106px);
  }
  .controls {
    top: calc(78svh - 106px);
  }
}
@media (max-width: 650px) {
  .topbar {
    padding: 22px;
  }
  .brand-caption {
    font-size: 12px;
    letter-spacing: 0.09em;
  }
  .brand > svg {
    width: 30px;
    height: 30px;
  }
  .top-actions {
    gap: 12px;
  }
  .connection {
    font-size: 12px;
  }
  .connection .status-dot {
    display: none;
  }
  .icon-button {
    width: 36px;
    height: 36px;
    border-radius: 10px;
  }
  .words {
    top: calc(59svh - 88px);
  }
  .transcript {
    font-size: 42px;
    max-height: 19svh;
  }
  .transcript.long {
    font-size: 26px;
  }
  .eyebrow {
    font-size: 12px;
    letter-spacing: 0.19em;
  }
  .hint {
    font-size: 14px;
  }
  .controls {
    top: calc(78svh - 88px);
  }
  .control-row {
    gap: 16px;
  }
  .mic-button {
    min-width: 172px;
    height: 52px;
    font-size: 14px;
  }
  .language {
    gap: 2px;
  }
  .language svg {
    display: none;
  }
  .language select {
    font-size: 14px;
    max-width: 77px;
  }
  .clear-button {
    font-size: 14px;
  }
  .clear-button span {
    display: none;
  }
  .clear-button svg {
    width: 21px;
    height: 21px;
  }
  .help {
    font-size: 12px;
  }
  .wave-status {
    margin-bottom: 16px;
  }
  footer {
    padding: 0 22px;
    bottom: 17px;
    justify-content: center;
  }
  footer > span:first-child {
    display: none;
  }
}
@media (max-height: 670px) {
  .topbar {
    padding-top: 15px;
    padding-bottom: 15px;
  }
  .words {
    top: calc(53svh - 75px);
  }
  .transcript {
    font-size: 35px;
    max-height: 15svh;
  }
  .transcript.long {
    font-size: 23px;
  }
  .eyebrow {
    margin-bottom: 5px;
  }
  .hint {
    margin-top: 3px;
  }
  .controls {
    top: calc(73svh - 75px);
  }
  .wave-status {
    margin-bottom: 9px;
    height: 33px;
    gap: 4px;
  }
  .help {
    margin-top: 9px;
  }
  footer {
    bottom: 10px;
  }
  .error-message {
    margin-top: 6px;
  }
}
@media (max-height: 500px) {
  body {
    min-height: 600px;
  }
  .words {
    top: 220px;
  }
  .controls {
    top: 385px;
  }
  footer {
    position: absolute;
    top: 570px;
    bottom: auto;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
.send-button,
.audio-unlock {
  font: inherit;
  font-size: 13px;
  border: 1px solid #b47cda50;
  border-radius: 18px;
  background: #31194399;
  color: #e5d0f4;
  padding: 7px 16px;
  margin-top: 12px;
  cursor: pointer;
}
.clear-button:disabled {
  cursor: default;
  opacity: 0.35;
}
.hint {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 90%;
  margin-inline: auto;
}
.controls {
  top: calc(77svh - 106px);
}
.mic-button {
  min-width: 215px;
}
.language[hidden] {
  display: none !important;
}
body[data-phase='thinking'] .status-dot {
  animation: thinking-pulse 1.5s ease-in-out infinite;
}
body[data-phase='speaking'] .status-dot {
  background: #ffca90;
  box-shadow: 0 0 16px #ff8d75;
}
.error-message {
  position: relative;
  background: #170d22ef;
  border-radius: 12px;
  padding: 10px 14px;
  margin-top: 10px;
}
.send-button:hover,
.audio-unlock:hover {
  background: #5d327b;
}
.topbar {
  padding: 24px 32px;
}
footer {
  padding: 0 32px;
}
.privacy {
  max-width: 65%;
  text-align: end;
}
@keyframes thinking-pulse {
  50% {
    opacity: 0.3;
  }
}
@media (max-width: 650px) {
  .topbar {
    padding: 20px;
  }
  .brand-caption {
    font-size: 11px;
  }
  .connection {
    max-width: 140px;
    font-size: 11px;
  }
  .wordmark {
    font-size: 14px;
  }
  .mic-button {
    min-width: 194px;
  }
  .control-row {
    gap: 18px;
  }
  .clear-button span {
    display: block;
    max-width: 85px;
    font-size: 13px;
  }
  .clear-button svg {
    display: none;
  }
  .controls {
    top: calc(74svh - 88px);
  }
  .wave-status {
    margin-bottom: 13px;
  }
  .privacy {
    max-width: 100%;
    text-align: center;
    font-size: 10px !important;
  }
  footer {
    padding: 0 14px;
  }
  .transcript.long {
    font-size: 23px;
  }
  .hint {
    font-size: 13px;
  }
}
@media (prefers-reduced-motion: reduce) {
  body[data-phase='thinking'] .status-dot {
    animation: none;
  }
}
.words {
  height: 14svh;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.eyebrow,
.hint {
  flex-shrink: 0;
}
.transcript,
.transcript.long {
  width: 100%;
  flex: 1;
  min-height: 0;
  max-height: none;
}
.hint {
  margin-top: 6px;
  line-height: 1.4;
}
.eyebrow {
  margin-bottom: 6px;
}
@media (max-height: 670px) {
  .words {
    height: 16svh;
  }
  .controls {
    top: calc(73svh - 75px);
  }
  .error-message {
    font-size: 12px;
    padding: 7px 10px;
  }
  .help {
    font-size: 12px;
  }
  .send-button {
    margin-top: 6px;
    font-size: 12px;
    padding: 5px 12px;
  }
}
@media (max-height: 500px) {
  .words {
    height: 100px;
  }
  .controls {
    top: 385px;
  }
}
/* Conversation controls and page-local transcript history. */
.topbar {
  gap: 24px;
  padding: 22px 32px;
}
.brand {
  flex-shrink: 0;
}
.brand-caption {
  font-size: 11px;
}
.top-actions {
  gap: 12px;
}
.connection {
  font-size: 12px;
  margin-right: 4px;
}
.status-dot {
  flex-shrink: 0;
}
.icon-button {
  flex-shrink: 0;
}
.icon-button[aria-expanded='true'] {
  background: #a261df30;
  border-color: #d9b1ff66;
}
.mode-picker {
  min-width: 290px;
  padding: 9px 14px;
  border: 1px solid #d9b1ff24;
  border-radius: 15px;
  background: #1c10276b;
  backdrop-filter: blur(14px);
}
.mode-label {
  display: block;
  font-size: 10px;
  letter-spacing: 0.08em;
  color: #baa4ce;
  margin-bottom: 3px;
}
.mode-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.mode-option {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: #bca8cc;
  font-size: 13px;
  font-weight: 500;
  padding: 8px;
  white-space: nowrap;
  cursor: pointer;
}
.mode-option:hover {
  background: #c495ee10;
}
.mode-option:has(input:checked) {
  background: #bd8aec1f;
  border-color: #d9b1ff33;
  color: #f2e5ff;
}
.mode-option:focus-within {
  outline: 2px solid #d5b1fa;
  outline-offset: 2px;
}
.mode-option input {
  accent-color: #d1a0ff;
  width: 16px;
  height: 16px;
  margin: 0;
  flex-shrink: 0;
  cursor: inherit;
}
.history-panel {
  position: fixed;
  z-index: 5;
  left: 24px;
  top: 125px;
  bottom: 28px;
  width: min(370px, 32vw);
  display: flex;
  flex-direction: column;
  border: 1px solid #ce9fff32;
  border-radius: 22px;
  background: linear-gradient(145deg, #261338ec, #100b1de8);
  box-shadow:
    0 18px 65px #0005,
    inset 0 1px 0 #ecd6ff0d;
  backdrop-filter: blur(22px);
  overflow: hidden;
}
.history-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 20px 18px 16px;
  border-bottom: 1px solid #d4a0ff1b;
}
.history-heading h1 {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 5px;
}
.history-heading p {
  font-size: 12px;
  line-height: 1.5;
  color: #b9a6cd;
  margin: 0;
}
.history-close {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: transparent;
  border-color: transparent;
}
.history-close svg {
  width: 18px;
  height: 18px;
}
.history-log {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 18px;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #a36dca77 transparent;
}
.history-log:focus-visible {
  outline: 2px solid #e6bcff;
  outline-offset: -4px;
}
.history-empty {
  margin: 34px 5px;
  color: #bbaaca;
  font-size: 14px;
  line-height: 1.7;
  text-align: center;
}
.history-turn {
  margin-bottom: 24px;
}
.history-turn:last-child {
  margin-bottom: 0;
}
.history-turn-mode {
  margin: 0 0 11px;
  color: #ad8cc5;
  font-size: 10px;
  letter-spacing: 0.03em;
}
.history-message {
  margin: 0 0 14px;
  padding: 12px 13px;
  border-radius: 14px;
  background: #ede0ff07;
  border: 1px solid #d7b1f514;
}
.history-message[data-role='user'] {
  background: #aa6fdf1b;
  border-color: #d7b1f521;
}
.history-speaker {
  display: block;
  color: #dcb2ff;
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 7px;
}
.history-message[data-role='assistant'] .history-speaker {
  color: #ffd7b0;
}
.history-text {
  font-size: 14px;
  font-weight: 400;
  line-height: 1.7;
  letter-spacing: normal;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 0;
  color: #eee4f7;
}
.history-turn-status {
  font-size: 12px;
  color: #baa1ce;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: -3px 3px 0;
}
.history-turn[data-state='error'] .history-turn-status {
  color: #efc0d6;
}
.history-turn[data-state='interrupted'] .history-turn-status {
  color: #ccaf8f;
}
.history-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  color: #aa96be;
  margin: 24px 0;
}
.history-divider::before,
.history-divider::after {
  content: '';
  height: 1px;
  flex: 1;
  background: #d4a0ff24;
}
.history-privacy {
  font-size: 10px;
  line-height: 1.5;
  color: #9d89b1;
  margin: 0;
  padding: 11px 18px;
  border-top: 1px solid #d4a0ff17;
}
.controls {
  position: fixed;
  z-index: 4;
  top: auto;
  bottom: max(28px, 7svh);
  width: min(94%, 580px);
}
.help {
  font-size: 12px;
}
.wave-status > span {
  font-size: 11px;
}
.error-message {
  font-size: 13px;
}
.send-button,
.audio-unlock {
  background: #311943e6;
}
@media (max-width: 1050px) {
  .topbar {
    gap: 16px;
    padding: 20px;
  }
  .connection {
    max-width: 110px;
    font-size: 10px;
    line-height: 1.5;
  }
  .mode-picker {
    min-width: 255px;
    padding: 8px 11px;
  }
  .mode-row {
    gap: 8px;
  }
  .history-panel {
    left: 18px;
    width: 330px;
    top: 120px;
    bottom: 240px;
  }
}
@media (max-width: 760px) {
  .topbar {
    flex-wrap: wrap;
    gap: 16px;
    padding: 18px 20px;
  }
  .brand > svg {
    width: 30px;
    height: 30px;
  }
  .brand-caption {
    font-size: 10px;
    letter-spacing: 0.08em;
  }
  .wordmark {
    font-size: 14px;
  }
  .top-actions {
    margin-left: auto;
    gap: 8px;
  }
  .connection {
    display: none;
  }
  .icon-button {
    width: 36px;
    height: 36px;
    border-radius: 10px;
  }
  .mode-picker {
    order: 3;
    width: 100%;
    max-width: 365px;
    margin-inline: auto;
    min-width: 0;
    padding: 8px 13px;
  }
  .mode-row {
    justify-content: space-between;
  }
  .mode-label {
    font-size: 10px;
  }
  .history-panel {
    left: 14px;
    right: 14px;
    top: 165px;
    bottom: max(235px, 30svh);
    width: auto;
    border-radius: 18px;
    background: linear-gradient(145deg, #261338fa, #100b1df7);
  }
  .history-heading {
    padding: 15px 15px 12px;
  }
  .history-heading h1 {
    font-size: 16px;
  }
  .history-heading p {
    font-size: 11px;
  }
  .history-heading .history-close {
    width: 28px;
    height: 28px;
  }
  .history-log {
    padding: 14px;
  }
  .history-privacy {
    padding: 8px 14px;
  }
  .history-text {
    font-size: 14px;
  }
  .controls {
    top: auto;
    bottom: 24px;
  }
  .control-row {
    gap: 18px;
  }
  .mic-button {
    min-width: 194px;
    height: 52px;
    font-size: 14px;
  }
  .clear-button {
    font-size: 13px;
  }
  .clear-button svg {
    display: none;
  }
  .clear-button span {
    max-width: 85px;
  }
  .help {
    font-size: 12px;
    padding-inline: 6px;
  }
  .wave-status {
    margin-bottom: 13px;
  }
}
@media (max-height: 700px) {
  .controls {
    top: auto;
    bottom: 17px;
  }
  .wave-status {
    height: 32px;
    gap: 4px;
    margin-bottom: 10px;
  }
  .help {
    margin-top: 10px;
  }
  .send-button,
  .audio-unlock {
    margin-top: 8px;
    padding-block: 5px;
  }
  .history-panel {
    bottom: 215px;
  }
}
@media (max-width: 760px) and (max-height: 650px) {
  .history-panel {
    top: 88px;
    bottom: 208px;
  }
  body:has(#historyPanel:not([hidden])) .mode-picker {
    visibility: hidden;
  }
  .history-heading p,
  .history-privacy {
    display: none;
  }
}
@media (max-height: 500px) {
  body {
    min-height: 100svh;
  }
}
@media (max-height: 480px) and (min-width: 761px) {
  .topbar {
    padding-block: 10px;
  }
  .history-panel {
    top: 90px;
    bottom: 16px;
    width: min(340px, 43vw);
    right: auto;
  }
  .history-heading p,
  .history-privacy {
    display: none;
  }
  .controls {
    left: 72%;
    width: 52%;
    top: auto;
    bottom: 18px;
  }
  .control-row {
    gap: 12px;
  }
  .mic-button {
    min-width: 180px;
  }
}
