:root {
  --page: #f8fbfa;
  --panel: #ffffff;
  --panel-soft: #fbfdfc;
  --line: #e1ece9;
  --line-strong: #c8ddd8;
  --ink: #152233;
  --muted: #657386;
  --quiet: #8b98aa;
  --mint: #42cfb8;
  --mint-hover: #32bfa8;
  --mint-active: #24a994;
  --mint-pressed: #178f7e;
  --mint-soft: #eefaf7;
  --mint-ring: rgba(66, 207, 184, 0.18);
  --black-button: #101820;
  --black-button-hover: #1b2732;
  --black-button-active: #071018;
  --blue: var(--mint-active);
  --blue-deep: #075e52;
  --cyan: var(--mint);
  --aqua: #67dcc8;
  --button-grad: var(--mint);
  --button-grad-hover: var(--mint-hover);
  --button-shadow: none;
  --button-shadow-strong: none;
  --danger: #c73f4f;
  --space-xs: 8px;
  --space-sm: 12px;
  --space-md: 18px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-xxl: 80px;
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 18px;
  --radius-pill: 999px;
  --control-height: 64px;
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --ease-out-quint: cubic-bezier(0.22, 1, 0.36, 1);
  font-family: "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", system-ui, sans-serif;
}

@property --scan-progress {
  syntax: "<angle>";
  inherits: false;
  initial-value: 38deg;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: #fff;
  padding: 0;
  overflow: hidden;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.tablet-shell {
  width: 100vw;
  min-height: 100vh;
  background: var(--page);
  border: 0;
  border-radius: 0;
  padding: 20px;
  box-shadow: none;
  display: grid;
  grid-template-rows: 68px 1fr;
  gap: 18px;
}

.topbar,
.virtual-panel,
.assessment-panel,
.question-card,
.assistant-message,
.patient-dialog,
.login-card {
  background: var(--panel);
  border: 1px solid var(--line);
}

.topbar {
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  gap: 20px;
}

.is-login .tablet-shell {
  background: #fff;
  grid-template-rows: 78px 1fr;
  gap: 0;
  padding: 0 24px 0;
}

.is-scanning .tablet-shell {
  grid-template-rows: 1fr;
}

.is-login .topbar {
  background: transparent;
  border-color: transparent;
  padding: 0 8px;
}

.is-scanning .topbar {
  display: none;
}

.is-login .brand-logo,
.is-login .brand-mark {
  width: 46px;
  height: 46px;
}

.brand,
.topbar-meta,
.workspace,
.panel-head,
.question-meta,
.nav-row,
.assistant-message,
.camera-tile,
.mode-switch,
.option-row,
.voice-actions {
  display: flex;
  align-items: center;
}

.brand {
  min-width: 0;
  gap: 14px;
}

.brand-logo {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  overflow: hidden;
  display: inline-flex;
  flex-shrink: 0;
  box-shadow: none;
}

.brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--button-grad);
  box-shadow: var(--button-shadow);
  position: relative;
  animation: markSettle 620ms var(--ease-out-quint) both;
}

.brand-mark::before,
.brand-mark::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
}

.brand-mark::before {
  width: 22px;
  height: 9px;
  transform: rotate(-28deg);
}

.brand-mark::after {
  width: 9px;
  height: 22px;
  transform: rotate(32deg);
}

.brand h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.25;
  font-weight: 760;
  letter-spacing: 0;
  white-space: nowrap;
}

.brand p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.topbar-meta {
  gap: 10px;
  flex-shrink: 0;
}

.pill {
  height: 42px;
  padding: 0 14px;
  border-radius: 18px;
  background: #f7faf9;
  border: 1px solid var(--line);
  color: var(--blue-deep);
  font-size: 18px;
  font-weight: 680;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  transition: transform 180ms var(--ease-out-quart), background 180ms var(--ease-out-quart);
}

.mini-icon {
  width: 22px;
  height: 22px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--button-grad);
  position: relative;
  box-shadow: 0 8px 16px rgba(20, 159, 136, 0.22);
}

.mini-icon::before,
.mini-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
}

.mini-icon::before {
  top: 5px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.mini-icon::after {
  bottom: 4px;
  width: 12px;
  height: 7px;
  border-radius: 8px 8px 4px 4px;
}

.exit-button,
.primary-button,
.secondary-button,
.mode-button,
.text-button {
  border: 0;
  min-height: 54px;
  border-radius: var(--radius-md);
  font-size: 20px;
  font-weight: 720;
  letter-spacing: 0;
}

.exit-button {
  height: 44px;
  min-height: 44px;
  padding: 0 18px;
  color: #fff;
  background: var(--button-grad);
  box-shadow: var(--button-shadow);
  font-size: 18px;
}

.workspace {
  min-height: 0;
  gap: 20px;
  align-items: stretch;
}

.is-login .assessment-meta,
.is-login .workspace {
  display: none;
}

body:not(.is-login) .login-screen {
  display: none;
}

.face-scan-screen {
  display: none;
}

.is-scanning .login-screen {
  display: none;
}

.is-scanning .face-scan-screen {
  display: grid;
}

.login-screen {
  min-height: 0;
  border-radius: 0;
  background: #fff;
  border: 0;
  display: grid;
  grid-template-rows: auto auto auto;
  align-content: center;
  place-items: center;
  padding: clamp(14px, 2.4vw, 30px) clamp(28px, 5vw, 64px) clamp(22px, 3vw, 34px);
  gap: 80px;
  animation: loginIn 420ms var(--ease-out-quint) both;
}

.face-scan-screen {
  min-height: 0;
  background: #fff;
  border: 0;
  place-items: center;
  grid-template-rows: auto 1fr auto auto;
  padding: clamp(20px, 4vw, 42px);
  position: relative;
  animation: scanPageIn 260ms var(--ease-out-quart) both;
}

.face-scan-screen h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(32px, 4vw, 44px);
  line-height: 1.2;
  font-weight: 760;
  letter-spacing: 0;
  align-self: start;
}

.scan-close {
  position: absolute;
  top: clamp(18px, 3vw, 34px);
  right: clamp(18px, 3vw, 34px);
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  background: #edf5f3;
  box-shadow: 0 8px 20px rgba(28, 46, 64, 0.08);
}

.scan-close::before,
.scan-close::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18px;
  height: 3px;
  border-radius: 999px;
  background: #7a8491;
}

.scan-close::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.scan-close::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.face-scan-wrap {
  width: min(68vw, 650px);
  min-width: 360px;
  aspect-ratio: 16 / 10;
  position: relative;
  display: grid;
  place-items: center;
  align-self: center;
}

.face-scan-ring {
  position: absolute;
  inset: 0;
  border-radius: 34px;
  border: 3px solid rgba(225, 237, 246, 0.92);
  box-shadow:
    0 22px 58px rgba(20, 159, 136, 0.14),
    inset 0 0 0 1px rgba(255, 255, 255, 0.76);
  pointer-events: none;
}

.face-scan-ring::before,
.face-scan-ring::after {
  content: "";
  position: absolute;
  width: 58px;
  height: 58px;
  border-color: var(--blue);
  border-style: solid;
  pointer-events: none;
}

.face-scan-ring::before {
  top: -3px;
  left: -3px;
  border-width: 4px 0 0 4px;
  border-radius: 34px 0 0 0;
}

.face-scan-ring::after {
  right: -3px;
  bottom: -3px;
  border-width: 0 4px 4px 0;
  border-radius: 0 0 34px 0;
}

.face-camera-feed {
  width: calc(100% - 24px);
  height: calc(100% - 24px);
  border-radius: 28px;
  overflow: hidden;
  position: relative;
  z-index: 1;
  background:
    radial-gradient(circle at 50% 35%, rgba(255, 255, 255, 0.14), transparent 36%),
    linear-gradient(135deg, #dcefe9, #f8fcfb 52%, #c7e1da);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.72),
    inset 0 -24px 60px rgba(14, 51, 78, 0.12);
}

.face-camera-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 240ms var(--ease-out-quart);
}

.face-scan-screen.is-camera-live .face-camera-video {
  opacity: 1;
}

.camera-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  color: #607084;
  font-size: 18px;
  font-weight: 680;
  text-align: center;
  transition: opacity 180ms var(--ease-out-quart);
}

.camera-placeholder em {
  color: var(--quiet);
  font-style: normal;
  font-size: 16px;
  font-weight: 620;
}

.camera-placeholder span {
  width: 68px;
  height: 68px;
  border-radius: 26px;
  background: var(--button-grad);
  box-shadow: var(--button-shadow);
  position: relative;
}

.camera-placeholder span::before {
  content: "";
  position: absolute;
  width: 24px;
  height: 17px;
  border: 4px solid #fff;
  border-radius: 7px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -42%);
}

.camera-placeholder span::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  right: 18px;
  top: 24px;
}

.face-scan-screen.is-camera-live .camera-placeholder {
  opacity: 0;
  pointer-events: none;
}

.scan-sweep {
  position: absolute;
  left: 6%;
  right: 6%;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(34, 198, 168, 0.9) 20%, rgba(12, 143, 217, 0.95) 50%, rgba(34, 198, 168, 0.9) 80%, transparent);
  box-shadow: 0 0 24px rgba(34, 198, 168, 0.62);
  animation: scanSweep 1.35s var(--ease-out-quart) infinite;
}

.scan-tip {
  min-width: 226px;
  min-height: 52px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  padding: 0 28px;
  color: #fff;
  background: var(--button-grad);
  box-shadow: var(--button-shadow);
  font-size: 22px;
  font-weight: 720;
  position: relative;
  z-index: 2;
}

.scan-helper {
  margin: 0;
  min-height: 34px;
  color: var(--muted);
  font-size: 20px;
  line-height: 1.5;
  align-self: end;
}

.scan-confirm-button {
  min-width: min(320px, 72vw);
  min-height: 58px;
  padding: 0 34px;
  border-radius: 20px;
  font-size: 21px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: end;
}

.face-scan-screen.is-success .scan-confirm-button {
  display: none;
}

.face-scan-screen.is-success .face-scan-ring {
  animation: successRing 520ms var(--ease-out-quint) both;
  border-color: rgba(32, 201, 151, 0.72);
}

.face-scan-screen.is-success .scan-tip {
  background: linear-gradient(135deg, #20c997, #149f88);
}

.login-unlock {
  display: none;
  align-self: start;
  margin: 0;
  color: var(--ink);
  font-size: 18px;
  font-weight: 650;
  letter-spacing: 0;
}

.login-avatar-wrap {
  width: min(34vw, 390px);
  min-width: 280px;
  aspect-ratio: 1;
  position: relative;
  display: grid;
  place-items: center;
  align-self: end;
  overflow: visible;
  isolation: isolate;
}

.login-avatar-frame {
  position: absolute;
  inset: 13%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 48% 38%, #ffffff 0, #f3fffc 38%, #dffbf5 72%, #d2f4ed 100%);
  border: 1px solid rgba(66, 207, 184, 0.18);
  z-index: 0;
  pointer-events: none;
}

.login-avatar-mask-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 1;
  overflow: visible;
  pointer-events: none;
}

.login-avatar-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
}

.login-dot {
  width: min(260px, 72vw);
  height: 32px;
  position: relative;
  display: grid;
  place-items: center;
}

.login-dot-pulse {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--ink);
  animation: loginDotCycle 2.8s var(--ease-out-quart) infinite;
}

.login-dot-text {
  position: absolute;
  left: 50%;
  top: 50%;
  white-space: nowrap;
  color: var(--ink);
  font-size: 19px;
  line-height: 1.2;
  font-weight: 760;
  letter-spacing: 0;
  transform: translate(-50%, -50%);
  min-width: 9.2em;
  text-align: center;
  opacity: 0;
  transition: opacity 180ms var(--ease-out-quart);
}

.login-dot.is-typing .login-dot-pulse {
  opacity: 0;
  animation: none;
}

.login-dot.is-typing .login-dot-text {
  opacity: 1;
}

.login-dot.is-typing .login-dot-text::after {
  content: "";
  display: inline-block;
  width: 2px;
  height: 1em;
  margin-left: 3px;
  background: currentColor;
  vertical-align: -0.12em;
  animation: loginCaret 760ms steps(1, end) infinite;
}

.login-actions {
  width: min(94vw, 1220px);
  display: grid;
  gap: 14px;
}

.login-main-button,
.login-secondary-button {
  width: 100%;
  min-height: var(--control-height);
  border-radius: var(--radius-pill);
  font-size: 22px;
  box-shadow: none;
}

.login-secondary-button {
  background: var(--black-button);
  color: #fff;
  border: 1px solid var(--black-button);
  box-shadow: none;
}

.visit-inline-form {
  width: min(94vw, 1220px);
  display: none;
  grid-template-columns: 1fr;
  gap: var(--space-sm);
  margin-top: calc(var(--space-xxl) * -0.55);
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: #fff;
  animation: answerEnter 260ms var(--ease-out-quart) both;
}

.visit-inline-form.is-visible {
  display: grid;
}

.visit-form-head {
  display: grid;
  gap: 4px;
  padding: 0 4px;
}

.visit-form-head strong {
  color: var(--ink);
  font-size: 21px;
  line-height: 1.35;
}

.visit-form-head p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.45;
}

.visit-form-row {
  display: grid;
  grid-template-columns: 1fr 180px;
  gap: var(--space-sm);
}

.visit-inline-form input {
  min-width: 0;
  height: var(--control-height);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 0 22px;
  color: var(--ink);
  background: #fff;
  font-size: 21px;
  outline: 0;
  transition: border-color 180ms var(--ease-out-quart), box-shadow 180ms var(--ease-out-quart);
}

.visit-inline-form input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px var(--mint-ring);
}

.visit-form-cancel {
  min-height: 42px;
  justify-self: center;
  font-size: 17px;
}

/* Legacy login blocks kept unused for quick design fallback. */
.login-hero {
  text-align: center;
  max-width: 720px;
}

.login-hero h2 {
  margin: 0;
  color: var(--ink);
  font-size: 42px;
  line-height: 1.22;
  font-weight: 780;
}

.login-hero p:not(.eyebrow) {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 22px;
  line-height: 1.5;
}

.login-card {
  width: min(880px, 100%);
  border-radius: 32px;
  padding: 28px;
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto minmax(320px, 1fr);
  gap: 28px;
  box-shadow: 0 28px 72px rgba(38, 70, 98, 0.12);
}

.scan-panel,
.number-panel {
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 16px;
  min-width: 0;
}

.scan-frame {
  width: 218px;
  height: 218px;
  border-radius: 36px;
  border: 1px solid rgba(20, 159, 136, 0.22);
  background:
    linear-gradient(135deg, rgba(34, 198, 168, 0.12), rgba(20, 159, 136, 0.12)),
    #f8fbfe;
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
}

.scan-frame::before,
.scan-frame::after {
  content: "";
  position: absolute;
  width: 42px;
  height: 42px;
  border-color: var(--cyan);
  border-style: solid;
}

.scan-frame::before {
  top: 18px;
  left: 18px;
  border-width: 3px 0 0 3px;
  border-radius: 16px 0 0 0;
}

.scan-frame::after {
  right: 18px;
  bottom: 18px;
  border-width: 0 3px 3px 0;
  border-radius: 0 0 16px 0;
}

.scan-face {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: var(--button-grad);
  box-shadow: var(--button-shadow);
  position: relative;
}

.scan-face::before,
.scan-face::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
}

.scan-face::before {
  top: 22px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
}

.scan-face::after {
  bottom: 20px;
  width: 44px;
  height: 24px;
  border-radius: 24px 24px 12px 12px;
}

.scan-line {
  position: absolute;
  left: 24px;
  right: 24px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  box-shadow: 0 0 18px rgba(34, 198, 168, 0.65);
  animation: scanLine 2.1s var(--ease-out-quart) infinite;
}

.scan-panel h3,
.number-panel label {
  margin: 0;
  color: var(--ink);
  font-size: 25px;
  font-weight: 780;
}

.scan-panel p,
.number-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
  text-align: center;
}

.login-action {
  width: 218px;
}

.login-divider {
  display: grid;
  place-items: center;
  color: var(--quiet);
  font-size: 18px;
  position: relative;
}

.login-divider::before {
  content: "";
  width: 1px;
  height: 100%;
  background: var(--line);
  position: absolute;
}

.login-divider span {
  background: #fff;
  z-index: 1;
  padding: 12px 0;
}

.number-panel {
  justify-items: stretch;
}

.number-panel label {
  text-align: left;
}

.visit-input-row {
  display: grid;
  grid-template-columns: 1fr 116px;
  gap: 12px;
}

.visit-input-row input {
  min-width: 0;
  height: 58px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 0 18px;
  color: var(--ink);
  background: #fff;
  font-size: 21px;
  outline: 0;
  transition: border-color 180ms var(--ease-out-quart), box-shadow 180ms var(--ease-out-quart), transform 180ms var(--ease-out-quart);
}

.visit-input-row input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(34, 198, 168, 0.13);
  transform: translateY(-1px);
}

.virtual-panel {
  width: 344px;
  border-radius: var(--radius-xl);
  padding: 22px;
  display: grid;
  grid-template-rows: auto 284px auto 1fr;
  gap: 22px;
}

.panel-head {
  justify-content: space-between;
  gap: 14px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
}

.panel-head h2,
.assistant-copy h3 {
  margin: 0;
  font-size: 25px;
  line-height: 1.25;
  letter-spacing: 0;
}

.state-badge {
  min-width: 52px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  color: var(--blue);
  background: #f4faf8;
  border: 1px solid var(--line);
  font-size: 18px;
  font-weight: 780;
  transition: color 240ms var(--ease-out-quart), background 240ms var(--ease-out-quart), transform 240ms var(--ease-out-quart);
}

.avatar-stage {
  border-radius: 32px;
  background:
    linear-gradient(145deg, rgba(234, 244, 255, 0.78), rgba(255, 255, 255, 0.74)),
    #f4fbf9;
  border: 1px solid #dfeeea;
  overflow: hidden;
  display: grid;
  place-items: center;
  position: relative;
  transition: border-color 260ms var(--ease-out-quart), background 260ms var(--ease-out-quart);
}

.avatar-stage::before {
  content: "";
  position: absolute;
  inset: 18px;
  border-radius: 30px;
  border: 1px solid rgba(20, 159, 136, 0.08);
}

.avatar-video-slot {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  position: relative;
}

.avatar-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  position: relative;
  z-index: 2;
}

.is-hidden {
  display: none;
}

.avatar-video:not(.is-hidden) + .avatar-orbit {
  display: none;
}

.avatar-orbit {
  width: 188px;
  height: 188px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 45% 42%, rgba(255, 255, 255, 0.78), rgba(42, 167, 162, 0.24) 34%, rgba(20, 159, 136, 0.18) 55%, transparent 72%);
  animation: breathe 2.4s ease-in-out infinite;
}

.avatar-core {
  width: 108px;
  height: 108px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.28), transparent 42%),
    var(--button-grad);
  box-shadow:
    inset 0 0 24px rgba(255, 255, 255, 0.22),
    0 22px 52px rgba(20, 159, 136, 0.28);
}

.avatar-face {
  width: 42px;
  height: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.avatar-face span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.76);
  animation: eyeFocus 3.2s ease-in-out infinite;
}

.virtual-panel[data-state="thinking"] .avatar-orbit {
  animation-duration: 1.1s;
}

.virtual-panel[data-state="thinking"] .avatar-core {
  animation: thinkingGlow 1.2s ease-in-out infinite;
}

.virtual-panel[data-state="listening"] .avatar-core {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.28), transparent 42%),
    linear-gradient(145deg, var(--aqua), var(--cyan), var(--blue));
}

.virtual-panel.state-pulse .state-badge {
  animation: stateBadgePulse 360ms var(--ease-out-quint);
}

.virtual-panel.state-pulse .assistant-copy {
  animation: copyRefresh 320ms var(--ease-out-quart);
}

.assistant-copy {
  text-align: center;
  padding: 0 8px;
}

.assistant-copy p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
}

.camera-tile {
  align-self: end;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel-soft);
}

.camera-thumb {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: #e7f5f1;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.camera-thumb span {
  width: 26px;
  height: 18px;
  border-radius: 7px;
  border: 3px solid var(--blue-deep);
  position: relative;
}

.camera-thumb span::after {
  content: "";
  position: absolute;
  right: -9px;
  top: 3px;
  border-left: 8px solid var(--blue-deep);
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
}

.camera-tile strong {
  font-size: 18px;
}

.camera-tile p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.assessment-panel {
  flex: 1;
  min-width: 0;
  border-radius: var(--radius-xl);
  padding: 28px;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 22px;
}

.assistant-message {
  max-width: 860px;
  gap: 14px;
  padding: 16px 20px;
  border-radius: var(--radius-lg);
  background: var(--panel-soft);
  transform-origin: left center;
}

.bot-dot {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--button-grad);
  color: var(--blue);
  font-weight: 800;
  box-shadow: 0 12px 28px rgba(20, 159, 136, 0.2);
  position: relative;
}

.bot-dot::before {
  content: "";
  width: 18px;
  height: 14px;
  border-radius: 6px;
  border: 2px solid rgba(255, 255, 255, 0.96);
}

.bot-dot::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
}

.assistant-message p {
  margin: 0;
  color: var(--ink);
  font-size: 20px;
  line-height: 1.5;
}

.question-card {
  border-radius: var(--radius-xl);
  padding: 26px;
  min-height: 476px;
  transform-origin: center top;
  will-change: transform, opacity;
}

.question-card.is-chat-step {
  background:
    linear-gradient(180deg, #fff, #fbfdfc);
}

.question-meta {
  justify-content: space-between;
  gap: 16px;
}

.question-meta span:first-child {
  color: var(--blue);
  font-size: 20px;
  font-weight: 760;
}

.question-meta span:last-child {
  color: var(--blue-deep);
  background: #e9f8f4;
  border-radius: 16px;
  padding: 8px 14px;
  font-size: 18px;
  font-weight: 760;
}

.question-card h2 {
  margin: 16px 0 8px;
  color: var(--ink);
  font-size: 29px;
  line-height: 1.38;
  font-weight: 780;
  letter-spacing: 0;
}

.question-card > p {
  margin: 0;
  color: var(--muted);
  font-size: 20px;
  line-height: 1.45;
}

.divider {
  height: 1px;
  background: var(--line);
  margin: 22px 0;
}

.answer-area {
  display: grid;
  gap: 14px;
}

.chat-step {
  display: grid;
  justify-items: start;
  gap: 18px;
}

.chat-bubble {
  max-width: min(720px, 100%);
  border-radius: 22px 22px 22px 8px;
  padding: 18px 20px;
  background: var(--mint-soft);
  border: 1px solid rgba(66, 207, 184, 0.18);
}

.chat-bubble p {
  margin: 0;
  color: var(--ink);
  font-size: 23px;
  line-height: 1.48;
  font-weight: 680;
}

.chat-input-card {
  width: min(640px, 100%);
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #fff;
  padding: 16px;
}

.chat-input-card span {
  color: var(--muted);
  font-size: 17px;
  font-weight: 680;
}

.chat-input-card input {
  width: 100%;
  height: 58px;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 0 18px;
  color: var(--ink);
  background: #fff;
  font-size: 22px;
  outline: 0;
}

.chat-input-card input:focus {
  border-color: var(--mint-active);
  box-shadow: 0 0 0 4px var(--mint-ring);
}

.chat-choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.chat-choice {
  min-width: 120px;
  min-height: 56px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 0 24px;
  color: var(--ink);
  background: #fff;
  font-size: 21px;
  font-weight: 700;
  transition: transform 160ms var(--ease-out-quart), background 160ms var(--ease-out-quart), border-color 160ms var(--ease-out-quart), color 160ms var(--ease-out-quart);
}

.chat-choice:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  background: var(--mint-soft);
}

.chat-choice.is-selected {
  color: #fff;
  background: var(--mint);
  border-color: var(--mint);
}

.assistant-message.motion-refresh {
  animation: assistantRefresh 320ms var(--ease-out-quart) both;
}

.question-card.motion-forward {
  animation: questionForward 380ms var(--ease-out-quint) both;
}

.question-card.motion-back {
  animation: questionBack 380ms var(--ease-out-quint) both;
}

.answer-area > .motion-enter {
  animation: answerEnter 360ms var(--ease-out-quint) both;
  animation-delay: var(--stagger, 0ms);
}

.option-row {
  width: 100%;
  min-height: 68px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
  padding: 0 20px;
  justify-content: space-between;
  gap: 18px;
  text-align: left;
  transition: background 180ms var(--ease-out-quart), border-color 180ms var(--ease-out-quart), transform 180ms var(--ease-out-quart), box-shadow 180ms var(--ease-out-quart);
  will-change: transform;
}

.option-row:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.option-row.is-selected {
  background: #f7fcfa;
  border-color: var(--blue);
  border-width: 2px;
  box-shadow: 0 10px 22px rgba(7, 94, 82, 0.08);
}

.option-row.just-selected {
  animation: selectedPulse 300ms var(--ease-out-quint);
}

.option-row span:first-child {
  color: var(--ink);
  font-size: 23px;
  line-height: 1.35;
}

.option-row.is-selected span:first-child {
  color: var(--blue-deep);
  font-weight: 720;
}

.radio {
  width: 30px;
  height: 30px;
  border: 2px solid #b9c7d6;
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
}

.option-row.is-selected .radio {
  border-color: var(--blue);
}

.option-row.is-selected .radio::after {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: var(--button-grad);
  animation: radioPop 220ms var(--ease-out-quint) both;
}

.free-input {
  display: grid;
  gap: 16px;
}

.mode-switch {
  gap: 8px;
  padding: 6px;
  border-radius: var(--radius-md);
  background: #f2f8f6;
}

.mode-button {
  flex: 1;
  background: transparent;
  color: var(--muted);
  transition: color 180ms var(--ease-out-quart), background 180ms var(--ease-out-quart), box-shadow 180ms var(--ease-out-quart), transform 180ms var(--ease-out-quart);
}

.mode-button.is-active {
  color: var(--blue);
  background: #fff;
  box-shadow: 0 8px 20px rgba(22, 44, 52, 0.08);
}

.text-entry {
  width: 100%;
  min-height: 160px;
  resize: none;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  color: var(--ink);
  background: #fff;
  font-size: 22px;
  line-height: 1.5;
  outline: 0;
}

.text-entry:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(20, 159, 136, 0.1);
  animation: inputFocus 260ms var(--ease-out-quart);
}

.voice-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel-soft);
  padding: 22px;
  display: grid;
  justify-items: center;
  gap: 12px;
}

.voice-help-tip {
  width: 100%;
  border-radius: 16px;
  padding: 13px 16px;
  color: var(--blue-deep);
  background: #fff;
  border: 1px solid rgba(20, 159, 136, 0.16);
  font-size: 18px;
  line-height: 1.45;
  font-weight: 680;
  text-align: center;
}

.mic-button {
  width: 88px;
  height: 88px;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: var(--button-grad);
  box-shadow: var(--button-shadow-strong);
  position: relative;
}

.mic-button span,
.mic-button::before,
.mic-button::after {
  position: absolute;
  content: "";
  left: 50%;
  transform: translateX(-50%);
}

.mic-button span {
  top: 23px;
  width: 22px;
  height: 32px;
  border: 4px solid #fff;
  border-radius: 13px;
}

.mic-button::before {
  top: 46px;
  width: 42px;
  height: 24px;
  border: 4px solid #fff;
  border-top: 0;
  border-radius: 0 0 22px 22px;
}

.mic-button::after {
  bottom: 17px;
  width: 28px;
  height: 4px;
  border-radius: 999px;
  background: #fff;
}

.voice-panel h3 {
  margin: 0;
  font-size: 24px;
}

.voice-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.5;
  text-align: center;
}

.voice-result {
  width: 100%;
  border-radius: var(--radius-md);
  background: #fff;
  border: 1px solid var(--line);
  padding: 16px;
  color: var(--ink);
  font-size: 20px;
  line-height: 1.5;
  animation: resultAppear 320ms var(--ease-out-quart) both;
}

.voice-actions {
  gap: 10px;
}

.primary-button,
.secondary-button {
  padding: 0 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
}

.primary-button {
  color: #fff;
  background: var(--mint);
  box-shadow: none;
  transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease, border-color 160ms ease;
  will-change: transform;
}

.primary-button:hover,
.exit-button:hover,
.mic-button:hover {
  background: var(--mint-hover);
  box-shadow: none;
  transform: translateY(-1px);
}

.primary-button:active,
.exit-button:active,
.mic-button:active {
  transform: translateY(1px);
  background: var(--mint-pressed);
  box-shadow: none;
}

button.pressing {
  animation: buttonPress 180ms var(--ease-out-quart);
}

.primary-button:disabled,
.secondary-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  box-shadow: none;
}

.secondary-button {
  color: var(--blue-deep);
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: none;
  transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.login-screen .login-secondary-button {
  color: #fff;
  background: var(--black-button);
  border-color: var(--black-button);
  box-shadow: none;
}

.secondary-button:hover {
  color: var(--blue-deep);
  background: var(--mint-soft);
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.secondary-button:active {
  transform: translateY(1px);
  background: #e6f6f2;
}

.login-screen .login-secondary-button:hover {
  color: #fff;
  background: var(--black-button-hover);
  border-color: var(--black-button-hover);
}

.login-screen .login-secondary-button:active {
  background: var(--black-button-active);
  border-color: var(--black-button-active);
}

.text-button {
  color: var(--muted);
  background: transparent;
}

.nav-row {
  justify-content: space-between;
}

.dialog-backdrop {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  background: rgba(14, 30, 46, 0.34);
  padding: 24px;
}

.dialog-backdrop.is-visible {
  display: grid;
  animation: backdropIn 260ms var(--ease-out-quart) both;
}

.dialog-backdrop.is-visible .patient-dialog {
  animation: dialogIn 360ms var(--ease-out-quint) both;
}

.dialog-backdrop.is-leaving {
  animation: backdropOut 180ms var(--ease-out-quart) both;
}

.dialog-backdrop.is-leaving .patient-dialog {
  animation: dialogOut 180ms var(--ease-out-quart) both;
}

.patient-dialog {
  width: min(470px, 100%);
  border-radius: 30px;
  padding: 28px;
  box-shadow: 0 30px 90px rgba(14, 30, 46, 0.22);
  text-align: center;
}

.dialog-icon {
  width: 62px;
  height: 62px;
  margin: 0 auto 12px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--button-grad);
  box-shadow: var(--button-shadow);
  position: relative;
}

.dialog-icon::before,
.dialog-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
}

.dialog-icon::before {
  top: 15px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
}

.dialog-icon::after {
  bottom: 13px;
  width: 31px;
  height: 17px;
  border-radius: 18px 18px 8px 8px;
}

.patient-dialog h2 {
  margin: 0 0 18px;
  font-size: 26px;
}

.patient-dialog dl {
  margin: 0 0 18px;
  padding: 18px;
  border-radius: var(--radius-lg);
  background: var(--panel-soft);
}

.patient-dialog dl div {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.patient-dialog dl div:last-child {
  border-bottom: 0;
}

.patient-dialog dt {
  color: var(--muted);
  font-size: 18px;
}

.patient-dialog dd {
  margin: 0;
  color: var(--ink);
  font-size: 20px;
  font-weight: 760;
}

.dialog-confirm {
  width: 100%;
}

.question-assistant-launcher {
  position: fixed;
  right: clamp(20px, 3vw, 42px);
  bottom: clamp(220px, 26vh, 260px);
  z-index: 20;
  width: 94px;
  min-height: 118px;
  border: 0;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(225, 236, 233, 0.92);
  box-shadow: 0 18px 42px rgba(22, 44, 52, 0.11);
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 8px;
  backdrop-filter: blur(14px);
  transition: transform 180ms var(--ease-out-quart), box-shadow 180ms var(--ease-out-quart), opacity 180ms var(--ease-out-quart);
}

.question-assistant-launcher:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 50px rgba(22, 44, 52, 0.14);
}

body.is-qa-open .question-assistant-launcher {
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px) scale(0.96);
}

.question-assistant-launcher strong {
  min-height: 30px;
  padding: 4px 10px;
  border-radius: 12px;
  color: var(--blue-deep);
  background: #eff8f5;
  border: 1px solid rgba(18, 143, 121, 0.16);
  font-size: 16px;
  line-height: 1.2;
  white-space: nowrap;
}

.qa-robot-icon {
  width: 66px;
  height: 66px;
  border-radius: 50%;
  background: linear-gradient(135deg, #62dec8, #20b79c);
  box-shadow: 0 12px 26px rgba(18, 143, 121, 0.16);
  position: relative;
  display: inline-block;
  flex-shrink: 0;
}

.qa-robot-icon::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 30px;
  height: 24px;
  border: 3px solid #fff;
  border-radius: 9px;
  transform: translate(-50%, -39%);
}

.qa-robot-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 51%;
  width: 18px;
  height: 5px;
  border-left: 4px solid #fff;
  border-right: 4px solid #fff;
  transform: translateX(-50%);
  box-shadow: 0 9px 0 -2px #fff;
}

.qa-robot-icon.is-small {
  width: 34px;
  height: 34px;
  box-shadow: none;
}

.qa-robot-icon.is-small::before {
  width: 17px;
  height: 14px;
  border-width: 2px;
  border-radius: 5px;
}

.qa-robot-icon.is-small::after {
  width: 10px;
  height: 3px;
  border-left-width: 2px;
  border-right-width: 2px;
  box-shadow: 0 5px 0 -1px #fff;
}

.qa-robot-icon.is-mini {
  width: 38px;
  height: 38px;
  box-shadow: 0 8px 18px rgba(18, 143, 121, 0.14);
}

.qa-robot-icon.is-mini::before {
  width: 18px;
  height: 15px;
  border-width: 2px;
  border-radius: 6px;
}

.qa-robot-icon.is-mini::after {
  width: 10px;
  height: 3px;
  border-left-width: 2px;
  border-right-width: 2px;
  box-shadow: 0 5px 0 -1px #fff;
}

.question-assistant-panel {
  position: fixed;
  right: clamp(24px, 4vw, 72px);
  bottom: clamp(24px, 4vw, 54px);
  z-index: 30;
  width: min(640px, calc(100vw - 48px));
  max-height: min(720px, calc(100vh - 56px));
  border-radius: 28px;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(198, 226, 219, 0.92);
  box-shadow: 0 30px 86px rgba(22, 44, 52, 0.18);
  display: none;
  grid-template-rows: auto auto minmax(260px, 1fr) auto auto;
}

.question-assistant-panel.is-open {
  display: grid;
  animation: qaPanelIn 260ms var(--ease-out-quint) both;
}

.question-assistant-panel.is-open + * {
  pointer-events: auto;
}

.qa-panel-head {
  min-height: 74px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--ink);
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.qa-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
  font-weight: 780;
}

.qa-close {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: #f2f6f5;
  position: relative;
}

.qa-close::before,
.qa-close::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18px;
  height: 3px;
  border-radius: 999px;
  background: #80928d;
}

.qa-close::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.qa-close::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.qa-current-question {
  margin: 14px 18px 0;
  padding: 15px 18px;
  border-radius: 16px;
  color: #075e52;
  background: #fbfdfc;
  border: 1px solid var(--line);
  font-size: 19px;
  line-height: 1.45;
  font-weight: 760;
  position: relative;
}

.qa-current-question::before {
  content: "当前题目";
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.2;
  font-weight: 700;
}

.qa-chat-log {
  min-height: 0;
  overflow: auto;
  padding: 18px;
  display: grid;
  align-content: start;
  gap: 14px;
}

.qa-message {
  max-width: 86%;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  animation: qaMessageIn 220ms var(--ease-out-quart) both;
}

.qa-message p {
  margin: 0;
  padding: 13px 16px;
  border-radius: 16px;
  color: var(--ink);
  background: #f5f8fb;
  border: 1px solid var(--line);
  font-size: 18px;
  line-height: 1.55;
}

.qa-message.is-user {
  justify-self: end;
}

.qa-message.is-user p {
  color: #fff;
  background: linear-gradient(135deg, #36c8af, #128f79);
  border-color: transparent;
  box-shadow: 0 10px 24px rgba(18, 143, 121, 0.12);
}

.qa-composer {
  margin: 0 18px 6px;
  padding: 8px;
  min-height: 66px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.72);
  display: grid;
  grid-template-columns: 48px 1fr 52px;
  align-items: center;
  gap: 8px;
}

.qa-composer:focus-within {
  border-color: rgba(20, 159, 136, 0.55);
  box-shadow:
    0 0 0 4px rgba(34, 198, 168, 0.11),
    inset 0 0 0 1px rgba(255, 255, 255, 0.86);
}

.qa-composer input {
  min-width: 0;
  height: 48px;
  border: 0;
  border-radius: 16px;
  padding: 0 8px;
  color: var(--ink);
  background: transparent;
  font-size: 20px;
  outline: 0;
}

.qa-composer-voice,
.qa-composer-send {
  width: 46px;
  height: 46px;
  min-height: 46px;
  border: 0;
  border-radius: 15px;
  position: relative;
  display: grid;
  place-items: center;
}

.qa-composer-voice {
  color: var(--blue-deep);
  background: #f5faf8;
  border: 1px solid var(--line);
}

.qa-composer-voice span {
  width: 14px;
  height: 22px;
  border: 3px solid currentColor;
  border-radius: 10px;
  position: relative;
}

.qa-composer-voice span::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 19px;
  width: 28px;
  height: 18px;
  border: 3px solid currentColor;
  border-top: 0;
  border-radius: 0 0 18px 18px;
  transform: translateX(-50%);
}

.qa-composer-voice span::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 38px;
  width: 24px;
  height: 3px;
  border-radius: 999px;
  background: currentColor;
  transform: translateX(-50%);
}

.qa-composer-send {
  background: var(--button-grad);
  box-shadow: 0 12px 26px rgba(20, 159, 136, 0.22);
}

.qa-composer-send::before {
  content: "";
  width: 17px;
  height: 17px;
  border-top: 4px solid #fff;
  border-right: 4px solid #fff;
  transform: translateX(-2px) rotate(45deg);
  border-radius: 2px;
}

.qa-composer-send::after {
  content: "";
  position: absolute;
  width: 24px;
  height: 4px;
  border-radius: 999px;
  background: #fff;
  transform: translateX(-2px);
}

.qa-voice-status {
  margin: 0;
  min-height: 26px;
  padding: 0 22px 14px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.35;
}

.qa-composer-voice.is-recording {
  color: #fff;
  background: var(--button-grad);
  box-shadow: var(--button-shadow);
  animation: qaRecording 880ms ease-in-out infinite;
}

/* Legacy QA selector/input styles kept unused for fallback. */
.qa-quick-row {
  display: none;
}

.qa-input-row {
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr 100px;
  gap: 10px;
}

.qa-input-row input {
  min-width: 0;
  height: 56px;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 0 18px;
  color: var(--ink);
  background: #fff;
  font-size: 19px;
  outline: 0;
}

.qa-input-row input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(34, 198, 168, 0.13);
}

.qa-voice-button {
  display: none;
  margin: 0 18px 18px;
  min-height: 68px;
  border: 0;
  border-radius: 18px;
  color: #5f6d7c;
  background: #eef7f4;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 21px;
  font-weight: 760;
  transition: background 180ms var(--ease-out-quart), color 180ms var(--ease-out-quart), transform 180ms var(--ease-out-quart);
}

.qa-voice-button span {
  width: 26px;
  height: 20px;
  border-radius: 7px;
  border: 3px solid currentColor;
  position: relative;
}

.qa-voice-button span::before,
.qa-voice-button span::after {
  content: "";
  position: absolute;
  left: 4px;
  right: 4px;
  height: 3px;
  border-radius: 999px;
  background: currentColor;
}

.qa-voice-button span::before {
  top: 4px;
}

.qa-voice-button span::after {
  bottom: 4px;
}

.qa-voice-button.is-recording {
  color: #fff;
  background: var(--button-grad);
  box-shadow: var(--button-shadow);
  animation: qaRecording 880ms ease-in-out infinite;
}

body.is-login .question-assistant-launcher,
body.is-login .question-assistant-panel,
body.is-scanning .question-assistant-launcher,
body.is-scanning .question-assistant-panel {
  display: none;
}

.coach-tip {
  position: fixed;
  z-index: 28;
  right: clamp(128px, 12vw, 180px);
  bottom: clamp(34px, 4vw, 58px);
  width: min(430px, calc(100vw - 42px));
  min-height: 76px;
  padding: 14px 54px 14px 16px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(190, 224, 216, 0.92);
  box-shadow: 0 22px 58px rgba(18, 64, 103, 0.18);
  display: none;
  align-items: center;
  gap: 12px;
  backdrop-filter: blur(16px);
}

.coach-tip.is-visible {
  display: flex;
  animation: coachTipIn 260ms var(--ease-out-quint) both;
}

.coach-tip.is-leaving {
  animation: coachTipOut 180ms var(--ease-out-quart) both;
}

.coach-tip.is-voice {
  left: 50%;
  right: auto;
  bottom: clamp(106px, 15vh, 138px);
  transform: translateX(-50%);
}

.coach-tip-mark {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  background: var(--button-grad);
  box-shadow: 0 12px 24px rgba(20, 159, 136, 0.2);
  position: relative;
  flex-shrink: 0;
}

.coach-tip-mark::before,
.coach-tip-mark::after {
  content: "";
  position: absolute;
  background: #fff;
  border-radius: 999px;
}

.coach-tip-mark::before {
  width: 18px;
  height: 4px;
  left: 13px;
  top: 17px;
}

.coach-tip-mark::after {
  width: 4px;
  height: 18px;
  left: 20px;
  top: 10px;
}

.coach-tip p {
  margin: 0;
  color: var(--ink);
  font-size: 19px;
  line-height: 1.45;
  font-weight: 680;
}

.coach-tip button {
  position: absolute;
  right: 12px;
  top: 12px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: #edf6f3;
}

.coach-tip button::before,
.coach-tip button::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 14px;
  height: 2px;
  border-radius: 999px;
  background: #718094;
}

.coach-tip button::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.coach-tip button::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

body.is-login .coach-tip,
body.is-scanning .coach-tip,
body.is-qa-open .coach-tip {
  display: none;
}

.app-install-prompt {
  position: fixed;
  top: 92px;
  right: 28px;
  z-index: 60;
  width: min(430px, calc(100vw - 56px));
  min-height: 74px;
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(214, 228, 224, 0.95);
  box-shadow: 0 20px 60px rgba(16, 24, 32, 0.13);
  backdrop-filter: blur(18px);
  display: grid;
  grid-template-columns: 50px 1fr auto 36px;
  align-items: center;
  gap: 12px;
  transform: translateY(-14px) scale(0.985);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms var(--ease-out-quart), transform 220ms var(--ease-out-quart);
}

.app-install-prompt.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.app-install-icon {
  width: 50px;
  height: 50px;
  border-radius: 17px;
  overflow: hidden;
  background: #f4fbf9;
  flex-shrink: 0;
}

.app-install-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.app-install-copy {
  min-width: 0;
}

.app-install-copy strong {
  display: block;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.25;
  font-weight: 780;
}

.app-install-copy p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.app-install-action {
  min-width: 108px;
  min-height: 48px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: #101820;
  font-size: 16px;
  font-weight: 760;
}

.app-install-close {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: #f1f5f4;
  position: relative;
}

.app-install-close::before,
.app-install-close::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 15px;
  height: 2px;
  border-radius: 999px;
  background: #718094;
}

.app-install-close::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.app-install-close::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

@keyframes breathe {
  0%,
  100% {
    transform: scale(0.96);
  }
  50% {
    transform: scale(1.05);
  }
}

@keyframes loginDotCycle {
  0%,
  42%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  20%,
  64% {
    opacity: 0.34;
    transform: scale(0.82);
  }
}

@keyframes loginCaret {
  0%,
  52% {
    opacity: 1;
  }
  53%,
  100% {
    opacity: 0;
  }
}

@keyframes loginIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scanLine {
  0% {
    transform: translateY(-78px);
    opacity: 0;
  }
  14%,
  86% {
    opacity: 1;
  }
  100% {
    transform: translateY(78px);
    opacity: 0;
  }
}

@keyframes markSettle {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes eyeFocus {
  0%,
  82%,
  100% {
    transform: scaleY(1);
  }
  88% {
    transform: scaleY(0.24);
  }
}

@keyframes thinkingGlow {
  0%,
  100% {
    transform: scale(1);
    filter: saturate(1);
  }
  50% {
    transform: scale(1.04);
    filter: saturate(1.18);
  }
}

@keyframes stateBadgePulse {
  from {
    transform: translateY(4px);
    opacity: 0.58;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes copyRefresh {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes assistantRefresh {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes questionForward {
  from {
    opacity: 0;
    transform: translateX(22px) scale(0.992);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes questionBack {
  from {
    opacity: 0;
    transform: translateX(-22px) scale(0.992);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes answerEnter {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes selectedPulse {
  0% {
    transform: scale(1);
  }
  45% {
    transform: scale(1.012);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes radioPop {
  from {
    opacity: 0;
    transform: scale(0.45);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes inputFocus {
  from {
    transform: translateY(2px);
  }
  to {
    transform: translateY(0);
  }
}

@keyframes resultAppear {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes qaPanelIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes qaMessageIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes qaRecording {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.012);
  }
}

@keyframes coachTipIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes coachTipOut {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(8px) scale(0.99);
  }
}

@keyframes coachTipInVoice {
  from {
    opacity: 0;
    transform: translate(-50%, 14px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
}

@keyframes coachTipOutVoice {
  from {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
  to {
    opacity: 0;
    transform: translate(-50%, 8px) scale(0.99);
  }
}

.coach-tip.is-visible.is-voice {
  animation-name: coachTipInVoice;
}

.coach-tip.is-leaving.is-voice {
  animation-name: coachTipOutVoice;
}

@keyframes buttonPress {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(0.975);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes backdropIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes backdropOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@keyframes dialogIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes dialogOut {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(10px) scale(0.99);
  }
}

@keyframes scanPageIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scanProgress {
  0% {
    --scan-progress: 38deg;
    transform: rotate(0deg);
  }
  48% {
    --scan-progress: 190deg;
  }
  100% {
    --scan-progress: 330deg;
    transform: rotate(0deg);
  }
}

@keyframes scanSweep {
  0% {
    opacity: 0;
    transform: translateY(-96px);
  }
  16%,
  84% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(96px);
  }
}

@keyframes successRing {
  0% {
    transform: scale(1);
    filter: saturate(1);
  }
  50% {
    transform: scale(1.035);
    filter: saturate(1.18);
  }
  100% {
    transform: scale(1);
    filter: saturate(1.08);
  }
}

@media (max-width: 980px) {
  body {
    padding: 0;
  }

  .tablet-shell {
    min-height: 100vh;
    border-radius: 0;
    padding: 14px;
  }

  .topbar {
    height: auto;
    min-height: 68px;
  }

  .brand p,
  .timer,
  .patient-pill {
    display: none;
  }

  .workspace {
    flex-direction: column;
    overflow: auto;
  }

  .login-screen {
    padding: 24px;
  }

  .login-card {
    grid-template-columns: 1fr;
  }

  .login-divider {
    min-height: 42px;
  }

  .login-divider::before {
    width: 100%;
    height: 1px;
  }

  .virtual-panel {
    width: 100%;
    min-height: 340px;
    grid-template-rows: auto 220px auto;
  }

  .camera-tile {
    display: none;
  }

  .assessment-panel {
    min-height: 620px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
