/* Abjad 360 identity: navy #083758 + orange #F47C4D (taken from the official logo files) */
:root {
  --navy: #083758;
  --orange: #F47C4D;
  --bg: #f4f7fa;
  --surface: #ffffff;
  --ink: #0f2233;
  --muted: #566878;
  --line: #dde5ec;
  --brand: #083758;          /* buttons, links */
  --brand-ink: #ffffff;
  --brand-soft: #e5eef5;
  --accent: #F47C4D;         /* decorative: focus ring, highlights */
  --accent-text: #b8481b;    /* orange that passes AA for text on white */
  --ok: #217a4b; --ok-soft: #e1f3e8;
  --warn: #8f5f00; --warn-soft: #fcf0d4;
  --bad: #b3332a; --bad-soft: #fae3e0;
  --radius: 12px;
  --shadow: 0 1px 2px rgb(8 55 88 / .05), 0 6px 18px rgb(8 55 88 / .06);
}
/* Light is the default theme; dark applies only when the visitor chooses it (data-theme="dark" on <html>) */
:root[data-theme="dark"] {
  --bg: #07131d; --surface: #0e2132; --ink: #e7eef4; --muted: #9db0c0; --line: #1d3448;
  --brand: #8ec2ea; --brand-ink: #062033; --brand-soft: #143350;
  --accent: #F47C4D; --accent-text: #f89b74;
  --ok: #6cc796; --ok-soft: #143826; --warn: #e8bd55; --warn-soft: #3a2e10;
  --bad: #f08b80; --bad-soft: #3d1b18; --shadow: none;
  color-scheme: dark;
}
:root[data-theme="light"] { color-scheme: light; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 17px/1.7 "Tajawal", system-ui, sans-serif;
  min-height: 100vh; display: flex; flex-direction: column;
}
a { color: var(--brand); }
h1, h2, h3 { line-height: 1.35; margin: 0 0 .5em; }
h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
/* full-width layout: fills the screen, capped only on very large displays; text keeps its own measure */
.wrap { width: 100%; max-width: 1680px; margin-inline: auto; padding-inline: clamp(16px, 3vw, 48px); }
.skip { position: absolute; inset-inline-start: -999px; }
.skip:focus { inset-inline-start: 8px; top: 8px; background: var(--surface); padding: 8px; z-index: 10; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* topbar */
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.topbar__in { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--ink); text-decoration: none; }
/* the logo is navy-on-transparent, so it sits on a white tile to stay legible in dark mode */
.brand__logo { height: 42px; width: auto; background: #fff; border-radius: 10px; padding: 3px 6px; box-sizing: content-box; }
.brand__name { display: flex; flex-direction: column; line-height: 1.15; }
.brand__name b { font-size: 1.15rem; font-weight: 800; color: var(--brand); }
.brand__name small { font-size: .8rem; color: var(--accent-text); font-weight: 500; }
.topbar { border-top: 4px solid var(--orange); }
.nav { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.nav a, .nav button { padding: 8px 12px; border-radius: 8px; color: var(--ink); text-decoration: none; font: inherit; background: none; border: 0; cursor: pointer; }
.nav a:hover, .nav button:hover { background: var(--brand-soft); }
.nav a[aria-current="page"] { color: var(--brand); font-weight: 600; }
.menu-btn { display: none; background: none; border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px; font-size: 1.2rem; color: var(--ink); }
@media (max-width: 760px) {
  .menu-btn { display: block; }
  .nav { display: none; width: 100%; flex-direction: column; align-items: stretch; padding-bottom: 12px; }
  .nav.open { display: flex; }
}

main { flex: 1; padding-block: 32px 64px; outline: none; }
/* site footer: always brand navy (both themes), orange top accent */
.site-footer { background: var(--navy); color: #c9d8e6; border-top: 4px solid var(--orange); margin-top: 24px; }
.site-footer a { color: #fff; text-decoration: none; transition: color .18s ease; }
.site-footer a:hover { color: var(--orange); }
.site-footer__grid { display: grid; grid-template-columns: minmax(240px, 1.6fr) repeat(3, minmax(160px, 1fr)); gap: 32px 40px; padding-block: 44px 32px; }
@media (max-width: 960px) { .site-footer__grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .site-footer__grid { grid-template-columns: 1fr; } }
.site-footer h2 { color: #fff; font-size: 1rem; margin: 0 0 12px; }
.site-footer h2::after { content: ""; display: block; width: 28px; height: 3px; border-radius: 2px; background: var(--orange); margin-top: 8px; }
.site-footer p { margin: 0 0 12px; font-size: .95rem; line-height: 1.8; max-width: 46ch; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.site-footer__brand { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.site-footer__brand img { height: 42px; width: auto; background: #fff; border-radius: 10px; padding: 3px 6px; box-sizing: content-box; }
.site-footer__brand span { display: flex; flex-direction: column; line-height: 1.15; }
.site-footer__brand b { font-size: 1.15rem; font-weight: 800; color: #fff; }
.site-footer__brand small { color: var(--orange); font-size: .8rem; }
.site-footer__cta { display: inline-flex; padding: 8px 16px; border-radius: 10px; border: 1px solid rgb(255 255 255 / .35); font-weight: 600; }
.site-footer__cta:hover { background: var(--orange); border-color: var(--orange); color: var(--navy) !important; }
.site-footer__bar { border-top: 1px solid rgb(255 255 255 / .12); font-size: .88rem; }
.site-footer__bar-in { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding-block: 16px; }

/* buttons & forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 18px; border-radius: 10px; border: 1px solid transparent; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; background: var(--brand); color: var(--brand-ink); min-height: 44px; }
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn--ghost { background: transparent; color: var(--brand); border-color: var(--line); }
.btn--danger { background: transparent; color: var(--bad); border-color: var(--line); }
.btn--sm { padding: 4px 10px; min-height: 34px; font-size: .9rem; }
label { display: block; font-weight: 500; margin-bottom: 4px; }
.field { margin-bottom: 14px; }
input, select, textarea { width: 100%; font: inherit; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
textarea { min-height: 100px; resize: vertical; }
.check { display: flex; gap: 8px; align-items: center; }
.check input { width: auto; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 16px; }
.err { color: var(--bad); min-height: 1.5em; font-size: .95rem; }

/* surfaces */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.narrow { max-width: 460px; margin-inline: auto; }
.muted { color: var(--muted); }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.stack > * + * { margin-top: 16px; }

/* hero */
.hero { display: grid; grid-template-columns: 1.3fr 1fr; gap: 32px; align-items: center; margin-bottom: 48px; }
.hero p { font-size: 1.15rem; color: var(--muted); max-width: 52ch; }
/* always the brand navy, in both themes */
.hero__panel { background: var(--navy); color: #fff; border-radius: 20px; padding: 28px; display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
  border-bottom: 6px solid var(--orange); }
.hero__panel b { display: block; font-size: 2.2rem; line-height: 1.2; color: var(--orange); font-weight: 800; }
.hero h1 .hl { color: var(--accent-text); }
@media (max-width: 760px) { .hero { grid-template-columns: 1fr; } }

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin: 32px 0 48px; counter-reset: s; }
.steps li { list-style: none; counter-increment: s; }
.steps li::before { content: counter(s); display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-weight: 700; margin-bottom: 8px; }
.steps { padding: 0; }

/* courses */
.filters { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 12px; margin-bottom: 20px; }
@media (max-width: 640px) { .filters { grid-template-columns: 1fr; } }
.courses { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.course { display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: inherit; transition: border-color .15s; }
.course:hover { border-color: var(--brand); }
.course p { color: var(--muted); flex: 1; margin: 0; }
.meta { display: flex; gap: 6px 14px; flex-wrap: wrap; color: var(--muted); font-size: .9rem; }
.tag { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .82rem; font-weight: 600; background: var(--brand-soft); color: var(--brand); }
.price { font-weight: 700; color: var(--accent-text); }
.bar { height: 6px; background: var(--line); border-radius: 999px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--brand); }

.detail { display: grid; grid-template-columns: 1fr 320px; gap: 24px; align-items: start; }
.detail aside { position: sticky; top: 88px; }
.outline { padding-inline-start: 1.2em; }
@media (max-width: 860px) { .detail { grid-template-columns: 1fr; } .detail aside { position: static; } }

/* status pills */
.st { padding: 2px 10px; border-radius: 999px; font-size: .82rem; font-weight: 600; white-space: nowrap; }
.st-pending { background: var(--warn-soft); color: var(--warn); }
.st-approved { background: var(--brand-soft); color: var(--brand); }
.st-completed { background: var(--ok-soft); color: var(--ok); }
.st-rejected { background: var(--bad-soft); color: var(--bad); }

/* tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { text-align: start; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 500; font-size: .85rem; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 24px; }
.kpi b { display: block; font-size: 1.7rem; }
.kpi span { color: var(--muted); font-size: .9rem; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tabs a { padding: 10px 16px; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a[aria-current="page"] { color: var(--brand); border-color: var(--brand); font-weight: 600; }

/* certificate */
/* certificates are always printed on white, so they use fixed brand colors rather than theme tokens */
.cert { background: #fff; color: #0f2233; border: 2px solid var(--navy); outline: 6px double #e5eef5; border-radius: 6px;
  padding: 40px 32px 48px; text-align: center; max-width: 760px; margin: 0 auto; border-top: 10px solid var(--orange); }
.cert__logo { height: 120px; width: auto; margin-bottom: 8px; }
.cert h1 { color: var(--navy); }
.cert .muted { color: #566878; }
.cert .who { color: var(--navy); }
.cert .st { display: inline-block; background: #e1f3e8; color: #217a4b; }
.cert .who { font-size: 1.8rem; font-weight: 700; margin: 12px 0; }
.cert .code { font-family: ui-monospace, monospace; direction: ltr; display: inline-block; }
@media print {
  .topbar, .footer, .no-print { display: none !important; }
  body { background: #fff; color: #000; }
}

/* curriculum & learning */
.unit { border: 1px solid var(--line); border-radius: 10px; padding: 4px 14px; margin-bottom: 10px; }
.unit summary { cursor: pointer; font-weight: 600; padding: 8px 0; }
.lessons { list-style: none; padding: 0; margin: 0 0 8px; }
.lessons li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.lessons a { text-decoration: none; }
.learn { display: grid; grid-template-columns: 300px 1fr; gap: 20px; align-items: start; }
.learn__nav { position: sticky; top: 88px; max-height: calc(100vh - 110px); overflow-y: auto; }
.learn__nav .lessons li { padding: 6px 8px; border-radius: 8px; border-top: 0; }
.learn__nav .lessons li.is-current { background: var(--brand-soft); }
.learn__nav .lessons a { color: var(--ink); }
.learn__nav .lessons a[aria-current="page"] { color: var(--brand); font-weight: 600; }
.unit-title { font-weight: 600; font-size: .9rem; color: var(--muted); margin: 12px 0 4px; }
.video { position: relative; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: #000; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.lesson-body { font-size: 1.05rem; max-width: 72ch; }
@media (max-width: 860px) {
  .learn { grid-template-columns: 1fr; }
  .learn__nav { position: static; max-height: none; order: 2; }
}

/* quizzes */
.quiz-head { position: sticky; top: 64px; z-index: 4; display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 16px; margin: 0 auto 16px; max-width: 760px; }
.timer { font: 700 1.2rem ui-monospace, monospace; direction: ltr; padding: 2px 10px; border-radius: 8px; background: var(--brand-soft); color: var(--brand); }
.timer--low { background: var(--bad-soft); color: var(--bad); }
.question { border: 1px solid var(--line); }
.question legend { padding: 0; float: inline-start; width: 100%; margin-bottom: 8px; }
.q-text { font-size: 1.1rem; font-weight: 600; clear: both; }
.option { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; cursor: pointer; font-weight: 400; }
.option:hover { border-color: var(--brand); }
.option:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.option input { width: auto; margin: 0; accent-color: var(--brand); }
.score { font-size: 3.2rem; font-weight: 700; line-height: 1.2; }
.score--pass { color: var(--ok); }
.score--fail { color: var(--bad); }
.question.is-ok { border-inline-start: 4px solid var(--ok); }
.question.is-wrong { border-inline-start: 4px solid var(--bad); }
.answers { list-style: none; padding: 0; margin: 0 0 8px; }
.answers li { padding: 6px 10px; border-radius: 8px; }
.ans-right { background: var(--ok-soft); color: var(--ok); }
.ans-wrong { background: var(--bad-soft); color: var(--bad); }
.ans-right-text { color: var(--ok); }
.qlist { margin: 0; padding-inline-start: 1.4em; }
.qlist li { padding: 8px 0; border-top: 1px solid var(--line); }
.opt-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.opt-row input[type=radio], .opt-row input[type=checkbox] { width: 20px; height: 20px; flex: none; accent-color: var(--ok); }

/* icons */
.ic { flex: none; vertical-align: -3px; margin-inline-end: 6px; color: var(--muted); }
.btn .ic, .st .ic, .ans-right-text .ic { color: currentColor; }
.ic--ok { color: var(--ok); }
.ic--bad { color: var(--bad); }
.ic--muted { color: var(--line); }
.meta span { display: inline-flex; align-items: center; }
.btn .ic:only-child { margin: 0; }
.menu-btn { display: none; align-items: center; cursor: pointer; }
@media (max-width: 760px) { .menu-btn { display: inline-flex; } }

/* interaction feedback (150–200ms, disabled under reduced motion) */
.btn, .nav a, .nav button, .tabs a, .option, .card.course, input, select, textarea {
  transition: background-color .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease; }
.btn, .option, label.check, select, summary, [data-content], [data-quizzes] { cursor: pointer; }
.btn:disabled { cursor: not-allowed; }
.card.course:hover { box-shadow: 0 2px 4px rgb(8 55 88 / .06), 0 10px 24px rgb(8 55 88 / .10); }
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--brand); }

.empty { text-align: center; padding: 40px 16px; color: var(--muted); }
#toast { position: fixed; bottom: 20px; inset-inline-start: 50%; transform: translate(50%, 16px); background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 10px; opacity: 0; pointer-events: none;
  transition: opacity .22s ease, transform .3s cubic-bezier(.2,.9,.3,1.2); max-width: calc(100% - 32px); box-shadow: 0 10px 30px rgb(0 0 0 / .2); z-index: 20; }
#toast.show { opacity: 1; transform: translate(50%, 0); }

/* ---------- header controls ---------- */
.brand { order: 0; }
.nav { order: 1; }
.theme-btn { order: 2; }
.menu-btn { order: 3; }
.theme-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); cursor: pointer; margin-inline-start: auto; }
.theme-btn:hover { background: var(--brand-soft); }
.theme-btn .ic { margin: 0; color: currentColor; }
.nav { margin-inline-start: auto; }
@media (max-width: 760px) { .nav { order: 4; margin: 0; } }

/* ---------- dashboards ---------- */
.page-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { margin: 0; }
.toolbar { margin-bottom: 16px; gap: 12px; }
.kpis { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.kpi { display: flex; flex-direction: column; gap: 2px; position: relative; overflow: hidden; }
.kpi b { font-size: 2rem; font-weight: 800; letter-spacing: -.01em; font-variant-numeric: tabular-nums; color: var(--ink); line-height: 1.2; }
.kpi small { font-size: .8rem; }
.kpi__icon { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); margin-bottom: 8px; }
.kpi__icon .ic { margin: 0; color: currentColor; }
.kpi__icon--ok { background: var(--ok-soft); color: var(--ok); }
.kpi__icon--warn { background: var(--warn-soft); color: var(--warn); }
.kpi__icon--accent { background: color-mix(in srgb, var(--orange) 16%, transparent); color: var(--accent-text); }
.kpi--link { text-decoration: none; color: inherit; transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.kpi--link:hover { border-color: var(--brand); transform: translateY(-2px); box-shadow: 0 8px 22px rgb(8 55 88 / .10); }
.panel { margin-bottom: 20px; }
.panel h2 { font-size: 1.15rem; margin: 0; }
.panel__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 20px; align-items: start; }
.grid-2 > .panel { margin-bottom: 0; }
.grid-2 { margin-bottom: 20px; }
.grid-2--wide { grid-template-columns: minmax(0, 2fr) minmax(min(100%, 320px), 1fr); }
@media (max-width: 960px) { .grid-2--wide { grid-template-columns: 1fr; } }
.empty-state { text-align: center; padding: 40px 20px; margin-bottom: 20px; display: grid; justify-items: center; gap: 6px; }
.ic--xl { width: 44px; height: 44px; color: var(--brand); margin: 0 0 6px; }
.ic--accent { color: var(--accent-text); }
.hero p, .lesson-body, .card p { max-width: 75ch; }

/* welcome + resume */
.welcome { display: grid; grid-template-columns: 1fr minmax(260px, 420px); gap: 20px; align-items: center; margin-bottom: 20px; }
.welcome h1 { margin: 0 0 4px; }
.welcome p { margin: 0; }
@media (max-width: 760px) { .welcome { grid-template-columns: 1fr; } }
.streak { color: var(--accent-text); font-weight: 600; }
.streak .ic { color: var(--orange); }
.resume { display: grid; gap: 6px; text-decoration: none; color: inherit; border-inline-start: 4px solid var(--orange); }
.resume b { font-size: 1.1rem; }
.resume .btn { justify-self: start; margin-top: 4px; }
.resume:hover { box-shadow: 0 10px 26px rgb(8 55 88 / .12); }

/* my courses */
.mycourses { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 14px; }
.mycourse { display: flex; flex-direction: column; gap: 8px; box-shadow: none; }
.mycourse h3 { margin: 0; }
.mycourse h3 a { color: var(--ink); text-decoration: none; }
.mycourse h3 a:hover { color: var(--brand); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); font-size: .82rem; color: var(--ink); text-decoration: none; }
.chip .ic { width: 14px; height: 14px; margin-inline-end: 4px; }
.chip--ok { border-color: transparent; background: var(--ok-soft); color: var(--ok); }
.chip--ok .ic { color: currentColor; }
.certs, .watch { list-style: none; margin: 0; padding: 0; }
.certs li, .watch li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.certs li:first-child, .watch li:first-child { border-top: 0; }
.certs li > span, .watch li > span:first-child { flex: 1; min-width: 0; }
.watch__p { width: 110px; display: grid; gap: 2px; }

/* activity feed */
.feed { list-style: none; margin: 0; padding: 0; max-height: 460px; overflow-y: auto; }
.feed li { display: flex; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); line-height: 1.5; }
.feed li:first-child { border-top: 0; }
.feed__icon { flex: none; display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); }
.feed__icon .ic { margin: 0; width: 16px; height: 16px; color: currentColor; }
.feed__icon--quiz_pass, .feed__icon--lesson { background: var(--ok-soft); color: var(--ok); }
.feed__icon--quiz_fail { background: var(--bad-soft); color: var(--bad); }
.feed__icon--cert { background: color-mix(in srgb, var(--orange) 16%, transparent); color: var(--accent-text); }

/* segmented control */
.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); gap: 2px; }
.seg button { font: inherit; font-size: .88rem; border: 0; background: none; color: var(--muted); padding: 5px 12px; border-radius: 8px; cursor: pointer;
  display: inline-flex; align-items: center; transition: background-color .18s ease, color .18s ease, box-shadow .18s ease; }
.seg button[aria-selected="true"], .seg button[aria-checked="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgb(0 0 0 / .12); font-weight: 600; }
.seg--lg button { padding: 8px 18px; font-size: 1rem; }

/* charts (single hue, recessive grid, 4px rounded data-ends) */
.chart { margin: 0; }
.chart figcaption { margin-bottom: 8px; color: var(--ink); }
.chart__svg { width: 100%; height: 220px; display: block; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart .tick { fill: var(--muted); font-size: 11px; font-family: inherit; }
.chart .mark { fill: var(--brand); transform-box: fill-box; transform-origin: bottom; }
.chart .hit { fill: transparent; }
.chart .col { outline: none; cursor: default; }
.chart .col:hover .hit, .chart .col:focus-visible .hit { fill: var(--brand-soft); opacity: .6; }
.chart .col:hover .mark, .chart .col:focus-visible .mark { fill: var(--orange); }
.chart__table { margin-top: 8px; font-size: .9rem; }
.chart__table summary { cursor: pointer; color: var(--muted); }
.hbars { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.hbars li { display: grid; grid-template-columns: minmax(90px, 1fr) 2fr auto; gap: 10px; align-items: center; }
.hbars__label { font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbars__track { height: 12px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.hbars__fill { display: block; height: 100%; background: var(--brand); border-radius: 4px; transform-origin: right; }
.hbars li:hover .hbars__fill { background: var(--orange); }
.hbars__value { font-variant-numeric: tabular-nums; min-width: 2ch; }
#tip { position: fixed; z-index: 30; pointer-events: none; background: var(--ink); color: var(--bg); font-size: .85rem; padding: 6px 10px; border-radius: 8px;
  opacity: 0; transform: translateY(4px); transition: opacity .15s ease, transform .15s ease; white-space: nowrap; box-shadow: 0 6px 20px rgb(0 0 0 / .2); }
#tip.show { opacity: 1; transform: none; }

/* skeleton loader */
.skeleton { display: grid; gap: 16px; }
.sk { border-radius: var(--radius); background: linear-gradient(90deg, var(--line) 0%, var(--brand-soft) 50%, var(--line) 100%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
.sk--title { height: 34px; width: 40%; }
.sk--card { height: 110px; }
.sk--block { height: 260px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---------- motion ----------
   Short (150–450ms), eased out, never layout-shifting, and fully disabled under reduced motion. */
@keyframes page-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes grow-x { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes grow-y { from { transform: scaleY(0); } to { transform: scaleY(1); } }
main.enter { animation: page-in .35s cubic-bezier(.2,.8,.2,1) both; }
main.enter .stagger > * { animation: rise .45s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--i, 0) * 55ms + 60ms); }
main.enter .bar > span { animation: grow-x .8s cubic-bezier(.2,.8,.2,1) .15s both; transform-origin: right; }
main.enter .hbars__fill { animation: grow-x .7s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--d, 0ms) + 150ms); }
.chart .mark { animation: grow-y .6s cubic-bezier(.2,.8,.2,1) both; animation-delay: var(--d, 0ms); }
main.enter .courses > *, main.enter .steps > *, main.enter .kpis > * { animation: rise .45s cubic-bezier(.2,.8,.2,1) both; }
main.enter .courses > :nth-child(2), main.enter .steps > :nth-child(2) { animation-delay: .06s; }
main.enter .courses > :nth-child(3), main.enter .steps > :nth-child(3) { animation-delay: .12s; }
main.enter .courses > :nth-child(n+4), main.enter .steps > :nth-child(4) { animation-delay: .18s; }
.card.course { transition: border-color .2s ease, box-shadow .25s ease, transform .25s cubic-bezier(.2,.8,.2,1); }
.card.course:hover { transform: translateY(-3px); }
.btn { transition: background-color .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease, transform .12s ease, filter .18s ease; }
.btn:not(.btn--ghost):not(.btn--danger):hover { box-shadow: 0 6px 16px rgb(8 55 88 / .22); filter: none; }
.btn:not(.btn--ghost):not(.btn--danger) { background-image: linear-gradient(180deg, rgb(255 255 255 / .08), transparent); }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn--ghost:hover { background: var(--brand-soft); }
.btn--danger:hover { background: var(--bad-soft); }
.option { transition: border-color .18s ease, background-color .18s ease, transform .12s ease; }
.option:active { transform: scale(.99); }
.question.is-ok, .question.is-wrong { animation: rise .4s cubic-bezier(.2,.8,.2,1) both; }
.score { animation: rise .5s cubic-bezier(.2,1.4,.4,1) both; }
.unit summary { transition: color .15s ease; }
.unit summary:hover { color: var(--brand); }
:root { scroll-behavior: smooth; }

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