[hidden] { display: none !important; }
/* DM Sans (SIL Open Font License, public/fonts/OFL-DM-Sans.txt), served with the app so it works offline */
@font-face { font-family: "DM Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/dm-sans-400.woff2) format("woff2"); }
@font-face { font-family: "DM Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url(/fonts/dm-sans-500.woff2) format("woff2"); }
@font-face { font-family: "DM Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url(/fonts/dm-sans-600.woff2) format("woff2"); }
@font-face { font-family: "DM Sans"; font-style: normal; font-weight: 700; font-display: swap; src: url(/fonts/dm-sans-700.woff2) format("woff2"); }
:root {
  /* VersaDrones brand: logo red and logo grey, with a sky blue taken from the brand photo */
  --brand: #e2332b;
  --brand-strong: #d42c24;
  --brand-ink: #c4261f;
  --brand-soft: #fdeceb;
  --ink: #1f1c1a;
  --ink-2: #3b3633;
  --ink-soft: #f4f3f1;
  --sky: #3f6488;
  --sky-soft: #eaf0f6;
  --amber: #f2a900;
  --amber-soft: #fff4d6;
  --green: #1e8a4c;
  --green-soft: #e3f4ea;
  --red: #b42318;
  --red-soft: #fbe9e7;
  --grey: #736c66;
  --line: #e8e5e2;
  --bg: #fcfbfa;
  --side: #f6f5f3;
  --card: #ffffff;
  --text: #1f1c1a;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(31, 28, 26, .04);
}
* { box-sizing: border-box; }
/* Slim scroll bars without arrow buttons, darker on hover */
@supports not selector(::-webkit-scrollbar) {
  html, .side, .modal, .table-wrap, .tb-table { scrollbar-width: thin; scrollbar-color: #d4cfca transparent; }
}
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d4cfca; border-radius: 99px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: #aaa39d; }
::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
::-webkit-scrollbar-corner { background: transparent; }
html, body { margin: 0; }
body {
  font-family: "DM Sans", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px; line-height: 1.55; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased;
}
a { color: var(--brand-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5rem; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: 1.7rem; font-weight: 700; letter-spacing: -.02em; }
h2 { font-size: 1.12rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .75rem; }
small, .muted { color: var(--grey); }
code { background: var(--ink-soft); padding: 1px 6px; border-radius: 6px; font-size: .88em; }
/* Line icons (in the style of the Lucide set) */
.ico { width: 18px; height: 18px; flex: none; }

/* Layout */
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.side { background: var(--side); color: var(--text); border-right: 1px solid var(--line); padding: 22px 16px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { margin: 0 8px 18px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.brand img { display: block; width: 118px; max-width: 100%; height: auto; }
.brand small { display: block; color: var(--grey); font-weight: 600; font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; margin-top: 6px; }
.nav-label { font-size: .78rem; color: var(--grey); font-weight: 500; margin: 18px 10px 6px; }
.nav a { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #3f3a36; padding: 8px 10px; border-radius: 10px; margin-bottom: 2px; font-size: .94rem; font-weight: 500; border: 1px solid transparent; }
.nav a .nav-l { display: flex; align-items: center; gap: 11px; }
.nav a .ico { color: #8a827b; }
.nav a:hover { background: #eeece9; text-decoration: none; }
.nav a.active { background: #fff; color: var(--ink); font-weight: 600; border-color: var(--line); box-shadow: 0 1px 2px rgba(31, 28, 26, .06); }
.nav a.active .ico { color: var(--brand); }
.nav .count { background: var(--brand-soft); color: var(--brand-ink); border: 1px solid #f6c9c6; font-size: .72rem; font-weight: 600; border-radius: 999px; padding: 0 8px; }
.side-foot { margin-top: 24px; padding: 14px 10px 0; border-top: 1px solid var(--line); font-size: .85rem; color: var(--grey); }
.side-foot .who { color: var(--ink); font-weight: 600; }
.side-foot button { margin-top: 8px; }
.main { padding: 30px 36px 60px; max-width: 1200px; width: 100%; }
.topbar { display: none; position: sticky; top: 0; z-index: 50; align-items: center; justify-content: space-between; gap: 12px;
  background: rgba(255, 255, 255, .96); border-bottom: 1px solid var(--line); padding: 10px 16px; }
.topbar-logo img { display: block; height: 28px; width: auto; }
.menu-btn { padding: 7px 12px; }
.side-backdrop { display: none; position: fixed; inset: 0; z-index: 55; background: rgba(43, 39, 36, .45); }
body.no-scroll { overflow: hidden; }
@media (prefers-reduced-motion: reduce) { .side { transition: none !important; } }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.crumbs { font-size: .85rem; color: var(--grey); margin-bottom: 6px; }

/* Cards and grids */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px; margin-bottom: 18px; }
.card.tight { padding: 14px 16px; }
.card h2 { margin-bottom: .6rem; }
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.stack > * + * { margin-top: 10px; }

.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); color: var(--text); }
.tile:hover { border-color: #d8d3cf; }
.tile .num { font-size: 2rem; font-weight: 700; color: var(--ink); line-height: 1.1; letter-spacing: -.02em; margin-top: 10px; }
/* Soft round icon badges, as on the dashboard figures */
.ico-badge { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--ink-soft); color: var(--ink-2); flex: none; }
.ico-badge.red { background: var(--brand-soft); color: var(--brand-ink); }
.ico-badge.green { background: var(--green-soft); color: var(--green); }
.ico-badge.blue { background: var(--sky-soft); color: var(--sky); }
.ico-badge.amber { background: var(--amber-soft); color: #8a5f00; }
.stat-head { display: flex; align-items: center; gap: 12px; font-weight: 600; color: var(--ink); }
.stat-big { font-size: 2.6rem; font-weight: 700; letter-spacing: -.03em; line-height: 1; margin: 16px 0 12px; color: var(--ink); }
.stat-big small { font-size: 1rem; font-weight: 500; color: var(--grey); letter-spacing: 0; }
.stat-foot { display: flex; justify-content: space-between; gap: 8px; color: var(--grey); font-size: .86rem; margin-top: 8px; }
.tile .lbl { color: var(--grey); font-size: .86rem; }

.mod-card { display: flex; flex-direction: column; gap: 10px; }
.mod-card .top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.mod-card .code { font-size: .75rem; font-weight: 600; color: var(--brand-ink); letter-spacing: .06em; text-transform: uppercase; }
.mod-card h3 { margin: 2px 0 0; }
.mod-card .foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; }

/* Progress */
.bar { height: 6px; background: #eeebe8; border-radius: 99px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.bar.green > span { background: var(--green); }

/* Pills and badges */
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: .75rem; font-weight: 500; padding: 2px 10px; border-radius: 99px; white-space: nowrap; background: var(--ink-soft); color: var(--grey); border: 1px solid var(--line); }
.pill.blue { background: var(--sky-soft); color: var(--sky); border-color: #cddbea; }
.pill.green { background: var(--green-soft); color: var(--green); border-color: #b9e0c8; }
.pill.amber { background: var(--amber-soft); color: #8a5f00; border-color: #f3dd9b; }
.pill.red { background: var(--red-soft); color: var(--red); border-color: #f2c4bf; }
.pill.navy { background: var(--ink); color: #fff; }

/* Buttons and forms */
button, .btn { font: inherit; font-size: .92rem; font-weight: 600; border: 1px solid transparent; border-radius: 10px; padding: 9px 16px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; background: var(--ink); color: #fff; text-decoration: none; }
button:hover, .btn:hover { background: #3a3532; text-decoration: none; }
button:disabled, .btn.disabled { opacity: .45; cursor: not-allowed; filter: none; }
button.secondary, .btn.secondary { background: #fff; color: var(--ink); border-color: var(--line); box-shadow: 0 1px 2px rgba(31, 28, 26, .04); }
button.secondary:hover, .btn.secondary:hover { background: var(--ink-soft); }
button.ghost { background: transparent; color: var(--ink); border-color: var(--line); padding: 5px 12px; font-size: .82rem; }
button.ghost:hover { background: #fff; border-color: #d8d3cf; }
button.green { background: var(--green); } button.green:hover { background: #18773f; }
button.red { background: var(--red); } button.red:hover { background: #9a1d14; }
button.amber { background: var(--amber); color: var(--ink); } button.amber:hover { background: #e09d00; }
button.small, .btn.small { padding: 6px 12px; font-size: .82rem; border-radius: 9px; }
label { display: block; font-size: .85rem; font-weight: 500; margin-bottom: 5px; color: #3f3a36; }
input, select, textarea { font: inherit; width: 100%; padding: 9px 12px; border: 1px solid #dedad6; border-radius: 10px; background: #fff; color: var(--text); }
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(31, 28, 26, .08); border-color: #a8a19b; }
.field { margin-bottom: 12px; }
.error { color: var(--red); font-size: .88rem; margin-top: 6px; min-height: 1em; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.check input { width: auto; }

/* Tables */
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th { text-align: left; font-size: .82rem; color: var(--grey); font-weight: 500; padding: 10px 12px; border-bottom: 1px solid var(--line); background: #faf9f8; }
td { padding: 11px 12px; border-bottom: 1px solid #f0edea; vertical-align: top; }
tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
td.num, th.num { text-align: right; white-space: nowrap; }

/* Units and lessons */
.unit { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; margin-bottom: 14px; overflow: hidden; }
.unit-head { padding: 14px 20px; background: #faf9f8; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; }
.unit-head h3 { margin: 0; }
.lesson-row { display: grid; grid-template-columns: 26px 90px 1fr auto; gap: 10px; align-items: center; padding: 10px 18px; border-bottom: 1px solid #eeebe8; color: var(--text); }
.lesson-row:last-child { border-bottom: 0; }
.lesson-row:hover { background: #f8f6f4; text-decoration: none; }
.lesson-row .lc { font-size: .8rem; font-weight: 600; color: var(--brand-ink); }
.tick { width: 20px; height: 20px; border-radius: 50%; border: 2px solid #cfc8c2; display: grid; place-items: center; font-size: .7rem; color: #fff; }
.tick.on { background: var(--green); border-color: var(--green); }
.lesson { max-width: 820px; }
.lesson .statement { font-size: 1.35rem; font-weight: 600; color: var(--ink); }
.points { margin: 0; padding-left: 0; list-style: none; }
.points li { position: relative; padding: 10px 12px 10px 38px; border-bottom: 1px solid #eeebe8; }
.points li:last-child { border-bottom: 0; }
.points li::before { content: counter(pt); counter-increment: pt; position: absolute; left: 6px; top: 10px; width: 22px; height: 22px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-ink); font-size: .75rem; font-weight: 700; display: grid; place-items: center; }
.points { counter-reset: pt; }
.example { background: #fffbf0; border: 1px solid #f1e2b8; border-radius: 10px; padding: 12px 16px; }
/* Alerts: an even, thin border and a small icon for the kind of message */
.notice { --ni: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 16v-4M12 8h.01'/%3E%3C/svg%3E"); --nc: var(--sky);
  position: relative; background: #f7f9fc; border: 1px solid #d9e3ee; border-radius: 10px; padding: 12px 16px 12px 44px; font-size: .9rem; color: var(--text); }
.notice::before { content: ""; position: absolute; left: 16px; top: 14px; width: 17px; height: 17px; background-color: var(--nc);
  -webkit-mask: var(--ni) center / contain no-repeat; mask: var(--ni) center / contain no-repeat; }
.notice.amber { --ni: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.3 3.9 1.8 18a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0z'/%3E%3Cpath d='M12 9v4M12 17h.01'/%3E%3C/svg%3E"); --nc: #c98a00; background: #fffbf0; border-color: #f1e2b8; }
.notice.red { --ni: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 8v4M12 16h.01'/%3E%3C/svg%3E"); --nc: var(--red); background: #fef7f6; border-color: #f2d0cc; }
.notice.green { --ni: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='m8.5 12 2.5 2.5 4.5-5'/%3E%3C/svg%3E"); --nc: var(--green); background: #f5fbf7; border-color: #c9e6d4; }

/* Questions */
.q { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; background: #fff; margin-bottom: 14px; }
.q .stem { font-weight: 600; margin-bottom: 12px; font-size: 1.02rem; }
.opts { display: grid; gap: 8px; }
.opt { text-align: left; background: #fff; color: var(--text); border: 1px solid #dedad6; font-weight: 500; padding: 11px 14px; display: flex; gap: 10px; align-items: flex-start; width: 100%; border-radius: 12px; }
.opt:hover { background: #faf9f8; }
.opt .k { flex: none; width: 24px; height: 24px; border-radius: 6px; background: #f1eeeb; display: grid; place-items: center; font-weight: 700; font-size: .8rem; color: var(--ink); }
.opt.sel { border-color: var(--ink); background: var(--ink-soft); }
.opt.sel .k { background: var(--ink); color: #fff; }
.opt.right { border-color: var(--green); background: var(--green-soft); }
.opt.right .k { background: var(--green); color: #fff; }
.opt.wrong { border-color: var(--red); background: var(--red-soft); }
.opt.wrong .k { background: var(--red); color: #fff; }
.opt:disabled { opacity: 1; cursor: default; }
.explain { margin-top: 12px; font-size: .92rem; padding: 10px 12px; border-radius: 7px; background: #f7f5f3; }
.palette { display: flex; flex-wrap: wrap; gap: 5px; }
.palette button { width: 34px; height: 30px; padding: 0; justify-content: center; font-size: .78rem; background: #fff; color: var(--ink); border: 1px solid #dedad6; border-radius: 8px; }
.palette button:hover { background: var(--ink-soft); }
.palette button.done { background: var(--ink-soft); border-color: var(--ink); }
.palette button.cur { outline: 2px solid var(--amber); }
.timer { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--ink); background: var(--amber-soft); padding: 4px 10px; border-radius: 7px; }
.score { font-size: 2.6rem; font-weight: 700; color: var(--ink); line-height: 1; letter-spacing: -.03em; }

/* Login */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.15fr 1fr; background: #fff; }
.login-art { position: relative; overflow: hidden; color: #fff; padding: 48px 52px; display: flex; flex-direction: column; justify-content: flex-end;
  background: var(--ink) url(/brand/login-hero.jpg) center 38% / cover no-repeat; }
.login-art::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(24, 21, 19, 0) 40%, rgba(24, 21, 19, .55) 62%, rgba(24, 21, 19, .9) 100%); }
.login-art > * { position: relative; }
.login-art h1 { font-size: 2.1rem; max-width: 500px; margin-bottom: .6rem; }
.login-art h1::before { content: ""; display: block; width: 56px; height: 4px; border-radius: 2px; background: var(--brand); margin-bottom: 16px; }
.login-art p { color: #ece6e1; max-width: 500px; }
.login-place { color: #d9d1cb; font-size: .82rem; letter-spacing: .04em; margin-top: 10px; }
.login-form { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px; gap: 22px; }
.login-logo { width: 190px; max-width: 70%; height: auto; }
.login-sub { margin-top: -14px; color: var(--grey); font-weight: 700; font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; }
.login-form .card { width: 100%; max-width: 380px; padding: 26px 26px 20px; box-shadow: 0 1px 3px rgba(31, 28, 26, .06), 0 8px 24px rgba(31, 28, 26, .05); }
/* Modal and toast */
.modal-bg { position: fixed; inset: 0; background: rgba(30, 27, 25, .5); display: grid; place-items: center; z-index: 50; padding: 20px; }
.modal { background: #fff; border-radius: 18px; padding: 24px; width: 100%; max-width: 480px; max-height: calc(100vh - 40px); overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
#toast { position: fixed; right: 20px; bottom: 20px; z-index: 60; display: grid; gap: 8px; }
#toast .t { background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 12px; box-shadow: var(--shadow); font-size: .9rem; }
#toast .t.err { background: var(--red); }

.empty { text-align: center; color: var(--grey); padding: 26px; }
.right { text-align: right; }
.mt0 { margin-top: 0; }
.mb0 { margin-bottom: 0; }
.nowrap { white-space: nowrap; }
details summary { cursor: pointer; }

/* Document logo (module notes and readiness report) */
.doc-logo { display: block; width: 150px; height: auto; margin-bottom: 10px; }

/* Print: readiness report */
.report { background: #fff; padding: 30px; border: 1px solid var(--line); border-radius: var(--radius); }
.report h1 { font-size: 1.4rem; }
.report table { font-size: .88rem; }
.sig { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; margin-top: 40px; }
.sig div { border-top: 1px solid #333; padding-top: 6px; font-size: .85rem; }
@media print {
  .side, .topbar, .side-backdrop, .no-print, #toast { display: none !important; }
  .shell { display: block; }
  .main { padding: 0; max-width: none; }
  body { background: #fff; }
  .report { border: 0; padding: 0; }
}

@media (max-width: 980px) {
  .g3, .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; align-content: start; }
  /* The menu slides in from the left when the Menu button is pressed */
  .topbar { display: flex; }
  .side { position: fixed; top: 0; left: 0; bottom: 0; z-index: 60; width: min(280px, 85vw); height: 100%;
    transform: translateX(-100%); visibility: hidden; transition: transform .2s ease, visibility 0s linear .2s; box-shadow: none; }
  .shell.menu-open .side { transform: none; visibility: visible; transition: transform .2s ease; box-shadow: 0 0 30px rgba(0, 0, 0, .25); }
  .shell.menu-open .side-backdrop { display: block; }
  .main { padding: 18px 16px 40px; }
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .login { grid-template-columns: 1fr; }
  .login-art { padding: calc(60vw - 10px) 20px 26px; background-position: center top; background-size: 100% auto; }
  .login-art::before { background: linear-gradient(180deg, rgba(43, 39, 36, 0) 0, rgba(43, 39, 36, 0) calc(42vw), var(--ink) calc(60vw)); }
  .login-art h1 { font-size: 1.6rem; }
  .login-form { padding: 28px 16px 40px; }
  .lesson-row { grid-template-columns: 26px 1fr; }
  .lesson-row .lc, .lesson-row .pill { display: none; }
}

/* ---------- Interactive lesson player ---------- */
.player { max-width: 940px; }
.player-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.dots { display: flex; gap: 6px; flex-wrap: wrap; }
.dot { width: 26px; height: 8px; padding: 0; border-radius: 99px; background: #e2ddd8; border: 0; }
.dot.done { background: var(--green); }
.dot.cur { background: var(--brand); }
.dot:disabled { opacity: 1; cursor: default; }
.screen { min-height: 300px; }
.screen-type { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--brand-ink); margin-bottom: 4px; }
.screen-body p { font-size: 1.02rem; max-width: 68ch; }
.scenario { background: #fffbf0; border: 1px solid #f1e2b8; border-radius: 10px; padding: 16px 18px; }
.scenario p { margin-bottom: .5rem; }
.scenario-tag { display: inline-block; font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; background: var(--amber); color: var(--ink); border-radius: 4px; padding: 1px 7px; margin-bottom: 8px; }
.explain-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.dia-wrap { margin: 0; background: #f9f8f6; border: 1px solid var(--line); border-radius: 10px; padding: 12px; text-align: center; }
.dia-wrap svg, svg.dia { width: 100%; height: auto; max-height: 340px; }
.dia-wrap figcaption { font-size: .82rem; color: var(--grey); margin-top: 6px; }
.steps { padding-left: 20px; margin: 0 0 12px; }
.steps li { padding: 8px 4px; border-bottom: 1px dashed #e6e1dc; animation: fadein .3s ease; }
.result { background: #f5fbf7; border: 1px solid #c9e6d4; border-radius: 10px; padding: 11px 16px; margin-bottom: 12px; animation: fadein .3s ease; }
.result p { margin: 0; }
.result p + p { margin-top: 8px; }
@keyframes fadein { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.calc { background: #f9f8f6; border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.calc-in { margin-bottom: 10px; }
.calc-in input[type=range] { padding: 0; accent-color: var(--brand); }
.calc-out { margin-top: 10px; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: 6px; padding: 10px 12px; font-size: .95rem; }
.tbar { display: grid; grid-template-columns: 60px 1fr; align-items: center; gap: 8px; margin: 6px 0; font-size: .82rem; }
.tbar-t { position: relative; height: 22px; background: #f1eeeb; border-radius: 5px; display: flex; overflow: visible; }
.tbar .seg { height: 100%; display: flex; align-items: center; justify-content: center; color: #fff; font-size: .72rem; overflow: hidden; white-space: nowrap; }
.tbar .seg.out { background: #7d9bb8; border-radius: 5px 0 0 5px; }
.tbar .seg.back { background: var(--ink); }
.tbar .seg.bad { background: var(--red); border-radius: 5px; }
.tbar-b { position: absolute; top: -4px; bottom: -4px; width: 3px; background: var(--red); border-radius: 2px; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: .78rem; color: var(--grey); justify-content: center; margin-top: 4px; }
.legend i { display: inline-block; width: 12px; height: 4px; border-radius: 2px; margin-right: 5px; vertical-align: middle; }
.pool { min-height: 54px; display: flex; flex-wrap: wrap; gap: 8px; padding: 10px; border: 1px dashed #cfc8c2; border-radius: 10px; background: #faf9f7; margin-bottom: 12px; }
.chip { display: inline-block; padding: 6px 12px; border-radius: 99px; background: #fff; border: 1px solid #cfc8c2; cursor: grab; font-size: .9rem; user-select: none; }
.chip.picked { border-color: var(--ink); background: var(--ink-soft); box-shadow: 0 0 0 2px var(--ink-soft); }
.chip.right { border-color: var(--green); background: var(--green-soft); }
.chip.wrong { border-color: var(--red); background: var(--red-soft); }
.buckets { display: grid; gap: 10px; }
.bucket { min-height: 120px; border: 2px dashed #cfc8c2; border-radius: 10px; padding: 8px; display: flex; flex-wrap: wrap; gap: 6px; align-content: flex-start; background: #fff; cursor: pointer; }
.bucket:hover { border-color: var(--ink); }
.bucket-h { width: 100%; font-weight: 700; font-size: .85rem; color: var(--ink); margin-bottom: 4px; }
.label-row { display: grid; grid-template-columns: 34px 1fr auto; gap: 8px; align-items: center; }
.label-row label { margin: 0; }
.marker { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: #fff; font-weight: 700; font-size: .85rem; }
.code-line { font-family: Consolas, "Courier New", monospace; background: var(--ink); color: #fff; padding: 12px; border-radius: 8px; display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.code-g { font-family: inherit; background: #3f3a36; color: #fff; border: 1px solid #5a534e; padding: 4px 8px; font-weight: 600; }
.code-g.seen { background: var(--amber); color: var(--ink); border-color: var(--amber); }
table.decode { margin-bottom: 10px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.fcard { min-height: 110px; background: #fff; color: var(--ink); border: 1px solid #cfc8c2; display: grid; place-items: center; text-align: center; font-weight: 600; padding: 12px; position: relative; }
.fcard .back { display: none; font-weight: 500; font-size: .9rem; }
.fcard.flipped { background: var(--brand-soft); border-color: var(--brand); }
.fcard.flipped .front { display: none; }
.fcard.flipped .back { display: block; }
.fcard .back small { display: block; font-size: .72rem; font-weight: 700; color: var(--brand-ink); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
@media (max-width: 1100px) { .explain-grid { grid-template-columns: 1fr; } .explain-grid .dia-wrap { max-width: 560px; } }
.summary-points { counter-reset: pt; }
@media (max-width: 760px) {
  .explain-grid { grid-template-columns: 1fr; }
  .buckets { grid-template-columns: 1fr !important; }
}

/* ---------- certificates and letters ---------- */
.cert-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.cert-row:first-of-type { border-top: 0; }
.cert-row-t { flex: 1; min-width: 0; }
.sig-box { border: 1px dashed #d6d1cc; border-radius: 10px; padding: 12px; min-height: 70px; display: flex; align-items: center; background: #fff; }
.sig-box img { max-height: 70px; max-width: 280px; }
.cert-wrap { overflow-x: auto; padding-bottom: 20px; }
.cert-page { background: #fff; color: #1f1c1a; margin: 0 auto; box-shadow: 0 1px 3px rgba(31, 28, 26, .08), 0 10px 30px rgba(31, 28, 26, .08); position: relative; }
.cert-page.letter { width: 210mm; min-height: 297mm; padding: 18mm 20mm 24mm; font-size: 11.5pt; line-height: 1.55; }
.letter-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10mm; padding-bottom: 6mm; border-bottom: 2px solid var(--brand); }
.letter-head img { width: 48mm; height: auto; }
.letter-uto { text-align: right; font-size: 9.5pt; color: #4a4440; }
.letter-meta { display: flex; justify-content: space-between; margin: 8mm 0 6mm; color: #4a4440; }
.letter-subject { font-weight: 700; letter-spacing: .02em; margin: 6mm 0 4mm; }
.cert-sign { margin-top: 8mm; width: 70mm; font-size: 10pt; line-height: 1.4; }
.cert-sign img { display: block; max-height: 20mm; max-width: 60mm; margin-bottom: 1mm; }
.cert-sign-line { border-top: 1px solid #1f1c1a; margin-bottom: 2mm; }
.cert-foot { position: absolute; left: 20mm; right: 20mm; bottom: 10mm; font-size: 8.5pt; color: #6a645f; text-align: center; }
.cert-page.certificate { width: 297mm; height: 210mm; padding: 9mm; }
.cert-frame { position: relative; height: 100%; border: 1.5px solid var(--brand); outline: 1px solid #d9d3cd; outline-offset: -4mm; padding: 10mm 22mm 8mm; text-align: center; display: flex; flex-direction: column; align-items: center; }
.cert-logo { width: 40mm; height: auto; }
.cert-kicker { margin-top: 4mm; font-size: 11pt; font-weight: 600; letter-spacing: .22em; text-transform: uppercase; color: var(--brand-ink); }
.cert-title { font-size: 22pt; font-weight: 700; letter-spacing: -.01em; margin-top: 2mm; }
.cert-intro { margin: 5mm 0 1mm; color: #4a4440; }
.cert-name { font-size: 28pt; font-weight: 700; letter-spacing: -.01em; border-bottom: 1px solid #d9d3cd; display: inline-block; padding: 0 10mm 2mm; }
.cert-id { margin-top: 2mm; color: #4a4440; font-size: 10.5pt; }
.cert-body { max-width: 205mm; margin: 5mm auto 0; font-size: 12pt; line-height: 1.55; }
.cert-bottom { align-self: stretch; display: flex; justify-content: space-between; align-items: flex-end; margin: 5mm 12mm 0; text-align: left; }
.cert-meta { font-size: 10pt; color: #4a4440; }
.certificate .cert-sign { margin-top: 0; }
.certificate .cert-foot { position: static; margin-top: auto; padding-top: 4mm; }
@page cert-land { size: A4 landscape; margin: 0; }
@page cert-port { size: A4 portrait; margin: 0; }
@media print {
  .cert-wrap { overflow: visible; padding: 0; }
  .cert-page { box-shadow: none; margin: 0; }
  .cert-page.certificate { page: cert-land; }
  .cert-page.letter { page: cert-port; }
}

/* ---------- radio exchanges (radiotelephony) ---------- */
.radio-log { display: grid; gap: 10px; margin: 12px 0 14px; }
.tx { border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; background: #fff; max-width: 86%; animation: fadein .25s ease; }
.tx.atc { background: #f7f9fc; border-color: #d9e3ee; border-top-left-radius: 4px; }
.tx.rp { margin-left: auto; border-top-right-radius: 4px; }
.tx-from { font-size: .72rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 3px; }
.tx.atc .tx-from { color: var(--sky); }
.tx.rp .tx-from { color: var(--brand-ink); }
.tx-msg { font-size: 1.02rem; font-weight: 500; color: var(--ink); }
.tx-note { margin-top: 7px; padding-top: 7px; border-top: 1px dashed var(--line); font-size: .84rem; color: var(--grey); }
.tx-note p { margin: 0; }
.order-list { list-style: none; padding: 0; margin: 10px 0; display: grid; gap: 8px; counter-reset: ord; }
.order-list li { counter-increment: ord; position: relative; border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px 9px 40px; background: #fff; cursor: pointer; }
.order-list li::before { content: counter(ord); position: absolute; left: 14px; top: 9px; font-weight: 700; color: var(--grey); }
.order-list li.is-right { background: #f5fbf7; border-color: #c9e6d4; }
.order-list li.is-wrong { background: #fef7f6; border-color: #f2d0cc; }
.order-pool:empty { display: none; }

/* ---------- textbook pages ---------- */
.read-time { font-size: .78rem; color: var(--grey); margin: -4px 0 10px; }
.tb { font-size: 1.02rem; line-height: 1.68; color: #262220; max-width: 74ch; }
.tb p { margin: 0 0 14px; }
.tb h3 { font-size: 1.08rem; margin: 22px 0 8px; color: var(--ink); }
.tb h3:first-child { margin-top: 4px; }
.tb ul, .tb ol { margin: 0 0 14px; padding-left: 1.4em; }
.tb li { margin-bottom: 6px; }
.tb b { color: var(--ink); }
.tb-fig { margin: 8px 0 18px; max-width: 640px; }
.tb-fig svg { max-height: 360px; }
.tb-table { overflow-x: auto; margin: 4px 0 16px; }
.tb-table table { width: 100%; border-collapse: collapse; font-size: .92rem; line-height: 1.45; }
.tb-table th { text-align: left; background: #f1eeeb; color: var(--ink); font-weight: 700; padding: 8px 10px; border-bottom: 2px solid #ddd7d1; }
.tb-table td { padding: 8px 10px; border-bottom: 1px solid #ebe7e3; vertical-align: top; }
.callout { border-radius: 10px; padding: 12px 16px 2px; margin: 4px 0 16px; border: 1px solid; font-size: .96rem; line-height: 1.6; }
.callout-h { font-size: .74rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; }
.callout p, .callout ul, .callout ol { margin-bottom: 10px; }
.callout.kenya { background: #fffbf0; border-color: #f1e2b8; } .callout.kenya .callout-h { color: #8a5f00; }
.callout.reg { background: #f7f9fc; border-color: #d9e3ee; } .callout.reg .callout-h { color: var(--sky); }
.callout.tip { background: #f5fbf7; border-color: #c9e6d4; } .callout.tip .callout-h { color: var(--green); }
.callout.warn { background: #fef7f6; border-color: #f2d0cc; } .callout.warn .callout-h { color: var(--red); }
.callout.remember, .callout.exam { background: #faf9f8; border-color: var(--line); } .callout.remember .callout-h, .callout.exam .callout-h { color: var(--ink); }

/* ---------- module notes ---------- */
.notes { max-width: 860px; }
.note-toc ul { margin: 4px 0 10px; padding-left: 1.2em; font-size: .9rem; }
.note-unit > h2 { margin: 30px 0 4px; padding-bottom: 6px; border-bottom: 2px solid var(--ink); }
.note-lesson { margin: 22px 0 30px; }
.note-lesson > h3 { font-size: 1.15rem; margin-bottom: 10px; }
.note-lesson h4 { margin: 18px 0 6px; color: var(--brand-ink); font-size: .95rem; }
.note-lesson .lc { color: var(--brand-ink); margin-right: 6px; }
.note-points { margin-top: 14px; }
@media print {
  .notes { max-width: none; }
  .note-toc { break-after: page; }
  .note-unit { break-before: page; }
  .note-lesson { break-inside: auto; }
  .tb-fig, .callout, .tb-table, .result, .scenario { break-inside: avoid; }
  .tb h3, .note-lesson h4, .note-lesson > h3, .note-unit > h2 { break-after: avoid; break-inside: avoid; }
  .tb-table { break-inside: auto; } .tb-table tr { break-inside: avoid; }
  .points li, .tb li { break-inside: avoid; }
  .tb { max-width: none; font-size: 11pt; }
}

/* ---------- accounts and enrolment ---------- */
.g5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.req { color: var(--brand-ink); font-weight: 700; }
.hint { display: block; color: var(--grey); font-size: .8rem; margin-top: 4px; }
.enrol-steps { display: flex; gap: 8px; list-style: none; padding: 0; margin: 0 0 16px; flex-wrap: wrap; }
.enrol-steps li { display: flex; align-items: center; gap: 8px; padding: 8px 14px 8px 8px; border-radius: 99px; background: var(--card); border: 1px solid var(--line); color: var(--grey); font-weight: 600; font-size: .9rem; }
.enrol-steps li span { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--ink-soft); color: var(--grey); font-size: .8rem; }
.enrol-steps li.cur { color: var(--ink); border-color: var(--brand); }
.enrol-steps li.cur span { background: var(--brand-strong); color: #fff; }
.enrol-steps li.done span { background: var(--green); color: #fff; }
.bio-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.bio-form .form-sec, .bio-form .span2, .bio-form .decl { grid-column: 1 / -1; }
.form-sec { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--brand-ink); margin: 14px 0 8px; padding-bottom: 4px; border-bottom: 1px solid var(--line); }
.bio-form .form-sec:first-child { margin-top: 2px; }
.decl { margin: 10px 0 6px; padding: 10px 12px; background: var(--ink-soft); border-radius: 8px; font-weight: 600; }
.kv-list { display: grid; grid-template-columns: minmax(160px, 34%) 1fr; gap: 6px 14px; margin: 0 0 6px; font-size: .92rem; }
.kv-list dt { color: var(--grey); }
.kv-list dd { margin: 0; white-space: pre-wrap; }
.bio-details summary { color: var(--brand-ink); font-weight: 600; margin-top: 10px; }
details > summary h2 { margin: 0; }
.doc { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 12px; background: #fff; }
.doc-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.doc-head h3 { margin: 0 0 2px; }
.doc-pill { text-align: right; flex: none; }
.doc-file { margin: 10px 0 4px; display: flex; gap: 10px; flex-wrap: wrap; align-items: baseline; }
.doc > .btn, .doc > button { margin-top: 8px; }
.upload { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0 14px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.upload .file-field input { padding: 6px; background: var(--ink-soft); }
.upload-actions { grid-column: 1 / -1; }
.card.dim .doc { opacity: .55; }
.finish { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.finish.notice { padding: 16px 18px; }
table.kv td { padding: 6px 10px; }
table.kv td:first-child { color: var(--grey); width: 38%; }
table.kv code { font-size: 1rem; background: var(--ink-soft); padding: 2px 8px; }
.doc-view { background: var(--ink-soft); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; display: grid; place-items: center; min-height: 200px; }
.doc-frame { width: 100%; height: 62vh; border: 0; background: #fff; }
.doc-img { max-width: 100%; max-height: 62vh; display: block; }
.modal textarea[readonly], .modal input[readonly] { background: var(--ink-soft); }
@media (max-width: 1100px) { .g5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .g5 { grid-template-columns: 1fr; }
  .bio-form { grid-template-columns: 1fr; }
  .kv-list { grid-template-columns: 1fr; gap: 0 0; }
  .kv-list dd { margin-bottom: 8px; }
}
