:root {
  color-scheme: dark;
  --fit-ink: #f8fcff;
  --fit-muted: #a4b8cf;
  --fit-bg: #051123;
  --fit-panel: #071a2f;
  --fit-blue: #117ef9;
  --fit-cyan: #03c8db;
  --fit-lime: #76de11;
  --fit-danger: #ff7b88;
  --fit-line: rgba(80, 205, 239, .44);
  --fit-voice-gradient: linear-gradient(90deg, #6ede09, #00cccd);
  --fit-viewport-height: 100dvh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 0; overflow-x: hidden; background: var(--fit-bg); }
body { margin: 0; min-width: 0; min-height: 100vh; min-height: 100dvh; color: var(--fit-ink); background: var(--fit-bg); }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid var(--fit-cyan); outline-offset: 3px; }
img, svg { display: block; max-width: 100%; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: fixed; z-index: 20; top: 10px; left: 10px; transform: translateY(-180%); padding: .7rem 1rem; color: #00101c; background: var(--fit-lime); border-radius: 999px; }
.skip-link:focus { transform: none; }

/* Shared authenticated surfaces */
.app-page {
  background:
    radial-gradient(circle at 12% 12%, rgba(3, 200, 219, .13), transparent 31rem),
    radial-gradient(circle at 88% 84%, rgba(118, 222, 17, .1), transparent 30rem),
    linear-gradient(135deg, #000916, #001d36 62%, #002231);
}
.app-page::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .18;
  background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, black, transparent 80%);
}
.app-header { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; max-width: 1240px; margin: 0 auto; padding: 1.4rem clamp(1rem, 4vw, 3rem); }
.app-header img { display: block; width: min(190px, 42vw); height: auto; }
.language-switch { display: flex; align-items: center; gap: .3rem; color: var(--fit-muted); white-space: nowrap; }
.language-switch button { min-width: 30px; min-height: 44px; border: 0; padding: .35rem; color: var(--fit-muted); background: transparent; }
.language-switch button[aria-pressed="true"] { color: var(--fit-lime); }
.auth-shell { position: relative; z-index: 1; display: grid; min-height: calc(100vh - 100px); min-height: calc(100dvh - 100px); padding: 4vh 1rem 10vh; place-items: center; }
.auth-card { width: min(100%, 600px); border: 1px solid rgba(176, 214, 237, .2); border-radius: 24px; padding: clamp(1.5rem, 5vw, 3.25rem); background: rgba(4, 28, 54, .86); box-shadow: 0 28px 90px rgba(0, 0, 0, .38); backdrop-filter: blur(18px); }
.auth-card .eyebrow { margin: 0 0 .75rem; color: var(--fit-cyan); font-size: .76rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.auth-card h1 { margin: 0; font-size: clamp(2rem, 7vw, 3.8rem); line-height: .98; letter-spacing: -.035em; }
.auth-card .lead { margin: 1rem 0 2rem; color: var(--fit-muted); line-height: 1.65; }
.auth-card form { display: grid; gap: .75rem; }
.auth-card label { margin-top: .35rem; font-size: .88rem; font-weight: 700; }
.auth-card input { width: 100%; border: 1px solid rgba(176, 214, 237, .2); border-radius: 13px; outline: 0; padding: .92rem 1rem; color: var(--fit-ink); background: rgba(0, 8, 20, .72); transition: border-color .2s, box-shadow .2s; }
.auth-card input:focus { border-color: var(--fit-cyan); box-shadow: 0 0 0 3px rgba(3, 200, 219, .14); }
.primary-button { display: inline-flex; align-items: center; justify-content: center; min-height: 50px; margin-top: .7rem; border: 0; border-radius: 999px; padding: .82rem 1.2rem; color: #00101c; background: var(--fit-voice-gradient); font-weight: 850; }
.button-spinner { display: none; width: 17px; height: 17px; margin-left: .6rem; border: 2px solid rgba(0, 16, 28, .25); border-top-color: #00101c; border-radius: 50%; animation: spin .7s linear infinite; }
form.is-busy .button-spinner { display: inline-block; }
.privacy-note { margin: 1.1rem 0 0; color: var(--fit-muted); font-size: .75rem; line-height: 1.5; }

/* Login V2 */
.login-v2-page {
  color-scheme: light;
  position: relative;
  overflow-x: hidden;
  color: #081a35;
  background: #edf5fa;
}
.login-v2-page::before,
.login-v2-page::after {
  content: "";
  position: fixed;
  z-index: 0;
  width: 520px;
  height: 520px;
  pointer-events: none;
  border: 1px solid rgba(0, 190, 217, .19);
  border-radius: 50%;
}
.login-v2-page::before { top: -350px; left: 28%; }
.login-v2-page::after { right: -330px; bottom: -290px; }
.login-v2-shell {
  position: relative;
  z-index: 1;
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  padding: clamp(1.5rem, 5.2vh, 3rem);
  place-items: center;
}
.login-v2-card {
  display: grid;
  width: min(1344px, 100%);
  min-height: min(806px, calc(100dvh - 3rem));
  grid-template-columns: 52.5% 47.5%;
  overflow: hidden;
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(8, 26, 53, .12);
}
.login-hero {
  position: relative;
  min-width: 0;
  min-height: 100%;
  overflow: hidden;
  color: #fff;
  background: #06172b;
  isolation: isolate;
}
.login-hero-image {
  position: absolute;
  z-index: -2;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: 74% center;
}
.login-hero-shade {
  position: absolute;
  z-index: -1;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(2, 12, 25, .24) 30%, rgba(2, 13, 27, .88) 100%),
    linear-gradient(90deg, rgba(1, 13, 28, .34), transparent 70%);
}
.login-logo-tile {
  position: absolute;
  top: 35px;
  left: 38px;
  display: grid;
  width: min(478px, calc(100% - 76px));
  min-height: 134px;
  border-radius: 20px;
  padding: 1rem 1.2rem;
  background: #fff;
  box-shadow: 0 14px 35px rgba(0, 0, 0, .16);
  place-items: center;
}
.login-logo-tile img { width: 100%; height: auto; }
.login-hero-copy { position: absolute; right: 48px; bottom: 72px; left: 48px; text-shadow: 0 2px 18px rgba(0, 0, 0, .55); }
.login-hero-copy h1 { max-width: 520px; margin: 0; font-size: clamp(2.5rem, 4vw, 3.65rem); line-height: .98; letter-spacing: -.045em; }
.login-hero-copy p { margin: 1.5rem 0 0; color: rgba(255, 255, 255, .9); font-size: 1.22rem; }
.login-form-panel { position: relative; display: grid; min-width: 0; padding: 3.2rem clamp(2.4rem, 5vw, 4.6rem); background: #fff; place-items: center; }
.login-language-switch { position: absolute; top: 1.3rem; right: 1.7rem; display: flex; align-items: center; gap: .2rem; color: #607691; font-size: .72rem; }
.login-language-switch button { min-width: 38px; min-height: 44px; border: 0; padding: .35rem; color: #607691; background: transparent; font-weight: 800; }
.login-language-switch button[aria-pressed="true"] { color: #087eb5; }
.login-form-wrap { width: min(510px, 100%); }
.login-form-wrap h2 { margin: 0; color: #081a35; font-size: clamp(2.55rem, 4vw, 3.15rem); line-height: 1; letter-spacing: -.045em; }
.login-lead { max-width: 470px; margin: 1.25rem 0 2.7rem; color: #536b88; font-size: 1.05rem; line-height: 1.55; }
.login-status { margin: -1.35rem 0 1.35rem; border: 1px solid #e8a4ad; border-radius: 12px; padding: .8rem 1rem; color: #7c1f2b; background: #fff1f3; line-height: 1.4; }
.login-form { display: grid; gap: 1.45rem; }
.login-field { display: grid; gap: .55rem; }
.login-field > label { color: #081a35; font-size: .76rem; font-weight: 850; }
.login-input-shell { position: relative; display: flex; min-height: 66px; align-items: center; border: 1px solid #c5d7e5; border-radius: 14px; color: #66809d; background: #fbfdff; transition: border-color .18s, box-shadow .18s, background .18s; }
.login-input-shell:focus-within { border-color: #078fca; background: #fff; box-shadow: 0 0 0 4px rgba(3, 200, 219, .14); }
.login-input-shell > svg { width: 23px; margin-left: 1.25rem; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.login-input-shell input { width: 100%; min-width: 0; min-height: 64px; border: 0; outline: 0; padding: .8rem 1.2rem; color: #081a35; background: transparent; font-size: 1rem; }
.login-input-shell input::placeholder { color: #7d92aa; opacity: 1; }
.login-input-shell:has(input[aria-invalid="true"]) { border-color: #c93d4e; box-shadow: 0 0 0 3px rgba(201, 61, 78, .1); }
.password-toggle { display: grid; width: 48px; min-width: 48px; height: 48px; margin-right: .45rem; border: 0; border-radius: 10px; padding: 11px; color: #607b99; background: transparent; place-items: center; }
.password-toggle svg { width: 26px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.password-toggle[aria-pressed="true"] .password-toggle-slash { display: none; }
.field-error { margin: 0; color: #a32838; font-size: .78rem; line-height: 1.35; }
.login-submit { display: grid; min-height: 70px; grid-template-columns: 1fr auto; align-items: center; margin-top: .65rem; border: 0; border-radius: 14px; padding: .9rem 1.55rem; color: #061629; background: linear-gradient(90deg, #77df0b, #00bed9); box-shadow: 0 13px 30px rgba(0, 190, 217, .18); font-size: 1.13rem; font-weight: 850; }
.login-submit [data-submit-label] { justify-self: center; transform: translateX(12px); }
.login-submit-arrow { font-size: 1.8rem; font-weight: 500; line-height: 1; }
.login-submit:disabled { cursor: wait; opacity: .72; }
.login-form.is-busy .login-submit-arrow { display: none; }
.login-form.is-busy .button-spinner { display: block; justify-self: end; }
.login-security-note { display: grid; min-height: 84px; grid-template-columns: 32px 1fr; align-items: center; gap: 1rem; margin-top: 2.55rem; border: 1px solid #d5e3ec; border-radius: 14px; padding: 1rem 1.25rem; color: #081a35; background: #f3f8fb; }
.login-security-note > svg { width: 29px; fill: none; stroke: #2879a9; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.login-security-note strong { display: block; font-size: .9rem; }
.login-security-note p { margin: .35rem 0 0; color: #607691; font-size: .84rem; line-height: 1.4; }

@media (max-width: 820px) {
  .login-v2-page { overflow-x: hidden; background: #eaf4fa; }
  .login-v2-page::before, .login-v2-page::after { display: none; }
  .login-v2-shell { display: block; min-height: 100dvh; padding: 0 0 max(.75rem, env(safe-area-inset-bottom)); }
  .login-v2-card { display: block; width: 100%; min-height: 100dvh; overflow: visible; border-radius: 0; background: transparent; box-shadow: none; }
  .login-hero { height: clamp(226px, 60vw, 248px); min-height: 226px; }
  .login-hero-image { object-position: 72% center; }
  .login-hero-shade { background: linear-gradient(180deg, rgba(2, 12, 25, .14) 24%, rgba(2, 13, 27, .86) 100%); }
  .login-logo-tile { top: calc(1.1rem + env(safe-area-inset-top)); left: 50%; width: min(322px, calc(100% - 3rem)); min-height: 89px; border-radius: 16px; padding: .6rem .8rem; transform: translateX(-50%); }
  .login-hero-copy { right: 1.625rem; bottom: 1.05rem; left: 1.625rem; }
  .login-hero-copy h1 { font-size: clamp(1.72rem, 8vw, 2rem); line-height: 1.04; }
  .login-hero-copy p { margin-top: .5rem; font-size: .91rem; }
  .login-form-panel { display: block; width: calc(100% - 1.5rem); max-width: 720px; margin: -5px auto 0; border-radius: 24px; padding: 1.55rem 1.5rem 1.25rem; }
  .login-language-switch { top: 1rem; right: 1.15rem; }
  .login-language-switch button { min-width: 34px; }
  .login-form-wrap h2 { padding-right: 5.4rem; font-size: 2.2rem; }
  .login-lead { margin: .75rem 0 1.45rem; padding-right: .4rem; font-size: .91rem; line-height: 1.48; }
  .login-status { margin: -.35rem 0 1rem; font-size: .84rem; }
  .login-form { gap: 1rem; }
  .login-field { gap: .4rem; }
  .login-input-shell { min-height: 56px; }
  .login-input-shell input { min-height: 54px; padding: .65rem .95rem; }
  .login-input-shell > svg { width: 21px; margin-left: .9rem; }
  .login-submit { min-height: 56px; margin-top: .25rem; font-size: 1rem; }
  .login-security-note { min-height: 74px; margin-top: 1.15rem; padding: .8rem 1rem; }
}

@media (max-width: 350px) {
  .login-logo-tile { width: calc(100% - 2.5rem); }
  .login-hero-copy { right: 1.25rem; left: 1.25rem; }
  .login-form-panel { margin-inline: .5rem; padding-inline: 1.15rem; }
  .login-language-switch { right: .7rem; }
  .login-form-wrap h2 { padding-right: 4.7rem; }
}

/* Voice welcome and real minimal conversation */
.coach-page { position: relative; height: 100vh; height: var(--fit-viewport-height); overflow: hidden; background: radial-gradient(circle at 80% 18%, rgba(0, 165, 196, .19), transparent 32rem), linear-gradient(145deg, #020c1c, #062036); }
.coach-page::before {
  background:
    radial-gradient(circle, rgba(3, 200, 219, .8) 0 1px, transparent 1.7px) 8% 9% / 180px 170px,
    radial-gradient(circle at 20% 65%, transparent 0 16rem, rgba(3, 200, 219, .16) 16.05rem 16.12rem, transparent 16.2rem),
    radial-gradient(circle at 92% 2%, transparent 0 14rem, rgba(3, 200, 219, .18) 14.05rem 14.12rem, transparent 14.2rem);
  opacity: .7;
  mask-image: none;
}
.coach-shell { position: relative; z-index: 1; display: grid; width: 100%; height: 100%; min-height: 0; padding: clamp(2rem, 7vh, 4.5rem) 1rem; place-items: center; }
.loading-panel { display: grid; min-height: 55vh; place-items: center; align-content: center; gap: 1rem; color: var(--fit-muted); text-align: center; }
.loader { width: 38px; height: 38px; border: 3px solid rgba(255,255,255,.14); border-top-color: var(--fit-lime); border-radius: 50%; animation: spin .8s linear infinite; }
.text-button, .logout-button { min-height: 44px; border: 1px solid rgba(164, 184, 207, .3); border-radius: 999px; padding: .55rem .8rem; color: var(--fit-ink); background: transparent; }
.coach-panel { display: flex; width: min(800px, calc(100vw - 2rem)); height: min(766px, calc(100% - 1rem)); min-height: 0; flex-direction: column; overflow: hidden; border: 1px solid var(--fit-line); border-radius: 31px; background: rgba(7, 26, 47, .96); box-shadow: 0 30px 90px rgba(0, 0, 0, .4); }
.coach-header { display: flex; min-height: 72px; flex: 0 0 auto; align-items: center; justify-content: space-between; gap: 1rem; padding: .8rem 2rem; border-bottom: 1px solid rgba(164, 184, 207, .12); }
.mini-brand, .welcome-eyebrow { color: #7be4ef; font-size: .72rem; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
.coach-tools { display: flex; min-width: 0; align-items: center; gap: .65rem; }
.icon-button { display: grid; width: 48px; height: 48px; flex: 0 0 auto; border: 1px solid rgba(80, 205, 239, .5); border-radius: 15px; padding: 11px; color: var(--fit-ink); background: rgba(13, 49, 78, .72); place-items: center; }
.icon-button svg, .talk-button svg, .record-button svg, .microphone-orbit svg { width: 100%; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sound-toggle[aria-pressed="false"] { color: var(--fit-muted); opacity: .7; }
.user-label { max-width: 100px; overflow: hidden; color: var(--fit-muted); font-size: .75rem; text-overflow: ellipsis; white-space: nowrap; }
.logout-button { border: 0; padding-inline: .5rem; color: var(--fit-muted); font-size: .75rem; }
.welcome-view { min-height: 0; flex: 1 1 auto; overflow-y: auto; }
.idle-state { display: flex; min-height: 682px; align-items: center; flex-direction: column; padding: 2.85rem 2rem 1.4rem; text-align: center; }
.welcome-eyebrow { margin: 0 0 2.1rem; }
.logo-tile, .compact-logo-tile { display: grid; border-radius: 20px; padding: 1.1rem; background: #fff; box-shadow: 0 12px 36px rgba(0, 0, 0, .2); place-items: center; }
.logo-tile { width: min(468px, 100%); }
.logo-tile img, .compact-logo-tile img { width: 100%; height: auto; }
.idle-state h1, .voice-state h1, .chat-heading h1 { margin: 0; letter-spacing: -.035em; }
.idle-state h1 { margin-top: .72rem; font-size: clamp(2rem, 4vw, 2.55rem); }
.welcome-prompt { margin: 1.25rem 0 0; color: #c5d5e7; font-size: 1.25rem; }
.fit-waveform { display: flex; align-items: center; justify-content: center; gap: 4px; }
.fit-waveform i { display: block; width: 4px; height: 4px; border-radius: 999px; background: var(--fit-cyan); }
.fit-waveform i:nth-child(3n) { height: 7px; background: var(--fit-blue); }
.fit-waveform i:nth-child(4n) { height: 10px; background: var(--fit-lime); }
.fit-waveform i:nth-child(7n) { height: 15px; }
.idle-waveform { width: min(472px, 100%); min-height: 38px; margin-top: 3.3rem; }
.mic-chip { display: inline-flex; min-height: 36px; align-items: center; gap: .65rem; margin: 1.3rem 0 0; border: 1px solid rgba(80, 205, 239, .38); border-radius: 999px; padding: .35rem 1rem; color: #bfd0e2; background: rgba(14, 58, 80, .48); font-size: .8rem; }
.mic-chip > span:first-child { width: 7px; height: 7px; border-radius: 50%; background: #82abc2; }
.welcome-actions { display: grid; width: min(410px, 100%); grid-template-columns: 1fr 1fr; gap: 1.15rem; margin-top: 1.5rem; }
.welcome-button { display: inline-flex; min-height: 72px; align-items: center; justify-content: center; gap: .8rem; border: 1px solid #16b8f4; border-radius: 17px; padding: .85rem 1.2rem; color: var(--fit-ink); background: transparent; font-size: 1.05rem; font-weight: 800; }
.welcome-button > span[aria-hidden="true"] { font-size: 1.3rem; }
.talk-button { border: 0; color: #031426; background: var(--fit-voice-gradient); }
.talk-button svg { width: 22px; }
.playback-hint { margin: 1.25rem 0 0; color: #819bb7; font-size: .7rem; }
.voice-caption { margin: 1.1rem 0 0; color: #6989a7; font-size: .64rem; letter-spacing: .11em; }

.voice-state { display: flex; min-height: 682px; align-items: center; flex-direction: column; padding: 1.7rem 2rem 1.4rem; text-align: center; }
.compact-logo-tile { width: min(270px, 78vw); border-radius: 18px; padding: .75rem; }
.microphone-orbit { position: relative; display: grid; width: 220px; height: 220px; margin-top: 3.25rem; border: 1px solid var(--fit-cyan); border-radius: 50%; color: var(--fit-ink); background: radial-gradient(circle, rgba(3, 200, 219, .11) 0 31%, transparent 32%); place-items: center; }
.microphone-orbit::before, .microphone-orbit::after { content: ""; position: absolute; border-radius: 50%; }
.microphone-orbit::before { inset: 16px; border: 2px solid var(--fit-lime); }
.microphone-orbit::after { inset: 34px; border: 1px solid var(--fit-cyan); }
.microphone-orbit svg { width: 48px; }
.recording-waveform { min-height: 54px; margin-top: 1.15rem; }
.recording-waveform i { height: 12px; }
.recording-waveform i:nth-child(3n) { height: 26px; }
.recording-waveform i:nth-child(4n) { height: 38px; }
.recording-waveform i:nth-child(7n) { height: 50px; }
.voice-state h1 { margin-top: .25rem; font-size: 2rem; }
.voice-helper { margin: .7rem 0 0; color: #bfd0e2; }
.stop-recording { display: inline-flex; width: min(390px, 100%); min-height: 64px; align-items: center; justify-content: center; gap: .9rem; margin-top: 2rem; border: 1px solid var(--fit-cyan); border-radius: 17px; color: var(--fit-ink); background: rgba(12, 50, 72, .72); font-weight: 800; }
.stop-recording > span:first-child { width: 14px; height: 14px; border-radius: 3px; background: #fff; }
.recording-status { display: inline-flex; align-items: center; gap: .5rem; margin: 1rem 0 0; color: #bfd0e2; font-size: .75rem; }
.recording-status > span:first-child { width: 8px; height: 8px; border-radius: 50%; background: var(--fit-danger); }
.voice-error-actions { display: grid; width: min(390px, 100%); grid-template-columns: 1fr 1fr; gap: .75rem; margin-top: 2rem; }
.secondary-button { min-height: 52px; border: 1px solid var(--fit-cyan); border-radius: 14px; color: var(--fit-ink); background: rgba(12, 50, 72, .72); font-weight: 750; }
.coach-panel[data-state="listening"] .microphone-orbit { box-shadow: 0 0 40px rgba(3, 200, 219, .2); animation: breathe 1.8s ease-in-out infinite; }
.coach-panel[data-state="listening"] .recording-waveform i { animation: recordPulse .9s ease-in-out infinite alternate; }
.coach-panel[data-state="listening"] .recording-waveform i:nth-child(2n) { animation-delay: -.25s; }
.coach-panel[data-state="listening"] .recording-waveform i:nth-child(3n) { animation-delay: -.5s; }

.chat-view { display: flex; min-height: 0; flex: 1 1 auto; flex-direction: column; overflow: hidden; padding: .75rem 2.4rem 1rem; }
.chat-heading { display: grid; grid-template-columns: 48px 1fr auto; align-items: center; gap: 1rem; padding: .8rem 0 1.2rem; border-bottom: 1px solid rgba(164, 184, 207, .16); }
.chat-heading .welcome-eyebrow { margin: 0 0 .3rem; }
.chat-heading h1 { font-size: 1.6rem; }
.back-button { width: 44px; height: 44px; border: 1px solid rgba(80, 205, 239, .35); border-radius: 50%; color: var(--fit-ink); background: rgba(12, 50, 72, .5); font-size: 1.25rem; }
.turn-count { color: var(--fit-muted); font-size: .75rem; white-space: nowrap; }
.status-message { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin: 1rem 0 0; border: 1px solid rgba(255, 123, 136, .38); border-radius: 12px; padding: .75rem .9rem; color: #ffd1d5; background: rgba(92, 17, 31, .28); font-size: .86rem; }
.status-retry { min-height: 44px; flex: 0 0 auto; border: 1px solid currentColor; border-radius: 999px; padding: .4rem .75rem; color: inherit; background: transparent; }
.conversation { display: flex; min-height: 0; flex: 1 1 auto; flex-direction: column; gap: .8rem; overflow-x: hidden; overflow-y: auto; margin: .75rem 0; padding: .4rem .3rem .8rem; overscroll-behavior-y: contain; scrollbar-gutter: stable; touch-action: pan-y; -webkit-overflow-scrolling: touch; }
.conversation:focus-visible { outline: 2px solid var(--fit-cyan); outline-offset: -2px; }
.conversation-empty { display: grid; width: min(100%, 620px); min-height: 100%; align-content: center; align-self: center; padding: 1rem 0 1.5rem; text-align: center; }
.conversation-empty[hidden] { display: none; }
.empty-kicker { margin: 0 0 .55rem; color: #7be4ef; font-size: .68rem; font-weight: 850; letter-spacing: .16em; }
.conversation-empty h2 { margin: 0; font-size: clamp(1.45rem, 4vw, 2rem); letter-spacing: -.03em; }
.conversation-empty > p:not(.empty-kicker) { margin: .65rem 0 0; color: var(--fit-muted); line-height: 1.5; }
.quick-starts { display: grid; grid-template-columns: 1fr 1fr; gap: .65rem; margin-top: 1.4rem; }
.quick-starts button { min-height: 52px; border: 1px solid rgba(80, 205, 239, .3); border-radius: 14px; padding: .7rem .85rem; color: var(--fit-ink); background: rgba(12, 50, 72, .48); font-size: .86rem; font-weight: 750; text-align: left; }
.quick-starts button:hover { border-color: rgba(118, 222, 17, .72); background: rgba(12, 59, 76, .72); }
.message { max-width: min(82%, 640px); border-radius: 17px; padding: .8rem 1rem; line-height: 1.5; overflow-wrap: anywhere; }
.message.user { align-self: flex-end; border-bottom-right-radius: 5px; color: #031426; background: var(--fit-voice-gradient); }
.message.user .message-content { white-space: pre-wrap; }
.message.assistant { align-self: flex-start; border: 1px solid rgba(126, 164, 195, .25); border-bottom-left-radius: 5px; color: #f5fbff; background: rgba(2, 16, 32, .88); }
.message-content p { margin: 0; }
.message-content p + p, .message-content ul + p, .message-content ol + p, .message-content p + ul, .message-content p + ol { margin-top: .7rem; }
.message-content ul, .message-content ol { margin: .6rem 0 0; padding-left: 1.25rem; }
.message-content li + li { margin-top: .35rem; }
.message.typing { width: 74px; min-height: 46px; align-items: center; flex-direction: row; gap: 5px; }
.message.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--fit-cyan); animation: typingPulse .9s ease-in-out infinite alternate; }
.message.typing i:nth-child(2) { animation-delay: -.3s; }
.message.typing i:nth-child(3) { animation-delay: -.6s; }
.message-actions { margin-top: .6rem; }
.speak-button { min-height: 44px; border: 0; padding: .25rem .15rem; color: #70e8ef; background: transparent; font-size: .8rem; font-weight: 700; }
.sound-off .speak-button { display: none; }
.composer { display: grid; min-width: 0; flex: 0 0 auto; grid-template-columns: minmax(0, 1fr) auto; gap: .55rem; padding: .55rem; border: 1px solid rgba(80, 205, 239, .35); border-radius: 18px; background: rgba(1, 13, 29, .92); box-shadow: 0 -10px 32px rgba(0, 8, 20, .18); }
.composer:focus-within { border-color: rgba(3, 200, 219, .78); box-shadow: 0 0 0 3px rgba(3, 200, 219, .12); }
.composer textarea { width: 100%; min-width: 0; min-height: 48px; max-height: min(144px, 28dvh); resize: none; border: 0; outline: 0; padding: .76rem .7rem; color: var(--fit-ink); background: transparent; line-height: 1.42; overflow-y: auto; }
.composer textarea::placeholder { color: #819bb7; }
.composer-actions { display: flex; align-items: center; gap: .55rem; }
.record-button, .send-button { min-width: 48px; min-height: 48px; border-radius: 14px; }
.record-button { border: 1px solid rgba(80, 205, 239, .4); padding: 12px; color: var(--fit-cyan); background: rgba(12, 50, 72, .6); }
.record-button svg { width: 22px; }
.send-button { border: 0; padding: .7rem 1.1rem; color: #031426; background: var(--fit-voice-gradient); font-weight: 800; }
audio { width: 100%; }
.playback-bar { display: grid; flex: 0 0 auto; grid-template-columns: 1fr auto; align-items: center; gap: .6rem; margin-top: .55rem; }
.stop-audio-button { min-height: 44px; border: 1px solid rgba(80, 205, 239, .4); border-radius: 12px; padding: .5rem .75rem; color: var(--fit-ink); background: rgba(12, 50, 72, .72); }
.coach-panel[data-state="speaking"] .playback-bar { border-radius: 12px; box-shadow: 0 0 0 2px var(--fit-lime); }
.chat-view > .privacy-note { flex: 0 0 auto; margin: .55rem 0 0; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes breathe { 50% { transform: scale(1.035); box-shadow: 0 0 58px rgba(118, 222, 17, .25); } }
@keyframes recordPulse { to { transform: scaleY(.55); opacity: .75; } }
@keyframes typingPulse { to { transform: translateY(-3px); opacity: .45; } }

@media (max-width: 700px) {
  .coach-shell { display: block; width: 100%; height: 100%; min-height: 0; padding: 0; }
  .coach-panel { width: 100%; height: 100%; min-height: 0; overflow: hidden; border: 0; border-radius: 0; box-shadow: none; }
  .coach-header { min-height: 64px; gap: .4rem; padding: max(.55rem, env(safe-area-inset-top)) max(.75rem, env(safe-area-inset-right)) .5rem max(.75rem, env(safe-area-inset-left)); }
  .mini-brand { font-size: .62rem; letter-spacing: .13em; }
  .coach-tools { gap: .25rem; }
  .coach-tools .language-switch { font-size: .68rem; }
  .coach-tools .language-switch button { min-width: 25px; padding: .15rem; }
  .icon-button { width: 44px; height: 44px; border-radius: 14px; padding: 10px; }
  .user-label { display: none; }
  .logout-button { min-height: 44px; padding-inline: .35rem; font-size: .66rem; }
  .welcome-view, .chat-view { min-height: 0; }
  .idle-state, .voice-state { min-height: 100%; }
  .idle-state { min-width: 0; padding: 6.55rem max(1.625rem, env(safe-area-inset-right)) calc(1.2rem + env(safe-area-inset-bottom)) max(1.625rem, env(safe-area-inset-left)); }
  .welcome-eyebrow { margin-bottom: 2.1rem; font-size: .68rem; letter-spacing: .16em; }
  .logo-tile { width: min(322px, 100%); min-height: 110px; padding: .8rem; border-radius: 20px; }
  .idle-state h1 { margin-top: 1.35rem; font-size: clamp(1.65rem, 7.2vw, 1.85rem); }
  .welcome-prompt { margin-top: .55rem; font-size: 1rem; }
  .idle-waveform { min-height: 34px; margin-top: 3.25rem; gap: 3px; }
  .fit-waveform i { width: 3px; }
  .mic-chip { min-height: 34px; margin-top: 1.2rem; }
  .welcome-actions { gap: .9rem; margin-top: 3.05rem; }
  .welcome-button { min-height: 66px; padding: .7rem; font-size: 1rem; }
  .playback-hint { margin-top: 1.35rem; }
  .voice-caption { margin-top: 2.1rem; padding-bottom: env(safe-area-inset-bottom); }
  .voice-state { padding: 2.3rem max(1.625rem, env(safe-area-inset-right)) calc(1.2rem + env(safe-area-inset-bottom)) max(1.625rem, env(safe-area-inset-left)); }
  .compact-logo-tile { width: min(232px, 80%); padding: .65rem; }
  .microphone-orbit { width: 232px; height: 232px; max-width: 72vw; max-height: 72vw; margin-top: 5.1rem; }
  .recording-waveform { margin-top: 1.15rem; gap: 3px; }
  .voice-state h1 { margin-top: .3rem; font-size: 1.75rem; }
  .voice-helper { max-width: 320px; font-size: .9rem; }
  .stop-recording { min-height: 66px; margin-top: 2.15rem; }
  .chat-view { padding: .25rem max(.75rem, env(safe-area-inset-right)) max(.55rem, env(safe-area-inset-bottom)) max(.75rem, env(safe-area-inset-left)); }
  .chat-heading { grid-template-columns: 40px 1fr auto; gap: .6rem; padding: .5rem 0; }
  .chat-heading h1 { font-size: 1.15rem; }
  .chat-heading .welcome-eyebrow { font-size: .58rem; }
  .turn-count { grid-column: auto; margin-top: 0; font-size: .68rem; }
  .conversation { min-height: 0; margin: .35rem 0; padding-inline: .1rem; }
  .conversation-empty { padding: .75rem 0 1rem; }
  .quick-starts { grid-template-columns: 1fr; gap: .5rem; margin-top: 1rem; }
  .quick-starts button { min-height: 48px; }
  .message { max-width: 91%; padding: .72rem .85rem; font-size: .94rem; line-height: 1.46; }
  .composer { grid-template-columns: minmax(0, 1fr) auto; gap: .35rem; padding: .4rem; }
  .composer-actions { gap: .35rem; }
  .record-button, .send-button { min-width: 46px; min-height: 46px; }
  .send-button { padding-inline: .8rem; }
  .playback-bar { grid-template-columns: 1fr; }
  .stop-audio-button { width: 100%; }
  .chat-view > .privacy-note { margin-top: .35rem; padding-bottom: 0; font-size: .68rem; }
}

@media (max-width: 350px) {
  .mini-brand { max-width: 72px; }
  .coach-tools .language-switch span { display: none; }
  .coach-tools .language-switch { gap: 0; }
  .logout-button { width: 44px; overflow: hidden; padding: 0; color: transparent; }
  .logout-button::after { content: "↪"; display: grid; color: var(--fit-muted); font-size: 1rem; place-items: center; }
  .idle-state { padding-top: 4.8rem; }
  .welcome-actions { gap: .6rem; }
  .welcome-button { min-width: 0; }
}

@media (max-height: 760px) and (max-width: 700px) {
  .idle-state { padding-top: 3.5rem; }
  .welcome-eyebrow { margin-bottom: 1.25rem; }
  .idle-waveform { margin-top: 2rem; }
  .welcome-actions { margin-top: 2rem; }
  .voice-caption { margin-top: 1rem; }
  .voice-state { justify-content: flex-start; padding-top: 1rem; }
  .compact-logo-tile { width: min(190px, 65vw); padding: .5rem; }
  .microphone-orbit { width: 168px; height: 168px; max-width: 50vw; max-height: 50vw; margin-top: 1rem; }
  .recording-waveform { min-height: 40px; margin-top: .5rem; }
  .recording-waveform i:nth-child(3n) { height: 20px; }
  .recording-waveform i:nth-child(4n) { height: 30px; }
  .recording-waveform i:nth-child(7n) { height: 38px; }
  .voice-state h1 { font-size: 1.55rem; }
  .voice-helper { margin-top: .4rem; }
  .stop-recording { min-height: 58px; margin-top: .75rem; }
  .recording-status { margin-top: .5rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
