*,
*::before,
*::after {
  box-sizing: border-box;
  color: var(--text-color, inherit);
}
html {
  scroll-behavior: smooth;
}
html.modal-scroll-locked {
  overflow: hidden;
}
body {
  margin: 0;
  --text-color: var(--ink);
  background: var(--paper);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
body.modal-scroll-locked {
  position: fixed;
  top: calc(0px - var(--modal-scroll-y));
  inset-inline: 0;
  width: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

button,
input,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
}
button:not(.icon-button) {
  min-height: 48px;
}
button:disabled,
input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
.choice:has(input:focus-visible) {
  outline: 3px solid var(--coral);
  outline-offset: 3px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
.topbar {
  min-height: 84px;
  padding: 18px max(22px, calc((100vw - 1180px) / 2));
  display: flex;
  align-items: center;
  gap: 12px;
  --text-color: var(--white);
  background: var(--ink);
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px 13px 13px 3px;
  --text-color: var(--ink);
  background: var(--coral);
  font-weight: 900;
  font-size: 1.4rem;
}
.brand-copy {
  min-width: 0;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: 1.12rem;
  letter-spacing: -0.02em;
}
h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 5vw, 3.7rem);
  line-height: 0.98;
  letter-spacing: -0.05em;
}
h3 {
  font-size: 1.07rem;
  line-height: 1.15;
}
.eyebrow {
  margin-bottom: 5px;
  --text-color: var(--eyebrow);
  text-transform: uppercase;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.16em;
}
.topbar .eyebrow {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
}
/* Small eyebrows stay ink-soft for contrast (coral fails AA on light); coral is reserved for display type + CTAs. */
.eyebrow.accent {
  --text-color: var(--ink-soft);
}
.connection {
  margin-left: auto;
  --text-color: var(--white);
  font-size: 0.75rem;
  font-weight: 650;
}
.account-trigger {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-left: auto;
  padding: 4px 10px 4px 4px;
  border: 1px solid rgba(183, 214, 200, 0.35);
  border-radius: 999px;
  --text-color: var(--white);
  background: transparent;
  text-align: left;
}
.account-trigger:hover {
  border-color: var(--coral);
}
.account-avatar {
  width: 37px;
  height: 37px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  --text-color: var(--ink);
  background: var(--coral);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.05rem;
  font-weight: 900;
}
.account-copy {
  display: grid;
  gap: 1px;
}
.account-copy strong {
  font-size: 0.78rem;
  line-height: 1.1;
}
.account-copy small {
  --text-color: var(--mint);
  font-size: 0.64rem;
}
.account-chevron {
  --text-color: var(--mint);
  font-size: 1.1rem;
  line-height: 1;
}
.account-trigger:not(.hidden) + .connection {
  display: none;
}
.account-trigger.hidden + .connection {
  margin-left: auto;
}
.back-link {
  margin-left: auto;
  --text-color: var(--mint);
  font-size: 0.78rem;
  font-weight: 800;
  text-decoration: none;
}
.shell {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  padding: 66px 0 40px;
}
.auth-screen {
  min-height: calc(100dvh - var(--topbar-height));
  display: grid;
  align-items: start;
  padding: clamp(52px, 8vw, 100px) max(22px, calc((100vw - 1180px) / 2)) 72px;
}
.auth-layout {
  width: min(1180px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(340px, 0.88fr);
  align-items: start;
  gap: clamp(40px, 9vw, 138px);
  margin: 0 auto;
}
.auth-intro {
  max-width: 640px;
}
.auth-intro h2 {
  max-width: 9ch;
  font-size: clamp(3.25rem, 6vw, 5.7rem);
}
.auth-lede {
  max-width: 560px;
  margin-top: 20px;
  --text-color: var(--ink-soft);
  font-size: 1.05rem;
  line-height: 1.6;
}
.auth-principles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  max-width: 540px;
  margin-top: 44px;
}
.auth-principles > div {
  display: grid;
  gap: 7px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.auth-principles strong {
  font-size: 0.86rem;
}
.auth-principles span {
  --text-color: var(--ink-soft);
  font-size: 0.75rem;
  line-height: 1.45;
}
.auth-card {
  min-width: 0;
  padding: clamp(24px, 3vw, 30px);
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--white);
  box-shadow: var(--shadow);
}
.auth-card .eyebrow {
  --text-color: var(--ink-soft);
}

.auth-card-head {
  margin-bottom: 22px;
}
.auth-card-head h2 {
  font-size: clamp(2.2rem, 5vw, 3.2rem);
}
.auth-card-head p:not(.eyebrow) {
  margin-top: 9px;
  --text-color: var(--ink-soft);
  font-size: 0.86rem;
  line-height: 1.5;
}
.auth-form {
  display: grid;
  gap: 15px;
}
.auth-field {
  display: grid;
  gap: 6px;
}
.auth-field label {
  --text-color: var(--ink);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.auth-field input,
.auth-field select {
  width: 100%;
  min-height: 50px;
  padding: 11px 13px;
  border: 1px solid var(--field-line);
  border-radius: 10px;
  --text-color: var(--ink);
  background: var(--white);
  font-size: max(16px, 1rem);
}
.auth-field input:hover,
.auth-field select:hover {
  border-color: var(--ink-soft);
}
.auth-field input:focus-visible,
.auth-field select:focus-visible {
  border-color: var(--coral);
  outline: 3px solid var(--coral-soft);
  outline-offset: 1px;
}
.auth-field-error {
  min-height: 16px;
  --text-color: var(--danger);
  font-size: 0.72rem;
}
.auth-field-error:empty,
.auth-error:empty {
  display: none;
  min-height: 0;
}

.auth-hint {
  --text-color: var(--ink-soft);
  font-size: 0.7rem;
}
.auth-error {
  min-height: 18px;
  --text-color: var(--danger);
  font-size: 0.78rem;
  line-height: 1.4;
}
.auth-submit {
  width: 100%;
  margin-top: 2px;
}
.auth-switch {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  --text-color: var(--ink-soft);
  font-size: 0.78rem;
  text-align: center;
}
.text-button {
  min-height: 44px;
  padding: 7px 2px;
  border: 0;
  --text-color: var(--ink);
  background: transparent;
  font-size: inherit;
  font-weight: 900;
  text-decoration: underline;
  text-decoration-color: var(--coral);
  text-underline-offset: 3px;
}
.text-button:hover {
  --text-color: var(--ink);
}

.auth-switch .text-button {
  --text-color: var(--ink);
  text-decoration-color: var(--ink-soft);
}
.back-button {
  margin-bottom: 15px;
  --text-color: var(--ink-soft);
  text-decoration: none;
}
.back-button:hover {
  --text-color: var(--ink);
}
.account-dialog {
  width: min(420px, calc(100% - 32px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 20px;
  --text-color: var(--ink);
  background: var(--white);
  box-shadow: 0 26px 90px rgba(23, 58, 56, 0.28);
}
.account-dialog::backdrop {
  background: rgba(23, 58, 56, 0.52);
  backdrop-filter: blur(3px);
}
.account-dialog-inner {
  padding: 28px;
}
.account-dialog-inner h2 {
  font-size: clamp(1.9rem, 5vw, 2.55rem);
}
.account-dialog-inner > p:not(.eyebrow) {
  margin-top: 9px;
  --text-color: var(--ink-soft);
  font-size: 0.84rem;
  line-height: 1.5;
}
.account-dialog-actions {
  display: grid;
  gap: 10px;
  margin-top: 26px;
}
.account-dialog-actions button {
  width: 100%;
}
.outline-button,
.secondary-button {
  padding: 11px 15px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  --text-color: var(--ink);
  background: transparent;
  font-weight: 800;
}
.secondary-button {
  display: block;
  margin-top: 14px;
}
.account-dialog-actions .secondary-button {
  margin-top: 0;
}
.welcome-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 40px;
}
.welcome-subject {
  display: grid;
  gap: 6px;
  justify-items: end;
  text-align: right;
  flex-shrink: 0;
}
.welcome-subject strong {
  font-size: 1.1rem;
  --text-color: var(--ink);
}
.welcome-subject .eyebrow {
  margin: 0;
}
.lede {
  max-width: 540px;
  margin-top: 18px;
  --text-color: var(--ink-soft);
  font-size: 1rem;
  line-height: 1.55;
}
.learner-panel {
  min-width: 190px;
  display: grid;
  gap: 5px;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 253, 248, 0.6);
}
.learner-panel span {
  --text-color: var(--ink-soft);
  font-size: 0.71rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.learner-panel strong {
  --text-color: var(--ink);
}
.learner-panel small {
  --text-color: var(--ink-soft);
  font-size: 0.72rem;
}
.grade-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}
.grade-tab {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 17px;
  --text-color: var(--ink-soft);
  background: transparent;
  font-weight: 800;
}
.grade-tab.active {
  --text-color: var(--white);
  border-color: var(--ink);
  background: var(--ink);
}
.admin-grade-switch {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: -6px 0 18px;
  padding: 12px;
  border: 1px solid var(--card-line);
  border-radius: 13px;
  background: var(--card);
}
.admin-grade-switch > span {
  margin-right: 4px;
  --text-color: var(--ink-soft);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
.profile-gate {
  margin: 18px 0;
  padding: 28px;
  border: 1px solid var(--card-line);
  border-radius: 20px;
  background: var(--card);
  box-shadow: var(--shadow);
}
.profile-gate h2 {
  max-width: 700px;
  font-size: clamp(1.7rem, 4vw, 2.6rem);
}
.profile-gate > p:not(.eyebrow) {
  max-width: 650px;
  margin-top: 12px;
  --text-color: var(--ink-soft);
  line-height: 1.5;
}
.profile-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}
.profile-choices .secondary-button.selected {
  --text-color: var(--white);
  background: var(--ink);
}
.profile-pair-form {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}
.profile-pair-form label {
  display: grid;
  gap: 6px;
  --text-color: var(--ink-soft);
  font-size: 0.7rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.profile-pair-form input {
  min-width: 160px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  --text-color: var(--ink);
  background: var(--white);
  font-size: max(16px, 1rem);
}
.primary-button {
  min-height: 48px;
  margin-top: 20px;
  padding: 12px 18px;
  border: 0;
  border-radius: 999px;
  --text-color: var(--ink);
  background: var(--coral);
  font-weight: 900;
}
.profile-pair-form .primary-button {
  margin: 0;
}

.auth-form .auth-submit {
  margin-top: 0;
}
.today-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 18px;
  padding: clamp(25px, 4vw, 42px);
  border: 1px solid var(--card-line);
  border-radius: 24px;
  background: var(--card);
  box-shadow: var(--shadow);
}
.today-card h2 {
  max-width: 680px;
  font-size: clamp(2rem, 4.5vw, 3.4rem);
}
.today-card p:not(.eyebrow) {
  max-width: 620px;
  margin-top: 11px;
  --text-color: var(--ink-soft);
  line-height: 1.5;
}
.today-card .primary-button {
  flex: 0 0 auto;
  margin: 0;
}
.today-card p.today-promise {
  --text-color: var(--ink);
  font-size: 0.82rem;
  font-weight: 800;
}
.score-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}
.overview-card-button {
  cursor: pointer;
  text-align: left;
  transition:
    transform 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}
.overview-card-button:hover {
  border-color: var(--coral);
  box-shadow: 0 20px 50px rgba(23, 58, 56, 0.18);
  transform: translateY(-2px);
}
.overview-card-button:focus-visible {
  outline: 3px solid var(--coral);
  outline-offset: 4px;
}
.overview-effort {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 0.8rem;
}
.overview-effort strong {
  font-size: 1.15rem;
}
.overview-card-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  margin-top: 14px;
  --text-color: var(--white);
  font-size: 0.8rem;
  font-weight: 900;
}
.overview-card-action span:last-child {
  --text-color: var(--coral-soft);
  font-size: 1.1rem;
  transition: transform 0.15s ease;
}
.overview-card-button:hover .overview-card-action span:last-child {
  transform: translateX(3px);
}
.projection-topic-section {
  margin: 14px 0 2px;
  --text-color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.score-card {
  min-width: 0;
  padding: clamp(22px, 3vw, 30px);
  border: 1px solid var(--line);
  border-radius: 21px;
  background: var(--white);
  box-shadow: var(--shadow);
}
.primary-card {
  --text-color: var(--white);
  border-color: var(--ink);
  background: var(--ink);
}
.section-card {
  background: var(--card);
  border-color: var(--card-line);
}
.card-label {
  margin-bottom: 17px;
  font-size: 0.69rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.75;
}
.big-score {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 4.1rem;
  line-height: 0.85;
  letter-spacing: -0.07em;
  overflow-wrap: anywhere;
}
.big-score small {
  font-family: Inter, sans-serif;
  font-size: 0.95rem;
  letter-spacing: 0;
  opacity: 0.6;
}
.big-score > small {
  margin-left: 0.16em;
}
.score-card > p:not(.microcopy) {
  margin-top: 13px;
  --text-color: inherit;
  opacity: 0.7;
  font-size: 0.8rem;
}
.microcopy {
  margin-top: 15px;
  --text-color: var(--sage);
  font-size: 0.73rem;
  line-height: 1.4;
}
.score-track,
.mini-track,
.topic-progress {
  height: 6px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(23, 58, 56, 0.12);
}
.score-track {
  margin-top: 19px;
  background: rgba(255, 255, 255, 0.16);
}
.score-track span,
.mini-track span,
.topic-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--coral);
  transition: width 0.35s ease;
}
.section-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 17px 0 8px;
  font-size: 0.82rem;
}
.section-row strong {
  font-size: 0.78rem;
}
.mini-track {
  height: 7px;
  background: rgba(23, 58, 56, 0.1);
}
.section-card .mini-track span {
  background: var(--ink);
}
.balance-details,
.study-details {
  margin-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}
.study-details {
  border-color: rgba(23, 58, 56, 0.14);
}
.balance-details summary,
.study-details summary {
  min-height: 48px;
  display: flex;
  align-items: center;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 850;
}
.balance-details summary {
  --text-color: var(--white);
}
.study-details summary {
  --text-color: var(--ink);
}
.balance-details .mini-track span {
  background: var(--coral-soft);
}
.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  margin: 72px 0 24px;
}
.section-heading h2 {
  font-size: clamp(1.8rem, 4vw, 2.7rem);
}
.term-filter-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: -8px 0 24px;
}
.term-filter-row label {
  --text-color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 850;
}
.term-filter-row select {
  min-height: 44px;
  padding: 8px 34px 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  font-weight: 750;
}
.term-filter-row p {
  margin: 0;
  --text-color: var(--ink-soft);
  font-size: 0.75rem;
}
.outline-button:hover,
.secondary-button:hover {
  --text-color: var(--white);
  background: var(--ink);
}
.topic-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.topic-card {
  min-height: 210px;
  display: flex;
  flex-direction: column;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  --text-color: var(--ink);
  background: rgba(255, 253, 248, 0.75);
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.15s ease;
}
.topic-card:hover {
  border-color: var(--ink);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}
.topic-card-button {
  cursor: pointer;
}
.topic-card-button:focus-visible {
  outline: 3px solid var(--coral);
  outline-offset: 4px;
}
.topic-card.research-card {
  background: var(--cream);
  border-color: var(--cream-edge);
}
.recommended-topic {
  grid-column: span 2;
  border-color: var(--ink);
  background: var(--white);
  box-shadow: var(--shadow);
}
.topic-topline,
.topic-meta-tags {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
}
.topic-topline {
  margin-bottom: 22px;
}
.section-tag,
.source-tag,
.recommended-tag {
  padding: 5px 8px;
  border-radius: 5px;
  font-size: 0.62rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.section-tag {
  --text-color: var(--ink);
  background: var(--mint);
}
.source-tag {
  --text-color: var(--cream-ink);
  background: var(--cream-wash);
}
.recommended-tag {
  --text-color: var(--white);
  background: var(--ink);
}
.topic-card h3 {
  max-width: 240px;
}
.topic-card p {
  margin-top: 8px;
  --text-color: var(--ink-soft);
  font-size: 0.76rem;
}
.topic-card .topic-recommendation {
  max-width: 520px;
  --text-color: var(--ink);
  font-weight: 750;
  line-height: 1.45;
}
.topic-card .topic-summary {
  max-width: 42ch;
  margin-top: 14px;
  --text-color: var(--ink);
  font-size: 0.86rem;
  line-height: 1.45;
}
.topic-card .topic-subtopics {
  margin-top: 10px;
  --text-color: var(--ink-soft);
  line-height: 1.45;
}
.topic-card .topic-subtopics strong {
  --text-color: var(--ink);
}
.topic-progress {
  margin-top: 17px;
}
.topic-progress span {
  background: var(--ink);
}
.topic-read-hint {
  display: flex;
  justify-content: space-between;
  align-items: end;
  min-height: 48px;
  margin-top: auto;
  padding-top: 15px;
  --text-color: var(--ink);
  font-size: 0.8rem;
  font-weight: 850;
}
.topic-read-hint span {
  --text-color: var(--coral);
  font-size: 1.1rem;
}
.topic-reader {
  position: relative;
  overflow: hidden;
  margin-top: 64px;
  padding: clamp(24px, 5vw, 52px);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--white);
  box-shadow: var(--shadow);
}
.topic-reader::before {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--coral);
  content: "";
}
.topic-reader-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 38px;
}
.topic-reader-back {
  min-height: 44px;
  padding: 9px 0;
  border: 0;
  --text-color: var(--ink);
  background: transparent;
  font-size: 0.82rem;
  font-weight: 850;
}
.topic-reader-back::before {
  content: "←";
  margin-right: 7px;
  --text-color: var(--coral);
  font-size: 1.1rem;
}
.topic-reader > .eyebrow {
  margin-bottom: 7px;
}
.topic-reader > h2 {
  max-width: 780px;
  font-size: clamp(2.15rem, 5vw, 4rem);
}
.topic-reader-summary {
  max-width: 680px;
  margin-top: 16px;
  --text-color: var(--ink-soft);
  font-size: 1.04rem;
  line-height: 1.6;
}
.topic-reader-content {
  display: grid;
  gap: 18px;
  max-width: 1080px;
  margin-top: 44px;
  view-transition-name: topic-reader-content;
}
.topic-reader-block {
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.topic-reader-block h3 {
  margin-bottom: 14px;
  font-size: 1.15rem;
}
.topic-reader-content
  > .topic-reader-block:not(.topic-reader-subtopics):not(.topic-reader-example):not(
    .topic-reader-figures
  ) {
  display: grid;
  grid-template-columns: minmax(150px, 0.3fr) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}
.topic-reader-content
  > .topic-reader-block:not(.topic-reader-subtopics):not(.topic-reader-example):not(
    .topic-reader-figures
  )
  h3 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.45rem;
  line-height: 1.08;
}
.topic-reader-list {
  display: grid;
  gap: 11px;
  margin: 0;
  padding-left: 20px;
  --text-color: var(--ink-soft);
  line-height: 1.55;
}
.topic-reader-steps {
  counter-reset: topic-step;
  list-style: none;
  padding-left: 0;
}
.topic-reader-steps li {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 10px;
  align-items: start;
}
.topic-reader-steps li::before {
  counter-increment: topic-step;
  content: counter(topic-step);
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  --text-color: var(--white);
  background: var(--ink);
  font-size: 0.76rem;
  font-weight: 900;
}
.topic-reader-concepts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.topic-reader-concepts li {
  display: grid;
  gap: 7px;
  padding: 16px;
  border-radius: 14px;
  background: var(--card);
}
.topic-reader-concepts strong {
  font-size: 0.9rem;
}
.topic-reader-concepts span {
  --text-color: var(--ink-soft);
  font-size: 0.84rem;
  line-height: 1.45;
}
.topic-reader-subtopic-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
  margin: 0;
  padding: 0;
  list-style: none;
}
.topic-reader-subtopic-list li {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  overflow: hidden;
  transition:
    border-color var(--motion-fast) var(--ease-emphasized),
    background-color var(--motion-fast) var(--ease-emphasized);
}
.topic-reader-subtopic-list li.is-expanded {
  border-color: var(--card-line);
  background: var(--white);
}
.topic-reader-subtopic-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.subtopic-reader-button {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
  min-height: 78px;
  margin: 8px 0 8px 10px;
  padding: 12px 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  --text-color: var(--ink);
  background: var(--white);
  text-align: left;
}
.subtopic-reader-button:hover,
.subtopic-reader-button:focus-visible {
  --text-color: var(--ink);
  background: var(--mist);
}
.subtopic-reader-button[aria-expanded="true"] {
  border-color: var(--card-line);
  background: var(--mist);
}
.subtopic-reader-copy {
  display: grid;
  min-width: 0;
  gap: 5px;
}
.subtopic-reader-copy strong {
  overflow: hidden;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.18rem;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.subtopic-reader-copy small {
  width: max-content;
  padding: 3px 7px;
  border-radius: 999px;
  --text-color: var(--ink-soft);
  background: var(--mist);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.subtopic-reader-chevron {
  flex: 0 0 auto;
  width: 11px;
  height: 11px;
  border-right: 2px solid var(--coral);
  border-bottom: 2px solid var(--coral);
  transform: rotate(45deg) translateY(-3px);
  transition: transform var(--motion-fast) var(--ease-emphasized);
}
.subtopic-reader-button[aria-expanded="true"] .subtopic-reader-chevron {
  transform: rotate(225deg) translate(-2px, -2px);
}
.subtopic-coach-button {
  flex: 0 0 auto;
  margin: 0 14px 0 0;
  padding: 7px 10px;
  border: 1px solid var(--ink-soft);
  border-radius: 999px;
  --text-color: var(--ink);
  background: var(--white);
  font: inherit;
  font-size: 0.74rem;
  font-weight: 800;
  cursor: pointer;
}
.subtopic-coach-button:hover,
.subtopic-coach-button:focus-visible {
  border-color: var(--coral-deep);
  color: var(--ink);
  background: var(--cream-warm);
}
.topic-reader-subtopic-list span {
  --text-color: var(--ink-soft);
  font-size: 0.84rem;
  line-height: 1.45;
}
.topic-reader-subtopic-meta {
  margin: -2px 18px 16px;
  --text-color: var(--ink-soft);
  font-size: 0.8rem;
  line-height: 1.45;
}
.subtopic-reader-content {
  display: none;
  gap: 18px;
  padding: 0 18px 22px;
  border-top: 2px solid var(--card-line);
  --text-color: var(--ink-soft);
  line-height: 1.55;
}
.subtopic-reader-content.expanded {
  display: grid;
}
.topic-reader-study-notes {
  display: grid;
  gap: 16px;
  max-width: 72ch;
  padding-top: 20px;
  --text-color: var(--ink-soft);
  font-size: 0.96rem;
  line-height: 1.6;
}
.topic-reader-study-notes-label {
  width: max-content;
  padding-bottom: 5px;
  border-bottom: 2px solid var(--coral);
  --text-color: var(--ink);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.topic-reader-study-notes h4 {
  margin: 5px 0 -4px;
  padding-top: 15px;
  border-top: 1px solid var(--cream-line);
  --text-color: var(--ink);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.topic-reader-study-notes h4:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}
.topic-reader-study-notes p {
  max-width: 68ch;
}
.topic-reader-study-notes strong {
  --text-color: var(--ink);
  font-weight: 800;
}
.topic-reader-study-notes ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.topic-reader-study-notes ul li {
  position: relative;
  padding-left: 20px;
  line-height: 1.55;
}
.topic-reader-study-notes ul li::before {
  position: absolute;
  top: 0.7em;
  left: 3px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--coral);
  content: "";
}
@media (prefers-reduced-motion: reduce) {
  .topic-reader-subtopic-list li,
  .subtopic-reader-chevron {
    transition: none;
  }
}
.topic-reader-detail,
.topic-reader-vocabulary {
  max-width: 72ch;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.topic-reader-detail-label {
  display: block;
  margin-bottom: 7px;
  --text-color: var(--ink);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.topic-reader-detail p {
  line-height: 1.55;
}
.topic-reader-vocabulary dl {
  display: grid;
  gap: 10px;
  margin: 0;
}
.topic-reader-vocabulary dl > div {
  display: grid;
  grid-template-columns: minmax(90px, 0.35fr) minmax(0, 1fr);
  gap: 12px;
}
.topic-reader-vocabulary dt {
  --text-color: var(--ink);
  font-weight: 800;
}
.topic-reader-vocabulary dd {
  margin: 0;
}
.subtopic-reader-content > .topic-reader-block {
  margin-top: 0;
  padding-top: 18px;
}
.subtopic-reader-content > .topic-reader-block h3 {
  font-size: 0.85rem;
}
.topic-reader-example {
  padding: 18px;
  border: 1px solid var(--cream-line);
  border-top-width: 1px;
  border-radius: 14px;
  background: var(--cream-light);
}
.topic-reader-example h3 {
  --text-color: var(--ink);
}
.topic-reader-example p,
.topic-reader-note p {
  --text-color: var(--ink-soft);
  line-height: 1.55;
}
.topic-reader-note {
  padding: 18px;
  border-left: 4px solid var(--coral);
  border-radius: 4px 14px 14px 4px;
  background: var(--cream-deep);
}
.topic-reader-note strong {
  display: block;
  margin-bottom: 6px;
  --text-color: var(--ink);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.topic-reader-figures h3 {
  margin-bottom: 18px;
}
.topic-reader-figure-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.topic-reader-figure {
  min-width: 0;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--panel);
}
.topic-reader-figure-svg {
  display: grid;
  place-items: center;
  min-height: 150px;
  overflow: auto;
}
.topic-reader-figure-svg svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: 280px;
}
.topic-reader-figure figcaption {
  display: grid;
  gap: 4px;
  margin-top: 12px;
  --text-color: var(--ink-soft);
  font-size: 0.78rem;
  line-height: 1.4;
}
.topic-reader-figure figcaption strong {
  --text-color: var(--ink);
}
.figure-open {
  justify-self: start;
  min-height: 44px;
  padding: 9px 13px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  --text-color: var(--ink);
  background: transparent;
  font-size: 0.78rem;
  font-weight: 850;
}
.topic-reader-figure .figure-open {
  margin-top: 13px;
}
.practice-panel {
  margin-top: 60px;
  padding: clamp(22px, 5vw, 48px);
  border-radius: 26px;
  --text-color: var(--white);
  background: var(--ink);
  box-shadow: var(--shadow);
}
.practice-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
}
.practice-head h2 {
  max-width: 620px;
  font-size: clamp(2rem, 6vw, 3.6rem);
}
.practice-head-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.coach-panel {
  view-transition-name: coach-panel;
  margin: 18px 0;
  padding: 16px;
  border-radius: 16px;
  --text-color: var(--ink);
  background: var(--surface-mist);
}
.practice-panel .eyebrow {
  --text-color: var(--ink-soft);
}
.practice-panel.coach-led .coach-panel {
  margin-bottom: 0;
}
footer {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  margin-top: 70px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  --text-color: var(--muted);
  font-size: 0.72rem;
}
footer a {
  --text-color: inherit;
  font-weight: 800;
}
body.coach-active .welcome-row,
body.coach-active .grade-tabs,
body.coach-active .admin-grade-switch,
body.coach-active .exam-card,
body.coach-active .today-card,
body.coach-active .score-grid,
body.coach-active .section-heading,
body.coach-active .term-filter-row,
body.coach-active .topic-grid,
/* On the subject picker the exam schedule sits above the coach. Leaving it rendered
   scrolled the 100dvh coach panel past the locked viewport, so the composer was
   unreachable and the app looked wedged. */
body.coach-active #subject-screen,
body.coach-active footer {
  display: none;
}
body.topic-reader-active .welcome-row,
body.topic-reader-active .grade-tabs,
body.topic-reader-active .profile-gate,
body.topic-reader-active .exam-card,
body.topic-reader-active .today-card,
body.topic-reader-active .score-grid,
body.topic-reader-active .section-heading,
body.topic-reader-active .term-filter-row,
body.topic-reader-active .topic-grid,
body.topic-reader-active footer {
  display: none;
}
body.topic-reader-active .topic-reader {
  margin-top: 0;
  display: block;
}
body.topic-reader-active .shell {
  padding-top: 36px;
}
body.coach-active {
  height: 100dvh;
  min-height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--paper);
}
body.coach-active .topbar {
  display: none;
}
body.coach-active .shell {
  width: 100%;
  height: 100dvh;
  min-height: 100dvh;
  min-width: 0;
  margin: 0;
  padding: 0;
}
body.coach-active .practice-panel {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  margin: 0;
  padding: 0;
  overflow: hidden;
  border-radius: 0;
  box-shadow: none;
}
body.coach-active .practice-head {
  display: none;
}
body.coach-active .practice-panel.coach-led .coach-panel {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border-radius: 0;
  background: var(--paper);
}
.coach-status {
  grid-row: 3;
  margin: 0;
  padding: 9px 14px;
  --text-color: var(--ink);
  background: var(--amber-soft);
  font-size: 0.78rem;
  font-weight: 800;
}
.coach-read-actions {
  display: none;
}
.coach-busy .coach-read-actions {
  pointer-events: none;
  opacity: 0.65;
}
.icon-button {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  --text-color: var(--white);
  background: transparent;
  font-size: 1.6rem;
  line-height: 1;
}
.question-figure-block {
  display: grid;
  gap: 10px;
  margin: 0 0 22px;
}
.question-figure {
  margin: 0;
  padding: clamp(12px, 3vw, 20px);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}
.figure-svg {
  display: grid;
  place-items: center;
  overflow: auto;
}
.figure-svg svg {
  display: block;
  max-width: 100%;
  height: auto;
}
.figure-alt {
  margin-top: 12px;
  --text-color: var(--ink-soft);
  font-size: 0.82rem;
  line-height: 1.45;
}
.figure-open:hover {
  --text-color: var(--white);
  background: var(--ink);
}
.choice-list {
  display: grid;
  gap: 10px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.choice {
  min-height: 50px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  cursor: pointer;
  --text-color: var(--ink-soft);
  font-size: 1rem;
  line-height: 1.4;
}
.choice:has(input:checked) {
  border-color: var(--ink);
  --text-color: var(--ink);
  background: var(--mint-wash);
}
.choice input {
  accent-color: var(--coral);
}
.choice-letter {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  --text-color: var(--white);
  background: var(--ink);
  font-size: 0.72rem;
  font-weight: 900;
}
textarea {
  width: 100%;
  resize: vertical;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  --text-color: var(--ink);
  background: var(--surface-warm);
  line-height: 1.5;
}
textarea:focus {
  border-color: var(--coral);
  box-shadow: 0 0 0 3px var(--coral-soft);
}
.primary-button:disabled {
  opacity: 0.55;
  cursor: wait;
}
.empty-state {
  grid-column: 1 / -1;
  padding: 30px;
  border: 1px dashed var(--line);
  border-radius: 18px;
  --text-color: var(--ink-soft);
}
.admin-shell {
  width: min(1040px, calc(100% - 36px));
  margin: 0 auto;
  padding: 66px 0 70px;
}
.admin-intro {
  margin-bottom: 38px;
}
.admin-intro h2 {
  max-width: 700px;
}
.admin-main-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.admin-main-tab {
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  --text-color: var(--ink-soft);
  background: var(--white);
  font-weight: 850;
}
.admin-main-tab.active {
  --text-color: var(--white);
  border-color: var(--ink);
  background: var(--ink);
}
.admin-main-nav .secondary-button {
  margin: 0 0 0 auto;
}
.parent-dashboard {
  margin-bottom: 34px;
}
.parent-dashboard-head,
.parent-profile-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
}
.parent-dashboard-head h3 {
  font:
    2rem Georgia,
    "Times New Roman",
    serif;
}
.parent-dashboard-head > p {
  --text-color: var(--ink-soft);
  font-size: 0.76rem;
}
.parent-profile-tabs {
  display: flex;
  gap: 9px;
  margin: 24px 0 14px;
}
.parent-profile-tab {
  min-height: 46px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  --text-color: var(--ink-soft);
  background: var(--white);
  font-weight: 850;
  text-align: left;
}
.parent-profile-tab span {
  display: block;
  margin-top: 3px;
  font-size: 0.68rem;
  font-weight: 700;
}
.parent-profile-tab.active {
  --text-color: var(--white);
  border-color: var(--ink);
  background: var(--ink);
}
.parent-profile-card {
  padding: clamp(20px, 4vw, 34px);
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--white);
  box-shadow: var(--shadow);
}
.parent-profile-head > div:first-child > span,
.parent-projection > span,
.parent-metric-grid span,
.parent-section-grid span {
  display: block;
  --text-color: var(--ink-soft);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.parent-profile-head h2 {
  margin-top: 7px;
  font-size: clamp(2.2rem, 5vw, 3.6rem);
}
.parent-profile-head p {
  margin-top: 8px;
  --text-color: var(--ink-soft);
  font-size: 0.8rem;
}
.parent-projection {
  min-width: 190px;
  padding: 17px;
  border-radius: 16px;
  --text-color: var(--white);
  background: var(--ink);
}
.parent-projection span {
  --text-color: var(--mint);
}
.parent-projection strong {
  display: block;
  margin-top: 10px;
  font:
    3rem / 0.85 Georgia,
    "Times New Roman",
    serif;
}
.parent-projection small {
  font:
    0.8rem Inter,
    sans-serif;
  opacity: 0.7;
}
.parent-projection .parent-projection-range {
  margin-top: 10px;
  --text-color: var(--mint);
  font-size: 0.72rem;
  font-weight: 700;
}
.admin-option-reasons {
  margin: 6px 0 0;
  padding-left: 18px;
  font-size: 0.8rem;
  line-height: 1.5;
}
.coach-head {
  grid-row: 1;
  min-width: 0;
  min-height: 58px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  padding: max(7px, env(safe-area-inset-top)) 12px 7px;
  --text-color: var(--white);
  background: var(--ink);
}
.coach-head-copy {
  flex: 1 1 150px;
  min-width: 0;
}
.coach-pause-button,
.coach-context-toggle {
  min-width: 48px;
  min-height: 48px;
  padding: 7px 9px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 10px;
  --text-color: var(--white);
  background: transparent;
  font-size: 12px;
  font-weight: 850;
}
.coach-block-progress {
  margin: 0;
  padding: 7px 9px;
  border-radius: 999px;
  --text-color: var(--ink);
  background: var(--coral-soft);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}
.coach-head .coach-pause-button,
.coach-head .coach-block-progress,
.coach-head .coach-context-toggle {
  flex: none;
}
.coach-quick-actions {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(12px + env(safe-area-inset-bottom));
  z-index: 60;
  display: none;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding-inline: max(12px, env(safe-area-inset-left)) max(12px, env(safe-area-inset-right));
  pointer-events: none;
}
body.coach-active .coach-quick-actions {
  display: flex;
}
body.coach-active:has(.coach-form:not(.hidden)) .coach-quick-actions {
  bottom: calc(
    var(--coach-keyboard-inset, 0px) + var(--coach-form-offset, 76px) + 8px
  );
}
body.coach-active:has(.coach-panel.writing-studio-active):has(.coach-form:not(.hidden))
  .coach-quick-actions {
  bottom: calc(
    var(--coach-keyboard-inset, 0px) + var(--coach-form-offset, 76px) + 20px
  );
}
.coach-quick-actions > * {
  pointer-events: auto;
}
.coach-quick-actions .coach-pause-button {
  min-height: 48px;
  padding: 10px 18px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--white);
  --text-color: var(--ink);
  box-shadow: 0 10px 22px rgb(23 58 56 / 20%);
  font-size: 13px;
  font-weight: 850;
}
.coach-send-button {
  display: none;
  min-height: 48px;
  margin: 0;
  padding: 10px 18px;
  border: 0;
  border-radius: 999px;
  background: var(--coral);
  --text-color: var(--ink);
  box-shadow: 0 10px 22px rgb(23 58 56 / 20%);
  font-size: 13px;
  font-weight: 850;
  white-space: nowrap;
}
body.coach-active:has(.coach-form:not(.hidden)) .coach-send-button {
  display: inline-flex;
  align-items: center;
}
.coach-head-copy .eyebrow {
  margin-bottom: 1px;
  font-size: 10px;
  letter-spacing: 0.12em;
}
.coach-head h3 {
  margin: 0;
  overflow: hidden;
  --text-color: var(--white);
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.coach-focus-reason,
.coach-current-note {
  --text-color: var(--ink-soft);
  font-size: 0.82rem;
  line-height: 1.45;
}
.coach-current-note {
  padding-top: 9px;
  border-top: 1px solid rgba(23, 58, 56, 0.14);
  --text-color: var(--ink);
}
.coach-transcript {
  grid-row: 4;
  min-width: 0;
  min-height: 0;
  display: block;
  margin: 0;
  padding: 16px max(14px, calc((100vw - 820px) / 2)) calc(84px + env(safe-area-inset-bottom));
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-padding-bottom: calc(84px + env(safe-area-inset-bottom));
  background: var(--paper);
}
.coach-chat-stream {
  display: grid;
  align-content: start;
  gap: 10px;
}
.coach-bubble {
  max-width: 90%;
  padding: 12px 14px;
  border-radius: 13px;
  font-size: 1rem;
  line-height: 1.5;
  white-space: pre-wrap;
}
.coach-bubble.assistant {
  justify-self: start;
  --text-color: var(--ink);
  background: var(--white-solid);
  box-shadow: 0 1px 2px rgba(23, 58, 56, 0.1);
}
.coach-bubble.user {
  justify-self: end;
  --text-color: var(--white);
  background: var(--ink);
}
.coach-bubble:focus-visible {
  outline: 3px solid var(--coral);
  outline-offset: 3px;
}
.coach-form {
  grid-row: 5;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 10px max(12px, calc((100vw - 820px) / 2)) calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--white);
}
.coach-form-row {
  display: flex;
  gap: 9px;
  align-items: flex-end;
  min-width: 0;
}
.coach-form-row .coach-send-button {
  flex: none;
}
.coach-form > label:not(.sr-only) {
  margin-bottom: 2px;
  font-size: 0.76rem;
  font-weight: 800;
  --text-color: var(--ink-soft);
}
.coach-send-button:disabled {
  background: var(--surface-mist);
  --text-color: var(--ink-soft);
  box-shadow: none;
  opacity: 1;
  cursor: not-allowed;
}
/* While drafting, the field owns the width and the action sits underneath it. */
.coach-form.writing.surface .coach-form-row,
.coach-panel.writing-studio-active .coach-form .coach-form-row,
.coach-panel.writing-coaching-active .coach-form .coach-form-row {
  flex-direction: column;
  align-items: stretch;
}
.coach-form.writing.surface .coach-form-row .coach-send-button,
.coach-panel.writing-studio-active .coach-form .coach-send-button,
.coach-panel.writing-coaching-active .coach-form .coach-send-button {
  width: 100%;
  justify-content: center;
}
.coach-form input,
.coach-form textarea {
  flex: 1;
  min-width: 0;
  min-height: 48px;
  max-height: 140px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: max(16px, 0.92rem);
  --text-color: var(--ink);
  background: var(--white-solid);
  font-family: inherit;
  resize: none;
  overflow-y: auto;
}
.coach-chat-stream > *,
.coach-task-handoff,
.coach-question-prompt {
  scroll-margin-top: 132px;
}
#coach-launch {
  margin-left: 10px;
}
.coach-history-panel {
  grid-row: 2;
  max-height: 40dvh;
  overflow: auto;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--white-solid);
  display: grid;
  gap: 6px;
}
.coach-history-head {
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  --text-color: var(--ink-soft);
}
.coach-history-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  --text-color: var(--ink);
  background: var(--panel);
  text-align: left;
  font:
    0.8rem Inter,
    sans-serif;
}
.coach-history-item small {
  --text-color: var(--ink-soft);
}
.coach-tool-card {
  min-width: 0;
  max-width: 100%;
  margin: 4px 0;
  padding: 16px;
  border: 1px solid var(--success-line);
  border-radius: 13px;
  --text-color: var(--ink);
  background: var(--white-solid);
}
.coach-tool-card p,
.coach-options label,
.coach-option {
  overflow-wrap: anywhere;
  --text-color: var(--ink);
}
.coach-tool-head {
  margin-bottom: 6px;
  --text-color: var(--ink-soft);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.coach-tool-card.coach-question {
  border-left: 4px solid var(--coral);
}
.coach-tool-card.coach-rule {
  border-left: 4px solid var(--ink);
}
.coach-tool-card.coach-retry {
  border-left: 4px solid var(--amber-deep);
}
.coach-tool-card.coach-feedback {
  border-left: 4px solid var(--success);
  background: var(--success-soft);
}
.coach-tool-card.coach-block {
  border-left: 4px solid var(--coral);
}
.coach-task-workspace {
  width: 100%;
  min-width: 0;
  min-height: 0;
  margin-top: 10px;
  overflow: visible;
  background: transparent;
}
#coach-task {
  height: auto;
  min-height: 0;
}
.coach-question-prompt {
  margin: 2px 0 12px;
  --text-color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.2rem, 5.4vw, 1.55rem);
  font-weight: 700;
  line-height: 1.3;
}
.coach-question-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
}
.coach-open-passage {
  min-height: 48px;
  padding: 9px 13px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  --text-color: var(--ink);
  background: var(--card);
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
}
.coach-task-handoff {
  margin: 0 0 16px;
  padding: 13px 14px;
  border-left: 3px solid var(--coral);
  border-radius: 3px 9px 9px 3px;
  --text-color: var(--ink);
  background: var(--mist);
}
.coach-handoff-label {
  display: block;
  --text-color: var(--ink-soft);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.coach-task-handoff p {
  margin-top: 8px;
  --text-color: var(--ink);
  font-size: 0.95rem;
  line-height: 1.5;
}
.coach-mark-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 10px;
  border-radius: 999px;
  --text-color: var(--ink);
  background: var(--coral-soft);
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}
.coach-mark-event {
  justify-self: center;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  --text-color: var(--ink-soft);
  font-size: 0.76rem;
  font-weight: 800;
}
.coach-answer-pane {
  min-width: 0;
  display: block;
}
.coach-answer-pane .coach-answer-error {
  margin: 8px 0 0;
  --text-color: var(--danger);
  font-size: 0.82rem;
  font-weight: 850;
}
.coach-read-actions .primary-button {
  width: 100%;
  min-height: 52px;
  margin: 0;
  font-size: clamp(16px, 1rem, 20px);
}
.coach-tool-card .coach-help {
  min-height: 44px;
  margin: 12px 0 0;
  font-size: 0.85rem;
}
.coach-options {
  display: grid;
  gap: 7px;
  margin: 9px 0;
}
.coach-options label {
  min-height: 50px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  --text-color: var(--ink);
  font-size: 1rem;
  font-weight: 650;
  line-height: 1.4;
  cursor: pointer;
}
.coach-answer-pane .coach-options label {
  scroll-margin-block: 62px 76px;
}
.coach-options input {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  accent-color: var(--coral);
}
.coach-options label:has(input:focus-visible) {
  outline: 3px solid var(--coral);
  outline-offset: 2px;
}
.coach-options label:has(input:checked) {
  background: var(--surface-mist);
  border-color: var(--ink);
}
.coach-tool-card .feedback {
  margin-top: 10px;
}
.coach-feedback-surface,
.coach-block-surface {
  height: auto;
  min-height: 0;
  overflow: visible;
  padding: 22px 0 calc(24px + env(safe-area-inset-bottom));
  background: var(--white);
}
.coach-guided-help {
  padding: 18px 0 24px;
  --text-color: var(--ink);
  background: var(--white);
}
.coach-guided-help h4 {
  margin: 8px 0 12px;
  font-size: 1.08rem;
  line-height: 1.35;
}
.coach-guided-help p:not(.eyebrow) {
  --text-color: var(--ink-soft);
  line-height: 1.5;
}
.coach-guided-help button {
  width: 100%;
  min-height: 48px;
  margin-top: 14px;
}
.coach-guided-notice {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-left: 3px solid var(--coral);
  --text-color: var(--ink-soft);
  background: var(--surface-neutral);
  line-height: 1.45;
}
.coach-feedback-surface .feedback {
  margin-top: 14px;
}
.coach-preparing p:not(.eyebrow),
.coach-generation-error p:not(.eyebrow) {
  max-width: 620px;
  --text-color: var(--ink-soft);
  line-height: 1.55;
}
.coach-generation-error .primary-button {
  width: min(100%, 420px);
  margin-top: 14px;
}
.coach-working-indicator {
  width: 42px;
  height: 4px;
  display: block;
  margin-top: 18px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--sage-deep);
}
.coach-working-indicator::after {
  width: 45%;
  height: 100%;
  display: block;
  border-radius: inherit;
  background: var(--coral);
  content: "";
  animation: coach-working 1.2s ease-in-out infinite alternate;
}
@keyframes coach-working {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(125%);
  }
}
@media (prefers-reduced-motion: reduce) {
  .coach-working-indicator::after {
    animation: none;
    transform: translateX(60%);
  }
}
.coach-question-reference {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
}
.coach-question-reference summary {
  min-height: 48px;
  display: flex;
  align-items: center;
  padding: 10px 12px;
  --text-color: var(--ink);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 850;
}
.coach-question-reference p {
  padding: 0 12px 12px;
  --text-color: var(--ink-soft);
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.45;
}
.coach-completed-task {
  max-width: 90%;
  margin: 2px 0;
  padding: 10px 12px;
  border-left: 3px solid var(--sage-line);
  border-radius: 3px 9px 9px 3px;
  --text-color: var(--ink-soft);
  background: var(--mist);
  font-size: 0.84rem;
  line-height: 1.45;
}
.coach-completed-task p {
  margin: 5px 0 0;
  overflow-wrap: anywhere;
}
.coach-completed-task-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  --text-color: var(--ink-soft);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.coach-completed-task details {
  margin-top: 7px;
}
.coach-completed-task summary {
  cursor: pointer;
  font-weight: 800;
}
.coach-completed-task details p {
  --text-color: var(--ink);
}
.coach-checkpoint-event,
.coach-retry-event {
  max-width: 100%;
  margin: 4px 0;
  padding: 16px;
  border: 1px solid var(--success-line);
  border-left: 4px solid var(--coral);
  border-radius: 13px;
  --text-color: var(--ink);
  background: var(--white-solid);
}
.coach-checkpoint-event {
  text-align: center;
}
.coach-checkpoint-next {
  margin: 6px 0 10px;
  font-size: 0.86rem;
}
.coach-checkpoint-event strong {
  display: block;
  --text-color: var(--coral);
  font:
    2.7rem / 0.95 Georgia,
    "Times New Roman",
    serif;
}
.coach-checkpoint-event > p:not(.eyebrow),
.coach-retry-event p {
  --text-color: var(--ink-soft);
  line-height: 1.5;
}
.coach-checkpoint-event .primary-button,
.coach-retry-event .secondary-button {
  width: 100%;
  margin: 10px 0 0;
}
.coach-retry-event {
  border-left-color: var(--amber-deep);
  background: var(--cream-warm);
}
.coach-block-surface {
  display: grid;
  place-content: center;
  justify-items: center;
  text-align: center;
}
.coach-block-surface > strong {
  --text-color: var(--coral);
  font:
    4rem / 0.9 Georgia,
    "Times New Roman",
    serif;
}
.coach-block-surface h4 {
  margin: 14px 0 0;
  font:
    1.7rem Georgia,
    "Times New Roman",
    serif;
}
.coach-block-surface > p:not(.eyebrow) {
  max-width: 620px;
  margin-top: 12px;
  --text-color: var(--ink-soft);
  line-height: 1.55;
}
.coach-block-surface .primary-button {
  width: min(100%, 420px);
}
.coach-passage-drawer {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  --text-color: var(--ink);
  background: var(--white);
}
.coach-passage-drawer[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}
.coach-passage-drawer::backdrop {
  background: rgba(10, 28, 26, 0.64);
}
.coach-passage-drawer-head {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: max(10px, env(safe-area-inset-top)) 14px 10px;
  --text-color: var(--white);
  background: var(--ink);
}
.coach-passage-drawer-head h3 {
  --text-color: var(--white);
}
.coach-passage-close {
  min-width: 54px;
  min-height: 48px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 10px;
  --text-color: var(--white);
  background: transparent;
  font-size: 13px;
  font-weight: 900;
}
.coach-passage-drawer-body {
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 22px max(18px, calc((100vw - 720px) / 2));
  --text-color: var(--ink-soft);
  background: var(--cream-warm);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.08rem;
  line-height: 1.75;
  white-space: pre-line;
}
.coach-passage-drawer-actions {
  padding: 10px max(12px, calc((100vw - 720px) / 2)) calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--white);
}
.coach-passage-drawer-actions .primary-button {
  width: 100%;
  margin: 0;
}
.figure-drawer {
  width: min(960px, 100vw);
  max-width: none;
  height: min(860px, 100dvh);
  max-height: none;
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 0;
  --text-color: var(--ink);
  background: var(--white);
}
.figure-drawer[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}
.figure-drawer::backdrop {
  background: rgba(10, 28, 26, 0.64);
}
.figure-drawer-head {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: max(10px, env(safe-area-inset-top)) 14px 10px;
  --text-color: var(--white);
  background: var(--ink);
}
.figure-drawer-head h3 {
  --text-color: var(--white);
}
.figure-drawer-close {
  min-width: 54px;
  min-height: 48px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 10px;
  --text-color: var(--white);
  background: transparent;
  font-size: 13px;
  font-weight: 900;
}
.figure-drawer-body {
  min-width: 0;
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: auto;
  padding: clamp(18px, 4vw, 42px);
  background: var(--panel);
}
.figure-drawer-body svg {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 65dvh;
}
.figure-drawer-alt {
  margin: 0;
  padding: 12px max(18px, calc((100vw - 720px) / 2)) calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  --text-color: var(--ink-soft);
  background: var(--white);
  font-size: 0.84rem;
  line-height: 1.45;
}
.effort-detail-groups {
  padding: 0 28px 18px;
}
.effort-detail-group {
  padding: 20px 0;
  border-top: 1px solid var(--line);
}
.effort-detail-group:first-child {
  border-top: 0;
}
.effort-detail-group h4 {
  --text-color: var(--ink-soft);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.effort-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 13px;
}
.effort-detail-grid span {
  min-width: 0;
  padding: 12px;
  border-radius: 11px;
  --text-color: var(--ink-soft);
  background: var(--paper);
  font-size: 0.72rem;
  line-height: 1.3;
}
.effort-detail-grid strong {
  display: block;
  --text-color: var(--ink);
  font:
    1.45rem / 1 Georgia,
    "Times New Roman",
    serif;
  overflow-wrap: anywhere;
}
.effort-detail-grid small {
  display: block;
  margin-top: 6px;
}
.projection-dialog {
  width: min(720px, calc(100% - 28px));
  max-height: min(820px, calc(100dvh - 28px));
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 21px;
  --text-color: var(--ink);
  background: var(--white);
  box-shadow: 0 26px 90px rgba(23, 58, 56, 0.28);
}
.projection-dialog::backdrop {
  background: rgba(10, 28, 26, 0.64);
  backdrop-filter: blur(3px);
}
.projection-dialog-inner {
  max-height: min(820px, calc(100dvh - 28px));
  overflow: auto;
}
.projection-dialog-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
  padding: 26px 28px 22px;
  --text-color: var(--white);
  background: var(--ink);
}
.projection-dialog-head h3 {
  --text-color: var(--white);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.8rem, 5vw, 2.5rem);
  letter-spacing: -0.04em;
}
.projection-dialog-head p:not(.eyebrow) {
  margin-top: 8px;
  --text-color: rgba(255, 255, 255, 0.72);
  font-size: 0.82rem;
  line-height: 1.45;
}
.projection-dialog-close {
  flex: 0 0 auto;
  min-width: 58px;
  min-height: 48px;
  padding: 8px 11px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 10px;
  --text-color: var(--white);
  background: transparent;
  font-size: 0.76rem;
  font-weight: 900;
}
.projection-dialog-close:hover {
  border-color: var(--white);
  background: rgba(255, 255, 255, 0.1);
}
.projection-detail-body {
  padding: 0 28px 18px;
}
.projection-overview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(170px, 0.42fr);
  gap: 18px;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}
.projection-overview-score .card-label {
  display: block;
  --text-color: var(--ink-soft);
}
.projection-overview-score > strong {
  display: block;
  --text-color: var(--ink);
  font:
    3.45rem / 0.9 Georgia,
    "Times New Roman",
    serif;
  letter-spacing: -0.05em;
}
.projection-overview-score > strong small {
  margin-left: 0.16em;
  --text-color: var(--ink-soft);
  font:
    0.88rem / 1 Inter,
    ui-sans-serif,
    system-ui,
    sans-serif;
  letter-spacing: 0;
}
.projection-overview-score > p {
  margin-top: 12px;
  --text-color: var(--ink-soft);
  font-size: 0.8rem;
  line-height: 1.4;
}
.projection-overview-evidence {
  align-self: end;
  display: grid;
  gap: 7px;
  padding: 15px;
  border-radius: 12px;
  --text-color: var(--ink-soft);
  background: var(--card);
  font-size: 0.74rem;
  line-height: 1.35;
}
.projection-overview-evidence strong {
  --text-color: var(--ink);
  font:
    1.7rem / 1 Georgia,
    "Times New Roman",
    serif;
}
.projection-detail-group {
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}
.projection-detail-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}
.projection-detail-heading h4,
.projection-detail-group > h4 {
  --text-color: var(--ink);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.projection-detail-heading > span {
  --text-color: var(--ink-soft);
  font-size: 0.72rem;
}
.projection-section-row {
  padding: 16px 0 0;
}
.projection-section-head,
.projection-section-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.projection-section-head {
  --text-color: var(--ink);
  font-size: 0.88rem;
  font-weight: 850;
}
.projection-section-head strong {
  flex: 0 0 auto;
  font-size: 0.8rem;
}
.projection-section-meta {
  margin-top: 5px;
  --text-color: var(--ink-soft);
  font-size: 0.7rem;
}
.projection-section-row .mini-track {
  margin-top: 9px;
}
.projection-explanation p,
.projection-coach-copy > p {
  max-width: 620px;
  margin-top: 10px;
  --text-color: var(--ink-soft);
  font-size: 0.82rem;
  line-height: 1.55;
}
.projection-coach {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 0;
}
.projection-coach-copy {
  min-width: 0;
  max-width: 620px;
}
.projection-coach-copy .projection-coach-context {
  margin-top: 12px;
  padding: 13px 14px;
  border-radius: 11px;
  --text-color: var(--ink);
  background: var(--card);
}
.projection-coach-action {
  flex: 0 0 auto;
  min-width: 190px;
  margin-top: 18px;
}
.parent-focus-card {
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid var(--success-line);
  border-radius: 14px;
  background: var(--success-soft);
}
.parent-focus-card > span {
  display: block;
  margin-bottom: 5px;
  --text-color: var(--ink-soft);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.09em;
}
.parent-focus-card p {
  margin: 0 0 5px;
  --text-color: var(--ink-soft);
  font-size: 0.85rem;
  line-height: 1.5;
}
.parent-focus-card small {
  --text-color: var(--ink);
  font-weight: 800;
}
.coach-log-card {
  margin-top: 18px;
}
.coach-log-card details {
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white-solid);
}
.coach-log-card summary {
  cursor: pointer;
  font-size: 0.82rem;
  --text-color: var(--ink);
}
.coach-log-card .coach-log-line {
  margin: 6px 0;
  --text-color: var(--ink-soft);
  font-size: 0.8rem;
  line-height: 1.45;
}
.coach-metrics-card {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--success-soft);
}
.coach-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 10px;
}
.coach-metrics-grid article {
  padding: 11px 12px;
  border-radius: 11px;
  background: var(--white-solid);
}
.coach-metrics-grid span,
.coach-metrics-grid small {
  display: block;
  --text-color: var(--ink-soft);
  font-size: 0.7rem;
  line-height: 1.35;
}
.coach-metrics-grid strong {
  display: block;
  margin: 3px 0;
  --text-color: var(--ink);
  font-size: 1.25rem;
}
.parent-activity-card {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface-green);
}
.parent-narrative {
  margin: 0 0 12px;
  --text-color: var(--ink-soft);
  font-size: 0.85rem;
  line-height: 1.55;
}
.parent-activity-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.parent-activity-chips span {
  padding: 8px 11px;
  border-radius: 10px;
  --text-color: var(--ink-soft);
  background: var(--white-solid);
  font-size: 0.76rem;
  line-height: 1.35;
}
.parent-activity-chips strong {
  display: block;
  margin-bottom: 2px;
  --text-color: var(--ink);
  font-size: 0.66rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.parent-week {
  margin-top: 14px;
}
.parent-week > strong {
  --text-color: var(--ink);
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.parent-week-bars {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 64px;
  margin-top: 8px;
}
.parent-week-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
  width: 100%;
  height: 100%;
}
.parent-week-day i {
  display: block;
  width: 100%;
  max-width: 26px;
  border-radius: 5px 5px 0 0;
  background: var(--coral);
  opacity: 0.9;
}
.parent-week-day small {
  --text-color: var(--ink-soft);
  font-size: 0.64rem;
  font-weight: 800;
}
.parent-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 24px;
}
.parent-metric-grid article,
.parent-section-grid article {
  padding: 15px;
  border-radius: 13px;
  background: var(--paper);
}
.parent-metric-grid strong,
.parent-section-grid strong {
  display: block;
  margin-top: 7px;
  --text-color: var(--ink);
  font:
    1.65rem Georgia,
    "Times New Roman",
    serif;
}
.parent-metric-grid small,
.parent-section-grid small,
.parent-section-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 10px;
}
.parent-section-grid article {
  background: var(--card);
}
.parent-progress {
  height: 7px;
  overflow: hidden;
  margin-top: 11px;
  border-radius: 99px;
  background: rgba(23, 58, 56, 0.12);
}
.parent-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--coral);
}
.admin-login {
  max-width: 520px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 21px;
  background: var(--white);
  box-shadow: var(--shadow);
}
.admin-test-card {
  margin-bottom: 26px;
  padding: 24px;
  border: 1px solid var(--cream-line);
  border-radius: 18px;
  background: var(--cream-deep);
}
.admin-test-card h3 {
  font-size: 1.35rem;
}
.admin-test-card > p {
  max-width: 680px;
  margin-top: 9px;
  --text-color: var(--ink-soft);
  font-size: 0.8rem;
  line-height: 1.45;
}
.admin-test-card form {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}
.admin-test-card label {
  display: grid;
  gap: 6px;
  --text-color: var(--ink-soft);
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.admin-test-card select,
.admin-test-card input {
  min-width: 145px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  --text-color: var(--ink);
  background: var(--white);
  font: inherit;
  text-transform: none;
  letter-spacing: normal;
}
.admin-test-card .secondary-button {
  margin: 0;
}
.admin-test-card .admin-test-message {
  min-height: 18px;
  --text-color: var(--danger);
}
.admin-card-label {
  margin-bottom: 16px;
  --text-color: var(--coral);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.admin-login h3 {
  font-size: 1.35rem;
}
.admin-login p {
  margin-top: 10px;
  --text-color: var(--ink-soft);
  font-size: 0.84rem;
  line-height: 1.45;
}
.admin-login form {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}
.admin-login input {
  min-width: 0;
  flex: 1;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  outline: none;
  --text-color: var(--ink);
  background: var(--surface-warm);
}
.admin-login input:focus {
  border-color: var(--coral);
  box-shadow: 0 0 0 3px var(--coral-soft);
}
.admin-login .primary-button {
  margin-top: 0;
}
#login-message.admin-error,
#llm-message.admin-error {
  --text-color: var(--danger-deep);
}
.admin-llm-card {
  margin-bottom: 28px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--ink);
  --text-color: var(--white);
  box-shadow: var(--shadow);
}
.admin-llm-card .admin-card-label {
  --text-color: var(--amber);
}
.admin-llm-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
}
.admin-llm-head h3 {
  font-size: 1.5rem;
}
.admin-llm-head p {
  max-width: 620px;
  margin-top: 8px;
  --text-color: rgba(255, 255, 255, 0.72);
  font-size: 0.83rem;
  line-height: 1.45;
}
.connection-badge {
  flex: 0 0 auto;
  padding: 8px 11px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  --text-color: rgba(255, 255, 255, 0.72);
  font-size: 0.68rem;
  font-weight: 850;
}
.connection-badge.connected {
  border-color: var(--success-line-strong);
  --text-color: var(--mint-bright);
}
.admin-llm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}
.admin-llm-card .primary-button {
  margin-top: 0;
  --text-color: var(--ink);
  background: var(--amber);
}
.admin-llm-card .secondary-button {
  margin-top: 0;
  --text-color: var(--white);
  border-color: rgba(255, 255, 255, 0.45);
}
.admin-llm-message {
  min-height: 20px;
  margin-top: 14px;
  --text-color: var(--amber);
  font-size: 0.78rem;
  line-height: 1.45;
}
.oauth-link {
  display: inline-block;
  margin-top: 4px;
  --text-color: var(--mint-bright);
  font-size: 0.8rem;
  font-weight: 800;
}
.model-field {
  display: grid;
  gap: 7px;
  max-width: 320px;
  margin-top: 17px;
  --text-color: rgba(255, 255, 255, 0.72);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.model-field select {
  padding: 11px 12px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 10px;
  --text-color: var(--white);
  background: rgba(255, 255, 255, 0.1);
  font: inherit;
  text-transform: none;
  letter-spacing: normal;
}
.admin-model-meta {
  margin-top: 9px;
  --text-color: rgba(255, 255, 255, 0.52);
  font-size: 0.68rem;
}
.admin-privacy {
  margin-top: 17px;
  --text-color: rgba(255, 255, 255, 0.56);
  font-size: 0.7rem;
  line-height: 1.45;
}
.admin-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}
.admin-toolbar h3 {
  font-size: 1.8rem;
}
.admin-grade-tabs {
  display: flex;
  gap: 8px;
}
.admin-grade-tabs .grade-tab {
  margin: 0;
}
.admin-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}
.admin-summary span {
  padding: 11px 13px;
  border-radius: 11px;
  --text-color: var(--ink-soft);
  background: var(--paper-deep);
  font-size: 0.75rem;
}
.admin-summary strong {
  margin-right: 4px;
  --text-color: var(--ink);
  font-size: 1rem;
}
.admin-topic-list {
  display: grid;
  gap: 14px;
}
.admin-topic {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--white);
}
.admin-topic-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 18px;
}
.admin-topic-head h3 {
  margin-top: 11px;
}
.source-reference {
  margin: 10px 0 17px;
  --text-color: var(--ink-soft);
  font-size: 0.75rem;
  line-height: 1.4;
}
.content-audit-card {
  margin: 24px 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-peach);
}
.content-audit-card h3 {
  margin-top: 5px;
}
.content-audit-card > p {
  margin-top: 8px;
  --text-color: var(--ink-soft);
  font-size: 0.8rem;
}
.content-audit-finding {
  margin-top: 10px;
  border: 1px solid var(--cream-line);
  border-radius: 9px;
  background: rgba(255, 253, 248, 0.7);
}
.content-audit-finding summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px;
  cursor: pointer;
  font-size: 0.78rem;
}
.content-audit-finding summary span {
  --text-color: var(--ink-soft);
  font-size: 0.68rem;
}
.content-audit-finding p {
  padding: 0 10px 10px;
  --text-color: var(--ink-soft);
  font-size: 0.75rem;
  line-height: 1.4;
}
.admin-questions {
  display: grid;
  gap: 8px;
}
.admin-question {
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-warm);
}
.admin-question summary {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  padding: 13px;
  cursor: pointer;
  --text-color: var(--ink);
  font-size: 0.83rem;
  font-weight: 750;
}
.admin-question summary small {
  flex: 0 0 auto;
  --text-color: var(--ink-soft);
  font-size: 0.68rem;
  font-weight: 600;
}
.admin-answer {
  padding: 0 13px 14px;
  border-top: 1px solid var(--line);
  --text-color: var(--ink-soft);
  font-size: 0.78rem;
  line-height: 1.5;
}
.admin-answer p {
  margin-top: 11px;
}
.admin-answer strong {
  --text-color: var(--ink);
}
@media (max-width: 850px) {
  .shell {
    padding-top: 42px;
  }
  .auth-screen {
    min-height: calc(100dvh - var(--topbar-height));
    padding-top: 48px;
  }
  .auth-layout {
    grid-template-columns: 1fr;
    gap: 38px;
  }
  .auth-intro h2 {
    max-width: 12ch;
    font-size: clamp(3rem, 12vw, 5.4rem);
  }
  .auth-principles {
    margin-top: 30px;
  }
  .welcome-row {
    align-items: start;
    flex-direction: column;
  }
  .welcome-subject {
    justify-items: start;
    text-align: left;
  }
  .learner-panel {
    width: 100%;
  }
  .score-grid {
    grid-template-columns: 1fr;
  }
  .primary-card {
    grid-column: 1 / -1;
  }
  .today-card {
    align-items: start;
    flex-direction: column;
  }
  .profile-pair-form {
    align-items: stretch;
    flex-direction: column;
  }
  .admin-grade-switch .grade-tab {
    flex: 1;
  }
  .topic-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .parent-metric-grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 560px) {
  :root {
    --topbar-height: 68px;
  }
  .topbar {
    min-height: 68px;
    padding: 13px 18px;
  }
  .brand-mark {
    width: 38px;
    height: 38px;
  }
  .topbar .connection {
    display: none;
  }
  .account-trigger {
    margin-left: auto;
  }
  .account-trigger .account-copy,
  .account-trigger .account-chevron {
    display: none;
  }
  .auth-screen {
    padding: 34px 18px 50px;
  }
  .auth-layout {
    gap: 30px;
  }
  .auth-card {
    padding: 22px 18px;
    border-radius: 18px;
  }
  .auth-principles {
    grid-template-columns: 1fr;
  }
  .shell {
    width: min(100% - 24px, 1180px);
    padding-top: 28px;
  }
  .welcome-row {
    gap: 18px;
    margin-bottom: 24px;
  }
  .lede {
    margin-top: 12px;
    font-size: 0.95rem;
  }
  .grade-tabs {
    overflow-x: auto;
    margin-bottom: 14px;
    padding-bottom: 4px;
    scrollbar-width: thin;
  }
  .grade-tab {
    flex: 0 0 auto;
    min-height: 48px;
    white-space: nowrap;
  }
  .score-grid,
  .topic-grid {
    grid-template-columns: 1fr;
  }
  .primary-card {
    grid-column: auto;
  }
  .score-card {
    min-height: 0;
    padding: 18px;
  }
  .big-score {
    font-size: 3.4rem;
  }
  .effort-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .section-heading {
    align-items: start;
    flex-direction: column;
    margin-top: 52px;
  }
  .term-filter-row {
    align-items: stretch;
    flex-direction: column;
    gap: 7px;
  }
  .term-filter-row select {
    width: 100%;
  }
  .outline-button {
    width: 100%;
  }
  .coach-head-copy {
    flex: 1 1 100%;
    order: 5;
  }
  .coach-head h3 {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.25;
  }
  .today-card {
    padding: 22px;
  }
  .today-card .primary-button {
    width: 100%;
  }
  .topic-card {
    min-height: 0;
    padding: 18px;
  }
  .recommended-topic {
    grid-column: auto;
  }
  .topic-topline {
    margin-bottom: 15px;
  }
  .topic-read-hint {
    min-height: 48px;
    padding-top: 12px;
    font-size: 0.92rem;
  }
  .topic-reader {
    margin-top: 42px;
    padding: 20px;
    border-radius: 18px;
  }
  .topic-reader-head {
    align-items: start;
    flex-direction: column-reverse;
    gap: 8px;
    margin-bottom: 28px;
  }
  .topic-reader > h2 {
    font-size: 2.35rem;
  }
  .topic-reader-summary {
    font-size: 0.98rem;
  }
  .topic-reader-content {
    margin-top: 32px;
  }
  .topic-reader-content
    > .topic-reader-block:not(.topic-reader-subtopics):not(.topic-reader-example):not(
      .topic-reader-figures
    ) {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .topic-reader-content
    > .topic-reader-block:not(.topic-reader-subtopics):not(.topic-reader-example):not(
      .topic-reader-figures
    )
    h3 {
    font-size: 1.2rem;
  }
  .topic-reader-concepts,
  .topic-reader-subtopic-list,
  .topic-reader-figure-grid {
    grid-template-columns: 1fr;
  }
  .subtopic-reader-button {
    flex-basis: 220px;
  }
  .subtopic-coach-button {
    margin-bottom: 14px;
  }
  .topic-reader-figure-svg svg {
    max-height: 250px;
  }
  .practice-panel {
    margin-top: 28px;
    padding: 16px;
    border-radius: 18px;
  }
  .practice-head h2 {
    font-size: 2.1rem;
  }
  .question-card {
    padding: 20px;
  }
  .question-prompt {
    margin-bottom: 20px;
    font-size: 1.55rem;
    line-height: 1.28;
  }
  .question-passage {
    padding: 14px;
    font-size: 1rem;
  }
  .choice {
    min-height: 54px;
    padding: 14px;
    font-size: 1rem;
  }
  body.coach-active .shell {
    width: 100%;
    height: 100dvh;
    padding: 0;
  }
  body.coach-active .practice-panel {
    height: 100%;
    margin: 0;
    padding: 0;
  }
  body.coach-active .coach-head {
    padding: max(6px, env(safe-area-inset-top)) 8px 6px;
  }
  .coach-bubble {
    max-width: 94%;
    font-size: 1rem;
  }
  .coach-options label {
    min-height: 54px;
    font-size: 1rem;
  }
  .profile-choices .secondary-button,
  .profile-pair-form input,
  .profile-pair-form .primary-button {
    width: 100%;
  }
  .admin-shell {
    padding-top: 42px;
  }
  .admin-toolbar {
    align-items: start;
    flex-direction: column;
  }
  .admin-grade-tabs {
    width: 100%;
  }
  .admin-grade-tabs .grade-tab {
    flex: 1;
  }
  .admin-login form {
    align-items: stretch;
    flex-direction: column;
  }
  .admin-test-card form {
    align-items: stretch;
    flex-direction: column;
  }
  .admin-test-card select,
  .admin-test-card input,
  .admin-test-card .secondary-button {
    width: 100%;
  }
  .admin-login .primary-button {
    width: 100%;
  }
  .admin-main-nav {
    align-items: stretch;
    flex-wrap: wrap;
  }
  .admin-main-nav .secondary-button {
    flex: 1 0 100%;
    margin-left: 0;
  }
  .parent-dashboard-head,
  .parent-profile-head {
    align-items: start;
    flex-direction: column;
  }
  .parent-profile-tabs {
    overflow: auto;
    padding-bottom: 3px;
  }
  .parent-profile-tab {
    flex: 1 0 145px;
  }
  .parent-projection {
    width: 100%;
  }
  .parent-metric-grid,
  .parent-section-grid,
  .admin-llm-head {
    flex-direction: column;
  }
  .connection-badge {
    align-self: start;
  }
  .admin-topic-head {
    flex-direction: column;
  }
  .admin-question summary {
    flex-direction: column;
    gap: 7px;
  }
  .effort-detail-groups {
    padding-inline: 18px;
  }
  .projection-dialog-head {
    padding: 22px 18px 19px;
  }
  .projection-detail-body {
    padding-inline: 18px;
  }
  .projection-overview {
    grid-template-columns: 1fr;
  }
  .projection-detail-heading {
    align-items: start;
    flex-direction: column;
    gap: 6px;
  }
  .projection-section-head {
    align-items: start;
    flex-direction: column;
    gap: 4px;
  }
  .projection-coach {
    align-items: stretch;
    flex-direction: column;
    gap: 0;
  }
  .projection-coach-action {
    width: 100%;
  }
  footer {
    flex-direction: column;
  }
}

@media (max-width: 560px) and (max-height: 720px) {
  .auth-screen {
    padding-top: 24px;
    padding-bottom: 32px;
  }
  .auth-layout {
    gap: 22px;
  }
  .auth-lede {
    margin-top: 14px;
    line-height: 1.5;
  }
  .auth-principles {
    margin-top: 22px;
  }
  .auth-card-head {
    margin-bottom: 16px;
  }
  .auth-form {
    gap: 12px;
  }
}

@media (max-width: 374px) {
  .coach-head {
    gap: 6px;
  }
  .coach-pause-button,
  .coach-context-toggle {
    min-width: 44px;
    padding-inline: 6px;
  }
  .coach-block-progress {
    padding-inline: 7px;
  }
}

@media (max-height: 620px) {
  .coach-head {
    min-height: 52px;
  }
  .coach-head-copy .eyebrow {
    display: none;
  }
  .coach-pause-button,
  .coach-context-toggle {
    min-height: 44px;
  }
  .coach-question-prompt {
    margin-bottom: 9px;
    font-size: 1.12rem;
  }
}

@media (max-width: 560px) and (max-height: 620px) {
  .coach-head-copy {
    flex: 1 1 120px;
    order: initial;
  }
  .coach-head h3 {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  /* Every transition in this file, listed explicitly so reduced-motion
     users get none of them. Equal specificity to the base rules, placed
     last, so these win the ties. Add new transitions here when adding them. */
  .overview-card-button,
  .overview-card-action span:last-child,
  .score-track span,
  .mini-track span,
  .topic-progress span,
  .topic-card {
    transition: none;
  }
}

/* --- Parent dashboard: coach, topics, effort --- */
.parent-coach-card {
  margin-top: 18px;
  padding: 16px 18px;
  border: 1px solid var(--success-line);
  border-radius: 15px;
  background: var(--success-soft);
}
.parent-coach-card > span,
.parent-topics-card > span,
.parent-effort-card > span {
  display: block;
  --text-color: var(--ink-soft);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.parent-coach-card > strong {
  display: block;
  margin-top: 6px;
  --text-color: var(--ink);
  font:
    1.45rem Georgia,
    "Times New Roman",
    serif;
}
.parent-coach-card p {
  margin-top: 8px;
  --text-color: var(--ink-soft);
  font-size: 0.85rem;
  line-height: 1.5;
}
.parent-coach-card small {
  display: block;
  margin-top: 8px;
  --text-color: var(--ink-soft);
  font-size: 0.72rem;
  line-height: 1.45;
}
.parent-topics-card,
.parent-detail-grid > div {
  margin-top: 18px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface-green);
}
.parent-topics-card h4,
.parent-effort-card h4 {
  margin: 4px 0 10px;
  font-size: 1rem;
}
.parent-topics-scroll {
  overflow-x: auto;
}
.parent-topics {
  width: 100%;
  min-width: 360px;
  border-collapse: collapse;
  font-size: 0.78rem;
}
.parent-topics th {
  padding: 7px 9px;
  --text-color: var(--ink-soft);
  background: var(--card);
  text-align: left;
  font-size: 0.66rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.parent-topics td {
  padding: 8px 9px;
  border-top: 1px solid var(--line);
  --text-color: var(--ink-soft);
}
.parent-topics tr.topic-row.good td:last-child {
  --text-color: var(--success);
  font-weight: 800;
}
.parent-topics tr.topic-row.weak td:last-child {
  --text-color: var(--danger);
  font-weight: 800;
}
.parent-topics tr.topic-row.todo td:last-child {
  --text-color: var(--ink-soft);
  font-weight: 600;
}
.parent-topics .section-tag {
  margin-right: 6px;
}
.parent-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.parent-detail-grid > div {
  margin-top: 18px;
}
.parent-test-row,
.parent-test-row {
  margin-top: 8px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 12px;
  align-items: baseline;
}
.parent-test-row strong {
  --text-color: var(--ink);
  font:
    1.2rem Georgia,
    "Times New Roman",
    serif;
}
.parent-test-row p,
.parent-test-row small {
  --text-color: var(--ink-soft);
  font-size: 0.74rem;
  line-height: 1.4;
}
.parent-test-row small {
  grid-column: 2;
}
.parent-effort-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.parent-effort-chips span {
  padding: 8px 11px;
  border-radius: 10px;
  --text-color: var(--ink-soft);
  background: var(--white-solid);
  font-size: 0.76rem;
}
.parent-effort-chips strong {
  display: block;
  margin-bottom: 2px;
  --text-color: var(--ink);
  font-size: 0.66rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
@media (max-width: 760px) {
  .parent-detail-grid {
    grid-template-columns: 1fr;
  }
  .coach-metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* --- Coach log groups --- */
.coach-log-group {
  margin-top: 14px;
}
.coach-log-group > h4 {
  margin: 0 0 2px;
  padding: 7px 10px;
  border-radius: 9px 9px 0 0;
  --text-color: var(--ink);
  background: var(--paper-deep);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}
.coach-log-group details {
  margin-top: 0;
  border-radius: 0 0 12px 12px;
}
.parent-overview {
  margin: 18px 0 4px;
}
.parent-overview-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.parent-overview-card {
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--white);
}
.parent-overview-card span {
  display: block;
  --text-color: var(--ink-soft);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.parent-overview-card strong {
  display: block;
  margin-top: 6px;
  --text-color: var(--ink);
  font:
    1.9rem Georgia,
    "Times New Roman",
    serif;
}
.parent-overview-card small {
  display: block;
  margin-top: 5px;
  --text-color: var(--ink-soft);
  font-size: 0.7rem;
  line-height: 1.35;
}
.parent-tab-count {
  display: inline-block;
  min-width: 22px;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--coral-soft);
  --text-color: var(--ink);
  font-size: 0.68rem;
  font-weight: 900;
  text-align: center;
}
.parent-profile-tab.active .parent-tab-count {
  background: rgba(255, 255, 255, 0.22);
  --text-color: var(--white);
}
.parent-profile-tab:focus-visible,
.subject-tab:focus-visible,
.admin-main-tab:focus-visible {
  outline: 2px solid var(--coral);
  outline-offset: 2px;
}
.parent-skeleton {
  display: grid;
  gap: 10px;
}
.parent-skeleton span {
  display: block;
  height: 46px;
  border-radius: 12px;
  background: linear-gradient(90deg, var(--paper) 25%, var(--card) 50%, var(--paper) 75%);
  background-size: 200% 100%;
  animation: parent-shimmer 1.2s infinite;
}
@keyframes parent-shimmer {
  to {
    background-position: -200% 0;
  }
}
.parent-topics-summary {
  margin: 8px 0 0;
  --text-color: var(--ink-soft);
  font-size: 0.74rem;
  font-weight: 700;
}
.topic-bar {
  display: inline-block;
  width: 52px;
  height: 6px;
  overflow: hidden;
  margin-right: 6px;
  border-radius: 99px;
  background: rgba(23, 58, 56, 0.12);
  vertical-align: middle;
}
.topic-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--coral);
}
.topic-row.good .topic-bar i {
  background: var(--success);
}
.topic-row.ok .topic-bar i {
  background: var(--amber);
}
.topic-row.todo .topic-bar i {
  background: transparent;
}
.parent-week-bars {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}
.parent-week-day.tone-good i {
  background: var(--success);
}
.parent-week-day.tone-ok i {
  background: var(--amber);
}
.parent-week-day.tone-weak i {
  background: var(--coral);
}
.parent-week-day.tone-idle i {
  background: rgba(23, 58, 56, 0.14);
}
@media (max-width: 640px) {
  .parent-overview-grid {
    grid-template-columns: 1fr;
  }
}

/* --- Feedback review tool --- */
.feedback-review-card {
  margin: 24px 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-green-light);
}
.feedback-review-card h3 {
  margin-top: 5px;
}
.feedback-review-card > p {
  margin-top: 8px;
  --text-color: var(--ink-soft);
  font-size: 0.8rem;
}
.feedback-review-list {
  display: grid;
  gap: 9px;
  margin-top: 14px;
}
.feedback-review-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
}
.feedback-review-item summary {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  cursor: pointer;
}
.feedback-review-item summary span {
  --text-color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 800;
}
.feedback-review-item summary strong {
  --text-color: var(--ink);
  font-size: 0.86rem;
}
.feedback-review-item summary small {
  --text-color: var(--ink-soft);
  font-size: 0.7rem;
}
.feedback-review-body {
  display: grid;
  gap: 7px;
  padding: 0 14px 13px;
}
.feedback-review-body p {
  --text-color: var(--ink-soft);
  font-size: 0.8rem;
  line-height: 1.5;
}
.feedback-review-body strong {
  --text-color: var(--ink);
}
.feedback-review-feedback {
  padding: 9px 11px;
  border-left: 3px solid var(--coral);
  border-radius: 3px 9px 9px 3px;
  background: var(--cream-deep);
}
@media (max-width: 640px) {
  .feedback-review-item summary {
    grid-template-columns: 1fr auto;
  }
  .feedback-review-item summary small {
    grid-column: 1 / -1;
  }
}

.numeric-answer-label {
  display: block;
  margin-bottom: 6px;
  --text-color: var(--ink-soft);
  font-size: 0.8rem;
  font-weight: 800;
}
.numeric-answer {
  width: 100%;
  max-width: 280px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 1rem;
}
.fb-steps ol {
  margin: 6px 0 0 18px;
  display: grid;
  gap: 4px;
}
.subject-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.subject-card {
  border: 2px solid var(--line);
  border-radius: 14px;
  background: var(--white);
  padding: 14px 16px;
  cursor: pointer;
  display: grid;
  gap: 6px;
}
.subject-card.active {
  border-color: var(--ink);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}
.subject-card h3 {
  margin: 0;
  font-size: 1.05rem;
  --text-color: var(--ink);
}
.subject-test-date {
  margin: 0;
  --text-color: var(--ink-soft);
  font-size: 0.82rem;
  font-weight: 700;
}
.flashcards-button {
  justify-self: start;
  margin-top: 4px;
}
.topic-coach-button {
  justify-self: start;
}
.topic-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.topic-coach-end-dialog {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: clamp(22px, 4vw, 32px);
  max-width: min(520px, 92vw);
  width: 100%;
}
.topic-coach-end-dialog::backdrop {
  background: rgba(23, 58, 56, 0.45);
}
.topic-coach-end-dialog h3 {
  margin: 6px 0 8px;
  font-size: 1.4rem;
}
.topic-coach-end-dialog p {
  --text-color: var(--ink-soft);
  line-height: 1.5;
}
.topic-coach-end-actions {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}
.topic-coach-switch-meta {
  margin: 0;
  font-size: 0.86rem;
}
.topic-coach-end-actions .text-button {
  justify-self: center;
}
.flashcards-dialog {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: clamp(20px, 4vw, 32px);
  width: min(620px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  background: var(--paper);
  --text-color: var(--ink);
}
.flashcards-dialog::backdrop {
  background: rgba(23, 58, 56, 0.58);
}
.flashcards-dialog-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: start;
  gap: 16px;
  margin-bottom: 6px;
}
.flashcards-dialog-head h3 {
  margin: 6px 0 0;
  font-size: 1.3rem;
}
.flashcards-close {
  padding: 9px 16px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: transparent;
  --text-color: var(--ink);
  font-weight: 800;
  cursor: pointer;
}
.flashcards-counter {
  margin: 0 0 12px;
  --text-color: var(--ink-soft);
  font-size: 0.85rem;
  font-weight: 800;
}
.flashcard {
  display: grid;
  gap: 10px;
  width: 100%;
  min-height: 220px;
  padding: clamp(20px, 4vw, 30px);
  border: 2px solid var(--ink);
  border-radius: 16px;
  background: var(--white);
  cursor: pointer;
  text-align: left;
  font: inherit;
  --text-color: inherit;
  box-shadow: 0 12px 24px rgb(23 58 56 / 8%);
}
.flashcard.flipped {
  background: var(--surface-green-pale);
}
.flashcard-cue {
  --text-color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.flashcard-face-label {
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.flashcard-face {
  font-size: 1.15rem;
  line-height: 1.5;
}
.flashcard-front {
  font-weight: 800;
}
.flashcard-back {
  font-weight: 700;
}
.flashcard-example {
  padding: 10px 12px;
  border: 1px solid var(--cream-edge);
  border-radius: 10px;
  background: var(--cream-warm);
  --text-color: var(--ink-soft);
  font-size: 0.92rem;
  line-height: 1.45;
  white-space: pre-line;
}
.flashcard-figure .figure-svg svg {
  width: 100%;
  height: auto;
}
.flashcard-figure .figure-title {
  margin-top: 6px;
  --text-color: var(--ink-soft);
  font-size: 0.82rem;
  font-weight: 700;
}
.flashcard-hint {
  --text-color: var(--ink-soft);
  font-size: 0.78rem;
}
.flashcards-controls {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 14px;
}
.flashcards-controls .primary-button {
  margin-left: 0;
  width: 100%;
}
@media (max-width: 520px) {
  .flashcards-dialog {
    padding: 18px;
  }
  .flashcards-dialog-head {
    flex-direction: column;
  }
  .flashcards-close {
    align-self: flex-start;
  }
  .flashcards-controls {
    display: grid;
    grid-template-columns: 1fr;
  }
  .flashcards-controls .primary-button {
    margin-left: 0;
  }
}
#subject-screen {
  display: grid;
  gap: 12px;
  margin-bottom: 8px;
}
#subject-screen .lede {
  --text-color: var(--ink-soft);
}
.subject-cards.rich .subject-card {
  padding: 18px 20px;
  gap: 8px;
}
.subject-cards.rich {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.subject-cards.rich .subject-card h3 {
  font-size: 1.25rem;
}
.subject-papers {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.subject-paper {
  display: grid;
  gap: 3px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}
.subject-paper-title {
  font-size: 0.9rem;
  font-weight: 700;
  --text-color: var(--ink);
}
.subject-paper-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 10px;
  font-size: 0.8rem;
  --text-color: var(--ink-soft);
}
.subject-paper-days[data-state="today"] {
  color: var(--accent, rgb(214 122 92));
  font-weight: 700;
}
.subject-paper[data-written="true"] .subject-paper-title {
  --text-color: var(--ink-soft);
}
.exam-schedule {
  padding: 18px 20px 6px;
  border: 1px solid var(--card-line);
  border-radius: 18px;
  background: var(--card);
  box-shadow: var(--shadow);
}
.exam-schedule-head h2 {
  margin: 4px 0 0;
  font-size: clamp(1.15rem, 2vw, 1.5rem);
  line-height: 1.25;
}
.exam-schedule-head .lede {
  margin: 6px 0 0;
  --text-color: var(--ink-soft);
  font-size: 0.9rem;
}
.exam-schedule-list {
  list-style: none;
  margin: 12px 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.schedule-paper {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.schedule-paper:hover,
.schedule-paper:focus-visible {
  border-color: var(--ink-soft);
}
.schedule-paper[data-next="true"] {
  border-color: var(--accent, rgb(214 122 92));
  box-shadow: 0 0 0 1px var(--accent, rgb(214 122 92)) inset;
}
.schedule-paper[data-written="true"] {
  opacity: 0.72;
}
.schedule-paper-main {
  display: grid;
  gap: 1px;
  min-width: 0;
}
.schedule-paper-date {
  font-size: 0.78rem;
  font-weight: 700;
  --text-color: var(--accent, rgb(214 122 92));
}
.schedule-paper-title {
  font-weight: 600;
}
.schedule-paper-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px 12px;
  color: var(--ink-soft);
  font-size: 0.8rem;
}
.schedule-paper-days[data-state="today"] {
  color: var(--accent, rgb(214 122 92));
  font-weight: 700;
}
@media (max-width: 640px) {
  .schedule-paper {
    grid-template-columns: minmax(0, 1fr);
  }
  .schedule-paper-meta {
    justify-content: flex-start;
  }
}
.subject-projected {
  margin: 0;
  font-size: 1.05rem;
  --text-color: var(--ink);
}
.subject-projected.dim {
  --text-color: var(--ink-soft);
  font-size: 0.9rem;
}
.subject-projection-hint {
  margin: 0.15rem 0 0;
  --text-color: var(--ink-soft);
  font-size: 0.78rem;
  line-height: 1.35;
}
.projection-detail-explanation {
  margin: 0.4rem 0 0;
  --text-color: var(--ink-soft);
  font-size: 0.82rem;
  line-height: 1.45;
  max-width: 34ch;
}
.subject-meta {
  margin: 0;
  --text-color: var(--ink-soft);
  font-size: 0.82rem;
}

/* Visibility utilities live last so they win equal-specificity ties.
   .hidden must beat class-level display rules; the id rule covers the
   single id-level display (#subject-screen) it is combined with. */
.hidden.hidden,
[hidden][hidden] {
  display: none;
}
#subject-screen.hidden,
#subject-screen[hidden] {
  display: none;
}

/* Exam countdown and per-paper readiness (Phase 5) */
.exam-card {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: clamp(18px, 3vw, 34px);
  margin-bottom: 18px;
  padding: clamp(22px, 3.4vw, 34px);
  border: 1px solid var(--card-line);
  border-radius: 24px;
  background: var(--card);
  box-shadow: var(--shadow);
}
.exam-next h2 {
  margin-top: 6px;
  font-size: clamp(1.5rem, 2.6vw, 2.1rem);
  line-height: 1.2;
}
.exam-next-meta {
  margin-top: 8px;
  color: var(--ink-soft);
  font-size: 0.92rem;
}
.exam-countdown {
  margin-top: 12px;
  font-size: clamp(1.15rem, 2vw, 1.5rem);
  font-weight: 700;
  color: var(--ink);
}
.exam-target {
  align-self: start;
  padding: 16px 18px;
  border-radius: 18px;
  background: var(--surface, rgb(255 255 255 / 55%));
  border: 1px solid var(--card-line);
}
.exam-target-count {
  margin-top: 6px;
  font-size: 1.35rem;
  font-weight: 700;
}
.exam-target-track {
  position: relative;
  height: 8px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgb(23 58 56 / 12%);
}
.exam-target-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent, rgb(214 122 92));
  transition: width 240ms ease;
}
.exam-study-plan {
  grid-column: 1 / -1;
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--card-line);
  border-radius: 18px;
  background: var(--surface, rgb(255 255 255 / 55%));
}
.exam-study-plan-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.exam-study-plan h3 {
  font-size: 0.88rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.exam-study-plan .microcopy {
  margin-top: 5px;
}
.exam-study-budget {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 8px;
}
.exam-study-budget label {
  display: grid;
  gap: 4px;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--ink-soft);
}
.exam-study-budget select {
  min-height: 38px;
  padding: 6px 9px;
  border: 1px solid var(--card-line);
  border-radius: 9px;
  background: var(--card);
  color: var(--ink);
  font: inherit;
}
.exam-study-budget button {
  min-height: 38px;
}
.exam-study-remaining {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-soft);
}
.exam-study-blocks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.exam-study-block {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 13px;
  border: 1px solid var(--card-line);
  border-radius: 14px;
  background: var(--card);
}
.exam-study-block[data-state='done'] {
  border-color: rgb(46 125 92 / 55%);
}
.exam-study-block[data-state='skipped'] {
  opacity: 0.72;
}
.exam-study-block-head,
.exam-study-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
}
.exam-study-block-head {
  font-size: 0.75rem;
  font-weight: 700;
}
.exam-study-reason {
  color: var(--ink-soft);
  font-weight: 500;
}
.exam-study-block h4 {
  font-size: 0.97rem;
  line-height: 1.3;
}
.exam-study-focus,
.exam-study-state {
  font-size: 0.82rem;
  line-height: 1.4;
  color: var(--ink-soft);
}
.exam-study-state[data-state='done'] {
  color: rgb(46 125 92);
  font-weight: 700;
}
.exam-study-actions {
  justify-content: flex-start;
  margin-top: 2px;
}
.exam-study-actions button {
  min-height: 36px;
  padding: 7px 11px;
  font-size: 0.78rem;
}
.exam-papers {
  grid-column: 1 / -1;
}
.exam-papers h3 {
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.exam-paper-list {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}
.exam-paper {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--card-line);
  border-radius: 14px;
  background: var(--card);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.exam-paper:hover,
.exam-paper:focus-visible {
  border-color: var(--ink-soft);
}
.exam-paper[data-next='true'] {
  border-color: var(--accent, rgb(214 122 92));
  box-shadow: 0 0 0 1px var(--accent, rgb(214 122 92)) inset;
}
.exam-paper[data-written='true'] {
  opacity: 0.72;
}
.exam-paper-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink-soft);
  font-size: 0.82rem;
  white-space: nowrap;
}
.exam-paper-date {
  color: var(--ink-soft);
}
.exam-paper-gap {
  max-width: 190px;
  color: var(--ink-soft);
  font-size: 0.7rem;
  line-height: 1.25;
  white-space: normal;
}
.exam-paper-title {
  display: block;
  font-weight: 600;
}
.exam-paper-subject {
  display: block;
  color: var(--ink-soft);
  font-size: 0.78rem;
}
.exam-paper-projection {
  font-size: 0.84rem;
  color: var(--ink-soft);
  white-space: nowrap;
}
.exam-status {
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  background: rgb(23 58 56 / 8%);
  color: var(--ink-soft);
}
.exam-status[data-status='ready'] {
  background: rgb(46 125 92 / 16%);
  color: rgb(31 94 68);
}
.exam-status[data-status='progressing'] {
  background: rgb(214 122 92 / 18%);
  color: rgb(140 74 51);
}
@media (max-width: 820px) {
  .exam-card {
    grid-template-columns: 1fr;
  }
  .exam-paper {
    grid-template-columns: 1fr;
    align-items: start;
    row-gap: 8px;
  }
  .exam-paper-meta {
    flex-wrap: wrap;
    white-space: normal;
  }
}

/* Writing Studio: task, practice mode, editor and result share one workspace. */
.writing-dialog {
  width: min(820px, calc(100% - 28px));
  max-width: none;
  max-height: min(900px, calc(var(--writing-visible-height, 100dvh) - 28px));
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  --text-color: var(--ink);
  background: var(--white);
  box-shadow: 0 26px 90px rgba(23, 58, 56, 0.28);
}
.writing-dialog::backdrop {
  background: rgba(10, 28, 26, 0.64);
  backdrop-filter: blur(3px);
}
.writing-shell {
  display: grid;
  gap: 16px;
  max-height: min(900px, calc(var(--writing-visible-height, 100dvh) - 28px));
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 22px clamp(16px, 3vw, 30px) max(22px, env(safe-area-inset-bottom));
  scrollbar-gutter: stable;
}
.writing-header,
.writing-independent-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.writing-header h2 {
  margin-top: 4px;
  font-size: clamp(1.45rem, 4vw, 2rem);
}
.writing-header .eyebrow {
  margin-bottom: 4px;
}
.writing-meta {
  margin-top: 5px;
  font-size: 0.82rem;
  font-weight: 650;
  letter-spacing: 0;
  text-transform: none;
}
.writing-dialog .writing-meta {
  text-transform: none;
}
.writing-close {
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border: 1px solid var(--card-line);
  border-radius: 50%;
  background: var(--card);
  font-size: 1.5rem;
  line-height: 1;
}
.writing-task-card {
  display: grid;
  gap: 8px;
  padding: 16px 18px;
  border: 1px solid var(--card-line);
  border-left: 4px solid var(--coral);
  border-radius: 16px;
  background: var(--card);
}
.writing-section-label {
  margin: 0;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.writing-prompt {
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  --text-color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.08rem, 2.5vw, 1.28rem);
  font-weight: 700;
  line-height: 1.45;
}
.writing-band {
  justify-self: start;
  margin: 0;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--white);
  font-size: 0.8rem;
  font-weight: 750;
}
.writing-guides {
  display: block;
  padding: 12px 14px;
  border: 1px solid var(--card-line);
  border-radius: 14px;
  background: var(--white);
}
.writing-guides > summary {
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 750;
}
.writing-guide-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  padding-top: 12px;
}
.writing-guide-grid section {
  min-width: 0;
}
.writing-guide-grid h3 {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.writing-plan,
.writing-checklist {
  display: grid;
  gap: 5px;
  margin: 7px 0 0;
  padding-left: 20px;
  font-size: 0.88rem;
  line-height: 1.5;
  --text-color: var(--ink-soft);
}
.writing-mode-picker {
  display: grid;
  gap: 12px;
}
.writing-mode-picker h3 {
  margin: 4px 0 0;
  font-size: 1.22rem;
}
.writing-mode-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.writing-mode-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 7px 11px;
  min-height: 154px;
  padding: 15px;
  border: 1px solid var(--card-line);
  border-radius: 16px;
  background: var(--card);
  text-align: left;
}
.writing-mode-card strong,
.writing-mode-card > span:not(.writing-mode-icon) {
  grid-column: 2;
}
.writing-mode-recommended {
  justify-self: start;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgb(46 125 92 / 12%);
  color: rgb(36 100 72) !important;
  font-size: 0.67rem !important;
  font-weight: 850;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.writing-mode-card strong {
  align-self: center;
  font-size: 1rem;
}
.writing-mode-card > span:not(.writing-mode-icon) {
  font-size: 0.86rem;
  line-height: 1.45;
  color: var(--ink-soft);
}
.writing-mode-card .writing-mode-action {
  align-self: end;
  margin-top: 3px;
  font-weight: 800;
  color: var(--ink);
}
.writing-mode-guided {
  border-color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--ink);
}
.writing-mode-icon {
  grid-column: 1;
  grid-row: 1 / span 4;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--white);
  font-weight: 800;
}
.writing-independent-head {
  align-items: center;
  min-height: 40px;
}
.writing-draft-status {
  margin: 0;
  font-size: 0.76rem;
  color: var(--ink-soft);
  text-align: right;
}
.writing-answer {
  width: 100%;
  min-height: 220px;
  padding: 15px 16px;
  border: 1px solid var(--field-line);
  border-radius: 14px;
  background: var(--white);
  color: var(--ink);
  font: inherit;
  line-height: 1.65;
  resize: vertical;
}
.writing-answer:focus-visible {
  outline: 3px solid var(--focus, rgb(214 122 92 / 45%));
  outline-offset: 2px;
}
.writing-count-row {
  display: grid;
  gap: 8px;
}
.writing-count {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 750;
}
.writing-score-note {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--ink-soft);
}
.writing-count[data-state='short'] {
  color: var(--ink-soft);
}
.writing-count[data-state='in-band'] {
  color: rgb(46 125 92);
}
.writing-count[data-state='long'],
.writing-count[data-state='error'] {
  color: rgb(154 55 40);
}
.writing-count-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgb(23 58 56 / 12%);
}
.writing-count-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--coral);
  transition: width 120ms ease-out;
}
.writing-count[data-state='in-band'] + .writing-count-track span {
  background: rgb(46 125 92);
}
.writing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}
.writing-actions .primary-button {
  min-height: 50px;
  padding-inline: 20px;
}
.writing-result {
  display: grid;
  gap: 10px;
  padding: 16px 18px;
  border: 1px solid var(--card-line);
  border-radius: 16px;
  background: var(--card);
  --text-color: var(--ink);
}
.writing-result h3 {
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.writing-score {
  font-size: 1.5rem;
  font-weight: 700;
}
.writing-result-criteria {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.writing-result-criteria li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border: 1px solid var(--card-line);
  border-radius: 10px;
  background: var(--white);
  font-size: 0.87rem;
}
.writing-model {
  white-space: pre-wrap;
  font-size: 0.9rem;
  line-height: 1.6;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--white);
  border: 1px solid var(--card-line);
}
body.writing-keyboard-open .writing-dialog {
  top: 8px;
  bottom: auto;
  margin-block: 0;
}
body.writing-keyboard-open .writing-answer {
  min-height: max(72px, min(190px, calc(var(--writing-visible-height, 100dvh) - 250px)));
  max-height: max(72px, min(42dvh, calc(var(--writing-visible-height, 100dvh) - 250px)));
}
body.writing-keyboard-open .writing-actions {
  position: sticky;
  bottom: 0;
  z-index: 1;
  padding: 8px 0 max(8px, env(safe-area-inset-bottom));
  background: var(--white);
}
@media (max-width: 620px) {
  .writing-dialog {
    width: calc(100% - 16px);
    max-height: calc(var(--writing-visible-height, 100dvh) - 16px);
    border-radius: 19px;
  }
  .writing-shell {
    max-height: calc(var(--writing-visible-height, 100dvh) - 16px);
    gap: 13px;
    padding: 16px 15px max(18px, env(safe-area-inset-bottom));
  }
  .writing-guide-grid,
  .writing-mode-cards {
    grid-template-columns: 1fr;
  }
  .writing-mode-card {
    min-height: 124px;
    padding: 13px;
  }
  .writing-answer {
    min-height: 160px;
    resize: vertical;
  }
  .writing-actions .primary-button {
    width: 100%;
  }
  .writing-dialog .writing-independent .writing-actions {
    position: sticky;
    bottom: 0;
    z-index: 2;
    padding: 8px 0 max(8px, env(safe-area-inset-bottom));
    background: var(--white);
  }
  .writing-draft-status {
    max-width: 48%;
  }
}

/* Per-section readiness under the exam countdown (Phase 6C) */
.exam-sections {
  display: grid;
  gap: 7px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}
.exam-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "name marks" "bar bar" "status status";
  gap: 4px 10px;
  padding: 8px 11px;
  border: 1px solid var(--card-line);
  border-radius: 11px;
  background: var(--surface, rgb(255 255 255 / 45%));
}
.exam-section-name {
  grid-area: name;
  font-size: 0.83rem;
  font-weight: 600;
}
.exam-section-marks {
  grid-area: marks;
  font-size: 0.78rem;
  color: var(--ink-soft);
  white-space: nowrap;
}
.exam-section-track {
  grid-area: bar;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: rgb(23 58 56 / 12%);
}
.exam-section-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent, rgb(214 122 92));
}
.exam-section[data-status='ready'] .exam-section-track span {
  background: rgb(46 125 92);
}
.exam-section .exam-status {
  grid-area: status;
  justify-self: start;
}

/* Mock paper workspace (Phase 6C) */
.exam-dialog {
  width: min(780px, calc(100% - 24px));
  max-height: min(900px, calc(100dvh - 24px));
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 21px;
  --text-color: var(--ink);
  background: var(--white);
  box-shadow: 0 26px 90px rgba(23, 58, 56, 0.28);
}
.exam-dialog::backdrop {
  background: rgba(10, 28, 26, 0.7);
  backdrop-filter: blur(3px);
}
.exam-shell {
  display: grid;
  gap: 14px;
  max-height: min(900px, calc(100dvh - 24px));
  overflow: auto;
  padding: 22px clamp(16px, 3vw, 28px) 24px;
}
.exam-shell-head h2 {
  margin-top: 4px;
  font-size: clamp(1.25rem, 2.3vw, 1.6rem);
}
.exam-mock-timer {
  margin-top: 8px;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ink);
}
.exam-mock-timer[data-expired='true'] {
  color: rgb(154 55 40);
}
.exam-mock-body {
  display: grid;
  gap: 12px;
}
.exam-mock-progress {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.exam-mock-prompt {
  font-size: 1.02rem;
  line-height: 1.5;
}
.exam-passage {
  border: 1px solid var(--card-line);
  border-radius: 12px;
  padding: 10px 12px;
  background: var(--card);
  --text-color: var(--ink);
}
.exam-passage summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.86rem;
}
.exam-passage p {
  margin-top: 8px;
  white-space: pre-wrap;
  font-size: 0.9rem;
  line-height: 1.55;
}
.exam-mock-answer {
  width: 100%;
  min-height: 84px;
  padding: 12px 14px;
  border: 1px solid var(--field-line);
  border-radius: 12px;
  font: inherit;
  line-height: 1.5;
}
.exam-mock-options {
  display: grid;
  gap: 8px;
  border: 0;
  padding: 0;
  margin: 0;
}
.exam-mock-options label {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 9px 12px;
  border: 1px solid var(--card-line);
  border-radius: 11px;
  background: var(--card);
  cursor: pointer;
}
.exam-shell-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.exam-mock-result {
  display: grid;
  gap: 10px;
  padding: 16px 18px;
  border: 1px solid var(--card-line);
  border-radius: 16px;
  background: var(--card);
}
.exam-mock-result h3 {
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.exam-mock-score {
  font-size: 1.6rem;
  font-weight: 700;
}
.exam-mock-group {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.88rem;
  padding: 6px 0;
  border-top: 1px solid var(--card-line);
}
.exam-mock-start {
  margin-top: 14px;
}

/* Review round (Phase 6C) */
.exam-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}
.review-dialog {
  width: min(720px, calc(100% - 24px));
  max-height: min(860px, calc(100dvh - 24px));
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 21px;
  --text-color: var(--ink);
  background: var(--white);
  box-shadow: 0 26px 90px rgba(23, 58, 56, 0.28);
}
.review-dialog::backdrop {
  background: rgba(10, 28, 26, 0.7);
  backdrop-filter: blur(3px);
}
.review-shell {
  display: grid;
  gap: 14px;
  max-height: min(860px, calc(100dvh - 24px));
  overflow: auto;
  padding: 22px clamp(16px, 3vw, 26px) 24px;
}
.review-list {
  display: grid;
  gap: 12px;
}
.review-item {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border: 1px solid var(--card-line);
  border-radius: 14px;
  background: var(--card);
  --text-color: var(--ink);
}
.review-item-meta {
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.review-item-prompt {
  font-weight: 600;
}
.review-group-title {
  margin: 10px 0 0;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.review-status-due {
  border-color: var(--accent);
}
.review-status-scheduled {
  opacity: 0.9;
}
.review-status-resolved {
  opacity: 0.65;
}
.review-resolved summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--ink-soft);
}
.review-practice {
  display: grid;
  gap: 12px;
}
.review-round-head,
.review-round-actions,
.review-round-done {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.review-form {
  display: grid;
  gap: 10px;
}
.review-feedback {
  display: grid;
  gap: 8px;
}
.review-score {
  font-size: 1.4rem;
  font-weight: 800;
}
.review-passage p {
  white-space: pre-wrap;
}
.stuck-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--card-line);
  border-radius: 12px;
  background: var(--card);
}
.stuck-row p {
  margin: 2px 0 0;
  font-size: 0.8rem;
  color: var(--ink-soft);
}
.stuck-due {
  margin-top: 10px;
}
.coach-question-parts {
  margin: 8px 0;
  padding: 10px 12px;
  border: 1px solid var(--card-line);
  border-radius: 12px;
  background: var(--surface-mist);
}
.coach-question-parts p {
  margin: 0 0 6px;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.coach-question-parts ul,
.coach-answer-review-parts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
}
.coach-question-parts li,
.coach-answer-review-parts li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.coach-answer-review {
  display: grid;
  gap: 10px;
  margin: 12px 0;
  padding: 12px 14px;
  border: 1px solid var(--card-line);
  border-radius: 14px;
  background: var(--card);
  --text-color: var(--ink);
}
.coach-answer-review-block h5 {
  margin: 0 0 4px;
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.coach-answer-review-block ul,
.coach-answer-review-block ol {
  margin: 0;
  padding-left: 20px;
}
.coach-answer-review-missing {
  display: block;
  color: var(--ink-soft);
}
.coach-answer-review-own summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--ink-soft);
}
.writing-precheck {
  display: grid;
  gap: 8px;
  margin: 12px 0;
  padding: 12px 14px;
  border: 1px solid var(--accent);
  border-radius: 14px;
  background: var(--amber-soft);
  --text-color: var(--ink);
}
.writing-precheck h4 {
  margin: 0;
}
.writing-precheck ul {
  margin: 0;
  padding-left: 20px;
}
.writing-precheck-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.writing-carry,
.writing-stall,
.writing-scaffold {
  margin: 10px 0;
  padding: 10px 12px;
  border: 1px solid var(--card-line);
  border-radius: 12px;
  background: var(--surface-mist);
  --text-color: var(--ink);
}
.writing-carry h4 {
  margin: 0 0 4px;
}
.writing-carry ul {
  margin: 0;
  padding-left: 20px;
}
.writing-stall {
  border-color: var(--accent);
}
.writing-biggest {
  font-weight: 700;
}

/* Coach exit button (the practice head is hidden in coach-active mode) */
.coach-close {
  flex: none;
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  background: transparent;
  color: var(--white);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}
.coach-close:hover,
.coach-close:focus-visible {
  border-color: var(--white);
}

/* Writing coach: plan, checklist, rubric feedback, model text */
.coach-writing {
  display: grid;
  gap: 10px;
  margin: 12px 0 4px;
}
.coach-writing-target {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.coach-writing-block h5,
.coach-writing-criteria + h4 {
  font-size: 0.74rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.coach-writing-block ol,
.coach-writing-block ul {
  display: grid;
  gap: 4px;
  margin: 6px 0 0;
  padding-left: 20px;
  font-size: 0.9rem;
  line-height: 1.45;
}
.coach-writing-count {
  font-size: 0.84rem;
  font-weight: 700;
}
.coach-writing-hint {
  font-size: 0.82rem;
  color: var(--ink-soft);
}
.coach-form.writing textarea {
  min-height: 200px;
  max-height: 42dvh;
}
.coach-writing-criteria {
  display: grid;
  gap: 8px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}
.coach-writing-criteria li {
  display: grid;
  gap: 3px;
  padding: 9px 11px;
  border: 1px solid var(--card-line);
  border-radius: 11px;
  --text-color: var(--ink);
  background: var(--card);
}
.coach-writing-criterion {
  font-size: 0.9rem;
  font-weight: 600;
}
.coach-writing-marks {
  font-size: 0.82rem;
  color: var(--ink-soft);
}
.coach-writing-evidence {
  font-size: 0.85rem;
  line-height: 1.45;
}
.coach-writing-missing {
  font-size: 0.82rem;
  color: rgb(154 55 40);
}
.coach-writing-model {
  white-space: pre-wrap;
  padding: 12px 14px;
  border: 1px solid var(--card-line);
  border-radius: 12px;
  --text-color: var(--ink);
  background: var(--card);
  font-size: 0.92rem;
  line-height: 1.55;
}
.coach-feedback-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}
.today-focus {
  font-size: 0.86rem;
  font-weight: 600;
}
@media (max-width: 640px) {
  .coach-form.writing textarea {
    min-height: 150px;
  }
}
body.coach-keyboard-open .coach-form.writing textarea {
  min-height: max(72px, min(150px, calc(var(--coach-visible-height, 100dvh) - 190px)));
  max-height: max(72px, min(42dvh, calc(var(--coach-visible-height, 100dvh) - 190px)));
}

/* Writing workshop (Phase 6F) */
.writing-stage {
  display: grid;
  gap: 12px;
}
.writing-stage-head {
  display: grid;
  gap: 9px;
}
.writing-rail {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.writing-rail li {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border: 1px solid var(--card-line);
  border-radius: 999px;
  --text-color: var(--ink-soft);
  font-size: 0.76rem;
}
.writing-rail li[data-state='current'] {
  --text-color: var(--white);
  border-color: var(--ink);
  background: var(--ink);
}
.writing-rail li[data-state='done'] {
  --text-color: rgb(46 125 92);
  border-color: rgb(46 125 92);
}
.writing-rail-number {
  font-weight: 700;
}
.writing-prompt {
  font-size: 1.05rem;
  line-height: 1.5;
}
.writing-meta {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.writing-strength {
  font-size: 0.92rem;
  line-height: 1.45;
}
.writing-model-move,
.writing-proofread-checks {
  padding: 12px 14px;
  border: 1px solid var(--card-line);
  border-radius: 12px;
  background: var(--card);
}
.writing-model-move h5,
.writing-proofread-checks h5 {
  margin-bottom: 7px;
  color: var(--ink);
  font-size: 0.88rem;
}
.writing-model-move pre {
  margin: 0;
  padding: 10px;
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
  font: inherit;
  font-size: 0.88rem;
  line-height: 1.5;
  white-space: pre-wrap;
}
.writing-model-move p,
.writing-proofread-checks li {
  color: var(--ink-soft);
  font-size: 0.85rem;
  line-height: 1.45;
}
.writing-model-move p {
  margin: 8px 0 0;
}
.writing-proofread-checks ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 20px;
}
.writing-error,
.writing-unscored {
  padding: 10px 12px;
  border: 1px solid rgb(154 55 40 / 35%);
  border-radius: 10px;
  background: rgb(154 55 40 / 7%);
  color: rgb(124 44 34);
  font-size: 0.9rem;
  line-height: 1.45;
}
.writing-gaps h5,
.writing-fixes h5,
.writing-habit h5 {
  font-size: 0.74rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.writing-gaps ul,
.writing-fixes ul {
  display: grid;
  gap: 6px;
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
}
.writing-fixes li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: start;
  padding: 8px 10px;
  border: 1px solid var(--card-line);
  border-radius: 10px;
  --text-color: var(--ink);
  background: var(--card);
  font-size: 0.88rem;
  line-height: 1.45;
}
.writing-fixes li[data-applied='true'] {
  border-color: rgb(46 125 92);
}
.writing-fix-state {
  font-weight: 700;
}
.writing-fix-flag {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.writing-plan-pinned {
  padding: 8px 10px;
  border: 1px solid var(--card-line);
  border-radius: 10px;
  --text-color: var(--ink);
  background: var(--card);
}
.writing-checklist-reference {
  padding: 8px 10px;
  border: 1px solid var(--card-line);
  border-radius: 10px;
  background: var(--white);
  --text-color: var(--ink);
}
.writing-checklist-reference summary {
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 650;
}
.writing-checklist-reference ul {
  display: grid;
  gap: 5px;
  margin: 7px 0 2px;
  padding-left: 20px;
  color: var(--ink-soft);
  font-size: 0.85rem;
  line-height: 1.45;
}
.writing-stage-options {
  padding: 7px 10px;
  border: 1px solid var(--card-line);
  border-radius: 10px;
  background: var(--white);
}
.writing-stage-options summary {
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 650;
}
.writing-stage-options > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  padding-top: 6px;
}
.writing-stage-options button {
  min-height: 40px;
}
.writing-plan-pinned summary {
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
}
.writing-plan-body {
  margin-top: 6px;
  font-size: 0.88rem;
  white-space: pre-wrap;
}
.writing-live-count {
  font-size: 0.86rem;
  font-weight: 700;
}
.writing-live-count[data-state='in-band'] {
  color: rgb(46 125 92);
}
.writing-live-count[data-state='out-band'] {
  color: rgb(154 55 40);
}
.writing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.writing-habit {
  padding: 10px 12px;
  border: 1px solid var(--card-line);
  border-radius: 12px;
  --text-color: var(--ink);
  background: var(--card);
}
.writing-score {
  font-size: 1.3rem;
  font-weight: 700;
}
.writing-stage[data-composer='off'] {
  padding-bottom: 64px;
}
.coach-panel.writing-studio-active .coach-chat-stream {
  display: none;
}
.coach-panel.writing-studio-active #coach-overview-toggle {
  display: none;
}
.coach-panel.writing-studio-active .coach-block-progress {
  display: none;
}
.coach-panel.writing-studio-active .coach-transcript {
  padding-top: 14px;
  padding-bottom: max(18px, env(safe-area-inset-bottom));
}
.coach-panel.writing-studio-active .coach-task-workspace {
  width: min(900px, 100%);
  margin: 0 auto;
  padding: 0 4px;
}
.coach-panel.writing-studio-active .writing-stage {
  display: grid;
  gap: 16px;
  padding: 8px 0 22px;
}
/* Workshop steps: one action per screen, position always visible. */
.writing-steps {
  display: flex;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.writing-steps li {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--card-line);
  border-radius: 999px;
  --text-color: var(--ink-soft);
  background: var(--white);
  white-space: nowrap;
}
.writing-steps li[data-state='current'] {
  border-color: var(--coral);
  --text-color: var(--ink);
  background: var(--coral-soft);
}
.writing-steps li[data-state='done'] {
  --text-color: var(--ink-soft);
  background: var(--surface-mist);
}
.writing-step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--paper);
  font-size: 0.7rem;
}
.writing-steps li[data-state='current'] .writing-step-number {
  background: var(--coral);
  --text-color: var(--ink);
}
/* The task itself, collapsed to a strip while writing. */
.writing-brief {
  border: 1px solid var(--card-line);
  border-radius: 12px;
  background: var(--white);
}
.writing-brief > summary {
  display: flex;
  gap: 8px;
  align-items: baseline;
  padding: 11px 13px;
  cursor: pointer;
  list-style: none;
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1.35;
}
.writing-brief > summary::-webkit-details-marker {
  display: none;
}
.writing-brief > summary::before {
  content: '▸';
  flex: none;
  --text-color: var(--ink-soft);
  font-size: 0.75rem;
}
.writing-brief[open] > summary::before {
  content: '▾';
}
.writing-brief-meta {
  font-weight: 600;
  --text-color: var(--ink-soft);
}
.writing-brief-body {
  margin: 0;
  padding: 0 13px 13px;
  font-size: 0.95rem;
  line-height: 1.5;
}
.writing-hint-line {
  margin: 0;
  --text-color: var(--ink-soft);
  font-size: 0.86rem;
  line-height: 1.45;
}
.writing-surface-hint {
  margin: 0;
  --text-color: var(--ink-soft);
  font-size: 0.8rem;
  line-height: 1.4;
}
.writing-score-summary {
  display: grid;
  gap: 6px;
  padding: 16px;
  border: 1px solid var(--card-line);
  border-radius: 14px;
  background: var(--white);
}
.writing-score-big {
  margin: 0;
  --text-color: var(--ink);
  font:
    700 2.6rem/1 Georgia,
    "Times New Roman",
    serif;
  letter-spacing: -0.03em;
}
.writing-score-big small {
  margin-left: 0.2em;
  --text-color: var(--ink-soft);
  font:
    600 1rem/1 Inter,
    ui-sans-serif,
    system-ui,
    sans-serif;
  letter-spacing: 0;
}
.writing-score-line {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.45;
}
.writing-detail {
  border: 1px solid var(--card-line);
  border-radius: 12px;
  background: var(--white);
}
.writing-detail > summary {
  padding: 11px 13px;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 800;
}
.writing-detail[open] > summary {
  border-bottom: 1px solid var(--card-line);
}
.writing-detail-body {
  padding: 12px 13px;
}
.writing-detail-body .writing-criteria,
.writing-detail-body .writing-criterion {
  margin: 0;
}
/* Concrete corrections: what the learner wrote, what it should be, and why. */
.writing-corrections {
  display: grid;
  gap: 8px;
}
.writing-corrections h4 {
  margin: 0;
  font-size: 0.8rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  --text-color: var(--ink-soft);
}
.writing-corrections-hint {
  margin: 0;
  --text-color: var(--ink-soft);
  font-size: 0.84rem;
}
.writing-corrections ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.writing-corrections li {
  display: grid;
  gap: 5px;
  padding: 11px 13px;
  border: 1px solid var(--card-line);
  border-left: 4px solid var(--coral);
  border-radius: 0 12px 12px 0;
  background: var(--white);
}
.writing-corrections li[data-kind='register'] {
  border-left-color: rgb(154 55 40);
}
.writing-corrections li[data-kind='woordkeuse'] {
  border-left-color: var(--amber);
}
.writing-correction-kind {
  justify-self: start;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-mist);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  --text-color: var(--ink-soft);
}
.writing-correction-change {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: baseline;
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.4;
}
.writing-correction-change s {
  padding: 0 3px;
  border-radius: 4px;
  background: rgb(154 55 40 / 12%);
  --text-color: rgb(120 40 30);
  text-decoration-thickness: 2px;
}
.writing-correction-change strong {
  --text-color: rgb(30 95 70);
  font-weight: 800;
}
.writing-correction-arrow {
  --text-color: var(--ink-soft);
}
.writing-correction-note {
  margin: 0;
  --text-color: var(--ink-soft);
  font-size: 0.82rem;
  line-height: 1.4;
}
.writing-coach-note {
  margin: 0;
  padding: 12px 14px;
  border-left: 4px solid var(--coral);
  border-radius: 0 12px 12px 0;
  background: var(--surface-mist);
  font-size: 0.95rem;
  line-height: 1.5;
}
.coach-panel.writing-studio-active .coach-form.writing {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 7px;
  padding-top: 9px;
}
.coach-panel.writing-studio-active .coach-form.writing > label {
  font-size: 0.76rem;
  font-weight: 800;
  color: var(--ink-soft);
}
.coach-panel.writing-studio-active .coach-form.writing textarea {
  width: 100%;
  min-height: 130px;
  max-height: 34dvh;
  font-size: max(16px, 0.98rem);
}
.coach-panel.writing-studio-active .coach-form.writing.surface textarea {
  min-height: 36dvh;
  max-height: 36dvh;
}
.coach-panel.writing-studio-active .coach-form.writing #writing-live-count {
  margin: 0;
  padding-inline: 2px;
}
body.coach-keyboard-open .coach-panel.writing-studio-active .coach-form.writing textarea {
  min-height: max(72px, min(130px, calc(var(--coach-visible-height, 100dvh) - 190px)));
  max-height: max(72px, min(34dvh, calc(var(--coach-visible-height, 100dvh) - 190px)));
}
body.coach-keyboard-open
  .coach-panel.writing-studio-active
  .coach-form.writing.surface
  textarea {
  min-height: max(120px, calc(var(--coach-visible-height, 100dvh) - 260px));
  max-height: max(120px, calc(var(--coach-visible-height, 100dvh) - 260px));
}
.coach-panel.writing-studio-active .writing-live-count {
  padding-inline: 3px;
}
body.coach-active:has(.coach-panel.writing-studio-active) .coach-quick-actions {
  display: none;
}
body.coach-active .coach-panel.writing-studio-active .coach-head-copy .eyebrow {
  color: var(--coral-soft);
}
.writing-history h5 {
  font-size: 0.74rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.writing-history ul {
  display: grid;
  gap: 4px;
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
}
.writing-history li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 10px;
  border: 1px solid var(--card-line);
  border-radius: 9px;
  --text-color: var(--ink);
  background: var(--card);
  font-size: 0.84rem;
}
.writing-history li[data-focus='true'] {
  border-color: var(--accent, rgb(214 122 92));
  font-weight: 600;
}
.writing-elapsed {
  margin-left: 8px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
}
.writing-compare {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid var(--card-line);
  border-radius: 14px;
  --text-color: var(--ink);
  background: var(--card);
}
.writing-compare h4 {
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.writing-compare-option {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 0.9rem;
  line-height: 1.45;
}
.writing-compare-option input {
  margin-top: 3px;
}
.writing-compare-option[data-chosen='true'] {
  color: var(--ink-soft);
}
.writing-compare-saved {
  font-size: 0.86rem;
  font-weight: 600;
  --text-color: var(--ink);
}

/* The streamlined workshop keeps the coach conversation, single editor, and feedback clear. */
.coach-panel.writing-coaching-active .coach-chat-stream {
  display: grid;
}
.coach-panel.writing-coaching-active .coach-form:not(.hidden) {
  display: grid;
}
.coach-panel.writing-studio-active .writing-stage {
  gap: 14px;
  padding: 8px 0 20px;
}
.writing-focus-note {
  padding: 10px 12px;
  border-left: 3px solid var(--coral);
  border-radius: 0 10px 10px 0;
  background: var(--surface-mist);
  line-height: 1.45;
}
.writing-focus-note p,
.writing-writing-help,
.writing-feedback-explanation,
.writing-word-count {
  margin: 4px 0 0;
  line-height: 1.5;
}
.writing-feedback-block {
  display: grid;
  gap: 6px;
}
.writing-feedback-block h4 {
  font-size: 0.95rem;
}
.writing-feedback-block ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 1.2rem;
}
.writing-feedback-block li {
  padding-left: 2px;
  line-height: 1.45;
}
.writing-feedback-block li span {
  display: block;
  color: var(--ink-soft);
  font-size: 0.9rem;
}
.writing-feedback-explanation {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface-mist);
}
.writing-word-count {
  color: var(--ink-soft);
  font-size: 0.86rem;
}

/* --- Simplified learner dashboard ---------------------------------------
   One next step, a compact score chip and slim topic cards. */

.welcome-row {
  align-items: center;
  margin-bottom: 22px;
}
.welcome-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.score-chip {
  display: grid;
  gap: 3px;
  min-width: 150px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.score-chip:hover,
.score-chip:focus-visible {
  border-color: var(--ink-soft);
}
.score-chip-label {
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
  text-transform: uppercase;
}
.score-chip-value {
  display: flex;
  align-items: baseline;
  gap: 4px;
}
.score-chip-value strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
  line-height: 1;
}
.score-chip-value small {
  color: var(--ink-soft);
  font-size: 0.78rem;
}
.score-chip-confidence {
  font-size: 0.72rem;
  color: var(--ink-soft);
}
.next-step-card {
  align-items: flex-start;
  gap: 24px;
  padding: clamp(20px, 3vw, 30px);
  margin-bottom: 14px;
}
.next-step-card h2 {
  max-width: 620px;
  margin-top: 4px;
  font-size: clamp(1.35rem, 2.4vw, 1.9rem);
}
.next-step-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.next-step-actions {
  display: grid;
  gap: 8px;
  justify-items: stretch;
  flex: 0 0 auto;
}
.next-step-actions .primary-button {
  margin: 0;
}
.exam-strip {
  display: grid;
  gap: 6px;
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--cream);
}
.exam-strip-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.exam-strip-head h2 {
  margin: 0;
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  line-height: 1.3;
}
.exam-countdown {
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--white);
  border: 1px solid var(--line);
  font-weight: 700;
  font-size: 0.82rem;
  white-space: nowrap;
}
.exam-focus-line {
  margin: 0;
  font-size: 0.86rem;
  color: var(--ink-soft);
}
.exam-today-note,
.exam-reason-line {
  margin: 6px 0 0;
  font-size: 0.82rem;
  line-height: 1.35;
  color: var(--ink-soft);
}
.exam-today-note {
  padding: 8px 10px;
  border-radius: 9px;
  background: var(--cream, #f7f1e6);
}
.exam-strip-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
}
.topic-card.slim {
  min-height: 132px;
  padding: 16px;
  gap: 6px;
}
.topic-card.slim h3 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.3;
}
.topic-status {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.84rem;
}
.topic-card.slim .topic-card-actions {
  margin-top: auto;
}
.topic-card.slim .topic-card-actions .primary-button {
  justify-self: start;
  margin: 0;
}
.reader-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}
@media (max-width: 720px) {
  .welcome-row,
  .next-step-card {
    flex-direction: column;
    align-items: stretch;
  }
  .welcome-actions {
    justify-content: flex-start;
  }
  .next-step-actions {
    justify-items: start;
  }
}

/* The chronological schedule is the subject picker. */
.schedule-paper[data-selected="true"] {
  border-color: var(--ink-soft);
  box-shadow: inset 3px 0 0 var(--ink);
}

/* Plan step: one message, one field, then one action. */
.coach-panel.writing-coaching-active .coach-chat-stream .coach-bubble:not(:last-child) {
  display: none;
}
.coach-form.plan textarea {
  height: 72px;
  min-height: 72px;
  max-height: 140px;
}
.writing-plan-card {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid var(--card-line);
  border-radius: 12px;
  background: var(--white);
}
.writing-plan-card h4 {
  margin: 0;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  --text-color: var(--ink-soft);
}
.writing-plan-card p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.5;
  white-space: pre-wrap;
}
.writing-plan-actions {
  display: grid;
  gap: 8px;
}
.writing-plan-actions .primary-button {
  width: 100%;
  min-height: 50px;
}
.writing-plan-actions .text-button {
  justify-self: start;
  padding-inline: 2px;
}

/* After a piece is finished: one clear next subject, with its test date. */
.writing-next-focus {
  display: grid;
  gap: 6px;
  padding: 16px;
  border: 1px solid var(--card-line);
  border-radius: 14px;
  background: var(--white);
}
.writing-next-focus .eyebrow {
  margin: 0;
}
.writing-next-focus h4 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.3;
}
.writing-next-meta {
  margin: 0;
  --text-color: var(--ink-soft);
  font-size: 0.86rem;
}
.writing-next-reason {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.45;
}
.writing-next-focus .primary-button {
  width: 100%;
  min-height: 50px;
  margin-top: 6px;
}
