:root {
  color-scheme: light;
  --bg: #f6f7f4;
  --surface: #ffffff;
  --surface-2: #edf2f0;
  --ink: #1f2725;
  --muted: #65706b;
  --line: #d8dfda;
  --blue: #235c9f;
  --green: #2f6f56;
  --red: #b54444;
  --amber: #8a661e;
  --focus: #163f73;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  line-height: 1.5;
}

button,
input,
select,
textarea {
  font: inherit;
}

/* Membership, dictionary, wordbook and writing AI */
.top-actions .tool-button,
.top-actions .account-button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 0 12px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.top-actions .account-button.is-member {
  border-color: #a9cabc;
  background: #eef7f2;
  color: var(--green);
}

.mobile-study-tool {
  display: none;
}

.account-dialog,
.dictionary-dialog,
.study-tools-dialog {
  width: min(calc(100vw - 28px), 540px);
  max-height: min(86vh, 760px);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  color: var(--ink);
  padding: 0;
  box-shadow: 0 24px 72px rgba(31, 39, 37, 0.22);
  overflow: auto;
}

.dictionary-dialog {
  width: min(calc(100vw - 28px), 720px);
}

.account-dialog::backdrop,
.dictionary-dialog::backdrop,
.study-tools-dialog::backdrop {
  background: rgba(22, 31, 28, 0.5);
}

.account-dialog-heading,
.dictionary-dialog-heading,
.study-tools-dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 24px 16px;
}

.account-dialog-heading span,
.dictionary-dialog-heading span,
.wordbook-heading > div > span {
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.account-dialog-heading h2,
.dictionary-dialog-heading h2,
.study-tools-dialog-heading h2 {
  margin: 4px 0 0;
  font-size: 24px;
  line-height: 1.25;
}

.dialog-close,
.study-tools-dialog-heading button {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
}

.account-gate-note,
.account-privacy,
.account-message {
  margin: 0 24px 16px;
  color: var(--muted);
  font-size: 13px;
}

.account-gate-note,
.account-message {
  border-left: 3px solid var(--green);
  background: #f2f7f4;
  padding: 10px 12px;
  color: var(--ink);
}

.account-mode-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin: 0 24px 16px;
  padding: 4px;
  border-radius: 10px;
  background: var(--surface-2);
}

.account-mode-tabs button {
  min-height: 38px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-weight: 750;
}

.account-mode-tabs button.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(31, 39, 37, 0.12);
}

.account-form {
  display: grid;
  gap: 13px;
  padding: 0 24px 18px;
}

.account-form label,
.wordbook-toolbar label,
.wordbook-card label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.account-form input,
.dictionary-search input,
.wordbook-toolbar input,
.wordbook-toolbar select,
.wordbook-card input,
.wordbook-card textarea,
.wordbook-card select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 9px 11px;
}

.account-form .primary-button {
  min-height: 46px;
}

.account-profile-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 24px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  background: var(--surface-2);
}

.account-profile-card > div {
  display: grid;
  gap: 4px;
}

.account-profile-card span {
  color: var(--muted);
  font-size: 12px;
}

.account-status-pill {
  border-radius: 999px;
  background: #e5ece8;
  padding: 5px 9px;
  white-space: nowrap;
}

.account-profile-card.active .account-status-pill {
  background: #dff1e7;
  color: var(--green);
}

.account-details {
  margin: 0 24px 16px;
}

.account-details > div {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.account-details dt { color: var(--muted); }
.account-details dd { margin: 0; text-align: right; overflow-wrap: anywhere; }

.account-plan-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0 24px 18px;
}

.account-plan-grid span {
  display: grid;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px;
  color: var(--muted);
  font-size: 12px;
}

.account-plan-grid strong { color: var(--ink); }

.account-logout {
  width: calc(100% - 48px);
  min-height: 42px;
  margin: 0 24px 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
}

.dictionary-search {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 0 24px 18px;
}

.dictionary-search .primary-button { min-width: 88px; }
.dictionary-content { padding: 0 24px 24px; }

.dictionary-loading,
.dictionary-error {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  padding: 18px;
  color: var(--muted);
}

.dictionary-error { border-color: #e9caca; background: #fff6f5; color: var(--red); }

.dictionary-pronunciation,
.dictionary-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.dictionary-pronunciation span { color: var(--muted); font-family: Georgia, serif; font-size: 18px; }
.dictionary-pronunciation button,
.dictionary-actions button,
.wordbook-toolbar > button,
.wordbook-card button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  padding: 7px 10px;
  font-weight: 700;
}

.dictionary-translation {
  display: grid;
  gap: 5px;
  margin-bottom: 18px;
  border-left: 3px solid var(--green);
  background: #f1f7f3;
  padding: 12px 14px;
}

.dictionary-translation span,
.dictionary-provider { color: var(--muted); font-size: 12px; }
.dictionary-meaning { border-top: 1px solid var(--line); padding: 14px 0 4px; }
.dictionary-meaning > strong { color: var(--green); font-style: italic; }
.dictionary-meaning ol { display: grid; gap: 10px; margin: 10px 0; padding-left: 22px; }
.dictionary-meaning li span,
.dictionary-meaning li em { display: block; }
.dictionary-meaning li em { margin-top: 3px; color: var(--muted); font-size: 13px; }

.selection-lookup-popover {
  position: absolute;
  z-index: 1000;
}

.selection-lookup-popover button {
  min-height: 38px;
  border: 1px solid #214f3d;
  border-radius: 8px;
  background: #214f3d;
  color: #fff;
  padding: 7px 12px;
  box-shadow: 0 8px 22px rgba(31, 39, 37, 0.25);
  font-size: 13px;
  font-weight: 800;
}

.wordbook-page {
  width: min(1180px, 100%);
  margin: 0 auto;
}

.wordbook-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}

.wordbook-heading h1 { margin: 4px 0; font-size: clamp(28px, 4vw, 42px); }
.wordbook-heading p { margin: 0; color: var(--muted); }

.wordbook-toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) repeat(2, minmax(130px, auto)) auto;
  align-items: end;
  gap: 10px;
  padding: 18px 0;
}

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

.wordbook-card {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  padding: 18px;
}

.wordbook-card-heading,
.wordbook-meta,
.wordbook-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.wordbook-card h2 { margin: 0; font-family: Georgia, serif; font-size: 25px; }
.wordbook-card-heading span,
.wordbook-meta { color: var(--muted); font-size: 12px; }
.wordbook-definition { margin: 0; font-size: 15px; }
.definitions-hidden .wordbook-definition { filter: blur(7px); user-select: none; }
.wordbook-card textarea { resize: vertical; }
.wordbook-card .danger { color: var(--red); }

.writing-ai-button {
  display: inline-grid;
  gap: 1px;
  min-width: 116px;
  border-color: #ed9da7 !important;
  background: #ffdfe3 !important;
  color: #b53944 !important;
}

.writing-ai-button small { font-size: 10px; font-weight: 650; opacity: 0.8; }
.writing-ai-button:disabled { opacity: 0.52; cursor: not-allowed; }

.writing-ai-result {
  margin-top: 20px;
  border: 1px solid #bad2c6;
  border-radius: 14px;
  background: var(--surface);
  padding: 20px;
}

.writing-ai-result.is-stale { border-style: dashed; opacity: 0.88; }
.writing-ai-result-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.writing-ai-result-heading > div { display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; }
.writing-ai-result-heading > div:first-child { display: grid; gap: 2px; }
.writing-ai-result-heading span { color: var(--muted); font-size: 12px; }
.writing-ai-result-heading h3 { margin: 0; font-size: 21px; }
.writing-ai-result-heading h3 strong { color: var(--green); font-size: 34px; }
.writing-ai-stale { border-left: 3px solid var(--amber); background: #fff9e9; padding: 9px 11px; color: #6d531c; font-size: 13px; }

.writing-ai-criteria {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.writing-ai-criteria article { border: 1px solid var(--line); border-radius: 9px; padding: 12px; }
.writing-ai-criteria article > div { display: flex; justify-content: space-between; gap: 10px; }
.writing-ai-criteria b { color: var(--green); font-size: 20px; }
.writing-ai-criteria p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }

.writing-ai-feedback-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 18px; }
.writing-ai-feedback-grid h4,
.writing-ai-rewrite h4 { margin: 0 0 7px; }
.writing-ai-feedback-grid ul,
.writing-ai-feedback-grid ol { display: grid; gap: 6px; margin: 0; padding-left: 20px; }
.writing-ai-rewrite { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 15px; }
.writing-ai-rewrite p { margin: 0; }
.writing-ai-disclaimer { margin: 16px 0 0; color: var(--muted); font-size: 11px; }

.study-tools-dialog { padding-bottom: 12px; }
.study-tools-dialog > button:not(.dialog-close) {
  display: grid;
  gap: 3px;
  width: calc(100% - 32px);
  margin: 0 16px 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  padding: 13px 14px;
  text-align: left;
}
.study-tools-dialog > button span { color: var(--muted); font-size: 12px; }

@media (max-width: 760px) {
  .desktop-study-tool { display: none !important; }
  .mobile-study-tool { display: inline-flex; align-items: center; }
  .top-actions .mobile-study-tool { min-height: 38px; }
  .wordbook-heading { align-items: flex-start; }
  .wordbook-toolbar { grid-template-columns: 1fr 1fr; }
  .wordbook-toolbar label:first-child { grid-column: 1 / -1; }
  .wordbook-list { grid-template-columns: 1fr; }
  .writing-ai-criteria,
  .writing-ai-feedback-grid { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .account-dialog-heading,
  .dictionary-dialog-heading { padding: 18px 16px 12px; }
  .account-gate-note,
  .account-privacy,
  .account-message,
  .account-mode-tabs,
  .account-profile-card,
  .account-details,
  .account-plan-grid { margin-right: 16px; margin-left: 16px; }
  .account-form,
  .dictionary-search,
  .dictionary-content { padding-right: 16px; padding-left: 16px; }
  .account-plan-grid { grid-template-columns: 1fr; }
  .dictionary-search { grid-template-columns: 1fr; }
  .wordbook-heading { display: grid; }
  .wordbook-toolbar { grid-template-columns: 1fr; }
  .wordbook-toolbar label:first-child { grid-column: auto; }
  .wordbook-card-heading,
  .wordbook-meta { align-items: flex-start; }
  .writing-ai-result { padding: 15px; }
  .writing-ai-result-heading { display: grid; }
}

/* Speaking practice is isolated so it cannot change the existing question-bank views. */
body.speaking-available .module-tabs {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

body.speaking-active .shell {
  grid-template-columns: 360px minmax(0, 1fr);
}

body.speaking-active .module-tab[data-module-id="speaking"].active,
body.speaking-active .primary-button {
  border-color: var(--red);
  background: var(--red);
  color: #fff;
}

.speaking-view-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.speaking-view-tabs button {
  min-width: 0;
  padding: 7px 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.speaking-view-tabs button.active {
  border-color: var(--red);
  background: #fff3f2;
  color: #9e3434;
}

.speaking-mobile-item-nav {
  display: none;
}

.speaking-filter-panel {
  display: grid;
  gap: 10px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.speaking-filter-panel > label,
.speaking-filter-grid label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.speaking-filter-panel input,
.speaking-filter-panel select {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  padding: 7px 9px;
}

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

.speaking-filter-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.speaking-filter-summary button {
  min-height: 30px;
  padding: 0 9px;
  font-size: 12px;
}

.speaking-item-list {
  display: grid;
  gap: 8px;
  padding-top: 12px;
}

.speaking-item-row {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px;
  align-items: stretch;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.speaking-item-row:hover {
  border-color: #b7c2bb;
}

.speaking-item-row.active {
  border-color: var(--red);
  background: #fff7f6;
}

.speaking-item-open {
  min-width: 0;
  min-height: 0;
  display: grid;
  gap: 6px;
  padding: 11px;
  border: 0;
  border-radius: 0;
  background: transparent;
  text-align: left;
}

.speaking-item-open:hover {
  border-color: transparent;
}

.speaking-item-open strong,
.speaking-item-open small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.speaking-item-open strong {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
}

.speaking-item-open small {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.speaking-item-meta,
.speaking-item-kicker,
.speaking-source-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.speaking-item-meta span,
.speaking-item-kicker span,
.speaking-source-row span {
  border-radius: 4px;
  background: var(--surface-2);
  color: #4d5d55;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 650;
}

.speaking-favorite-button {
  width: 38px;
  min-width: 38px;
  min-height: 100%;
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: #7c8982;
  font-size: 18px;
}

.speaking-favorite-button.active,
.speaking-header-favorite.active {
  color: #a33d3d;
}

.speaking-sidebar-note,
.speaking-empty {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.speaking-dashboard {
  min-height: calc(100vh - 112px);
  display: grid;
  align-content: start;
  gap: 24px;
  padding: clamp(24px, 5vw, 56px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.speaking-dashboard header {
  max-width: 700px;
  padding-bottom: 20px;
  border-bottom: 3px solid var(--red);
}

.speaking-dashboard header p {
  margin: 0 0 7px;
  color: var(--red);
  font-size: 13px;
  font-weight: 700;
}

.speaking-dashboard h2 {
  margin: 0 0 8px;
  font-size: 30px;
  letter-spacing: 0;
}

.speaking-dashboard header span,
.speaking-dashboard-copy {
  color: var(--muted);
}

.speaking-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.speaking-stats > div {
  min-height: 108px;
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 16px;
  background: var(--surface);
}

.speaking-stats strong {
  font-size: 27px;
  font-variant-numeric: tabular-nums;
}

.speaking-stats span {
  color: var(--muted);
  font-size: 13px;
}

.speaking-view,
.speaking-records-view,
.speaking-resources-view {
  min-width: 0;
  display: grid;
  gap: 14px;
}

.speaking-item-header,
.speaking-records-view > header,
.speaking-resources-view > header {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.speaking-item-header > div {
  min-width: 0;
}

.speaking-item-header h2,
.speaking-records-view > header h2,
.speaking-resources-view > header h2 {
  margin: 7px 0;
  font-size: 21px;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.speaking-records-view > header p,
.speaking-resources-view > header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.speaking-header-favorite {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 11px;
}

.speaking-practice-grid {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.78fr);
  gap: 14px;
  align-items: stretch;
}

.speaking-prompt-panel,
.speaking-recorder-panel,
.speaking-reflection,
.speaking-analysis,
.speaking-reference-audio,
.speaking-saved-recordings,
.speaking-related {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.speaking-prompt-panel,
.speaking-recorder-panel {
  min-height: 360px;
}

.speaking-prompt-panel > h3,
.speaking-recorder-panel > h3,
.speaking-reflection > h3,
.speaking-analysis > h3,
.speaking-reference-audio > h3,
.speaking-saved-recordings > h3,
.speaking-related > h3 {
  margin: 0;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}

.speaking-question-text,
.speaking-cue-card {
  max-width: 72ch;
  padding: 24px;
  color: #26312d;
  font-family: "Times New Roman", Times, serif;
  font-size: 19px;
  line-height: 1.7;
}

.speaking-question-text > :first-child,
.speaking-cue-card > :first-child,
.speaking-rich-text > :first-child {
  margin-top: 0;
}

.speaking-question-text > :last-child,
.speaking-cue-card > :last-child,
.speaking-rich-text > :last-child {
  margin-bottom: 0;
}

.speaking-question-text ol,
.speaking-cue-card ul {
  padding-left: 24px;
}

.speaking-cue-card {
  margin: 18px;
  padding: 20px;
  border-radius: 7px;
  background: #f1f5f3;
}

.speaking-cue-card > p {
  margin-top: 0;
  font-weight: 700;
}

.speaking-cue-card > span {
  color: var(--muted);
  font-family: Inter, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  font-size: 13px;
  font-weight: 700;
}

.speaking-recorder-panel {
  display: grid;
  grid-template-rows: auto 1fr;
}

.speaking-recorder-body {
  min-width: 0;
  display: grid;
  align-content: center;
  justify-items: stretch;
  gap: 14px;
  padding: 24px;
  background: #f8faf8;
}

.speaking-practice-status,
.speaking-timing-note {
  display: grid;
  justify-items: center;
  gap: 4px;
  text-align: center;
}

.speaking-practice-status span,
.speaking-timing-note span,
.speaking-practice-status small {
  color: var(--muted);
  font-size: 12px;
}

.speaking-practice-status strong {
  color: #25312c;
  font-size: 34px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

.speaking-timing-note strong {
  font-size: 16px;
}

.speaking-primary-action,
.speaking-stop-action {
  min-height: 44px;
  border-color: var(--red);
  background: var(--red);
  color: #fff;
  padding: 0 18px;
  font-weight: 700;
}

.speaking-primary-action:hover,
.speaking-stop-action:hover {
  border-color: #9e3737;
  background: #9e3737;
}

.speaking-stop-action {
  background: #8f3030;
}

.speaking-warning,
.speaking-save-message,
.speaking-audio-pending {
  margin: 0;
  border-radius: 6px;
  background: #fff4e5;
  color: #77541f;
  padding: 9px 11px;
  font-size: 12px;
  line-height: 1.55;
}

.speaking-save-message {
  background: #edf7f1;
  color: #2c674d;
}

.speaking-transient-recording {
  min-width: 0;
  display: grid;
  gap: 10px;
}

.speaking-transient-recording audio,
.speaking-reference-audio audio,
.speaking-recording-row audio,
.speaking-record-card audio,
.speaking-resource-item audio {
  width: 100%;
  min-width: 0;
}

.speaking-transient-recording > div,
.speaking-related > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.speaking-transient-recording > div button {
  flex: 1 1 140px;
}

.speaking-reflection {
  display: grid;
  gap: 0;
}

.speaking-reflection > label {
  display: grid;
  gap: 6px;
  padding: 14px 16px 8px;
  color: #46544d;
  font-size: 13px;
  font-weight: 650;
}

.speaking-reflection textarea {
  width: 100%;
  min-width: 0;
  min-height: 104px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 11px;
  color: var(--ink);
  background: #fff;
  line-height: 1.6;
}

.speaking-assessment-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 8px 16px 12px;
}

.speaking-assessment-grid label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.speaking-assessment-grid select {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 6px 8px;
}

.speaking-reflection > p {
  margin: 0;
  padding: 0 16px 14px;
  color: var(--muted);
  font-size: 11px;
}

.speaking-locked-analysis {
  display: grid;
  gap: 3px;
  padding: 18px;
  border: 1px dashed #b8c4bd;
  border-radius: 8px;
  background: #f1f5f3;
  color: #34423b;
}

.speaking-locked-analysis span {
  color: var(--muted);
  font-size: 13px;
}

.speaking-analysis > section + section,
.speaking-recording-row + .speaking-recording-row,
.speaking-reference-audio > div + div {
  border-top: 1px solid var(--line);
}

.speaking-analysis > section {
  padding: 15px 17px;
}

.speaking-analysis h4 {
  margin: 0 0 8px;
  color: #37453e;
  font-size: 14px;
}

.speaking-rich-text {
  max-width: 75ch;
  color: #27332e;
  font-size: 15px;
  line-height: 1.72;
  overflow-wrap: anywhere;
}

.speaking-rich-text p {
  margin: 0 0 11px;
}

.speaking-rich-text ul,
.speaking-rich-text ol {
  padding-left: 22px;
}

.speaking-reference-audio > div {
  display: grid;
  grid-template-columns: minmax(120px, 0.35fr) minmax(220px, 1fr);
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
}

.speaking-reference-audio > div > span {
  color: #44534c;
  font-size: 13px;
  font-weight: 650;
}

.speaking-audio-pending {
  margin: 12px 16px;
}

.speaking-recording-row {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(130px, 0.4fr) minmax(240px, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
}

.speaking-recording-row > div,
.speaking-record-card > div:first-child {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.speaking-recording-row span,
.speaking-record-card span,
.speaking-record-card small,
.speaking-resource-item > div > span {
  color: var(--muted);
  font-size: 11px;
}

.speaking-related > div {
  padding: 13px 16px;
}

.speaking-related button {
  min-height: 34px;
  padding: 5px 10px;
  text-align: left;
}

.speaking-records-view,
.speaking-resources-view {
  max-width: 1100px;
  margin: 0 auto;
}

.speaking-record-card,
.speaking-resource-item {
  min-width: 0;
  display: grid;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.speaking-record-card {
  grid-template-columns: minmax(180px, 0.8fr) minmax(260px, 1fr) auto;
}

.speaking-record-card h3,
.speaking-resource-item h3 {
  margin: 2px 0;
  font-size: 15px;
  overflow-wrap: anywhere;
}

.speaking-record-card > div:last-child {
  display: flex;
  gap: 7px;
}

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

.speaking-resource-item {
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.8fr);
}

@media (max-width: 980px) {
  body.speaking-active .shell {
    grid-template-columns: 1fr;
  }

  body.speaking-active .sidebar {
    max-height: 440px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .speaking-practice-grid,
  .speaking-record-card,
  .speaking-resource-item {
    grid-template-columns: 1fr;
  }

  .speaking-prompt-panel,
  .speaking-recorder-panel {
    min-height: 0;
  }

  .speaking-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .speaking-recording-row {
    grid-template-columns: minmax(130px, 0.35fr) minmax(220px, 1fr) auto;
  }
}

@media (max-width: 620px) {
  body.speaking-available .module-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.speaking-active .sidebar {
    max-height: none;
  }

  body.speaking-active.speaking-item-open .speaking-mobile-item-nav {
    display: block;
    width: 100%;
    min-height: 48px;
  }

  body.speaking-active.speaking-item-open .speaking-filter-panel,
  body.speaking-active.speaking-item-open .speaking-item-list {
    display: none;
  }

  .speaking-view-tabs button,
  .speaking-filter-panel input,
  .speaking-filter-panel select,
  .speaking-filter-summary button,
  .speaking-item-open,
  .speaking-favorite-button,
  .speaking-header-favorite,
  .speaking-primary-action,
  .speaking-stop-action,
  .speaking-transient-recording button,
  .speaking-assessment-grid select,
  .speaking-related button,
  .speaking-recording-row button,
  .speaking-record-card button {
    min-height: 48px;
  }

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

  .speaking-item-row {
    grid-template-columns: minmax(0, 1fr) 48px;
  }

  .speaking-favorite-button {
    width: 48px;
    min-width: 48px;
  }

  .speaking-dashboard {
    min-height: 0;
    gap: 18px;
    padding: 22px 16px;
  }

  .speaking-dashboard h2 {
    font-size: 25px;
  }

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

  .speaking-stats > div {
    min-height: 86px;
    padding: 12px;
  }

  .speaking-item-header,
  .speaking-records-view > header,
  .speaking-resources-view > header {
    align-items: stretch;
    flex-direction: column;
    padding: 14px;
  }

  .speaking-item-header h2 {
    font-size: 18px;
  }

  .speaking-header-favorite {
    width: 100%;
  }

  .speaking-question-text,
  .speaking-cue-card {
    max-width: none;
    padding: 18px 15px;
    font-size: 18px;
  }

  .speaking-cue-card {
    margin: 12px;
  }

  .speaking-recorder-body {
    padding: 20px 14px;
  }

  .speaking-practice-status strong {
    font-size: 31px;
  }

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

  .speaking-reference-audio > div,
  .speaking-recording-row {
    grid-template-columns: 1fr;
  }

  .speaking-record-card,
  .speaking-resource-item {
    padding: 14px;
  }

  .speaking-record-card > div:last-child {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Exam scorecard */
.score-button {
  min-height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 6px;
  background: #fff;
  color: var(--atlas-blue);
  padding: 0 18px;
  font-weight: 750;
  white-space: nowrap;
}

.score-button:hover,
.score-button.active {
  border-color: #fff;
  background: #dfeaff;
  color: #132f67;
}

.scorecard-view {
  min-height: calc(100vh - 76px);
  padding: 26px;
  background: #edf2f8;
}

.scorecard-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 14px;
}

.scorecard-kicker {
  margin: 0 0 4px;
  color: var(--atlas-red);
  font-size: 13px;
  font-weight: 750;
}

.scorecard-header h2 {
  margin: 0;
  color: #172337;
  font-size: 24px;
}

.scorecard-band {
  display: grid;
  justify-items: center;
  min-width: 86px;
  border-radius: 8px;
  padding: 7px 12px 6px;
  background: #fff;
  color: #25324a;
}

.scorecard-band strong {
  font-size: 26px;
  line-height: 1;
}

.scorecard-band span {
  margin-top: 3px;
  color: #5a6a84;
  font-size: 12px;
  font-weight: 700;
}

.scorecard-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(130px, 168px));
  gap: 10px;
  margin-bottom: 12px;
}

.scorecard-metrics section {
  display: grid;
  gap: 4px;
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.scorecard-metrics span {
  color: #5a6a84;
  font-size: 13px;
  font-weight: 700;
}

.scorecard-metrics strong {
  color: #172337;
  font-size: 24px;
  line-height: 1;
}

.scorecard-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.scorecard-table-wrap {
  overflow: hidden;
  border-radius: 8px;
  background: #fff;
}

.scorecard-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.scorecard-table th,
.scorecard-table td {
  padding: 10px 8px;
  border-bottom: 1px solid #e4eaf2;
  text-align: left;
  vertical-align: middle;
}

.scorecard-table thead th {
  color: #5a6a84;
  font-size: 12px;
  white-space: nowrap;
}

.scorecard-table tbody tr:last-child > * { border-bottom: 0; }
.scorecard-table tbody tr.wrong { background: #fff6f6; }
.scorecard-table tbody tr.correct { background: #f2fbf5; }
.scorecard-table tbody th { color: #202a3b; font-weight: 750; }
.scorecard-table td { overflow-wrap: anywhere; }

.scorecard-status {
  display: inline-grid;
  width: 20px;
  height: 20px;
  place-items: center;
  color: #c82d39;
  font-size: 22px;
  line-height: 1;
}

.scorecard-table tr.correct .scorecard-status { color: #16824a; }

@media (max-width: 1080px) {
  .scorecard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .score-button { min-height: 38px; padding: 0 12px; }
  .scorecard-view { padding: 16px; }
  .scorecard-header h2 { font-size: 20px; }
  .scorecard-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .scorecard-metrics section { padding: 10px; }
  .scorecard-metrics strong { font-size: 21px; }
  .scorecard-grid { grid-template-columns: 1fr; }
}

/* Cobalt Atlas: homepage and library shell. Question content styles above remain untouched. */
:root {
  --atlas-blue: #123fbd;
  --atlas-blue-dark: #0b2d91;
  --atlas-blue-soft: #eaf0ff;
  --atlas-yellow: #ffd84d;
  --atlas-red: #e83f4d;
  --atlas-ink: #12213f;
  --atlas-muted: #52617b;
  --atlas-line: #cfd9ef;
  --atlas-surface: #ffffff;
  --focus: #ffcf33;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: 6px;
  background: #fff;
  color: var(--atlas-blue-dark);
  font-weight: 700;
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.topbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 28px;
  min-height: 76px;
  padding: 12px max(24px, calc((100vw - 1440px) / 2));
  border: 0;
  background: var(--atlas-blue);
  color: #fff;
  box-shadow: 0 4px 0 rgba(7, 30, 100, 0.22);
}

.brand-button,
.top-nav-home,
.module-tab {
  min-height: 44px;
  border: 0;
  background: transparent;
  color: inherit;
}

.brand-button {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 0;
  text-align: left;
}

.brand-button:hover,
.brand-button:active,
.top-nav-home:hover,
.module-tab:hover {
  border-color: transparent;
}

.brand-mark {
  white-space: nowrap;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-mark strong {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin-right: 4px;
  border-radius: 50%;
  background: var(--atlas-red);
  color: #fff;
  font-size: 21px;
}

.brand-subtitle {
  color: #cbd8ff;
  font-size: 12px;
  font-weight: 650;
}

.primary-navigation {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  gap: 2px;
}

.primary-navigation .module-tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 0;
}

.top-nav-home,
.primary-navigation .module-tab {
  position: relative;
  padding: 0 14px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #dbe4ff;
  font-size: 14px;
  font-weight: 700;
}

.top-nav-home:hover,
.primary-navigation .module-tab:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.top-nav-home.active,
.primary-navigation .module-tab.active {
  background: var(--atlas-yellow);
  color: #382d00;
}

.top-actions {
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.source-meta {
  margin: 0;
  color: #dbe4ff !important;
  font-size: 12px !important;
  white-space: nowrap;
}

.primary-button {
  min-height: 44px;
  border: 0;
  border-radius: 6px;
  background: var(--atlas-red);
  color: #fff;
  padding: 0 18px;
  font-weight: 750;
}

.primary-button:hover {
  border-color: transparent;
  background: #cf2f3d;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.shell {
  grid-template-columns: 310px minmax(0, 1fr);
  min-height: calc(100vh - 76px);
}

.sidebar {
  border-right: 1px solid var(--atlas-line);
  background: #f8faff;
  padding: 22px 18px;
}

.sidebar-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0 2px 16px;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--atlas-line);
}

.sidebar-heading strong {
  color: var(--atlas-ink);
  font-size: 16px;
}

.sidebar-heading span {
  color: var(--atlas-muted);
  font-size: 11px;
}

body.writing-active .sidebar-heading,
body.speaking-active .sidebar-heading {
  display: none;
}

.book-item {
  border-color: var(--atlas-line);
  border-radius: 10px;
  background: #fff;
  padding: 13px;
}

.book-item h3 {
  color: var(--atlas-ink);
}

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

.paper-chip {
  display: grid;
  gap: 2px;
  min-height: 50px;
  padding: 7px 8px;
  border-color: var(--atlas-line);
  border-radius: 6px;
  background: #f7f9ff;
  color: var(--atlas-ink);
}

.paper-chip:hover {
  border-color: var(--atlas-blue);
}

.paper-chip.active {
  border-color: var(--atlas-blue);
  background: var(--atlas-blue);
  color: #fff;
}

.paper-chip-status {
  font-size: 10px;
  font-weight: 700;
}

.paper-chip-status.not-started { color: #68748a; }
.paper-chip-status.in-progress { color: #9a6700; }
.paper-chip-status.completed { color: #18764d; }
.paper-chip.active .paper-chip-status { color: #fff; }

.workspace {
  background: #f3f6fd;
  padding: 24px;
}

body.home-active .shell,
body.atlas-library-active .shell {
  display: block;
  min-height: calc(100vh - 76px);
  background: var(--atlas-blue);
}

body.home-active .sidebar,
body.atlas-library-active .sidebar {
  display: none;
}

body.home-active .workspace,
body.atlas-library-active .workspace {
  min-height: calc(100vh - 76px);
  padding: 34px clamp(20px, 4vw, 64px) 44px;
  background: var(--atlas-blue);
}

.atlas-home,
.atlas-library {
  width: min(1240px, 100%);
  margin: 0 auto;
}

.atlas-home-intro {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.75fr);
  gap: 24px;
  align-items: stretch;
  margin-bottom: 24px;
}

.atlas-home-copy {
  align-self: center;
  padding: 18px 8px;
  color: #fff;
}

.atlas-home-copy p {
  margin: 0 0 12px;
  color: var(--atlas-yellow);
  font-size: 15px;
  font-weight: 750;
}

.atlas-home-copy h1 {
  max-width: 12ch;
  margin: 0;
  color: #fff;
  font-size: 52px;
  line-height: 1.08;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.atlas-home-copy > span {
  display: block;
  max-width: 58ch;
  margin-top: 16px;
  color: #d6e0ff;
  font-size: 15px;
}

.resume-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 190px;
  padding: 24px;
  border-radius: 14px;
  background: var(--atlas-blue-dark);
  color: #fff;
  box-shadow: 0 6px 0 rgba(6, 24, 80, 0.28);
}

.resume-panel > span {
  color: var(--atlas-yellow);
  font-size: 13px;
  font-weight: 750;
}

.resume-panel strong {
  margin-top: 7px;
  font-size: 21px;
}

.resume-panel p {
  margin: 8px 0 18px;
  color: #c9d6ff;
  font-size: 13px;
}

.resume-panel button {
  align-self: flex-start;
  min-height: 44px;
  border: 0;
  border-radius: 6px;
  background: var(--atlas-red);
  color: #fff;
  padding: 0 18px;
  font-weight: 750;
}

.resume-panel button:hover {
  border-color: transparent;
  background: #cf2f3d;
}

.module-bento {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
}

.home-module-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 226px;
  overflow: hidden;
  border: 0;
  border-radius: 14px;
  background: #fff;
  color: var(--atlas-ink);
  padding: 24px;
  text-align: left;
  box-shadow: 0 6px 0 rgba(6, 24, 80, 0.22);
  transition: transform 180ms ease-out, box-shadow 180ms ease-out;
}

.home-module-card:hover {
  border-color: transparent;
  transform: translateY(-3px);
  box-shadow: 0 8px 0 rgba(6, 24, 80, 0.28);
}

.home-module-card:active {
  transform: translateY(0);
  box-shadow: 0 4px 0 rgba(6, 24, 80, 0.28);
}

.home-module-card.module-listening { grid-column: span 5; }
.home-module-card.module-reading {
  grid-column: span 7;
  background: var(--atlas-yellow);
}
.home-module-card.module-writing { grid-column: span 7; }
.home-module-card.module-speaking {
  grid-column: span 5;
  background: #e9efff;
}

.module-card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--atlas-muted);
  font-size: 13px;
  font-weight: 700;
}

.module-card-topline strong {
  color: var(--atlas-blue);
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}

.module-reading .module-card-topline,
.module-reading .module-card-topline strong {
  color: #4a3b00;
}

.module-card-heading {
  margin-top: 20px;
  font-size: 36px;
  font-weight: 820;
  line-height: 1;
  letter-spacing: -0.03em;
}

.module-card-description {
  margin-top: 12px;
  color: var(--atlas-muted);
  font-size: 14px;
}

.module-reading .module-card-description {
  color: #5b4a0a;
}

.module-card-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-top: auto;
  padding-top: 24px;
}

.module-progress-copy {
  color: var(--atlas-muted);
  font-size: 12px;
}

.module-reading .module-progress-copy {
  color: #5b4a0a;
}

.module-card-action {
  color: var(--atlas-red);
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}

.module-card-action b,
.test-card-action b {
  font-size: 18px;
  font-weight: 500;
}

.module-progress-track {
  position: absolute;
  right: 24px;
  bottom: 16px;
  left: 24px;
  height: 4px;
  overflow: hidden;
  border-radius: 4px;
  background: rgba(18, 63, 189, 0.12);
}

.module-progress-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--atlas-red);
}

.home-status-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 18px;
  margin-top: 20px;
  color: #dbe4ff;
  font-size: 12px;
}

.home-status-legend span,
.progress-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.status-dot,
.progress-badge i {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #8793a9;
}

.status-dot.in-progress,
.progress-badge.in-progress i { background: #d89200; }
.status-dot.completed,
.progress-badge.completed i { background: #168658; }

.atlas-library {
  color: #fff;
}

.library-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 22px;
}

.library-back {
  min-height: 44px;
  margin: 0 0 12px -12px;
  border: 0;
  background: transparent;
  color: #dbe4ff;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 700;
}

.library-back:hover {
  border-color: transparent;
  color: #fff;
}

.library-hero h1 {
  margin: 0;
  color: #fff;
  font-size: 40px;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.atlas-library-reading .library-hero h1 {
  color: var(--atlas-yellow);
}

.library-hero p {
  margin: 10px 0 0;
  color: #d7e1ff;
  font-size: 14px;
}

.library-summary {
  display: flex;
  align-items: stretch;
  gap: 1px;
  overflow: hidden;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.2);
}

.library-summary span {
  display: grid;
  min-width: 92px;
  padding: 13px 16px;
  background: var(--atlas-blue-dark);
  color: #cbd8ff;
  font-size: 11px;
}

.library-summary strong {
  color: #fff;
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}

.question-type-strip {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 18px 20px;
  border-radius: 12px;
  background: var(--atlas-yellow);
  color: #342a00;
}

.question-type-strip h2,
.question-type-strip p {
  margin: 0;
}

.question-type-strip h2 {
  font-size: 16px;
}

.question-type-strip p {
  margin-top: 2px;
  color: #685500;
  font-size: 11px;
}

.question-type-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.question-type-list span {
  padding: 7px 11px;
  border: 1px solid rgba(70, 55, 0, 0.35);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.35);
  font-size: 12px;
  font-weight: 700;
}

.library-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 170px 170px auto;
  gap: 12px;
  align-items: end;
  margin-top: 14px;
  padding: 18px;
  border-radius: 12px;
  background: #fff;
  color: var(--atlas-ink);
}

.library-toolbar label {
  display: grid;
  gap: 6px;
  color: var(--atlas-muted);
  font-size: 12px;
  font-weight: 700;
}

.library-toolbar input,
.library-toolbar select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--atlas-line);
  border-radius: 6px;
  background: #f8faff;
  color: var(--atlas-ink);
  padding: 0 12px;
  font-size: 14px;
}

.library-toolbar input::placeholder {
  color: #66748d;
}

.library-reset {
  min-height: 44px;
  border: 1px solid var(--atlas-line);
  border-radius: 6px;
  background: #fff;
  color: var(--atlas-blue);
  padding: 0 15px;
  font-size: 13px;
  font-weight: 750;
}

.library-reset:hover {
  border-color: var(--atlas-blue);
  background: var(--atlas-blue-soft);
}

.library-result-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  margin: 26px 2px 12px;
}

.library-result-heading h2 {
  margin: 0;
  font-size: 20px;
}

.library-result-heading span {
  color: #d4dfff;
  font-size: 12px;
}

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

.test-card {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 12px;
  min-height: 158px;
  border: 2px solid transparent;
  border-radius: 12px;
  background: #fff;
  color: var(--atlas-ink);
  padding: 20px;
  text-align: left;
  transition: border-color 160ms ease-out, transform 160ms ease-out;
}

.test-card:hover {
  border-color: var(--atlas-yellow);
  transform: translateY(-2px);
}

.test-card:active {
  transform: translateY(0);
}

.test-card-topline {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--atlas-blue);
  font-size: 12px;
  font-weight: 750;
}

.progress-badge {
  color: #68748a;
  font-size: 11px;
  font-weight: 700;
}

.progress-badge.in-progress { color: #895d00; }
.progress-badge.completed { color: #146c47; }

.test-card > strong {
  align-self: start;
  font-size: 27px;
  line-height: 1;
}

.test-card-meta {
  grid-column: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--atlas-muted);
  font-size: 12px;
}

.test-card-meta span + span::before {
  content: '·';
  margin-right: 8px;
}

.test-card-action {
  grid-column: 2;
  grid-row: 3;
  color: var(--atlas-red);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.library-empty {
  grid-column: 1 / -1;
  display: grid;
  place-items: center;
  min-height: 210px;
  border: 2px dashed rgba(255, 255, 255, 0.5);
  border-radius: 12px;
  color: #fff;
  text-align: center;
}

.library-empty span {
  color: #d5e0ff;
  font-size: 13px;
}

.paper-header,
.content-panel,
.result-panel {
  border-color: var(--atlas-line);
}

.paper-header {
  border-radius: 10px;
}

.segmented button.active {
  border-color: var(--atlas-blue);
  background: var(--atlas-blue);
  color: #fff;
}

body.writing-active .primary-navigation .module-tab.active,
body.speaking-active .primary-navigation .module-tab.active {
  border: 0;
  background: var(--atlas-yellow);
  color: #382d00;
}

body.library-active.writing-active .workspace,
body.library-active.speaking-active .workspace {
  padding: 30px;
  background: var(--atlas-blue);
}

body.library-active .writing-dashboard,
body.library-active .speaking-dashboard {
  min-height: 520px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border: 0;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 6px 0 rgba(6, 24, 80, 0.24);
}

body.library-active .writing-dashboard {
  padding: clamp(30px, 6vw, 72px);
}

body.library-active .speaking-dashboard {
  padding: clamp(28px, 5vw, 64px);
}

body.library-active .writing-dashboard-header p,
body.library-active .speaking-dashboard header p {
  color: var(--atlas-red);
}

body.library-active .writing-dashboard h2,
body.library-active .speaking-dashboard h2 {
  color: var(--atlas-ink);
  font-size: 38px;
  letter-spacing: -0.03em;
}

body.library-active .writing-stats,
body.library-active .speaking-stats {
  border-color: var(--atlas-line);
}

body.library-active .writing-stats > div,
body.library-active .speaking-stats > div {
  background: #f8faff;
}

@media (max-width: 1080px) {
  .topbar {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px 20px;
  }

  .primary-navigation {
    justify-content: flex-end;
  }

  .top-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }

  .source-meta {
    display: none;
  }

  .atlas-home-intro {
    grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
  }

  .library-toolbar {
    grid-template-columns: minmax(240px, 1fr) repeat(2, 150px);
  }

  .library-reset {
    grid-column: 1 / -1;
    justify-self: end;
  }
}

@media (max-width: 820px) {
  .topbar {
    position: static;
    grid-template-columns: 1fr;
    padding: 12px 16px;
  }

  .brand-button {
    justify-self: center;
  }

  .primary-navigation {
    justify-content: center;
    flex-wrap: wrap;
  }

  .top-actions {
    grid-column: auto;
    justify-content: center;
  }

  .top-actions:has(.primary-button[hidden]) {
    display: none;
  }

  .shell,
  body.speaking-active .shell,
  body.writing-active .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--atlas-line);
  }

  body.home-active .workspace,
  body.atlas-library-active .workspace {
    min-height: calc(100vh - 132px);
    padding: 26px 18px 36px;
  }

  .atlas-home-intro {
    grid-template-columns: 1fr;
  }

  .atlas-home-copy h1 {
    font-size: 42px;
  }

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

  .home-module-card.module-listening,
  .home-module-card.module-reading,
  .home-module-card.module-writing,
  .home-module-card.module-speaking {
    grid-column: span 1;
  }

  .library-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .question-type-strip {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .library-toolbar {
    grid-template-columns: 1fr 1fr;
  }

  .library-search {
    grid-column: 1 / -1;
  }

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

@media (max-width: 560px) {
  .brand-subtitle {
    display: none;
  }

  .top-nav-home,
  .primary-navigation .module-tab {
    min-height: 42px;
    padding: 0 10px;
    font-size: 13px;
  }

  .atlas-home-copy {
    padding: 6px 2px;
  }

  .atlas-home-copy h1 {
    max-width: none;
    font-size: 36px;
  }

  .resume-panel {
    min-height: 0;
    padding: 20px;
  }

  .module-bento {
    grid-template-columns: 1fr;
  }

  .home-module-card {
    min-height: 206px;
    padding: 20px;
  }

  .module-card-heading {
    font-size: 31px;
  }

  .module-card-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

  .module-progress-track {
    right: 20px;
    left: 20px;
  }

  .home-status-legend {
    justify-content: flex-start;
  }

  .library-hero h1 {
    font-size: 34px;
  }

  .library-summary {
    width: 100%;
  }

  .library-summary span {
    flex: 1;
    min-width: 0;
    padding: 11px;
  }

  .library-toolbar {
    grid-template-columns: 1fr;
  }

  .library-search,
  .library-reset {
    grid-column: auto;
  }

  .library-reset {
    justify-self: stretch;
  }

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

  .test-card-action {
    grid-column: 1;
    grid-row: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

button {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  min-height: 36px;
}

button:hover {
  border-color: #aeb9b3;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0;
}

.topbar p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.top-actions {
  display: flex;
  gap: 10px;
}

.primary-button {
  background: var(--green);
  color: white;
  border-color: var(--green);
  padding: 0 16px;
}

.ghost-button {
  padding: 0 14px;
}

.shell {
  display: grid;
  grid-template-columns: 300px 1fr;
  min-height: calc(100vh - 74px);
}

.sidebar {
  border-right: 1px solid var(--line);
  background: #fbfcfa;
  padding: 16px;
  overflow-y: auto;
}

.module-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.module-tab {
  padding: 8px 10px;
  background: var(--surface);
}

.module-tab.active {
  background: var(--blue);
  color: white;
  border-color: var(--blue);
}

.book-list {
  display: grid;
  gap: 10px;
}

.book-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px;
}

.book-item h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.paper-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.paper-chip {
  min-height: 32px;
  font-size: 13px;
}

.paper-chip.active {
  background: var(--green);
  color: white;
  border-color: var(--green);
}

.workspace {
  min-width: 0;
  padding: 18px;
}

.dashboard {
  display: grid;
  gap: 16px;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.stat strong {
  display: block;
  font-size: 26px;
}

.stat span {
  color: var(--muted);
  font-size: 13px;
}

.paper-view {
  display: grid;
  gap: 14px;
}

.paper-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.paper-header h2 {
  margin: 0;
  font-size: 20px;
}

.paper-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.segmented button {
  padding: 0 12px;
}

.segmented button.active {
  background: var(--blue);
  color: white;
  border-color: var(--blue);
}

.practice-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.practice-layout.listening-submitted-layout {
  grid-template-columns: minmax(0, 1.18fr) minmax(360px, 0.82fr);
  min-height: calc(100vh - 180px);
}

.listening-review-rail {
  min-width: 0;
  position: sticky;
  top: 92px;
  max-height: calc(100vh - 110px);
}

.listening-review-stack {
  display: grid;
  grid-template-rows: minmax(220px, 0.9fr) minmax(260px, 1.1fr);
  gap: 14px;
  height: calc(100vh - 110px);
  min-height: 620px;
}

.content-panel,
.result-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.content-panel {
  min-width: 0;
  overflow: hidden;
}

.audio-strip {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}

.audio-strip audio {
  width: 100%;
  display: block;
}

.reading-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  min-height: 640px;
}

.reading-column:first-child {
  border-right: 1px solid var(--line);
}

.reading-column h3,
.result-panel h3 {
  margin: 0;
  padding: 12px 14px;
  font-size: 15px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}

.markdown-body {
  padding: 16px;
  overflow: auto;
  max-height: calc(100vh - 230px);
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3 {
  line-height: 1.25;
  margin: 18px 0 10px;
}

.markdown-body h1 {
  font-size: 22px;
}

.markdown-body h2 {
  font-size: 18px;
}

.markdown-body h3 {
  font-size: 16px;
}

.markdown-body p {
  margin: 0 0 12px;
}

.markdown-body .module-heading {
  font-size: 17px;
  font-weight: 700;
  margin: 0 0 12px;
  letter-spacing: 0;
}

.markdown-body .listening-module-heading .module-question-range {
  font-style: italic;
}

.markdown-body .question-range-heading {
  font-size: 15px;
  font-weight: 700;
  margin: 14px 0 8px;
}

.markdown-body .listening-question-range-heading {
  font-style: italic;
}

.markdown-body .content-title {
  font-size: 16px;
  font-weight: 700;
  margin: 12px 0 8px;
}

.markdown-body .content-subheading {
  font-size: 14px;
  font-weight: 400;
  margin: 8px 0 6px;
}

.markdown-body .list-heading {
  font-size: 14px;
  font-weight: 700;
  margin: 8px 0 6px;
}

.markdown-body .numbered-heading {
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  margin: 8px 0 6px;
}

.markdown-body .numbered-heading .choice-question-number {
  font-weight: 700;
}

.numbered-fill-list {
  display: grid;
  gap: 8px;
  margin: 8px 0 14px;
}

.numbered-fill-item {
  margin: 0;
  line-height: 1.55;
}

.cloze-summary-block {
  margin: 8px 0 12px;
}

.cloze-summary-line {
  margin: 0 0 7px;
  line-height: 1.6;
}

.markdown-body .task-instruction {
  font-size: 14px;
  font-weight: 400;
  font-style: italic;
  margin: 0 0 8px;
}

.markdown-body .source-heading {
  font-weight: 700;
}

.passage-standfirst {
  color: #3d4641;
  font-weight: 600;
  line-height: 1.55;
  margin: 0 0 14px;
}

.passage-translation {
  margin: 9px 0 14px;
  padding: 9px 0 0;
  border-top: 1px solid #d1dcd5;
  color: #365348;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.lettered-text .passage-translation {
  margin-bottom: 0;
}

.markdown-body strong {
  font-weight: 700;
}

.markdown-body em {
  font-style: italic;
}

.markdown-body code {
  padding: 1px 4px;
  border-radius: 4px;
  background: var(--surface-2);
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 0.95em;
}

.lettered-paragraph {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  column-gap: 12px;
  align-items: start;
  margin: 0 0 14px;
}

.lettered-label {
  font-weight: 700;
  line-height: 1.65;
  text-align: center;
}

.lettered-text {
  line-height: 1.65;
  min-width: 0;
}

.markdown-body img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 12px auto;
  border: 1px solid var(--line);
}

.visual-answer-block {
  margin: 12px 0 18px;
}

.visual-flow-chart {
  display: grid;
  justify-items: center;
  gap: 6px;
}

.visual-diagram-stack {
  display: grid;
  justify-items: center;
  gap: 8px;
}

.visual-side-diagram {
  display: grid;
  grid-template-columns: minmax(160px, 42%) minmax(160px, 1fr);
  align-items: stretch;
  gap: 18px;
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

.visual-side-image,
.visual-answer-image {
  min-width: 0;
}

.visual-side-image .visual-answer-image,
.visual-answer-image img {
  margin: 0 auto;
}

.visual-side-image .visual-answer-image img {
  width: auto;
  max-height: 560px;
}

.visual-side-labels {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 0;
}

.visual-answer-title,
.visual-answer-line {
  width: 100%;
  margin: 0;
  line-height: 1.5;
}

.visual-answer-title {
  font-weight: 700;
  text-align: center;
}

.visual-flow-chart .visual-answer-line,
.visual-diagram-stack .visual-answer-line {
  text-align: center;
}

.visual-side-labels .visual-answer-line {
  text-align: left;
}

.visual-answer-line .inline-answer-wrap {
  vertical-align: middle;
}

.markdown-body table {
  width: fit-content;
  min-width: min(560px, calc(100% - 20px));
  max-width: calc(100% - 20px);
  table-layout: auto;
  border-collapse: collapse;
  margin: 12px 0 16px 20px;
  font-size: 14px;
}

.markdown-body td,
.markdown-body th {
  border: 1px solid #aeb9b3;
  padding: 6px 8px;
  line-height: 1.45;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.markdown-body th,
.markdown-body td[colspan] {
  font-weight: 700;
  text-align: center;
}

.markdown-body table tr:first-child > td {
  font-weight: 700;
  text-align: center;
}

.markdown-body table.visual-whale-picture-grid {
  width: min(780px, calc(100% - 20px));
  min-width: 0;
  max-width: 780px;
  table-layout: fixed;
  border: 0;
  border-collapse: separate;
  border-spacing: 24px 16px;
  margin: 16px 0 22px 12px;
  background: transparent;
  font-family: "Times New Roman", Times, serif;
}

.markdown-body table.visual-whale-picture-grid td,
.markdown-body table.visual-whale-picture-grid tr:first-child > td {
  width: 50%;
  height: 176px;
  border: 0;
  padding: 0;
  background: transparent;
  text-align: left;
  vertical-align: middle;
  font-weight: 400;
  overflow-wrap: normal;
}

.markdown-body table.visual-whale-picture-grid .whale-picture-entry {
  display: flex;
  min-width: 0;
  height: 100%;
  align-items: center;
  justify-content: center;
}

.markdown-body table.visual-whale-picture-grid .whale-picture-label {
  flex: 0 0 22px;
  margin-right: 5px;
  color: #202724;
  font-size: 20px;
  line-height: 1;
  font-weight: 700;
  text-align: center;
}

.markdown-body table.visual-whale-picture-grid img {
  display: block;
  width: auto;
  max-width: calc(100% - 27px);
  max-height: 174px;
  margin: 0;
  border: 0;
  object-fit: contain;
}

.markdown-body table.visual-whale-picture-grid .whale-picture-a img,
.markdown-body table.visual-whale-picture-grid .whale-picture-c img {
  max-width: 100%;
}

@media (max-width: 620px) {
  .markdown-body table.visual-whale-picture-grid {
    width: 100%;
    max-width: 100%;
    border-spacing: 8px 10px;
    margin: 12px 0 18px;
  }

  .markdown-body table.visual-whale-picture-grid td,
  .markdown-body table.visual-whale-picture-grid tr:first-child > td {
    height: 116px;
  }

  .markdown-body table.visual-whale-picture-grid .whale-picture-label {
    flex-basis: 16px;
    margin-right: 2px;
    font-size: 16px;
  }

  .markdown-body table.visual-whale-picture-grid img {
    max-width: calc(100% - 18px);
    max-height: 112px;
  }

  .markdown-body table.visual-whale-picture-grid .whale-picture-a img,
  .markdown-body table.visual-whale-picture-grid .whale-picture-c img {
    max-width: 100%;
  }
}

.markdown-body table.damaged-fridge-note {
  width: fit-content;
  min-width: min(560px, calc(100% - 20px));
  max-width: calc(100% - 20px);
  margin: 8px 0 16px 28px;
  border: 1px solid #6f7772;
  border-collapse: collapse;
  table-layout: auto;
  font-family: "Times New Roman", Times, serif;
  font-size: 16px;
  line-height: 1.32;
}

.markdown-body table.damaged-fridge-note td,
.markdown-body table.damaged-fridge-note tr:first-child > td {
  border: 0;
  padding: 2px 5px;
  background: transparent;
  text-align: left;
  vertical-align: baseline;
  font-weight: 400;
  overflow-wrap: normal;
  word-break: normal;
}

.markdown-body table.damaged-fridge-note .damaged-fridge-title,
.markdown-body table.damaged-fridge-note tr:first-child > td.damaged-fridge-title {
  padding: 0 0 26px;
  text-align: center;
  font-size: 20px;
  font-weight: 700;
  font-style: italic;
}

.markdown-body table.damaged-fridge-note .damaged-fridge-marker {
  width: 18px;
  padding-right: 4px;
  text-align: center;
}

.markdown-body table.damaged-fridge-note .damaged-fridge-label {
  width: 190px;
  white-space: nowrap;
}

.markdown-body table.damaged-fridge-note .damaged-fridge-value,
.markdown-body table.damaged-fridge-note .damaged-fridge-wide {
  white-space: nowrap;
}

.markdown-body table.damaged-fridge-note .damaged-fridge-section {
  padding-top: 14px;
  padding-bottom: 5px;
  font-weight: 700;
}

.markdown-body table.damaged-fridge-note .inline-answer-wrap {
  width: 116px;
  max-width: 116px;
  margin: 0 4px;
  vertical-align: middle;
}

.markdown-body table.damaged-fridge-note .inline-answer {
  min-height: 26px;
  padding: 3px 7px;
  font-family: Inter, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  font-size: 14px;
}

.markdown-body table.suv-note-frame {
  width: fit-content;
  min-width: min(620px, calc(100% - 20px));
  max-width: calc(100% - 20px);
  margin: 6px 0 16px;
  border: 1px solid #6f7772;
  border-collapse: collapse;
  table-layout: auto;
  font-size: 14px;
  line-height: 1.45;
}

.markdown-body table.suv-note-frame td,
.markdown-body table.suv-note-frame tr:first-child > td {
  border: 0;
  padding: 3px 6px;
  background: transparent;
  text-align: left;
  vertical-align: baseline;
  font-weight: 400;
  overflow-wrap: normal;
  word-break: normal;
}

.markdown-body table.suv-note-frame .suv-note-title,
.markdown-body table.suv-note-frame tr:first-child > td.suv-note-title {
  padding: 8px 6px 9px;
  font-weight: 700;
}

.markdown-body table.suv-note-frame .suv-note-section {
  padding-top: 10px;
  padding-bottom: 2px;
  font-weight: 700;
}

.markdown-body table.suv-note-frame .suv-note-marker {
  width: 18px;
  padding-right: 2px;
  text-align: center;
}

.markdown-body table.suv-note-frame .inline-answer-wrap {
  width: 116px;
  max-width: 116px;
  margin: 0 4px;
  vertical-align: middle;
}

.markdown-body table.suv-note-frame .inline-answer {
  min-height: 28px;
  padding: 4px 7px;
  font-size: 14px;
}

.markdown-body table.recommendations-note-frame {
  width: fit-content;
  min-width: min(620px, calc(100% - 20px));
  max-width: calc(100% - 20px);
  margin: 6px 0 16px;
  border: 1px solid #4f5752;
  border-collapse: collapse;
  table-layout: auto;
  font-family: "Times New Roman", Times, serif;
  font-size: 16px;
  line-height: 1.38;
}

.markdown-body table.recommendations-note-frame td,
.markdown-body table.recommendations-note-frame tr:first-child > td {
  border: 0;
  padding: 3px 8px;
  background: transparent;
  text-align: left;
  vertical-align: baseline;
  font-weight: 400;
  overflow-wrap: normal;
  word-break: normal;
}

.markdown-body table.recommendations-note-frame .recommendations-title,
.markdown-body table.recommendations-note-frame tr:first-child > td.recommendations-title {
  padding: 10px 8px 12px;
  text-align: center;
  font-size: 18px;
  font-weight: 700;
}

.markdown-body table.recommendations-note-frame .recommendations-marker {
  width: 18px;
  padding-right: 2px;
  text-align: center;
}

.markdown-body table.recommendations-note-frame .inline-answer-wrap {
  width: 116px;
  max-width: 116px;
  margin: 0 4px;
  vertical-align: middle;
}

.markdown-body table.recommendations-note-frame .inline-answer {
  min-height: 28px;
  padding: 4px 7px;
  font-family: Inter, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  font-size: 14px;
}

.markdown-body table.example-row-table tr:first-child > td {
  font-weight: 400;
  text-align: left;
}

.markdown-body table.example-answer-table {
  width: fit-content;
  max-width: min(calc(100% - 20px), 760px);
  table-layout: auto;
}

.markdown-body table.example-answer-table td {
  min-width: 96px;
}

.markdown-body table.example-answer-table.example-row-table {
  min-width: min(420px, calc(100% - 20px));
  border: 1px solid #6f7772;
}

.markdown-body table.example-answer-table.example-row-table td {
  border: 0;
  padding: 10px 18px;
  line-height: 1.35;
}

.markdown-body table.heading-example-answer-table,
.markdown-body table.heading-example-answer-table.example-row-table {
  min-width: 0;
  width: fit-content;
  max-width: min(calc(100% - 20px), 680px);
  margin: 10px 0 16px 20px;
  border: 0;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: auto;
}

.markdown-body table.heading-example-answer-table td,
.markdown-body table.heading-example-answer-table tr:first-child > td {
  border: 0;
  padding: 5px 12px;
  background: transparent;
  text-align: left;
  vertical-align: middle;
  font-weight: 400;
  overflow-wrap: normal;
  word-break: normal;
}

.markdown-body table.heading-example-answer-table .heading-example-box-cell {
  min-width: 120px;
  padding: 6px 22px;
  text-align: center;
  font-weight: 400;
  border-width: 0;
  border-style: solid;
  border-color: #5f6a64;
}

.markdown-body table.heading-example-answer-table .heading-example-box-top {
  border-top-width: 1px;
}

.markdown-body table.heading-example-answer-table .heading-example-box-bottom {
  border-bottom-width: 1px;
}

.markdown-body table.heading-example-answer-table .heading-example-box-left {
  border-left-width: 1px;
}

.markdown-body table.heading-example-answer-table .heading-example-box-right {
  border-right-width: 1px;
}

.markdown-body table.heading-example-answer-table .heading-example-label-row .heading-example-box-cell,
.markdown-body table.heading-example-answer-table .heading-example-combined-row .heading-example-box-cell {
  font-style: italic;
}

.markdown-body table.heading-example-answer-table .heading-example-answer-row .heading-example-box-cell:last-child,
.markdown-body table.heading-example-answer-table .heading-example-combined-row .heading-example-box-cell:last-child {
  font-weight: 700;
}

.markdown-body table.heading-example-answer-table .heading-example-gutter-cell {
  width: 46px;
  min-width: 46px;
  padding: 0;
}

.markdown-body table.heading-example-answer-table .heading-example-question-number-cell {
  min-width: 28px;
  padding-left: 2px;
  padding-right: 12px;
  font-weight: 700;
}

.markdown-body table.heading-example-answer-table .heading-example-question-text-cell {
  min-width: 160px;
  padding-right: 24px;
}

.markdown-body table.heading-example-answer-table .heading-example-question-answer-cell,
.markdown-body table.heading-example-answer-table .table-answer-cell {
  min-width: 112px;
  text-align: center;
}

.markdown-body table.heading-example-answer-table .inline-answer-wrap {
  width: 96px;
  max-width: 96px;
}

.markdown-body .heading-example-frame-shell {
  display: inline-block;
  max-width: min(calc(100% - 20px), 680px);
  margin: 10px 0 10px 20px;
  border: 1px solid #4c5650 !important;
  outline: 1px solid #4c5650;
  outline-offset: -1px;
  vertical-align: top;
}

.markdown-body table.heading-example-frame {
  min-width: 0;
  width: fit-content;
  max-width: min(calc(100% - 20px), 680px);
  margin: 0;
  border: 0 !important;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: auto;
  background: transparent;
}

.markdown-body table.heading-example-frame td,
.markdown-body table.heading-example-frame tr:first-child > td,
.markdown-body table.heading-example-frame .heading-example-box-cell {
  min-width: 120px;
  padding: 6px 22px;
  border: 0 !important;
  background: transparent;
  text-align: center;
  vertical-align: middle;
}

.markdown-body .heading-example-question-list {
  display: grid;
  width: min(100%, 360px);
  margin: 0 0 12px 20px;
  gap: 8px;
}

.markdown-body .heading-example-question-entry {
  display: grid;
  grid-template-columns: minmax(128px, max-content) 112px;
  gap: 12px;
  align-items: center;
  min-height: 32px;
}

.markdown-body .heading-example-question-prompt {
  font-weight: 400;
}

.markdown-body .heading-example-question-answer {
  min-width: 0;
  text-align: center;
}

.markdown-body .heading-example-question-answer .inline-answer-wrap {
  width: 96px;
  max-width: 96px;
}

.example-underlined {
  border-bottom: 2px dotted #8b8f8d;
}

.markdown-body table.note-example-table {
  min-width: min(560px, calc(100% - 20px));
  max-width: min(calc(100% - 20px), 760px);
  border: 0;
}

.markdown-body table.note-example-table td {
  border: 0;
  min-width: 0;
  padding: 13px 18px 8px;
  vertical-align: middle;
}

.markdown-body table.note-example-table tr:first-child > td {
  border-top: 1px solid #6f7772;
  border-bottom: 1px solid #6f7772;
  padding-top: 10px;
  padding-bottom: 10px;
  font-weight: 400;
  text-align: left;
}

.markdown-body table.note-example-table tr:first-child > td:first-child {
  border-left: 1px solid #6f7772;
}

.markdown-body table.note-example-table tr:first-child > td:last-child {
  border-right: 1px solid #6f7772;
}

.markdown-body table.note-example-table td:first-child {
  width: 42%;
}

.markdown-body table.note-island-table {
  width: min(620px, calc(100% - 20px));
  max-width: min(calc(100% - 20px), 700px);
  margin: 4px 0 18px 26px;
  border: 0;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: auto;
}

.markdown-body table.note-island-table td,
.markdown-body table.note-island-table tr:first-child > td {
  border: 0;
  padding: 3px 16px;
  line-height: 1.45;
  text-align: left;
  vertical-align: top;
  font-weight: 400;
  overflow-wrap: normal;
  word-break: normal;
}

.markdown-body table.note-island-table .note-island-title,
.markdown-body table.note-island-table tr:first-child > td.note-island-title {
  padding: 4px 16px 12px;
  text-align: center;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0;
}

.markdown-body table.note-island-table tr.note-island-example > td {
  border-top: 1px solid #6f7772;
  border-bottom: 1px solid #6f7772;
  padding-top: 9px;
  padding-bottom: 9px;
}

.markdown-body table.note-island-table tr.note-island-example > td:first-child {
  width: 52%;
  border-left: 1px solid #6f7772;
  padding-left: 28px;
}

.markdown-body table.note-island-table tr.note-island-example > td:last-child {
  border-right: 1px solid #6f7772;
}

.markdown-body table.note-island-table .note-island-section {
  padding-top: 16px;
  padding-left: 28px;
  font-weight: 700;
}

.markdown-body table.note-island-table tr:not(.note-island-example) td[colspan]:not(.note-island-title):not(.note-island-section) {
  padding-left: 48px;
  white-space: nowrap;
}

.markdown-body table.note-island-table .inline-answer-wrap {
  width: 86px;
  max-width: 86px;
  margin-top: 1px;
  margin-bottom: 1px;
}

.markdown-body table.note-fields-table {
  min-width: min(560px, calc(100% - 20px));
  max-width: min(calc(100% - 20px), 700px);
  margin: 22px 0 18px 38px;
  border: 0;
  border-collapse: separate;
  border-spacing: 0 18px;
  table-layout: auto;
}

.markdown-body table.note-fields-table td,
.markdown-body table.note-fields-table tr:first-child > td {
  border: 0;
  padding: 0 18px 0 0;
  line-height: 1.5;
  text-align: left;
  vertical-align: middle;
  font-weight: 400;
}

.markdown-body table.note-fields-table td:first-child {
  width: 42%;
  min-width: 220px;
  font-weight: 700;
}

.markdown-body table.note-fields-table td:last-child {
  min-width: 260px;
}

.markdown-body table.note-frame-table {
  min-width: min(620px, calc(100% - 20px));
  max-width: min(calc(100% - 20px), 780px);
  margin: 14px 0 18px 24px;
  border: 1px solid #6f7772;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: auto;
}

.markdown-body table.note-frame-table.note-frame-heavy {
  border-width: 3px;
  border-radius: 10px;
  overflow: hidden;
}

.markdown-body table.note-frame-table td,
.markdown-body table.note-frame-table tr:first-child > td {
  border: 0;
  padding: 6px 24px;
  line-height: 1.5;
  text-align: left !important;
  vertical-align: top;
  font-weight: 400;
}

.markdown-body table.note-frame-table td *:not(input) {
  text-align: left !important;
}

.markdown-body table.note-frame-table .note-frame-title-cell,
.markdown-body table.note-frame-table tr:first-child > td.note-frame-title-cell {
  padding: 16px 24px 14px;
  text-align: center !important;
  font-size: 20px;
  font-weight: 700;
}

.markdown-body table.note-frame-table .note-frame-title-cell * {
  text-align: center !important;
}

.markdown-body table.note-frame-table .note-frame-section-cell,
.markdown-body table.note-frame-table tr > td.note-frame-section-cell {
  padding-top: 14px;
  padding-bottom: 3px;
  padding-left: 28px;
  font-weight: 700;
  text-align: left !important;
}

.markdown-body table.note-frame-table tr.note-frame-example-row > td {
  padding-top: 10px;
  padding-bottom: 12px;
}

.markdown-body table.note-frame-table.note-frame-ruled tr.note-frame-example-row > td {
  border-top: 1px solid #7f8782;
  border-bottom: 1px solid #7f8782;
}

.markdown-body table.note-frame-table tr.note-frame-box-row > td {
  border-top: 1px solid #7f8782;
  border-bottom: 1px solid #7f8782;
  padding-top: 10px;
  padding-bottom: 10px;
}

.markdown-body table.note-frame-table tr.note-frame-box-row > td:first-child {
  border-left: 1px solid #7f8782;
}

.markdown-body table.note-frame-table tr.note-frame-box-row > td:last-child {
  border-right: 1px solid #7f8782;
}

.markdown-body table.note-frame-table td:first-child:not([colspan]) {
  width: 42%;
  min-width: 210px;
}

.markdown-body table.note-frame-table td[colspan] {
  font-weight: 400;
  text-align: left !important;
  padding-left: 44px;
}

.markdown-body table.note-frame-table .inline-answer-wrap {
  margin-top: 2px;
  margin-bottom: 2px;
}

.markdown-body table.note-frame-table.source-note-frame {
  min-width: min(680px, calc(100% - 20px));
  max-width: min(calc(100% - 20px), 860px);
  border-color: #4f5752;
  border-radius: 12px;
  font-family: "Times New Roman", Times, serif;
  font-size: 16px;
  line-height: 1.42;
}

.markdown-body table.note-frame-table.source-note-frame td,
.markdown-body table.note-frame-table.source-note-frame tr:first-child > td {
  padding: 4px 34px;
  line-height: 1.42;
}

.markdown-body table.note-frame-table.source-note-frame .note-frame-title-cell,
.markdown-body table.note-frame-table.source-note-frame tr:first-child > td.note-frame-title-cell {
  padding: 18px 34px 12px;
  font-size: 22px;
}

.markdown-body table.note-frame-table.source-note-frame .note-frame-section-cell,
.markdown-body table.note-frame-table.source-note-frame tr > td.note-frame-section-cell {
  padding-top: 16px;
  padding-bottom: 4px;
  padding-left: 34px;
  font-size: 17px;
}

.markdown-body table.note-frame-table.source-note-frame .inline-answer-wrap {
  width: 116px;
  max-width: 116px;
  margin: 0 4px;
}

.markdown-body table.note-frame-table.source-note-frame .inline-answer {
  min-height: 28px;
  padding: 4px 7px;
  font-family: Inter, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  font-size: 14px;
}

.markdown-body table.note-frame-table.source-note-frame.sahara-cultures-note-frame {
  width: min(100%, 760px);
  margin-left: 0;
  border-color: #6f7772;
  border-radius: 0;
  font-size: 17px;
}

.markdown-body table.note-frame-table.source-note-frame.sahara-cultures-note-frame td,
.markdown-body table.note-frame-table.source-note-frame.sahara-cultures-note-frame tr:first-child > td {
  padding: 3px 16px;
  line-height: 1.48;
}

.markdown-body table.note-frame-table.source-note-frame.sahara-cultures-note-frame .note-frame-title-cell,
.markdown-body table.note-frame-table.source-note-frame.sahara-cultures-note-frame tr:first-child > td.note-frame-title-cell {
  padding: 10px 16px 8px;
  font-size: 18px;
}

.markdown-body table.note-frame-table.source-note-frame.sahara-cultures-note-frame .note-frame-section-cell,
.markdown-body table.note-frame-table.source-note-frame.sahara-cultures-note-frame tr > td.note-frame-section-cell {
  padding: 10px 16px 3px;
  font-size: 17px;
}

.markdown-body table.note-form-frame-table {
  min-width: min(560px, calc(100% - 20px));
  max-width: min(calc(100% - 20px), 800px);
  margin: 14px 0 18px 24px;
  border: 3px solid #4f5752;
  border-radius: 12px;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  table-layout: auto;
  font-family: "Times New Roman", Times, serif;
  font-size: 16px;
  line-height: 1.38;
}

.markdown-body table.note-form-frame-table td,
.markdown-body table.note-form-frame-table tr:first-child > td {
  border: 0;
  padding: 4px 24px;
  background: transparent;
  text-align: left;
  vertical-align: top;
  font-weight: 400;
  overflow-wrap: normal;
  word-break: normal;
}

.markdown-body table.note-form-frame-table .note-form-title-cell,
.markdown-body table.note-form-frame-table tr:first-child > td.note-form-title-cell {
  padding: 18px 24px 14px;
  text-align: center;
  font-size: 22px;
  font-weight: 700;
}

.markdown-body table.note-form-frame-table .note-form-section-cell {
  padding-top: 16px;
  padding-bottom: 5px;
  text-align: center;
  font-size: 17px;
  font-weight: 700;
}

.markdown-body table.note-form-frame-table tr.note-form-example-row > td {
  border-top: 1px solid #6f7772;
  border-bottom: 1px solid #6f7772;
  padding-top: 8px;
  padding-bottom: 8px;
}

.markdown-body table.note-form-frame-table tr.note-form-example-row > td:first-child {
  border-left: 1px solid #6f7772;
}

.markdown-body table.note-form-frame-table tr.note-form-example-row > td:last-child {
  border-right: 1px solid #6f7772;
}

.markdown-body table.note-form-frame-table td:first-child:not([colspan]) {
  width: 42%;
  min-width: 190px;
  font-weight: 700;
}

.markdown-body table.note-form-frame-table td[colspan] {
  padding-left: 34px;
  padding-right: 34px;
}

.markdown-body table.note-form-frame-table .inline-answer-wrap {
  width: 116px;
  max-width: 116px;
  margin: 0 4px;
  vertical-align: middle;
}

.markdown-body table.note-form-frame-table .inline-answer {
  min-height: 28px;
  padding: 4px 7px;
  font-family: Inter, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  font-size: 14px;
}

.markdown-body table.judgement-definition-table {
  width: fit-content;
  min-width: 0;
  max-width: calc(100% - 20px);
  margin: 6px 0 12px 20px;
  border: 0;
  table-layout: auto;
}

.markdown-body table.judgement-definition-table td {
  border: 0;
  padding: 1px 14px 1px 0;
  background: transparent;
}

.markdown-body table.judgement-definition-table td:first-child {
  min-width: 86px;
  font-weight: 800;
  text-align: left;
}

.markdown-body table.plain-first-row-table tr:first-child > td {
  font-weight: 400;
  text-align: left;
}

.markdown-body table.judgement-definition-table tr > td:first-child {
  font-weight: 800;
  text-align: left;
}

.markdown-body .judgement-definition-label {
  font-weight: 800;
}

.markdown-body table.matching-list-table {
  width: fit-content;
  max-width: min(calc(100% - 20px), 780px);
  margin: 12px 0 16px 20px;
  border: 1px solid #8f9b95;
  table-layout: auto;
}

.markdown-body table.matching-list-table td {
  padding: 5px 10px;
  font-weight: 400;
  text-align: left;
  vertical-align: top;
}

.markdown-body table.matching-list-table tr:first-child > td {
  font-weight: 700;
  text-align: center;
}

.markdown-body table.matching-list-table td.matching-list-title-cell {
  font-weight: 700;
  text-align: center;
}

.markdown-body table.matching-list-table td.matching-list-marker-cell {
  width: 36px;
  min-width: 36px;
  padding-left: 8px;
  padding-right: 8px;
  text-align: right;
}

.markdown-body table.matching-list-table td.matching-list-option-cell {
  min-width: 220px;
}

.matching-list-option-line {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.matching-list-marker {
  display: inline-block;
  min-width: 18px;
  font-weight: 700;
}

.matching-list-option-text {
  font-weight: 400;
}

.markdown-body table.word-bank-table {
  width: fit-content;
  max-width: calc(100% - 20px);
  margin: 12px 0 16px 20px;
  table-layout: auto;
}

.markdown-body table.word-bank-table td {
  min-width: 104px;
  padding: 6px 12px;
  font-weight: 400;
  text-align: left;
  vertical-align: middle;
}

.markdown-body table.word-bank-table tr:first-child > td {
  font-weight: 400;
  text-align: left;
}

.markdown-body table.word-bank-table td.word-bank-marker-cell {
  min-width: 34px;
  width: 34px;
  padding-left: 8px;
  padding-right: 8px;
  text-align: center;
}

.markdown-body table.word-bank-table tr:first-child > td.word-bank-marker-cell {
  text-align: center;
}

.markdown-body table.unlettered-word-bank-table td {
  min-width: 0;
  padding-left: 8px;
  padding-right: 8px;
  text-align: center;
}

.markdown-body table.unlettered-word-bank-table {
  width: fit-content;
  min-width: min(520px, calc(100% - 20px));
  table-layout: fixed;
}

.markdown-body table.unlettered-word-bank-table tr:first-child > td {
  text-align: center;
}

.markdown-body table.wide-comparison-table {
  width: min(920px, calc(100% - 20px));
  max-width: calc(100% - 20px);
  table-layout: fixed;
}

.markdown-body table.wide-comparison-table td,
.markdown-body table.wide-comparison-table th {
  overflow-wrap: break-word;
  word-break: normal;
}

.markdown-body table.wide-comparison-table .inline-answer-wrap.compact {
  width: 96px;
  max-width: 96px;
}

.markdown-body table.outline-note-table tr:first-child > td {
  font-weight: 700;
  text-align: center;
}

.markdown-body table.outline-note-table td.outline-note-heading-cell {
  font-weight: 700;
  text-align: left;
}

.markdown-body table.outline-note-table td.outline-note-section-cell {
  font-weight: 700;
  text-align: center;
}

.markdown-body table.outline-note-table td:not(.outline-note-title-cell):not(.outline-note-heading-cell):not(.outline-note-section-cell) {
  font-weight: 400;
  text-align: left;
}

.word-bank-marker {
  display: inline-block;
  min-width: 16px;
  font-weight: 700;
}

.word-bank-option-text {
  font-weight: 400;
}

.markdown-body td[rowspan] {
  vertical-align: middle;
}

.inline-answer-wrap {
  position: relative;
  display: inline-block;
  width: 150px;
  margin: 0 5px;
  vertical-align: baseline;
}

.inline-answer-wrap.compact {
  width: 88px;
}

.inline-answer {
  border: 1px solid #b9c3bd;
  border-radius: 5px;
  min-height: 32px;
  padding: 5px 8px;
  width: 100%;
  background: white;
  text-align: left;
}

.inline-answer {
  display: block;
}

.inline-answer.compact {
  min-height: 28px;
  padding: 4px 7px;
}

.inline-answer::placeholder {
  color: var(--muted);
  opacity: 1;
}

.inline-answer:placeholder-shown {
  text-align: center;
}

.markdown-body table .inline-answer-wrap {
  width: min(130px, 100%);
  max-width: 130px;
}

.markdown-body table .inline-answer-wrap.compact {
  width: min(88px, 100%);
}

.markdown-body table td.table-answer-cell,
.markdown-body table th.table-answer-cell {
  min-width: 104px;
  text-align: center;
  vertical-align: middle;
}

.markdown-body table.flow-chart {
  width: min(100%, 620px);
  margin: 12px 0 18px 20px;
  border: 0;
  background: transparent;
  table-layout: auto;
}

.markdown-body table.flow-chart td {
  border: 0;
  padding: 4px 8px;
  text-align: center;
  vertical-align: middle;
  background: transparent;
}

.markdown-body table.flow-chart .flow-arrow {
  padding: 0 8px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
}

.markdown-body table.flow-chart .flow-box {
  border: 1px solid #8f9993;
  padding: 9px 13px;
  background: #fff;
  text-align: center;
  line-height: 1.55;
}

.markdown-body table.flow-chart .flow-box.left {
  text-align: left;
}

.markdown-body table.flow-chart .flow-branch-label {
  border: 1px solid #9da7a1;
  padding: 7px 12px;
  background: #fff;
  text-align: center;
  font-weight: 400;
}

.markdown-body table.flow-chart.flow-chart-linear {
  max-width: 640px;
}

.markdown-body table.flow-chart.flow-chart-branch {
  max-width: 780px;
}

.markdown-body table.flow-chart .inline-answer-wrap {
  display: inline-block;
  vertical-align: middle;
}

.form-like-block {
  border: 1px solid #aeb9b3;
  box-sizing: border-box;
  width: fit-content;
  min-width: min(560px, calc(100% - 20px));
  max-width: calc(100% - 20px);
  margin: 12px 0 16px 20px;
  background: #fff;
}

.form-like-row {
  display: grid;
  grid-template-columns: minmax(130px, 34%) minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  margin: 0;
  padding: 7px 9px;
  border-bottom: 1px solid #d8dfdb;
}

.form-like-row:last-child {
  border-bottom: 0;
}

.form-like-row-full {
  grid-template-columns: 1fr;
}

.form-like-label {
  min-width: 0;
  font-weight: 700;
}

.form-like-value {
  min-width: 0;
}

.form-like-section-row {
  background: #f4f7f5;
}

.form-like-section-title {
  font-weight: 700;
}

.note-list {
  margin: 0 0 7px;
}

.note-list-in-form {
  margin: 0;
}

.structured-note-block {
  margin: 0 0 12px;
}

.structured-note-title,
.structured-note-heading {
  margin: 10px 0 5px;
  font-weight: 700;
}

.structured-note-title {
  margin-top: 0;
  text-align: center;
  letter-spacing: 0;
}

.structured-note-block .note-bullet {
  margin-left: 10px;
}

.structured-note-block .note-bullet + .structured-note-heading {
  margin-top: 12px;
}

.lead-note-block {
  margin: 8px 0 14px;
}

.markdown-body .loose-note-block {
  box-sizing: border-box;
  width: min(760px, 100%);
  margin: 14px 0 22px;
  padding: 30px 52px 28px;
  border: 2px solid #35433f;
  border-radius: 0;
  background: #fff;
  color: #17231f;
}

.markdown-body .loose-note-block .loose-note-title {
  margin: 0 0 26px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  font-style: italic;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
}

.markdown-body .loose-note-block .loose-note-section {
  margin: 18px 0 7px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
}

.markdown-body .loose-note-block .loose-note-section + .lead-note-line {
  margin-top: 0;
}

.markdown-body .loose-note-block .lead-note-line,
.markdown-body .loose-note-block .note-bullet {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 16px;
  line-height: 1.5;
}

.markdown-body .loose-note-block .note-bullet {
  grid-template-columns: 16px minmax(0, 1fr);
  column-gap: 8px;
}

.markdown-body .loose-note-block .note-bullet + .note-bullet,
.markdown-body .loose-note-block .lead-note-line + .note-bullet,
.markdown-body .loose-note-block .note-bullet + .lead-note-line {
  margin-top: 5px;
}

.markdown-body .loose-note-block.source-note-frame {
  position: relative;
  isolation: isolate;
  width: min(720px, 100%);
  min-height: 520px;
  margin: 14px 0 22px;
  padding: 48px 60px 56px;
  border: 0;
  border-left: 4px solid #1d2620;
  border-right: 4px solid #1d2620;
  background: #fff;
  color: #111;
}

.markdown-body .loose-note-block.source-note-frame::before,
.markdown-body .loose-note-block.source-note-frame::after {
  position: absolute;
  right: -4px;
  left: -4px;
  z-index: 0;
  height: 24px;
  content: '';
  background: radial-gradient(ellipse 23px 15px at 23px -4px, transparent 82%, #1d2620 84% 92%, transparent 94%) 0 0 / 46px 24px repeat-x;
}

.markdown-body .loose-note-block.source-note-frame::before {
  top: -1px;
}

.markdown-body .loose-note-block.source-note-frame::after {
  bottom: -1px;
  transform: rotate(180deg);
}

.markdown-body .loose-note-block.source-note-frame > * {
  position: relative;
  z-index: 1;
}

.markdown-body .loose-note-block.source-note-frame .loose-note-title {
  margin-bottom: 34px;
  color: #111;
  font-size: 23px;
}

.markdown-body .loose-note-block.source-note-frame .loose-note-section {
  margin: 0 0 8px;
  color: #111;
  font-size: 18px;
}

.markdown-body .loose-note-block.source-note-frame .loose-note-section:not(:first-child) {
  margin-top: 30px;
}

.markdown-body .loose-note-block.source-note-frame .lead-note-line,
.markdown-body .loose-note-block.source-note-frame .note-bullet {
  color: #111;
  font-size: 18px;
  line-height: 1.55;
}

.markdown-body .loose-note-block.source-note-frame .source-note-field-line strong {
  font-weight: 700;
}

.markdown-body .loose-note-block.source-note-frame .note-bullet {
  grid-template-columns: 18px minmax(0, 1fr);
  column-gap: 7px;
}

.markdown-body .loose-note-block.source-note-frame .note-bullet + .note-bullet {
  margin-top: 7px;
}

.markdown-body .loose-note-block.source-note-frame .inline-answer-wrap {
  width: 118px;
  margin: 0 4px;
  vertical-align: middle;
}

.markdown-body .loose-note-block.source-note-frame .inline-answer {
  min-height: 25px;
  padding: 0 2px 2px;
  border: 0;
  border-bottom: 2px dotted #1d2620;
  border-radius: 0;
  background: transparent;
  color: #111;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  line-height: 1.2;
}

.markdown-body .loose-note-block.source-note-frame .inline-answer:placeholder-shown {
  text-align: left;
}

.markdown-body .loose-note-block.source-note-frame .inline-answer.correct {
  border-bottom-color: var(--green);
}

.markdown-body .loose-note-block.source-note-frame .inline-answer.wrong {
  border-bottom-color: var(--red);
}

.markdown-body .loose-note-block.source-note-frame .inline-answer.pending {
  border-bottom-color: var(--amber);
}

.markdown-body .loose-note-block.source-note-frame.source-note-frame-sleep {
  width: min(700px, 100%);
  min-height: 0;
  padding: 28px 38px 34px;
  border: 3px solid #343a36;
}

.markdown-body .loose-note-block.source-note-frame.source-note-frame-sleep::before,
.markdown-body .loose-note-block.source-note-frame.source-note-frame-sleep::after {
  content: none;
}

.markdown-body .loose-note-block.source-note-frame.source-note-frame-sleep .loose-note-title {
  margin-bottom: 22px;
  font-size: 21px;
  font-style: normal;
}

.markdown-body .loose-note-block.source-note-frame.source-note-frame-sleep .loose-note-section {
  margin-bottom: 4px;
  font-size: 16px;
  line-height: 1.25;
}

.markdown-body .loose-note-block.source-note-frame.source-note-frame-sleep .loose-note-section:not(:first-child) {
  margin-top: 14px;
}

.markdown-body .loose-note-block.source-note-frame.source-note-frame-sleep .lead-note-line,
.markdown-body .loose-note-block.source-note-frame.source-note-frame-sleep .note-bullet {
  font-size: 15px;
  line-height: 1.35;
}

.markdown-body .loose-note-block.source-note-frame.source-note-frame-sleep .note-bullet + .note-bullet {
  margin-top: 2px;
}

.markdown-body .loose-note-block.source-note-frame.source-note-frame-sleep .inline-answer-wrap {
  width: 98px;
}

.markdown-body .loose-note-block.source-note-frame.source-note-frame-sleep .inline-answer {
  min-height: 20px;
  font-size: 14px;
}

.markdown-body .loose-note-block.source-note-frame.source-note-frame-drama {
  width: min(720px, 100%);
  min-height: 0;
  margin: 14px 0 22px;
  padding: 34px 38px 36px;
  border: 5px solid #5b5e57;
  border-radius: 20px;
  background: #fff;
  color: #151713;
  font-family: "Times New Roman", Times, serif;
}

.markdown-body .loose-note-block.source-note-frame.source-note-frame-drama::before,
.markdown-body .loose-note-block.source-note-frame.source-note-frame-drama::after {
  display: none;
}

.markdown-body .loose-note-block.source-note-frame.source-note-frame-drama .loose-note-title {
  margin: 0 0 24px;
  color: #151713;
  font-family: "Times New Roman", Times, serif;
  font-size: 23px;
  font-style: normal;
  font-weight: 700;
  line-height: 1.24;
  text-align: center;
}

.markdown-body .loose-note-block.source-note-frame.source-note-frame-drama .loose-note-section {
  margin: 22px 0 7px;
  color: #151713;
  font-family: "Times New Roman", Times, serif;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
}

.markdown-body .loose-note-block.source-note-frame.source-note-frame-drama .loose-note-title + .loose-note-section {
  margin-top: 0;
}

.markdown-body .loose-note-block.source-note-frame.source-note-frame-drama .lead-note-line,
.markdown-body .loose-note-block.source-note-frame.source-note-frame-drama .note-bullet {
  color: #151713;
  font-family: "Times New Roman", Times, serif;
  font-size: 17px;
  line-height: 1.48;
}

.markdown-body .loose-note-block.source-note-frame.source-note-frame-drama .note-bullet {
  grid-template-columns: 13px minmax(0, 1fr);
  column-gap: 7px;
}

.markdown-body .loose-note-block.source-note-frame.source-note-frame-drama .note-bullet + .note-bullet {
  margin-top: 6px;
}

.markdown-body .loose-note-block.source-note-frame.source-note-frame-drama .inline-answer-wrap {
  width: 105px;
  margin: 0 3px;
}

.markdown-body .loose-note-block.source-note-frame.source-note-frame-drama .inline-answer {
  min-height: 24px;
  color: #151713;
  font-family: "Times New Roman", Times, serif;
  font-size: 16px;
}

.markdown-body .loose-note-block.source-note-frame.source-note-frame-greenwell {
  width: min(600px, 100%);
  min-height: 0;
  margin: 14px 0 22px;
  padding: 30px 28px 26px;
  border: 7px solid #59605a;
  border-radius: 19px;
  background: #fff;
  color: #111;
  font-family: "Times New Roman", Times, serif;
}

.markdown-body .loose-note-block.source-note-frame.source-note-frame-greenwell::before,
.markdown-body .loose-note-block.source-note-frame.source-note-frame-greenwell::after {
  display: none;
}

.markdown-body .loose-note-block.source-note-frame.source-note-frame-greenwell .loose-note-title {
  margin: 0 0 24px;
  color: #111;
  font-family: "Times New Roman", Times, serif;
  font-size: 21px;
  font-style: normal;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}

.markdown-body .loose-note-block.source-note-frame.source-note-frame-greenwell .loose-note-section {
  margin: 24px 0 8px;
  color: #111;
  font-family: "Times New Roman", Times, serif;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.28;
}

.markdown-body .loose-note-block.source-note-frame.source-note-frame-greenwell .loose-note-title + .loose-note-section {
  margin-top: 0;
}

.markdown-body .loose-note-block.source-note-frame.source-note-frame-greenwell .lead-note-line,
.markdown-body .loose-note-block.source-note-frame.source-note-frame-greenwell .note-bullet {
  color: #111;
  font-family: "Times New Roman", Times, serif;
  font-size: 16px;
  line-height: 1.42;
}

.markdown-body .loose-note-block.source-note-frame.source-note-frame-greenwell .note-bullet {
  grid-template-columns: 13px minmax(0, 1fr);
  column-gap: 7px;
}

.markdown-body .loose-note-block.source-note-frame.source-note-frame-greenwell .note-bullet + .note-bullet,
.markdown-body .loose-note-block.source-note-frame.source-note-frame-greenwell .lead-note-line + .note-bullet,
.markdown-body .loose-note-block.source-note-frame.source-note-frame-greenwell .note-bullet + .lead-note-line {
  margin-top: 7px;
}

.markdown-body .loose-note-block.source-note-frame.source-note-frame-greenwell .note-bullet-marker {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.42;
}

.markdown-body .loose-note-block.source-note-frame.source-note-frame-greenwell .inline-answer-wrap {
  width: 88px;
  margin: 0 3px;
}

.markdown-body .loose-note-block.source-note-frame.source-note-frame-greenwell .inline-answer {
  min-height: 22px;
  padding: 0 2px 1px;
  border: 0;
  border-bottom: 2px dotted #1b1b1b;
  border-radius: 0;
  background: transparent;
  color: #111;
  font-family: "Times New Roman", Times, serif;
  font-size: 15px;
  line-height: 1.15;
}

.markdown-body .loose-note-block.source-note-frame.source-note-frame-textiles {
  width: min(670px, 100%);
  min-height: 760px;
  margin: 14px 0 22px;
  padding: 36px 38px 46px;
  border-left: 5px solid #5b5d56;
  border-right: 5px solid #5b5d56;
  background: #fff;
  color: #111;
  font-family: "Times New Roman", Times, serif;
}

.markdown-body .loose-note-block.source-note-frame.source-note-frame-textiles::before,
.markdown-body .loose-note-block.source-note-frame.source-note-frame-textiles::after {
  right: -5px;
  left: -5px;
  height: 22px;
  background: radial-gradient(ellipse 21px 14px at 21px -4px, transparent 81%, #5b5d56 83% 92%, transparent 94%) 0 0 / 42px 22px repeat-x;
}

.markdown-body .loose-note-block.source-note-frame.source-note-frame-textiles::before {
  top: -1px;
}

.markdown-body .loose-note-block.source-note-frame.source-note-frame-textiles::after {
  bottom: -1px;
}

.markdown-body .loose-note-block.source-note-frame.source-note-frame-textiles .loose-note-title {
  margin: 0 0 30px;
  color: #111;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  font-style: italic;
  font-weight: 700;
  line-height: 1.22;
  text-align: center;
}

.markdown-body .loose-note-block.source-note-frame.source-note-frame-textiles .loose-note-section {
  margin: 25px 0 8px;
  color: #111;
  font-family: "Times New Roman", Times, serif;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.28;
}

.markdown-body .loose-note-block.source-note-frame.source-note-frame-textiles .loose-note-title + .loose-note-section {
  margin-top: 0;
}

.markdown-body .loose-note-block.source-note-frame.source-note-frame-textiles .lead-note-line,
.markdown-body .loose-note-block.source-note-frame.source-note-frame-textiles .note-bullet {
  color: #111;
  font-family: "Times New Roman", Times, serif;
  font-size: 16px;
  line-height: 1.4;
}

.markdown-body .loose-note-block.source-note-frame.source-note-frame-textiles .note-bullet {
  grid-template-columns: 14px minmax(0, 1fr);
  column-gap: 7px;
}

.markdown-body .loose-note-block.source-note-frame.source-note-frame-textiles .note-bullet + .note-bullet,
.markdown-body .loose-note-block.source-note-frame.source-note-frame-textiles .lead-note-line + .note-bullet,
.markdown-body .loose-note-block.source-note-frame.source-note-frame-textiles .note-bullet + .lead-note-line {
  margin-top: 7px;
}

.markdown-body .loose-note-block.source-note-frame.source-note-frame-textiles .note-bullet-marker {
  color: #111;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
  transform: translateY(1px);
}

.markdown-body .loose-note-block.source-note-frame.source-note-frame-textiles .note-bullet-dash {
  margin-left: 22px;
}

.markdown-body .loose-note-block.source-note-frame.source-note-frame-textiles .inline-answer-wrap {
  width: 102px;
  margin: 0 3px;
}

.markdown-body .loose-note-block.source-note-frame.source-note-frame-textiles .inline-answer {
  min-height: 22px;
  padding: 0 2px 1px;
  border: 0;
  border-bottom: 2px dotted #1b1b1b;
  border-radius: 0;
  background: transparent;
  color: #111;
  font-family: "Times New Roman", Times, serif;
  font-size: 15px;
  line-height: 1.15;
}

.markdown-body .loose-note-block.source-note-frame.source-note-frame-flat {
  width: min(590px, 100%);
  min-height: 690px;
  margin: 14px 0 22px;
  padding: 34px 28px 44px;
  border-left: 5px solid #5c615d;
  border-right: 5px solid #5c615d;
  background: #fff;
  color: #111;
  font-family: "Times New Roman", Times, serif;
}

.markdown-body .loose-note-block.source-note-frame.source-note-frame-flat::before,
.markdown-body .loose-note-block.source-note-frame.source-note-frame-flat::after {
  right: -5px;
  left: -5px;
  height: 22px;
  background: radial-gradient(ellipse 21px 14px at 21px -4px, transparent 81%, #5c615d 83% 92%, transparent 94%) 0 0 / 42px 22px repeat-x;
}

.markdown-body .loose-note-block.source-note-frame.source-note-frame-flat::before {
  top: -1px;
}

.markdown-body .loose-note-block.source-note-frame.source-note-frame-flat::after {
  bottom: -1px;
}

.markdown-body .loose-note-block.source-note-frame.source-note-frame-flat .loose-note-title {
  margin: 0 0 22px;
  color: #111;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  font-style: italic;
  font-weight: 700;
  line-height: 1.22;
  text-align: center;
}

.markdown-body .loose-note-block.source-note-frame.source-note-frame-flat .loose-note-section {
  margin: 20px 0 6px;
  color: #111;
  font-family: "Times New Roman", Times, serif;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.25;
}

.markdown-body .loose-note-block.source-note-frame.source-note-frame-flat .loose-note-title + .loose-note-section {
  margin-top: 0;
}

.markdown-body .loose-note-block.source-note-frame.source-note-frame-flat .lead-note-line,
.markdown-body .loose-note-block.source-note-frame.source-note-frame-flat .note-bullet {
  color: #111;
  font-family: "Times New Roman", Times, serif;
  font-size: 16px;
  line-height: 1.34;
}

.markdown-body .loose-note-block.source-note-frame.source-note-frame-flat .note-bullet {
  grid-template-columns: 13px minmax(0, 1fr);
  column-gap: 7px;
}

.markdown-body .loose-note-block.source-note-frame.source-note-frame-flat .note-bullet + .note-bullet,
.markdown-body .loose-note-block.source-note-frame.source-note-frame-flat .lead-note-line + .note-bullet,
.markdown-body .loose-note-block.source-note-frame.source-note-frame-flat .note-bullet + .lead-note-line {
  margin-top: 5px;
}

.markdown-body .loose-note-block.source-note-frame.source-note-frame-flat .note-bullet-marker {
  color: #111;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.34;
  text-align: center;
  transform: translateY(1px);
}

.markdown-body .loose-note-block.source-note-frame.source-note-frame-flat .note-bullet-dash {
  margin-left: 20px;
}

.markdown-body .loose-note-block.source-note-frame.source-note-frame-flat .inline-answer-wrap {
  width: 96px;
  margin: 0 3px;
}

.markdown-body .loose-note-block.source-note-frame.source-note-frame-flat .inline-answer {
  min-height: 20px;
  padding: 0 2px 1px;
  border: 0;
  border-bottom: 2px dotted #1b1b1b;
  border-radius: 0;
  background: transparent;
  color: #111;
  font-family: "Times New Roman", Times, serif;
  font-size: 15px;
  line-height: 1.1;
}

.markdown-body .loose-note-block.source-note-frame.source-note-frame-childcare {
  width: min(760px, 100%);
  min-height: 746px;
  padding: 46px 62px 50px;
  border-left-width: 5px;
  border-right-width: 5px;
  color: #0f0f0f;
  font-family: "Times New Roman", Times, serif;
}

.markdown-body .loose-note-block.source-note-frame.source-note-frame-childcare::before,
.markdown-body .loose-note-block.source-note-frame.source-note-frame-childcare::after {
  right: -5px;
  left: -5px;
  height: 26px;
  background:
    linear-gradient(#1d2620, #1d2620) 0 0 / 100% 3px no-repeat,
    radial-gradient(ellipse 26px 17px at 26px 0, transparent 0 79%, #1d2620 81% 93%, transparent 95%) 0 0 / 52px 26px repeat-x;
}

.markdown-body .loose-note-block.source-note-frame.source-note-frame-childcare .loose-note-title {
  margin: 0 0 34px;
  color: #111;
  font-family: "Segoe Print", "Comic Sans MS", cursive;
  font-size: 25px;
  font-style: normal;
  font-weight: 700;
  line-height: 1.2;
}

.markdown-body .loose-note-block.source-note-frame.source-note-frame-childcare .loose-note-section {
  margin: 28px 0 7px;
  color: #111;
  font-family: "Times New Roman", Times, serif;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.32;
}

.markdown-body .loose-note-block.source-note-frame.source-note-frame-childcare .loose-note-title + .loose-note-section {
  margin-top: 0;
}

.markdown-body .loose-note-block.source-note-frame.source-note-frame-childcare .lead-note-line,
.markdown-body .loose-note-block.source-note-frame.source-note-frame-childcare .note-bullet {
  color: #111;
  font-family: "Times New Roman", Times, serif;
  font-size: 19px;
  line-height: 1.48;
}

.markdown-body .loose-note-block.source-note-frame.source-note-frame-childcare .note-bullet {
  grid-template-columns: 17px minmax(0, 1fr);
  column-gap: 7px;
}

.markdown-body .loose-note-block.source-note-frame.source-note-frame-childcare .note-bullet + .note-bullet,
.markdown-body .loose-note-block.source-note-frame.source-note-frame-childcare .lead-note-line + .note-bullet,
.markdown-body .loose-note-block.source-note-frame.source-note-frame-childcare .note-bullet + .lead-note-line {
  margin-top: 2px;
}

.markdown-body .loose-note-block.source-note-frame.source-note-frame-childcare .inline-answer-wrap {
  width: 112px;
  margin: 0 3px;
}

.markdown-body .loose-note-block.source-note-frame.source-note-frame-childcare .inline-answer {
  min-height: 25px;
  padding: 0 1px 2px;
  font-family: "Times New Roman", Times, serif;
  font-size: 18px;
}

/* Source-specific listening frames: the original PDFs use printed paper borders, not cards. */
.markdown-body .loose-note-block.source-note-frame.source-note-frame-classic,
.markdown-body .loose-note-block.source-note-frame.source-note-frame-balloon {
  width: min(760px, 100%);
  min-height: 0;
  padding: 46px 62px 50px;
  border-left-width: 5px;
  border-right-width: 5px;
  color: #0f0f0f;
  font-family: "Times New Roman", Times, serif;
}

.markdown-body .loose-note-block.source-note-frame.source-note-frame-classic::before,
.markdown-body .loose-note-block.source-note-frame.source-note-frame-classic::after,
.markdown-body .loose-note-block.source-note-frame.source-note-frame-balloon::before,
.markdown-body .loose-note-block.source-note-frame.source-note-frame-balloon::after {
  right: -5px;
  left: -5px;
  height: 26px;
  background:
    linear-gradient(#1d2620, #1d2620) 0 0 / 100% 3px no-repeat,
    radial-gradient(ellipse 26px 17px at 26px 0, transparent 0 79%, #1d2620 81% 93%, transparent 95%) 0 0 / 52px 26px repeat-x;
}

.markdown-body .loose-note-block.source-note-frame.source-note-frame-classic .loose-note-title,
.markdown-body .loose-note-block.source-note-frame.source-note-frame-balloon .loose-note-title {
  margin: 0 0 34px;
  color: #111;
  font-family: "Segoe Print", "Comic Sans MS", cursive;
  font-size: 25px;
  font-style: normal;
  font-weight: 700;
  line-height: 1.2;
}

.markdown-body .loose-note-block.source-note-frame.source-note-frame-classic .loose-note-section,
.markdown-body .loose-note-block.source-note-frame.source-note-frame-balloon .loose-note-section {
  margin: 28px 0 7px;
  color: #111;
  font-family: "Times New Roman", Times, serif;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.32;
}

.markdown-body .loose-note-block.source-note-frame.source-note-frame-classic .loose-note-title + .loose-note-section,
.markdown-body .loose-note-block.source-note-frame.source-note-frame-balloon .loose-note-title + .loose-note-section {
  margin-top: 0;
}

.markdown-body .loose-note-block.source-note-frame.source-note-frame-classic .lead-note-line,
.markdown-body .loose-note-block.source-note-frame.source-note-frame-classic .note-bullet,
.markdown-body .loose-note-block.source-note-frame.source-note-frame-balloon .lead-note-line,
.markdown-body .loose-note-block.source-note-frame.source-note-frame-balloon .note-bullet {
  color: #111;
  font-family: "Times New Roman", Times, serif;
  font-size: 19px;
  line-height: 1.48;
}

.markdown-body .loose-note-block.source-note-frame.source-note-frame-classic .note-bullet,
.markdown-body .loose-note-block.source-note-frame.source-note-frame-balloon .note-bullet {
  grid-template-columns: 17px minmax(0, 1fr);
  column-gap: 7px;
}

.markdown-body .loose-note-block.source-note-frame.source-note-frame-classic .note-bullet + .note-bullet,
.markdown-body .loose-note-block.source-note-frame.source-note-frame-classic .lead-note-line + .note-bullet,
.markdown-body .loose-note-block.source-note-frame.source-note-frame-classic .note-bullet + .lead-note-line,
.markdown-body .loose-note-block.source-note-frame.source-note-frame-balloon .note-bullet + .note-bullet,
.markdown-body .loose-note-block.source-note-frame.source-note-frame-balloon .lead-note-line + .note-bullet,
.markdown-body .loose-note-block.source-note-frame.source-note-frame-balloon .note-bullet + .lead-note-line {
  margin-top: 2px;
}

.markdown-body .loose-note-block.source-note-frame.source-note-frame-classic .inline-answer-wrap,
.markdown-body .loose-note-block.source-note-frame.source-note-frame-balloon .inline-answer-wrap {
  width: 112px;
  margin: 0 3px;
}

.markdown-body .loose-note-block.source-note-frame.source-note-frame-classic .inline-answer,
.markdown-body .loose-note-block.source-note-frame.source-note-frame-balloon .inline-answer {
  min-height: 25px;
  padding: 0 1px 2px;
  font-family: "Times New Roman", Times, serif;
  font-size: 18px;
}

.markdown-body .loose-note-block.source-note-frame.source-note-frame-balloon {
  min-height: 470px;
}

.markdown-body .loose-note-block.source-note-frame.source-note-frame-balloon .lead-note-line {
  margin: 0;
}

.markdown-body .loose-note-block.source-note-frame.source-note-frame-balloon .lead-note-line:nth-of-type(6) {
  margin-bottom: 25px;
}

.markdown-body .loose-note-block.source-note-frame.source-note-frame-frog,
.markdown-body .loose-note-block.source-note-frame.source-note-frame-earth {
  width: min(760px, 100%);
  min-height: 0;
  padding: 48px 58px 54px;
  border: 0;
  background: #fff;
  color: #111;
  font-family: "Times New Roman", Times, serif;
}

.markdown-body .loose-note-block.source-note-frame.source-note-frame-frog {
  border-left: 2px solid #111;
  border-right: 9px solid #111;
}

.markdown-body .loose-note-block.source-note-frame.source-note-frame-frog::before {
  top: -1px;
  right: 0;
  left: 0;
  height: 28px;
  background: radial-gradient(ellipse 15px 24px at 16px 0, transparent 0 78%, #111 80% 88%, transparent 90%) 0 0 / 33px 28px repeat-x;
}

.markdown-body .loose-note-block.source-note-frame.source-note-frame-frog::after {
  right: 0;
  bottom: -1px;
  left: 0;
  height: 20px;
  background: #111;
  clip-path: polygon(0 12%, 8% 48%, 15% 18%, 25% 55%, 35% 26%, 47% 70%, 58% 31%, 69% 63%, 79% 38%, 88% 74%, 100% 42%, 100% 100%, 0 100%);
}

.markdown-body .loose-note-block.source-note-frame.source-note-frame-earth {
  border: 2px solid #1d2620;
  border-bottom: 0;
}

.markdown-body .loose-note-block.source-note-frame.source-note-frame-earth::before {
  top: -5px;
  right: -2px;
  left: -2px;
  height: 26px;
  background:
    linear-gradient(#fff, #fff) 0 0 / 100% 16px no-repeat,
    repeating-radial-gradient(circle at 30px 4px, #fff 0 12px, #1d2620 13px 14px, transparent 15px 72px) 0 0 / 220px 25px repeat-x;
}

.markdown-body .loose-note-block.source-note-frame.source-note-frame-earth::after {
  right: -2px;
  bottom: -1px;
  left: -2px;
  height: 22px;
  background: #1d2620;
  clip-path: polygon(0 12%, 6% 56%, 13% 14%, 20% 61%, 27% 17%, 35% 58%, 43% 13%, 50% 64%, 58% 18%, 65% 58%, 73% 14%, 81% 62%, 90% 18%, 100% 58%, 100% 100%, 0 100%);
}

.markdown-body .loose-note-block.source-note-frame.source-note-frame-frog .loose-note-title,
.markdown-body .loose-note-block.source-note-frame.source-note-frame-earth .loose-note-title {
  margin: 0 0 28px;
  color: #111;
  font-family: "Times New Roman", Times, serif;
  font-size: 23px;
  font-style: normal;
  font-weight: 700;
  line-height: 1.25;
}

.markdown-body .loose-note-block.source-note-frame.source-note-frame-frog .loose-note-section,
.markdown-body .loose-note-block.source-note-frame.source-note-frame-earth .loose-note-section {
  margin: 26px 0 7px;
  color: #111;
  font-family: "Times New Roman", Times, serif;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.32;
}

.markdown-body .loose-note-block.source-note-frame.source-note-frame-frog .loose-note-title + .loose-note-section,
.markdown-body .loose-note-block.source-note-frame.source-note-frame-earth .loose-note-title + .loose-note-section {
  margin-top: 0;
}

.markdown-body .loose-note-block.source-note-frame.source-note-frame-frog .lead-note-line,
.markdown-body .loose-note-block.source-note-frame.source-note-frame-frog .note-bullet,
.markdown-body .loose-note-block.source-note-frame.source-note-frame-earth .lead-note-line,
.markdown-body .loose-note-block.source-note-frame.source-note-frame-earth .note-bullet {
  color: #111;
  font-family: "Times New Roman", Times, serif;
  font-size: 19px;
  line-height: 1.48;
}

.markdown-body .loose-note-block.source-note-frame.source-note-frame-frog .note-bullet,
.markdown-body .loose-note-block.source-note-frame.source-note-frame-earth .note-bullet {
  grid-template-columns: 17px minmax(0, 1fr);
  column-gap: 7px;
}

.markdown-body .loose-note-block.source-note-frame.source-note-frame-frog .note-bullet + .note-bullet,
.markdown-body .loose-note-block.source-note-frame.source-note-frame-earth .note-bullet + .note-bullet {
  margin-top: 2px;
}

.markdown-body .loose-note-block.source-note-frame.source-note-frame-frog .inline-answer-wrap,
.markdown-body .loose-note-block.source-note-frame.source-note-frame-earth .inline-answer-wrap {
  width: 112px;
  margin: 0 3px;
}

.markdown-body .loose-note-block.source-note-frame.source-note-frame-frog .inline-answer,
.markdown-body .loose-note-block.source-note-frame.source-note-frame-earth .inline-answer {
  min-height: 25px;
  padding: 0 1px 2px;
  font-family: "Times New Roman", Times, serif;
  font-size: 18px;
}

.lead-note-heading {
  margin: 0 0 6px;
  font-weight: 700;
}

.standalone-lead-note-heading {
  margin-top: 10px;
}

.lead-note-line {
  margin: 0;
  line-height: 1.55;
}

.lead-note-line + .lead-note-line,
.lead-note-line + .note-bullet,
.lead-note-block .note-bullet + .lead-note-line {
  margin-top: 7px;
}

.note-bullet {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  column-gap: 7px;
  align-items: start;
  margin: 0;
}

.note-bullet + .note-bullet {
  margin-top: 7px;
}

.note-bullet-marker {
  text-align: center;
  font-weight: 700;
  line-height: 1.5;
}

.note-bullet-text {
  min-width: 0;
}

.note-bullet-heading .note-bullet-text {
  font-weight: 700;
}

.matching-answer-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.matching-answer-stem {
  min-width: 0;
}

.markdown-body table.heading-example-row-table {
  width: min(100%, 620px);
  margin: 10px 0 12px;
  border: 0;
  border-collapse: collapse;
  table-layout: fixed;
  background: #c8ceca;
}

.markdown-body table.heading-example-row-table td,
.markdown-body table.heading-example-row-table tr:first-child > td {
  border: 0;
  padding: 8px 24px;
  text-align: center;
  vertical-align: middle;
  font-weight: 700;
  line-height: 1.35;
  background: #c8ceca;
}

.supplemental-answer-panel {
  margin: 14px 0 6px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8faf9;
}

.image-answer-panel {
  margin: 4px 0 14px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.image-answer-panel .supplemental-answer-grid {
  gap: 8px 10px;
}

.supplemental-answer-title {
  margin: 0 0 8px;
  font-weight: 700;
  font-size: 13px;
}

.supplemental-answer-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.supplemental-answer-row {
  display: inline-grid;
  grid-template-columns: auto auto;
  gap: 6px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

.choice-group {
  margin: 0 0 16px;
}

.choice-question {
  margin: 0 0 10px;
}

.choice-question-number {
  font-weight: 700;
}

.choice-options {
  display: grid;
  gap: 10px;
  margin: 8px 0 14px;
}

.choice-option {
  display: grid;
  grid-template-columns: 20px 26px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  line-height: 1.45;
  cursor: pointer;
  position: relative;
}

.choice-control {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.choice-circle {
  width: 18px;
  height: 18px;
  border: 1.5px solid #7b8781;
  border-radius: 50%;
  background: #fff;
  display: grid;
  place-items: center;
  margin-top: 2px;
}

.choice-circle::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  opacity: 0;
}

.choice-option:hover .choice-circle {
  border-color: var(--green);
}

.choice-control:focus-visible + .choice-circle {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.choice-control:checked + .choice-circle {
  border-color: var(--green);
}

.choice-control:checked + .choice-circle::after {
  opacity: 1;
}

.choice-letter {
  font-weight: 700;
}

.choice-text {
  min-width: 0;
}

.judgement-group {
  margin: 0 0 18px;
}

.judgement-instructions {
  margin: 0 0 12px;
}

.judgement-instructions p {
  margin: 0 0 6px;
}

.judgement-list {
  display: grid;
  gap: 10px;
}

.judgement-question {
  display: grid;
  gap: 4px;
}

.judgement-stem {
  margin: 0;
}

.judgement-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding-left: 18px;
}

.judgement-option {
  display: inline-grid;
  grid-template-columns: 18px auto;
  gap: 5px;
  align-items: center;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
  position: relative;
}

.judgement-option .choice-circle {
  width: 16px;
  height: 16px;
  margin-top: 0;
}

.judgement-option .choice-circle::after {
  width: 7px;
  height: 7px;
}

.judgement-option-text {
  font-weight: 500;
}

.judgement-question.correct .judgement-stem,
.judgement-question.correct .judgement-option-text {
  color: var(--green);
}

.judgement-question.wrong .judgement-stem,
.judgement-question.wrong .judgement-option-text {
  color: var(--red);
}

.judgement-question.pending .judgement-stem,
.judgement-question.pending .judgement-option-text {
  color: var(--amber);
}

.matching-options-box {
  border: 1px solid #6f7772;
  box-sizing: border-box;
  width: fit-content;
  min-width: min(360px, calc(100% - 20px));
  max-width: min(calc(100% - 20px), 780px);
  margin: 10px 0 16px 20px;
  padding: 8px 10px 10px;
  background: #fff;
}

.matching-options-title {
  margin: 0 0 8px;
  font-weight: 700;
  text-align: center;
}

.matching-options-list {
  display: grid;
  gap: 7px;
}

.matching-option-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  column-gap: 8px;
  align-items: start;
}

.matching-option-letter {
  font-weight: 700;
}

.matching-option-text {
  min-width: 0;
  font-weight: 400;
}

.choice-group.correct .choice-question,
.choice-group.correct .choice-letter {
  color: var(--green);
}

.choice-group.wrong .choice-question,
.choice-group.wrong .choice-letter {
  color: var(--red);
}

.choice-group.pending .choice-question,
.choice-group.pending .choice-letter {
  color: var(--amber);
}

.inline-answer.correct {
  border-color: var(--green);
  background: #eef7f2;
}

.inline-answer.wrong {
  border-color: var(--red);
  background: #fff2f2;
}

.inline-answer.pending {
  border-color: var(--amber);
  background: #fff8e8;
}

.result-panel {
  padding-bottom: 12px;
}

.result-body {
  padding: 12px 14px;
}

.result-body.compact {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}

.result-body p {
  margin: 0 0 8px;
}

.result-body.compact p:last-child {
  margin-bottom: 0;
}

.listening-answer-panel,
.listening-transcript-panel {
  min-height: 0;
  overflow: hidden;
}

.listening-answer-panel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
}

.listening-answer-panel .explanation-part {
  min-height: 0;
  overflow: hidden;
  border-bottom: 0;
}

.listening-answer-panel .explanation-list {
  max-height: none;
  overflow: auto;
}

.listening-answer-list {
  padding: 10px;
}

.listening-answer-list .explanation-card {
  cursor: pointer;
}

.listening-answer-focus {
  min-height: 0;
  overflow: auto;
  padding: 10px;
}

.listening-answer-focus .explanation-card {
  cursor: pointer;
}

.listening-answer-empty {
  color: var(--muted);
  padding: 14px;
}

.explanation-card.active {
  box-shadow: 0 0 0 2px rgba(35, 92, 159, 0.18);
}

.listening-transcript-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.listening-transcript-panel h3 {
  margin: 0;
  padding: 12px 14px;
  font-size: 15px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}

.listening-transcript-list {
  overflow: auto;
  padding: 12px;
}

.listening-transcript-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
}

.listening-transcript-row.seekable {
  cursor: pointer;
}

.listening-transcript-row.seekable:hover {
  border-color: #b8c7d8;
  background: #f8fbff;
}

.listening-transcript-row + .listening-transcript-row {
  margin-top: 10px;
}

.listening-transcript-row.active {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(35, 92, 159, 0.14);
}

.listening-transcript-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.listening-transcript-qs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.listening-transcript-q {
  min-height: 26px;
  padding: 0 8px;
  border-color: #b8c7d8;
  background: #eef4fb;
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
}

.listening-transcript-time {
  color: var(--muted);
  font-size: 12px;
}

.listening-transcript-speaker {
  color: var(--blue);
}

.listening-transcript-row p {
  margin: 0;
  line-height: 1.65;
}

.listening-transcript-underline {
  text-decoration-line: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.listening-transcript-empty {
  padding: 14px;
  color: var(--muted);
}

.answer-explanations {
  border-top: 1px solid var(--line);
}

.answer-explanations-header {
  padding: 14px;
  background: #f7faf8;
  border-bottom: 1px solid var(--line);
}

.answer-explanations-header h4 {
  margin: 0 0 6px;
  font-size: 15px;
}

.answer-explanations-header p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.explanation-part {
  border-bottom: 1px solid var(--line);
}

.explanation-part h5 {
  margin: 0;
  padding: 11px 14px;
  font-size: 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}

.explanation-list {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.explanation-card {
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: 8px;
  background: white;
  overflow: hidden;
}

.explanation-card.correct {
  border-left-color: var(--green);
}

.explanation-card.wrong {
  border-left-color: var(--red);
}

.explanation-card.pending {
  border-left-color: var(--amber);
}

.explanation-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: #fbfcfb;
  border-bottom: 1px solid var(--line);
}

.question-badge {
  font-weight: 700;
  color: var(--ink);
}

.status-pill {
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 700;
}

.status-pill.correct {
  color: #12643a;
  background: #e7f5ed;
}

.status-pill.wrong {
  color: #8f1d20;
  background: #ffe9ea;
}

.status-pill.pending {
  color: #815b00;
  background: #fff2c7;
}

.answer-comparison {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0;
  margin: 0;
  border-bottom: 1px solid var(--line);
}

.answer-comparison div {
  padding: 10px 12px;
}

.answer-comparison div + div {
  border-left: 1px solid var(--line);
}

.answer-comparison dt {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
}

.answer-comparison dd {
  margin: 0;
  font-weight: 650;
  word-break: break-word;
}

.muted-answer,
.missing-explanation {
  color: var(--muted);
}

.explanation-markdown {
  padding: 12px;
  font-size: 14px;
  line-height: 1.65;
}

.explanation-markdown p {
  margin: 0 0 10px;
}

.explanation-markdown h6 {
  margin: 10px 0 6px;
  font-size: 13px;
}

.listening-explanation-evidence {
  padding: 10px 12px;
  border-left: 3px solid var(--blue);
  background: #f4f8fb;
}

.listening-explanation-evidence h6 {
  margin-top: 0;
}

.listening-explanation-evidence p {
  margin-bottom: 0;
}

.explanation-markdown table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0;
}

.explanation-markdown td,
.explanation-markdown th {
  border: 1px solid #aeb9b3;
  padding: 5px 7px;
  vertical-align: top;
}

.empty-state {
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
}

.source-path {
  word-break: break-all;
  color: var(--muted);
  font-size: 12px;
}

body.writing-active .shell {
  grid-template-columns: 360px minmax(0, 1fr);
}

body.writing-active .primary-button,
.module-tab[data-module-id="writing"].active {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

.writing-filter-panel {
  display: grid;
  gap: 10px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfa;
}

.writing-search-label,
.writing-filter-grid label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.writing-search,
.writing-filter-grid select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  padding: 7px 9px;
}

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

.writing-filter-grid label:last-child {
  grid-column: 1 / -1;
}

.writing-filter-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.writing-clear-filters {
  min-height: 30px;
  padding: 0 9px;
  font-size: 12px;
}

.writing-item-list {
  display: grid;
  gap: 8px;
  padding-top: 12px;
}

.writing-item-card {
  width: 100%;
  min-width: 0;
  display: grid;
  gap: 7px;
  padding: 11px;
  text-align: left;
  border-radius: 7px;
}

.writing-item-card:hover {
  background: #f6f8f7;
}

.writing-item-card.active {
  border-color: var(--red);
  background: #fff6f5;
  box-shadow: inset 3px 0 0 var(--red);
}

.writing-item-card-heading {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 7px;
}

.writing-item-number,
.writing-progress-badge {
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.writing-item-number {
  border-color: #bdc9c1;
  background: #f4f7f5;
  color: #45534c;
  font-variant-numeric: tabular-nums;
}

.writing-progress-badge.not-started {
  color: #65736b;
  background: #f4f6f5;
}

.writing-progress-badge.in-progress {
  border-color: #d59b50;
  background: #fff8ed;
  color: #915d1f;
}

.writing-progress-badge.completed {
  border-color: #a9cfb7;
  background: #edf7f1;
  color: #26714c;
}

.writing-item-card-title {
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.writing-item-card-preview {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.writing-item-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.writing-item-card-meta span,
.writing-item-kicker span,
.writing-source-chip,
.writing-complete-badge {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-2);
  color: #44534d;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 600;
}

.writing-no-results,
.writing-muted {
  color: var(--muted);
  font-size: 13px;
}

.writing-load-more {
  width: 100%;
  min-height: 38px;
  border-style: dashed;
  color: var(--muted);
  font-size: 12px;
}

.writing-dashboard {
  min-height: calc(100vh - 112px);
  display: grid;
  align-content: start;
  gap: 24px;
  padding: clamp(24px, 5vw, 64px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.writing-dashboard-header {
  max-width: 720px;
  padding-bottom: 20px;
  border-bottom: 3px solid var(--red);
}

.writing-eyebrow {
  margin: 0 0 8px;
  color: var(--red);
  font-size: 13px;
  font-weight: 700;
}

.writing-dashboard h2 {
  margin: 0;
  font-size: 32px;
  letter-spacing: 0;
}

.writing-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.writing-stats > div {
  min-height: 112px;
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 18px;
  background: var(--surface);
}

.writing-stats strong {
  font-size: 27px;
}

.writing-stats span {
  color: var(--muted);
  font-size: 13px;
}

.writing-view {
  display: grid;
  gap: 14px;
}

.writing-item-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.writing-item-header h2 {
  margin: 8px 0;
  font-size: 21px;
  letter-spacing: 0;
}

.writing-item-kicker,
.writing-source-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.writing-complete-badge {
  flex: 0 0 auto;
  border-color: #b8d3c4;
  background: #edf7f1;
  color: var(--green);
  padding: 5px 9px;
}

.writing-practice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
}

.writing-prompt-panel,
.writing-editor-panel,
.writing-analysis,
.writing-related {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.writing-analysis {
  scroll-margin-top: 76px;
}

.writing-prompt-panel,
.writing-editor-panel {
  min-height: calc(100vh - 190px);
}

.writing-prompt-panel > h3,
.writing-analysis-heading,
.writing-related > h3 {
  margin: 0;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}

.writing-prompt-panel > .writing-rich-text {
  max-height: calc(100vh - 245px);
  overflow: auto;
}

.writing-rich-text {
  padding: 17px;
  color: #25302c;
  font-size: 15px;
  line-height: 1.68;
  overflow-wrap: anywhere;
}

.writing-rich-text > :first-child {
  margin-top: 0;
}

.writing-rich-text > :last-child {
  margin-bottom: 0;
}

.writing-rich-text h3,
.writing-rich-text h4,
.writing-rich-text h5 {
  margin: 20px 0 9px;
  font-size: 16px;
  letter-spacing: 0;
}

.writing-rich-text p {
  margin: 0 0 13px;
  white-space: normal;
}

.writing-rich-text ul {
  margin: 0 0 14px;
  padding-left: 22px;
}

.writing-rich-text blockquote {
  margin: 12px 0;
  padding: 9px 12px;
  border-left: 3px solid #9cb0a5;
  background: #f5f7f6;
  color: var(--muted);
}

.writing-rich-text pre {
  overflow: auto;
  padding: 12px;
  border-radius: 6px;
  background: #202724;
  color: #f2f5f3;
}

.writing-table-wrap {
  width: 100%;
  overflow: auto;
  margin: 14px 0;
}

.writing-table-wrap table {
  width: 100%;
  min-width: 480px;
  border-collapse: collapse;
}

.writing-table-wrap td,
.writing-table-wrap th {
  border: 1px solid #aeb9b3;
  padding: 7px 9px;
  vertical-align: top;
}

.writing-source-image {
  margin: 16px 0;
}

.writing-image-button {
  width: 100%;
  height: auto;
  display: block;
  overflow: hidden;
  padding: 0;
  border-color: #bec8c2;
  background: #fff;
}

.writing-image-button img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}

.writing-source-image figcaption {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  text-align: right;
}

.writing-editor-panel {
  display: grid;
  grid-template-rows: auto auto minmax(540px, 1fr) auto auto;
  overflow: hidden;
}

.writing-editor-toolbar {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}

.writing-timer,
.writing-word-count {
  min-width: 82px;
  display: grid;
  grid-template-columns: auto auto;
  align-items: baseline;
  gap: 4px 7px;
}

.writing-timer span,
.writing-word-count span {
  color: var(--muted);
  font-size: 11px;
}

.writing-timer strong,
.writing-word-count strong {
  font-variant-numeric: tabular-nums;
  font-size: 17px;
}

.writing-timer strong.expired {
  color: var(--red);
  font-size: 14px;
}

.writing-word-count strong.target-met {
  color: var(--green);
}

.writing-editor-actions {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.writing-editor-actions button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
}

.writing-editor-label {
  padding: 10px 14px 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.writing-editor {
  width: 100%;
  min-width: 0;
  min-height: 540px;
  resize: vertical;
  border: 0;
  outline: 0;
  padding: 14px 18px 24px;
  color: #1c2421;
  background: #fff;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  line-height: 1.75;
}

.writing-editor:focus {
  box-shadow: inset 0 0 0 2px var(--focus);
}

.writing-complete-action {
  width: calc(100% - 28px);
  min-height: 38px;
  justify-self: center;
  margin: 0 14px 10px;
  border-color: var(--red);
  background: var(--red);
  color: #fff;
  font-weight: 700;
}

.writing-complete-action:hover {
  background: #a63535;
  border-color: #a63535;
}

.writing-complete-action.is-complete {
  border-color: #abcbb7;
  background: #edf7f1;
  color: #26714c;
}

.writing-save-state {
  min-height: 30px;
  padding: 7px 13px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  text-align: right;
}

.writing-save-state.saved {
  color: var(--green);
}

.writing-analysis-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.writing-analysis-heading h3,
.writing-related > h3 {
  margin: 0;
}

.writing-variant-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.writing-variant-tabs button {
  min-height: 31px;
  padding: 0 9px;
  font-size: 12px;
}

.writing-variant-tabs button.active {
  border-color: var(--red);
  background: var(--red);
  color: #fff;
}

.writing-analysis-sections {
  display: grid;
}

.writing-analysis-section {
  min-width: 0;
  padding: 0;
}

.writing-analysis-section + .writing-analysis-section {
  border-top: 1px solid var(--line);
}

.writing-analysis-section > h4 {
  margin: 0;
  padding: 13px 17px 0;
  color: #384740;
  font-size: 15px;
}

.writing-analysis-section .writing-rich-text {
  max-height: none;
}

.writing-related-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px;
}

.writing-related-list button {
  min-height: 34px;
  padding: 5px 10px;
  text-align: left;
}

.writing-image-dialog {
  width: min(92vw, 1200px);
  max-width: none;
  max-height: 92vh;
  overflow: auto;
  padding: 42px 18px 18px;
  border: 1px solid #718078;
  border-radius: 8px;
  background: #fff;
}

.writing-image-dialog::backdrop {
  background: rgba(21, 28, 25, 0.72);
}

.writing-image-dialog img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}

/* Source-scoped Listening Notes layouts. These profiles are attached only by
   the 62-entry source manifest, so unrelated question tables and notes retain
   their existing appearance. */
.markdown-body .loose-note-block.source-note-frame[class*="source-note-layout-"] {
  width: min(760px, 100%);
  min-height: 0;
  margin: 16px 0 24px;
  padding: clamp(30px, 5vw, 48px) clamp(28px, 6vw, 58px);
  border: 2px solid #4e514e;
  background: #fff;
  color: #111;
  font-family: "Times New Roman", Times, serif;
}

.markdown-body .loose-note-block.source-note-frame[class*="source-note-layout-"]::before,
.markdown-body .loose-note-block.source-note-frame[class*="source-note-layout-"]::after {
  content: none;
}

.markdown-body .loose-note-block.source-note-frame[class*="source-note-layout-"] .loose-note-title {
  margin: 0 0 24px;
  color: #111;
  font-family: "Times New Roman", Times, serif;
  font-size: 22px;
  font-style: normal;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
}

.markdown-body .loose-note-block.source-note-frame[class*="source-note-layout-"] .loose-note-section {
  margin: 21px 0 6px;
  color: #111;
  font-family: "Times New Roman", Times, serif;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.28;
}

.markdown-body .loose-note-block.source-note-frame[class*="source-note-layout-"] .loose-note-title + .loose-note-section {
  margin-top: 0;
}

.markdown-body .loose-note-block.source-note-frame[class*="source-note-layout-"] .lead-note-line,
.markdown-body .loose-note-block.source-note-frame[class*="source-note-layout-"] .note-bullet {
  color: #111;
  font-family: "Times New Roman", Times, serif;
  font-size: 17px;
  line-height: 1.46;
}

.markdown-body .loose-note-block.source-note-frame[class*="source-note-layout-"] .note-bullet {
  grid-template-columns: 16px minmax(0, 1fr);
  column-gap: 7px;
}

.markdown-body .loose-note-block.source-note-frame[class*="source-note-layout-"] .note-bullet-dash {
  margin-left: 25px;
}

.markdown-body .loose-note-block.source-note-frame[class*="source-note-layout-"] .inline-answer-wrap {
  width: 105px;
  margin: 0 3px;
}

.markdown-body .loose-note-block.source-note-frame[class*="source-note-layout-"] .inline-answer {
  min-height: 23px;
  padding: 0 2px 1px;
  font-family: "Times New Roman", Times, serif;
  font-size: 16px;
}

.markdown-body .loose-note-block.source-note-frame[class*="source-note-layout-"] .source-note-example-layout {
  margin: 2px 0 20px;
  color: #111;
  font-family: "Times New Roman", Times, serif;
  font-size: 17px;
  line-height: 1.4;
}

.markdown-body .loose-note-block.source-note-frame[class*="source-note-layout-"] .source-note-example-row {
  display: grid;
  align-items: baseline;
  column-gap: clamp(18px, 5vw, 64px);
  min-width: 0;
}

.markdown-body .loose-note-block.source-note-frame[class*="source-note-layout-"] .source-note-example-cell {
  min-width: 0;
}

.markdown-body .loose-note-block.source-note-frame[class*="source-note-layout-"] .source-note-example-grid .source-note-example-row,
.markdown-body .loose-note-block.source-note-frame[class*="source-note-layout-"] .source-note-example-band .source-note-example-row,
.markdown-body .loose-note-block.source-note-frame[class*="source-note-layout-"] .source-note-example-pair .source-note-example-row {
  grid-template-columns: minmax(130px, 0.9fr) minmax(160px, 1.1fr);
}

.markdown-body .loose-note-block.source-note-frame[class*="source-note-layout-"] .source-note-example-row + .source-note-example-row {
  margin-top: 8px;
}

.markdown-body .loose-note-block.source-note-frame[class*="source-note-layout-"] .source-note-example-colspan-2 {
  grid-column: span 2;
}

.markdown-body .loose-note-block.source-note-frame[class*="source-note-layout-"] .source-note-example-colspan-3 {
  grid-column: span 3;
}

.markdown-body .loose-note-block.source-note-frame[class*="source-note-layout-"] .source-note-example-answer {
  width: fit-content;
  max-width: 100%;
  border-bottom: 2px dotted #555;
  font-weight: 700;
}

.markdown-body .loose-note-block.source-note-frame[class*="source-note-layout-"] .source-note-example-box {
  padding: 7px 12px 9px;
  border: 1px solid #555;
}

.markdown-body .loose-note-block.source-note-frame[class*="source-note-layout-"] .source-note-example-box .source-note-example-row {
  grid-template-columns: 24px minmax(125px, 0.72fr) minmax(180px, 1.28fr);
  column-gap: 12px;
}

.markdown-body .loose-note-block.source-note-frame[class*="source-note-layout-"] .source-note-example-caption {
  font-style: italic;
}

.markdown-body .loose-note-block.source-note-frame[class*="source-note-layout-"] .source-note-example-box .source-note-example-caption {
  justify-self: start;
  margin-left: 42px;
}

.markdown-body .loose-note-block.source-note-frame[class*="source-note-layout-"] .source-note-example-marker {
  font-size: 22px;
  line-height: 1;
}

.markdown-body .loose-note-block.source-note-frame[class*="source-note-layout-"] .source-note-example-band {
  padding: 10px clamp(10px, 4vw, 38px) 11px;
  border-top: 1px solid #555;
  border-bottom: 1px solid #555;
}

.markdown-body .loose-note-block.source-note-frame[class*="source-note-layout-"] .source-note-example-pair {
  margin-top: 4px;
}

.markdown-body .loose-note-block.source-note-frame.source-note-birmingham,
.markdown-body .loose-note-block.source-note-frame.source-note-revision,
.markdown-body .loose-note-block.source-note-frame.source-note-hotel-reservation {
  padding-top: 58px;
}

.markdown-body .loose-note-block.source-note-frame.source-note-birmingham::before,
.markdown-body .loose-note-block.source-note-frame.source-note-revision::before,
.markdown-body .loose-note-block.source-note-frame.source-note-hotel-reservation::before {
  top: 5px;
  right: 24px;
  left: 24px;
  display: block;
  height: 32px;
  content: '';
  background: radial-gradient(ellipse at 20px 7px, #fff 0 9px, #555 10px 11px, transparent 12px) 0 0 / 28% 32px repeat-x;
}

.markdown-body .loose-note-block.source-note-frame.source-note-birmingham .loose-note-title,
.markdown-body .loose-note-block.source-note-frame.source-note-revision .loose-note-title {
  font-family: "Segoe Print", "Comic Sans MS", "Times New Roman", serif;
  font-style: italic;
  font-weight: 700;
}

.markdown-body .loose-note-block.source-note-frame.source-note-layout-scalloped {
  border-top: 0;
  border-bottom: 0;
  border-left-width: 4px;
  border-right-width: 4px;
  padding-top: 48px;
  padding-bottom: 50px;
}

.markdown-body .loose-note-block.source-note-frame.source-note-layout-scalloped::before,
.markdown-body .loose-note-block.source-note-frame.source-note-layout-scalloped::after {
  right: -4px;
  left: -4px;
  display: block;
  height: 24px;
  content: '';
  background: radial-gradient(ellipse 23px 15px at 23px -4px, transparent 82%, #4e514e 84% 92%, transparent 94%) 0 0 / 46px 24px repeat-x;
}

.markdown-body .loose-note-block.source-note-frame.source-note-layout-scalloped::before {
  top: 0;
}

.markdown-body .loose-note-block.source-note-frame.source-note-layout-scalloped::after {
  bottom: 0;
  transform: rotate(180deg);
}

.markdown-body .loose-note-block.source-note-frame.source-note-layout-rounded {
  border-width: 6px;
  border-radius: 22px;
}

.markdown-body .loose-note-block.source-note-frame.source-note-layout-rough {
  border: 3px double #4f524e;
  border-radius: 7px 15px 5px 12px;
  outline: 1px solid #737772;
  outline-offset: 3px;
}

.markdown-body .loose-note-block.source-note-frame.source-note-layout-cornered {
  border: 3px solid #4a4d49;
  box-shadow: inset 0 0 0 2px #fff, inset 0 0 0 3px #777b76;
}

.markdown-body .loose-note-block.source-note-frame.source-note-layout-simple,
.markdown-body .loose-note-block.source-note-frame.source-note-layout-thin {
  border-radius: 0;
}

.markdown-body .loose-note-block.source-note-frame.source-note-layout-thin {
  border-width: 1px;
}

.markdown-body .loose-note-block.source-note-frame.source-note-layout-notebook,
.markdown-body .loose-note-block.source-note-frame.source-note-layout-ring {
  margin-left: 18px;
  padding-left: clamp(38px, 7vw, 68px);
  border-radius: 8px;
}

.markdown-body .loose-note-block.source-note-frame.source-note-layout-notebook::before,
.markdown-body .loose-note-block.source-note-frame.source-note-layout-ring::before {
  top: 24px;
  bottom: 24px;
  left: -22px;
  display: block;
  width: 28px;
  height: auto;
  content: '';
  background:
    radial-gradient(circle at 18px 12px, #fff 0 5px, #555a56 6px 7px, transparent 8px) 0 0 / 28px 38px repeat-y;
}

.markdown-body .loose-note-block.source-note-frame.source-note-layout-ring::before {
  left: -26px;
  width: 34px;
  background:
    radial-gradient(ellipse at 21px 14px, transparent 0 7px, #4e514e 8px 10px, transparent 11px) 0 0 / 34px 44px repeat-y;
}

.markdown-body .loose-note-block.source-note-frame.source-note-layout-torn {
  border-radius: 3px 10px 5px 8px;
  box-shadow: 4px 5px 0 #d7d7d2;
  clip-path: polygon(0.5% 0.7%, 7% 0, 14% 0.8%, 23% 0.1%, 34% 0.9%, 45% 0.2%, 57% 0.7%, 70% 0, 82% 0.8%, 93% 0.1%, 99.5% 1%, 100% 98.8%, 91% 100%, 80% 99.2%, 68% 100%, 55% 99.1%, 43% 100%, 30% 99.2%, 18% 100%, 7% 99.1%, 0 99%);
}

.markdown-body .loose-note-block.source-note-frame.source-note-layout-scroll {
  border-radius: 34px 8px 34px 8px;
  box-shadow: inset 20px 0 0 #f3f3f0, inset -8px 0 0 #fafaf8;
  padding-left: clamp(45px, 8vw, 78px);
}

.markdown-body .loose-note-block.source-note-frame.source-note-layout-dogear {
  padding-bottom: 42px;
  border-radius: 0;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 34px), calc(100% - 34px) 100%, 0 100%);
  background: linear-gradient(135deg, transparent 23px, #dadbd7 24px 33px, #fff 34px) bottom right / 34px 34px no-repeat, #fff;
}

.markdown-body .loose-note-block.source-note-frame.source-note-layout-clipboard {
  margin-top: 54px;
  padding-top: 68px;
  border-width: 7px;
  border-radius: 28px;
}

.markdown-body .loose-note-block.source-note-frame.source-note-layout-clipboard::before {
  top: -48px;
  left: 28%;
  display: block;
  width: 44%;
  height: 80px;
  border: 8px solid #797c78;
  border-radius: 38px 38px 9px 9px;
  background: #b5b6b3;
  content: '';
}

.source-note-table-wrap {
  position: relative;
  isolation: isolate;
  width: min(780px, 100%);
  margin: 16px 0 24px;
  padding: 26px 30px 30px;
  border: 2px solid #4e514e;
  background: #fff;
  color: #111;
}

.markdown-body .source-note-table-wrap > table.source-note-layout-table,
.markdown-body .source-note-table-wrap > table.source-note-layout-table.note-frame-table {
  width: 100%;
  min-width: 0;
  max-width: none;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #111;
  font-family: "Times New Roman", Times, serif;
}

.markdown-body .source-note-table-wrap > table.source-note-layout-table td,
.markdown-body .source-note-table-wrap > table.source-note-layout-table tr:first-child > td {
  border: 0;
  padding: 5px 12px;
  color: #111;
  font-family: "Times New Roman", Times, serif;
  font-size: 17px;
  line-height: 1.42;
}

.markdown-body .source-note-table-wrap > table.source-note-layout-table .note-frame-title-cell,
.markdown-body .source-note-table-wrap > table.source-note-layout-table tr:first-child > td.note-frame-title-cell,
.markdown-body .source-note-table-wrap > table.source-note-layout-table tr:first-child > td[colspan] {
  padding: 7px 12px 18px;
  font-size: 22px;
  font-weight: 700;
  text-align: center !important;
}

.markdown-body .source-note-table-wrap > table.source-note-layout-table .note-frame-section-cell {
  padding: 16px 12px 4px;
  font-size: 18px;
  font-weight: 700;
}

.markdown-body .source-note-table-wrap > table.source-note-layout-table .source-note-table-marker {
  width: 18px;
  padding-right: 0;
  text-align: center !important;
}

.markdown-body .source-note-table-wrap > table.note-island-table .note-island-title,
.markdown-body .source-note-table-wrap > table.note-island-table tr:first-child > td.note-island-title,
.markdown-body .source-note-table-wrap > table.source-note-driving-school .note-frame-title-cell {
  font-family: "Arial Narrow", Impact, "Segoe UI", sans-serif;
  font-style: italic;
  font-weight: 900;
  letter-spacing: 1px;
}

.markdown-body .source-note-table-wrap.source-note-table-clipboard > table.note-complaint-form .note-form-title-cell,
.markdown-body .source-note-table-wrap.source-note-table-clipboard > table.note-complaint-form tr:first-child > td.note-form-title-cell {
  font-family: "Arial Narrow", Impact, "Segoe UI", sans-serif;
  font-style: italic;
  font-weight: 900;
  letter-spacing: 1px;
}

.markdown-body .source-note-table-wrap.source-note-table-clipboard > table.note-complaint-form td:first-child:not([colspan]) {
  font-weight: 400;
}

.markdown-body .source-note-table-wrap > table.source-note-layout-table tr.source-note-example-row > td {
  border: 1px solid #696c69;
}

.markdown-body .source-note-table-wrap > table.source-note-sharing-accommodation tr.source-note-example-row > td {
  border-bottom: 0;
}

.markdown-body .source-note-table-wrap > table.source-note-sharing-accommodation tr.source-note-example-row + tr.source-note-example-row > td {
  border-top: 0;
  border-bottom: 1px solid #696c69;
}

.markdown-body .source-note-table-wrap > table.source-note-layout-table tr.source-note-field-row > td:first-child:not(.source-note-table-marker) {
  width: 35%;
  vertical-align: top;
}

.markdown-body .source-note-table-wrap > table.source-note-house-rental tr.source-note-field-row > td:nth-child(2) {
  vertical-align: top;
  text-align: left !important;
}

.markdown-body .source-note-table-wrap > table.source-note-house-rental {
  table-layout: fixed;
}

.markdown-body .source-note-table-wrap > table.source-note-house-rental col.source-note-house-marker-column {
  width: 28px;
}

.markdown-body .source-note-table-wrap > table.source-note-house-rental col.source-note-house-label-column {
  width: 38%;
}

.markdown-body .source-note-table-wrap > table.source-note-house-rental tr.source-note-house-header > td {
  border-bottom: 0 !important;
  font-style: italic;
}

.markdown-body .source-note-table-wrap > table.source-note-house-rental .source-note-table-marker {
  width: 28px;
  font-size: 19px;
  line-height: 1.2;
}

.source-note-inline-list {
  display: grid;
  gap: 7px;
}

.source-note-inline-list-item {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 4px;
  align-items: start;
}

.source-note-inline-marker {
  font-size: 17px;
  line-height: 1.45;
  text-align: center;
}

.source-note-table-wrap.source-note-table-rounded {
  border-width: 7px;
  border-radius: 22px;
}

.source-note-table-wrap.source-note-table-thin,
.source-note-table-wrap.source-note-table-simple {
  border-radius: 0;
}

.source-note-table-wrap.source-note-table-thin {
  border-width: 1px;
}

.markdown-body .content-title:has(+ .source-note-table-wrap > table.source-note-sports-registration) {
  width: min(780px, 100%);
  margin: 18px 0 8px;
  text-align: center;
}

.markdown-body .source-note-table-wrap > table.source-note-sports-registration td:first-child {
  width: 46%;
  font-weight: 700;
}

.source-note-table-wrap.source-note-table-segmented {
  padding: 0;
  border-width: 1px;
  border-radius: 0;
}

.markdown-body .source-note-table-wrap.source-note-table-segmented > table.source-note-car-rental .note-frame-title-cell {
  padding: 8px 18px;
  border-bottom: 1px solid #666a66;
}

.markdown-body .source-note-table-wrap.source-note-table-segmented > table.source-note-car-rental .source-note-example-band > td {
  padding: 10px 38px 14px;
  border-bottom: 1px solid #666a66;
}

.markdown-body .source-note-table-wrap.source-note-table-segmented > table.source-note-car-rental .source-note-segment-line > td {
  padding: 5px 38px;
}

.markdown-body .source-note-table-wrap.source-note-table-segmented > table.source-note-car-rental .source-note-segment-heading > td {
  padding: 18px 38px 3px;
}

.markdown-body .source-note-table-wrap.source-note-table-segmented > table.source-note-car-rental .source-note-segment-bullet > td {
  padding: 3px 38px 3px 54px;
}

.source-note-small-marker {
  display: inline-block;
  width: 20px;
  margin-left: -22px;
  font-size: 13px;
  line-height: 1.4;
  text-align: center;
}

.source-note-incident-example-grid {
  display: grid;
  grid-template-columns: 38% minmax(0, 1fr);
  gap: 10px;
  margin-top: 3px;
  font-style: normal;
}

.source-note-incident-example-grid .example-underlined {
  justify-self: start;
}

.source-note-table-wrap.source-note-table-notebook,
.source-note-table-wrap.source-note-table-ring,
.source-note-table-wrap.source-note-table-ring-grid {
  margin-left: 20px;
  padding-left: 44px;
  border-radius: 8px;
}

.source-note-table-wrap.source-note-table-notebook {
  border: 0;
  box-shadow: none;
}

.source-note-table-wrap.source-note-table-notebook::before,
.source-note-table-wrap.source-note-table-ring::before,
.source-note-table-wrap.source-note-table-ring-grid::before {
  position: absolute;
  top: 22px;
  bottom: 22px;
  left: -23px;
  width: 30px;
  content: '';
  background: radial-gradient(circle at 19px 12px, #fff 0 5px, #555a56 6px 7px, transparent 8px) 0 0 / 30px 39px repeat-y;
}

.source-note-table-wrap.source-note-table-ring::before,
.source-note-table-wrap.source-note-table-ring-grid::before {
  background: radial-gradient(ellipse at 20px 13px, transparent 0 7px, #4e514e 8px 10px, transparent 11px) 0 0 / 32px 43px repeat-y;
}

.source-note-table-wrap.source-note-table-ring {
  margin-top: 52px;
  margin-left: 0;
  padding: 62px 30px 30px;
  border-width: 1px;
  border-radius: 3px;
}

.source-note-table-wrap.source-note-table-ring::before {
  top: -28px;
  right: 18px;
  bottom: auto;
  left: 18px;
  width: auto;
  height: 58px;
  background: radial-gradient(ellipse at 15px 29px, transparent 0 7px, #505450 8px 10px, transparent 11px) 0 0 / 34px 58px repeat-x;
}

.markdown-body .source-note-table-wrap.source-note-table-ring > table.damaged-fridge-note .damaged-fridge-title,
.markdown-body .source-note-table-wrap.source-note-table-ring > table.damaged-fridge-note tr:first-child > td.damaged-fridge-title {
  padding-bottom: 24px;
  font-family: "Segoe Print", "Bradley Hand", cursive;
  font-size: 22px;
  font-style: italic;
}

.source-note-table-wrap.source-note-table-scroll {
  margin-top: 62px;
  padding-left: 104px;
  border-radius: 42px 5px 34px 44px;
  box-shadow: none;
}

.source-note-table-wrap.source-note-table-scroll::before {
  position: absolute;
  z-index: 1;
  top: 20px;
  bottom: -42px;
  left: -2px;
  width: 86px;
  border: 2px solid #4e514e;
  border-radius: 45px;
  background: linear-gradient(90deg, #fff 0 58%, #d7d8d4 59% 77%, #fff 78%);
  content: '';
}

.source-note-table-wrap.source-note-table-scroll::after {
  position: absolute;
  z-index: 1;
  top: -52px;
  right: -2px;
  width: 88px;
  height: 72px;
  border: 2px solid #4e514e;
  border-bottom: 0;
  border-radius: 48px 48px 0 0;
  background: radial-gradient(circle at 26px 47px, #d0d1cd 0 26px, #fff 27px);
  content: '';
}

.markdown-body .source-note-table-wrap.source-note-table-scroll > table.source-note-layout-table {
  position: relative;
  z-index: 2;
}

.source-note-table-wrap.source-note-table-clipboard {
  margin-top: 52px;
  padding-top: 64px;
  border-width: 7px;
  border-radius: 28px;
}

.source-note-table-wrap.source-note-table-clipboard::before {
  position: absolute;
  top: -46px;
  left: 50%;
  width: 44%;
  height: 78px;
  border: 8px solid #797c78;
  border-radius: 38px 38px 9px 9px;
  background: linear-gradient(#c4c5c2 0 60%, #737673 61% 78%, #a7a9a6 79%);
  content: '';
  transform: translateX(-50%);
}

.source-note-table-wrap.source-note-table-clipboard::after {
  position: absolute;
  z-index: 2;
  top: -30px;
  left: 50%;
  width: 34px;
  height: 34px;
  border: 7px solid #797c78;
  border-radius: 50%;
  background: #fff;
  content: '';
  transform: translateX(-50%);
}

.source-note-table-wrap.source-note-table-clip,
.source-note-table-wrap.source-note-table-torn,
.source-note-table-wrap.source-note-table-torn-grid {
  border-radius: 5px 12px 7px 9px;
  box-shadow: 4px 5px 0 #d8d8d3;
  clip-path: polygon(0.5% 0.7%, 9% 0, 19% 0.8%, 31% 0.1%, 44% 0.8%, 57% 0.1%, 71% 0.8%, 84% 0, 99.5% 1%, 100% 98.8%, 87% 100%, 73% 99.2%, 59% 100%, 45% 99.2%, 30% 100%, 16% 99.1%, 0 99%);
}

.source-note-table-wrap.source-note-table-clip::before {
  position: absolute;
  z-index: 2;
  top: 7px;
  right: 10%;
  width: 22px;
  height: 58px;
  border: 7px solid #747774;
  border-top-width: 5px;
  border-radius: 15px 15px 18px 18px;
  content: '';
  transform: rotate(-14deg);
}

.source-note-table-wrap.source-note-table-torn {
  margin-top: 46px;
  padding-top: 60px;
}

.source-note-table-wrap.source-note-table-torn::before {
  position: absolute;
  z-index: 2;
  top: 5px;
  right: 9%;
  left: 9%;
  height: 36px;
  background: radial-gradient(ellipse at 15px 7px, transparent 0 7px, #5f635f 8px 9px, transparent 10px) 0 0 / 42px 32px repeat-x;
  content: '';
}

.source-note-table-wrap.source-note-table-dogear {
  padding-bottom: 42px;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 34px), calc(100% - 34px) 100%, 0 100%);
  background: linear-gradient(135deg, transparent 23px, #dadbd7 24px 33px, #fff 34px) bottom right / 34px 34px no-repeat, #fff;
}

.source-note-table-wrap.source-note-table-grid {
  padding: 0;
  border: 0;
}

.markdown-body .source-note-table-wrap.source-note-table-grid > table.source-note-layout-table,
.markdown-body .source-note-table-wrap.source-note-table-torn-grid > table.source-note-layout-table {
  border: 1px solid #5c605c;
  border-collapse: collapse;
}

.markdown-body .source-note-table-wrap.source-note-table-grid > table.source-note-layout-table td,
.markdown-body .source-note-table-wrap.source-note-table-grid > table.source-note-layout-table tr:first-child > td,
.markdown-body .source-note-table-wrap.source-note-table-torn-grid > table.source-note-layout-table td,
.markdown-body .source-note-table-wrap.source-note-table-torn-grid > table.source-note-layout-table tr:first-child > td {
  border: 1px solid #727672;
}

.source-note-table-wrap.source-note-table-ring-grid {
  border: 0;
  border-radius: 0;
  background: #eeeeeb;
}

.markdown-body .source-note-table-wrap.source-note-table-ring-grid > table.source-note-layout-table td,
.markdown-body .source-note-table-wrap.source-note-table-ring-grid > table.source-note-layout-table tr:first-child > td {
  border-bottom: 1px solid #a4a7a2;
}

.writing-image-close {
  position: absolute;
  top: 7px;
  right: 9px;
  width: 32px;
  min-height: 32px;
  border: 0;
  background: transparent;
  font-size: 25px;
  line-height: 1;
}

@media (max-width: 980px) {
  .shell {
    grid-template-columns: 1fr;
  }

  body.writing-active .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  body.writing-active .sidebar {
    max-height: 420px;
  }

  .practice-layout,
  .reading-grid,
  .stat-row,
  .writing-practice-grid {
    grid-template-columns: 1fr;
  }

  .writing-prompt-panel,
  .writing-editor-panel {
    min-height: 0;
  }

  .writing-prompt-panel > .writing-rich-text {
    max-height: none;
  }

  .practice-layout.listening-submitted-layout {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .listening-review-rail {
    position: static;
    max-height: none;
  }

  .listening-review-stack {
    grid-template-rows: auto auto;
    height: auto;
    min-height: 0;
  }

  .markdown-body {
    max-height: none;
  }

  .lettered-paragraph {
    grid-template-columns: 24px minmax(0, 1fr);
    column-gap: 8px;
  }
}

@media (max-width: 620px) {
  .topbar {
    align-items: flex-start;
    gap: 12px;
    padding: 13px 14px;
  }

  .topbar h1 {
    font-size: 18px;
  }

  .topbar p {
    display: none;
  }

  .shell .sidebar,
  .workspace {
    padding: 12px;
  }

  .module-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .module-tab {
    padding: 7px 4px;
    font-size: 12px;
  }

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

  .writing-filter-grid label:last-child {
    grid-column: 1 / -1;
  }

  .writing-dashboard {
    min-height: 0;
    padding: 22px 18px;
  }

  .writing-dashboard h2 {
    font-size: 26px;
  }

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

  .writing-stats > div {
    min-height: 92px;
    padding: 13px;
  }

  .writing-item-header,
  .writing-analysis-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .writing-item-header h2 {
    font-size: 18px;
  }

  .writing-editor-toolbar {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 9px 16px;
  }

  .writing-editor-actions {
    width: 100%;
    margin-left: 0;
  }

  .writing-editor-actions button {
    flex: 1 1 120px;
  }

  .writing-editor {
    min-height: 440px;
    padding: 13px 14px 20px;
    font-size: 16px;
  }

  .writing-rich-text {
    padding: 14px;
  }

  .writing-table-wrap table {
    min-width: 420px;
  }

  .writing-variant-tabs {
    width: 100%;
  }

  .writing-variant-tabs button {
    flex: 1 1 140px;
  }

  .markdown-body .loose-note-block {
    width: 100%;
    padding: 24px 20px 22px;
  }

  .markdown-body .loose-note-block.source-note-frame {
    min-height: 0;
    padding: 38px 26px 42px;
  }

  .markdown-body .loose-note-block.source-note-frame.source-note-frame-childcare {
    min-height: 0;
    padding: 38px 26px 42px;
  }

  .markdown-body .loose-note-block .loose-note-title {
    font-size: 19px;
    margin-bottom: 20px;
  }

  .markdown-body .loose-note-block.source-note-frame .loose-note-title {
    font-size: 20px;
  }

  .markdown-body .loose-note-block.source-note-frame.source-note-frame-childcare .loose-note-title {
    font-size: 21px;
  }

  .markdown-body .loose-note-block .loose-note-section {
    font-size: 16px;
  }

  .markdown-body .loose-note-block.source-note-frame .loose-note-section,
  .markdown-body .loose-note-block.source-note-frame .lead-note-line,
  .markdown-body .loose-note-block.source-note-frame .note-bullet {
    font-size: 16px;
  }

  .markdown-body .loose-note-block.source-note-frame.source-note-frame-childcare .loose-note-section,
  .markdown-body .loose-note-block.source-note-frame.source-note-frame-childcare .lead-note-line,
  .markdown-body .loose-note-block.source-note-frame.source-note-frame-childcare .note-bullet {
    font-size: 16px;
  }

  .markdown-body .loose-note-block.source-note-frame.source-note-frame-childcare .inline-answer-wrap {
    width: min(104px, 38vw);
  }

  .markdown-body .loose-note-block.source-note-frame.source-note-frame-drama {
    padding: 28px 18px 30px;
    border-width: 4px;
    border-radius: 14px;
  }

  .markdown-body .loose-note-block.source-note-frame.source-note-frame-drama .loose-note-title {
    margin-bottom: 20px;
    font-size: 19px;
  }

  .markdown-body .loose-note-block.source-note-frame.source-note-frame-drama .loose-note-section,
  .markdown-body .loose-note-block.source-note-frame.source-note-frame-drama .lead-note-line,
  .markdown-body .loose-note-block.source-note-frame.source-note-frame-drama .note-bullet {
    font-size: 16px;
  }

  .markdown-body .loose-note-block.source-note-frame.source-note-frame-drama .inline-answer-wrap {
    width: min(96px, 34vw);
  }

  .markdown-body .loose-note-block.source-note-frame.source-note-frame-greenwell {
    padding: 24px 16px 24px;
    border-width: 5px;
    border-radius: 15px;
  }

  .markdown-body .loose-note-block.source-note-frame.source-note-frame-greenwell .loose-note-title {
    margin-bottom: 18px;
    font-size: 18px;
  }

  .markdown-body .loose-note-block.source-note-frame.source-note-frame-greenwell .loose-note-section,
  .markdown-body .loose-note-block.source-note-frame.source-note-frame-greenwell .lead-note-line,
  .markdown-body .loose-note-block.source-note-frame.source-note-frame-greenwell .note-bullet {
    font-size: 15px;
  }

  .markdown-body .loose-note-block.source-note-frame.source-note-frame-greenwell .inline-answer-wrap {
    width: min(78px, 30vw);
  }

  .markdown-body .loose-note-block.source-note-frame.source-note-frame-textiles {
    min-height: 0;
    padding: 34px 18px 36px;
    border-left-width: 4px;
    border-right-width: 4px;
  }

  .markdown-body .loose-note-block.source-note-frame.source-note-frame-textiles::before,
  .markdown-body .loose-note-block.source-note-frame.source-note-frame-textiles::after {
    right: -4px;
    left: -4px;
  }

  .markdown-body .loose-note-block.source-note-frame.source-note-frame-textiles .loose-note-title {
    margin-bottom: 22px;
    font-size: 19px;
  }

  .markdown-body .loose-note-block.source-note-frame.source-note-frame-textiles .loose-note-section,
  .markdown-body .loose-note-block.source-note-frame.source-note-frame-textiles .lead-note-line,
  .markdown-body .loose-note-block.source-note-frame.source-note-frame-textiles .note-bullet {
    font-size: 15px;
  }

  .markdown-body .loose-note-block.source-note-frame.source-note-frame-textiles .note-bullet-dash {
    margin-left: 14px;
  }

  .markdown-body .loose-note-block.source-note-frame.source-note-frame-textiles .inline-answer-wrap {
    width: min(88px, 32vw);
  }

  .markdown-body .loose-note-block.source-note-frame.source-note-frame-flat {
    min-height: 0;
    padding: 32px 16px 36px;
    border-left-width: 4px;
    border-right-width: 4px;
  }

  .markdown-body .loose-note-block.source-note-frame.source-note-frame-flat::before,
  .markdown-body .loose-note-block.source-note-frame.source-note-frame-flat::after {
    right: -4px;
    left: -4px;
  }

  .markdown-body .loose-note-block.source-note-frame.source-note-frame-flat .loose-note-title {
    margin-bottom: 18px;
    font-size: 19px;
  }

  .markdown-body .loose-note-block.source-note-frame.source-note-frame-flat .loose-note-section,
  .markdown-body .loose-note-block.source-note-frame.source-note-frame-flat .lead-note-line,
  .markdown-body .loose-note-block.source-note-frame.source-note-frame-flat .note-bullet {
    font-size: 15px;
  }

  .markdown-body .loose-note-block.source-note-frame.source-note-frame-flat .note-bullet-dash {
    margin-left: 14px;
  }

  .markdown-body .loose-note-block.source-note-frame.source-note-frame-flat .inline-answer-wrap {
    width: min(84px, 32vw);
  }

  .markdown-body .loose-note-block .lead-note-line,
  .markdown-body .loose-note-block .note-bullet {
    font-size: 15px;
  }

  .visual-side-diagram {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .visual-side-labels {
    padding: 0;
  }

  .visual-side-labels .visual-answer-line {
    text-align: center;
  }
}

@media (max-width: 620px) {
  .markdown-body .source-note-table-wrap {
    overflow-x: auto;
    overflow-y: visible;
    padding-right: 12px;
    padding-left: 12px;
    overscroll-behavior-inline: contain;
  }

  .markdown-body .loose-note-block.source-note-frame[class*="source-note-layout-"] .source-note-example-grid .source-note-example-row,
  .markdown-body .loose-note-block.source-note-frame[class*="source-note-layout-"] .source-note-example-band .source-note-example-row,
  .markdown-body .loose-note-block.source-note-frame[class*="source-note-layout-"] .source-note-example-pair .source-note-example-row {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    column-gap: 8px;
  }

  .markdown-body .loose-note-block.source-note-frame[class*="source-note-layout-"] .source-note-example-box .source-note-example-row {
    grid-template-columns: 18px minmax(0, 0.8fr) minmax(0, 1.2fr);
    column-gap: 6px;
  }

  .markdown-body .loose-note-block.source-note-frame[class*="source-note-layout-"] .source-note-example-answer,
  .markdown-body .loose-note-block.source-note-frame[class*="source-note-layout-"] .source-note-example-cell {
    overflow-wrap: anywhere;
  }
}

/* Keep the app-shell layer authoritative after the legacy question-layout rules. */
.topbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 28px;
  min-height: 76px;
  padding: 12px max(24px, calc((100vw - 1440px) / 2));
  border: 0;
  background: var(--atlas-blue);
  color: #fff;
  box-shadow: 0 4px 0 rgba(7, 30, 100, 0.22);
}

.top-actions {
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.primary-button {
  min-height: 44px;
  border: 0;
  border-radius: 6px;
  background: var(--atlas-red);
  color: #fff;
  padding: 0 18px;
  font-weight: 750;
}

.primary-button:hover {
  border-color: transparent;
  background: #cf2f3d;
}

.shell {
  grid-template-columns: 310px minmax(0, 1fr);
  min-height: calc(100vh - 76px);
}

.sidebar {
  border-right: 1px solid var(--atlas-line);
  background: #f8faff;
  padding: 22px 18px;
}

.book-item {
  border-color: var(--atlas-line);
  border-radius: 10px;
  background: #fff;
  padding: 13px;
}

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

.paper-chip {
  display: grid;
  gap: 2px;
  min-height: 50px;
  padding: 7px 8px;
  border-color: var(--atlas-line);
  border-radius: 6px;
  background: #f7f9ff;
  color: var(--atlas-ink);
}

.paper-chip.active {
  border-color: var(--atlas-blue);
  background: var(--atlas-blue);
  color: #fff;
}

.workspace {
  background: #f3f6fd;
  padding: 24px;
}

.paper-header {
  border-color: var(--atlas-line);
  border-radius: 10px;
}

.segmented button.active {
  border-color: var(--atlas-blue);
  background: var(--atlas-blue);
  color: #fff;
}

@media (max-width: 1080px) {
  .topbar {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px 20px;
  }

  .top-actions {
    grid-column: 1 / -1;
  }
}

@media (max-width: 820px) {
  .topbar {
    position: static;
    grid-template-columns: 1fr;
    padding: 12px 16px;
  }

  .top-actions {
    grid-column: auto;
    justify-content: center;
  }

  .shell,
  body.speaking-active .shell,
  body.writing-active .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--atlas-line);
  }

  body.practice-active .sidebar {
    max-height: 340px;
    overflow-y: auto;
  }

  body.library-active.writing-active .workspace,
  body.library-active.speaking-active .workspace {
    padding: 18px;
  }

  body.library-active .writing-dashboard,
  body.library-active .speaking-dashboard {
    min-height: 0;
  }
}

/* Reference-aligned question library: compact two-column test index. */
:root {
  --atlas-blue: #1d4595;
  --atlas-blue-dark: #123474;
  --atlas-blue-soft: #e8effd;
  --atlas-yellow: #f7c946;
  --atlas-red: #f13f4a;
  --atlas-ink: #09204f;
  --atlas-muted: #53678f;
  --atlas-line: #ccd8ed;
  --focus: #ffcf3d;
}

.topbar {
  grid-template-columns: 260px minmax(0, 1fr) auto;
  gap: 22px;
  min-height: 72px;
  padding: 0 clamp(20px, 3vw, 44px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.17);
  box-shadow: none;
}

.brand-button {
  gap: 0;
}

.brand-mark {
  font-size: 26px;
  letter-spacing: -0.035em;
}

.brand-mark strong {
  display: inline;
  width: auto;
  height: auto;
  margin-right: 3px;
  border-radius: 0;
  background: transparent;
  color: var(--atlas-red);
  font-size: 34px;
  line-height: 1;
}

.brand-subtitle,
.source-meta {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.primary-navigation {
  justify-content: flex-start;
  align-self: stretch;
  gap: 20px;
}

.primary-navigation .module-tabs[hidden] {
  display: none !important;
}

.top-nav-home,
.top-nav-library,
.top-nav-placeholder {
  position: relative;
  display: inline-flex;
  align-items: center;
  align-self: stretch;
  min-height: 44px;
  padding: 0 2px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #cbd9f5;
  font-size: 14px;
  font-weight: 680;
  white-space: nowrap;
}

.top-nav-home:hover,
.top-nav-library:hover {
  border-color: transparent;
  background: transparent;
  color: #fff;
}

.top-nav-home.active,
.top-nav-library.active {
  background: transparent;
  color: #fff;
}

.top-nav-home.active::after,
.top-nav-library.active::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  background: var(--atlas-red);
  content: "";
}

.top-nav-placeholder {
  cursor: default;
}

.top-actions {
  display: flex;
  gap: 10px;
}

.global-search-button,
.learner-target {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.055);
  color: #fff;
}

.global-search-button {
  justify-content: space-between;
  gap: 24px;
  min-width: 166px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 650;
}

.global-search-button:hover {
  border-color: rgba(255, 255, 255, 0.46);
  background: rgba(255, 255, 255, 0.11);
}

.global-search-button kbd {
  border: 0;
  background: transparent;
  color: #a9bde6;
  font: inherit;
  font-size: 11px;
}

.learner-target {
  gap: 8px;
  padding: 0 13px;
  font-size: 13px;
  font-weight: 650;
}

.learner-target strong {
  color: var(--atlas-red);
  font-size: 14px;
}

body.home-active .shell,
body.atlas-library-active .shell {
  min-height: calc(100vh - 76px);
}

body.home-active .workspace,
body.atlas-library-active .workspace {
  min-height: calc(100vh - 76px);
}

body.atlas-library-active .workspace {
  padding: 26px clamp(20px, 3vw, 44px) 40px;
}

.reference-library {
  width: min(1352px, 100%);
  margin: 0 auto;
}

.library-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 24px;
  color: #ccdaf6;
  font-size: 12px;
  font-weight: 650;
}

.library-breadcrumb button {
  min-height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #ccdaf6;
  font: inherit;
}

.library-breadcrumb button:hover {
  border-color: transparent;
  color: #fff;
}

.library-breadcrumb strong {
  color: #fff;
}

.reference-library-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  min-height: 112px;
  padding: 22px 0 15px;
  color: #fff;
}

.reference-library-title h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(30px, 2.5vw, 38px);
  line-height: 1.1;
  letter-spacing: -0.045em;
}

.reference-library-title p {
  margin: 9px 0 0;
  color: #c8d7f5;
  font-size: 13px;
}

.reference-library-overview {
  display: flex;
  align-items: flex-end;
  gap: 70px;
}

.reference-status-legend {
  display: flex;
  gap: 18px;
  padding-bottom: 7px;
  color: #ccdaf6;
  font-size: 12px;
  font-weight: 700;
}

.reference-status-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.status-dot,
.reference-row-status i {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #9aabc4;
}

.status-dot.in-progress,
.reference-row-status.in-progress i {
  background: #c6730b;
}

.status-dot.completed,
.reference-row-status.completed i {
  background: #078a70;
}

.reference-total {
  display: grid;
  justify-items: end;
  min-width: 78px;
}

.reference-total strong {
  color: #ffd31f;
  font-size: 27px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.reference-total strong b {
  margin-left: 3px;
  font-size: 20px;
}

.reference-total span {
  margin-top: 5px;
  color: #dce6f9;
  font-size: 10px;
}

.reference-control-row {
  display: grid;
  grid-template-columns: minmax(0, 2.05fr) minmax(360px, 1fr);
  gap: 16px;
}

.reference-search-panel,
.reference-metrics {
  min-height: 108px;
  border-radius: 12px;
}

.reference-search-panel {
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 13px 16px;
  background: #fff;
}

.reference-search-row {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
}

.reference-search-row > label {
  color: #4c5f83;
  font-size: 12px;
  font-weight: 750;
}

.reference-search-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
}

.reference-search-field input {
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid #c9d7ee;
  border-right: 0;
  border-radius: 9px 0 0 9px;
  background: #fff;
  color: var(--atlas-ink);
  font-size: 14px;
}

.reference-search-field input::placeholder {
  color: #778aad;
}

.reference-search-field button {
  min-width: 72px;
  min-height: 44px;
  border: 1px solid #102d67;
  border-radius: 0 9px 9px 0;
  background: #102d67;
  color: #fff;
  font-size: 12px;
  font-weight: 750;
}

.reference-search-field button:hover {
  border-color: #0a2458;
  background: #0a2458;
}

.reference-type-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-left: 106px;
}

.reference-type-filters button {
  min-height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  background: #e4ebf8;
  color: #48618d;
  font-size: 12px;
  font-weight: 700;
}

.reference-type-filters button:hover {
  border-color: transparent;
  background: #d7e2f5;
}

.reference-type-filters button.active {
  background: var(--atlas-red);
  color: #fff;
}

.reference-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  background: var(--atlas-yellow);
  color: #09245c;
}

.reference-metrics span {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  min-width: 0;
}

.reference-metrics span + span {
  border-left: 1px solid rgba(64, 78, 87, 0.2);
}

.reference-metrics small {
  font-size: 11px;
}

.reference-metrics strong {
  font-size: 25px;
  font-variant-numeric: tabular-nums;
}

.reference-test-panel {
  overflow: hidden;
  margin-top: 16px;
  border-radius: 12px;
  background: #fff;
}

.reference-test-panel > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  padding: 0 20px;
  border-bottom: 1px solid var(--atlas-line);
}

.reference-test-panel > header > div {
  display: flex;
  align-items: baseline;
  gap: 16px;
}

.reference-test-panel h2 {
  margin: 0;
  color: #071a42;
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.25;
}

.reference-test-panel > header span {
  color: #53678f;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.4;
}

.reference-filter-toggle {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid #c8d6eb;
  border-radius: 9px;
  background: #fff;
  color: #536a94;
  font-size: 12px;
}

.reference-filter-toggle:hover {
  border-color: #8fa7cf;
  background: #f6f8fd;
}

.reference-advanced-filters {
  display: flex;
  align-items: end;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--atlas-line);
  background: #f7f9fd;
}

.reference-advanced-filters[hidden] {
  display: none;
}

.reference-advanced-filters label {
  display: grid;
  gap: 5px;
  color: #53678f;
  font-size: 11px;
  font-weight: 700;
}

.reference-advanced-filters select,
.reference-advanced-filters button {
  min-height: 38px;
}

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

.reference-test-row {
  display: grid;
  grid-template-columns: 34px minmax(180px, 1fr) auto auto 104px;
  align-items: center;
  gap: 14px;
  min-height: 148px;
  padding: 20px 18px;
  color: var(--atlas-ink);
  transition: background-color 180ms ease-out;
}

.reference-test-row:hover,
.reference-test-row:focus-within {
  background: #f7f9fd;
}

.reference-test-row:nth-child(odd) {
  border-right: 1px solid var(--atlas-line);
}

.reference-test-row:nth-child(n + 3) {
  border-top: 1px solid var(--atlas-line);
}

.reference-row-number {
  color: #38588d;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
}

.reference-test-title {
  display: grid;
  align-content: center;
  min-width: 0;
}

.reference-test-title small,
.reference-test-title span {
  color: #38527f;
  font-size: 0.8125rem;
  line-height: 1.4;
}

.reference-test-title small {
  font-weight: 600;
}

.reference-test-title span {
  font-weight: 500;
}

.reference-test-title strong {
  margin: 4px 0 6px;
  color: #071a42;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.25;
}

.reference-unit-progress {
  display: flex;
  gap: 6px;
}

.unit-chip {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 32px;
  border: 1px solid #b7cae6;
  border-radius: 7px;
  background: #fff;
  color: #38527f;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
}

.unit-chip.done {
  border-color: #83bdba;
  background: #e8f4f1;
  color: #007268;
}

.unit-chip.current {
  border-color: #d8b68c;
  background: #fff4e8;
  color: #a04c07;
}

.reference-row-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 82px;
  color: #3f5782;
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
}

.reference-row-status.in-progress {
  color: #b45a00;
}

.reference-row-status.completed {
  color: #007667;
}

.reference-row-action {
  min-width: 104px;
  min-height: 46px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  background: #d7e3f5;
  color: #0a2f70;
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.2;
}

.reference-row-action:hover {
  border-color: transparent;
  background: #cfdbf0;
}

.reference-row-action.in-progress {
  background: var(--atlas-red);
  color: #fff;
}

.reference-row-action.in-progress:hover {
  background: #d83340;
}

.reference-test-grid > .library-empty {
  grid-column: 1 / -1;
  min-height: 180px;
}

@media (max-width: 1180px) {
  .topbar {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .top-nav-placeholder,
  .learner-target {
    display: none;
  }

  .reference-library-overview {
    gap: 28px;
  }

  .reference-test-row {
    grid-template-columns: 32px minmax(150px, 1fr) auto 104px;
    gap: 12px;
  }

  .reference-row-status {
    grid-column: 2 / 3;
    margin-top: -20px;
  }

  .reference-row-action {
    grid-column: 4 / 5;
    grid-row: 1 / 2;
  }
}

@media (max-width: 920px) {
  .reference-library-hero {
    align-items: flex-start;
  }

  .reference-library-overview {
    gap: 18px;
  }

  .reference-status-legend {
    display: grid;
    gap: 5px;
  }

  .reference-control-row {
    grid-template-columns: 1fr;
  }

  .reference-metrics {
    min-height: 92px;
  }

  .reference-test-grid {
    grid-template-columns: 1fr;
  }

  .reference-test-row:nth-child(odd) {
    border-right: 0;
  }

  .reference-test-row:nth-child(n + 2) {
    border-top: 1px solid var(--atlas-line);
  }
}

@media (max-width: 700px) {
  .topbar {
    grid-template-columns: auto 1fr;
    min-height: 64px;
    padding: 0 16px;
  }

  .primary-navigation {
    justify-content: flex-end;
    gap: 16px;
  }

  .top-nav-placeholder,
  .top-actions {
    display: none;
  }

  body.home-active .shell,
  body.atlas-library-active .shell,
  body.home-active .workspace,
  body.atlas-library-active .workspace {
    min-height: calc(100vh - 64px);
  }

  body.atlas-library-active .workspace {
    padding: 18px 14px 28px;
  }

  .reference-library-hero {
    display: grid;
    gap: 18px;
    padding: 14px 0 18px;
  }

  .reference-library-overview {
    justify-content: space-between;
  }

  .reference-status-legend {
    display: flex;
    flex-wrap: wrap;
  }

  .reference-search-panel {
    padding: 14px;
  }

  .reference-search-row {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .reference-type-filters {
    padding-left: 0;
  }

  .reference-type-filters button {
    min-height: 44px;
  }

  .reference-test-panel > header > div {
    display: grid;
    gap: 2px;
  }

  .reference-advanced-filters {
    flex-wrap: wrap;
  }

  .reference-test-row,
  .reference-test-row:nth-child(n + 1) {
    grid-template-columns: 30px minmax(0, 1fr) 104px;
    gap: 12px;
    min-height: 178px;
    padding: 18px 14px;
  }

  .reference-unit-progress {
    grid-column: 2 / 3;
  }

  .reference-row-status {
    grid-column: 2 / 3;
    margin: 0;
  }

  .reference-row-action {
    grid-column: 3 / 4;
    grid-row: 1 / 4;
  }
}

@media (prefers-reduced-motion: reduce) {
  .reference-library *,
  .topbar * {
    scroll-behavior: auto;
    transition-duration: 0.01ms !important;
  }
}

/* Navigation v3: one top-level system, no persistent sidebar. */
.topbar {
  grid-template-columns: 260px minmax(0, 1fr) auto;
  min-height: 76px;
}

.primary-navigation {
  justify-content: flex-start;
  gap: 18px;
  overflow: hidden;
}

.primary-navigation .module-tabs {
  display: flex;
  align-self: stretch;
  gap: 18px;
  margin: 0;
}

.top-nav-home,
.primary-navigation .module-tab {
  position: relative;
  align-self: stretch;
  min-height: 44px;
  padding: 0 2px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #cbd9f5;
  font-size: 16px;
  font-weight: 700;
}

.top-nav-home:hover,
.primary-navigation .module-tab:hover {
  border-color: transparent;
  background: transparent;
  color: #fff;
}

.top-nav-home.active,
.primary-navigation .module-tab.active,
body.writing-active .primary-navigation .module-tab[data-module-id="writing"].active,
body.speaking-active .primary-navigation .module-tab[data-module-id="speaking"].active {
  border-color: transparent;
  background: transparent;
  color: #fff;
}

.top-nav-home.active::after,
.primary-navigation .module-tab.active::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  background: var(--atlas-red);
  content: "";
}

.shell,
body.writing-active .shell,
body.speaking-active .shell {
  display: block;
  min-height: calc(100vh - 76px);
}

.workspace {
  width: 100%;
  min-width: 0;
}

body.library-active.writing-active .workspace,
body.library-active.speaking-active .workspace {
  min-height: calc(100vh - 76px);
  padding: 26px clamp(18px, 3vw, 44px) 48px;
  background: #edf1f6;
}

body.practice-active .workspace {
  padding: 24px clamp(18px, 3vw, 40px) 48px;
  background: #f3f6fd;
}

body.practice-active .paper-view,
body.practice-active .writing-view,
body.practice-active .speaking-view {
  width: min(1600px, 100%);
  margin: 0 auto;
}

.module-back-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid #b9c8e1;
  border-radius: 8px;
  background: #fff;
  color: #244a86;
  font-size: 13px;
  font-weight: 750;
}

.module-back-button:hover {
  border-color: #7996c5;
  background: #f3f7fd;
}

.module-back-button.inverse {
  border-color: rgba(255, 255, 255, 0.38);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.module-back-button.inverse:hover {
  border-color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.14);
}

.library-breadcrumb .module-back-button {
  padding: 0 13px;
  color: #fff;
}

.paper-header .module-back-button,
.writing-item-header .module-back-button,
.speaking-item-header .module-back-button {
  margin-bottom: 12px;
}

.library-index-panel {
  display: grid;
  align-content: center;
  gap: 10px;
  min-height: 126px;
  padding: 14px 16px;
  border-radius: 12px;
  background: #fff;
}

.library-index-row {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
}

.library-index-row > strong {
  color: #42577d;
  font-size: 12px;
}

.library-index-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.library-index-tabs button {
  min-height: 40px;
  padding: 0 13px;
  border: 0;
  border-radius: 8px;
  background: #e6edf9;
  color: #405a86;
  font-size: 12px;
  font-weight: 720;
}

.library-index-tabs button:hover {
  border-color: transparent;
  background: #d8e3f5;
}

.library-index-tabs button.active {
  background: var(--atlas-blue);
  color: #fff;
}

.library-index-tabs.compact button {
  min-width: 78px;
}

.reference-control-row {
  align-items: stretch;
}

.reference-metrics {
  min-height: 126px;
}

.reference-test-panel > header {
  justify-content: flex-start;
}

/* Writing and speaking library surfaces. */
.study-library {
  width: min(1352px, 100%);
  margin: 0 auto;
  color: var(--atlas-ink);
}

.study-library-back {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 46px;
  margin-bottom: 12px;
  color: #52688f;
  font-size: 13px;
  font-weight: 600;
}

.study-library-back strong {
  color: #233e70;
}

.study-library-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  min-height: 132px;
  padding: 26px 28px;
  border-radius: 12px;
  background: var(--atlas-blue);
  color: #fff;
}

.study-library-heading h1 {
  margin: 0;
  color: #fff;
  font-size: 34px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.study-library-heading p {
  max-width: 62ch;
  margin: 10px 0 0;
  color: #e2e9f7;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.55;
}

.study-library-count {
  display: grid;
  justify-items: end;
  min-width: 90px;
}

.study-library-count strong {
  color: var(--atlas-yellow);
  font-size: 32px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.study-library-count span {
  margin-top: 8px;
  color: #e2e9f7;
  font-size: 12px;
  font-weight: 600;
}

.study-view-tabs {
  margin-top: 16px;
  padding: 10px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(19, 45, 91, 0.08);
}

.study-view-tabs .speaking-view-tabs {
  display: flex;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}

.study-view-tabs .speaking-view-tabs button {
  min-width: 110px;
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  background: #edf2f9;
  color: #344d78;
  font-size: 14px;
  font-weight: 700;
}

.study-view-tabs .speaking-view-tabs button.active {
  background: var(--atlas-blue);
  color: #fff;
}

.study-filter-panel {
  display: grid;
  gap: 0;
  margin-top: 16px;
  overflow: hidden;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(19, 45, 91, 0.08);
}

.study-filter-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  padding: 18px 20px;
}

.study-tab-group {
  display: flex;
  gap: 8px;
}

.study-tab-group button,
.study-chip-row button {
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  background: #edf2f9;
  color: #344d78;
  font-size: 13px;
  font-weight: 700;
}

.study-tab-group button:hover,
.study-chip-row button:hover {
  border-color: transparent;
  background: #dbe5f4;
}

.study-tab-group button.active,
.study-chip-row button.active {
  background: var(--atlas-blue);
  color: #fff;
}

.study-tab-group.secondary button.active {
  background: var(--atlas-blue);
}

.study-select-field,
.study-search-field {
  display: grid;
  gap: 4px;
  color: #3f557e;
  font-size: 12px;
  font-weight: 700;
}

.study-select-field select,
.study-search-field input {
  min-height: 44px;
  border: 1px solid #cbd7ea;
  border-radius: 8px;
  background: #fff;
  color: #142c58;
  padding: 0 12px;
  font-size: 14px;
}

.study-select-field select {
  min-width: 126px;
}

.study-search-field {
  flex: 1 1 280px;
  min-width: 240px;
}

.study-search-field input::placeholder {
  color: #667b9f;
  opacity: 1;
}

.study-chip-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  align-items: start;
  gap: 14px;
  padding: 12px 20px 16px;
  border-top: 1px solid #e2e8f2;
}

.study-chip-row > strong {
  padding-top: 12px;
  color: #324b75;
  font-size: 13px;
}

.study-chip-row > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.study-chip-row button {
  min-height: 44px;
  background: transparent;
}

.study-result-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
  padding: 17px 20px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(19, 45, 91, 0.08);
}

.study-result-strip > div:first-child {
  min-width: 0;
}

.study-result-strip h2 {
  margin: 0;
  color: #102750;
  font-size: 18px;
  line-height: 1.3;
}

.study-result-strip span {
  display: block;
  margin-top: 5px;
  color: #52688f;
  font-size: 13px;
  font-weight: 500;
}

.study-result-strip > button,
.study-result-strip > div:last-child button {
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid #c9d5e7;
  border-radius: 8px;
  background: #fff;
  color: #344f7b;
  font-size: 13px;
  font-weight: 700;
}

.study-result-strip > div:last-child {
  display: flex;
  gap: 8px;
}

.study-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.study-item-card {
  display: grid;
  grid-template-rows: auto auto minmax(52px, 1fr) auto auto;
  gap: 14px;
  min-width: 0;
  min-height: 320px;
  padding: 0 18px 18px;
  border: 1px solid #cbd7e8;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}

.study-item-card h3 {
  display: -webkit-box;
  min-width: 0;
  overflow: hidden;
  margin: 0;
  color: #0b2148;
  font-size: 17px;
  line-height: 1.4;
  font-weight: 700;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.study-item-card > p {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: #465d83;
  font-size: 14px;
  line-height: 1.6;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.speaking-library-card h3,
.speaking-library-card > p {
  -webkit-line-clamp: 2;
}

.study-card-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 60px;
  margin: 0 -18px;
  padding: 8px 16px;
  border-bottom: 1px solid #e1e8f2;
  background: #f7f9fc;
}

.status-label {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 6px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 700;
}

.status-label.not-started {
  background: #e7f1fd;
  color: #1e70b5;
}

.status-label.in-progress {
  background: #fff2df;
  color: #a85808;
}

.status-label.completed {
  background: #e6f4ef;
  color: #087465;
}

.study-card-tags {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 6px;
}

.study-card-tags span,
.study-item-card .writing-item-number {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border: 0;
  border-radius: 5px;
  background: #edf2f8;
  color: #3e557a;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 700;
}

.study-favorite-button {
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid #d2dbea;
  border-radius: 7px;
  background: #fff;
  color: #405779;
  font-size: 12px;
  font-weight: 700;
}

.study-favorite-button.active {
  border-color: #dfc66a;
  background: #fff7d6;
  color: #735300;
}

.study-favorite-button.active:hover {
  border-color: #d2b84d;
  background: #fff0ad;
}

.study-card-action {
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  background: var(--atlas-red);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}

.study-card-action:hover {
  border-color: transparent;
  background: #d83340;
}

.study-load-more {
  display: block;
  min-width: 220px;
  min-height: 48px;
  margin: 24px auto 0;
  border: 1px solid #b8c8e1;
  border-radius: 8px;
  background: #fff;
  color: #294f89;
  font-size: 14px;
  font-weight: 700;
}

.study-empty-state {
  grid-column: 1 / -1;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  min-height: 180px;
  border-radius: 12px;
  background: #fff;
  color: #586b8b;
}

.study-empty-state strong {
  color: #18325f;
}

.study-library [data-speaking-secondary] {
  margin-top: 14px;
}

.study-library [data-speaking-secondary] > section {
  border-radius: 12px;
  background: #fff;
  padding: 16px;
}

@media (max-width: 1080px) {
  .topbar {
    grid-template-columns: 190px minmax(0, 1fr) auto;
    gap: 14px;
  }

  .primary-navigation,
  .primary-navigation .module-tabs {
    gap: 12px;
  }

  .reference-control-row {
    grid-template-columns: 1fr;
  }

  .reference-metrics {
    min-height: 92px;
  }
}

@media (max-width: 760px) {
  .topbar {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0 12px;
    padding: 8px 14px 0;
  }

  .brand-button {
    align-self: center;
  }

  .primary-navigation {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: flex-start;
    min-width: 0;
    min-height: 50px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .primary-navigation::-webkit-scrollbar {
    display: none;
  }

  .primary-navigation .module-tabs {
    flex: 0 0 auto;
  }

  .top-actions {
    display: flex;
    grid-column: 2;
    grid-row: 1;
  }

  .learner-target {
    display: none;
  }

  body.library-active.writing-active .workspace,
  body.library-active.speaking-active .workspace,
  body.practice-active .workspace {
    padding: 18px 14px 32px;
  }

  .library-index-row {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .library-index-tabs button,
  .study-tab-group button,
  .study-chip-row button {
    min-height: 44px;
  }

  .study-library-heading {
    align-items: flex-start;
    padding: 18px;
  }

  .study-library-heading h1 {
    font-size: 27px;
  }

  .study-filter-toolbar {
    align-items: stretch;
  }

  .study-tab-group {
    flex: 1 1 auto;
    flex-wrap: wrap;
  }

  .study-select-field,
  .study-search-field {
    flex: 1 1 180px;
  }

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

@media (max-width: 520px) {
  .brand-mark {
    font-size: 21px;
  }

  .brand-mark strong {
    font-size: 27px;
  }

  .top-nav-home,
  .primary-navigation .module-tab {
    min-width: 44px;
    justify-content: center;
    font-size: 14px;
  }

  .study-library-heading p,
  .study-library-count span {
    font-size: 12px;
  }

  .study-library-count {
    min-width: 64px;
  }

  .study-library-count strong {
    font-size: 24px;
  }

  .study-view-tabs .speaking-view-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .study-view-tabs .speaking-view-tabs button {
    min-width: 0;
    padding: 0 8px;
  }

  .study-filter-toolbar,
  .study-chip-row,
  .study-result-strip {
    padding-right: 12px;
    padding-left: 12px;
  }

  .study-chip-row {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .study-chip-row > strong {
    padding-top: 0;
  }

  .study-select-field,
  .study-search-field {
    flex-basis: 100%;
  }

  .study-select-field select,
  .study-search-field input {
    width: 100%;
    min-height: 44px;
    font-size: 16px;
  }

  .study-result-strip {
    align-items: flex-start;
  }

  .study-result-strip > div:last-child {
    flex-direction: column;
  }

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

  .study-item-card {
    min-height: 0;
  }

  .paper-header,
  .writing-item-header,
  .speaking-item-header {
    display: grid;
  }
}

/* Reading: keep every submitted answer explanation with its question. */
.reading-inline-explanation-stack {
  display: grid;
  gap: 10px;
  margin: 4px 0 18px;
}

.reading-inline-explanation {
  overflow: hidden;
  border: 1px solid #9fc0f7;
  border-radius: 9px;
  background: #eef5ff;
  color: #19304f;
}

.reading-inline-explanation.correct {
  border-color: #9bcab5;
  background: #f0f8f4;
}

.reading-inline-explanation.wrong {
  border-color: #e0aaaa;
  background: #fff4f4;
}

.reading-inline-explanation.active {
  border-color: #2e75d6;
  box-shadow: 0 0 0 3px rgba(46, 117, 214, 0.16);
}

.reading-evidence-highlight {
  padding: 0 2px;
  border-radius: 3px;
  background: #cfe5ff;
  color: #103f7a;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.reading-inline-explanation-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  border-bottom: 1px solid rgba(35, 92, 159, 0.16);
}

.reading-inline-explanation-head > strong {
  color: #1f63c5;
  font-size: 14px;
}

.reading-inline-answer-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  border-bottom: 1px solid rgba(35, 92, 159, 0.16);
}

.reading-inline-answer-summary > div {
  min-width: 0;
  padding: 10px 14px;
}

.reading-inline-answer-summary > div + div {
  border-left: 1px solid rgba(35, 92, 159, 0.16);
}

.reading-inline-answer-summary dt {
  margin: 0 0 3px;
  color: #5b6f8b;
  font-size: 12px;
}

.reading-inline-answer-summary dd {
  margin: 0;
  color: #142a47;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.reading-inline-explanation-detail {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  padding: 12px 14px 14px;
}

.reading-inline-explanation-label {
  color: #1f63c5;
  font-size: 13px;
  line-height: 1.65;
}

.reading-inline-explanation-detail .explanation-markdown {
  min-width: 0;
  padding: 0;
  color: #19304f;
  font-size: 14px;
}

.reading-inline-explanation-detail .explanation-markdown p:last-child {
  margin-bottom: 0;
}

.markdown-body .reading-inline-explanation-detail table {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  margin: 8px 0;
}

.reading-inline-explanation-row > td {
  border: 0 !important;
  padding: 2px 0 14px !important;
  background: transparent !important;
}

@media (max-width: 620px) {
  .reading-inline-answer-summary {
    grid-template-columns: 1fr;
  }

  .reading-inline-answer-summary > div + div {
    border-top: 1px solid rgba(35, 92, 159, 0.16);
    border-left: 0;
  }

  .reading-inline-explanation-detail {
    grid-template-columns: 1fr;
    gap: 5px;
  }
}
