:root {
  color-scheme: light;
  font: 15px/1.5 system-ui, sans-serif;
  color: #192b36;
  background: #f7f6f2;
  --green: #315547;
  --green-hover: #254639;
  --dark: #192b36;
  --line: #dddcd5;
  --muted: #53615c;
  --paper: #fff;
  --soft: #e6eee8;
  --quiet-surface: #f5f4ef;
  --control-line: #aeb3ab;
  --control-height: 38px;
  --radius: 8px;
  --inset: clamp(14px, 2.6vw, 22px);
  --cover-width: 74px;
  --cover-height: 99px;
}

* { box-sizing: border-box; }
body { margin: 0; }
h1, h2, h3, p { margin: 0 0 8px; overflow-wrap: anywhere; }
h1, h2, h3 { line-height: 1.2; }
h1, h2 { font-family: Georgia, serif; font-weight: 500; }
h1 { font-size: clamp(32px, 3.3vw, 42px); letter-spacing: -.035em; }
h2 { font-size: clamp(24px, 2.1vw, 28px); letter-spacing: -.02em; }
h3 { font-size: 17px; font-weight: 600; }
a { color: var(--green); text-underline-offset: .2em; }
:focus-visible { outline: 2px solid #346d91; outline-offset: 3px; }

button, .button {
  display: inline-flex; align-items: center; justify-content: center; max-width: 100%;
  min-height: var(--control-height); padding: 6px 12px;
  border: 1px solid var(--green); border-radius: var(--radius);
  background: var(--green); color: #fff; font: inherit; font-weight: 600;
  text-align: center; text-decoration: none; overflow-wrap: anywhere; cursor: pointer;
}
button:hover:not(:disabled), .button:hover { background: var(--green-hover); }
button:disabled { background: var(--quiet-surface); color: var(--muted); border-color: var(--line); cursor: wait; }
.secondary { border-color: var(--line); background: var(--paper); color: var(--green); }
button.secondary:hover:not(:disabled), .button.secondary:hover { background: var(--soft); }
.text-button, .quiet {
  padding: 0; border: 0; background: none; color: var(--green);
  font-weight: 500; text-decoration: underline; text-underline-offset: .2em;
}
button:is(.text-button, .quiet):hover:not(:disabled) { background: none; color: var(--dark); }
.skip { position: absolute; top: -8rem; z-index: 100; background: var(--paper); padding: 12px; }
.skip:focus { top: 0; }

.masthead { background: var(--paper); border-bottom: 1px solid var(--line); }
.topbar, .workspace, .site-footer { max-width: 1080px; margin-inline: auto; padding-inline: clamp(16px, 4vw, 32px); }
.topbar { display: flex; align-items: center; gap: clamp(12px, 3vw, 28px); min-height: 68px; }
.brand { flex-shrink: 0; display: inline-flex; }
.brand img { display: block; width: 124px; height: auto; }
.topbar nav { display: flex; flex-wrap: wrap; gap: 4px; }
.topbar nav a, .account summary, .account-links > a {
  display: flex; align-items: center; min-height: var(--control-height); padding: 5px 9px;
  border-radius: var(--radius); color: var(--dark); font-size: 14px; font-weight: 500; text-decoration: none;
}
.topbar nav a:hover, .account summary:hover { background: var(--quiet-surface); }
.topbar nav a[aria-current=page] { background: var(--soft); color: var(--green); font-weight: 600; }
.account-links { margin-inline-start: auto; min-width: 0; max-width: 28%; }
.account { position: relative; }
.account summary { display: list-item; align-content: center; cursor: pointer; overflow-wrap: anywhere; }
.account-menu {
  z-index: 5; position: absolute; inset: calc(100% + 4px) 0 auto auto;
  width: min(240px, 85vw); padding: 12px 14px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper);
  box-shadow: 0 4px 14px rgb(25 43 54 / 9%); overflow-wrap: anywhere;
}

.workspace, .narrow { padding-block: clamp(22px, 4vw, 40px); }
.narrow { width: min(100% - 32px, 560px); margin-inline: auto; }
.site-footer {
  display: flex; flex-wrap: wrap; gap: 6px 18px; padding-block: 16px 28px;
  border-top: 1px solid var(--line); font-size: 13px;
}
.sample-links { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.context, .muted, .reference { color: var(--muted); }
.context, .reference { font-size: 13px; overflow-wrap: anywhere; }

.panel, .course, .continue {
  min-width: 0; padding: var(--inset); border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--paper);
}
:is(.panel, .course, .continue) > :last-child { margin-bottom: 0; }
.empty, .narrow > .login { margin-block-start: 16px; }
.continue {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px;
  margin: 16px 0 22px; background: #eff3ed;
}
.continue h2 { margin-bottom: 4px; }
.continue p { margin-bottom: 0; color: var(--muted); }
.workspace section + section { margin-top: 20px; }
.course-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr));
  align-items: start; gap: 12px; margin-top: 12px;
}
.course-main {
  display: grid; grid-template-columns: var(--cover-width) minmax(0, 1fr);
  align-items: start; gap: 12px; margin-bottom: 12px;
}
.course-main h3 { margin-bottom: 6px; }
.course-main .muted { font-size: 13px; }
.cover {
  display: block; width: var(--cover-width); height: var(--cover-height);
  object-fit: contain; border-radius: 5px;
}
.fallback {
  display: grid; align-items: end; padding: 7px; border-inline-start: 3px solid #779484;
  background: #dfe9e1; color: var(--green); font: 12px/1.1 Georgia, serif;
  overflow: hidden; overflow-wrap: anywhere;
}
.badge {
  display: inline-block; margin-bottom: 6px; padding: 2px 7px; border-radius: 6px;
  background: var(--quiet-surface); color: var(--dark); font-size: 12px; font-weight: 600;
}
.badge.good { background: var(--soft); color: var(--green); }
.badge.warning { background: #f4ebe0; color: #754321; }
summary { min-height: var(--control-height); padding: 8px 0; color: var(--green); font-weight: 500; cursor: pointer; }
.grant-details { margin-top: 10px; border-top: 1px solid var(--line); }
.grant { padding: 8px 0; border-bottom: 1px solid var(--line); }
.grant:last-child { border: 0; }
.lesson-list { margin-block: 0 8px; padding-inline-start: 20px; }
.lesson-list li { padding-block: 4px; }
.renewal { margin-top: 8px; color: var(--muted); font-size: 13px; }
.notice { padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--quiet-surface); }
.notice.error { margin-bottom: 12px; border-color: #dfb6b8; background: #fdf3f2; color: #8c2534; }
.actions, .setup-account { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.actions > *, .setup-account > * { min-width: 0; max-width: 100%; }

.purchase-list { display: grid; gap: 12px; margin-block: 14px 0; padding: 0; list-style: none; }
.purchase { display: grid; gap: 14px; overflow-wrap: anywhere; }
.purchase:has(.purchase-actions:not(:empty)) { grid-template-columns: minmax(0, 1fr) minmax(0, 300px); }
.purchase-actions:empty { display: none; }
.purchase-actions .muted { margin-top: 8px; font-size: 13px; }
.purchase:target { border-color: var(--green); }
.copy-status { margin-inline-start: 6px; color: var(--green); }

.setup-account { justify-content: space-between; gap: 0 12px; }
.setup-account .context { margin-bottom: 0; }
.steps {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px;
  margin: 12px 0; padding: 0; list-style: none;
}
.steps li {
  padding: 7px 8px; border-block-end: 2px solid var(--line); border-radius: 5px 5px 0 0;
  color: var(--muted); font-size: 13px; font-weight: 500; overflow-wrap: anywhere;
}
.steps li[aria-current] { border-color: var(--green); background: var(--soft); color: var(--green); font-weight: 600; }
.facts { display: grid; gap: 6px; margin: 10px 0; padding: 10px 12px; border-radius: 6px; background: var(--quiet-surface); }
.facts div { display: grid; grid-template-columns: minmax(110px, 38%) minmax(0, 1fr); gap: 8px; }
.facts dt { color: var(--muted); font-size: 13px; }
.facts dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
label:not(.choice), legend { font-size: 13px; font-weight: 600; }
label:not(.choice) { display: block; }
input:not([type=radio], [type=hidden]), select {
  display: block; min-height: var(--control-height); width: 100%; margin: 4px 0 10px; padding: 6px 9px;
  border: 1px solid var(--control-line); border-radius: var(--radius);
  background: #fcfcfa; color: var(--dark); font: inherit; font-size: 15px; font-weight: 400;
}
input[readonly] { border-color: var(--line); background: var(--quiet-surface); }
:is(input, select):user-invalid { border-color: #9a2738; }
fieldset { min-width: 0; margin: 10px 0; padding: 4px 8px 8px; border: 1px solid var(--line); border-radius: var(--radius); }
legend { padding-inline: 4px; }
.choice { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 4px 6px; border-radius: 6px; cursor: pointer; }
.choice:has(:checked) { background: var(--soft); }
.choice input { flex: none; width: 16px; height: 16px; margin: 0; accent-color: var(--green); }
:is(.journey, .login) :is(form, .actions) + p { margin-top: 10px; }
.journey form > .muted { font-size: 13px; }

@media (max-width: 760px) {
  :root { --control-height: 44px; }
  .topbar {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 4px 10px; padding-block: 4px 6px;
  }
  .brand { justify-self: start; }
  .brand img { width: 112px; }
  .topbar nav { grid-column: 1 / -1; grid-row: 2; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; }
  .topbar nav a { justify-content: center; padding-inline: 5px; text-align: center; font-size: 13px; }
  .account-links { max-width: 100%; }
  .purchase:has(.purchase-actions:not(:empty)) { grid-template-columns: 1fr; }
  .purchase-actions:not(:empty) { border-top: 1px solid var(--line); padding-top: 12px; }
  input:not([type=radio], [type=hidden]), select { font-size: 16px; }
}

@media (max-width: 490px) {
  :root { --cover-width: 66px; --cover-height: 88px; }
  .continue .button { grid-column: 1 / -1; justify-self: start; }
}
