:root {
  /* palette from the 2026 census seal: census blue, deep navy, gold star (green is kept for pass/complete marks only) */
  --bg: #f4f7fc;
  --surface: #ffffff;
  --surface-2: #edf2fb;
  --text: #0e1b36;
  --muted: #5b6a86;
  --border: #d5deee;
  --primary: #1f5fd6;
  --primary-deep: #122f7a;
  --primary-ink: #ffffff;
  --primary-soft: #e3ecfc;
  --accent: #4f8df7;
  --gold: #f2b705;
  --gold-soft: #fff6dc;
  --good: #1e8a44;
  --good-soft: #e4f5ea;
  --bad: #b3261e;
  --bad-soft: #fbe6e4;
  --warn: #9a6700;
  --warn-soft: #fff4d6;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(14, 27, 54, .06), 0 8px 24px -8px rgba(31, 95, 214, .18);
  --shadow-lg: 0 2px 4px rgba(14, 27, 54, .06), 0 18px 40px -12px rgba(31, 95, 214, .30);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--text); min-height: 100vh;
  background: var(--bg) linear-gradient(180deg, #e8eefb 0%, var(--bg) 380px, #f8fafd 100%) fixed;
  font: 16px/1.5 "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: url("/static/census-logo.png") repeat 24px 24px / 120px 120px;
  opacity: .045;
}
body::after {   /* soft gold and blue glows in the corners, behind the content */
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(700px 360px at -5% -5%, rgba(242, 183, 5, .16), transparent 60%),
              radial-gradient(800px 420px at 105% 0%, rgba(31, 95, 214, .18), transparent 60%);
}
main { position: relative; z-index: 1; }
a { color: var(--primary); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5rem; }
h1 { font-size: 1.55rem; font-weight: 800; letter-spacing: -.01em; } h2 { font-size: 1.2rem; font-weight: 700; } h3 { font-size: 1.02rem; font-weight: 700; }
p { margin: 0 0 .75rem; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.tiny { font-size: .78rem; }
.right { text-align: right; }
.center { text-align: center; }
.wrap { max-width: 760px; margin: 0 auto; padding: 16px; }
.wrap.wide { max-width: 1240px; }
.grow { flex: 1; min-width: 0; }
.hidden { display: none !important; }
.mt { margin-top: 14px; } .mb0 { margin-bottom: 0; }

.topbar {
  background: linear-gradient(100deg, #0f2a6e 0%, #163f9e 35%, #1f5fd6 75%, #3b7cf0 100%); color: var(--primary-ink); padding: 10px 16px;
  position: sticky; top: 0; z-index: 10;
  box-shadow: 0 3px 0 var(--gold), 0 6px 18px rgba(18, 47, 122, .35);
}
.topbar::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(600px 90px at 18% 130%, rgba(255,255,255,.18), transparent 70%); }
.topbar .inner { position: relative; }
.topbar .inner { max-width: 760px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.topbar.wide .inner { max-width: 1240px; }
.topbar .brandwrap { display: flex; align-items: center; gap: 12px; min-width: 0; text-decoration: none; color: inherit; }
.topbar .logo { width: 44px; height: 44px; border-radius: 50%; background: #fff; flex: none; box-shadow: 0 0 0 2px rgba(255,255,255,.6), 0 2px 6px rgba(0,0,0,.3); }
.topbar .brand { font-weight: 700; letter-spacing: .01em; line-height: 1.2; }
.topbar .brand small { display: block; font-weight: 400; opacity: .85; font-size: .78rem; }
.topbar a { color: inherit; font-weight: 600; }
.topbar .links { display: flex; gap: 6px; align-items: center; white-space: nowrap; font-size: .9rem; }
.topbar .links a { padding: 6px 10px; border-radius: 999px; text-decoration: none; transition: background .15s; }
.topbar .links a:hover { background: rgba(255,255,255,.16); }

.card { background: rgba(255, 255, 255, .96); border: 1px solid rgba(213, 222, 238, .9); border-radius: var(--radius); padding: 20px; margin-bottom: 14px;
  box-shadow: var(--shadow); position: relative; overflow: hidden; }
.card.accent::before { content: ""; position: absolute; left: 0; top: 0; right: 0; height: 5px; background: var(--course-color, linear-gradient(90deg, var(--primary-deep), var(--primary) 55%, var(--gold))); }
.card.tight { padding: 14px; }

label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 4px; }
input[type=text], input[type=email], input[type=tel], input[type=number], input[type=password], input[type=date], input[type=datetime-local],
input[type=url], input[type=search], input[type=color], textarea, select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit;
}
input[type=color] { padding: 2px; height: 42px; }
textarea { min-height: 90px; resize: vertical; }
textarea.code { font-family: Consolas, "Cascadia Mono", monospace; font-size: .9rem; min-height: 260px; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--primary); outline-offset: 1px; border-color: var(--primary); }
.field { margin-bottom: 14px; }
.hint { font-size: .8rem; color: var(--muted); margin-top: 3px; }
.row { display: grid; gap: 12px; }
@media (min-width: 640px) { .row.two { grid-template-columns: 1fr 1fr; } .row.three { grid-template-columns: 1fr 1fr 1fr; } .row.four { grid-template-columns: repeat(4, 1fr); } }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: .95rem; margin-bottom: 8px; }
.check input { width: 18px; height: 18px; accent-color: var(--primary); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; min-height: 44px;
  transition: transform .15s var(--ease), box-shadow .15s var(--ease), background .15s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(180deg, #2f72e8, var(--primary) 60%, #1b55c4); color: var(--primary-ink); border-color: #163f9e; box-shadow: 0 4px 12px -2px rgba(31, 95, 214, .45), inset 0 1px 0 rgba(255,255,255,.25); }
.btn.primary:hover { filter: brightness(1.06); box-shadow: 0 8px 18px -4px rgba(31, 95, 214, .5), inset 0 1px 0 rgba(255,255,255,.25); }
.btn.good { background: var(--good); color: #fff; border-color: var(--good); }
.btn.danger { color: var(--bad); border-color: var(--bad); }
.btn.sm { padding: 6px 12px; min-height: 34px; font-size: .875rem; }
.btn.xs { padding: 3px 9px; min-height: 28px; font-size: .8rem; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn.link { border: 0; background: none; color: var(--primary); padding: 4px 6px; min-height: 0; }

.alert { padding: 12px 14px; border-radius: 8px; margin-bottom: 14px; font-size: .95rem; }
.alert.error { background: var(--bad-soft); color: var(--bad); }
.alert.info { background: var(--primary-soft); color: var(--primary); }
.alert.warn { background: var(--warn-soft); color: var(--warn); }
.alert.good { background: var(--good-soft); color: var(--good); }

.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .76rem; font-weight: 600; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.badge.good { background: var(--good-soft); color: var(--good); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.primary { background: var(--primary-soft); color: var(--primary); }

/* progress bars */
.bar { height: 10px; background: var(--border); border-radius: 999px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--primary-deep), var(--primary), var(--accent)); border-radius: 999px; transition: width .5s var(--ease); }
.bar > i.done { background: var(--good); }
.minibar { display: inline-block; height: 8px; background: var(--border); border-radius: 999px; width: 90px; vertical-align: middle; overflow: hidden; margin-right: 6px; }
.minibar > i { display: block; height: 100%; background: var(--good); }
.minibar > i.low { background: var(--bad); } .minibar > i.mid { background: var(--warn); }

/* learner home */
.courses { display: grid; gap: 12px; }
.coursesec { margin-bottom: 22px; }
.coursesec .coursecard { margin-bottom: 4px; }
@media (min-width: 720px) { .courses { grid-template-columns: 1fr 1fr; } }
.coursecard { display: flex; flex-direction: column; gap: 8px; padding: 18px; border: 1px solid var(--border); border-radius: var(--radius); background: linear-gradient(180deg, #fff, #f6f9ff); border-top: 5px solid var(--course-color, var(--primary)); text-decoration: none; color: inherit; box-shadow: var(--shadow); transition: transform .2s var(--ease), box-shadow .2s var(--ease); }
.coursecard:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.coursecard h3 { margin: 0; font-size: 1.05rem; }
.coursecard .meta { display: flex; gap: 10px; flex-wrap: wrap; font-size: .8rem; color: var(--muted); }
.coursecard .foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; }
.announce { border-left: 4px solid var(--accent); padding-left: 12px; margin-bottom: 12px; }
.announce h3 { margin-bottom: 2px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 12px 0; }
.stats.four { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 640px) { .stats.four { grid-template-columns: repeat(4, 1fr); } }
.stat { background: var(--surface-2); border-radius: 12px; padding: 12px 10px; text-align: center; }
.stat .v { font-size: 1.4rem; font-weight: 700; line-height: 1.1; }
.stat .l { font-size: .74rem; color: var(--muted); margin-top: 2px; }

/* course outline */
.module { margin-bottom: 14px; }
.module h2 { font-size: 1.05rem; margin: 0 0 6px; }
.lessons { display: grid; gap: 6px; }
.lessonrow { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: #fff; text-decoration: none; color: inherit; transition: transform .15s var(--ease), box-shadow .15s; }
.lessonrow:hover { transform: translateX(2px); box-shadow: var(--shadow); }
.lessonrow:hover { background: var(--surface-2); }
.lessonrow .ico { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex: none; background: var(--surface-2); color: var(--muted); font-weight: 700; font-size: .9rem; }
.lessonrow.completed .ico { background: var(--good-soft); color: var(--good); }
.lessonrow.started .ico { background: var(--warn-soft); color: var(--warn); }
.lessonrow .t { font-weight: 600; }
.lessonrow .m { font-size: .78rem; color: var(--muted); }
.lessonrow.current { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.lessonrow.locked { opacity: .6; cursor: not-allowed; }

/* slide viewer */
.slidebox { position: relative; background: #1b2435; border-radius: 10px; overflow: hidden; min-height: 180px; display: flex; align-items: center; justify-content: center; touch-action: pan-y pinch-zoom; }
.slidebox canvas { display: block; max-width: 100%; }
.slidemsg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #fff; padding: 20px; text-align: center; font-size: .95rem; }
.slidemsg a { color: #fff; }
.slidenav { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 10px; }
/* full-screen slides: the viewer fills the screen, dark, with the controls along the bottom */
#slides.fs { position: fixed; inset: 0; z-index: 60; background: #0b1220; display: flex; flex-direction: column; padding: 8px; margin: 0; }
#slides.fs:fullscreen, #slides.fs:-webkit-full-screen { width: 100%; height: 100%; }
#slides.fs .slidebox { flex: 1; min-height: 0; border-radius: 8px; background: #0b1220; }
#slides.fs .slidebox canvas { max-height: 100%; }
#slides.fs .slidenav { margin: 8px 0 0; color: #fff; }
#slides.fs .slidenav .btn { background: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.25); }
#slides.fs .slidenav .btn.primary { background: linear-gradient(180deg, #2f72e8, var(--primary) 60%, #1b55c4); }
#slides.fs .bar { background: rgba(255,255,255,.15); margin: 8px 0 0; }
#slides.fs #slidehint { display: none; }
body.noscroll { overflow: hidden; }
body.noscroll main { z-index: 70; }   /* lift the page above the sticky top bar while the slides are full screen */
.card:has(> #slides.fs), .card:has(#slides.fs) { transform: none !important; animation: none !important; }
.matrow { padding: 10px 0; border-top: 1px solid var(--border); }
.matrow:first-of-type { border-top: 0; }

/* day grid and day view */
.daygrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
@media (min-width: 720px) { .daygrid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1100px) { .wrap.wide .daygrid { grid-template-columns: repeat(5, 1fr); } }
.daycard { display: block; position: relative; padding: 14px 14px 12px; border: 1px solid var(--border); border-radius: 14px; background: linear-gradient(180deg, #fff 0%, #f7faff 100%); text-decoration: none; color: inherit; box-shadow: var(--shadow); overflow: hidden; transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s; }
.daycard::before { content: ""; position: absolute; left: 0; top: 0; right: 0; height: 4px; background: linear-gradient(90deg, var(--primary-deep), var(--primary) 60%, var(--accent)); }
.daycard:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: #b7c9ec; }
.daycard .dn { display: flex; align-items: baseline; gap: 6px; color: var(--primary); }
.daycard .dn .w { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.daycard .dn .n { font-size: 1.9rem; font-weight: 800; line-height: 1; background: linear-gradient(180deg, var(--primary), var(--primary-deep)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.daycard .dt { font-weight: 600; font-size: .9rem; line-height: 1.25; margin: 4px 0 6px; min-height: 2.5em; }
.daycard .dm { font-size: .75rem; color: var(--muted); }
.daycard .ds { font-size: .78rem; font-weight: 600; margin-top: 2px; color: var(--muted); }
.daycard.done { border-color: #bfe3cc; } .daycard.done::before { background: var(--good); } .daycard.done .dn, .daycard.done .ds { color: var(--good); } .daycard.done .dn .n { background: none; color: var(--good); }
.daycard.started .ds { color: var(--warn); }
.daycard.current { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft), var(--shadow); } .daycard.current .ds { color: var(--primary); }
.daycard.locked { opacity: .6; }
.daycard.manual { position: relative; border-color: #e3cf8a; background: linear-gradient(180deg, var(--gold-soft), #fff 70%); } .daycard.manual::before { background: linear-gradient(90deg, var(--gold), #ffd966); }
.daycard.manual .stretch { color: inherit; text-decoration: none; font-weight: 600; }
.daycard.manual .stretch::after { content: ""; position: absolute; inset: 0; border-radius: 12px; }   /* the whole tile opens the manual */
.daycard.manual .dl { position: relative; z-index: 1; }                                                 /* ...except the download button */
.daycard.manual .dn { color: var(--primary-deep); } .daycard.manual .dn .n { font-size: 1.5rem; background: none; color: inherit; }
.daycard.manual .ds { color: var(--primary-deep); display: flex; align-items: center; justify-content: space-between; gap: 6px; flex-wrap: wrap; }
.daynav { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.dayhead { display: flex; gap: 14px; align-items: center; }
.daynum { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 72px; height: 72px; border-radius: 18px; background: linear-gradient(145deg, var(--primary), var(--primary-deep)); color: #fff; flex: none; line-height: 1; box-shadow: 0 8px 18px -6px rgba(31, 95, 214, .6); }
.daynum .w { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.daynum .n { font-size: 2rem; font-weight: 800; }
.files.sub { margin: -2px 0 8px 46px; }
.files.sub .filerow { padding: 7px 10px; font-size: .9rem; }

/* lesson content */
.prose { font-size: 1.02rem; line-height: 1.65; }
.prose h1, .prose h2, .prose h3 { margin-top: 1.4em; }
.prose h2 { font-size: 1.25rem; color: var(--primary); } .prose h3 { font-size: 1.05rem; }
.prose p { margin: 0 0 .9em; }
.prose ul, .prose ol { padding-left: 1.4em; margin: 0 0 .9em; }
.prose li { margin-bottom: .3em; }
.prose blockquote { margin: 0 0 1em; padding: 10px 14px; border-left: 4px solid var(--accent); background: var(--surface-2); border-radius: 0 8px 8px 0; }
.prose blockquote p:last-child { margin: 0; }
.prose img { max-width: 100%; height: auto; border-radius: 8px; }
.prose table { width: 100%; border-collapse: collapse; margin: 0 0 1em; font-size: .95rem; }
.prose th, .prose td { border: 1px solid var(--border); padding: 7px 10px; text-align: left; vertical-align: top; }
.prose th { background: var(--surface-2); }
.prose code { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; font-size: .9em; }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 1.4em 0; }
.video:not(.kind) { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: 10px; overflow: hidden; margin-bottom: 14px; }   /* the player, not the 'Video' badge */
.video iframe, .video video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.files { display: grid; gap: 8px; }
.filerow { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: #fff; text-decoration: none; color: inherit; transition: box-shadow .15s, border-color .15s; }
.filerow:hover { border-color: #b7c9ec; box-shadow: var(--shadow); }
.filerow .ico { width: 36px; height: 36px; border-radius: 8px; background: var(--primary-soft); color: var(--primary); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .72rem; flex: none; }
.lessonnav { display: flex; gap: 10px; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.progress-top { position: sticky; top: 64px; z-index: 9; background: var(--bg); padding: 6px 0 8px; }
.progress-top .meta { display: flex; justify-content: space-between; font-size: .85rem; color: var(--muted); margin-bottom: 4px; gap: 8px; }
.timer.low { color: var(--bad); font-weight: 700; }

/* quiz */
.question { padding: 14px 0; border-top: 1px solid var(--border); }
.question:first-child { border-top: 0; padding-top: 4px; }
.question .qhead { display: flex; gap: 10px; align-items: baseline; margin-bottom: 8px; }
.question .qnum { font-weight: 700; color: var(--primary); flex: none; }
.question .area { font-size: .75rem; color: var(--muted); margin-left: auto; text-align: right; }
.options { display: grid; gap: 8px; }
.option { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; background: #fff; }
.option:hover { background: var(--surface-2); }
.option input { margin-top: 4px; flex: none; accent-color: var(--primary); width: 18px; height: 18px; }
.option.selected { border-color: var(--primary); background: var(--primary-soft); }
.option .letter { font-weight: 700; color: var(--primary); flex: none; width: 1.2em; }
.option.correct { border-color: var(--good); background: var(--good-soft); }
.option.wrong { border-color: var(--bad); background: var(--bad-soft); }
.explain { background: var(--surface-2); border-radius: 8px; padding: 10px 12px; margin-top: 8px; font-size: .92rem; }
.submitbar { position: sticky; bottom: 0; padding: 12px 0 16px; background: linear-gradient(to top, var(--bg) 70%, transparent); }
.score-hero { text-align: center; padding: 22px 18px; }
.score-hero .pct { font-size: 3.2rem; font-weight: 800; line-height: 1; color: var(--good); }
.score-hero .pct.fail { color: var(--bad); }
.areabar { margin-bottom: 10px; }
.areabar .top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: .95rem; }
.areabar .track { height: 10px; background: var(--border); border-radius: 999px; overflow: hidden; margin-top: 4px; }
.areabar .fill { height: 100%; border-radius: 999px; background: var(--good); }
.areabar .fill.mid { background: var(--warn); } .areabar .fill.low { background: var(--bad); }

/* horizontal bar chart (dashboard: quiz results by district) */
.barchart { display: grid; gap: 6px; }
.barrow { display: grid; grid-template-columns: minmax(90px, 140px) 1fr minmax(120px, auto); gap: 10px; align-items: center; text-decoration: none; color: inherit; padding: 4px 6px; border-radius: 8px; font-size: .86rem; }
.barrow:hover { background: var(--surface-2); }
.barrow .lbl { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.barrow .track { position: relative; height: 14px; background: var(--border); border-radius: 999px; overflow: hidden; }
.barrow .track i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--primary-deep), var(--primary), var(--accent)); }
.barrow .track b { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--gold); }   /* the 80% pass mark */
.barrow .val { white-space: nowrap; font-weight: 600; }
.barrow .val .muted { font-weight: 400; font-size: .78rem; }

/* tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); white-space: nowrap; }
tbody tr:hover td { background: var(--surface-2); }
td.num, th.num { text-align: right; white-space: nowrap; }
tr.clickable { cursor: pointer; }
tr.grouprow td { padding-top: 12px; border-bottom: 0; text-transform: uppercase; letter-spacing: .05em; }
tr.dayrow td { font-size: .86rem; padding-top: 5px; padding-bottom: 5px; }

/* admin */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tabs button { background: none; border: 0; border-bottom: 3px solid transparent; padding: 10px 14px; font: inherit; font-weight: 700; color: var(--text); cursor: pointer; white-space: nowrap; }
.tabs button.active { color: var(--primary); border-bottom-color: var(--primary); }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.toolbar .grow { flex: 1; min-width: 160px; }
.toolbar > select, .toolbar > input { width: auto; }
.toolbar > input.grow, .toolbar > select.grow { width: auto; flex: 1; }
.toolbar h2 { margin: 0; }
.list { display: grid; gap: 10px; }
.list .item { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: #fff; cursor: pointer; }
.list .item.active { border-color: var(--primary); background: var(--primary-soft); }
.list .dayitems { display: grid; gap: 4px; margin: -4px 0 6px 18px; }
.list .dayitems .item.day { padding: 7px 12px; font-size: .9rem; border-color: transparent; background: rgba(255,255,255,.6); }
.list .dayitems .item.day:hover { border-color: var(--border); background: #fff; }
.tree .mod.flash { box-shadow: 0 0 0 3px var(--primary-soft); border-color: var(--primary); transition: box-shadow .4s; }
.panel { background: rgba(255, 255, 255, .97); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px 16px; margin-bottom: 14px; box-shadow: 0 4px 18px rgba(29, 78, 216, .08); }
.panel .card { box-shadow: 0 1px 3px rgba(29, 78, 216, .08); background: #fff; }
.tree .mod { border: 1px solid var(--border); border-radius: 10px; background: #fff; margin-bottom: 10px; }
.tree .modhead { display: flex; gap: 8px; align-items: center; padding: 10px 12px; background: var(--surface-2); border-radius: 10px 10px 0 0; flex-wrap: wrap; }
.tree .modhead h3 { margin: 0; flex: 1; min-width: 160px; }
.tree .les { display: flex; gap: 8px; align-items: center; padding: 8px 12px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.tree .les .t { flex: 1; min-width: 160px; font-weight: 600; cursor: pointer; }
.tree .les .t:hover { color: var(--primary); }
.kind { display: inline-block; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 2px 7px; border-radius: 5px; background: var(--surface-2); color: var(--muted); }
.kind.quiz { background: var(--warn-soft); color: var(--warn); } .kind.video { background: var(--primary-soft); color: var(--primary); } .kind.file { background: var(--good-soft); color: var(--good); }
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: none; align-items: flex-start; justify-content: center; padding: 20px 12px; overflow: auto; z-index: 50; }
.modal-bg.open { display: flex; }
.modal { background: var(--surface); border-radius: var(--radius); padding: 20px; width: 100%; max-width: 720px; }
.modal.wide { max-width: 1100px; }
.opt-row { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.opt-row input[type=radio] { flex: none; accent-color: var(--primary); width: 18px; height: 18px; }
.opt-row .k { font-weight: 700; width: 1.4em; color: var(--primary); }
.opt-row input[type=text] { flex: 1; }
.dist { display: flex; flex-wrap: wrap; gap: 6px; }
.dist span { font-size: .75rem; padding: 2px 7px; border-radius: 6px; background: var(--surface-2); }
.dist span.correct { background: var(--good-soft); color: var(--good); font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips label { display: inline-flex; align-items: center; gap: 5px; font-weight: 500; font-size: .85rem; border: 1px solid var(--border); border-radius: 999px; padding: 4px 10px; margin: 0; cursor: pointer; background: #fff; }
.chips label.on { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.chips input { display: none; }
.editor { display: grid; gap: 12px; }
@media (min-width: 900px) { .editor { grid-template-columns: 1fr 1fr; } }
.preview { border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; background: #fff; min-height: 260px; max-height: 520px; overflow: auto; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 10px; font-size: .9rem; }
details summary { cursor: pointer; font-weight: 600; }
code, pre { font-family: Consolas, "Cascadia Mono", monospace; font-size: .85rem; }
pre { background: var(--surface-2); padding: 10px; border-radius: 8px; overflow: auto; }
.code { font-family: Consolas, "Cascadia Mono", monospace; font-weight: 700; letter-spacing: .12em; color: var(--primary); background: var(--primary-soft); border-radius: 8px; padding: 4px 10px; display: inline-block; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--text); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: .9rem; z-index: 100; box-shadow: 0 6px 20px rgba(0,0,0,.25); opacity: 0; transition: opacity .2s; pointer-events: none; }
.toast.show { opacity: 1; }
.offline { background: var(--warn-soft); color: var(--warn); text-align: center; font-size: .85rem; padding: 6px; position: sticky; top: 64px; z-index: 9; }

.sitefoot { position: relative; z-index: 1; margin: 28px 0 0; padding: 22px 16px 30px; border-top: 0; color: var(--muted); font-size: .85rem; line-height: 1.5; text-align: center; background: linear-gradient(180deg, rgba(255,255,255,.55), rgba(255,255,255,.92)); }
.sitefoot::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: linear-gradient(90deg, var(--primary-deep) 0 40%, var(--primary) 40% 80%, var(--gold) 80%); }
.sitefoot .inner { max-width: 760px; margin: 0 auto; display: flex; align-items: center; justify-content: center; gap: 14px; text-align: left; }
.sitefoot img { width: 50px; height: 50px; border-radius: 50%; flex: none; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.sitefoot strong { color: var(--text); }

/* certificate */
.cert { background: #fff; border: 10px double var(--primary); border-radius: 6px; padding: 36px 32px; text-align: center; position: relative; max-width: 900px; margin: 0 auto 16px; box-shadow: 0 8px 30px rgba(29, 78, 216, .15); }
.cert .org { text-transform: uppercase; letter-spacing: .18em; font-size: .85rem; color: var(--muted); font-weight: 700; }
.cert h1 { font-size: 2rem; color: var(--primary); margin: 10px 0 4px; }
.cert .name { font-size: 2.1rem; font-weight: 800; margin: 18px 0 4px; border-bottom: 2px solid var(--border); display: inline-block; padding: 0 24px 4px; }
.cert .course { font-size: 1.25rem; font-weight: 600; margin: 12px 0; }
.cert .logos { display: flex; justify-content: center; gap: 18px; }
.cert .logo { width: 86px; height: 86px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.2); }
.cert .foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-top: 28px; text-align: left; flex-wrap: wrap; }
.cert .qr { width: 110px; height: 110px; }
.cert .results { display: inline-block; text-align: left; margin-top: 8px; font-size: .9rem; }
@media print {
  body { background: #fff; } body::before { display: none; }
  .topbar, .sitefoot, .noprint { display: none !important; }
  .wrap { max-width: none; padding: 0; }
  .cert { box-shadow: none; border-width: 8px; page-break-inside: avoid; }
  @page { size: A4 landscape; margin: 12mm; }
}
.filerow .btns { display: flex; gap: 6px; flex: none; flex-wrap: wrap; justify-content: flex-end; }
details.card > summary { cursor: pointer; list-style: none; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::after { content: '▾'; float: right; color: var(--muted); }
details.card[open] > summary::after { content: '▴'; }

/* ---------- theme extras ---------- */
/* welcome hero on the home page: navy to census blue, with the seal's glow */
#hero.card { background: linear-gradient(120deg, #0f2a6e 0%, #163f9e 40%, #1f5fd6 100%); color: #fff; border: 0; box-shadow: var(--shadow-lg); }
#hero.card::before { display: none; }
#hero.card::after { content: ""; position: absolute; right: -40px; top: -60px; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle, rgba(242, 183, 5, .35), rgba(242, 183, 5, 0) 70%); pointer-events: none; }
#hero h1 { color: #fff; font-size: 1.7rem; }
#hero .muted { color: rgba(255,255,255,.82); }
#hero .stat { background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.22); color: #fff; }
#hero .stat .v { color: #fff; } #hero .stat .l { color: rgba(255,255,255,.8); }
/* training materials shortcut */
#matcard.card { background: linear-gradient(90deg, var(--gold-soft), #fff 55%); }
#matcard.card::before { background: linear-gradient(90deg, var(--gold), var(--primary)); }
/* sign-in and register cards */
#login.card, #register.card { margin-top: 22px; padding: 26px 22px; }
#login h1, #register h1 { font-size: 1.7rem; background: linear-gradient(90deg, var(--primary-deep), var(--primary)); -webkit-background-clip: text; background-clip: text; color: transparent; }
/* section headings above the day grid */
h3.small.muted { color: var(--primary-deep); opacity: .75; }
/* gentle entrance for cards and tiles */
@media (prefers-reduced-motion: no-preference) {
  .card, .daycard, .coursecard { animation: rise .3s var(--ease) backwards; }   /* 'backwards', not 'both': a lingering transform would trap fixed children (the full-screen slides) */
  @keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
}

/* ---------- landing page (learner sign-in) ---------- */
.landing { max-width: 1060px; display: grid; gap: 24px; align-items: start; padding-top: 24px; padding-bottom: 28px; }
@media (min-width: 880px) { .landing { grid-template-columns: 1.15fr 1fr; column-gap: 48px; row-gap: 22px; } }
.sealrow { grid-column: 1 / -1; text-align: center; }          /* the seal centred above both columns */
.sealrow .seal { width: 150px; height: 150px; border-radius: 50%; background: #fff; box-shadow: 0 10px 30px -10px rgba(18, 47, 122, .45), 0 0 0 6px rgba(255,255,255,.7); }
.intro { text-align: center; }
@media (min-width: 880px) { .intro { text-align: left; } }
.intro .kicker { margin: 0 0 6px; }                                /* the sign-in card's top edge lines up with this line */
.intro .kicker, .adminlogin .kicker { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--primary-deep); opacity: .8; }
.adminlogin .kicker { margin: 18px 0 6px; }
.intro h1 { font-size: 2.3rem; line-height: 1.08; margin: 0 0 12px; color: var(--primary-deep); }
.intro h1 span { background: linear-gradient(90deg, var(--primary), #4f8df7); -webkit-background-clip: text; background-clip: text; color: transparent; }
.intro .lead { font-size: 1.05rem; color: var(--muted); max-width: 46ch; margin: 0 auto 18px; }
@media (min-width: 880px) { .intro .lead { margin-left: 0; } }
.features { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 8px; }
.features li { display: flex; align-items: center; gap: 12px; background: rgba(255,255,255,.75); border: 1px solid var(--border); border-radius: 12px; padding: 8px 12px; text-align: left; }
.features b { flex: none; min-width: 58px; text-align: center; font-size: 1.05rem; color: var(--primary); }
.features span { font-size: .92rem; color: var(--text); }
.intro .motto { font-weight: 800; letter-spacing: .04em; color: var(--primary); margin: 0; font-size: 1.15rem; }
.entry .card { margin-top: 0; }
.entry #msg { margin-top: 0; }
/* admin sign-in */
.adminlogin { max-width: 440px; margin: 40px auto; text-align: center; padding: 28px 26px; }
.adminlogin .seal { width: 96px; height: 96px; border-radius: 50%; background: #fff; box-shadow: 0 8px 24px -10px rgba(18, 47, 122, .5); }
.adminlogin h1 { font-size: 1.45rem; margin-bottom: 14px; }
.adminlogin form, .adminlogin .alert { text-align: left; }
