/* =====================================================================
   ACOE — Alabama Educator Code of Ethics
   Palette drawn from the ACOE logo: navy wordmark, apple red, leaf green.
   Green marks ethical conduct; red marks unethical conduct.
   ===================================================================== */

:root {
  --navy: #1F3F73;
  --navy-deep: #142A4F;
  --navy-tint: #E8EEF7;
  --ink: #1C2533;
  --muted: #566376;
  --line: #D5DCE6;
  --bg: #F2F4F7;
  --surface: #FFFFFF;
  --leaf: #2C7A4B;
  --leaf-tint: #EAF4EE;
  --apple: #B3302A;
  --apple-tint: #FBEDEB;
  --gold: #A4802C;

  --serif: "Source Serif 4", "Source Serif Pro", Georgia, "Times New Roman", serif;
  --sans: "Public Sans", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --radius-sm: 4px;
  --radius: 8px;
  --measure: 70ch;
  --focus: 0 0 0 3px #FFFFFF, 0 0 0 5px var(--navy);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 9rem; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; outline: none; }

img { max-width: 100%; height: auto; }

a { color: var(--navy); text-underline-offset: 2px; }
a:hover { color: var(--navy-deep); }

h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; color: var(--navy-deep); }

[hidden] { display: none !important; }

:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--radius-sm); }

.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--navy); color: #fff; padding: .6rem 1rem; border-radius: var(--radius-sm);
}
.skip-link:focus { top: 1rem; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------------------------------------------------------------- Buttons */

.btn {
  font: 600 1rem/1.2 var(--sans);
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .8rem 1.35rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--navy-deep); }
.btn-secondary { background: var(--surface); color: var(--navy); border-color: var(--navy); }
.btn-secondary:hover:not(:disabled) { background: var(--navy-tint); }
.btn-quiet { background: transparent; color: var(--navy); border-color: var(--line); }
.btn-quiet:hover { border-color: var(--navy); }
.btn-success { background: var(--leaf); color: #fff; }
.btn-success:hover:not(:disabled) { background: #22613B; }
.btn-small { padding: .45rem .8rem; font-size: .875rem; }
.btn-large { padding: 1rem 1.75rem; font-size: 1.0625rem; }
.btn-block { width: 100%; }

/* ---------------------------------------------------------------- Header */

.site-head {
  position: sticky; top: 0; z-index: 20;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.site-head-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .6rem 1.25rem;
}
.brand { display: flex; align-items: center; gap: .85rem; text-decoration: none; color: inherit; min-width: 0; }
.brand img { width: 72px; height: auto; flex: none; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-course { font-family: var(--serif); font-weight: 700; font-size: 1.1rem; color: var(--navy-deep); line-height: 1.2; }
.brand-credit { font-size: .82rem; color: var(--muted); }
.user-box { display: flex; align-items: center; gap: .75rem; flex: none; }
.user-name { font-weight: 600; font-size: .95rem; }

.course-nav { border-top: 1px solid var(--line); background: var(--surface); }
.course-nav-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 .75rem;
  display: flex; gap: .25rem; overflow-x: auto; scrollbar-width: thin;
}
.tab {
  font: 500 .92rem/1.2 var(--sans);
  color: var(--muted);
  background: none; border: 0; border-bottom: 3px solid transparent;
  padding: .85rem .7rem .7rem;
  display: flex; align-items: center; gap: .55rem;
  cursor: pointer; white-space: nowrap;
}
.tab:hover { color: var(--navy-deep); }
.tab[aria-selected="true"] { color: var(--navy-deep); border-bottom-color: var(--navy); font-weight: 600; }
.tab-step {
  width: 1.6rem; height: 1.6rem; border-radius: 50%;
  display: inline-grid; place-items: center;
  font-size: .8rem; font-weight: 700;
  border: 1.5px solid currentColor;
}
.tab[aria-selected="true"] .tab-step { background: var(--navy); border-color: var(--navy); color: #fff; }
.tab.is-done .tab-step { background: var(--leaf); border-color: var(--leaf); color: #fff; }
.tab.is-locked { color: #8C97A6; }
.tab.is-locked .tab-step { border-style: dashed; }
.tab-milestone { margin-left: auto; }
.tab-milestone + .tab-milestone { margin-left: 0; }

/* ---------------------------------------------------------------- Login */

.login {
  max-width: 1100px; margin: 0 auto;
  padding: clamp(2rem, 6vw, 5rem) 1.25rem;
  display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
.login-logo { width: 150px; margin-bottom: 2rem; mix-blend-mode: multiply; } /* logo has a white background */
.login-statement blockquote { margin: 0 0 2.25rem; padding: 0; }
.login-statement blockquote p {
  font-family: var(--serif);
  font-size: clamp(1.6rem, 3.2vw, 2.35rem);
  line-height: 1.28;
  color: var(--navy-deep);
  margin: 0 0 .9rem;
  max-width: 24ch;
  text-wrap: balance;
}
.login-statement blockquote footer { color: var(--muted); font-size: .95rem; }
.login-statement blockquote footer::before { content: ""; display: inline-block; width: 2rem; height: 2px; background: var(--apple); vertical-align: middle; margin-right: .6rem; }
.login-facts { margin: 0; display: grid; gap: .75rem; border-top: 1px solid var(--line); padding-top: 1.25rem; }
.login-facts div { display: grid; grid-template-columns: 6.5rem 1fr; gap: 1rem; }
.login-facts dt { font-weight: 600; color: var(--navy); }
.login-facts dd { margin: 0; color: var(--ink); }

.login-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 4px solid var(--navy);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 4vw, 2.5rem);
  box-shadow: 0 12px 32px -18px rgba(20, 42, 79, .35);
}
.login-card h1 { font-family: var(--serif); font-size: 1.75rem; margin-bottom: .25rem; }
.login-help { color: var(--muted); margin: 0 0 1.5rem; font-size: .95rem; }
.login-support { font-size: .875rem; color: var(--muted); margin: 1rem 0 0; text-align: center; }

/* ---------------------------------------------------------------- Forms */

.field { display: flex; flex-direction: column; gap: .35rem; margin-bottom: 1.1rem; flex: 1; min-width: 0; }
.field-row { display: flex; gap: 1rem; }
.field label { font-weight: 600; font-size: .92rem; }
.field input {
  font: 400 1rem/1.4 var(--sans);
  padding: .75rem .85rem;
  border: 1.5px solid #B9C3D1;
  border-radius: var(--radius-sm);
  background: #fff; color: var(--ink);
  width: 100%;
}
.field input:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(31, 63, 115, .2); }
.field input[aria-invalid="true"] { border-color: var(--apple); }
.field-help { font-size: .85rem; color: var(--muted); margin: 0; }
.form-error {
  background: var(--apple-tint); color: #7E1F1A;
  border-left: 4px solid var(--apple);
  padding: .7rem .9rem; border-radius: var(--radius-sm);
  font-size: .95rem; margin: 0 0 1rem;
}

/* ---------------------------------------------------------------- Panels & modules */

.app { max-width: 1200px; margin: 0 auto; padding: 2rem 1.25rem 4rem; }

.module-head { max-width: var(--measure); margin-bottom: 2rem; }
.module-count { font-weight: 600; color: var(--apple); margin: 0 0 .35rem; font-size: .95rem; }
.module-head h2 { font-family: var(--serif); font-size: clamp(1.8rem, 3.5vw, 2.5rem); font-weight: 700; margin-bottom: .6rem; }
.lede { font-size: 1.12rem; color: var(--muted); margin: 0; }

.module-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 2.5rem; align-items: start; }
.module-main { min-width: 0; }
.module-aside { position: sticky; top: 9.5rem; display: grid; gap: 1rem; }
.aside-block {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.15rem 1.25rem; font-size: .93rem;
}
.aside-block h3 { font-family: var(--sans); font-size: .95rem; font-weight: 700; margin-bottom: .6rem; }
.aside-block ul { margin: 0; padding-left: 1.1rem; }
.aside-block li + li { margin-top: .4rem; }
.aside-meta p { margin: 0; }
.aside-meta strong { display: block; font-size: .85rem; color: var(--muted); font-weight: 600; }
.time-spent { margin-top: .6rem !important; color: var(--muted); font-size: .88rem; }

/* Video */
.video-frame {
  position: relative; aspect-ratio: 16 / 9; width: 100%;
  background: var(--navy-deep); border-radius: var(--radius); overflow: hidden;
  margin-bottom: 1.5rem;
}
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Slide deck */
.deck { margin-bottom: 2.75rem; }
.deck-stage {
  position: relative; aspect-ratio: 16 / 9; width: 100%;
  background: var(--navy-deep); color: #fff;
  border-radius: var(--radius); overflow: hidden;
  container-type: inline-size;
}
.slide {
  position: absolute; inset: 0;
  padding: 6cqw 7cqw;
  display: flex; flex-direction: column; justify-content: center;
  background:
    linear-gradient(90deg, var(--apple) 0 1.2cqw, transparent 1.2cqw),
    var(--navy-deep);
}
.slide[aria-hidden="true"] { visibility: hidden; }
.slide-tag { margin: 0 0 1.4cqw; color: #9FB6DA; font-size: max(.75rem, 1.9cqw); font-weight: 600; }
.slide h3 { color: #fff; font-family: var(--serif); font-size: max(1.2rem, 4.6cqw); margin: 0 0 3cqw; }
.slide p, .slide li { font-size: max(.8rem, 2.15cqw); line-height: 1.45; color: #DCE5F3; }
.slide-title h3 { font-size: max(1.5rem, 6.4cqw); max-width: 18ch; }
.slide-title p { max-width: 46ch; font-size: max(.85rem, 2.5cqw); }
.slide-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3cqw; }
.slide-cols-2 { grid-template-columns: repeat(2, 1fr); }
.slide-cols > div { border-top: 2px solid #3E5E91; padding-top: 1.6cqw; }
.slide-cols h4 { color: #fff; font-family: var(--sans); font-size: max(.85rem, 2.4cqw); margin: 0 0 1cqw; }
.slide-cols p { margin: 0; }
.slide-cols ul, .slide-list { margin: 0; padding-left: 1.2em; }
.slide-list li + li { margin-top: 1.4cqw; }
.slide-ok { border-top-color: #5DBB84 !important; }
.slide-no { border-top-color: #E4655E !important; }

.deck-controls { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: .75rem; }
.deck-count { font-size: .9rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.deck-buttons { display: flex; gap: .5rem; }

/* Reading */
.reading { max-width: var(--measure); margin-bottom: 3rem; }
.reading-title { font-family: var(--serif); font-size: 1.6rem; padding-bottom: .5rem; border-bottom: 2px solid var(--navy); margin-bottom: 1rem; }
.reading p { margin: 0 0 1rem; }
.plain-list { padding-left: 1.2rem; margin: 0 0 1rem; }
.plain-list li + li { margin-top: .35rem; }
.note {
  background: var(--navy-tint); border-left: 4px solid var(--navy);
  padding: .85rem 1rem; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: .97rem;
}

/* Standard — the large numeral rail is the signature element */
.standard {
  display: grid; grid-template-columns: 5.5rem minmax(0, 1fr); gap: 1.5rem;
  padding: 2.25rem 0; border-top: 1px solid var(--line);
}
.std-num {
  font-family: var(--serif); font-weight: 700;
  font-size: 5.25rem; line-height: .85; color: var(--navy);
  text-align: right; padding-right: 1.25rem;
  border-right: 3px solid var(--navy);
  font-variant-numeric: lining-nums;
}
.std-body { min-width: 0; }
.std-body > h3 { font-family: var(--serif); font-size: 1.55rem; margin-bottom: .6rem; }
.std-rule {
  font-family: var(--serif); font-size: 1.22rem; line-height: 1.5;
  color: var(--ink); margin: 0 0 1.5rem; max-width: 60ch;
}

.conduct-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1.25rem; }
.conduct {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.1rem 1.25rem; font-size: .97rem;
}
.conduct h4 { font-family: var(--sans); font-size: .98rem; font-weight: 700; display: flex; align-items: center; gap: .5rem; }
.conduct h4::before {
  content: ""; width: .7rem; height: .7rem; border-radius: 50%; flex: none;
}
.conduct-ok { border-top: 4px solid var(--leaf); }
.conduct-ok h4 { color: #1E5C37; }
.conduct-ok h4::before { background: var(--leaf); }
.conduct-no { border-top: 4px solid var(--apple); }
.conduct-no h4 { color: #8A231E; }
.conduct-no h4::before { background: var(--apple); border-radius: 2px; }
.conduct ul, .conduct ol { margin: 0; padding-left: 1.15rem; }
.conduct li + li { margin-top: .45rem; }
.conduct p { margin: 0 0 .6rem; }
.conduct-def { color: var(--muted); font-size: .93rem; }
.conduct-def:last-child { margin: .8rem 0 0; }
.conduct-wide { margin-bottom: 1.25rem; max-width: var(--measure); }

.scenario {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); margin-bottom: .75rem; max-width: var(--measure);
}
.scenario summary {
  cursor: pointer; padding: .95rem 1.15rem .95rem 2.6rem; position: relative; list-style: none;
}
.scenario summary::-webkit-details-marker { display: none; }
.scenario summary::before {
  content: ""; position: absolute; left: 1.1rem; top: 1.35rem;
  width: .5rem; height: .5rem; border-right: 2px solid var(--navy); border-bottom: 2px solid var(--navy);
  transform: rotate(-45deg); transition: transform .15s ease;
}
.scenario[open] summary::before { transform: rotate(45deg); top: 1.2rem; }
.scenario-label { font-weight: 700; color: var(--navy); margin-right: .35rem; }
.scenario-answer { padding: 0 1.15rem 1rem 2.6rem; border-top: 1px dashed var(--line); }
.scenario-answer p { margin: .85rem 0 0; }

.code-ref {
  border: 1px solid var(--line); border-left: 4px solid var(--gold);
  background: var(--surface); border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1.1rem 1.25rem; margin: 1.25rem 0; font-size: .97rem;
}
.code-ref p { margin: 0 0 .75rem; }
.code-ref ol, .code-ref ul { margin: 0 0 .9rem; padding-left: 1.25rem; }
.code-ref li + li { margin-top: .45rem; }
.code-ref > :last-child { margin-bottom: 0; }
.code-cite { font-family: var(--serif); font-weight: 700; color: #6E5517; }

.key-terms { margin: 1.5rem 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.key-terms div { background: var(--surface); padding: 1rem 1.1rem; }
.key-terms dt { font-family: var(--serif); font-weight: 700; font-size: 1.3rem; color: var(--navy-deep); }
.key-terms dd { margin: .2rem 0 0; font-size: .9rem; color: var(--muted); }

/* Module completion */
.module-finish {
  margin-top: 2rem; padding: 1.5rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}
.module-finish p { margin: 0; color: var(--muted); }
.module-finish.is-done { border-color: #A8D2B7; background: var(--leaf-tint); }
.module-finish.is-done p { color: #1E5C37; font-weight: 600; }

/* ---------------------------------------------------------------- State cards */

.state-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.5rem 1.6rem; max-width: var(--measure); margin-bottom: 1.5rem;
}
.state-card h3 { font-family: var(--serif); font-size: 1.35rem; }
.state-card p { margin: 0 0 1rem; }
.state-error { border-left: 4px solid var(--apple); }
.link-list { margin: 0; padding-left: 1.2rem; }
.link-list button { font: inherit; color: var(--navy); background: none; border: 0; padding: 0; text-decoration: underline; cursor: pointer; text-underline-offset: 2px; }

/* ---------------------------------------------------------------- Quiz */

.quiz { max-width: 820px; }
.quiz-list { list-style: none; margin: 0; padding: 0; counter-reset: q; }
.q {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  margin-bottom: 1rem; padding: 0;
}
.q.is-missing { border-color: var(--apple); box-shadow: 0 0 0 1px var(--apple); }
.q fieldset { border: 0; margin: 0; padding: 1.25rem 1.4rem 1.1rem; min-width: 0; }
.q legend { padding: 0; margin-bottom: .9rem; display: block; width: 100%; }
.q-meta { display: flex; justify-content: space-between; gap: 1rem; font-size: .82rem; color: var(--muted); margin-bottom: .35rem; }
.q-num { font-weight: 700; color: var(--navy); }
.q-text { font-family: var(--serif); font-size: 1.15rem; line-height: 1.45; color: var(--ink); }
.opt {
  display: flex; gap: .75rem; align-items: flex-start;
  padding: .7rem .85rem; margin-top: .45rem;
  border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  cursor: pointer; font-size: .98rem; line-height: 1.45;
}
.opt:hover { border-color: #9DADC4; background: #FAFBFD; }
.opt input { margin: .2rem 0 0; accent-color: var(--navy); width: 1.05rem; height: 1.05rem; flex: none; }
.opt:has(input:checked) { border-color: var(--navy); background: var(--navy-tint); }
.opt:has(input:focus-visible) { box-shadow: var(--focus); }

.quiz-bar {
  position: sticky; bottom: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 1.25rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius) var(--radius) 0 0;
  padding: .9rem 1.2rem; margin-top: 1.5rem;
  box-shadow: 0 -10px 24px -16px rgba(20, 42, 79, .3);
}
.quiz-progress { flex: 1; min-width: 0; }
.quiz-progress p { margin: .35rem 0 0; font-size: .9rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.progress-track { height: 8px; background: var(--navy-tint); border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: var(--navy); border-radius: 99px; transition: width .2s ease; }
#quiz-error-inline { margin-top: 1rem; }

/* Results */
.result {
  max-width: 820px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; margin-bottom: 1.5rem;
}
.result-head { padding: 1.75rem 1.75rem 1.5rem; display: grid; grid-template-columns: auto 1fr; gap: 1.5rem; align-items: center; }
.result-pass .result-head { background: var(--leaf-tint); border-bottom: 1px solid #BFE0CB; }
.result-fail .result-head { background: var(--apple-tint); border-bottom: 1px solid #F0C9C5; }
.result-score { font-family: var(--serif); font-weight: 700; font-size: 3.4rem; line-height: 1; font-variant-numeric: lining-nums tabular-nums; }
.result-pass .result-score { color: var(--leaf); }
.result-fail .result-score { color: var(--apple); }
.result-head h3 { font-family: var(--serif); font-size: 1.5rem; margin-bottom: .25rem; }
.result-head p { margin: 0; }
.result-body { padding: 1.5rem 1.75rem 1.75rem; }
.result-body > p { margin: 0 0 1rem; }
.result-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.25rem; }

.review-summary { margin: 0 0 1.5rem; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; }
.review-summary li { background: var(--apple-tint); color: #7E1F1A; border-radius: 99px; padding: .3rem .8rem; font-size: .88rem; font-weight: 600; }
.review-list { list-style: none; margin: 0; padding: 0; }
.review-item { border-top: 1px solid var(--line); padding: 1.1rem 0; }
.review-item h4 { font-family: var(--serif); font-weight: 600; font-size: 1.05rem; color: var(--ink); margin-bottom: .5rem; }
.review-item .review-std { display: block; font-family: var(--sans); font-size: .8rem; color: var(--muted); font-weight: 600; margin-bottom: .2rem; }
.review-item p { margin: .3rem 0 0; font-size: .95rem; }
.review-yours { color: #8A231E; }
.review-why { color: var(--ink); }
.review-why strong, .review-yours strong { font-weight: 700; }
.review-link { font: inherit; font-size: .9rem; color: var(--navy); background: none; border: 0; padding: 0; margin-top: .4rem; text-decoration: underline; cursor: pointer; }

/* ---------------------------------------------------------------- Certificate preview */

.cert-preview-wrap { max-width: 900px; margin-bottom: 1.5rem; }
.cert-preview {
  aspect-ratio: 11 / 8.5; background: #fff;
  border: 10px solid var(--navy-deep);
  outline: 1px solid var(--line); outline-offset: 0;
  padding: 2.2%; container-type: inline-size;
  box-shadow: 0 18px 40px -24px rgba(20, 42, 79, .45);
}
.cert-inner {
  height: 100%; border: 1.5px solid var(--gold);
  display: flex; flex-direction: column; align-items: center;
  text-align: center; padding: 4cqw 5cqw 4cqw;
}
.cert-inner p { margin: 0; }
.cert-logo { width: 13cqw; margin-bottom: 1.2cqw; }
.cert-org { font-size: 1.7cqw; color: var(--navy); font-weight: 600; letter-spacing: .04em; }
.cert-heading { font-family: var(--serif); font-size: 5cqw; font-weight: 700; color: var(--navy-deep); margin: 1.5cqw 0 1.5cqw !important; line-height: 1.1; }
.cert-small { font-size: 1.6cqw; color: var(--muted); font-style: italic; font-family: var(--serif); }
.cert-name {
  font-family: var(--serif); font-size: 4.4cqw; font-weight: 600; color: var(--ink);
  border-bottom: 1.5px solid var(--gold); padding: 0 4cqw .6cqw; margin: 1cqw 0 1.6cqw !important;
  min-width: 50%;
}
.cert-course { font-family: var(--serif); font-size: 2.7cqw; font-weight: 700; color: var(--navy-deep); margin-top: .8cqw !important; }
.cert-credit { font-size: 1.7cqw; color: var(--apple); font-weight: 700; margin-top: .8cqw !important; }
.cert-meta { display: grid; grid-template-columns: 1fr .9fr 1fr; gap: 3cqw; align-items: end; width: 100%; margin-top: auto; }
.cert-sig { display: flex; flex-direction: column; border-top: 1px solid var(--ink); padding-top: .8cqw; font-size: 1.35cqw; }
.cert-sig-name { font-weight: 600; color: var(--ink); }
.cert-sig-title { color: var(--muted); }
.cert-ids p { display: flex; flex-direction: column; font-size: 1.2cqw; }
.cert-ids p + p { margin-top: .9cqw !important; }
.cert-ids span { color: var(--muted); }
.cert-ids strong { color: var(--ink); font-size: 1.5cqw; }

.cert-actions { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.name-fix { max-width: 560px; margin-bottom: 1.25rem; }
.name-fix summary { cursor: pointer; color: var(--navy); font-weight: 600; }
.name-fix-form { margin-top: 1rem; }
.cert-note { color: var(--muted); font-size: .92rem; max-width: var(--measure); }

/* ---------------------------------------------------------------- Footer & toast */

.site-foot {
  border-top: 1px solid var(--line); background: var(--surface);
  padding: 1.5rem 1.25rem; font-size: .85rem; color: var(--muted); text-align: center;
}
.site-foot p { max-width: 72ch; margin: 0 auto .4rem; }

.toast {
  position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%); z-index: 50;
  background: var(--navy-deep); color: #fff; padding: .8rem 1.2rem; border-radius: var(--radius-sm);
  font-size: .95rem; box-shadow: 0 10px 24px -10px rgba(0, 0, 0, .4);
  max-width: calc(100% - 2rem);
}

/* ---------------------------------------------------------------- Responsive */

@media (max-width: 960px) {
  .module-layout { grid-template-columns: 1fr; }
  .module-aside { position: static; grid-row: 1; grid-template-columns: 1fr 1fr; }
  .login { grid-template-columns: 1fr; }
  .login-statement blockquote p { max-width: none; }
}

@media (max-width: 680px) {
  html { scroll-padding-top: 8rem; }
  .brand-credit, .user-name { display: none; }
  .brand img { width: 56px; }
  .brand-course { font-size: .98rem; }
  .tab-label { font-size: .85rem; }
  .tab-milestone { margin-left: 0; }
  .module-aside { grid-template-columns: 1fr; }
  .standard { grid-template-columns: 1fr; gap: .5rem; }
  .std-num { text-align: left; border-right: 0; border-bottom: 3px solid var(--navy); padding: 0 0 .4rem; font-size: 3.5rem; width: max-content; }
  .conduct-grid { grid-template-columns: 1fr; }
  .key-terms { grid-template-columns: 1fr; }
  .slide-cols, .slide-cols-2 { grid-template-columns: 1fr; gap: 1.5cqw; }
  .deck-stage { aspect-ratio: 4 / 3.4; }
  .field-row { flex-direction: column; gap: 0; }
  .quiz-bar { flex-direction: column; align-items: stretch; }
  .result-head { grid-template-columns: 1fr; }
  .login-facts div { grid-template-columns: 1fr; gap: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------------------------------------------------------------- Print
   Printing a module gives a clean handout; printing the certificate tab
   prints the certificate alone in landscape. */

@media print {
  @page { margin: 0.6in; }
  body { background: #fff; font-size: 11pt; }
  .site-head, .course-nav, .site-foot, .skip-link, .toast, .deck, .video-frame,
  .module-finish, .module-aside, .quiz-bar, .cert-actions, .name-fix, .cert-note,
  .result-actions, .btn { display: none !important; }
  .app { padding: 0; max-width: none; }
  .module-layout { display: block; }
  .standard, .conduct, .code-ref, .q, .review-item { break-inside: avoid; }
  .scenario-answer { display: block !important; }
  .scenario { border-color: #999; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 9pt; color: #555; }
  body.printing-cert .app > .panel:not(#panel-cert),
  body.printing-cert .module-head { display: none !important; }
  body.printing-cert .cert-preview { box-shadow: none; max-width: none; }
}
