:root {
  --ink: #17201c;
  --muted: #59645f;
  --paper: #f7f8f3;
  --surface: #ffffff;
  --surface-soft: #f0f5ef;
  --line: #dce3dd;
  --line-strong: #bfcbc3;
  --teal: #08756f;
  --teal-dark: #07534f;
  --red: #b93b2d;
  --gold: #c08a2c;
  --blue: #3766a3;
  --green: #dfeee2;
  --shadow: 0 18px 44px rgba(23, 32, 28, 0.12);
  --header-height: 68px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  line-height: 1.5;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

a {
  color: inherit;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.06;
  letter-spacing: 0;
}

h1 {
  font-size: 64px;
}

h2 {
  font-size: 34px;
}

h3 {
  font-size: 18px;
}

p {
  margin: 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  min-height: var(--header-height);
  align-items: center;
  gap: 20px;
  padding: 0 clamp(20px, 3vw, 48px);
  border-bottom: 1px solid rgba(191, 203, 195, 0.72);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 1px 10px rgba(23, 32, 28, 0.035);
  backdrop-filter: blur(20px) saturate(140%);
}

.brand {
  display: inline-flex;
  justify-self: start;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  font-weight: 850;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 7px;
  color: #fff;
  background: var(--red);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
  font-family: Georgia, serif;
  font-size: 20px;
}

.top-nav {
  display: flex;
  align-self: stretch;
  justify-self: center;
  align-items: center;
  gap: 10px;
}

.nav-group {
  display: flex;
  height: 100%;
  align-items: center;
  gap: 2px;
}

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

.account-area {
  position: relative;
  justify-self: end;
}

.account-button {
  display: flex;
  max-width: 250px;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--teal-dark);
  background: var(--surface);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.account-button > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-chevron {
  flex: 0 0 auto;
  font-size: 13px;
  transition: transform 160ms ease;
}

.account-button[aria-expanded="true"] .account-chevron {
  transform: rotate(180deg);
}

.account-menu {
  position: absolute;
  z-index: 60;
  top: calc(100% + 8px);
  right: 0;
  display: grid;
  min-width: 210px;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 16px 34px rgba(23, 32, 28, 0.16);
}

.account-menu[hidden] {
  display: none;
}

.account-menu button,
.auth-text-button {
  width: fit-content;
  padding: 0;
  border: 0;
  color: var(--teal-dark);
  background: transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.top-nav button {
  position: relative;
  align-self: stretch;
  min-height: var(--header-height);
  padding: 0 13px;
  border: 0;
  border-radius: 0;
  color: var(--muted);
  background: transparent;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: color 160ms ease, background 160ms ease;
}

.top-nav button:hover {
  color: var(--teal-dark);
  background: rgba(8, 117, 111, 0.055);
}

.top-nav button.active {
  color: var(--ink);
  font-weight: 800;
}

.top-nav button.active::after {
  position: absolute;
  right: 13px;
  bottom: 0;
  left: 13px;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--teal);
  content: "";
}

.top-nav .nav-page-link {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 4px;
  color: var(--muted);
  font: inherit;
  font-weight: 800;
  text-decoration: none;
}

.top-nav .nav-page-link:hover {
  color: var(--teal-dark);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

html.app-booting main {
  visibility: hidden;
}

body.ai-preview [data-ai-feature] {
  display: none !important;
}

.auth-modal[hidden] {
  display: none;
}

.leave-practice-modal[hidden] {
  display: none;
}

.auth-dialog [hidden] {
  display: none !important;
}

.auth-modal {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(18, 31, 27, 0.56);
  backdrop-filter: blur(7px);
}

.leave-practice-modal {
  position: fixed;
  z-index: 95;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(18, 31, 27, 0.42);
  backdrop-filter: blur(4px);
}

.leave-practice-dialog {
  width: min(392px, 100%);
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 20px 52px rgba(10, 25, 20, 0.22);
}

.leave-practice-dialog h2 {
  font-size: 23px;
}

.leave-practice-dialog p {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.55;
}

.leave-practice-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 22px;
}

.leave-practice-actions .button {
  min-width: 0;
  padding: 0 12px;
}

.auth-dialog {
  position: relative;
  width: min(456px, 100%);
  padding: 34px 34px 30px;
  border: 1px solid #d8e0da;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 28px 80px rgba(10, 25, 20, 0.3), 0 2px 8px rgba(10, 25, 20, 0.08);
}

.auth-brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  margin: 0 auto 15px;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: var(--red);
  box-shadow: 0 5px 14px rgba(185, 59, 45, 0.22);
  font-family: Georgia, serif;
  font-size: 21px;
}

.auth-dialog h2 {
  margin-top: 2px;
  text-align: center;
  font-size: 30px;
}

.auth-description {
  max-width: 340px;
  margin: 10px auto 0;
  color: var(--muted);
  text-align: center;
  line-height: 1.5;
}

.auth-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.auth-close:hover {
  color: var(--ink);
  background: var(--surface-soft);
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-top: 24px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.auth-tabs button {
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.auth-tabs button.active {
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 2px 6px rgba(23, 32, 28, 0.08);
}

.auth-form {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.auth-form label {
  margin-top: 4px;
  font-size: 13px;
  font-weight: 800;
}

.auth-form input {
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
  font: inherit;
  font-size: 15px;
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

#authEmail:focus,
.auth-password-control:focus-within {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(8, 117, 111, 0.13);
}

.auth-google-button {
  display: flex;
  width: 100%;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 26px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.auth-google-button:hover {
  border-color: var(--teal);
  background: #fbfdfb;
  box-shadow: 0 4px 12px rgba(23, 32, 28, 0.08);
}

.auth-google-button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.auth-google-button .google-mark {
  color: transparent;
  background: conic-gradient(from -45deg, #4285f4 0 25%, #34a853 0 42%, #fbbc05 0 67%, #ea4335 0 82%, #4285f4 0);
  background-clip: text;
  font-family: Arial, sans-serif;
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
  -webkit-background-clip: text;
}

.auth-field-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.auth-inline-link,
.auth-text-button {
  border: 0;
  color: var(--teal-dark);
  background: transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.auth-inline-link:focus-visible,
.auth-text-button:focus-visible,
.auth-close:focus-visible,
.auth-google-button:focus-visible,
#togglePasswordButton:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

.auth-password-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.auth-password-control input {
  min-width: 0;
  border: 0;
  box-shadow: none;
}

.auth-password-control button {
  display: grid;
  width: 44px;
  padding: 0;
  place-items: center;
  border: 0;
  color: var(--teal-dark);
  background: transparent;
  font: inherit;
  cursor: pointer;
}

.password-requirements {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px 14px;
  margin: 10px 2px 0;
  padding: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  list-style: none;
}

.password-requirements li {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  gap: 7px;
}

.password-requirements .password-category-hint {
  grid-column: 1 / -1;
  margin-top: 2px;
  color: var(--ink);
  font-weight: 800;
}

.password-requirements .password-category-hint::before {
  display: none;
}

.password-requirements li::before {
  width: 7px;
  height: 7px;
  margin-top: 4px;
  flex: 0 0 auto;
  border: 1px solid #9da8a2;
  border-radius: 50%;
  background: transparent;
  content: "";
}

.password-requirements li.passed {
  color: var(--teal-dark);
}

.password-requirements li.passed::before {
  border-color: var(--teal);
  background: var(--teal);
  box-shadow: 0 0 0 2px rgba(8, 117, 111, 0.12);
}

.password-eye-icon {
  position: relative;
  width: 17px;
  height: 11px;
  border: 1.7px solid currentColor;
  border-radius: 50% / 60%;
}

.password-eye-icon::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  content: "";
  transform: translate(-50%, -50%);
}

#togglePasswordButton[aria-pressed="true"] .password-eye-icon::before {
  position: absolute;
  top: 4px;
  left: -2px;
  width: 20px;
  height: 1.7px;
  background: currentColor;
  content: "";
  transform: rotate(-42deg);
}

.auth-form #authSubmit {
  min-height: 48px;
  margin-top: 2px;
  font-size: 15px;
}

.auth-forgot-link {
  display: block;
  margin: 10px 0 0 auto;
}

.auth-mode-prompt {
  display: flex;
  align-items: baseline;
  justify-content: center;
  flex-wrap: wrap;
  gap: 5px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.auth-mode-prompt .auth-inline-link {
  font-size: 13px;
}

.auth-legal {
  margin-top: 16px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  line-height: 1.5;
}

.auth-legal a {
  color: var(--teal-dark);
  font-weight: 800;
}

.auth-confirmation {
  margin-top: 22px;
  padding-top: 2px;
  text-align: center;
}

.auth-confirmation-label {
  color: var(--red);
  font-size: 12px;
  font-weight: 850;
}

.auth-confirmation-message {
  margin-top: 14px;
  color: var(--muted);
  line-height: 1.5;
}

.auth-confirmation-email {
  margin: 10px 0 18px;
  color: var(--ink);
  font-weight: 800;
}

.auth-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  margin: 18px 0;
  color: var(--muted);
  font-size: 12px;
}

.auth-divider::before,
.auth-divider::after {
  height: 1px;
  background: var(--line);
  content: "";
}

.auth-text-button {
  display: block;
  margin: 14px auto 0;
}

.auth-status {
  min-height: 20px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.auth-status:empty {
  display: none;
}

.auth-status.error {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 12px;
  border: 1px solid #d66b5f;
  border-radius: 8px;
  color: #8b281f;
  background: #fff1ee;
  font-size: 14px;
  font-weight: 750;
}

.auth-status.error::before {
  display: grid;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #b83d31;
  content: "!";
  font-size: 12px;
  font-weight: 850;
}

.home-hero {
  display: grid;
  min-height: calc(100vh - var(--header-height));
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 28px;
  align-items: center;
  padding: 42px 32px;
  background:
    linear-gradient(90deg, rgba(9, 23, 19, 0.82), rgba(9, 23, 19, 0.48), rgba(9, 23, 19, 0.18)),
    url("/assets/hero-practice.png") center / cover;
}

.hero-copy-block {
  width: min(760px, 100%);
  color: #fff;
}

.eyebrow,
.mini-label {
  display: block;
  color: var(--red);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero-copy-block .eyebrow {
  color: #ffd486;
}

.hero-copy {
  max-width: 650px;
  margin-top: 22px;
  color: rgba(255, 255, 255, 0.91);
  font-size: 20px;
}

.hero-actions,
.launch-actions,
.card-top,
.detail-meta,
.heading-row,
.session-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-actions {
  margin-top: 30px;
}

.button,
.tool-button,
.mic-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease,
    border-color 160ms ease;
}

.button:hover,
.tool-button:hover,
.mic-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(23, 32, 28, 0.13);
}

.button.primary {
  border-color: var(--teal);
  color: #fff;
  background: var(--teal);
}

.button.primary:hover {
  background: var(--teal-dark);
}

.button.secondary {
  border-color: rgba(255, 255, 255, 0.72);
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
}

.button.ghost,
.tool-button {
  background: transparent;
}

.button.small,
.tool-button {
  min-height: 36px;
  padding: 0 12px;
  font-size: 13px;
}

.button.full,
.launch-actions .button {
  width: 100%;
}

.button:disabled,
.tool-button:disabled,
.mic-button:disabled,
input:disabled {
  cursor: not-allowed;
  opacity: 0.62;
  transform: none;
  box-shadow: none;
}

.launch-panel,
.custom-form,
.prep-settings,
.chat-panel,
.feedback-panel,
.summary-card-inner {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.launch-panel {
  display: grid;
  gap: 16px;
  padding: 20px;
}

.panel-heading {
  display: grid;
  gap: 6px;
}

.panel-heading h2 {
  font-size: 24px;
}

.popular-grid {
  display: grid;
  gap: 10px;
}

.popular-pill {
  display: grid;
  gap: 4px;
  min-height: 74px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.popular-pill:hover,
.popular-pill.active {
  border-color: rgba(8, 117, 111, 0.44);
  box-shadow: 0 10px 24px rgba(23, 32, 28, 0.11);
}

.popular-pill span,
.popular-pill em,
.scenario-card p,
.prep-description,
.custom-copy p,
.report-layout p,
.record p,
.feedback-card p,
.info-block li,
.status-line {
  color: var(--muted);
}

.popular-pill strong {
  font-size: 15px;
}

.popular-pill em {
  font-style: normal;
  font-size: 13px;
}

.scenario-workspace,
.custom-view,
.report-view {
  padding: 64px 32px;
}

.section-heading,
.scenario-grid,
.browser-tools,
.custom-layout,
.report-layout,
.records-block,
.prep-detail,
.page-bar,
.practice-frame {
  width: min(1180px, 100%);
  margin: 0 auto;
}

.section-heading {
  margin-bottom: 22px;
}

.section-heading.compact {
  display: grid;
  gap: 8px;
}

.heading-row {
  align-items: end;
  justify-content: space-between;
}

.heading-row p {
  max-width: 720px;
  margin-top: 8px;
}

.scenario-count {
  min-width: 96px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--teal-dark);
  background: var(--surface);
  font-size: 13px;
  font-weight: 850;
  text-align: center;
}

.browser-tools {
  display: grid;
  grid-template-columns: minmax(220px, 1.3fr) minmax(220px, 1fr) minmax(220px, 1fr);
  gap: 16px;
  align-items: start;
  margin-bottom: 18px;
}

label,
legend {
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
}

label {
  display: grid;
  gap: 7px;
}

fieldset {
  display: grid;
  gap: 8px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
}

input,
select {
  min-height: 44px;
  padding: 0 12px;
}

textarea {
  resize: vertical;
  padding: 12px;
}

.segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #fff;
  font-weight: 650;
  cursor: pointer;
  transition:
    border-color 140ms ease,
    background 140ms ease,
    color 140ms ease,
    box-shadow 140ms ease;
}

.chip.active {
  border-color: var(--teal);
  color: #fff;
  background: var(--teal);
  box-shadow: 0 8px 18px rgba(8, 117, 111, 0.22);
  font-weight: 850;
}

.chip.active::before {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #fff;
  content: "";
}

.chip:hover,
.chip:focus-visible {
  border-color: rgba(8, 117, 111, 0.52);
  color: var(--teal-dark);
}

.chip.active:hover,
.chip.active:focus-visible {
  color: #fff;
}

.scenario-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.scenario-card {
  display: grid;
  min-height: 188px;
  align-content: space-between;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
  outline: none;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.scenario-card:hover,
.scenario-card:focus-visible,
.scenario-card.active {
  transform: translateY(-2px);
  border-color: rgba(8, 117, 111, 0.48);
  box-shadow: 0 14px 34px rgba(23, 32, 28, 0.12);
}

.scenario-card.active .button {
  border-color: var(--teal);
  color: #fff;
  background: var(--teal);
}

.card-top {
  align-items: center;
  justify-content: space-between;
}

.card-meta,
.detail-meta {
  align-items: center;
}

.tag {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  padding: 0 8px;
  border-radius: 6px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 12px;
  font-weight: 800;
}

.tag.level {
  color: #fff;
  background: var(--blue);
}

.scenario-card h3 {
  margin-top: 4px;
}

.scenario-card p {
  margin-top: 8px;
  font-size: 14px;
}

.scenario-title-zh {
  margin-top: 5px;
  color: var(--red);
  font-weight: 850;
}

.empty-state {
  padding: 22px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.72);
}

.prep-view {
  min-height: calc(100vh - var(--header-height));
  padding: 28px 32px 72px;
}

.page-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.prep-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 28px;
  align-items: start;
}

.prep-main {
  display: grid;
  gap: 18px;
}

.prep-main h1,
.custom-copy h1,
.report-layout h1 {
  font-size: 50px;
}

.opening-line {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-left: 4px solid var(--teal);
  border-radius: 8px;
  background: var(--green);
}

.opening-line p {
  font-size: 22px;
  font-weight: 800;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.info-block {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.info-block:first-child {
  grid-row: span 2;
}

.info-block h3 {
  font-size: 16px;
}

.info-block ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
}

.word-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.word-list.compact {
  grid-template-columns: 1fr;
}

.word-item {
  display: grid;
  gap: 2px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.word-item strong {
  font-size: 16px;
}

.word-item span {
  color: var(--teal-dark);
  font-size: 13px;
}

.word-item em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
}

.readable-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px;
}

.readable-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.inline-learning-actions {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
}

.inline-play-button,
.inline-read-button {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 9px;
  border: 1px solid rgba(8, 117, 111, 0.28);
  border-radius: 7px;
  color: var(--teal-dark);
  background: #fff;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.inline-play-button:hover,
.inline-play-button:focus-visible,
.inline-read-button:hover,
.inline-read-button:focus-visible {
  border-color: var(--teal);
  background: var(--teal-soft);
}

.inline-read-button .mini-mic-icon {
  transform: scale(0.86);
}

.prep-settings {
  position: sticky;
  top: calc(var(--header-height) + 20px);
  display: grid;
  gap: 15px;
  padding: 18px;
}

.field-note {
  margin: -5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.practice-mode-fixed {
  display: grid;
  gap: 6px;
}

.practice-mode-fixed strong {
  font-size: 17px;
}

.custom-view {
  min-height: calc(100vh - var(--header-height));
  background: #eef4ef;
}

.custom-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(360px, 1fr);
  gap: 40px;
  align-items: start;
}

.custom-copy {
  display: grid;
  gap: 18px;
  padding-top: 18px;
}

.custom-form {
  display: grid;
  gap: 16px;
  padding: 22px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.status-line {
  min-height: 22px;
  font-size: 14px;
}

.practice-view {
  min-height: calc(100vh - var(--header-height));
  padding: 0;
  background: #eef4ef;
}

.practice-frame {
  padding: 18px 20px 28px;
}

.session-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: end;
  margin-bottom: 12px;
}

.session-title-block {
  display: grid;
  gap: 4px;
}

.session-title-block h1 {
  font-size: 32px;
}

.session-controls {
  align-items: end;
  justify-content: flex-end;
}

.session-controls label {
  min-width: 112px;
  color: var(--muted);
  font-size: 12px;
}

.session-controls select {
  min-height: 36px;
}

.tool-button.active {
  border-color: var(--teal);
  color: #fff;
  background: var(--teal);
}

.tool-button.saved {
  border-color: var(--teal);
  color: #fff;
  background: var(--teal);
}

.save-session-button,
.leave-session-button {
  gap: 7px;
}

.save-session-icon {
  width: 11px;
  height: 14px;
  flex: 0 0 auto;
  background: currentColor;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 76%, 0 100%);
  opacity: 0.42;
}

.tool-button.saved .save-session-icon {
  opacity: 1;
}

.leave-session-icon {
  width: 9px;
  height: 9px;
  margin-right: 2px;
  flex: 0 0 auto;
  border-top: 1.8px solid currentColor;
  border-right: 1.8px solid currentColor;
  transform: rotate(45deg);
}

.tool-button.danger {
  border-color: #d9b6ad;
  color: #9f2f1e;
  background: #fff7f5;
}

.tool-button.danger:hover {
  border-color: #bd4a35;
  color: #7f2418;
  background: #fff0ec;
}

.turn-progress {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.turn-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #dfe7df;
}

.turn-track span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--gold);
  transition: width 220ms ease;
}

.session-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 16px;
  align-items: start;
}

.chat-panel {
  display: grid;
  min-height: calc(100vh - 178px);
  grid-template-rows: minmax(0, 1fr) auto auto auto auto;
  overflow: hidden;
}

.chat-log {
  display: flex;
  min-height: 0;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  overflow-y: auto;
}

.message {
  width: fit-content;
  max-width: 82%;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
}

.message.ai {
  align-self: flex-start;
  background: #edf5ee;
}

.message.user {
  align-self: flex-end;
  color: #fff;
  background: var(--teal);
}

.message.selected {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(192, 138, 44, 0.16);
}

.message:focus-visible {
  outline: 3px solid rgba(192, 138, 44, 0.36);
  outline-offset: 2px;
}

.message.user .pinyin,
.message.user .translation {
  color: rgba(255, 255, 255, 0.82);
}

.message.user .translation {
  border-top-color: rgba(255, 255, 255, 0.24);
}

.message.system {
  width: 100%;
  max-width: 100%;
  color: #6b4a13;
  background: #fff7df;
}

.message strong {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
}

.message p {
  margin: 0;
}

.pinyin {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.translation {
  margin-top: 6px;
  color: #3f4b46;
  font-size: 14px;
}

.message .translation {
  padding-top: 6px;
  border-top: 1px solid rgba(8, 117, 111, 0.16);
}

.message-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.message-actions button {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  gap: 5px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.mini-mic-icon {
  position: relative;
  display: inline-block;
  width: 10px;
  height: 14px;
  border: 2px solid currentColor;
  border-radius: 999px;
}

.mini-mic-icon::before {
  position: absolute;
  left: 50%;
  bottom: -5px;
  width: 10px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  border-left: 2px solid currentColor;
  border-radius: 0 0 999px 999px;
  content: "";
  transform: translateX(-50%);
}

.mini-mic-icon::after {
  position: absolute;
  left: 50%;
  bottom: -8px;
  width: 8px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  content: "";
  transform: translateX(-50%);
}

.message.user .message-actions button {
  border-color: rgba(255, 255, 255, 0.28);
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.message.user .message-actions button:hover,
.message.user .message-actions button:focus-visible {
  background: rgba(255, 255, 255, 0.2);
}

.read-practice-panel {
  display: grid;
  gap: 9px;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.92);
}

.message.user .read-practice-panel {
  color: var(--ink);
}

.read-practice-panel.success {
  border-color: rgba(8, 117, 111, 0.38);
  background: #f3faf7;
}

.read-practice-panel.warning,
.read-practice-panel.pending {
  border-color: rgba(192, 138, 44, 0.42);
  background: #fff9e9;
}

.read-practice-panel.error {
  border-color: rgba(185, 59, 45, 0.34);
  background: #fff5f3;
}

.read-practice-top {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
}

.read-practice-top strong {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
}

.read-practice-top p {
  color: var(--muted);
  font-size: 13px;
}

.read-pulse {
  display: inline-flex;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border-radius: 999px;
  color: var(--teal);
  background: #fff;
}

.read-pulse i {
  display: block;
  width: 3px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
}

.read-practice-panel.listening .read-pulse {
  color: var(--red);
}

.read-practice-panel.listening .read-pulse i {
  animation: speech-wave 780ms ease-in-out infinite;
}

.read-practice-panel.listening .read-pulse i:nth-child(2) {
  animation-delay: 130ms;
}

.read-practice-panel.listening .read-pulse i:nth-child(3) {
  animation-delay: 260ms;
}

.read-heard {
  display: grid;
  gap: 3px;
  padding: 8px;
  border: 1px solid rgba(8, 117, 111, 0.14);
  border-radius: 7px;
  background: #fff;
}

.read-heard span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.read-score {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-soft);
}

.read-score span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--gold);
}

.read-practice-panel.success .read-score span {
  background: var(--teal);
}

.read-practice-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.read-practice-actions button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--teal-dark);
  background: #fff;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}

.thinking {
  min-width: 132px;
}

.typing-dots {
  display: flex;
  gap: 4px;
  margin-top: 8px;
}

.typing-dots span {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--teal);
  animation: bounce 900ms infinite ease-in-out;
}

.typing-dots span:nth-child(2) {
  animation-delay: 120ms;
}

.typing-dots span:nth-child(3) {
  animation-delay: 240ms;
}

@keyframes bounce {
  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.45;
  }

  40% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

.hint-strip {
  min-height: 42px;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  background: #fbfcfa;
  font-size: 14px;
}

.quick-replies {
  display: grid;
  gap: 7px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  background: #f4f8f4;
}

.quick-replies[hidden] {
  display: none;
}

.quick-replies > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.quick-replies > div {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  min-width: 0;
}

.quick-replies > div::-webkit-scrollbar,
.session-controls::-webkit-scrollbar {
  display: none;
}

.quick-replies button {
  display: grid;
  gap: 2px;
  min-width: 0;
  min-height: 66px;
  width: 100%;
  padding: 7px 10px;
  border: 1px solid rgba(8, 117, 111, 0.28);
  border-radius: 8px;
  color: var(--teal-dark);
  background: #fff;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.25;
  cursor: pointer;
}

.quick-reply-zh,
.suggestion-zh {
  color: var(--teal-dark);
  font-weight: 850;
}

.quick-reply-pinyin,
.quick-reply-meaning,
.suggestion-pinyin,
.suggestion-meaning {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quick-reply-zh {
  display: -webkit-box;
  min-width: 0;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.quick-reply-pinyin {
  overflow: visible;
  overflow-wrap: anywhere;
  text-overflow: clip;
  white-space: normal;
}

.quick-reply-meaning,
.suggestion-meaning {
  color: #59645f;
  font-weight: 550;
}

.quick-reply-meaning {
  display: -webkit-box;
  min-width: 0;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: unset;
  line-clamp: unset;
  white-space: normal;
}

.quick-replies button:hover,
.quick-replies button:focus-visible {
  border-color: var(--teal);
}

.intent-form {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--line);
  background: #fbfcfa;
}

.intent-form label {
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
}

.intent-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.intent-result {
  display: grid;
  gap: 8px;
}

.intent-submit {
  min-width: 142px;
}

.button.is-loading {
  padding-inline: 18px;
}

.loading-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(8, 117, 111, 0.24);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.intent-note {
  color: var(--muted);
  font-size: 13px;
}

.service-notice {
  padding: 9px 10px;
  border: 1px solid rgba(192, 138, 44, 0.32);
  border-radius: 8px;
  color: #6b4a13;
  background: #fff9e9;
  font-size: 12px;
}

.intent-card {
  display: grid;
  gap: 5px;
  padding: 10px;
  border: 1px solid rgba(8, 117, 111, 0.24);
  border-radius: 8px;
  background: #fff;
}

.intent-card span,
.intent-card p {
  color: var(--muted);
  font-size: 13px;
}

.intent-card .intent-card-label {
  color: var(--ink);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.intent-card p strong {
  color: var(--ink);
}

.intent-context-note {
  padding: 8px 9px;
  border-left: 3px solid var(--gold);
  color: #6b4a13 !important;
  background: #fff9e9;
  font-size: 12px !important;
}

.use-translation,
.intent-adapted {
  min-height: 34px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--teal-dark);
  background: #fff;
  font-weight: 850;
  cursor: pointer;
  text-align: left;
}

.intent-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.intent-actions button {
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid rgba(8, 117, 111, 0.28);
  border-radius: 8px;
  color: #fff;
  background: var(--teal);
  font-weight: 850;
  cursor: pointer;
}

.speaking-feedback {
  min-height: 18px;
  color: var(--teal-dark);
  font-size: 13px;
  font-weight: 750;
}

.chat-form {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  gap: 10px;
  padding: 12px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.guided-mode .intent-form {
  display: none;
}

.guided-mode #userMessage[readonly] {
  color: #65726b;
  background: #fff;
  border-color: var(--line-strong);
  border-style: dashed;
  box-shadow: inset 0 0 0 1px rgba(20, 43, 37, 0.03);
  cursor: default;
  font-weight: 800;
  opacity: 1;
}

.guided-mode .chat-form {
  grid-template-columns: minmax(0, 1fr) auto;
}

.guided-mode .mic-button {
  display: none;
}

.mic-button {
  min-width: 52px;
  padding: 0;
}

.mic-icon {
  position: relative;
  display: block;
  width: 14px;
  height: 22px;
  border: 2px solid currentColor;
  border-radius: 999px;
}

.mic-icon::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -8px;
  width: 18px;
  height: 12px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  border-left: 2px solid currentColor;
  border-radius: 0 0 999px 999px;
  transform: translateX(-50%);
}

.mic-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -14px;
  width: 14px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transform: translateX(-50%);
}

.mic-button.listening {
  border-color: var(--red);
  color: #fff;
  background: var(--red);
}

.speech-panel {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto auto auto 30px;
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface-soft);
}

.speech-panel[hidden] {
  display: none;
}

.speech-panel.listening {
  border-color: rgba(185, 59, 45, 0.38);
  background: #fff7f5;
}

.speech-panel.success {
  border-color: rgba(8, 117, 111, 0.34);
  background: #f3faf7;
}

.speech-panel.warning,
.speech-panel.pending {
  border-color: rgba(192, 138, 44, 0.36);
  background: #fff9e9;
}

.speech-panel.error {
  border-color: rgba(185, 59, 45, 0.32);
  background: #fff5f3;
}

.speech-pulse {
  display: inline-flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border-radius: 50%;
  color: var(--teal);
  background: #fff;
}

.speech-pulse i {
  display: block;
  width: 3px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
}

.speech-panel.listening .speech-pulse {
  color: var(--red);
}

.speech-panel.listening .speech-pulse i {
  animation: speech-wave 780ms ease-in-out infinite;
}

.speech-panel.listening .speech-pulse i:nth-child(2) {
  animation-delay: 130ms;
}

.speech-panel.listening .speech-pulse i:nth-child(3) {
  animation-delay: 260ms;
}

@keyframes speech-wave {
  0%,
  100% {
    height: 7px;
  }

  50% {
    height: 20px;
  }
}

.speech-copy,
.speech-heading {
  min-width: 0;
}

.speech-copy {
  display: grid;
  gap: 2px;
  color: var(--muted);
  font-size: 13px;
}

.speech-heading {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.speech-heading strong {
  color: var(--ink);
  font-size: 14px;
}

.speech-heading time {
  color: var(--red);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.speech-retry,
.speech-help,
.speech-type,
.speech-dismiss {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--teal-dark);
  background: #fff;
  font-weight: 800;
  cursor: pointer;
}

.speech-retry,
.speech-help,
.speech-type {
  padding: 0 10px;
  white-space: nowrap;
}

.speech-help {
  color: #6f4d12;
  border-color: rgba(192, 138, 44, 0.42);
}

.speech-type {
  color: var(--muted);
}

.speech-dismiss {
  width: 30px;
  padding: 0;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
}

.speech-dismiss:disabled {
  cursor: default;
  opacity: 0.42;
}

#speechTranscript {
  white-space: pre-line;
}

.empty-chat {
  display: grid;
  gap: 12px;
  align-self: center;
  justify-items: start;
  width: min(460px, 100%);
  margin: 0 auto;
  padding: 22px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.72);
}

.empty-chat strong {
  color: var(--ink);
  font-size: 20px;
}

.feedback-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.line-breakdown-heading {
  display: grid;
  gap: 4px;
  padding: 2px 2px 4px;
}

.line-breakdown-heading h2 {
  color: var(--ink);
  font-size: 22px;
}

.feedback-card {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.feedback-card.priority {
  border-color: rgba(8, 117, 111, 0.34);
  background: #fff;
}

.feedback-card.keywords-card {
  border-color: rgba(8, 117, 111, 0.28);
  background: #f4faf6;
}

.feedback-card h3,
.feedback-card summary {
  font-size: 15px;
  font-weight: 850;
}

.feedback-card summary {
  cursor: pointer;
}

.better-sentence {
  color: var(--ink) !important;
  font-size: 18px !important;
  font-weight: 850;
}

.score-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.score-line strong {
  color: var(--teal-dark);
  font-size: 24px;
}

.score-bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-soft);
}

.score-bar span {
  display: block;
  height: 100%;
  background: var(--gold);
}

.suggestions {
  display: grid;
  gap: 8px;
}

.suggestion {
  display: grid;
  gap: 3px;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  text-align: left;
}

.suggestion:hover {
  border-color: var(--teal);
}

.breakdown-list {
  display: grid;
  gap: 10px;
}

.breakdown-item {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.breakdown-item span {
  color: var(--teal-dark);
  font-size: 13px;
}

.brief-title {
  display: grid;
  gap: 5px;
}

.brief-title strong {
  font-size: 18px;
}

.role-pair {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
}

.mission-list,
.goal-list {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mission-list li,
.goal-list li {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  color: var(--muted);
  font-size: 14px;
}

.mission-list span,
.goal-list span {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 999px;
  color: var(--teal-dark);
  background: var(--green);
  font-size: 12px;
  font-weight: 850;
}

.goal-list span::before {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--teal);
  content: "";
}

.mission-list li.done {
  color: var(--ink);
}

.mission-list li.done span {
  color: #fff;
  background: var(--teal);
}

.report-view {
  min-height: calc(100vh - var(--header-height));
}

.report-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1fr);
  gap: 28px;
  align-items: start;
}

.library-intro {
  grid-template-columns: minmax(0, 1fr);
}

.summary-card-inner {
  display: grid;
  gap: 12px;
  padding: 20px;
}

.records-block {
  margin-top: 48px;
}

.saved-records {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.record {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.record-saved-label {
  justify-self: start;
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--teal-dark);
  background: var(--teal-soft);
  font-size: 12px;
  font-weight: 800;
}

.record-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.record-action {
  min-width: 0;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  color: var(--teal-dark);
  background: var(--surface);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}

.record-action:hover:not(:disabled) {
  border-color: var(--teal);
  background: var(--teal-soft);
}

.record-action.primary-action {
  border-color: var(--teal);
  color: #fff;
  background: var(--teal);
}

.record-action.primary-action:hover:not(:disabled) {
  border-color: var(--teal-dark);
  background: var(--teal-dark);
}

.record-action.remove-action {
  padding-inline: 8px;
  border-color: transparent;
  color: var(--muted);
  background: transparent;
}

.record-action.remove-action:hover:not(:disabled) {
  border-color: var(--line);
  color: var(--red);
  background: var(--surface-soft);
}

.record-action:disabled {
  cursor: wait;
  opacity: 0.65;
}

.review-view {
  max-width: 980px;
  margin: 0 auto;
}

.admin-view {
  max-width: 760px;
  margin: 0 auto;
}

.admin-heading {
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.admin-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  margin-top: 24px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.admin-card h2,
.admin-card p {
  margin: 0;
}

.admin-card p {
  margin-top: 6px;
  color: var(--muted);
}

.feature-toggle {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 9px;
  color: var(--teal-dark);
  font-weight: 850;
  cursor: pointer;
}

.feature-toggle input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
}

.feature-toggle span {
  position: relative;
  width: 42px;
  height: 24px;
  border-radius: 20px;
  background: #aab9b3;
  transition: background 160ms ease;
}

.feature-toggle span::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  content: "";
  transition: transform 160ms ease;
}

.feature-toggle input:checked + span {
  background: var(--teal);
}

.feature-toggle input:checked + span::after {
  transform: translateX(18px);
}

.feature-toggle input:disabled + span {
  cursor: not-allowed;
  opacity: 0.55;
}

.review-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 30px;
}

.review-heading {
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.review-messages {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

.review-message {
  display: grid;
  gap: 10px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.review-message.user {
  border-color: var(--teal);
}

.review-line {
  display: grid;
  gap: 7px;
}

.review-line p {
  margin: 0;
}

.review-chinese {
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
}

.review-translation,
.review-explanation {
  color: var(--muted);
}

.review-correction {
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.review-score {
  justify-self: start;
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--teal-dark);
  background: var(--teal-soft);
  font-size: 12px;
  font-weight: 800;
}

.review-details {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
}

.review-details summary {
  cursor: pointer;
  color: var(--ink);
  font-weight: 800;
}

.review-details > p {
  margin: 10px 0 0;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 32px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

.footer-links {
  display: flex;
  gap: 14px;
}

.footer-links a {
  color: var(--muted);
  font-weight: 750;
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--teal-dark);
  text-decoration: underline;
}

.legal-page {
  min-height: 100vh;
}

.legal-header {
  position: static;
}

.legal-main {
  width: min(900px, calc(100% - 40px));
  margin: 0 auto;
  padding: 64px 0 84px;
}

.legal-intro {
  max-width: 720px;
}

.legal-intro h1 {
  margin-top: 10px;
}

.legal-updated {
  margin-top: 16px;
  color: var(--muted);
}

.legal-notice {
  margin: 32px 0;
  padding: 16px 18px;
  border-left: 4px solid var(--gold);
  border-radius: 0 8px 8px 0;
  background: #fff8e9;
  color: #5c4619;
}

.legal-content {
  display: grid;
  gap: 30px;
}

.legal-content section {
  padding-top: 4px;
}

.legal-content h2 {
  font-size: 25px;
}

.legal-content h3 {
  margin-top: 18px;
}

.legal-content p,
.legal-content li {
  color: #34413a;
}

.legal-content p + p,
.legal-content p + ul,
.legal-content ul + p,
.legal-content h3 + p {
  margin-top: 12px;
}

.legal-content ul {
  margin: 12px 0 0;
  padding-left: 22px;
}

.legal-content li + li {
  margin-top: 8px;
}

.legal-content a {
  color: var(--teal-dark);
  font-weight: 750;
}

.legal-footer {
  justify-content: flex-start;
  padding-top: 22px;
}

.pricing-main {
  width: min(1080px, calc(100% - 40px));
  margin: 0 auto;
  padding: 76px 0 84px;
}

.pricing-intro {
  max-width: 720px;
}

.pricing-intro h1 {
  max-width: 680px;
  margin: 10px 0 18px;
}

.pricing-intro > p:not(.eyebrow) {
  max-width: 620px;
  color: var(--muted);
  font-size: 18px;
}

.pricing-status {
  margin-top: 22px;
  padding: 11px 13px;
  border-left: 3px solid var(--gold);
  background: #fff8e9;
  color: #5c4619 !important;
  font-size: 14px !important;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 42px;
}

.price-card {
  display: flex;
  flex-direction: column;
  min-height: 510px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.price-card.featured {
  border: 2px solid var(--teal);
  box-shadow: 0 18px 42px rgba(6, 83, 79, 0.11);
}

.price-card h2 {
  margin: 8px 0 16px;
  font-size: 30px;
}

.price {
  margin: 0;
  color: var(--ink);
  font-weight: 800;
}

.price span {
  font-size: 42px;
}

.annual-price {
  min-height: 22px;
  margin: 6px 0 0;
  color: var(--teal-dark);
  font-size: 14px;
  font-weight: 750;
}

.price-description {
  min-height: 72px;
  margin: 18px 0 24px;
  color: var(--muted);
}

.price-card .button {
  margin-bottom: 24px;
}

.paddle-checkout-actions {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.paddle-checkout-actions .button {
  margin-bottom: 0;
}

.paddle-checkout-notice {
  margin: 0 0 18px;
  color: #6b4a13;
  font-size: 14px;
  font-weight: 700;
}

.price-card .button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.plan-features {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.plan-features li {
  position: relative;
  padding-left: 24px;
  color: #34413a;
}

.plan-features li::before {
  position: absolute;
  left: 0;
  color: var(--teal);
  content: "\2713";
  font-weight: 900;
}

.pricing-details {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 48px;
  margin-top: 58px;
  padding: 38px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.pricing-details h2 {
  margin-top: 10px;
  font-size: 29px;
}

.pricing-copy {
  color: #34413a;
}

.pricing-copy p + p {
  margin-top: 14px;
}

.pricing-copy a {
  color: var(--teal-dark);
  font-weight: 750;
}

.billing-success-page {
  background: #f5f8f4;
}

.billing-success-main {
  display: grid;
  min-height: calc(100vh - 166px);
  place-items: center;
  width: min(680px, calc(100% - 40px));
  margin: 0 auto;
  padding: 56px 0 88px;
}

.billing-success-card {
  width: 100%;
  padding: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: center;
  background: var(--surface);
  box-shadow: 0 18px 42px rgba(6, 83, 79, 0.1);
}

.billing-success-icon {
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  margin: 0 auto 22px;
  border: 2px solid var(--teal);
  border-radius: 50%;
  color: var(--teal);
  font-size: 32px;
  font-weight: 900;
}

.billing-success-card h1 {
  margin: 8px auto 14px;
  font-size: 36px;
}

.billing-success-card > p:not(.eyebrow) {
  max-width: 520px;
  margin-right: auto;
  margin-left: auto;
  color: var(--muted);
  font-size: 17px;
}

.billing-success-detail {
  margin-top: 12px;
  font-size: 14px !important;
}

.billing-success-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 28px;
}

.warning,
.warning-card {
  border-color: rgba(192, 138, 44, 0.45);
  color: #6b4a13;
  background: #fff7df;
}

.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;
}

@media (max-width: 1080px) {
  h1 {
    font-size: 52px;
  }

  .home-hero,
  .custom-layout,
  .report-layout,
  .prep-layout,
  .session-toolbar,
  .session-grid {
    grid-template-columns: 1fr;
  }

  .launch-panel,
  .prep-settings {
    position: static;
  }

  .popular-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .scenario-grid,
  .saved-records {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .browser-tools {
    grid-template-columns: 1fr;
  }

  .session-controls {
    justify-content: flex-start;
  }

  .pricing-details {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

@media (max-width: 920px) and (min-width: 701px) {
  .site-header {
    gap: 10px;
    padding-inline: 16px;
  }

  .brand span:last-child {
    display: none;
  }

  .top-nav {
    gap: 4px;
  }

  .top-nav button {
    padding-inline: 9px;
  }

  .top-nav button.active::after {
    right: 9px;
    left: 9px;
  }

  .account-button {
    max-width: 160px;
  }
}

@media (max-width: 700px) {
  :root {
    --header-height: 58px;
  }
  .pricing-main {
    width: min(100% - 28px, 1080px);
    padding: 42px 0 58px;
  }

  .pricing-grid {
    grid-template-columns: 1fr;
    margin-top: 28px;
  }

  .price-card {
    min-height: 0;
    padding: 22px;
  }

  .price-description {
    min-height: 0;
  }

  .billing-success-main {
    min-height: calc(100vh - 136px);
    width: min(100% - 28px, 680px);
    padding: 36px 0 58px;
  }

  .billing-success-card {
    padding: 28px 20px;
  }

  .billing-success-card h1 {
    font-size: 30px;
  }

  .billing-success-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .site-header {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    min-height: var(--header-height);
    padding: 8px 12px;
    backdrop-filter: none;
  }

  body {
    padding-bottom: 64px;
  }

  .top-nav {
    position: fixed;
    z-index: 70;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    width: 100%;
    height: 58px;
    gap: 0;
    padding: 0 max(6px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(6px, env(safe-area-inset-left));
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 -8px 22px rgba(23, 32, 28, 0.08);
    backdrop-filter: blur(20px) saturate(140%);
  }

  .nav-group {
    display: contents;
  }

  .nav-divider {
    display: none;
  }

  .top-nav button {
    align-self: stretch;
    min-height: 58px;
    padding: 3px 4px 0;
    border-radius: 0;
    font-size: 11px;
    white-space: nowrap;
  }

  .top-nav button.active::after {
    top: 0;
    right: 24%;
    bottom: auto;
    left: 24%;
    border-radius: 0 0 3px 3px;
  }

  .brand span:last-child {
    display: inline;
    font-size: 14px;
  }

  .account-button {
    max-width: 112px;
    min-height: 36px;
    padding: 0 7px;
    font-size: 12px;
  }

  .auth-dialog {
    padding: 24px 18px;
  }

  .auth-dialog h2 {
    font-size: 27px;
  }

  h1,
  .prep-main h1,
  .custom-copy h1,
  .report-layout h1 {
    font-size: 38px;
  }

  h2 {
    font-size: 26px;
  }

  .home-hero {
    min-height: auto;
    gap: 22px;
    padding: 34px 18px 24px;
    background-position: 58% center;
  }

  .hero-copy {
    font-size: 17px;
  }

  .hero-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .scenario-workspace,
  .custom-view,
  .report-view,
  .prep-view {
    padding: 34px 18px 48px;
  }

  .heading-row,
  .page-bar,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .popular-grid,
  .scenario-grid,
  .info-grid,
  .word-list,
  .form-grid,
  .saved-records {
    grid-template-columns: 1fr;
  }

  .quick-replies > div {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .quick-replies button {
    flex: 0 0 min(260px, 82vw);
  }

  .scenario-card {
    min-height: 152px;
  }

  .card-top {
    align-items: flex-start;
  }

  .prep-settings {
    order: -1;
  }

  .opening-line p {
    font-size: 18px;
  }

  .practice-frame {
    padding: 10px 10px 18px;
  }

  .session-toolbar {
    gap: 10px;
    margin-bottom: 10px;
  }

  .session-title-block h1 {
    font-size: 24px;
  }

  .session-controls {
    display: flex;
    width: 100%;
    gap: 8px;
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 3px;
    scrollbar-width: none;
  }

  .session-controls label {
    flex: 0 0 126px;
    min-width: 126px;
  }

  .session-controls .tool-button {
    flex: 0 0 auto;
    min-width: 66px;
  }

  .session-grid {
    display: flex;
    flex-direction: column;
  }

  .chat-panel {
    order: 1;
    width: 100%;
    height: calc(100dvh - 276px);
    min-height: 460px;
    max-height: 650px;
  }

  .feedback-panel {
    order: 2;
    width: 100%;
  }

  .chat-log {
    padding: 12px;
  }

  .message {
    max-width: 94%;
  }

  .chat-form {
    grid-template-columns: 48px minmax(0, 1fr) 74px;
    gap: 8px;
    padding: 10px;
  }

  .speech-panel {
    grid-template-columns: 34px repeat(3, minmax(0, 1fr)) 30px;
    padding: 9px;
  }

  .speech-copy {
    grid-column: 2 / 5;
  }

  .speech-dismiss {
    grid-column: 5;
    grid-row: 1;
  }

  .speech-retry,
  .speech-help,
  .speech-type {
    grid-row: 2;
    max-width: none;
    line-height: 1.15;
  }

  .speech-retry {
    grid-column: 1 / 3;
  }

  .speech-help {
    grid-column: 3 / 4;
  }

  .speech-type {
    grid-column: 4 / 6;
  }

  .intent-row {
    grid-template-columns: minmax(0, 1fr) 112px;
    gap: 8px;
  }

  .intent-submit {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    padding: 6px 8px;
    justify-content: center;
    white-space: normal;
    line-height: 1.15;
    text-align: center;
    font-size: 12px;
  }

  .chat-form .button {
    padding: 0 12px;
  }

  .guided-mode .chat-panel {
    height: calc(100dvh - 226px);
    min-height: 390px;
    max-height: 520px;
  }

  .guided-mode .hint-strip {
    min-height: 34px;
    padding: 8px 10px;
    font-size: 12px;
  }

  .guided-mode .quick-replies {
    gap: 5px;
    padding: 8px 10px;
  }

  .guided-mode .quick-replies > div {
    gap: 6px;
  }

  .guided-mode .quick-replies button {
    flex-basis: min(188px, 58vw);
    min-height: 66px;
    padding: 6px 8px;
    font-size: 12px;
  }

  .guided-mode .quick-reply-zh,
  .guided-mode .quick-reply-meaning {
    -webkit-line-clamp: unset;
    line-clamp: unset;
  }

  .guided-mode .quick-reply-pinyin,
  .guided-mode .quick-reply-meaning {
    font-size: 11px;
  }

  .guided-mode .chat-form {
    grid-template-columns: minmax(0, 1fr) 68px;
    gap: 8px;
    padding: 8px 10px;
  }

  .guided-mode .chat-form .button {
    padding: 0 8px;
  }

  .guided-mode #userMessage[readonly] {
    font-size: 14px;
  }

  .feedback-card,
  .launch-panel,
  .custom-form,
  .prep-settings,
  .summary-card-inner {
    padding: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .loading-spinner {
    animation-duration: 1400ms;
  }
}
