/* Exam Engine — styles. White surfaces with a blue accent (light + dark). No external deps (CSP: self only, no inline styles). */
:root {
  --bg: #FFFFFF; --bg2: #F7F9FD; --surface: #FFFFFF;
  --ink: #141B2D; --soft: #3F4A63; --muted: #667085;
  --accent: #2F62E8; --deep: #2450CC; --a-soft: #C7D6FA; --wash: #EEF3FE; --wash2: #F5F8FF; --wash-line: #DCE6FC;
  --btn1: #3468EE; --btn2: #2450CC; --mark: #C4CEE0;
  --green: #1F8A4C; --green-wash: #E6F5EC; --amber: #8A5A00; --amber-wash: #FFF3D9;
  --red: #C0362C; --red-wash: #FDECEA; --blue: #2F62E8; --blue-chip: #EEF3FE;
  --border: #E4E9F2; --border-2: #EEF1F7;
  --shadow-sm: 0 1px 3px rgba(20, 40, 90, .06), 0 1px 2px rgba(20, 40, 90, .04);
  --shadow-md: 0 14px 40px rgba(30, 60, 140, .09), 0 2px 8px rgba(30, 60, 140, .05);
  --page: #fff radial-gradient(1200px 500px at 100% 0, #F1F5FF 0, transparent 60%), radial-gradient(900px 500px at 0 100%, #F5F8FF 0, transparent 60%);
  --glass: rgba(255, 255, 255, .85); --scrim: rgba(15, 25, 55, .32);
  --radius: 20px; --accent-rgb: 47, 98, 232; --g1: #5B86FF; --focus: 0 0 0 3px rgba(var(--accent-rgb), .35);
  color-scheme: light;
}
/* Dark: neutral near-black with the same blue accent. "Automatic" follows the device (assets/js/theme.js sets data-theme on <html>). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0E1219; --bg2: #141A24; --surface: #161C28; --ink: #E9EDF6; --soft: #C3CCDD; --muted: #93A0B8;
    --accent: #5B86FF; --deep: #8FB0FF; --a-soft: #2F4A8E; --wash: #1B2745; --wash2: #151F38; --wash-line: #25355E; --mark: #3A465F;
    --green: #7FD39C; --green-wash: #163526; --amber: #F2D08A; --amber-wash: #3A2E12; --red: #F2A8A2; --red-wash: #3A1B18;
    --blue: #8FB0FF; --blue-chip: #1B2745;
    --border: rgba(255, 255, 255, .12); --border-2: rgba(255, 255, 255, .07);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, .4); --shadow-md: 0 14px 40px rgba(0, 0, 0, .45);
    --page: #0E1219 radial-gradient(1200px 500px at 100% 0, #131C33 0, transparent 60%), radial-gradient(900px 500px at 0 100%, #101828 0, transparent 60%);
    --glass: rgba(14, 18, 25, .85); --scrim: rgba(0, 0, 0, .55);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0E1219; --bg2: #141A24; --surface: #161C28; --ink: #E9EDF6; --soft: #C3CCDD; --muted: #93A0B8;
  --accent: #5B86FF; --deep: #8FB0FF; --a-soft: #2F4A8E; --wash: #1B2745; --wash2: #151F38; --wash-line: #25355E; --mark: #3A465F;
  --green: #7FD39C; --green-wash: #163526; --amber: #F2D08A; --amber-wash: #3A2E12; --red: #F2A8A2; --red-wash: #3A1B18;
  --blue: #8FB0FF; --blue-chip: #1B2745;
  --border: rgba(255, 255, 255, .12); --border-2: rgba(255, 255, 255, .07);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, .4); --shadow-md: 0 14px 40px rgba(0, 0, 0, .45);
  --page: #0E1219 radial-gradient(1200px 500px at 100% 0, #131C33 0, transparent 60%), radial-gradient(900px 500px at 0 100%, #101828 0, transparent 60%);
  --glass: rgba(14, 18, 25, .85); --scrim: rgba(0, 0, 0, .55);
  color-scheme: dark;
}

* { box-sizing: border-box; }
/* No visible scrollbars (wheel, touch, trackpad and keyboard still scroll) */
* { scrollbar-width: none; }
::-webkit-scrollbar { display: none; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--page); background-attachment: fixed; color: var(--ink);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}
main { flex: 1; }
a { color: var(--deep); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: none; box-shadow: var(--focus); }
.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: -48px; z-index: 100; background: var(--surface); padding: 8px 14px; border-radius: 10px; }
.skip:focus { top: 12px; }
[hidden] { display: none !important; }
.muted { color: var(--muted); font-size: 13.5px; }
.inline { display: inline; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 18px; border-radius: 11px; border: 1px solid transparent;
  font-weight: 650; font-size: 14px; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .15s;
}
.btn-primary { background: linear-gradient(180deg, var(--btn1), var(--btn2)); color: #fff; box-shadow: 0 4px 12px rgba(var(--accent-rgb), .25); } /* white text >= 6:1 (WCAG AA) */
.btn-primary:hover { transform: translateY(-1px); }
.btn-ghost { background: var(--surface); border-color: var(--border); color: var(--ink); }
.btn-ghost:hover { border-color: var(--a-soft); background: var(--wash2); }
.btn-soft { background: var(--wash); color: var(--deep); }
.btn-soft:hover { background: var(--wash-line); }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 9px; }
.btn-block { width: 100%; }
.btn-danger { background: var(--red); color: #fff; }
.btn.danger { color: var(--red); }
.btn[disabled], .btn[aria-disabled="true"], button.btn:disabled { opacity: .55; cursor: default; transform: none; }
.link-btn { background: none; border: 0; padding: 0; color: var(--deep); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.link-btn.danger { color: var(--red); }

/* ONE header for every page: brand (or exam counter) left, [timer], Catalog + My Exams and the ☰ menu right */
.hdr { position: sticky; top: 0; z-index: 55; background: var(--glass); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border-2); }
.hdr-in { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 12px; min-height: 64px; padding: 8px 16px; max-width: 1180px; margin: 0 auto; }
.hdr-left { grid-column: 1; grid-row: 1; min-width: 0; }
.hdr-in > .timer { grid-column: 2; grid-row: 1; }
.hright { display: flex; align-items: center; gap: 10px; justify-self: end; grid-column: 3; grid-row: 1; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 750; color: var(--ink); text-decoration: none; min-width: 0; }
.logo { width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(135deg, var(--btn1), var(--btn2)); display: grid; place-items: center; color: #fff; flex: none; }
.tabs-nav { display: flex; gap: 4px; }
.tab { padding: 6px 14px; border-radius: 999px; font-size: 14px; font-weight: 650; color: var(--soft); border: 1px solid transparent; text-decoration: none; white-space: nowrap; }
.tab:hover { background: var(--wash); color: var(--deep); }
.tab[aria-current="page"] { background: var(--surface); color: var(--deep); border-color: var(--border); box-shadow: var(--shadow-sm); }
.live-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-left: 7px; vertical-align: 2px; }
.menu-btn { position: relative; width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; display: grid; place-items: center; box-shadow: var(--shadow-sm); color: var(--ink); padding: 0; }
.menu-btn:hover { border-color: var(--a-soft); }
.menu-btn .ic-x { display: none; }
.menu-btn.open .ic-bars { display: none; }
.menu-btn.open .ic-x { display: block; }
.menu-btn.open { border-color: var(--accent); color: var(--deep); background: var(--wash); }
.menu-badge { position: absolute; top: -6px; right: -6px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 99px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--bg); }
/* exam header content */
.q-count { font-weight: 700; font-size: 15px; letter-spacing: -.01em; line-height: 1.2; }
.q-progress { height: 4px; width: 110px; border-radius: 99px; background: var(--border); margin-top: 5px; overflow: hidden; }
.q-progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--g1), var(--deep)); border-radius: 99px; transition: width .3s; }
.timer { justify-self: center; display: flex; align-items: center; gap: 8px; padding: 5px 6px 5px 12px; border-radius: 12px; background: var(--wash); border: 1px solid var(--wash-line); font: 600 14px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--ink); }
.timer > svg { color: var(--accent); }
.timer.warn { background: var(--red-wash); border-color: transparent; color: var(--red); }
.timer.warn > svg { color: var(--red); }
.timer form { margin: 0; }
.pause { width: 28px; height: 28px; border-radius: 8px; border: 0; background: var(--surface); color: var(--accent); cursor: pointer; display: grid; place-items: center; box-shadow: var(--shadow-sm); padding: 0; }
.pause:hover { background: var(--wash2); }
/* phones: brand / counter + timer + ☰ on row 1, Catalog / My Exams on row 2 */
@media (max-width: 720px) {
  .hdr-in { grid-template-columns: minmax(0, 1fr) auto auto; row-gap: 6px; padding-bottom: 6px; }
  .hright { display: contents; }
  .hdr-in > .timer { grid-column: 2; }
  .menu-btn { grid-column: 3; grid-row: 1; }
  .tabs-nav { grid-column: 1 / -1; grid-row: 2; justify-content: center; }
}

/* Shared right-hand menu drawer (starts below the header, so the ☰ stays clickable and toggles it) */
.scrim { position: fixed; inset: 65px 0 0 0; background: var(--scrim); backdrop-filter: blur(2px); z-index: 40; }
.drawer { position: fixed; top: 65px; right: 0; bottom: 0; width: min(360px, 100vw); background: var(--surface); z-index: 50; box-shadow: -20px 10px 60px rgba(0, 0, 0, .18); display: flex; flex-direction: column; border-left: 1px solid var(--border-2); border-top: 1px solid var(--border-2); }
.drawer-head { padding: 16px 20px 10px; }
.drawer-head h2 { margin: 0; font-size: 18px; }
.seg { display: flex; gap: 4px; background: var(--bg2); border: 1px solid var(--border-2); border-radius: 12px; padding: 3px; margin: 0 20px 12px; }
.seg button { flex: 1; border: 0; background: none; padding: 7px 10px; border-radius: 9px; font-weight: 650; font-size: 13.5px; color: var(--muted); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--deep); box-shadow: var(--shadow-sm); }
.drawer-body { padding: 0 20px 14px; overflow-y: auto; flex: 1; }
.drawer-foot { padding: 14px 20px 18px; border-top: 1px solid var(--border-2); display: grid; gap: 8px; background: var(--surface); }
.drawer-foot form { margin: 0; }
.drawer-foot .btn { width: 100%; }
.dstat { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 6px 0 12px; }
.dstat div { background: var(--bg2); border: 1px solid var(--border-2); border-radius: 12px; padding: 8px 12px; }
.dstat b { display: block; font-size: 20px; }
.dstat span { font-size: 12px; color: var(--muted); font-weight: 600; }
.dfilters { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.f { padding: 6px 13px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); font-weight: 650; font-size: 13px; color: var(--soft); cursor: pointer; }
.f[aria-pressed="true"] { background: var(--wash); border-color: var(--a-soft); color: var(--deep); }
.qgrid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.qd { aspect-ratio: 1; border-radius: 9px; border: 1.5px solid var(--border); background: var(--surface); font-weight: 700; font-size: 12.5px; color: var(--soft); cursor: pointer; display: grid; place-items: center; padding: 0; }
.qd:hover { border-color: var(--a-soft); background: var(--wash2); }
.qd.ans { background: var(--wash); border-color: var(--wash-line); color: var(--deep); }
.qd.cur { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .22); color: var(--deep); background: var(--surface); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin: 12px 0 0; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; border: 1.5px solid var(--border); vertical-align: -2px; margin-right: 5px; background: var(--surface); }
.legend i.a { background: var(--wash); border-color: var(--wash-line); }
.legend i.c { border-color: var(--accent); }
.legend i.g { background: var(--amber-wash); border-color: var(--amber); }
.usercard { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--border-2); border-radius: 14px; background: var(--bg2); margin: 4px 0 14px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--wash); color: var(--deep); font-weight: 700; font-size: 15px; flex: none; }
.usercard b { display: block; line-height: 1.25; overflow-wrap: anywhere; }
.usercard span { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.mlist { display: grid; gap: 2px; margin-bottom: 12px; }
.mlist form { margin: 0; }
.mitem { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 11px; border: 0; background: none; text-align: left; font-weight: 650; font-size: 14.5px; color: var(--ink); cursor: pointer; width: 100%; text-decoration: none; }
.mitem:hover { background: var(--wash2); }
.mitem[aria-current="page"] { background: var(--wash); color: var(--deep); }
.mitem svg { color: var(--muted); flex: none; }
.mitem[aria-current="page"] svg { color: var(--deep); }
.mitem.danger { color: var(--red); }
.msep { height: 1px; background: var(--border-2); margin: 8px 4px; }
.mlabel { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 10px 12px 6px; }
.themeseg { margin: 0 12px 6px; }
.toast { position: fixed; top: 76px; left: 50%; transform: translateX(-50%); z-index: 70; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-size: 13.5px; font-weight: 600; box-shadow: var(--shadow-md); max-width: calc(100vw - 24px); text-align: center; }

/* Hero & search (catalog) */
.hero { text-align: center; padding-top: 44px; padding-bottom: 12px; }
.eyebrow { display: inline-block; font-size: 12px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; color: var(--deep); background: var(--wash); padding: 5px 14px; border-radius: 999px; margin: 0 0 14px; }
h1 { font-size: clamp(28px, 5vw, 42px); line-height: 1.12; margin: 0 0 12px; letter-spacing: -.02em; }
h2 { font-size: 20px; margin: 22px 0 8px; }
.grad { background: linear-gradient(120deg, var(--accent), var(--btn1)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { color: var(--soft); font-size: 17px; max-width: 620px; margin: 0 auto 26px; }
.search-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-md); padding: 16px; max-width: 860px; margin: 0 auto; text-align: left; }
.field-search { position: relative; display: block; }
.field-search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.field-search input { width: 100%; padding: 12px 14px 12px 42px; border-radius: 14px; border: 1px solid var(--border); background: var(--bg2); font-size: 16px; }
.field-search input:focus { border-color: var(--accent); }
.filters { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: center; margin-top: 12px; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg2); font-size: 13.5px; font-weight: 600; cursor: pointer; color: var(--soft); }
.pill[aria-pressed="true"] { background: linear-gradient(120deg, var(--btn1), var(--btn2)); color: #fff; border-color: transparent; }
select { padding: 7px 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--bg2); font-size: 14px; max-width: 100%; }

/* Results / cards */
.results { padding-top: 22px; padding-bottom: 48px; }
.status { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 34px; margin-bottom: 12px; color: var(--muted); font-size: 14.5px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); gap: 18px; }
.card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); transition: transform .18s, box-shadow .18s; min-width: 0; }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.chip { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--wash); color: var(--deep); white-space: nowrap; }
.chip.info { background: var(--blue-chip); color: var(--blue); }
.chip.ok { background: var(--green-wash); color: var(--green); }
.chip.warn { background: var(--amber-wash); color: var(--amber); }
.chip.bad { background: var(--red-wash); color: var(--red); }
.chip.plain { background: transparent; border: 1px solid var(--border); color: var(--soft); font-weight: 600; }
.card-title { font-size: 18px; line-height: 1.3; margin: 0 0 4px; overflow-wrap: anywhere; }
.card-by { color: var(--soft); margin: 0 0 2px; font-size: 14.5px; }
.card-meta { color: var(--muted); margin: 0; font-size: 13px; }
.card-actions { display: flex; gap: 8px; margin-top: auto; padding-top: 16px; flex-wrap: wrap; }
.card-actions .btn { flex: 1 1 auto; }
.icon-tile { width: 42px; height: 42px; border-radius: 12px; background: var(--wash); color: var(--deep); display: grid; place-items: center; margin-bottom: 12px; flex: none; }
.empty { grid-column: 1 / -1; text-align: center; padding: 48px 16px; color: var(--muted); background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Studio-style pages (My Exams, admin, setup, exam, results, settings) */
.studio { padding-top: 28px; padding-bottom: 48px; }
.studio-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 20px; margin-bottom: 18px; }
.studio-head h1, .studio > h1 { margin: 0; font-size: clamp(26px, 5vw, 34px); }
.studio > h1 { margin-bottom: 16px; }
.studio-head p { margin: 4px 0 0; }
.narrow { max-width: 560px; margin: 0 auto; }
.narrow.mid { max-width: 780px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr)); gap: 12px; margin: 0 0 18px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 14px 16px; box-shadow: var(--shadow-sm); }
.kpi dt { font-size: 13px; color: var(--muted); font-weight: 600; }
.kpi dd { margin: 2px 0 0; font-size: 26px; font-weight: 750; }
.kpi dd small { font-size: 14px; color: var(--muted); font-weight: 600; }
.kpi dd.ok { color: var(--green); }
.section-title { font-size: 17px; margin: 26px 0 10px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 26px 0 10px; }
.section-head .section-title { margin: 0; }
.panel-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 16px; }
.panel-card { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 16px 18px 18px; box-shadow: var(--shadow-sm); min-width: 0; }
.panel-card h2 { font-weight: 750; font-size: 17px; margin: 0 0 12px; }
.panel-card > .muted:first-child { margin-top: 0; }
.panel-card > h1 { font-size: 26px; margin-bottom: 8px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 18px; }
.callout { margin: 14px 0 0; padding: 10px 12px; border-radius: 12px; background: var(--wash2); font-size: 14px; }

/* Topic mastery bars — widths applied by app.js from data-pct (CSP: no inline styles) */
.bars { display: flex; flex-direction: column; gap: 12px; }
.bar-row { display: grid; grid-template-columns: 130px 1fr 46px; align-items: center; gap: 12px; font-size: 13.5px; }
.bar-row .t { color: var(--ink); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track { height: 9px; background: var(--wash2); border-radius: 999px; overflow: hidden; }
.fill { display: block; height: 100%; border-radius: 999px; background: var(--accent); width: 0; transition: width .4s ease; }
.fill.low { background: #D9824A; } .fill.mid { background: #D9A406; } .fill.high { background: var(--green); }
.bar-row .n { text-align: right; font-variant-numeric: tabular-nums; color: var(--soft); font-weight: 650; }

/* Tables */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow-sm); }
.panel-card .table-wrap { border: 0; box-shadow: none; background: none; border-radius: 0; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table.wide { min-width: 760px; }
.data-table th, .data-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border-2); vertical-align: top; }
.data-table th { font-size: 12.5px; color: var(--muted); font-weight: 700; white-space: nowrap; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table .num, th.num, td.num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table .chip { white-space: nowrap; }
.data-table tr.retired td { opacity: .55; }
.data-table form { margin: 0; }

/* Tabs (admin sub-navigation) */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tabs a { padding: 10px 14px; border-radius: 10px 10px 0 0; font-weight: 650; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -1px; text-decoration: none; }
.tabs a:hover { color: var(--deep); }
.tabs a[aria-current="page"] { color: var(--deep); border-bottom-color: var(--deep); }

/* Forms */
label { display: block; }
.field { display: block; margin: 14px 0 0; font-size: 14px; font-weight: 600; }
.field input:not([type="checkbox"]):not([type="radio"]), .field select, .field textarea { display: block; width: 100%; margin-top: 6px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--bg2); font-size: 16px; font-weight: 400; }
.field input:focus, .field select:focus { border-color: var(--accent); }
.field-label { display: block; margin: 14px 0 4px; font-size: 14px; font-weight: 600; }
.hint-inline { font-weight: 400; color: var(--muted); }
.field textarea { resize: vertical; line-height: 1.5; }
.preview-note { margin: 14px 2px 0; }
.hint { display: block; margin-top: 4px; font-size: 12.5px; font-weight: 400; color: var(--muted); }
.check { display: flex; gap: 10px; align-items: center; margin-top: 14px; font-size: 14px; color: var(--soft); font-weight: 400; }
.check input { flex: none; width: 18px; height: 18px; accent-color: var(--btn1); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 0 12px; align-items: end; }
.form-grid .btn { margin-top: 14px; }
.cert-form { border-top: 1px solid var(--border-2); padding-top: 4px; margin-top: 8px; }
.inline-select { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* Flash / status */
.flash { padding: 10px 14px; border-radius: 12px; margin: 0 0 16px; font-size: 14.5px; }
.flash-success, .ok { background: var(--green-wash); color: var(--green); }
.flash-error, .err { background: var(--red-wash); color: var(--red); }
.errlist { color: var(--red); }
.checks { list-style: none; padding: 0; }
.checks li { padding: 3px 0; }
.flashes { padding-top: 16px; }
.flashes .flash { margin: 0; }

/* Auth (sign in / change password) and installer */
.account-page { display: grid; place-items: center; padding: 36px 16px; }
.account-card { width: 100%; max-width: 440px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-md); padding: 28px 24px; }
.account-card .brand { margin-bottom: 20px; }
.account-card h1 { font-size: 24px; margin-bottom: 6px; }
.account-card .btn-block { margin-top: 18px; }
.account-card .flash { margin: 14px 0 0; }
.install main.card { max-width: 480px; margin: 40px auto; padding: 28px 24px; box-shadow: var(--shadow-md); }
.install h1 { font-size: 24px; }
.install label { display: block; margin: 14px 0 0; font-size: 14px; font-weight: 600; }
.install input { display: block; width: 100%; margin-top: 6px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--bg2); font-size: 16px; font-weight: 400; }
.install button { margin-top: 18px; display: inline-flex; padding: 10px 18px; border-radius: 999px; border: 0; background: linear-gradient(120deg, var(--btn1), var(--btn2)); color: #fff; font-weight: 650; cursor: pointer; }

/* Exam setup */
.mode-cards { display: grid; gap: 8px; margin-top: 8px; }
.mode-card { display: block; border: 1px solid var(--border); border-radius: 16px; padding: 12px 14px; cursor: pointer; background: var(--bg2); }
.mode-card input { position: absolute; opacity: 0; width: 0; height: 0; }
.mode-card.selected, .mode-card:has(input:checked) { border-color: var(--accent); background: var(--wash); }
.mode-card:has(input:focus-visible) { box-shadow: var(--focus); }
.mode-title { display: block; font-weight: 650; }
.mode-desc { display: block; font-size: 13.5px; margin-top: 2px; }
#topic-picker { display: flex; flex-wrap: wrap; gap: 6px 18px; border: 1px solid var(--border); border-radius: 16px; padding: 12px 14px; background: var(--bg2); }
.topic-group { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.topic-group .check { margin-top: 0; }
.setup-actions { margin-top: 20px; }

/* Exam taking: compact, focused card (the header and the ☰ drawer carry counter, timer, jump-to-question) */
.stage { max-width: 760px; margin: 22px auto 60px; padding: 0 16px; }
.q-card { background: var(--surface); border: 1px solid var(--border-2); border-radius: 18px; box-shadow: var(--shadow-md); padding: 22px 26px; }
.q-eyebrow { display: block; font-size: 12px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; color: var(--accent); margin: 0 0 8px; }
.question { border: 0; margin: 0; padding: 0; min-width: 0; }
.question legend { float: left; width: 100%; padding: 0; margin: 0 0 4px; font-size: 17.5px; line-height: 1.5; font-weight: 600; letter-spacing: -.005em; overflow-wrap: anywhere; }
.question legend + * { clear: both; }
.q-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 10px; }
.q-hint { color: var(--muted); font-size: 13px; margin: 0; min-height: 18px; }
.flag-btn { border: 1px solid var(--border); background: var(--surface); color: var(--soft); border-radius: 999px; padding: 4px 12px; font: inherit; font-size: 13px; font-weight: 650; cursor: pointer; }
.flag-btn[aria-pressed="true"] { background: var(--amber-wash); color: var(--amber); border-color: transparent; }
.feedback { margin: 4px 0 12px; }
.question:has(.check-btn:not([hidden])) { padding-bottom: 18px; }
.feedback-verdict { margin: 0; font-weight: 700; }
.feedback.ok .feedback-verdict { color: var(--green); }
.feedback.bad .feedback-verdict { color: var(--red); }
.opt.is-correct { background: var(--green-wash); }
.opt.is-wrong { background: var(--red-wash); }
.question code, .explanation code, .review-stem code, .review-opts code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; background: var(--bg2); padding: 0 4px; border-radius: 4px; }
.qd.flag { box-shadow: inset 0 0 0 2px var(--amber); }
.opts { margin: 4px 0 18px; padding: 0; list-style: none; }
.opt { display: flex; align-items: center; gap: 13px; padding: 13px 14px; border-radius: 12px; cursor: pointer; position: relative; transition: background .12s; font-weight: 400; overflow-wrap: anywhere; }
.opt + .opt::before { content: ""; position: absolute; left: 14px; right: 14px; top: 0; height: 1px; background: var(--border); }
.opt:hover { background: var(--wash2); }
.opt:has(input:checked) { background: var(--wash); }
.opt:has(input:checked)::before, .opt:has(input:checked) + .opt::before { background: transparent; }
.opt input { position: absolute; opacity: 0; width: 0; height: 0; }
.mark { width: 20px; height: 20px; flex: none; border-radius: 50%; border: 1.5px solid var(--mark); display: grid; place-items: center; background: var(--surface); transition: .12s; }
.opt.multi .mark { border-radius: 6px; }
.opt:has(input:checked) .mark { border-color: var(--accent); background: var(--accent); }
.opt:has(input[type=radio]:checked) .mark::after { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #fff; }
.opt:has(input[type=checkbox]:checked) .mark::after { content: ""; width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px, -1px); }
.opt:has(input:focus-visible) { box-shadow: var(--focus); }
.opt-text { font-size: 15px; color: var(--ink); }
.opt-key { margin-left: auto; font-size: 11px; font-weight: 700; color: var(--muted); border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px; background: var(--surface); }
.nav-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.nav-mid { color: var(--muted); font-size: 12.5px; }
.unans { margin-top: 18px; border: 1.5px solid var(--wash-line); border-radius: 12px; background: var(--surface); overflow: hidden; }
.unans summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 11px 14px; font-weight: 650; font-size: 14px; color: var(--deep); }
.unans summary::-webkit-details-marker { display: none; }
.unans summary .cnt { background: var(--wash); border-radius: 99px; padding: 1px 9px; font-size: 12px; }
.unans summary .chev { margin-left: auto; transition: transform .15s; }
.unans[open] summary .chev { transform: rotate(180deg); }
.unans .body { padding: 4px 14px 14px; border-top: 1px solid var(--border-2); }
.unans .body p { margin: 10px 0 8px; font-size: 13px; color: var(--muted); }
.unans .dots { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.jump { min-width: 30px; height: 30px; padding: 0 8px; border-radius: 9px; border: 1px solid var(--wash-line); background: var(--surface); color: var(--deep); font-weight: 700; font-size: 12.5px; cursor: pointer; }
.jump:hover { background: var(--wash); border-color: var(--a-soft); }
.kbd { font-size: 12px; color: var(--muted); text-align: center; margin-top: 12px; }
.kbd kbd { border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 6px; padding: 1px 6px; background: var(--surface); font: 600 11.5px ui-monospace, monospace; }
.exam-take:not(.js) .question { margin-bottom: 26px; }
.exam-take:not(.js) .exam-js-only { display: none; }
.exam-take.js .exam-nojs { display: none; }
.paused-card form + form { margin-top: 14px; }
.panelx { background: var(--surface); border: 1px solid var(--border-2); border-radius: 18px; box-shadow: var(--shadow-md); padding: 24px 26px; }
.panelx h2 { margin: 0 0 6px; font-size: 21px; }
.warnbox { display: flex; gap: 12px; align-items: flex-start; background: var(--amber-wash); color: var(--amber); border-radius: 12px; padding: 10px 14px; margin: 14px 0; font-size: 14px; }
.list-un { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0 4px; }
.review-card { max-width: 640px; margin: 26px auto; padding: 0 16px; }
.paused-card { max-width: 420px; margin: 70px auto; text-align: center; }
.paused-card .muted { margin-bottom: 24px; }
.paused-card .big { font: 700 30px ui-monospace, monospace; color: var(--deep); margin: 10px 0 2px; }

/* Results / review */
.score-hero { text-align: center; padding: 28px 16px; border-radius: var(--radius); margin-bottom: 16px; }
.score-hero.pass { background: var(--green-wash); color: var(--green); }
.score-hero.fail { background: var(--red-wash); color: var(--red); }
.score-number { font-size: 52px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.score-verdict { font-size: 18px; font-weight: 700; }
.score-hero .muted { color: inherit; opacity: .85; }
.review-q { background: var(--surface); border: 1px solid var(--border); border-left: 5px solid var(--border); border-radius: 18px; padding: 14px 18px; margin: 0 0 14px; box-shadow: var(--shadow-sm); }
.review-q.correct { border-left-color: var(--green); }
.review-q.incorrect { border-left-color: var(--red); }
.review-stem { margin: 0 0 8px; overflow-wrap: anywhere; }
.review-opts { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.review-opts li { padding: 8px 12px; border-radius: 12px; background: var(--bg2); overflow-wrap: anywhere; }
.review-opts li.opt-correct { background: var(--green-wash); }
.review-opts li.opt-wrong { background: var(--red-wash); }
.tag { display: inline-block; margin-left: 6px; font-size: 11.5px; font-weight: 700; padding: 2px 9px; border-radius: 999px; }
.tag-correct { background: var(--green-wash); color: var(--green); }
.tag-yours { background: var(--wash); color: var(--deep); }
.explanation { background: var(--wash2); border-radius: 12px; padding: 10px 12px; margin: 10px 0 0; font-size: 14.5px; color: var(--soft); }

/* Footer */
.foot { border-top: 1px solid var(--border-2); background: var(--bg2); font-size: 14px; color: var(--muted); }
.foot-in { display: flex; flex-wrap: wrap; gap: 10px 20px; justify-content: space-between; align-items: center; padding-top: 18px; padding-bottom: 18px; }
.lang { display: inline-flex; align-items: center; gap: 8px; }

/* Dialogs (account settings) */
.dialog { position: fixed; inset: 0; margin: auto; height: fit-content; border: 1px solid var(--border); border-radius: var(--radius); padding: 26px 24px 22px; width: min(440px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow-y: auto; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-md); }
.dialog::backdrop { background: rgba(28, 22, 38, .45); backdrop-filter: blur(3px); }
.dialog-wide { width: min(620px, calc(100vw - 32px)); }
.dialog h2 { margin: 0 0 6px; font-size: 21px; padding-right: 28px; }
.dialog-close { position: absolute; right: 10px; top: 10px; text-decoration: none; }
.icon-btn { border: 0; background: transparent; cursor: pointer; font-size: 18px; padding: 6px 10px; border-radius: 10px; color: var(--muted); }
.icon-btn:hover { background: var(--wash); }
.account-section { border-top: 1px solid var(--border-2); margin-top: 18px; padding-top: 14px; }
#accountTitle + .account-section { border-top: 0; margin-top: 8px; }
.account-section h3 { margin: 0; font-size: 16px; }
.account-section input[readonly] { color: var(--muted); }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 0 12px; }
.form-actions { display: flex; justify-content: flex-end; margin: 12px 0 0; }
.form-error { margin: 12px 0 0; padding: 10px 12px; border-radius: 12px; background: var(--red-wash); color: var(--red); font-size: 14px; }
.form-success { margin: 12px 0 0; padding: 10px 12px; border-radius: 12px; background: var(--wash2); color: var(--ink); font-size: 14px; }
.danger-zone h3 { color: var(--red); }

/* Admin: certification wizard & management */
.crumbs { font-size: 14px; color: var(--muted); margin: 0 0 6px; }
.wide-card { max-width: 760px; margin-bottom: 16px; }
.table-gap { margin-top: 12px; }
.kpis-gap { margin-top: 12px; }
.replace-hint { margin: 14px 0 6px; }
.actions form, .actions-row form { margin: 0; }
.actions-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.stepper { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 18px; padding: 0; list-style: none; }
.stepper li { display: flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); font-size: 14px; font-weight: 650; color: var(--muted); }
.stepper li b { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--wash); color: var(--deep); font-size: 12.5px; }
.stepper li.cur { color: var(--deep); border-color: var(--a-soft); }
.stepper li.cur b { background: linear-gradient(120deg, var(--btn1), var(--btn2)); color: #fff; }
.stepper li.done b { background: var(--green-wash); color: var(--green); }
.dropzone { margin-top: 6px; border: 2px dashed var(--a-soft); border-radius: 18px; background: var(--wash2); padding: 16px; }
.dropzone-label { margin: 0; }
.ok-box { display: flex; gap: 10px; align-items: flex-start; background: var(--green-wash); color: var(--green); border-radius: 14px; padding: 10px 14px; font-size: 14px; margin-top: 14px; }
.info-box { background: var(--wash); border: 1px solid var(--a-soft); border-radius: 14px; padding: 12px 14px; font-size: 14px; margin-top: 14px; }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
.preview-label { font-size: 12px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }
.danger-card { border-color: color-mix(in srgb, var(--red) 35%, transparent); }
.danger-card h2 { color: var(--red); }
.add-card { border-style: dashed; align-items: center; justify-content: center; text-align: center; min-height: 200px; color: inherit; text-decoration: none; box-shadow: none; }
.add-card .icon-tile { margin-bottom: 8px; font-size: 20px; }
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; } }

/* Catalog: big tiles, three per row, with an "Exam details" popup */
.cat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; padding: 32px 0 60px; }
.cat-tile { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: 22px; padding: 28px 28px 24px; min-height: 260px; box-shadow: var(--shadow-sm); transition: transform .18s, box-shadow .18s; min-width: 0; }
.cat-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.cat-tile h2 { font-size: 21px; line-height: 1.25; margin: 0 0 10px; letter-spacing: -.01em; overflow-wrap: anywhere; }
.cat-tile .short { color: var(--soft); font-size: 15px; line-height: 1.55; margin: 0 0 16px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.cat-tile .facts2 { color: var(--muted); font-size: 13.5px; font-weight: 600; margin: 0; }
.cat-tile .act { margin-top: auto; padding-top: 22px; display: flex; justify-content: flex-end; }
@media (max-width: 1000px) { .cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .cat-grid { grid-template-columns: 1fr; } }
dialog.dialog-details { padding: 30px 30px 26px; width: min(760px, calc(100vw - 32px)); }
.field-err { display: block; margin-top: 6px; font-size: 13px; color: var(--red); }
.account-card .alt { margin: 16px 0 0; text-align: center; font-size: 14px; }
.account-card .inline-resend { margin-top: 18px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.linkish { background: none; border: 0; padding: 0; color: var(--deep); font: inherit; font-weight: 650; cursor: pointer; text-decoration: underline; }
.dialog-confirm { width: min(460px, calc(100vw - 32px)); }
.dialog-confirm h2 { padding-right: 0; }
.dialog-confirm .dialog-actions { justify-content: flex-end; }
.dialog-confirm .dialog-actions .btn { flex: 0 0 auto; }
.narrow.setup { max-width: 760px; }
.head-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.head-actions form { margin: 0; }
.back { margin: 0 0 18px; }
.dfacts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0 0 22px; }
.dfacts div { background: var(--bg2); border: 1px solid var(--border-2); border-radius: 12px; padding: 10px 14px; }
.dfacts dt { font-size: 12px; color: var(--muted); font-weight: 600; }
.dfacts dd { margin: 2px 0 0; font-weight: 700; font-size: 15.5px; }
.dsub { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.tchips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 24px; }
.dialog .desc { color: var(--soft); font-size: 15px; margin: 0 0 20px; white-space: pre-line; }
.dialog-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.dialog-actions form { display: contents; }
.dialog-actions .btn { flex: 1 1 180px; }
.dnote { font-size: 12.5px; color: var(--muted); margin: 14px 0 0; }
@media (max-width: 480px) { .dfacts { grid-template-columns: 1fr; } }

/* My Exams: sidebar of my exams, tabs (Exams / Analytics / Passed exams), plain row lists */
.my-wrap { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 40px; padding-top: 44px; padding-bottom: 100px; align-items: start; }
.my-wrap.solo { grid-template-columns: 1fr; }
.my-wrap > * { min-width: 0; }
.my-side { background: var(--surface); border: 1px solid var(--border-2); border-radius: 18px; padding: 22px 16px; box-shadow: var(--shadow-sm); position: sticky; top: 90px; }
.side-label { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 2px 14px 16px; }
.side-list { display: grid; gap: 8px; }
.side-item { display: flex; align-items: center; gap: 12px; padding: 15px 16px; border-radius: 14px; border: 1px solid transparent; color: var(--ink); text-decoration: none; }
.side-item:hover { background: var(--wash2); }
.side-item[aria-current="true"] { background: var(--wash); border-color: var(--wash-line); }
.side-item b { display: block; font-size: 15px; line-height: 1.4; }
.side-item .dot { margin-left: auto; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); flex: none; }
.my-tabs { display: inline-flex; gap: 8px; background: var(--surface); border: 1px solid var(--border-2); border-radius: 16px; padding: 6px; box-shadow: var(--shadow-sm); margin-bottom: 36px; max-width: 100%; overflow-x: auto; }
.my-tabs a { display: block; border: 1.5px solid transparent; padding: 11px 24px; border-radius: 12px; font-weight: 650; font-size: 15px; color: var(--soft); white-space: nowrap; text-decoration: none; }
.my-tabs a:hover { background: var(--wash2); }
.my-tabs a[aria-current="page"] { border-color: var(--accent); color: var(--deep); background: var(--surface); }
.simple-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin: 0 0 36px; }
.simple-head h2 { font-size: 28px; margin: 0 0 8px; letter-spacing: -.01em; }
.rows { background: var(--surface); border: 1px solid var(--border-2); border-radius: 16px; box-shadow: var(--shadow-sm); overflow: hidden; }
.rrow { display: flex; align-items: center; gap: 26px; padding: 24px 30px; }
.rrow + .rrow { border-top: 1px solid var(--border-2); }
.rrow.live { background: var(--wash2); }
.rrow .main { flex: 1; min-width: 0; }
.rrow .t { font-weight: 650; font-size: 16px; }
.rrow .s { font-size: 13.5px; color: var(--muted); margin-top: 4px; }
.rrow form { margin: 0; }
.pbar { height: 6px; border-radius: 99px; background: var(--border); overflow: hidden; margin-top: 14px; max-width: 240px; }
.pbar span { display: block; height: 100%; background: linear-gradient(90deg, var(--g1), var(--deep)); border-radius: 99px; width: 0; }
.rscore { font-weight: 750; font-size: 19px; min-width: 64px; text-align: right; }
.tlink { background: none; border: 0; color: var(--muted); font-size: 13.5px; font-weight: 600; cursor: pointer; padding: 8px 14px; border-radius: 8px; text-decoration: none; display: inline-block; }
.tlink:hover { color: var(--red); background: var(--red-wash); }
.tlink.plain:hover { color: var(--deep); background: var(--wash); }
.quiet-remove { margin: 36px 0 0; text-align: right; }
.quiet-remove form { margin: 0; }
.an-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-bottom: 32px; }
.an-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 28px; }
.an-grid .panel { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 28px 30px; box-shadow: var(--shadow-sm); }
.an-grid .panel h2 { font-size: 17px; margin: 0 0 24px; }
.chart { width: 100%; height: 190px; display: block; }
.chart text { fill: var(--muted); font-size: 10.5px; }
.mbar { display: grid; grid-template-columns: 120px 1fr 44px; gap: 12px; align-items: center; font-size: 13px; margin: 18px 0; }
.mbar b { text-align: right; }
.my-empty { text-align: center; padding: 80px 28px; background: var(--surface); border: 1px dashed var(--border); border-radius: 18px; }
.my-empty h2 { margin: 8px 0 6px; font-size: 19px; }
@media (max-width: 900px) {
  .my-wrap { grid-template-columns: 1fr; gap: 28px; padding-top: 28px; }
  .my-side { position: static; }
  .side-list { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
  .an-kpis { grid-template-columns: 1fr 1fr; }
  .an-grid { grid-template-columns: 1fr; }
  .rrow { flex-wrap: wrap; gap: 14px; padding: 20px; }
}

/* Airier spacing on every page (studio pages, admin, wizard, forms, tables) */
.studio { padding-top: 44px; padding-bottom: 100px; }
.studio-head { margin-bottom: 36px; gap: 16px 28px; }
.studio-head h1, .studio > h1 { font-size: clamp(26px, 5vw, 32px); }
.studio > h1 { margin-bottom: 28px; }
.kpis { gap: 24px; margin-bottom: 32px; }
.kpi { padding: 22px 26px; border-radius: 16px; }
.kpi dd { font-size: 28px; margin-top: 8px; }
.panel-grid { gap: 28px; }
.panel-card { padding: 28px 30px; border-radius: 18px; }
.panel-card h2 { margin-bottom: 18px; }
.panel-card + .panel-card, .wide-card { margin-bottom: 28px; }
.section-title { margin: 40px 0 18px; }
.section-head { margin: 40px 0 18px; }
.grid { gap: 26px; }
.card { padding: 26px; border-radius: 20px; }
.actions { margin-top: 28px; gap: 12px; }
.callout { margin-top: 26px; padding: 16px 18px; }
.callout.ready { background: var(--green-wash); color: var(--green); }
.drill { margin-left: 6px; font-size: 12px; font-weight: 700; }
.hard-q { margin: -6px 0 12px; font-size: 13px; }
.tabs { margin-bottom: 32px; gap: 10px; }
.tabs a { padding: 12px 18px; }
.data-table th, .data-table td { padding: 16px 20px; }
.field { margin-top: 22px; }
.field-label { margin: 22px 0 8px; }
.form-grid { gap: 0 20px; }
.check { margin-top: 20px; }
.mode-cards { gap: 12px; }
.mode-card { padding: 16px 18px; }
.account-card { padding: 34px 32px; }
.dialog { padding: 30px 30px 26px; }
.account-section { margin-top: 26px; padding-top: 22px; }
.stepper { margin-bottom: 32px; gap: 12px; }
.flashes { padding-top: 24px; }
.flash { padding: 14px 18px; }
.ok-box, .info-box, .warnbox { padding: 14px 18px; }
.info-box { margin-top: 20px; }
.crumbs { margin-bottom: 12px; }
.setup-actions { margin-top: 28px; }
.score-hero { padding: 36px 20px; margin-bottom: 28px; }
.review-q { padding: 20px 24px; margin-bottom: 22px; }
@media (max-width: 720px) {
  .studio { padding-top: 28px; }
  .panel-card { padding: 22px; }
  .data-table th, .data-table td { padding: 12px 14px; }
}

/* Admin settings + backup */
.set-card { margin: 0 0 28px; padding: 26px 28px 28px; }
.set-card h2 { font-size: 19px; margin: 0 0 6px; }
.set-card .muted { margin: 0 0 16px; }
.reauth { margin: 0 0 28px; padding: 22px 28px 24px; }
.reauth h2 { font-size: 17px; margin: 0 0 6px; }
.reauth-ok { margin: 0 0 24px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.inline-form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.inline-form .grow { flex: 1 1 260px; margin-top: 0; }
.check { display: flex; align-items: center; gap: 10px; margin: 12px 0 0; font-size: 15px; font-weight: 600; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.check.inline { display: inline-flex; margin: 6px 0 0; font-weight: 500; font-size: 13.5px; }
.hint { display: block; margin-top: 6px; font-size: 13px; font-weight: 400; color: var(--muted); }
.set-card .actions { margin-top: 22px; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 8px; }
.card-head form { margin: 0; }
.row-actions { display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
.row-actions form { margin: 0; }
.token-forms { margin-top: 22px; display: grid; gap: 18px; }
.token-forms form { margin: 0; }
pre.log { margin: 14px 0 0; padding: 16px 18px; background: #0F172A; color: #CBD5E1; border-radius: 14px; font: 12.5px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 420px; overflow: auto; }
pre.log .ts { color: #38BDF8; }
pre.log .sec { color: #FACC15; }
pre.log .okc { color: #4ADE80; }
pre.log .badc { color: #F87171; }
.test-result { margin-top: 18px; }
.test-result p { margin: 0 0 8px; }
.set-card code, .data-table code { font-size: 12.5px; word-break: break-all; }

.why { margin: 12px 0 0; font-size: 14px; color: var(--soft); }
.why summary { cursor: pointer; font-weight: 650; color: var(--deep); }
.why p { margin: 10px 0 0; line-height: 1.6; max-width: 70ch; }
.status-line { margin: 16px 0 0 !important; }

/* Tables that turn into cards on a phone (rows stack, each cell shows its label); admin tabs scroll instead of wrapping */
.row-actions { flex-wrap: wrap; }
@media (max-width: 640px) {
  .data-table.stack.wide { min-width: 0; }
  .data-table.stack thead { display: none; }
  .data-table.stack, .data-table.stack tbody, .data-table.stack tr, .data-table.stack td { display: block; width: 100%; }
  .data-table.stack tr { padding: 14px 4px; border-bottom: 1px solid var(--border-2); }
  .data-table.stack tr:last-child { border-bottom: 0; }
  .data-table.stack td { border: 0; padding: 4px 10px; text-align: left; }
  .data-table.stack td[data-label]::before { content: attr(data-label); display: block; font-size: 12px; font-weight: 700; color: var(--muted); }
  .data-table.stack td.num { text-align: left; }
  .data-table.stack td.row-actions { justify-content: flex-start; padding-top: 10px; }
  .tabs { flex-wrap: nowrap; overflow-x: auto; gap: 2px; }
  .tabs a { white-space: nowrap; padding: 12px 12px; }
}

/* Learning paths: tiles, popup, My Exams path page */
:root { --path1: #1E3FA8; --path2: #3B2FB8; }
:root[data-theme="dark"] { --path1: #1B2F7A; --path2: #2A2470; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --path1: #1B2F7A; --path2: #2A2470; } }
.kindseg { display: flex; width: max-content; max-width: 100%; margin: 14px auto 0; overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 4px; box-shadow: var(--shadow-sm); }
.kindseg button { border: 0; background: none; padding: 8px 16px; border-radius: 10px; font-weight: 650; font-size: 14.5px; color: var(--soft); cursor: pointer; }
.kindseg button span { color: var(--muted); font-weight: 600; margin-left: 2px; }
.kindseg button[aria-pressed="true"] { background: var(--wash); color: var(--deep); box-shadow: inset 0 0 0 1.5px var(--accent); }
.path-tile { position: relative; display: flex; flex-direction: column; color: #fff; border-radius: 22px; padding: 26px 28px 24px; min-height: 260px; min-width: 0; background: linear-gradient(140deg, var(--path1), var(--path2)); box-shadow: 14px 14px 0 -6px var(--wash-line), 0 12px 30px rgba(30, 50, 140, .25); }
.path-tile[hidden], .cat-tile[hidden] { display: none; }
.path-tile .badge, .path-top .badge, .pathhead .badge { align-self: flex-start; font-size: 11.5px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; background: rgba(255, 255, 255, .18); padding: 5px 12px; border-radius: 999px; display: inline-block; }
.path-tile h2 { font-size: 21px; line-height: 1.25; margin: 14px 0 8px; overflow-wrap: anywhere; }
.path-tile .short { color: rgba(255, 255, 255, .86); font-size: 15px; margin: 0 0 10px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.path-tile .routes { font-size: 13.5px; font-weight: 650; color: rgba(255, 255, 255, .92); margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.path-tile .dots { display: flex; align-items: center; gap: 6px; margin-top: 12px; }
.path-tile .dots i { width: 12px; height: 12px; border-radius: 50%; background: rgba(255, 255, 255, .9); }
.path-tile .dots u { width: 22px; border-top: 2px dashed rgba(255, 255, 255, .55); }
.path-tile .dots span { font-size: 14px; }
.path-tile .mine { margin: 10px 0 0; font-size: 13px; font-weight: 700; color: #FDE68A; }
.path-tile .act { margin-top: auto; padding-top: 18px; display: flex; justify-content: flex-end; }
.btn-white { background: #fff; color: var(--wink, #1E3FA8); box-shadow: 0 6px 18px rgba(0, 0, 0, .22); }
dialog.dialog-path { padding: 0; overflow: hidden; }
.path-top { padding: 26px 34px 22px; color: #fff; background: linear-gradient(120deg, var(--path1), var(--path2)); }
.path-top h2 { color: #fff; font-size: 28px; margin: 12px 0 4px; padding-right: 0; }
.path-top p { margin: 0; color: rgba(255, 255, 255, .85); }
.path-body { padding: 24px 34px 28px; max-height: calc(100vh - 220px); overflow-y: auto; }
.dfacts3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.req { list-style: none; padding: 0; margin: 0 0 20px; display: grid; gap: 10px; }
.req-item { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 14px; align-items: center; border: 1px solid var(--border); border-radius: 14px; padding: 13px 16px; }
.req-item .n { width: 34px; height: 34px; border-radius: 50%; background: var(--wash); color: var(--deep); display: grid; place-items: center; font-weight: 800; }
.req-item b { display: block; }
.req-item small { color: var(--muted); font-size: 13px; }
.rule { display: block; background: var(--wash); border: 1px solid var(--wash-line); color: var(--soft); border-radius: 14px; padding: 13px 16px; font-size: 14.5px; margin: 0 0 22px; }
.chip.plain { background: var(--bg2); color: var(--muted); border: 1px solid var(--border); }
@media (max-width: 640px) { .dfacts3 { grid-template-columns: 1fr; } .path-top, .path-body { padding-left: 22px; padding-right: 22px; } }
.side-path { display: block; color: #fff; background: linear-gradient(120deg, var(--path1), var(--path2)); border-radius: 14px; padding: 12px 14px; text-decoration: none; border: 2px solid transparent; }
.side-path[aria-current="true"] { border-color: var(--accent); box-shadow: 0 0 0 2px var(--wash-line); }
.side-path b { display: block; font-size: 15px; }
.side-path small { display: block; color: rgba(255, 255, 255, .8); font-weight: 600; font-size: 12.5px; margin: 2px 0 8px; }
.mini { display: block; height: 6px; background: rgba(255, 255, 255, .28); border-radius: 99px; overflow: hidden; }
.mini i { display: block; height: 100%; width: 0; background: #fff; border-radius: 99px; }
.side-label + .side-list + .side-label { margin-top: 22px; }
.pathhead { position: relative; overflow: hidden; color: #fff; border-radius: 22px; padding: 30px 34px; background: radial-gradient(500px 220px at 100% 0, rgba(140, 170, 255, .35), transparent 60%), linear-gradient(120deg, var(--path1), var(--path2)); margin-bottom: 28px; }
.pathhead h2 { font-size: 28px; margin: 12px 0 6px; }
.pathhead p { margin: 0; color: rgba(255, 255, 255, .85); }
.pathprog { display: flex; align-items: center; gap: 16px; margin-top: 20px; }
.pathprog .pt { flex: 1; height: 10px; background: rgba(255, 255, 255, .25); border-radius: 99px; overflow: hidden; }
.pathprog .pt i { display: block; height: 100%; width: 0; background: #fff; border-radius: 99px; }
.pathprog b { font-size: 15px; white-space: nowrap; }
.card-steps { background: var(--surface); border: 1px solid var(--border-2); border-radius: 16px; box-shadow: var(--shadow-sm); padding: 6px 28px; }
.steps { list-style: none; margin: 0; padding: 0; }
.step { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 20px; align-items: center; padding: 20px 0; }
.step + .step { border-top: 1px solid var(--border-2); }
.step .n { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: var(--wash); color: var(--deep); border: 2px solid var(--wash-line); }
.step.pass .n { background: var(--green-wash); color: var(--green); border-color: var(--green); }
.step h3 { font-size: 18px; margin: 0; }
.step h3 a { color: inherit; text-decoration: none; }
.step h3 a:hover { color: var(--deep); }
.step .s { color: var(--muted); font-size: 14px; margin: 2px 0 0; }
.step .acts { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.done-banner { margin-top: 22px; background: var(--green-wash); color: var(--green); border-radius: 16px; padding: 18px 22px; font-weight: 700; }
.path-foot { display: flex; justify-content: flex-end; margin-top: 22px; }
.path-foot form { margin: 0; }
.partof { margin: 0 0 6px; font-size: 14px; color: var(--muted); }
.partof a { font-weight: 650; }
@media (max-width: 640px) { .step { grid-template-columns: 44px minmax(0, 1fr); } .step .acts { grid-column: 1 / -1; justify-content: flex-start; } }

/* Admin: assembling a learning path */
.items { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 10px; }
.item { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 12px; align-items: center; border: 1px solid var(--border); border-radius: 14px; padding: 11px 14px; background: var(--surface); }
.item .n { width: 30px; height: 30px; border-radius: 50%; background: var(--wash); color: var(--deep); display: grid; place-items: center; font-weight: 800; font-size: 13px; }
.item b { display: block; font-size: 15px; }
.item small { color: var(--muted); font-size: 12.5px; }
.item-warn { border-color: var(--red); background: var(--red-wash); }
.item-actions { display: flex; gap: 6px; }
.item-actions form { margin: 0; }
.item-actions .icon-btn { width: 32px; height: 32px; border: 1px solid var(--border); background: var(--surface); border-radius: 9px; font-weight: 800; cursor: pointer; }
.item-actions .icon-btn:disabled { opacity: .35; cursor: default; }
.picker { border: 1px dashed var(--wash-line); border-radius: 14px; padding: 14px; margin-top: 18px; background: var(--wash2); }
.pick { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--border-2); font-size: 14.5px; margin: 0; }
.pick:last-child { border: 0; }
.hint-inline { font-weight: 400; color: var(--muted); font-size: 13px; }

/* Completion certificates: the document (A4 landscape, always light), badge, verify page, My Exams card, admin results */
/* Certificate shades: the built-in blue; a theme's accent swaps them with .pal-RRGGBB (see Theme::certCss). */
.cert-paper { --cp-btn1: #3468EE; --cp-deep: #2450CC; --cp-dark: #1E3FA8; --cp-dark2: #3B2FB8; --cp-line: #DCE6FC; --cp-sigline: #B8C5E6; --cp-wm: rgba(47, 98, 232, .035); --cp-glow: rgba(140, 170, 255, .35); }
.cert-paper .cp-seal .s1 { stop-color: var(--cp-btn1); }
.cert-paper .cp-seal .s2 { stop-color: var(--cp-dark2); }
.cert-paper { container-type: inline-size; width: 100%; position: relative; aspect-ratio: 297 / 210; background: #fff; color: #141B2D; border-radius: 6px; box-shadow: 0 18px 50px rgba(20, 40, 90, .22), 0 0 0 1px rgba(20, 40, 90, .08); overflow: hidden; font-family: Georgia, "Times New Roman", serif; text-align: left; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.cert-paper * { margin: 0; }
.cert-paper .cp-brand, .cert-paper .cp-foot3, .cert-paper .cp-list, .cert-paper .cp-exams, .cert-paper .cp-vfy, .cert-paper .cp-cell, .cert-paper .cp-year, .cert-paper .cp-kick, .cert-paper .cp-small, .cert-paper .cp-sub { font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.cert-paper .cp-brand { display: flex; align-items: center; gap: .8cqw; font-weight: 800; font-size: 1.5cqw; letter-spacing: .02em; }
.cert-paper .cp-brand i { width: 2.4cqw; height: 2.4cqw; border-radius: .7cqw; background: linear-gradient(180deg, var(--cp-btn1), var(--cp-deep)); display: grid; place-items: center; color: #fff; font-style: normal; font-size: 1.3cqw; }
.cert-paper .cp-seal { width: 9.2cqw; height: 9.2cqw; flex: none; }
.cert-paper .cp-cell { font-size: 1.15cqw; color: #667085; line-height: 1.5; }
.cert-paper .cp-cell b { display: block; color: #141B2D; font-size: 1.35cqw; font-weight: 700; }
.cert-paper .cp-cell.cp-r { text-align: right; }
.cert-paper .cp-cell.cp-c { text-align: center; margin-top: .3cqw; }
.cert-paper .cp-sig { font-family: "Brush Script MT", "Segoe Script", cursive; font-size: 2.6cqw; color: var(--cp-dark); border-bottom: .12cqw solid var(--cp-sigline); padding: 0 1cqw .1cqw; display: inline-block; line-height: 1.1; }
.cert-paper .cp-qrbox { display: flex; align-items: center; gap: 1cqw; justify-content: flex-end; min-width: 0; }
.cert-paper .cp-qr { width: 6.4cqw; height: 6.4cqw; flex: none; }
.cert-paper .cp-qr svg { display: block; width: 100%; height: 100%; }
.cert-paper .cp-vfy { font-size: 1.05cqw; color: #667085; line-height: 1.4; flex: 1; min-width: 0; text-align: right; overflow-wrap: anywhere; }
.cert-paper .cp-vfy b { color: #141B2D; }
/* classic */
.cp-classic .cp-frame { position: absolute; inset: 2.4cqw; border: .35cqw solid var(--cp-deep); outline: .12cqw solid var(--cp-deep); outline-offset: .5cqw; }
.cp-classic .cp-wm { position: absolute; inset: 0; background: repeating-linear-gradient(135deg, var(--cp-wm) 0 .25cqw, transparent .25cqw 1.6cqw); }
.cp-classic .cp-corner { position: absolute; width: 5cqw; height: 5cqw; border: .35cqw solid var(--cp-deep); background: #fff; }
.cp-classic .cp-corner.a { left: 1.4cqw; top: 1.4cqw; } .cp-classic .cp-corner.b { right: 1.4cqw; top: 1.4cqw; }
.cp-classic .cp-corner.c { left: 1.4cqw; bottom: 1.4cqw; } .cp-classic .cp-corner.d { right: 1.4cqw; bottom: 1.4cqw; }
.cp-classic .cp-body { position: absolute; inset: 6cqw 9cqw 5.5cqw; display: flex; flex-direction: column; align-items: center; text-align: center; }
.cp-classic .cp-ttl { font-size: 4.6cqw; letter-spacing: .01em; margin: 1.6cqw 0 .6cqw; color: var(--cp-dark); }
.cp-classic .cp-sub { font-size: 1.5cqw; letter-spacing: .24em; text-transform: uppercase; color: #667085; }
.cp-classic .cp-certify { font-size: 1.7cqw; font-style: italic; color: #3F4A63; margin-top: 2.4cqw; }
.cp-classic .cp-name { font-size: 5.2cqw; line-height: 1.15; margin: .8cqw 0 .6cqw; border-bottom: .14cqw solid var(--cp-line); padding: 0 3cqw .8cqw; max-width: 100%; overflow-wrap: anywhere; }
.cp-classic .cp-line { font-size: 1.6cqw; color: #3F4A63; max-width: 60cqw; }
.cp-classic .cp-pname { font-size: 3cqw; color: var(--cp-deep); margin: .8cqw 0 1cqw; line-height: 1.2; }
.cp-classic .cp-list { font-size: 1.3cqw; color: #3F4A63; display: flex; gap: 1.6cqw; flex-wrap: wrap; justify-content: center; margin-top: .4cqw; }
.cp-classic .cp-list span::before { content: "✓ "; color: #1F8A4C; font-weight: 800; }
.cp-classic .cp-foot3 { margin-top: auto; width: 100%; display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 2cqw; }
.cp-classic .cp-mid { text-align: center; }
/* modern */
.cp-modern .cp-band { position: absolute; left: 0; top: 0; bottom: 0; width: 24%; background: radial-gradient(60cqw 30cqw at 0 0, var(--cp-glow), transparent 60%), linear-gradient(160deg, var(--cp-dark), var(--cp-dark2)); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 4.6cqw 1.6cqw 4cqw; }
.cp-modern .cp-band::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(135deg, rgba(255, 255, 255, .05) 0 .2cqw, transparent .2cqw 1.4cqw); }
.cp-modern .cp-band > * { position: relative; z-index: 1; }
.cp-modern .cp-year { font-size: 1.05cqw; letter-spacing: .2em; text-transform: uppercase; opacity: .85; text-align: center; }
.cp-modern .cp-body { position: absolute; left: 24%; right: 0; top: 0; bottom: 0; padding: 5.2cqw 5.2cqw 4.2cqw 5cqw; display: flex; flex-direction: column; }
.cp-modern .cp-kick { font-size: 1.15cqw; letter-spacing: .22em; text-transform: uppercase; color: var(--cp-deep); font-weight: 700; }
.cp-modern .cp-h4 { font-size: 3.6cqw; font-weight: 400; margin: .9cqw 0 2.4cqw; letter-spacing: -.01em; line-height: 1.15; overflow-wrap: anywhere; }
.cp-modern .cp-small { font-size: 1.35cqw; color: #667085; }
.cp-modern .cp-small.cp-lead { font-size: 1.4cqw; color: #3F4A63; }
.cp-modern .cp-who { font-size: 4.6cqw; line-height: 1.1; border-bottom: .14cqw solid var(--cp-line); padding-bottom: 1cqw; margin: .6cqw 0 1.6cqw; overflow-wrap: anywhere; }
.cp-modern .cp-exams { list-style: none; padding: 0; margin: 1cqw 0 0; display: grid; gap: .9cqw; font-size: 1.55cqw; color: #3F4A63; }
.cp-modern .cp-exams li { display: flex; gap: .6cqw; }
.cp-modern .cp-tick { color: #1F8A4C; font-weight: 800; }
.cp-modern .cp-dim { color: #98A2B3; }
.cp-modern .cp-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 2cqw; margin-top: auto; }
.cp-modern .cp-foot .cp-cell.cp-r { flex: 1; min-width: 0; max-width: 46cqw; }
.cp-modern .cp-signblock { margin-top: 1.4cqw; }
.cp-modern .cp-signblock b { margin-top: .3cqw; }

/* the printable page */
.cert-page { background: var(--bg2); }
.cert-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding: 14px 24px; background: var(--surface); border-bottom: 1px solid var(--border); font-size: 14px; }
.cert-sheet { width: 100%; max-width: 1100px; margin: 28px auto 60px; padding: 0 24px; }
@media print {
  @page { size: A4 landscape; margin: 0; }
  html, body, .cert-page { background: #fff !important; margin: 0; }
  .cert-bar { display: none; }
  .cert-sheet { max-width: none; margin: 0; padding: 0; }
  .cert-page .cert-paper { width: 297mm; height: 210mm; aspect-ratio: auto; border-radius: 0; box-shadow: none; }
}

/* badge */
.badge-ic { display: block; flex: none; }
.side-path { position: relative; }
.side-path .badge-ic { position: absolute; right: 10px; top: 10px; }
.side-path .badge-ic:not(.on) { opacity: .75; }
.path-tile .tile-badge { position: absolute; right: 18px; top: 16px; }
.pathhead .head-badge { position: absolute; right: 26px; top: 24px; }

/* My Exams: the certificate card under "Path complete" */
.cert-card { display: grid; grid-template-columns: minmax(0, 320px) minmax(0, 1fr); gap: 30px; align-items: center; margin-top: 16px; padding: 22px 26px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow-sm); }
.cert-card h3 { font-size: 20px; margin: 0 0 6px; }
.cert-card .muted { margin: 0 0 16px; }
.cert-card .acts { display: flex; gap: 10px; flex-wrap: wrap; }
.cert-thumb { display: block; text-decoration: none; }
.cert-thumb:hover .cert-paper { transform: rotate(-1deg) scale(1.02); }
.cert-thumb .cert-paper { transition: transform .2s; }
.cert-card .callout { margin-top: 0; }
@media (max-width: 800px) { .cert-card { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .cert-thumb .cert-paper { transition: none; } .cert-thumb:hover .cert-paper { transform: none; } }

/* public verification page */
.verify { max-width: 760px; padding-top: 44px; padding-bottom: 90px; }
.vhead { display: flex; gap: 20px; align-items: center; padding: 26px 30px; border-radius: 22px 22px 0 0; background: var(--green-wash); border: 1px solid var(--green); border-bottom: 0; }
.vhead h1 { font-size: 24px; margin: 0 0 2px; color: var(--green); }
.vhead p { margin: 0; }
.vhead.revoked { background: var(--red-wash); border-color: var(--red); }
.vhead.revoked h1 { color: var(--red); }
.vbody { padding: 26px 30px; border: 1px solid var(--border); border-radius: 0 0 22px 22px; background: var(--surface); }
.vgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0 0 22px; }
.vgrid div { background: var(--bg2); border: 1px solid var(--border-2); border-radius: 12px; padding: 10px 14px; }
.vgrid dt { font-size: 12px; color: var(--muted); font-weight: 600; }
.vgrid dd { margin: 0; font-weight: 700; word-break: break-word; }
.vsec { font-size: 12px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.vex { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.vex li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; border: 1px solid var(--border-2); border-radius: 12px; }
@media (max-width: 560px) { .vgrid { grid-template-columns: 1fr; } .vhead { padding: 20px; } }

/* admin: certificate settings, issued list, results */
.cert-settings { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 28px; align-items: start; }
@media (max-width: 960px) { .cert-settings { grid-template-columns: 1fr; } }
.cert-settings .cert-paper { margin-top: 4px; }
.style-pick { display: inline-flex; gap: 4px; padding: 4px; border: 1px solid var(--border); border-radius: 999px; background: var(--bg2); }
.style-pick label { cursor: pointer; }
.style-pick input { position: absolute; opacity: 0; pointer-events: none; }
.style-pick span { display: block; padding: 6px 16px; border-radius: 999px; font-weight: 650; font-size: 14px; color: var(--soft); }
.style-pick input:checked + span { background: var(--surface); color: var(--deep); box-shadow: var(--shadow-sm); }
.style-pick input:focus-visible + span { box-shadow: var(--focus); }
.switch-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.switch-row form { margin: 0; }
.an-kpis.four { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 800px) { .an-kpis.four { grid-template-columns: 1fr 1fr; } }
.list-tools { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 0 0 14px; }
.list-tools input[type="search"] { border: 1px solid var(--border); background: var(--surface); color: var(--ink); border-radius: 12px; padding: 9px 14px; font: inherit; min-width: 220px; }
.list-tools .filter { display: inline-flex; gap: 4px; padding: 4px; border: 1px solid var(--border); border-radius: 999px; background: var(--bg2); }
.list-tools .filter button { border: 0; background: none; border-radius: 999px; padding: 6px 14px; font-weight: 650; font-size: 14px; color: var(--soft); cursor: pointer; }
.list-tools .filter button[aria-pressed="true"] { background: var(--surface); color: var(--deep); box-shadow: var(--shadow-sm); }
.who small { display: block; color: var(--muted); font-size: 12.5px; }
.cellbar { display: flex; align-items: center; gap: 10px; }
.cellbar .pbar2 { height: 8px; min-width: 90px; border-radius: 99px; background: var(--wash); overflow: hidden; }
.cellbar .pbar2 i { display: block; height: 100%; width: 0; background: var(--accent); }
.cellbar .pbar2.done i { background: var(--green); }
.cellbar span { white-space: nowrap; font-size: 13.5px; color: var(--soft); }
.export-link { margin: 14px 0 0; font-size: 14px; }
dialog.dialog-results { width: min(720px, calc(100vw - 32px)); padding: 28px 32px; }
.res-sec { font-size: 12px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 22px 0 8px; }
.res-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 14px; border: 1px solid var(--border-2); border-radius: 12px; margin-bottom: 8px; }
.res-row small { display: block; color: var(--muted); }
.res-none { color: var(--muted); margin: 0 0 8px; }
.profile-names { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .profile-names { grid-template-columns: 1fr; } }
.list-tools[hidden], .cert-settings [hidden] { display: none; }
.block { display: block; }
.field .style-pick { display: flex; width: max-content; margin-top: 8px; }
dialog.dialog-results .dialog-actions { justify-content: flex-end; margin-top: 18px; }
dialog.dialog-results .dialog-actions .btn { flex: 0 0 auto; }
.data-table td.nowrap { white-space: nowrap; }

/* Theming: an uploaded logo replaces the mark; the brand also sits above the login box. */
.logo-img { display: block; height: 30px; width: auto; max-width: 140px; object-fit: contain; flex: none; }
.brand-login { justify-content: center; font-size: 18px; }
.chart-line { stroke: var(--accent-line, #2F62E8); }
.chart-dot { stroke: var(--accent-line, #2F62E8); }

/* Admin → Settings → Appearance */
.theming { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 28px; align-items: start; }
@media (max-width: 900px) { .theming { grid-template-columns: 1fr; } }
.theme-list { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 10px; }
.theme-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--ink); text-decoration: none; }
.theme-item:hover { border-color: var(--a-soft); }
.theme-item[aria-current="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px var(--wash-line); }
.theme-item .tx { flex: 1; min-width: 0; }
.theme-item .tx small { display: block; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.th-dot { width: 20px; height: 20px; border-radius: 50%; flex: none; background: var(--muted); }
.th-tools { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.th-form { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--border-2); }
.th-form h3 { margin: 0 0 10px; font-size: 17px; }
.th-color { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.field .th-color input[type="color"] { display: block; width: 46px; height: 42px; margin: 0; padding: 2px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); flex: none; }
.field .th-color input[type="text"] { width: 130px; margin: 0; flex: none; }
.th-logo input[type="file"] { margin: 0 0 8px; padding: 6px 8px; width: auto; max-width: 100%; }
.th-swatches { display: flex; gap: 6px; margin-top: 8px; }
.th-swatches i { width: 26px; height: 26px; border-radius: 8px; border: 1px solid var(--border); display: block; }
.th-logo { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; padding: 14px; border: 1px dashed var(--wash-line); border-radius: 14px; background: var(--bg2); margin-top: 6px; }
.th-logobox { min-width: 92px; height: 56px; padding: 0 10px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.th-nologo { font-size: 12.5px; color: var(--muted); }
.tp-frame { border: 1px solid var(--border); border-radius: 16px; overflow: hidden; background: var(--bg); margin-bottom: 18px; }
.tp-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 54px; padding: 8px 16px; border-bottom: 1px solid var(--border-2); background: var(--surface); }
.tp-nav { font-size: 13px; font-weight: 650; color: var(--soft); }
.tp-body { padding: 16px; display: grid; gap: 12px; justify-items: start; }
.tp-body .pbar { width: 100%; }
.tp-login { padding: 20px 14px; background: var(--bg2); }
.tp-login .account-card { max-width: 340px; margin: 0 auto; padding: 22px 20px; }
.tp-h { font-size: 22px; font-weight: 750; margin-bottom: 4px; }
.tp-input { border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; color: var(--muted); background: var(--bg2); margin-top: 14px; }
