:root {
  --hw-bg: #eef2f5;
  --hw-surface: #ffffff;
  --hw-ink: #192633;
  --hw-muted: #607080;
  --hw-line: #d6e0e7;
  --hw-teal: #087f78;
  --hw-teal-dark: #075d5a;
  --hw-teal-soft: #e4f4f1;
  --hw-coral: #c65c48;
  --hw-coral-soft: #fff0ec;
  --hw-amber: #a66a12;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--hw-bg); }
body { margin: 0; color: var(--hw-ink); background: var(--hw-bg); }
button, input { font: inherit; touch-action: manipulation; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.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-page { width: min(1240px, 100%); margin: 0 auto; padding: 42px 34px 64px; }
.hidden-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.eyebrow { margin: 0; color: var(--hw-teal); font-size: 11px; font-weight: 850; letter-spacing: .14em; text-transform: uppercase; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 12px; font-size: clamp(2.25rem, 5vw, 4.5rem); letter-spacing: -.045em; line-height: .98; }
h1 span { color: var(--hw-muted); font-weight: 520; }
.lede { max-width: 55ch; margin-bottom: 0; color: var(--hw-muted); font-size: 1.05rem; line-height: 1.65; }
.header-actions { display: flex; align-items: center; gap: 10px; padding-top: 4px; }
.live-toggle { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 13px; border: 1px solid var(--hw-line); border-radius: 999px; background: var(--hw-surface); color: var(--hw-ink); font-size: 13px; font-weight: 750; }
.live-toggle input { width: 16px; height: 16px; accent-color: var(--hw-teal); }
.text-button { min-height: 44px; padding: 0 13px; border: 1px solid transparent; background: transparent; color: var(--hw-muted); font-size: 13px; font-weight: 750; }
.text-button:hover { color: var(--hw-ink); }

.setup-panel { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, .8fr); border: 1px solid var(--hw-line); background: var(--hw-surface); box-shadow: 0 18px 45px rgba(39, 56, 69, .08); }
.setup-main { padding: clamp(26px, 5vw, 54px); border-right: 1px solid var(--hw-line); }
.setup-main h2 { margin: 11px 0 12px; font-size: clamp(1.7rem, 3vw, 2.65rem); letter-spacing: -.03em; }
.setup-copy { max-width: 57ch; margin-bottom: 26px; color: var(--hw-muted); line-height: 1.7; }
.topic-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 30px; }
.topic-chip { min-height: 40px; padding: 7px 12px; border: 1px solid var(--hw-line); border-radius: 999px; background: #f8fafb; color: var(--hw-muted); font-size: 13px; font-weight: 700; }
.topic-chip:hover, .topic-chip.is-selected { border-color: var(--hw-teal); background: var(--hw-teal-soft); color: var(--hw-teal-dark); }
.primary-button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 18px; border: 0; border-radius: 6px; background: var(--hw-teal); color: #fff; font-weight: 800; box-shadow: 0 8px 18px rgba(8, 127, 120, .2); transition: transform 160ms ease, background 160ms ease; }
.primary-button:hover { background: var(--hw-teal-dark); transform: translateY(-1px); }
.primary-button span { font-size: 1.35rem; line-height: 1; }
.word-brief { display: flex; flex-direction: column; padding: 26px; background: #f8fafb; }
.brief-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; }
.brief-head strong { color: var(--hw-coral); font-size: 2.25rem; letter-spacing: -.05em; }
.word-brief > p { margin: 6px 0 18px; color: var(--hw-muted); font-size: 13px; line-height: 1.45; }
.word-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.word-chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 9px; border: 1px solid var(--hw-line); background: #fff; font-size: 13px; font-weight: 750; }
.word-chip small { color: var(--hw-muted); font-size: 10px; font-weight: 750; text-transform: uppercase; }
.brief-note { margin-top: auto; padding-top: 26px; color: var(--hw-muted); font-size: 12px; }

.chat-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(270px, .8fr); gap: 22px; align-items: start; }
.chat-column { min-width: 0; border: 1px solid var(--hw-line); background: var(--hw-surface); box-shadow: 0 18px 45px rgba(39, 56, 69, .08); }
.chat-topline { display: flex; align-items: center; gap: 9px; min-height: 52px; padding: 0 18px; border-bottom: 1px solid var(--hw-line); color: var(--hw-muted); font-size: 13px; font-weight: 750; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #2da97e; box-shadow: 0 0 0 4px #e0f4eb; }
.turn-count { margin-left: auto; color: var(--hw-muted); font-variant-numeric: tabular-nums; font-weight: 650; }
.chat-stream { display: grid; gap: 18px; min-height: 470px; max-height: 64vh; overflow-y: auto; padding: 24px 22px; background: #fbfcfd; scroll-behavior: smooth; }
.message { display: flex; gap: 10px; max-width: 82%; animation: rise 220ms ease-out; }
.message.user { margin-left: auto; flex-direction: row-reverse; }
.avatar { display: grid; place-items: center; width: 30px; height: 30px; flex: 0 0 30px; border-radius: 50%; background: #dce8ed; color: var(--hw-teal-dark); font-size: 11px; font-weight: 900; }
.message.user .avatar { background: var(--hw-teal); color: #fff; }
.bubble { padding: 12px 14px; border: 1px solid var(--hw-line); background: #fff; color: var(--hw-ink); font-size: 15px; line-height: 1.55; }
.message.user .bubble { border-color: var(--hw-teal); background: var(--hw-teal); color: #fff; }
.bubble p { margin: 0; }
.target-word { border-bottom: 2px solid #f0b15a; font-weight: 800; }
.meaning-check { margin-left: 40px; padding: 16px; border: 1px solid #f0c6b9; background: var(--hw-coral-soft); animation: rise 220ms ease-out; }
.check-label { display: flex; align-items: center; gap: 7px; margin-bottom: 8px; color: var(--hw-coral); font-size: 11px; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.check-label span { display: grid; place-items: center; width: 21px; height: 21px; border-radius: 50%; background: var(--hw-coral); color: #fff; font-size: 12px; }
.check-question { margin: 0 0 12px; font-weight: 800; line-height: 1.45; }
.check-statement { margin: 0 0 11px; color: var(--hw-muted); font-style: italic; line-height: 1.5; }
.check-options { display: grid; gap: 8px; }
.check-option { min-height: 44px; padding: 9px 12px; border: 1px solid #e7b8a9; background: #fff; color: var(--hw-ink); text-align: left; font-weight: 700; line-height: 1.35; }
.check-option:hover { border-color: var(--hw-coral); background: #fff9f7; }
.check-option.is-dk { color: var(--hw-muted); font-weight: 650; }
.check-feedback { margin: 11px 0 0; color: var(--hw-muted); font-size: 13px; line-height: 1.5; }
.check-feedback strong { color: var(--hw-ink); }
.check-option:disabled { cursor: default; opacity: .72; }
.composer { display: flex; gap: 9px; padding: 14px; border-top: 1px solid var(--hw-line); background: #fff; }
.composer input { min-width: 0; flex: 1; min-height: 46px; padding: 0 13px; border: 1px solid var(--hw-line); border-radius: 5px; color: var(--hw-ink); outline: none; }
.composer input:focus { border-color: var(--hw-teal); box-shadow: 0 0 0 3px rgba(8,127,120,.14); }
.send-button { display: grid; place-items: center; width: 48px; min-width: 48px; border: 0; border-radius: 5px; background: var(--hw-teal); color: #fff; font-size: 1.3rem; }
.send-button:hover { background: var(--hw-teal-dark); }
.voice-toolbar { display: grid; grid-template-columns: auto auto minmax(120px, 1fr); align-items: center; gap: 8px; padding: 0 14px 10px; background: #fff; }
.voice-connect, .voice-talk { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 13px; border: 1px solid var(--hw-line); border-radius: 5px; background: #f8fafb; color: var(--hw-ink); font-size: 13px; font-weight: 780; }
.voice-connect:hover, .voice-talk:hover:not(:disabled) { border-color: var(--hw-teal); background: var(--hw-teal-soft); color: var(--hw-teal-dark); }
.voice-connect.is-ready { border-color: #8ac9c1; background: var(--hw-teal-soft); color: var(--hw-teal-dark); }
.voice-status-dot { width: 8px; height: 8px; border-radius: 50%; background: #8b98a3; }
.voice-connect.is-connecting .voice-status-dot { background: var(--hw-amber); animation: voicePulse 900ms ease-in-out infinite; }
.voice-connect.is-ready .voice-status-dot { background: var(--hw-teal); box-shadow: 0 0 0 4px rgba(8,127,120,.12); }
.voice-connect.is-error .voice-status-dot { background: var(--hw-coral); }
.voice-talk { min-width: 128px; border-color: var(--hw-teal); background: var(--hw-teal); color: #fff; user-select: none; -webkit-user-select: none; }
.voice-talk:hover:not(:disabled) { background: var(--hw-teal-dark); color: #fff; }
.voice-talk:disabled { cursor: not-allowed; border-color: var(--hw-line); background: #edf1f3; color: #8b98a3; }
.voice-talk.is-listening { border-color: var(--hw-coral); background: var(--hw-coral); color: #fff; box-shadow: 0 0 0 4px rgba(198,92,72,.14); }
.voice-talk.is-speaking { border-color: var(--hw-amber); background: #fff7e8; color: var(--hw-amber); }
.voice-talk-icon { font-size: 10px; transform: scale(1); }
.voice-talk.is-listening .voice-talk-icon { animation: voicePulse 700ms ease-in-out infinite; }
.voice-status { min-width: 0; color: var(--hw-muted); font-size: 12px; line-height: 1.35; }
.composer-note { margin: 0; padding: 0 14px 14px; color: var(--hw-muted); font-size: 12px; }
.progress-column { display: grid; gap: 12px; position: sticky; top: 20px; }
.progress-card { border: 1px solid var(--hw-line); background: var(--hw-surface); padding: 20px; }
.progress-card-head { display: flex; justify-content: space-between; gap: 12px; }
.progress-card h2 { margin: 7px 0 14px; font-size: 1.1rem; letter-spacing: -.02em; }
.progress-ring { display: grid; place-items: center; width: 50px; height: 50px; border: 1px solid #8ac9c1; border-radius: 50%; background: var(--hw-teal-soft); color: var(--hw-teal-dark); font-size: 12px; font-weight: 850; }
.progress-bar { height: 6px; overflow: hidden; margin-bottom: 18px; background: #e4eaee; }
.progress-bar span { display: block; width: 0; height: 100%; background: var(--hw-teal); transition: width 240ms ease; }
.progress-list { display: grid; gap: 7px; }
.progress-word { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 32px; padding: 4px 7px; border-bottom: 1px solid #eef1f3; font-size: 13px; }
.progress-word strong { font-weight: 780; }
.progress-word small { color: var(--hw-muted); font-size: 10px; text-transform: uppercase; }
.progress-word.is-surfaced strong { color: var(--hw-teal-dark); }
.progress-word.is-familiar small { color: var(--hw-teal); font-weight: 800; }
.end-button { min-height: 46px; border: 1px solid var(--hw-line); background: transparent; color: var(--hw-muted); font-weight: 750; }
.end-button:hover { border-color: var(--hw-ink); color: var(--hw-ink); }

.summary-panel { border: 1px solid var(--hw-line); background: var(--hw-surface); padding: clamp(28px, 6vw, 64px); text-align: center; box-shadow: 0 18px 45px rgba(39, 56, 69, .08); }
.summary-mark { display: grid; place-items: center; width: 58px; height: 58px; margin: 0 auto 18px; border: 1px solid #8ac9c1; border-radius: 50%; background: var(--hw-teal-soft); color: var(--hw-teal); font-size: 1.8rem; font-weight: 850; }
.summary-panel h2 { margin: 10px 0; font-size: clamp(1.8rem, 4vw, 3.1rem); letter-spacing: -.04em; }
.summary-lede { margin-bottom: 28px; color: var(--hw-muted); font-size: 1.05rem; }
.summary-lede strong { color: var(--hw-ink); font-size: 1.35rem; }
.summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 620px; margin: 0 auto 28px; border-top: 1px solid var(--hw-line); border-bottom: 1px solid var(--hw-line); }
.summary-grid div { display: grid; gap: 4px; padding: 17px 10px; border-right: 1px solid var(--hw-line); }
.summary-grid div:last-child { border-right: 0; }
.summary-grid strong { font-size: 1.8rem; }
.summary-grid span { color: var(--hw-muted); font-size: 12px; }
.summary-words { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; max-width: 740px; margin: 0 auto 28px; }
.summary-word { padding: 7px 10px; border: 1px solid var(--hw-line); font-size: 13px; font-weight: 750; }
.summary-word.is-familiar { border-color: #8ac9c1; background: var(--hw-teal-soft); color: var(--hw-teal-dark); }
.summary-word.is-review { border-color: #ebc58c; background: #fff7e8; color: var(--hw-amber); }
.storage-note { margin: 18px 0 0; color: var(--hw-muted); font-size: 12px; text-align: center; }

@keyframes rise { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@keyframes voicePulse { 50% { opacity: .55; transform: scale(.82); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; } }
@media (max-width: 960px) { .hidden-page { padding: 32px 22px 50px; } .setup-panel, .chat-layout { grid-template-columns: 1fr; } .setup-main { border-right: 0; border-bottom: 1px solid var(--hw-line); } .progress-column { position: static; } .progress-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; } }
@media (max-width: 620px) { .hidden-page { padding: 26px 14px 38px; } .hidden-header { display: block; } .header-actions { margin-top: 18px; justify-content: space-between; } h1 { font-size: 2.45rem; } .setup-main, .word-brief { padding: 22px 18px; } .chat-stream { min-height: 420px; padding: 18px 12px; } .message { max-width: 92%; } .meaning-check { margin-left: 0; } .voice-toolbar { grid-template-columns: 1fr 1fr; } .voice-status { grid-column: 1 / -1; } .progress-list { grid-template-columns: 1fr; } .summary-grid { grid-template-columns: 1fr; } .summary-grid div { border-right: 0; border-bottom: 1px solid var(--hw-line); } .summary-grid div:last-child { border-bottom: 0; } }
