:root {
  --ink: hsl(220 15% 25%);
  --muted: #5e687a;
  --brand: #3d5ca3;
  --brand-dark: #2a4480;
  --brand-soft: hsl(220 45% 92%);
  --accent: hsl(250 60% 75%);
  --paper: hsl(220 25% 97%);
  --canvas: hsl(220 30% 94%);
  --border: hsl(220 15% 86%);
  --habit-blue: hsl(220 75% 70%);
  --habit-lavender: hsl(250 60% 75%);
  --habit-peach: hsl(25 75% 88%);
  --habit-lilac: hsl(260 40% 92%);
  --danger: #a13b3b;
  --danger-soft: #fbeaea;
  --success: #176b49;
  --shadow: 0 12px 40px rgba(54, 61, 90, 0.07);
  --radius: 18px;
}

/* Systematisches Training */
.training-part-grid,
.training-option-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-block: 1.5rem;
}

.training-part-card,
.training-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
  position: relative;
}

.training-part-number {
  display: inline-grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  background: var(--color-primary, #155e75);
  color: #fff;
  font-weight: 800;
}

.training-part-card--coming {
  min-height: 8rem;
  opacity: 0.68;
}

.training-part-card--coming .training-part-number {
  background: #64748b;
}

.training-history {
  list-style: none;
  padding: 0;
}

.training-history li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.7rem;
  border-bottom: 1px solid var(--color-border, #dbe4e8);
}

.training-task {
  display: grid;
  gap: 1.5rem;
}

.training-listening {
  padding: 1rem;
  border: 1px solid var(--color-border, #dbe4e8);
  border-radius: 0.8rem;
  background: #f6fbfc;
}

.playback-controls,
.voice-source-controls,
.rating-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-block: 1rem;
}

.voice-source-controls {
  margin-block: 0.8rem 0.45rem;
}

.voice-source-controls .is-active {
  background: var(--brand-soft);
  border-color: var(--brand);
  color: var(--brand-dark);
}

.spelling-playback {
  border-top: 1px solid var(--color-border, #dbe4e8);
  margin-top: 1rem;
  padding-top: 1rem;
}

.spelling-playback h3 {
  margin: 0 0 0.35rem;
}

.training-listening audio {
  display: none;
}

.revealed-medication {
  padding: 0.75rem 1rem;
  border-left: 4px solid #0e7490;
  background: #ecfeff;
}

.training-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.training-field-grid input,
.training-phone-form input {
  width: 100%;
}

.result-field input[readonly],
.submitted-answer[readonly] {
  background: #f7f9f8;
  border: 1px solid var(--border);
  color: var(--ink);
  cursor: default;
  width: 100%;
}

.submitted-answer[readonly] {
  border-radius: 12px;
  font: inherit;
  line-height: 1.6;
  padding: 1rem;
  resize: vertical;
}

.inline-field-status {
  font-weight: 700;
  margin: 0.45rem 0 0;
}

.result-field--correct .inline-field-status {
  color: var(--success);
}

.result-field--incorrect .inline-field-status,
.result-field--case .inline-field-status {
  color: var(--danger);
}

.private-recording {
  display: block;
  margin-block: 0.75rem;
  max-width: 100%;
  width: 32rem;
}

.training-next-action {
  border-top: 1px solid var(--border);
  margin-top: 0.5rem;
  padding-top: 1.5rem;
}

.training-verdict > div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.75rem;
  border-bottom: 1px solid var(--color-border, #dbe4e8);
}

.correction-row--correct {
  background: #ecfdf5;
  color: #14532d;
}

.correction-row--incorrect,
.correction-row--case {
  background: #fef2f2;
  color: #7f1d1d;
}

.training-task button:focus-visible,
.training-option button:focus-visible,
.training-part-card a:focus-visible,
.rating-grid button:focus-visible {
  outline: 3px solid #f59e0b;
  outline-offset: 3px;
}

@media (max-width: 720px) {
  .training-part-grid,
  .training-option-grid,
  .training-field-grid {
    grid-template-columns: 1fr;
  }

  .training-history li,
  .training-verdict > div {
    align-items: flex-start;
    flex-direction: column;
  }
}

* { box-sizing: border-box; }
html { color-scheme: light; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
}
a { color: var(--brand); font-weight: 650; text-underline-offset: 3px; }
a:hover { color: var(--brand-dark); }
button, input, select { font: inherit; }
:focus-visible { outline: 3px solid #e1ad4f; outline-offset: 3px; }
.skip-link {
  left: 1rem;
  padding: .7rem 1rem;
  position: fixed;
  top: -5rem;
  z-index: 100;
  background: var(--ink);
  color: white;
}
.skip-link:focus { top: 1rem; }

.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(340px, .9fr) minmax(500px, 1.1fr); }
.auth-intro {
  background:
    radial-gradient(circle at 80% 15%, rgba(212, 164, 78, .14), transparent 30%),
    linear-gradient(145deg, #0a5c57, #123f45);
  color: white;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: clamp(2rem, 5vw, 5.5rem);
}
.brand { display: inline-flex; align-items: center; gap: .75rem; color: inherit; font-size: 1.1rem; font-weight: 800; text-decoration: none; letter-spacing: -.02em; }
.brand-mark { align-items: center; background: var(--accent); border-radius: 11px; color: #15373b; display: inline-flex; font-size: 1.65rem; font-weight: 500; height: 42px; justify-content: center; width: 42px; }
.auth-intro__content { margin: auto 0; max-width: 650px; padding: 5rem 0; }
.eyebrow { color: var(--brand); font-size: .76rem; font-weight: 800; letter-spacing: .14em; margin: 0 0 .8rem; text-transform: uppercase; }
.auth-intro .eyebrow { color: #b9dcd6; }
.auth-intro h1 { font-family: inherit; font-size: clamp(2.4rem, 5vw, 4.5rem); font-weight: 700; letter-spacing: -.035em; line-height: 1.06; margin: 0; }
.intro-copy { color: #d9e8e6; font-size: 1.08rem; max-width: 560px; }
.feature-list { display: grid; gap: .85rem; list-style: none; margin: 2.25rem 0 0; padding: 0; }
.feature-list li { display: flex; gap: .75rem; }
.feature-list span { color: #f4c66f; font-weight: 900; }
.auth-intro__note { color: #b9d0ce; font-size: .78rem; margin: 0; }
.auth-panel { align-items: center; background: var(--paper); display: flex; justify-content: center; padding: clamp(2rem, 7vw, 7rem); }
.auth-card { max-width: 560px; width: 100%; }
.auth-heading { margin-bottom: 2rem; }
.auth-heading h2 { font-family: inherit; font-size: clamp(2rem, 4vw, 2.8rem); font-weight: 700; letter-spacing: -.025em; line-height: 1.12; margin: 0 0 .8rem; }
.auth-heading > p:last-child { color: var(--muted); margin: 0; }
.stack { display: grid; gap: 1.2rem; }
.form-grid { display: grid; gap: 1.2rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-group { min-width: 0; }
.form-group--full { grid-column: 1 / -1; }
.form-group > label, .label-row label { display: inline-block; font-size: .9rem; font-weight: 750; margin-bottom: .42rem; }
.label-row { align-items: center; display: flex; justify-content: space-between; }
.label-row a { font-size: .82rem; }
.form-control, input[type="email"], input[type="password"], input[type="text"],
input[type="date"], select {
  appearance: none;
  background: white;
  border: 1px solid #b9c9c6;
  border-radius: 10px;
  color: var(--ink);
  min-height: 48px;
  padding: .75rem .9rem;
  width: 100%;
}
.form-control:hover { border-color: #809b97; }
.form-control:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(11, 107, 101, .12); outline: none; }
.password-field { position: relative; }
.password-field .form-control { padding-right: 6.2rem; }
.password-toggle { background: transparent; border: 0; color: var(--brand); cursor: pointer; font-size: .78rem; font-weight: 750; padding: .5rem; position: absolute; right: .35rem; top: 50%; transform: translateY(-50%); }
.check-row { align-items: center; cursor: pointer; display: inline-flex; font-size: .9rem; gap: .65rem; width: fit-content; }
.form-check-input { accent-color: var(--brand); height: 18px; width: 18px; }
.field-help { color: var(--muted); font-size: .76rem; margin-top: .35rem; }
.field-help ul { margin: .35rem 0 0; padding-left: 1.2rem; }
.field-error { color: var(--danger); font-size: .82rem; font-weight: 650; margin: .35rem 0 0; }
.alert { border-radius: 10px; padding: .85rem 1rem; }
.alert p { margin: 0; }
.alert--error { background: var(--danger-soft); border-left: 4px solid var(--danger); color: #7e2727; }
.button { align-items: center; border: 1px solid transparent; border-radius: 10px; cursor: pointer; display: inline-flex; font-weight: 750; justify-content: center; min-height: 50px; padding: .75rem 1.2rem; text-decoration: none; }
.button--wide { width: 100%; }
.button--primary { background: var(--brand); color: white; box-shadow: 0 8px 20px rgba(11, 107, 101, .16); }
.button--primary:hover { background: var(--brand-dark); color: white; }
.button--secondary { border-color: var(--border); color: var(--brand); }
.auth-switch { border-top: 1px solid var(--border); color: var(--muted); font-size: .9rem; margin: 2rem 0 0; padding-top: 1.4rem; text-align: center; }
.legal-note { color: var(--muted); font-size: .75rem; margin: 0; text-align: center; }

.site-header { align-items: center; background: white; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; min-height: 72px; padding: .8rem clamp(1rem, 5vw, 5rem); }
.brand--compact { color: var(--ink); }
.brand--compact .brand-mark { height: 36px; width: 36px; }
.site-header nav { align-items: center; display: flex; gap: 1.5rem; }
.site-header nav a, .nav-button { background: none; border: 0; color: var(--muted); cursor: pointer; font-weight: 700; text-decoration: none; }
.site-header form { display: inline; margin: 0; }
.page-container { margin: 0 auto; max-width: 1180px; padding: clamp(2rem, 6vw, 5rem) 1.25rem; }
.page-container--narrow { max-width: 850px; }
.page-heading { margin-bottom: 2rem; }
.page-heading h1 { font-family: inherit; font-size: clamp(2.2rem, 5vw, 3.7rem); font-weight: 700; letter-spacing: -.03em; line-height: 1.1; margin: 0; }
.page-heading p:last-child { color: var(--muted); }
.page-heading--split { align-items: flex-start; display: flex; gap: 2rem; justify-content: space-between; }
.surface { background: white; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: clamp(1.5rem, 4vw, 3rem); }
.empty-state { text-align: center; }
.empty-icon { align-items: center; background: var(--brand-soft); border-radius: 50%; color: var(--brand); display: inline-flex; font-size: 2rem; height: 64px; justify-content: center; width: 64px; }
.messages { display: grid; gap: .75rem; margin: 1rem auto 0; max-width: 1180px; padding: 0 1.25rem; }
.message { align-items: center; background: white; border: 1px solid var(--border); border-left: 5px solid var(--success); border-radius: 10px; display: flex; gap: 1rem; padding: .65rem 1rem; }
.message p { flex: 1; margin: 0; min-width: 0; overflow-wrap: anywhere; }
.message-close { align-items: center; background: transparent; border: 0; border-radius: 6px; color: var(--muted); cursor: pointer; display: inline-flex; flex: none; font-size: 1.5rem; justify-content: center; min-height: 44px; min-width: 44px; }
.message-close:hover { background: var(--brand-soft); color: var(--ink); }
.status-pill { background: #f7edd8; border: 1px solid #ead3a7; border-radius: 999px; color: #725417; flex: none; font-size: .76rem; font-weight: 800; padding: .45rem .8rem; }
.card-grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.subject-card, .case-card { background: white; border: 1px solid var(--border); border-radius: var(--radius); display: flex; flex-direction: column; padding: 1.6rem; }
.subject-card { box-shadow: 0 12px 34px rgba(20, 47, 54, .06); gap: 1.15rem; }
.subject-card__icon { align-items: center; background: var(--brand-soft); border-radius: 13px; color: var(--brand); display: flex; font-size: 1.5rem; height: 48px; justify-content: center; width: 48px; }
.card-kicker, .case-card__meta { color: var(--muted); font-size: .76rem; font-weight: 750; margin: 0; text-transform: uppercase; }
.subject-card h2, .case-card h3 { margin: .15rem 0 .45rem; }
.subject-card h2 a, .case-card h3 a { color: var(--ink); text-decoration: none; }
.subject-card p, .case-card p { color: var(--muted); margin: 0; }
.compact-list { border-bottom: 1px solid var(--border); border-top: 1px solid var(--border); list-style: none; margin: 0; padding: .65rem 0; }
.compact-list li { display: flex; font-size: .86rem; justify-content: space-between; padding: .3rem 0; }
.compact-list span { color: var(--muted); }
.card-link { margin-top: auto; text-decoration: none; }
.breadcrumbs { align-items: center; color: var(--muted); display: flex; flex-wrap: wrap; font-size: .84rem; gap: .5rem; margin-bottom: 2.2rem; }
.breadcrumbs a { color: var(--muted); }
.category-section { margin: 3rem 0; }
.section-heading { align-items: flex-end; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; margin-bottom: 1.2rem; padding-bottom: .8rem; }
.section-heading h2 { font-family: inherit; font-size: 2rem; font-weight: 700; margin: 0; }
.section-heading > span { color: var(--muted); font-size: .85rem; }
.case-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.case-card { gap: .9rem; }
.case-card__meta { display: flex; flex-wrap: wrap; gap: .8rem; }
.case-card__meta span + span::before { color: #adc0bc; content: "•"; margin-right: .8rem; }
.case-layout { align-items: start; display: grid; gap: 2rem; grid-template-columns: minmax(0, 1fr) 330px; }
.prototype-notice { background: #fff8e9; border: 1px solid #ead3a7; border-radius: 10px; color: #6f531e; margin-bottom: 1.25rem; padding: .8rem 1rem; }
.case-story h2 { font-family: inherit; font-size: 1.35rem; font-weight: 700; margin: 2rem 0 .25rem; }
.case-story h2:first-of-type { margin-top: 1.3rem; }
.case-story p { color: #3f545c; margin-top: 0; }
.patient-facts { display: flex; flex-wrap: wrap; gap: .6rem; }
.patient-facts span { background: var(--brand-soft); border-radius: 999px; color: var(--brand-dark); font-size: .82rem; padding: .35rem .7rem; }
.case-sidebar { position: sticky; top: 1.5rem; }
.case-sidebar h2 { font-family: inherit; font-size: 1.7rem; font-weight: 700; line-height: 1.2; margin-top: 0; }
.case-sidebar dl { border-bottom: 1px solid var(--border); border-top: 1px solid var(--border); margin: 1.4rem 0; padding: .75rem 0; }
.case-sidebar dl div { display: flex; justify-content: space-between; padding: .35rem 0; }
.case-sidebar dt { color: var(--muted); }
.case-sidebar dd { font-weight: 750; margin: 0; }
.muted { color: var(--muted); }
.visually-hidden { clip: rect(0 0 0 0); clip-path: inset(50%); height: 1px; overflow: hidden; position: absolute; white-space: nowrap; width: 1px; }
.practice-shell { margin: 0 auto; max-width: 1320px; padding: clamp(1.5rem, 4vw, 3rem) 1.25rem 5rem; }
.practice-header { align-items: flex-end; display: flex; justify-content: space-between; }
.practice-header h1 { font-family: inherit; font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 700; margin: 0; }
.practice-header .eyebrow { margin-top: 1rem; }
.back-link { color: var(--muted); font-size: .82rem; }
.question-count { color: var(--muted); font-size: 1rem; }
.question-count strong { color: var(--ink); font-size: 1.7rem; }
.progress-track { background: #dce7e5; border-radius: 999px; height: 7px; margin: 1rem 0 2rem; overflow: hidden; }
.progress-track span { background: var(--brand); border-radius: inherit; display: block; height: 100%; }
.practice-layout { align-items: start; display: grid; gap: 1.5rem; grid-template-columns: minmax(0, 1fr) 310px; }
.question-surface h2 { font-family: inherit; font-size: clamp(1.65rem, 3vw, 2.35rem); font-weight: 700; line-height: 1.25; margin: 1.2rem 0 1.8rem; }
.question-meta { display: flex; flex-wrap: wrap; gap: .6rem; }
.question-meta span { background: var(--brand-soft); border-radius: 999px; color: var(--brand-dark); font-size: .75rem; font-weight: 750; padding: .3rem .65rem; }
.answer-tabs { border-bottom: 1px solid var(--border); display: flex; gap: 1.2rem; margin-bottom: 1.2rem; }
.answer-tab { background: transparent; border: 0; color: var(--muted); font-weight: 750; padding: .8rem .15rem; }
.answer-tab.is-active { border-bottom: 3px solid var(--brand); color: var(--brand); }
.answer-tab--disabled { cursor: not-allowed; opacity: .55; }

.import-review-table-wrap { border: 1px solid var(--border); max-height: 65vh; overflow: auto; }
.import-review-table { border-collapse: collapse; min-width: 100%; }
.import-review-table th, .import-review-table td { border-bottom: 1px solid var(--border); padding: .65rem; text-align: left; vertical-align: top; }
.import-review-table thead th { background: var(--surface); position: sticky; top: 0; z-index: 1; }
.import-review-table input[type="text"], .import-review-table input[type="number"], .import-review-table select, .import-review-table textarea { box-sizing: border-box; min-width: 11rem; width: 100%; }
.import-field--main_indication, .import-field--example_answer { min-width: 20rem; }
.import-review-table small { color: var(--muted); display: block; margin-top: .35rem; }
.answer-textarea { border: 1px solid #b9c9c6; border-radius: 12px; color: var(--ink); font: inherit; line-height: 1.65; min-height: 250px; padding: 1rem; resize: vertical; width: 100%; }
.answer-textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(11, 107, 101, .12); outline: none; }
.answer-helper { color: var(--muted); display: flex; font-size: .75rem; justify-content: space-between; margin-top: .3rem; }
.answer-actions { align-items: center; display: flex; justify-content: space-between; }
.practice-aside { display: grid; gap: 1rem; }
.tip-card, .history-card { box-shadow: none; padding: 1.3rem; }
.tip-card h2, .history-card h2 { font-family: inherit; font-size: 1.25rem; font-weight: 700; margin: 0 0 .5rem; }
.tip-card p:last-child { color: var(--muted); font-size: .86rem; }
.history-card ul { list-style: none; margin: 0; padding: 0; }
.history-card li { border-top: 1px solid var(--border); display: flex; flex-direction: column; font-size: .82rem; padding: .7rem 0; }
.history-card li span { color: var(--muted); }
.submission-status { align-items: center; background: var(--brand-soft); border-radius: 12px; display: flex; gap: 1rem; padding: 1rem; }
.submission-status p { color: var(--muted); margin: .1rem 0 0; }
.status-symbol { align-items: center; background: white; border-radius: 50%; color: var(--success); display: flex; flex: none; font-size: 1.2rem; font-weight: 900; height: 42px; justify-content: center; width: 42px; }
.status-spinner { animation: spin 1s linear infinite; border: 4px solid white; border-radius: 50%; border-top-color: var(--brand); height: 36px; width: 36px; }
@keyframes spin { to { transform: rotate(360deg); } }
.original-answer { background: #f7f9f8; border-left: 4px solid #b9c9c6; border-radius: 4px 10px 10px 4px; padding: 1.2rem; }
.grading-card { display: grid; gap: 1rem; margin-top: 1.5rem; }
.grading-card h2 { font-family: inherit; font-weight: 700; margin: 0; }
.grade-grid { display: grid; gap: .65rem; grid-template-columns: repeat(4, 1fr); }
.grade-button { background: white; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; font-weight: 750; padding: .75rem; }
.grade-button--again { border-color: #daa3a3; color: #8b3030; }
.grade-button--hard { border-color: #dbc596; color: #76591d; }
.grade-button--good, .grade-button--easy { border-color: #8fc7b1; color: #176b49; }
.completion-card { margin-bottom: 1.5rem; text-align: center; }
.completion-card h1 { font-family: inherit; font-size: 2.5rem; font-weight: 700; margin: .2rem 0; }
.completion-mark { align-items: center; background: var(--brand-soft); border-radius: 50%; color: var(--success); display: inline-flex; font-size: 2rem; height: 70px; justify-content: center; margin-bottom: 1rem; width: 70px; }
.summary-actions { display: flex; flex-wrap: wrap; gap: .7rem; justify-content: center; margin-top: 1.5rem; }
.review-list { display: grid; gap: 1rem; }
.review-row { align-items: center; box-shadow: none; display: flex; gap: 2rem; justify-content: space-between; padding: 1.4rem; }
.review-row h2 { font-size: 1.05rem; margin: .3rem 0; }
.review-row p:last-child { color: var(--muted); font-size: .8rem; margin: 0; }
.is-hidden { display: none !important; }
.recorder-card { background: #f7f9f8; border: 1px solid var(--border); border-radius: 14px; padding: 1.2rem; }
.recorder-status { align-items: center; display: flex; gap: .8rem; }
.recorder-status p { color: var(--muted); font-size: .82rem; margin: 0; }
.recorder-status time { font-variant-numeric: tabular-nums; font-weight: 800; margin-left: auto; }
.record-dot { background: #b6c7c4; border-radius: 50%; height: 12px; width: 12px; }
.recorder-controls { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; }
.button--record { background: #9d3d3d; color: white; }
.button--danger { border-color: #d6a0a0; color: var(--danger); }
.audio-preview { align-items: center; display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1rem; }
.audio-preview audio, .audio-submission audio { max-width: 100%; width: 100%; }
.upload-fallback { border-top: 1px solid var(--border); display: grid; font-size: .82rem; gap: .4rem; margin-top: 1rem; padding-top: 1rem; }
.upload-fallback input { max-width: 100%; }
.upload-progress { margin-top: 1rem; }
.upload-progress > div { display: flex; font-size: .78rem; justify-content: space-between; }
.upload-progress progress { accent-color: var(--brand); height: 10px; width: 100%; }
.audio-submission { display: grid; gap: .4rem; }
.audio-submission span { color: var(--muted); font-size: .8rem; }
.text-button { background: transparent; border: 0; cursor: pointer; font: inherit; font-size: .82rem; font-weight: 700; padding: .5rem 0; text-decoration: underline; text-underline-offset: 3px; }
.text-button--danger { color: var(--danger); }
.feedback-report { display: grid; gap: 1.25rem; margin-top: 1.5rem; }
.score-overview { align-items: center; display: flex; gap: 2rem; justify-content: space-between; }
.score-overview h2 { font-family: inherit; font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 700; line-height: 1.3; margin: 0; }
.confidence-note { color: var(--muted); font-size: .76rem; }
.score-ring { align-items: center; aspect-ratio: 1; background: conic-gradient(var(--brand) calc(var(--score) * 1%), #e4ecea 0); border-radius: 50%; display: flex; flex: 0 0 118px; flex-direction: column; justify-content: center; position: relative; }
.score-ring::before { background: white; border-radius: 50%; content: ""; inset: 9px; position: absolute; }
.score-ring strong, .score-ring span { position: relative; z-index: 1; }
.score-ring strong { font-size: 2rem; line-height: 1; }
.score-ring span { color: var(--muted); font-size: .7rem; }
.score-grid { display: grid; gap: .7rem; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.mini-score { background: white; border: 1px solid var(--border); border-radius: 12px; display: grid; gap: .35rem; padding: .9rem; }
.mini-score > span { color: var(--muted); font-size: .73rem; font-weight: 700; }
.mini-score > strong { font-size: 1.4rem; }
.mini-score > div { background: #e4ecea; border-radius: 999px; height: 5px; overflow: hidden; }
.mini-score i { background: var(--brand); display: block; height: 100%; }
.feedback-section { box-shadow: none; }
.feedback-section > h2, .next-drill h2 { font-family: inherit; font-size: 1.55rem; font-weight: 700; margin: 0 0 1rem; }
.feedback-list { display: grid; gap: .7rem; list-style: none; margin: 0; padding: 0; }
.feedback-list li { align-items: flex-start; display: flex; gap: .65rem; }
.feedback-list li span { color: var(--brand); font-weight: 900; }
.feedback-list--success li { background: #eff8f4; border-radius: 9px; padding: .7rem; }
.issue-card { border: 1px solid var(--border); border-left: 4px solid #d69a58; border-radius: 8px; margin-top: .8rem; padding: 1rem; }
.issue-card--uncertain { border-style: dashed; }
.issue-card p { margin: .45rem 0; }
.issue-card del { color: #8b3030; text-decoration-thickness: 2px; }
.issue-labels { display: flex; flex-wrap: wrap; gap: .45rem; }
.issue-labels span { background: #f5ecdc; border-radius: 999px; color: #74551f; font-size: .67rem; font-weight: 800; padding: .25rem .55rem; text-transform: uppercase; }
.score-comparison { align-items: center; display: flex; flex-wrap: wrap; font-size: 1.05rem; gap: .55rem; margin-bottom: 1.2rem; }
.score-comparison strong { font-size: 1.45rem; }
.score-delta { border-radius: 999px; font-size: .78rem; font-weight: 800; padding: .28rem .65rem; }
.score-delta--improved { background: #e4f4eb; color: #0f5d3c; }
.score-delta--lower { background: var(--danger-soft); color: #842f2f; }
.score-delta--same { background: #edf1f0; color: #45585f; }
.result-counts { display: grid; gap: .7rem; grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr)); margin: 0; }
.result-counts div { background: #f7f9f8; border-radius: 10px; padding: .8rem; }
.result-counts dt { color: var(--muted); font-size: .75rem; font-weight: 750; }
.result-counts dd { font-size: 1.4rem; font-weight: 800; margin: .15rem 0 0; }
.scoring-mode-picker { border: 0; margin: 0; padding: 0; }
.scoring-mode-picker legend { font-size: 1rem; font-weight: 800; margin-bottom: .35rem; }
.scoring-mode-picker > p { font-size: .82rem; margin: 0 0 .75rem; }
.scoring-mode-options { display: grid; gap: .55rem; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.scoring-mode-option { align-items: flex-start; background: #f7f9f8; border: 2px solid var(--border); border-radius: 10px; cursor: pointer; display: flex; font-size: .82rem; font-weight: 700; gap: .55rem; padding: .75rem; }
.scoring-mode-option:has(input:checked) { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-dark); }
.scoring-mode-option:focus-within { box-shadow: 0 0 0 3px rgba(25, 105, 87, .2); outline: 2px solid var(--brand); outline-offset: 2px; }
.scoring-mode-option input { flex: 0 0 auto; margin-top: .15rem; }
.speech-panel > p { color: var(--muted); }
.target-playback { align-items: center; display: flex; flex-wrap: wrap; gap: 1rem; }
.target-playback .button { gap: .5rem; }
.speech-rate { align-items: center; border: 1px solid var(--border); border-radius: 10px; display: inline-flex; gap: .25rem; padding: .25rem; }
.speech-rate > span { color: var(--muted); font-size: .75rem; font-weight: 750; padding: 0 .35rem; }
.speech-rate button { background: transparent; border: 0; border-radius: 7px; color: var(--brand); cursor: pointer; font-size: .8rem; font-weight: 750; padding: .5rem .65rem; }
.speech-rate button[aria-pressed="true"] { background: var(--brand-soft); color: var(--brand-dark); }
.speech-unavailable { background: var(--danger-soft); border-left: 4px solid var(--danger); color: #782d2d !important; padding: .75rem; }
.speech-status { font-size: .8rem; min-height: 1.5em; }
.phone-comparison { border: 1px solid var(--border); border-radius: 12px; margin-top: 1rem; overflow-x: auto; padding: .55rem; }
.phone-table { border-collapse: separate; border-spacing: .4rem; min-width: max-content; width: 100%; }
.phone-table th { background: white; color: var(--muted); font-size: .75rem; left: -.55rem; min-width: 5rem; padding: .5rem; position: sticky; text-align: left; z-index: 2; }
.phone-table td { min-width: 7.1rem; padding: 0; vertical-align: stretch; width: 7.1rem; }
.phone-cell { align-items: center; border: 2px solid; border-radius: 10px; display: flex; flex-direction: column; justify-content: center; min-height: 7.5rem; padding: .55rem; text-align: center; width: 100%; }
.phone-cell--correct { background: #e7f5ed; border-color: #438563; color: #104f35; }
.phone-cell--error { background: #fff0f0; border-color: #b54b4b; color: #782727; }
.phone-cell--near { background: #fff7dc; border-color: #aa7a18; color: #684806; }
.phone-cell--placeholder { background: #f6f8f7; border-color: #aab8b5; border-style: dashed; color: var(--muted); font-size: 1.5rem; }
.phone-cell__sounds { display: flex; flex-wrap: wrap; gap: .3rem; justify-content: center; }
.phone-cell__sound { align-items: center; background: rgba(255, 255, 255, .55); border: 1px solid currentColor; border-radius: 7px; color: inherit; cursor: pointer; display: flex; flex-direction: column; font: inherit; padding: .35rem; }
.phone-cell__sound:hover { background: rgba(255, 255, 255, .9); }
.phone-cell__sound:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.phone-cell__ipa { font-family: Georgia, "Times New Roman", serif; font-size: 1.35rem; font-weight: 700; line-height: 1.1; }
.phone-cell__status { font-size: .7rem; font-weight: 850; margin-top: .4rem; text-transform: uppercase; }
.phone-cell__example { font-size: .66rem; line-height: 1.25; margin-top: .35rem; }
.phone-legend { display: flex; flex-wrap: wrap; font-size: .75rem; font-weight: 750; gap: .55rem; margin: .8rem 0 1.5rem; }
.phone-legend span { border-radius: 999px; padding: .3rem .65rem; }
.phone-legend__correct { background: #e7f5ed; color: #104f35; }
.phone-legend__near { background: #fff7dc; color: #684806; }
.phone-legend__error { background: #fff0f0; color: #782727; }
.ignored-onset-note { background: #edf6f3; border-left: 4px solid var(--brand); color: var(--brand-dark); margin-top: 1rem; padding: .7rem; }
.affricate-help { background: #fff7dc; border-left: 4px solid #aa7a18; color: #684806; margin-top: 1rem; padding: .7rem; }
.analysis-method { background: #edf6f3; border-left: 4px solid var(--brand); padding: .7rem; }
.analysis-method--fallback { background: #fff7dc; border-left-color: #aa7a18; }
.repeat-recorder { margin-top: 1.2rem; }
.repeat-recorder > summary { color: var(--brand); cursor: pointer; font-size: 1.05rem; font-weight: 800; }
.repeat-recorder[open] > summary { margin-bottom: 1rem; }
.repeat-recorder > p { color: var(--muted); }
.repeat-recorder .answer-form { box-shadow: none; margin-top: 1rem; padding: 0; }
.correction { color: var(--success); }
.feedback-columns { display: grid; gap: 1rem; grid-template-columns: 1fr 1fr; }
.feedback-columns > div { background: #f7f9f8; border-radius: 10px; padding: 1rem; }
.feedback-columns h3 { font-size: .92rem; margin: 0; }
.feedback-columns h3 span { color: var(--brand); }
.feedback-columns ul { margin-bottom: 0; padding-left: 1.2rem; }
.section-heading-inline { align-items: flex-start; display: flex; justify-content: space-between; }
.section-heading-inline h2 { font-family: inherit; font-size: 1.55rem; font-weight: 700; margin: 0 0 1rem; }
.pronunciation-grid { display: grid; gap: .8rem; grid-template-columns: repeat(2, 1fr); }
.pronunciation-grid div { border-top: 1px solid var(--border); padding-top: .6rem; }
.pronunciation-grid dt { color: var(--muted); font-size: .72rem; font-weight: 800; text-transform: uppercase; }
.pronunciation-grid dd { margin: .2rem 0 0; }
.answer-comparison { display: grid; gap: 1.25rem; grid-template-columns: 1fr 1fr; }
.feedback-section--model { background: #edf6f3; border-color: #bcd9d3; }
.model-answer { line-height: 1.75; }
.next-drill { align-items: center; box-shadow: none; display: flex; gap: 1rem; }
.next-drill h2 { margin: 0; }
.dashboard-welcome { align-items: flex-end; display: flex; gap: 2rem; justify-content: space-between; margin-bottom: 2rem; }
.dashboard-welcome h1 { font-family: inherit; font-size: clamp(2.2rem, 5vw, 3.7rem); font-weight: 700; letter-spacing: -.03em; line-height: 1.1; margin: 0; }
.dashboard-welcome p:last-child { color: var(--muted); margin-bottom: 0; }
.metric-grid { display: grid; gap: 1rem; grid-template-columns: repeat(4, 1fr); margin-bottom: 1.25rem; }
.metric-card { align-items: center; background: white; border: 1px solid var(--border); border-radius: 14px; display: flex; gap: .8rem; min-height: 110px; padding: 1.1rem; position: relative; }
.metric-card > div { display: flex; flex-direction: column; }
.metric-card strong { font-size: 1.7rem; line-height: 1.1; }
.metric-card span:not(.metric-icon) { color: var(--muted); font-size: .78rem; }
.metric-card small { color: var(--muted); font-size: .65rem; }
.metric-card > a { inset: 0; position: absolute; }
.metric-icon { align-items: center; background: var(--brand-soft); border-radius: 11px; color: var(--brand); display: flex; flex: none; font-size: 1.2rem; height: 42px; justify-content: center; width: 42px; }
.metric-icon--due { background: #f8edd9; color: #76591d; }
.metric-icon--streak { background: #f2e8f7; color: #674078; }
.continue-card { align-items: center; background: linear-gradient(120deg, #0a625c, #15464b); border-radius: var(--radius); color: white; display: flex; gap: 2rem; justify-content: space-between; margin-bottom: 2rem; padding: 1.5rem 2rem; }
.continue-card > div { flex: 1; }
.continue-card .eyebrow { color: #bee1db; }
.continue-card h2 { font-family: inherit; font-size: 1.8rem; font-weight: 700; margin: 0; }
.continue-card p { color: #d7e9e6; margin: .2rem 0 .8rem; }
.continue-card .progress-track { background: rgba(255,255,255,.25); margin: 0; max-width: 600px; }
.continue-card .progress-track span { background: #f1c46c; }
.continue-card .button--primary { background: white; box-shadow: none; color: var(--brand-dark); flex: none; }
.dashboard-columns { align-items: start; display: grid; gap: 1.5rem; grid-template-columns: minmax(0, 1fr) 320px; }
.dashboard-main, .dashboard-aside { display: grid; gap: 1.5rem; }
.dashboard-section { min-width: 0; }
.dashboard-section .section-heading { align-items: center; }
.dashboard-section .section-heading h2 { font-size: 1.7rem; }
.dashboard-specialties { display: grid; gap: .8rem; grid-template-columns: repeat(2, 1fr); }
.dashboard-specialty { align-items: center; background: white; border: 1px solid var(--border); border-radius: 12px; color: var(--ink); display: flex; gap: .8rem; padding: .9rem; text-decoration: none; }
.dashboard-specialty > div:nth-child(2) { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.dashboard-specialty small { color: var(--muted); font-size: .7rem; }
.dashboard-specialty .subject-card__icon { height: 38px; width: 38px; }
.session-table { background: white; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.session-row { align-items: center; border-top: 1px solid var(--border); display: grid; font-size: .78rem; gap: 1rem; grid-template-columns: minmax(180px, 1fr) 90px 100px 75px; padding: .85rem 1rem; }
.session-row:first-child { border-top: 0; }
.session-row > div { display: flex; flex-direction: column; }
.session-row small, .session-row > span { color: var(--muted); }
.empty-inline { color: var(--muted); padding: 1rem; }
.activity-list { background: white; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.activity-list > a { align-items: center; border-top: 1px solid var(--border); color: var(--ink); display: flex; gap: .8rem; padding: .8rem 1rem; text-decoration: none; }
.activity-list > a:first-child { border-top: 0; }
.activity-list .status-symbol { background: var(--brand-soft); height: 34px; width: 34px; }
.activity-list a > div { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.activity-list small, .activity-list time { color: var(--muted); font-size: .7rem; }
.analytics-card { box-shadow: none; padding: 1.25rem; }
.analytics-card h2 { font-family: inherit; font-size: 1.25rem; font-weight: 700; margin: 0 0 1rem; }
.analytics-bars { display: grid; gap: .85rem; }
.analytics-bars > div { display: grid; font-size: .74rem; gap: .3rem; grid-template-columns: 1fr auto; }
.analytics-bars > div > i { background: #e4ecea; border-radius: 99px; grid-column: 1 / -1; height: 5px; overflow: hidden; }
.analytics-bars b { background: var(--brand); display: block; height: 100%; }
.weak-list { list-style: none; margin: 0; padding: 0; }
.weak-list li { border-top: 1px solid var(--border); display: flex; font-size: .8rem; justify-content: space-between; padding: .55rem 0; }
.privacy-zone { align-items: center; border-color: #e6bcbc; box-shadow: none; display: flex; gap: 2rem; justify-content: space-between; margin-top: 2rem; }
.privacy-zone h2 { font-family: inherit; font-size: 1.5rem; font-weight: 700; margin: 0; }
.privacy-zone p:last-child { color: var(--muted); font-size: .85rem; margin-bottom: 0; }
.privacy-zone form { flex: none; }
.summary-metrics { display: flex; gap: 1rem; justify-content: center; margin: 1.5rem 0; }
.summary-metrics div { background: #f7f9f8; border-radius: 10px; display: flex; flex-direction: column; min-width: 105px; padding: .7rem; }
.summary-metrics strong { font-size: 1.5rem; }
.summary-metrics span { color: var(--muted); font-size: .7rem; }
.listening-source { border-bottom: 1px solid var(--border); margin-bottom: 1.5rem; padding-bottom: 1.5rem; }
.listening-recorder { display: grid; gap: .7rem; }
.live-transcript { background: white; border: 1px solid var(--border); border-radius: 10px; margin-top: 1rem; padding: 1rem; }
.live-transcript h3 { margin: 0; }
.live-transcript__text { line-height: 1.65; min-height: 3.3rem; }
.listening-review-step textarea { min-height: 11rem; width: 100%; }
.private-recording { margin: .6rem 0 1rem; max-width: 100%; width: 100%; }
.listening-score-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.listening-score-grid > div { background: #f7f9f8; border-radius: 10px; display: grid; padding: 1rem; }
.listening-score-grid strong { font-size: 1.6rem; }
.listening-score-grid span { color: var(--muted); font-size: .78rem; }
.listening-fact-table { min-width: 760px; }
.fact-status { border-radius: 999px; display: inline-block; font-size: .72rem; font-weight: 800; padding: .3rem .6rem; white-space: nowrap; }
.fact-status--retained { background: #e7f5ed; color: #104f35; }
.fact-status--partial { background: #fff7dc; color: #684806; }
.fact-status--missing, .fact-status--incorrect { background: #fff0f0; color: #782727; }
.transcript-reveals { display: grid; gap: .75rem; }
.transcript-reveals details { border: 1px solid var(--border); border-radius: 10px; padding: .8rem 1rem; }
.transcript-reveals summary { color: var(--brand); cursor: pointer; font-weight: 800; }
.transcript-reveals summary:focus-visible { outline: 3px solid rgba(25, 105, 87, .3); outline-offset: 4px; }

@media (max-width: 850px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-intro { min-height: auto; padding: 1.5rem; }
  .auth-intro__content { padding: 3.5rem 0 2rem; }
  .auth-intro h1 { font-size: 2.55rem; }
  .auth-intro__note, .feature-list { display: none; }
  .auth-panel { padding: 2.5rem 1.25rem 4rem; }
  .case-layout { grid-template-columns: 1fr; }
  .case-sidebar { position: static; }
  .practice-layout { grid-template-columns: 1fr; }
  .answer-comparison { grid-template-columns: 1fr; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-columns { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .scoring-mode-options { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .form-group--full { grid-column: auto; }
  .site-header { align-items: flex-start; gap: 1rem; }
  .site-header nav { align-items: flex-end; flex-direction: column; gap: .3rem; }
  .answer-actions, .review-row { align-items: stretch; flex-direction: column; }
  .grade-grid { grid-template-columns: repeat(2, 1fr); }
  .score-overview { align-items: flex-start; flex-direction: column-reverse; }
  .feedback-columns, .pronunciation-grid { grid-template-columns: 1fr; }
  .dashboard-welcome, .continue-card, .privacy-zone { align-items: stretch; flex-direction: column; }
  .dashboard-specialties { grid-template-columns: 1fr; }
  .session-row { grid-template-columns: 1fr 1fr; }
  .summary-metrics { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
/* Habit reference palette: https://habit.dawwa.cloud/ (verified 2026-09-08).
   Darker text/link variants preserve contrast on the pastel surfaces. */
body { background: radial-gradient(ellipse at 12% 0%, var(--brand-soft), transparent 48%), radial-gradient(ellipse at 94% 15%, var(--habit-lilac), transparent 48%), var(--canvas); }
h1, h2, h3, .auth-intro h1, .auth-heading h2, .page-heading h1 { font-family: inherit; font-weight: 700; letter-spacing: -.035em; }
.page-heading h1 { max-width: 850px; font-size: clamp(2rem, 4.3vw, 3.45rem); line-height: 1.12; }
.page-heading > p:last-child { max-width: 730px; line-height: 1.75; }
.page-container { padding-top: clamp(2rem, 5vw, 4rem); }
.site-header { background: rgba(248, 249, 253, .96); gap: 1.2rem; flex-wrap: wrap; padding: 1rem clamp(1rem, 3vw, 3rem); box-shadow: 0 3px 20px #363d4910; }
.site-header nav { flex-wrap: wrap; gap: .3rem; }
.site-header nav a, .nav-button { border-radius: 9px; padding: .65rem .75rem; font-size: .87rem; transition: background .18s ease, color .18s ease; }
.site-header nav a:hover, .nav-button:hover, .site-header nav a[aria-current] { background: var(--brand-soft); color: var(--brand-dark); }
.site-header nav a[aria-current] { box-shadow: inset 0 -2px 0 var(--habit-blue); }
.brand-mark { background: linear-gradient(135deg, var(--habit-blue), var(--habit-lavender)); color: #243654; box-shadow: 0 4px 12px #799fec30; }
.nav-toggle { display: none; border: 1px solid var(--border); color: var(--ink); background: var(--paper); border-radius: 10px; min-height: 44px; padding: .5rem .8rem; cursor: pointer; }
[hidden] { display: none !important; }
.surface, .subject-card, .case-card { background: rgba(250, 251, 254, .95); border-color: var(--border); box-shadow: var(--shadow); }
.button { border-radius: 11px; transition: transform .18s ease, box-shadow .18s ease, background .18s ease; }
.button--primary { background: linear-gradient(120deg, var(--habit-blue), var(--habit-lavender)); color: #1e2e4b; border-color: transparent; box-shadow: 0 5px 15px #799fec26; }
.button--primary:hover { background: linear-gradient(120deg, #8badf2, #beb0ed); color: #1e2e4b; box-shadow: 0 7px 20px #799fec40; }
.button--secondary { background: var(--paper); border-color: var(--border); color: var(--brand-dark); }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; }
.form-control, input[type=email], input[type=password], input[type=text], input[type=date], select, textarea { border-color: var(--border); background: #fff; }
.form-control:focus { border-color: var(--brand); box-shadow: 0 0 0 4px #799fec25; }
.training-part-card { padding: 1.65rem; overflow: hidden; transition: transform .2s ease, box-shadow .2s ease; }
.training-part-card .button { margin-top: auto; }
.training-part-card p { line-height: 1.65; }
.training-part-number { background: var(--brand-soft); color: var(--brand-dark); border-radius: 12px; width: 3rem; height: 3rem; }
.training-part-card:nth-child(2) .training-part-number { background: var(--habit-peach); color: #754724; }
.training-part-card:nth-child(3) .training-part-number { background: var(--habit-lilac); color: #594081; }
.training-part-card:nth-child(4) .training-part-number { background: #dbeaf2; color: #355f76; }
.training-part-card--coming { opacity: 1; color: var(--muted); box-shadow: none; background: #f4f5f980; min-height: 0; padding: 1.15rem 1.5rem; }
.training-part-card--coming h2 { font-size: 1rem; margin: 0; }
.training-part-card--coming .training-part-number { background: #e7eaf0; color: var(--muted); }
.progress-track > span { background: linear-gradient(90deg, var(--habit-blue), var(--habit-lavender)); transition: width .35s ease; }
.term-intro { display: grid; grid-template-columns: minmax(170px, .75fr) 1.25fr; gap: 2rem; align-items: center; }
.term-example { display: grid; text-align: center; gap: .8rem; padding: 2rem 1rem; border-radius: 16px; background: linear-gradient(145deg, var(--brand-soft), var(--habit-lilac)); }
.term-example span { color: var(--muted); font-size: .8rem; }
.term-example strong { font-size: 1.45rem; overflow-wrap: anywhere; }
.term-intro form { margin-top: 1.3rem; }
.term-prompt { background: linear-gradient(120deg, var(--brand-soft), var(--habit-lilac)); border-radius: 15px; padding: clamp(1.5rem, 4vw, 3rem); margin-bottom: 2rem; text-align: center; }
.term-prompt h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin: .7rem 0; overflow-wrap: anywhere; }
.term-answer { max-width: 620px; margin: 0 auto; }
.term-answer input { font-size: 1.15rem; min-height: 58px; }
.term-feedback { border: 1px solid var(--border); border-left: 4px solid #997942; background: #fbf3e9; padding: 1.5rem; border-radius: 12px; margin-bottom: 1.5rem; }
.term-feedback--correct { border-left-color: var(--success); background: #eef6f2; }
.term-feedback h3 { font-size: 1.65rem; margin: .5rem 0; }
.auth-intro { background: radial-gradient(ellipse at 85% 15%, var(--habit-peach), transparent 55%), linear-gradient(135deg, var(--brand-soft), var(--habit-lilac)); color: var(--ink); }
.auth-intro .eyebrow, .auth-intro__note, .intro-copy, .feature-list span { color: var(--brand-dark); }
.auth-panel { background: #f9faff; }
@media (max-width: 1100px) {
  .site-header { align-items: center; }
  .site-header[data-nav-ready] .nav-toggle { display: inline-flex; align-items: center; gap: .6rem; margin-left: auto; }
  .site-header[data-nav-ready] nav { display: none; width: 100%; }
  .site-header[data-nav-ready].nav-open nav { display: flex; align-items: stretch; flex-direction: row; gap: .35rem; padding-top: .6rem; }
  .site-header nav a { flex: 1 1 auto; text-align: center; }
}
@media (max-width: 620px) {
  .term-intro { grid-template-columns: 1fr; }
  .term-example { padding: 1.3rem; }
  .training-part-grid { grid-template-columns: 1fr; }
  .brand--compact { font-size: .95rem; }
  .training-part-card { padding: 1.3rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition: none !important; }
  .button:hover, .training-part-card--active:hover { transform: none; }
}
/* Loading feedback never intercepts input or replaces an available page. */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.page-loading-strip, .page-loading-skeleton { display: none; pointer-events: none; }
[data-page-loading] .page-loading-strip { display: block; position: fixed; z-index: 100; inset: 0 0 auto; height: 4px; background: linear-gradient(100deg, var(--habit-blue) 15%, var(--habit-lavender) 45%, var(--brand-soft) 60%, var(--habit-blue) 85%); background-size: 200% 100%; animation: skeleton-shimmer 1.4s linear infinite; }
[data-page-loading="initial"] .page-loading-skeleton { display: block; position: fixed; inset: 7rem max(1.25rem, calc((100vw - 1180px) / 2)) auto; z-index: 0; }
/* The parser can expose useful content before DOMContentLoaded. Hide at once. */
html:has(#main-content > *) .page-loading-skeleton { display: none; }
html[data-page-loading="initial"]:has(#main-content > *) .page-loading-strip { display: none; }
.skeleton-heading, .skeleton-line, .skeleton-cards > div { background: linear-gradient(110deg, var(--brand-soft) 25%, var(--paper) 45%, var(--brand-soft) 65%); background-size: 200% 100%; animation: skeleton-shimmer 1.4s linear infinite; border-radius: 14px; }
.skeleton-heading { width: 65%; height: 3rem; margin-bottom: 1.5rem; }
.skeleton-line { width: 85%; height: 1rem; margin-bottom: 3rem; }
.skeleton-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.skeleton-cards > div { height: 15rem; border: 1px solid var(--border); }
@keyframes skeleton-shimmer { to { background-position: -200% 0; } }

/* Lift follows real controls; static cards do not pretend to be buttons. */
:is(.button, .grade-button, .answer-tab, .nav-toggle, .speech-rate button, a.surface, a.subject-card, a.case-card) { transition: transform .16s ease, box-shadow .16s ease, background .16s ease; transform-origin: center; }
:is(.training-part-card, .training-option, .subject-card, .case-card) { transition: box-shadow .18s ease; }
@media (hover: hover) and (pointer: fine) {
  :is(.button, .grade-button, .answer-tab, .nav-toggle, .speech-rate button, a.surface, a.subject-card, a.case-card):not(:disabled):not([aria-disabled="true"]):hover { transform: perspective(700px) translateY(-2px) rotateX(2deg); box-shadow: 0 8px 18px #536b9b26, 0 2px 2px #536b9b12; }
  :is(.training-part-card, .training-option, .subject-card, .case-card):has(:is(a, button:not(:disabled)):hover) { box-shadow: 0 15px 35px #536b9b20; }
}
:is(.button, .grade-button, .answer-tab, .nav-toggle, .speech-rate button, a.surface, a.subject-card, a.case-card):not(:disabled):not([aria-disabled="true"]):active { transform: translateY(1px) scale(.99); box-shadow: inset 0 2px 4px #536b9b26; }
:is(.button, .grade-button, .answer-tab, .nav-toggle, .speech-rate button, a.surface, a.subject-card, a.case-card):focus-visible { outline: 3px solid var(--brand-dark); outline-offset: 4px; }
@media (max-width: 600px) { .skeleton-cards { grid-template-columns: 1fr; } .skeleton-cards > div { height: 9rem; } .skeleton-cards > div:nth-child(n+3) { display: none; } }
@media (prefers-reduced-motion: reduce) {
  .page-loading-strip, .skeleton-heading, .skeleton-line, .skeleton-cards > div { animation: none; }
  :is(.button, .grade-button, .answer-tab, .nav-toggle, .speech-rate button, a.surface, a.subject-card, a.case-card) { transition: none; }
  :is(.button, .grade-button, .answer-tab, .nav-toggle, .speech-rate button, a.surface, a.subject-card, a.case-card):is(:hover, :active) { transform: none; }
  :is(.training-part-card, .training-option, .subject-card, .case-card) { transition: none; }
}
/* Shared voice notes: actual microphone signal, local review, explicit send. */
[hidden] { display: none !important; }
.voice-note { background: linear-gradient(130deg, var(--paper), var(--brand-soft)); border: 1px solid var(--border); border-radius: 20px; padding: clamp(1rem, 3vw, 1.5rem); min-width: 0; }
.voice-note__heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.voice-note__heading strong { font-size: .95rem; }
.voice-note time { flex: none; background: var(--paper); border: 1px solid var(--border); border-radius: 20px; padding: .35rem .65rem; font-variant-numeric: tabular-nums; font-weight: 750; }
.voice-note__signal { background: #ffffff80; border-radius: 16px; padding: .5rem .75rem; margin: 1rem 0; }
.voice-note canvas { display: block; width: 100%; height: 64px; }
.voice-note__signal span { display: block; color: var(--muted); font-size: .78rem; min-height: 1.4em; }
.voice-note__controls { display: flex; flex-wrap: wrap; gap: .6rem; }
.voice-note .button { gap: .5rem; min-height: 44px; }
.voice-note__icon { display: block; width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.voice-note__review { margin-top: 1rem; }
.voice-note audio { display: block; width: 100%; max-width: 100%; }
.voice-note progress { display: block; width: 100%; accent-color: var(--brand); margin-top: 1rem; }
.voice-note[data-voice-state="recording"] .voice-note__heading strong::before { content: ""; display: inline-block; width: .6rem; height: .6rem; background: #b64b63; border-radius: 50%; margin-right: .5rem; }
.voice-note [data-voice-send] { margin-top: .5rem; }
.voice-note button:disabled { opacity: .55; cursor: not-allowed; }
@media (max-width: 480px) { .voice-note__heading { align-items: flex-start; } .voice-note__controls .button { padding: .65rem .8rem; font-size: .88rem; } .voice-note [data-voice-send] { width: 100%; } }

/* Part 5: a single microphone expands only while it is in use. */
.voice-note--compact { max-width: 560px; margin: 1rem auto; }
.voice-note--compact:not([data-voice-state]),
.voice-note--compact[data-voice-state="idle"],
.voice-note--compact[data-voice-state="error"] { background: none; border: 0; padding: 0; }
.voice-note--compact:not([data-voice-state]) .voice-note__heading,
.voice-note--compact:not([data-voice-state]) .voice-note__signal,
.voice-note--compact[data-voice-state="idle"] .voice-note__heading,
.voice-note--compact[data-voice-state="idle"] .voice-note__signal,
.voice-note--compact[data-voice-state="error"] .voice-note__heading,
.voice-note--compact[data-voice-state="error"] .voice-note__signal,
.voice-note--compact [data-voice-help],
.voice-note--compact [data-voice-signal],
.voice-note--compact:not([data-voice-state="review"]):not([data-voice-state="uploading"]) [data-voice-send] { display: none; }
.voice-note--compact .voice-note__controls { justify-content: center; }
.voice-note--compact [data-voice-start] { width: 76px; height: 76px; border-radius: 50%; padding: 0; }
.voice-note--compact [data-voice-start] svg { width: 30px; height: 30px; }
.answer-divider { display: flex; align-items: center; gap: 1rem; color: var(--muted); text-align: center; margin: 1.5rem 0; }
.answer-divider::before, .answer-divider::after { content: ""; height: 1px; background: var(--border); flex: 1; }

.rating-interval { display: block; font-weight: 400; font-size: .8rem; margin-top: .3rem; }
.rating-help { grid-column: 1 / -1; }
.queue-continue { max-width:1180px; margin:1rem auto; padding:0 1.25rem; }
.learning-calendar { margin:1.5rem 0; }
.calendar-toolbar { display:flex; align-items:center; justify-content:space-between; gap:.5rem; flex-wrap:wrap; }
.calendar-toolbar h2 { margin:0; font-size:1.25rem; }
.calendar-grid,.calendar-weekdays { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:.3rem; }
.calendar-weekdays { text-align:center; margin:1rem 0 .5rem; color:var(--muted); }
.calendar-day { min-width:0; border:1px solid var(--border); border-radius:10px; position:relative; background:var(--paper); }
.calendar-day summary { list-style:none; min-height:76px; padding:.4rem; display:flex; flex-direction:column; cursor:pointer; }
.calendar-day summary::-webkit-details-marker { display:none; }
.calendar-day small { display:block; font-size:.7rem; }
.calendar-day--today { outline:2px solid var(--brand); }
.calendar-day--outside { opacity:.45; }
.calendar-day--recovered { border:2px dashed #8b77b1; }
.calendar-day-detail { position:absolute; z-index:10; width:min(260px,70vw); padding:1rem; background:white; border:1px solid var(--border); box-shadow:var(--shadow); border-radius:12px; }
.calendar-day:nth-child(7n) .calendar-day-detail,.calendar-day:nth-child(7n - 1) .calendar-day-detail { right:0; }
.learning-reminder { position:fixed; bottom:1rem; right:1rem; max-width:min(360px,90vw); padding:1rem; background:var(--paper); border:1px solid var(--border); border-radius:16px; box-shadow:var(--shadow); z-index:30; }
@media(max-width:480px) { .calendar-day summary { min-height:60px; padding:.25rem; } .learning-calendar { padding:.75rem; } }

.daily-review-card { display:grid; gap:1rem; background:linear-gradient(120deg,#dfe8fb,#e9e2f6); color:var(--ink); border:1px solid var(--border); border-radius:22px; padding:clamp(1rem,3vw,2rem); max-width:1180px; margin:1.5rem auto; }
.daily-review-card form { display:flex; flex-wrap:wrap; align-items:center; gap:.65rem; }
.daily-review-card h2 { margin:.3rem 0; }
.daily-review-card select { width:auto; max-width:100%; }
.daily-review-card a { color:#354f87; }

/* Keep explanation prompts and direct microphone controls close together. */
.explanation-practice { max-width: 960px; padding-top: 1.25rem; }
.explanation-practice .practice-header h1 { font-size: 1.35rem; }
.explanation-practice .practice-header .eyebrow { margin: .5rem 0 .25rem; }
.explanation-practice .progress-track { margin: 1rem 0; }
.explanation-practice .training-task { padding: clamp(1rem, 3vw, 1.75rem); gap: .75rem; }
.explanation-practice .term-prompt { padding: 1rem; margin: 0; }
.explanation-practice .term-prompt h2 { margin: .5rem 0; }
.explanation-practice .term-prompt p { margin: .5rem 0; }
.explanation-practice .field-help { margin: 0; }
.explanation-practice .voice-note--compact { margin: .5rem auto; }
.explanation-practice .answer-divider { margin: .5rem 0; }

.explanation-practice .term-answer { width: 100%; }
.explanation-practice .term-answer textarea { width: 100%; min-height: 100px; font: inherit; padding: .85rem; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: inherit; resize: vertical; }

.explanation-practice .training-task > *,
.explanation-practice .term-feedback .form-group { min-width: 0; }
.explanation-practice .term-feedback { overflow-wrap: anywhere; }
.explanation-practice .term-feedback select { min-width: 0; max-width: 100%; }
.explanation-practice .term-feedback .button { white-space: normal; overflow-wrap: anywhere; }

.azure-trial-entry { margin-bottom: 1.5rem; }
.azure-trial-entry.stack { gap: .75rem; }
.azure-trial-entry.stack > * { margin: 0; }
.azure-word-list { display: flex; flex-wrap: wrap; gap: .75rem; list-style: none; padding: 0; }
.azure-word { display: grid; gap: .3rem; padding: .85rem 1rem; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); overflow-wrap: anywhere; max-width: 100%; }
.azure-word--practice { border-color: #9a650e; background: #fff4dc; color: #583a08; }
