:root {
  --navy: #102136;
  --teal: #087F8C;
  --teal-dark: #06646e;
  --teal-tint: #e6f3f4;
  --bg: #F6F7F9;
  --card: #ffffff;
  --text: #1b2533;
  --muted: #5a6677;
  --line: #dde2e8;
  --ok: #1f7a4d;
  --ok-tint: #e7f5ee;
  --bad: #b3261e;
  --bad-tint: #fdeceb;
  --radius: 12px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 17px; line-height: 1.6; }
a { color: var(--teal-dark); }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid #f2b705; outline-offset: 2px; }
.skip { position: absolute; left: -999px; top: 0; background: #fff; padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }

.topbar { position: sticky; top: 0; z-index: 5; background: var(--navy); color: #fff; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; padding: 10px 16px 14px; }
.brand { color: #fff; font-weight: 700; text-decoration: none; letter-spacing: .2px; }
.topnav { display: flex; gap: 14px; margin-left: auto; font-size: 15px; }
.topnav a { color: #cfe3e6; text-decoration: none; }
.topnav a:hover, .topnav a[aria-current="page"] { color: #fff; text-decoration: underline; }
.topprogress { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255,255,255,.15); }
.topprogress span { display: block; height: 100%; width: 0; background: #3cc2cf; transition: width .3s; }

main { max-width: 760px; margin: 0 auto; padding: 24px 16px 48px; outline: none; }
h1 { font-size: 1.75rem; line-height: 1.25; color: var(--navy); margin: .2em 0 .4em; }
h2 { font-size: 1.3rem; color: var(--navy); margin: 1.4em 0 .4em; }
h3 { font-size: 1.1rem; color: var(--navy); margin: 1.2em 0 .3em; }
.lesson-body h2:first-child { margin-top: .4em; }
p { margin: .6em 0; }
.muted { color: var(--muted); font-size: .93rem; }
.eyebrow { text-transform: uppercase; font-size: .78rem; letter-spacing: .08em; color: var(--teal-dark); font-weight: 700; }
code { background: #eef1f4; padding: 1px 5px; border-radius: 4px; }
blockquote { margin: .8em 0; padding: .6em 1em; border-left: 4px solid var(--teal); background: var(--teal-tint); border-radius: 6px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin: 14px 0; }
.hero { background: var(--navy); color: #fff; border: 0; padding: 28px 22px; }
.hero h1, .hero h2, .hero h3 { color: #fff; }
.hero a { color: #9fe3ea; }
.hero .cover h2 { font-size: 1.15rem; font-weight: 600; color: #9fe3ea; margin: 0 0 .6em; }
.note { background: var(--teal-tint); border: 1px solid #c3e2e5; border-radius: var(--radius); padding: 12px 16px; font-size: .95rem; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 10px 18px; border-radius: 10px; border: 2px solid var(--teal); background: var(--teal); color: #fff; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--teal-dark); border-color: var(--teal-dark); }
.btn.secondary { background: #fff; color: var(--teal-dark); }
.btn.secondary:hover { background: var(--teal-tint); }
.btn.small { min-height: 36px; padding: 6px 12px; font-size: .92rem; }
.btn.done { background: var(--ok); border-color: var(--ok); }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0; }

.progress { height: 10px; border-radius: 99px; background: #e3e8ee; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--teal); }
.progress-label { display: flex; justify-content: space-between; font-size: .93rem; color: var(--muted); margin-top: 6px; }
.hero .progress { background: rgba(255,255,255,.2); }
.hero .progress span { background: #3cc2cf; }
.hero .progress-label { color: #cfe3e6; }

.modules { list-style: none; padding: 0; margin: 0; }
.module-card { display: flex; gap: 14px; align-items: flex-start; text-decoration: none; color: inherit; }
.module-card:hover h3 { text-decoration: underline; }
.badge { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: #e3e8ee; color: var(--navy); }
.badge.done { background: var(--ok); color: #fff; }
.badge.partial { background: var(--teal-tint); color: var(--teal-dark); border: 2px solid var(--teal); }
.module-card h3 { margin: 0 0 2px; }
.module-card p { margin: 0; }

.lesson-list { list-style: none; padding: 0; margin: 0; }
.lesson-list li { border-top: 1px solid var(--line); }
.lesson-list li:first-child { border-top: 0; }
.lesson-list a { display: flex; gap: 12px; align-items: center; padding: 12px 4px; text-decoration: none; color: var(--text); }
.lesson-list a:hover { background: var(--bg); }
.tick { width: 26px; height: 26px; flex: 0 0 26px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font-size: 15px; color: #fff; }
.tick.on { background: var(--ok); border-color: var(--ok); }

.crumbs { font-size: .9rem; color: var(--muted); margin-bottom: 6px; }
.crumbs a { color: var(--muted); }
.pdfpage { display: inline-block; font-size: .8rem; padding: 2px 8px; border-radius: 99px; background: #e3e8ee; color: var(--navy); margin-left: 6px; vertical-align: middle; }
.resources { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 8px; }
.resources a { display: block; padding: 12px 14px; border-radius: 10px; background: var(--teal-tint); border: 1px solid #c3e2e5; text-decoration: none; font-weight: 600; }
.resources a::after { content: " ↗"; }
.resources small { display: block; font-weight: 400; color: var(--muted); word-break: break-all; }
.pager { display: flex; justify-content: space-between; gap: 10px; margin-top: 18px; }
.pager a { max-width: 48%; }

.table-wrap { overflow-x: auto; margin: .8em 0; }
table { border-collapse: collapse; width: 100%; font-size: .95rem; background: #fff; }
th, td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
th { background: #eef3f6; color: var(--navy); }

.quiz-q { margin: 18px 0; }
.quiz-q fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; background: #fff; margin: 0; }
.quiz-q legend { font-weight: 700; padding: 0 6px; color: var(--navy); }
.opt { display: flex; gap: 10px; align-items: flex-start; padding: 10px; border-radius: 8px; border: 1px solid var(--line); margin: 8px 0; cursor: pointer; }
.opt input { margin-top: 5px; width: 18px; height: 18px; }
.opt.correct { background: var(--ok-tint); border-color: var(--ok); }
.opt.wrong { background: var(--bad-tint); border-color: var(--bad); }
.feedback { margin-top: 8px; font-size: .95rem; }
.feedback.ok strong { color: var(--ok); }
.feedback.no strong { color: var(--bad); }
.score { font-size: 1.1rem; font-weight: 700; }

.check-item { display: flex; gap: 12px; align-items: flex-start; padding: 10px 4px; border-top: 1px solid var(--line); cursor: pointer; }
.check-item input { width: 22px; height: 22px; margin-top: 2px; flex: 0 0 22px; }
.code-form { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: flex-end; margin: 10px 0; }
.code-form label { width: 100%; font-weight: 600; }
.code-form input { flex: 1 1 220px; min-height: 44px; font: inherit; font-size: 1.05rem; letter-spacing: .06em; text-transform: uppercase; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; }
textarea { width: 100%; min-height: 90px; font: inherit; font-size: .85rem; padding: 10px; border-radius: 8px; border: 1px solid var(--line); }
.status { min-height: 1.4em; font-size: .93rem; }
.footer { max-width: 760px; margin: 0 auto; padding: 18px 16px 40px; color: var(--muted); font-size: .85rem; border-top: 1px solid var(--line); }
.noscript { max-width: 760px; margin: 20px auto; padding: 16px; }

@media (max-width: 560px) {
  body { font-size: 16px; }
  .topnav { margin-left: 0; width: 100%; gap: 16px; }
  h1 { font-size: 1.5rem; }
  .pager { flex-direction: column; }
  .pager a { max-width: 100%; }
}
@media print {
  .topbar, .btn-row, .pager, .footer { display: none; }
  body { background: #fff; }
}
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
