:root {
  --paper: #ffffff;
  --surface: #ffffff;
  --ink: #15232a;
  --muted: #465361;
  --teal: #155b59;
  --coral: #c6482d;
  --coral-dark: #a83b25;
  --rule: #bfc7c9;
  --serif: Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
html {
  background: var(--paper);
  color: var(--ink);
}
body {
  margin: 0;
  font: 18px/1.55 var(--sans);
}
button,
select,
textarea {
  font: inherit;
}
button,
a,
summary,
input,
select {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
a,
.text-button {
  color: var(--teal);
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
}
a:hover,
.text-button:hover {
  color: var(--coral-dark);
}
button:focus-visible,
a:focus-visible,
summary:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 4px;
}
h1:focus,
main:focus,
#explanation-heading:focus {
  outline: none;
}
p,
h1,
h2,
h3,
ol,
dl {
  margin: 0;
}
h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -0.025em;
}
h1 {
  font-size: clamp(48px, 6vw, 88px);
  line-height: 1.04;
  max-width: 1200px;
}
h2,
.editor-label {
  font: 400 clamp(30px, 3vw, 42px)/1.12 var(--serif);
  letter-spacing: -0.025em;
}
h3 {
  font-size: 27px;
}
.shell {
  max-width: 1536px;
  padding-inline: 64px;
  margin-inline: auto;
}
.masthead {
  min-height: 96px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 28px;
  position: relative;
}
.masthead::after {
  content: "";
  height: 1px;
  background: var(--ink);
  position: absolute;
  bottom: 0;
  left: 64px;
  right: 64px;
}
.brand {
  line-height: 0;
  flex-shrink: 0;
}
.brand img {
  width: 300px;
  height: auto;
}
.review-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  white-space: nowrap;
}
svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.skip-link {
  position: fixed;
  z-index: 10;
  top: 12px;
  left: 12px;
  padding: 12px 18px;
  color: var(--surface);
  background: var(--ink);
  transform: translateY(-180%);
}
.skip-link:focus {
  transform: none;
}
main {
  position: relative;
}
.progress {
  padding-top: 34px;
  margin-bottom: 38px;
}
.progress ol {
  display: flex;
  list-style: none;
  padding: 0;
  max-width: 780px;
}
.progress li {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  position: relative;
  font-size: 17px;
  color: var(--muted);
}
.progress li:not(:last-child)::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--rule);
  margin-inline: 12px 20px;
}
.step-number {
  border: 1px solid var(--rule);
  border-radius: 50%;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  font: 22px var(--serif);
  flex-shrink: 0;
}
.progress li[aria-current="step"] {
  color: var(--teal);
}
.progress li[aria-current="step"] .step-number {
  color: var(--surface);
  background: var(--teal);
  border-color: var(--teal);
}
.progress li[data-complete="true"]:not([aria-current="step"]) .step-number {
  color: var(--teal);
  border-color: var(--teal);
}
.lesson-step {
  padding-top: 44px;
}
.intro {
  margin-bottom: 0;
}
.deck {
  font: 400 clamp(20px, 1.8vw, 26px)/1.45 var(--serif);
  color: var(--muted);
  margin-top: 17px;
  max-width: 1020px;
}
.columns {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 44px;
}
.primary-column > h2,
.secondary-column > h2 {
  margin-bottom: 20px;
}
.secondary-column {
  padding-left: 44px;
  border-left: 1px solid var(--rule);
}
.paper-panel {
  padding: 26px 30px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 3px;
}
.label {
  font-size: 15px;
  color: var(--muted);
  margin-bottom: 12px;
}
.specimen {
  font: 400 27px/1.5 var(--serif);
}
.scenario {
  margin-bottom: 30px;
}
.prompt-heading {
  margin-top: 30px;
}
.prompt-text {
  font-size: 18px;
  line-height: 1.6;
  margin-top: 14px;
  margin-bottom: 28px;
  max-width: 780px;
}
.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
  min-height: 54px;
  padding: 13px 21px;
  border: 1px solid var(--ink);
  border-radius: 4px;
  font: 500 18px/1.35 var(--sans);
  text-align: center;
  transition: background-color 0.15s ease;
}
.primary {
  background: var(--coral);
  color: #fff;
  border-color: transparent;
}
.primary:hover {
  background: var(--coral-dark);
}
.secondary {
  background: transparent;
  color: var(--teal);
  border-color: var(--teal);
}
.secondary:hover {
  background: rgb(21 91 89 / 7%);
}
.text-button {
  border: 0;
  padding: 10px 0;
  min-height: 44px;
  background: none;
  text-align: left;
  text-decoration-line: underline;
  font: 400 16px/1.5 var(--sans);
}
.learning-list {
  list-style: none;
  padding: 0;
}
.learning-list li {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 12px;
  padding: 22px 0;
  border-bottom: 1px solid var(--rule);
}
.learning-list li:first-child {
  padding-top: 2px;
}
.learning-list li > span {
  color: var(--teal);
  font: 24px/1.4 var(--serif);
}
.learning-list h3 {
  font-size: 27px;
  margin-bottom: 8px;
}
.learning-list p,
.context-copy {
  color: var(--muted);
  font: 21px/1.5 var(--serif);
}
.quiet-note {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
  margin-top: 20px;
}
.learning-list + .quiet-note {
  max-width: 440px;
  margin-top: 25px;
}
.context-copy {
  margin-bottom: 26px;
}
.answer-choices {
  border: 0;
  padding: 0;
  margin: 0 0 20px;
  min-width: 0;
}
.answer-choices legend {
  font: 25px/1.25 var(--serif);
  margin-bottom: 16px;
  padding: 0;
}
.answer-choices label {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  border-bottom: 1px solid var(--rule);
  padding: 13px 0;
  cursor: pointer;
  font-size: 17px;
}
.answer-choices input {
  accent-color: var(--teal);
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin: 3px 0 0;
}
.reveal-button {
  display: block;
  margin-top: 8px;
}
.feedback {
  margin-top: 18px;
  color: var(--teal);
  font-size: 16px;
}
.feedback:empty {
  display: none;
}
.error {
  color: var(--coral-dark);
}
#clue.is-revealed {
  background: #f4dccb;
  box-shadow: 0 2px 0 var(--coral);
}
.explanation {
  margin-top: 30px;
  border-top: 1px solid var(--rule);
  padding-top: 25px;
}
.explanation h3 {
  color: var(--coral-dark);
  margin-bottom: 12px;
}
.explanation p {
  margin-bottom: 24px;
  max-width: 700px;
}
.secondary-actions {
  margin-top: 18px;
}
.editor-label {
  display: block;
}
#editor-instruction {
  margin: 12px 0 20px;
  max-width: 660px;
}
textarea {
  color: var(--ink);
  width: 100%;
  display: block;
  padding: 22px 26px;
  background: var(--surface);
  border: 1px solid var(--muted);
  border-radius: 3px;
  resize: vertical;
  min-height: 190px;
}
#draft-editor {
  font: 25px/1.5 var(--serif);
}
.revision-hint {
  min-height: 25px;
}
.correction {
  border-block: 1px solid var(--rule);
  padding-block: 16px;
  margin-top: 24px;
}
summary {
  color: var(--teal);
  font-size: 17px;
  min-height: 28px;
  cursor: pointer;
}
.correction p {
  margin-block: 18px;
  font: 23px/1.5 var(--serif);
}
.privacy-note {
  max-width: 660px;
}
.secondary-column > h2 + .quiet-note {
  margin-top: -5px;
}
.checks {
  margin-top: 20px;
}
.check-field {
  border-top: 1px solid var(--rule);
  padding-block: 16px;
}
.check-field label {
  display: block;
  font-size: 16px;
  line-height: 1.45;
}
.check-field label span {
  font: 25px/1.2 var(--serif);
  display: block;
  margin-bottom: 5px;
}
select {
  margin-top: 10px;
  width: 100%;
  min-height: 44px;
  padding: 9px 38px 9px 12px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--muted);
  border-radius: 3px;
  font-size: 16px;
}
.finish-button {
  margin-top: 12px;
}
.skip-button {
  display: block;
  margin-top: 8px;
}
.receipt-checks {
  margin-top: 25px;
}
.receipt-checks > div {
  display: grid;
  grid-template-columns: minmax(100px, 1fr) 1.4fr;
  padding-block: 20px;
  border-bottom: 1px solid var(--rule);
  gap: 20px;
}
.receipt-checks dt {
  font: 28px/1.3 var(--serif);
}
.receipt-checks dd {
  margin: 0;
  align-self: center;
  color: var(--teal);
  font-size: 18px;
}
.receipt-checks dd[data-status="review"],
.receipt-checks dd[data-status="unsure"] {
  color: var(--coral-dark);
}
.receipt-draft {
  font-size: 25px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
#copy-draft {
  margin-top: 23px;
}
.copy-note {
  margin-top: 14px;
}
.takeaway {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 88px;
  border-top: 1px solid var(--rule);
  margin-top: 48px;
  padding-top: 32px;
}
.takeaway h2 {
  font-size: 34px;
  margin-bottom: 14px;
}
.takeaway p {
  color: var(--muted);
  max-width: 760px;
}
.takeaway-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}
.next-lesson-step {
  margin: 25px 0 0;
  font-size: 19px;
}
.next-lesson-step a {
  color: var(--coral);
}
.copy-fallback {
  margin-top: 24px;
}
.copy-fallback h3 {
  margin-bottom: 12px;
}
.copy-fallback textarea {
  margin-top: 12px;
  font-size: 18px;
}
.lesson-footer {
  margin-top: 46px;
  padding: 24px 0 28px;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 14px;
}
.prototype-note {
  max-width: 780px;
}
.save-row {
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}
.save-row .text-button {
  font-size: 14px;
  white-space: nowrap;
}
.clear-confirmation {
  border-top: 1px solid var(--rule);
  margin-top: 14px;
  padding-top: 18px;
  color: var(--ink);
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  margin-top: 16px;
}
@media (max-width: 1050px) {
  .shell {
    padding-inline: 32px;
  }
  .masthead::after {
    left: 32px;
    right: 32px;
  }
  .columns {
    gap: 28px;
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  }
  .secondary-column {
    padding-left: 28px;
  }
  .specimen {
    font-size: 25px;
  }
  .button {
    gap: 12px;
    font-size: 17px;
  }
}
@media (max-width: 760px) {
  .shell {
    padding-inline: 22px;
  }
  .masthead {
    min-height: 88px;
    gap: 12px;
  }
  .masthead::after {
    left: 22px;
    right: 22px;
  }
  .brand img {
    width: 220px;
  }
  .review-link {
    max-width: 100px;
    white-space: normal;
    font-size: 13px;
    line-height: 1.3;
  }
  .review-link svg {
    display: none;
  }
  .progress {
    padding-top: 25px;
    margin-bottom: 30px;
  }
  .progress li {
    flex-direction: column;
    align-items: flex-start;
    gap: 7px;
    font-size: 14px;
  }
  .progress li:not(:last-child)::after {
    position: absolute;
    top: 18px;
    left: 43px;
    right: 16px;
    margin: 0;
  }
  .step-number {
    width: 36px;
    height: 36px;
    font-size: 20px;
  }
  h1 {
    font-size: clamp(42px, 9.5vw, 60px);
  }
  .deck {
    font-size: 21px;
    margin-top: 15px;
  }
  .lesson-step {
    padding-top: 30px;
  }
  .columns,
  .takeaway {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .secondary-column {
    border-left: 0;
    border-top: 1px solid var(--rule);
    padding: 28px 0 0;
  }
  h2,
  .editor-label {
    font-size: 31px;
  }
  h3 {
    font-size: 25px;
  }
  .specimen {
    font-size: 24px;
    line-height: 1.45;
  }
  .paper-panel {
    padding: 21px;
  }
  .prompt-text {
    font-size: 17px;
  }
  .button {
    width: 100%;
    justify-content: space-between;
    padding: 13px 18px;
  }
  .secondary {
    justify-content: center;
  }
  #copy-draft {
    justify-content: center;
  }
  .learning-list h3 {
    font-size: 25px;
  }
  .learning-list p {
    font-size: 20px;
  }
  #draft-editor {
    font-size: 23px;
    padding: 20px;
    min-height: 240px;
  }
  .takeaway {
    gap: 23px;
    margin-top: 34px;
    padding-top: 26px;
  }
  .takeaway h2 {
    font-size: 31px;
  }
  .takeaway-actions {
    align-items: stretch;
  }
  .receipt-checks > div {
    grid-template-columns: 1fr;
    gap: 5px;
    padding-block: 15px;
  }
  .receipt-checks dt {
    font-size: 26px;
  }
  .save-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 0;
    margin-top: 12px;
  }
  .lesson-footer {
    margin-top: 32px;
  }
  .actions {
    flex-direction: column;
    align-items: flex-start;
  }
}
@media (max-width: 360px) {
  .shell {
    padding-inline: 18px;
  }
  .masthead::after {
    left: 18px;
    right: 18px;
  }
  .brand img {
    width: 184px;
  }
  .review-link {
    font-size: 12px;
  }
  .progress li {
    font-size: 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* Optional local saving uses the same controls as the lesson. */
.save-controls {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  margin-top: 20px;
}
.save-controls > div:first-child {
  max-width: 760px;
}
.storage-note {
  margin-top: 6px;
  max-width: 700px;
  line-height: 1.5;
}
.save-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}
.save-actions .button {
  font-size: 16px;
  min-height: 46px;
  padding: 10px 16px;
}
#save-status[data-status="error"] {
  color: var(--coral-dark);
}
#save-status[data-status="saved"] {
  color: var(--teal);
}
@media (max-width: 760px) {
  .save-controls {
    flex-direction: column;
    gap: 15px;
  }
  .save-actions {
    width: 100%;
  }
  .brand img {
    max-width: 53vw;
  }
}
@media (max-width: 360px) {
  .brand img {
    width: 174px;
  }
}
