:root {
  color-scheme: light;
  --page: #f4f7f6;
  --surface: #fff;
  --surface-soft: #f8faf9;
  --ink: #172c2b;
  --muted: #687b79;
  --line: #dbe5e2;
  --teal: #0c7768;
  --teal-deep: #07594f;
  --teal-soft: #e5f3ef;
  --danger: #a93b3b;
  --shadow: 0 18px 48px rgba(26, 57, 52, .08);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--page);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: var(--page); }
button { font: inherit; }
button:focus-visible, a:focus-visible { outline: 3px solid #52a99b; outline-offset: 3px; }
.shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar { height: 76px; display: flex; align-items: center; justify-content: space-between; padding: 0 clamp(20px, 6vw, 88px); border-bottom: 1px solid var(--line); background: rgba(255,255,255,.78); }
.brand { display: inline-flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--teal); color: #fff; }
.brand-mark svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.brand-copy { display: grid; gap: 2px; }
.brand-copy strong { font-size: 14px; letter-spacing: -.01em; }
.brand-copy small { color: var(--muted); font-size: 12px; }
.mode-badge { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #159676; box-shadow: 0 0 0 3px #e3f3ec; }
.workspace { width: min(100% - 40px, 900px); margin: 55px auto 46px; flex: 1; }
.intro { text-align: center; margin: 0 auto 28px; }
.eyebrow, .overline { margin: 0; color: var(--teal); font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
h1 { margin: 9px 0 8px; font-size: clamp(29px, 4vw, 40px); letter-spacing: -.045em; line-height: 1.12; font-weight: 650; }
.intro-copy { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.55; }
.voice-console { overflow: hidden; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); box-shadow: var(--shadow); }
.console-head { height: 66px; display: flex; align-items: center; justify-content: space-between; padding: 0 22px; border-bottom: 1px solid var(--line); }
.console-head > div { display: grid; gap: 4px; }
.console-head strong { font-size: 13px; font-weight: 600; }
.overline { color: #839491; font-size: 9px; }
.quiet-button { display: inline-flex; gap: 7px; align-items: center; border: 0; border-radius: 8px; background: transparent; padding: 8px 10px; color: var(--muted); font-size: 12px; cursor: pointer; }
.quiet-button:hover:not(:disabled) { background: var(--surface-soft); color: var(--ink); }
.quiet-button:disabled { opacity: .42; cursor: default; }
.quiet-button svg, .note-icon svg, .empty-mark svg, .privacy-mark svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.voice-stage { display: flex; flex-direction: column; align-items: center; padding: 30px 20px 24px; }
.sound-ring { display: grid; place-items: center; width: 104px; height: 104px; border: 1px solid #d8eae5; border-radius: 50%; background: #f5faf8; transition: transform .2s ease, border-color .2s ease, background .2s ease; }
.wave-bars { height: 34px; display: flex; align-items: center; gap: 4px; }
.wave-bars i { display: block; width: 3px; height: 8px; border-radius: 4px; background: #76a89e; transform-origin: center; }
.voice-stage.is-listening .sound-ring { transform: scale(1.06); border-color: #66b3a4; background: var(--teal-soft); }
.voice-stage.is-listening .wave-bars i { animation: pulse 760ms ease-in-out infinite alternate; }
.wave-bars i:nth-child(2n) { animation-delay: 120ms !important; }
.wave-bars i:nth-child(3n) { animation-delay: 240ms !important; }
@keyframes pulse { from { transform: scaleY(.55); } to { transform: scaleY(2.2); } }
.voice-status { margin: 17px 0 14px; font-size: 14px; font-weight: 600; }
.talk-button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-width: 205px; min-height: 50px; padding: 0 20px; border: 0; border-radius: 13px; color: #fff; background: var(--teal); box-shadow: 0 7px 16px rgba(12,119,104,.16); font-weight: 650; font-size: 14px; cursor: pointer; transition: background .16s ease, transform .16s ease, box-shadow .16s ease; }
.talk-button:hover:not(:disabled) { background: var(--teal-deep); transform: translateY(-1px); box-shadow: 0 10px 22px rgba(12,119,104,.22); }
.talk-button:active:not(:disabled) { transform: translateY(0); }
.talk-button:disabled { opacity: .55; cursor: wait; box-shadow: none; }
.talk-button.is-active { background: var(--danger); box-shadow: 0 7px 16px rgba(169,59,59,.18); }
.mic-icon { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.voice-hint { margin: 11px 0 0; color: #879794; font-size: 11px; }
.conversation { display: grid; gap: 14px; min-height: 116px; max-height: 340px; overflow-y: auto; padding: 18px 22px 22px; border-top: 1px solid var(--line); background: #fbfcfc; }
.empty-conversation { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 18px 0; color: #879794; }
.empty-mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: #eef4f2; color: #718d86; }
.empty-conversation strong { color: #5e7470; font-size: 12px; font-weight: 600; }
.empty-conversation p { margin: 4px 0 0; font-size: 11px; }
.message { max-width: min(78%, 600px); padding: 12px 14px; border-radius: 14px; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.message.user { justify-self: end; border: 1px solid #cfe5df; border-bottom-right-radius: 4px; background: #edf7f4; color: #23413b; }
.message.assistant { justify-self: start; border: 1px solid #e3e9e7; border-bottom-left-radius: 4px; background: #fff; color: #304441; }
.message-label { display: block; margin-bottom: 4px; color: #7b918c; font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.test-note { display: flex; align-items: center; gap: 13px; margin-top: 16px; padding: 14px 17px; border: 1px solid #dce9e3; border-radius: 14px; background: #eef5f1; }
.note-icon { display: grid; place-items: center; flex: none; width: 31px; height: 31px; border-radius: 10px; background: #deede6; color: #327667; }
.test-note p { display: grid; gap: 3px; flex: 1; margin: 0; }
.test-note strong { font-size: 12px; }
.test-note p span { color: #617873; font-size: 11px; line-height: 1.45; }
.api-state { flex: none; border: 1px solid #d4e4dc; border-radius: 7px; padding: 5px 8px; color: #517366; font-size: 10px; font-weight: 650; }
.footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px clamp(20px, 6vw, 88px) 19px; color: #82918f; font-size: 10px; }
.privacy-mark { display: inline-flex; align-items: center; gap: 5px; }
.privacy-mark svg { width: 14px; height: 14px; }
.error-text { color: #9b3737; }
@media (max-width: 600px) {
  .topbar { height: 66px; padding: 0 18px; }
  .workspace { width: min(100% - 28px, 520px); margin: 37px auto 30px; }
  .intro { margin-bottom: 21px; }
  .intro-copy { max-width: 330px; margin-inline: auto; font-size: 13px; }
  .voice-console { border-radius: 18px; }
  .console-head { padding-inline: 16px; }
  .voice-stage { padding: 24px 16px 20px; }
  .conversation { min-height: 130px; max-height: 320px; padding: 15px; }
  .message { max-width: 90%; }
  .test-note { align-items: flex-start; padding: 13px; gap: 10px; }
  .api-state { align-self: center; white-space: nowrap; }
  .footer { flex-direction: column; align-items: flex-start; padding: 4px 18px 18px; gap: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
