/* RCM Academy Hub — same deep navy-to-teal look as GrowthPoint */
:root {
  --navy-950: #0a1a2c;
  --navy-800: #12304d;
  --sky-400: #2a7fc0;
  --teal-400: #4fb3b8;
  --sage-400: #6db59e;
  --brand-grad: linear-gradient(135deg, #2a7fc0 0%, #4fb3b8 55%, #6db59e 100%);
  --primary: #2677b8;
  --primary-600: #1d6299;
  --primary-50: #e6f1f9;
  --primary-grad: linear-gradient(135deg, #2677b8 0%, #2b8a80 100%);
  --accent-50: #e3f3f1;
  --accent-ink: #1f6b63;
  --mist-300: #a9c0cf;

  --bg: #eef3f7;
  --surface: #ffffff;
  --surface-2: #f6f9fb;
  --line: #dfe7ee;
  --line-strong: #c9d5df;
  --ink: #16324a;
  --ink-2: #48607a;
  --ink-3: #5b6f82;

  --good-bg: #e9f4e9;
  --good-ink: #2f6e31;
  --warn-bg: #fcf3e0;
  --warn-ink: #855a0b;
  --crit: #d0504a;
  --crit-bg: #fbeae9;
  --crit-ink: #a3302b;
  --neutral-bg: #edf2f6;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(18, 48, 77, .05), 0 6px 20px rgba(18, 48, 77, .06);
  --shadow-lg: 0 16px 48px rgba(10, 26, 44, .28);
  --font: "Inter Tight", "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font); font-size: 14px; line-height: 1.45;
  color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--primary); }
h1, h2, h3 { margin: 0; letter-spacing: -.01em; }

/* ---------- Sign-in screens ---------- */
.auth {
  min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
  background:
    radial-gradient(60% 50% at 0% 100%, rgba(79, 179, 184, .28), transparent 70%),
    radial-gradient(50% 45% at 100% 0%, rgba(42, 127, 192, .30), transparent 70%),
    linear-gradient(160deg, #102a43 0%, #0c2036 55%, #0a1a2c 100%);
}
.auth-card {
  width: 100%; max-width: 400px; background: var(--surface); border-radius: 18px;
  box-shadow: var(--shadow-lg); padding: 32px 28px; position: relative; overflow: hidden;
}
.auth-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--brand-grad); }
.auth-card .brand-mark { margin-bottom: 18px; }
.auth-card h1 { font-size: 22px; font-weight: 700; color: var(--navy-800); }
.auth-card p.lead { margin: 6px 0 22px; color: var(--ink-3); }
.auth-card form { display: grid; gap: 14px; }
.auth-card .btn { justify-content: center; padding: 11px 14px; }
.auth-note { margin-top: 18px; font-size: 12px; color: var(--ink-3); text-align: center; }
.form-error {
  background: var(--crit-bg); color: var(--crit-ink); border-radius: 8px; padding: 9px 12px; font-size: 13px;
}

.brand-mark {
  width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center;
  background: var(--brand-grad); color: #fff; font-weight: 700; font-size: 13px;
  box-shadow: 0 6px 16px rgba(42, 127, 192, .35);
}
.brand-mark svg { width: 62%; height: 62%; }

/* ---------- App layout ---------- */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  background:
    radial-gradient(120% 45% at 0% 100%, rgba(79, 179, 184, .20), transparent 70%),
    radial-gradient(90% 35% at 100% 0%, rgba(42, 127, 192, .22), transparent 70%),
    linear-gradient(180deg, #102a43 0%, #0c2036 55%, #0a1a2c 100%);
  color: #fff; padding: 22px 14px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 22px; }
.brand .brand-mark { width: 36px; height: 36px; border-radius: 10px; }
.brand strong { display: block; font-size: 15px; font-weight: 600; }
.brand span { font-size: 12px; color: var(--mist-300); }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 10px; color: #b8cddb; text-decoration: none;
  padding: 10px 12px; border-radius: 9px; font-weight: 500;
}
.nav a svg { width: 18px; height: 18px; flex: none; opacity: .85; }
.nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav a.active {
  background: linear-gradient(90deg, rgba(79, 179, 184, .30), rgba(42, 127, 192, .08)); color: #fff;
  box-shadow: inset 3px 0 0 var(--teal-400), 0 4px 14px rgba(0, 0, 0, .18);
}

.sidebar-foot { margin-top: auto; padding: 14px 10px 0; border-top: 1px solid rgba(255, 255, 255, .1); font-size: 12px; color: var(--mist-300); }
.sidebar-foot strong { display: block; color: #fff; font-size: 13px; font-weight: 600; }
.sidebar-foot .links { display: flex; gap: 14px; margin-top: 10px; }
.link-btn { border: 0; background: none; color: var(--mist-300); cursor: pointer; padding: 0; text-decoration: underline; font-size: 12px; }
.link-btn:hover { color: #fff; }

main { min-width: 0; padding: 0 28px 40px; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin: 0 -28px 22px; padding: 20px 28px 18px;
  background: rgba(255, 255, 255, .88); backdrop-filter: saturate(160%) blur(10px); -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line); box-shadow: 0 4px 16px rgba(18, 48, 77, .05);
}
.topbar::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: linear-gradient(180deg, #2a7fc0, #4fb3b8 60%, #6db59e); }
.topbar h1 { font-size: 26px; font-weight: 700; letter-spacing: -.02em; color: var(--navy-800); }
.topbar p { margin: 2px 0 0; color: var(--ink-3); }
.top-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

/* ---------- Buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink); border-radius: 9px; padding: 8px 14px;
  font-weight: 600; cursor: pointer; white-space: nowrap; line-height: 1.2; text-decoration: none;
}
.btn svg { width: 16px; height: 16px; }
.btn:hover { border-color: var(--primary); color: var(--primary-600); }
.btn.primary { background: var(--primary-grad); border-color: transparent; color: #fff; box-shadow: 0 4px 12px rgba(38, 119, 184, .22); }
.btn.primary:hover { background: var(--primary-600); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.danger { color: var(--crit-ink); }
.btn.danger:hover { border-color: var(--crit); color: var(--crit); }
.btn.danger.solid { background: var(--crit); border-color: var(--crit); color: #fff; }
.btn.sm { padding: 5px 10px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn:focus-visible, .nav a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--primary); outline-offset: 2px;
}

.input, .select, textarea.input {
  width: 100%; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface);
  padding: 8px 10px; min-height: 38px;
}
textarea.input { min-height: 120px; resize: vertical; font-family: ui-monospace, Menlo, monospace; font-size: 13px; }
.input:focus, .select:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px rgba(38, 117, 163, .18); }
label.field { display: flex; flex-direction: column; gap: 5px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.field-row { display: flex; gap: 8px; }
.field-row .input { flex: 1; }
.hint { font-size: 12px; color: var(--ink-3); font-weight: 400; }

/* ---------- Cards, pills, tables ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px; min-width: 0;
}
.empty {
  display: grid; place-items: center; text-align: center; color: var(--ink-3); padding: 36px 16px;
  border: 1.5px dashed var(--line-strong); border-radius: var(--radius-sm); background: var(--surface-2);
}
.empty strong { display: block; color: var(--ink-2); margin-bottom: 4px; }

.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 99px;
  font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--neutral-bg); color: var(--ink-2);
}
.pill.good { background: var(--good-bg); color: var(--good-ink); }
.pill.prog { background: var(--primary-50); color: var(--primary-600); }
.pill.warn { background: var(--warn-bg); color: var(--warn-ink); }
.pill.crit { background: var(--crit-bg); color: var(--crit-ink); }
.pill.teal { background: var(--accent-50); color: var(--accent-ink); }

.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.toolbar .input, .toolbar .select { width: auto; min-width: 150px; }
.toolbar .search { flex: 1 1 220px; max-width: 360px; }
.toolbar .count { margin-left: auto; color: var(--ink-3); font-size: 13px; }

.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
table.data { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
table.data th {
  position: sticky; top: 0; background: var(--surface-2); text-align: left; font-size: 12px; font-weight: 600;
  color: var(--ink-3); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.data td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tr:hover td { background: #f9fbfd; }
table.data td.name strong { display: block; font-weight: 600; }
table.data td.name span { color: var(--ink-3); font-size: 12px; }
table.data td.actions { text-align: right; white-space: nowrap; }
tr.inactive td { color: var(--ink-3); }

/* Row action menu */
.menu { position: relative; display: inline-block; }
.menu-list {
  position: fixed; min-width: 200px; z-index: 30; /* placed next to its button by people.js */
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg);
  padding: 6px; display: none; text-align: left;
}
.menu.open .menu-list { display: block; }
.menu-list button {
  display: block; width: 100%; text-align: left; border: 0; background: none; padding: 9px 10px; border-radius: 7px; cursor: pointer;
}
.menu-list button:hover { background: var(--primary-50); }
.menu-list button.danger { color: var(--crit-ink); }
.menu-list button.danger:hover { background: var(--crit-bg); }
.menu-list hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px;
  background: rgba(10, 26, 44, .55); backdrop-filter: blur(2px);
}
.modal {
  width: 100%; max-width: 480px; max-height: calc(100vh - 32px); overflow: auto;
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-lg);
}
.modal.wide { max-width: 640px; }
.modal-head { padding: 18px 20px 0; }
.modal-head h2 { font-size: 18px; font-weight: 700; color: var(--navy-800); }
.modal-head p { margin: 4px 0 0; color: var(--ink-3); }
.modal-body { padding: 16px 20px; display: grid; gap: 14px; }
.modal-foot { padding: 14px 20px 18px; display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--line); }

.credentials {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px;
  font-family: ui-monospace, Menlo, monospace; font-size: 13px; white-space: pre-wrap; word-break: break-all;
}
.notice { background: var(--warn-bg); color: var(--warn-ink); border-radius: 8px; padding: 9px 12px; font-size: 13px; }
.notice.info { background: var(--primary-50); color: var(--primary-600); }

/* ---------- Programs ---------- */
.muted { color: var(--ink-3); }
.stack { display: grid; gap: 16px; }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.card-head h2 { font-size: 15px; font-weight: 600; }
.card-head h2 .muted { font-weight: 400; }
table.data.clickable tbody tr { cursor: pointer; }
table.data.clickable tbody tr:focus-visible td { background: var(--primary-50); }
.meter { display: inline-block; vertical-align: middle; width: 80px; height: 8px; border-radius: 99px; background: var(--neutral-bg); overflow: hidden; margin-right: 6px; }
.meter i { display: block; height: 100%; background: var(--brand-grad); border-radius: inherit; }

.back-link { display: inline-flex; align-items: center; gap: 2px; font-size: 13px; font-weight: 600; color: var(--ink-3); text-decoration: none; margin-bottom: 4px; }
.back-link svg { width: 16px; height: 16px; }
.back-link:hover { color: var(--primary); }
.topbar p .pill { vertical-align: 1px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs a {
  padding: 10px 14px; color: var(--ink-3); text-decoration: none; font-weight: 600; white-space: nowrap;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs a:hover { color: var(--ink); }
.tabs a.active { color: var(--navy-800); border-bottom-color: var(--teal-400); }
.tab-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.tab-head p { margin: 0; max-width: 640px; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; max-width: 860px; }
.form-grid .span-2, .form-grid .form-error { grid-column: 1 / -1; }
.form-actions { display: flex; justify-content: flex-end; }
textarea.input.prose { font-family: var(--font); font-size: 14px; min-height: 96px; }
textarea.input.prose.tall { min-height: 160px; }
textarea.input.prose.short { min-height: 64px; }
label.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; color: var(--ink); cursor: pointer; }
label.check input { width: 16px; height: 16px; accent-color: var(--primary); }

.video-box { width: 100%; max-width: 640px; border-radius: 10px; background: #000; display: block; margin-bottom: 12px; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.dropzone {
  display: grid; justify-items: center; gap: 4px; text-align: center; padding: 28px 16px; cursor: pointer;
  border: 1.5px dashed var(--line-strong); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--ink-2);
}
.dropzone svg { width: 26px; height: 26px; color: var(--primary); }
.dropzone:hover { border-color: var(--primary); background: var(--primary-50); }

/* Learning journey */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.step {
  display: grid; grid-template-columns: 28px 40px minmax(0, 1fr) auto; gap: 12px; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px;
}
.step-num span {
  display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  background: var(--navy-800); color: #fff; font-size: 12px; font-weight: 700;
}
.step-icon { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary-600); }
.step-icon svg { width: 20px; height: 20px; }
.step-type { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--accent-ink); }
.step-body strong { display: block; font-size: 15px; }
.step-meta { color: var(--ink-3); font-size: 12px; margin-top: 2px; }
.step-flags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.step-actions { display: flex; gap: 4px; align-items: center; }
.btn.icon { padding: 5px 7px; }
.btn.icon svg { width: 16px; height: 16px; }

/* Assessment builder */
.questions { display: grid; gap: 12px; }
.q { border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: grid; gap: 8px; background: var(--surface-2); }
.q-head { display: flex; align-items: center; gap: 10px; }
.q-head strong { flex: 1; }
.q-points { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-3); }
.q-points .input { width: 64px; min-height: 30px; padding: 4px 8px; }
.q-options { display: grid; gap: 6px; }
.q-option { display: flex; align-items: center; gap: 8px; }
.q-option input[type=radio] { width: 18px; height: 18px; accent-color: var(--good-ink); flex: none; }
.q-option .input { flex: 1; min-height: 34px; }
.link-btn.dark { color: var(--primary); text-decoration: none; font-weight: 600; font-size: 13px; justify-self: start; }

/* Enroll checklist */
.checklist { max-height: 46vh; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.check-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--line); cursor: pointer; }
.check-row:last-child { border-bottom: 0; }
.check-row:hover { background: var(--primary-50); }
.check-row input { width: 16px; height: 16px; accent-color: var(--primary); flex: none; }
.check-row strong { display: block; font-weight: 600; }
.check-row .muted { font-size: 12px; }

/* ---------- Learner ---------- */
.small { font-size: 12px; }
.section-title { font-size: 16px; font-weight: 700; color: var(--navy-800); margin: 6px 0 12px; }
.kpi-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.kpi { display: grid; gap: 2px; position: relative; overflow: hidden; }
.kpi::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--brand-grad); }
.kpi.warn::before { background: #e6a532; }
.kpi .label { font-size: 12px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; }
.kpi b { font-size: 28px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi b small { font-size: 15px; color: var(--ink-3); font-weight: 600; }
.learn-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 16px; align-items: start; }

.program-card { display: grid; gap: 10px; color: inherit; text-decoration: none; transition: border-color .15s, transform .15s; }
.program-card:hover { border-color: var(--teal-400); transform: translateY(-1px); }
.program-card h2 { font-size: 17px; font-weight: 700; color: var(--navy-800); margin-top: 2px; }
.program-card-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.program-card-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; color: var(--ink-2); font-size: 13px; }
.next-up { font-size: 13px; padding-top: 10px; border-top: 1px solid var(--line); }
.next-up.good { color: var(--good-ink); font-weight: 600; }

.ring {
  --size: 54px; width: var(--size); height: var(--size); flex: none; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(#4fb3b8 calc(var(--p) * 1%), var(--neutral-bg) 0);
}
.ring span {
  width: calc(var(--size) - 12px); height: calc(var(--size) - 12px); border-radius: 50%; background: var(--surface);
  display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--navy-800);
}
.ring.big { --size: 68px; }
.ring.big span { font-size: 15px; }

.mini-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.mini-list li { display: grid; gap: 2px; justify-items: start; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.mini-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.mini-list a:not(.pill) { font-weight: 600; text-decoration: none; }
.mini-list .muted { font-size: 12px; }
.mini-list a.pill { text-decoration: none; }

.prose-text { white-space: pre-wrap; line-height: 1.6; }
.sub-title { font-size: 14px; font-weight: 700; margin: 14px 0 6px; color: var(--navy-800); }
.objectives { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
section.gate { border-color: var(--teal-400); box-shadow: 0 0 0 3px rgba(79, 179, 184, .18), var(--shadow); }
.gate-note { font-weight: 600; color: var(--accent-ink); margin: 12px 0 8px; }
.welcome .video-box { margin-top: 12px; }
.watch-bar { height: 6px; max-width: 640px; border-radius: 99px; background: var(--neutral-bg); overflow: hidden; }
.watch-bar i { display: block; height: 100%; width: 0; background: var(--brand-grad); transition: width .3s; }
.reading .btn { margin-top: 14px; }

.steps.learner .step.locked { background: var(--surface-2); box-shadow: none; }
.steps.learner .step.locked .step-icon { background: var(--neutral-bg); color: var(--ink-3); }
.steps.learner .step.locked strong { color: var(--ink-2); }
.steps.learner .step.done .step-num span { background: var(--good-ink); }
.steps.learner .step.done .step-icon { background: var(--good-bg); color: var(--good-ink); }
.steps.learner .step.redo { border-color: var(--crit); }
.step-desc { white-space: pre-wrap; color: var(--ink-2); font-size: 13px; margin-top: 4px; }
.upload-line { margin-top: 8px; font-size: 13px; display: grid; gap: 6px; justify-items: start; }
.upload-line .link-btn { font-size: 13px; }

.topbar.compact { padding-top: 14px; padding-bottom: 12px; margin-bottom: 10px; }
.module-note { margin: 0 0 10px; font-size: 13px; }
.module-frame { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); box-shadow: var(--shadow); }
.module-frame iframe { display: block; width: 100%; height: calc(100vh - 190px); min-height: 480px; border: 0; }
.module-frame { position: relative; }
.module-frame:fullscreen, .module-frame.expanded { border: 0; border-radius: 0; box-shadow: none; background: #fff; }
.module-frame.expanded { position: fixed; inset: 0; z-index: 100; }
.module-frame:fullscreen iframe, .module-frame.expanded iframe { height: 100vh; height: 100dvh; min-height: 0; }
.module-exit { position: absolute; top: 10px; right: 10px; z-index: 2; opacity: .85; box-shadow: var(--shadow-lg); }
.module-exit:hover { opacity: 1; }
body.no-scroll { overflow: hidden; }

.assessment { max-width: 760px; }
.question { border: 1px solid var(--line); margin: 0; display: grid; gap: 8px; }
.question legend { float: left; width: 100%; font-weight: 600; font-size: 15px; margin-bottom: 6px; display: flex; gap: 10px; }
.q-no { flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--navy-800); color: #fff; font-size: 12px; }
.choice { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; }
.choice:hover { border-color: var(--primary); background: var(--primary-50); }
.choice input { width: 17px; height: 17px; margin-top: 1px; accent-color: var(--primary); flex: none; }
.choice:has(input:checked) { border-color: var(--primary); background: var(--primary-50); }
.result { max-width: 560px; display: grid; gap: 8px; justify-items: start; }
.result h2 { font-size: 20px; }
.result.good { border-top: 4px solid #5aa65a; }
.result.warn { border-top: 4px solid #e6a532; }
.result p { margin: 0; }

/* Learner view (preview) banner */
.preview-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 16px 0 0; padding: 10px 14px;
  border-radius: 10px; background: var(--primary-50); border: 1px solid #bcd7ec; color: var(--primary-600); font-size: 13px;
}
.preview-bar label { margin-left: auto; display: flex; gap: 8px; align-items: center; font-weight: 600; }
.preview-bar .select { width: auto; min-height: 32px; padding: 4px 8px; }
#preview-body .topbar { position: static; }

/* Sidebar counts */
.nav a .count {
  margin-left: auto; font-size: 11px; font-weight: 700; min-width: 20px; text-align: center;
  padding: 1px 6px; border-radius: 99px; background: var(--teal-400); color: var(--navy-950);
}

/* Messages */
.thread-list { display: grid; gap: 10px; }
.thread-row { display: flex; justify-content: space-between; gap: 12px; align-items: center; color: inherit; text-decoration: none; }
.thread-row:hover { border-color: var(--teal-400); }
.thread-meta { display: grid; justify-items: end; gap: 4px; text-align: right; }
.conversation { display: grid; gap: 12px; max-width: 760px; margin-bottom: 16px; }
.bubble { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; max-width: 88%; box-shadow: var(--shadow); }
.bubble.staff { background: var(--accent-50); border-color: #cfe7e3; }
.bubble.mine { justify-self: end; }
.bubble-head { display: flex; gap: 8px; align-items: center; margin-bottom: 4px; flex-wrap: wrap; }
.reply { max-width: 760px; display: grid; gap: 10px; }
.reply .form-actions { align-items: center; gap: 10px; }

/* Dashboard */
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 9px; overflow: hidden; background: var(--surface); flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: 7px 12px; cursor: pointer; font-weight: 600; color: var(--ink-2); }
.seg button.on { background: var(--navy-800); color: #fff; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.kpi.crit::before { background: var(--crit); }
.chart-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; }
.bars { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 4px; align-items: end; height: 220px; padding-top: 6px; }
.bar { display: grid; grid-template-rows: auto 1fr auto; height: 100%; align-items: end; text-align: center; min-width: 0; }
.bar i { display: block; width: 100%; max-width: 34px; margin: 0 auto; min-height: 2px; border-radius: 5px 5px 0 0; background: linear-gradient(180deg, #4fb3b8, #2a7fc0); }
.bar-value { font-size: 11px; font-weight: 700; color: var(--ink-2); }
.bar-label { font-size: 10px; color: var(--ink-3); padding-top: 4px; white-space: nowrap; overflow: hidden; }
.hbars { display: grid; gap: 10px; }
.hbar { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) 40px; gap: 10px; align-items: center; font-size: 13px; }
.hbar-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar-track { height: 10px; border-radius: 99px; background: var(--neutral-bg); overflow: hidden; }
.hbar-track i { display: block; height: 100%; border-radius: inherit; background: var(--brand-grad); }
.hbar b { text-align: right; font-variant-numeric: tabular-nums; }

/* Close & Archive steps */
.wizard { margin: 0; padding: 0; list-style: none; counter-reset: w; display: grid; gap: 10px; }
.wizard li {
  counter-increment: w; position: relative; display: grid; gap: 6px; justify-items: start;
  padding: 12px 14px 12px 50px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2);
}
.wizard li::before {
  content: counter(w); position: absolute; left: 14px; top: 12px; width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--navy-800); color: #fff;
}
.wizard li.ok::before { content: "✓"; background: var(--good-ink); }
.wizard li.blocked { border-color: #e6a532; }
.wizard li .input { max-width: 420px; }

/* ---------- Learner program page: welcome hero and journey ---------- */
@property --ring { syntax: "<number>"; inherits: false; initial-value: 0; }
.reveal { opacity: 0; transform: translateY(14px); animation: rise .7s cubic-bezier(.2, .7, .2, 1) forwards; animation-delay: calc(var(--i, 0) * 90ms + 60ms); }
@keyframes rise { to { opacity: 1; transform: none; } }
.page-back { display: inline-flex; margin-top: 18px; }

.hero {
  position: relative; overflow: hidden; border-radius: 22px; color: #fff; margin-top: 10px;
  background: linear-gradient(130deg, #0d2540 0%, #12395a 45%, #17606e 100%);
  box-shadow: 0 20px 50px rgba(10, 26, 44, .28);
}
.aurora span { position: absolute; border-radius: 50%; filter: blur(46px); opacity: .55; animation: drift 16s ease-in-out infinite alternate; pointer-events: none; }
.aurora span:nth-child(1) { width: 380px; height: 380px; background: #2a7fc0; top: -140px; right: 8%; }
.aurora span:nth-child(2) { width: 300px; height: 300px; background: #4fb3b8; bottom: -150px; left: 30%; animation-duration: 20s; }
.aurora span:nth-child(3) { width: 220px; height: 220px; background: #6db59e; top: 30%; right: -60px; animation-duration: 24s; opacity: .4; }
@keyframes drift { to { transform: translate(40px, 30px) scale(1.12); } }
.hero-grid { position: relative; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 28px; padding: 34px; align-items: center; }
.hero-grid.single { grid-template-columns: 1fr; }
.hero-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #9fe3dd; }
.eyebrow i { width: 8px; height: 8px; border-radius: 50%; background: #6ee7d6; animation: ping 2.2s infinite; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(110, 231, 214, .7); } 70%, 100% { box-shadow: 0 0 0 10px rgba(110, 231, 214, 0); } }
.hero h1 { font-size: 40px; line-height: 1.05; font-weight: 800; letter-spacing: -.03em; margin: 12px 0 6px; }
.hero h1 .wave { display: inline-block; transform-origin: 70% 70%; animation: wave 2.4s ease-in-out 1s 2; }
@keyframes wave { 0%, 60%, 100% { transform: rotate(0); } 10%, 30% { transform: rotate(14deg); } 20%, 40% { transform: rotate(-8deg); } }
.program-name { font-size: 18px; color: #cfe6f2; font-weight: 500; }
.program-name b { color: #fff; font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 22px; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 99px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .16); font-size: 13px; font-weight: 600; }
.chip svg { width: 15px; height: 15px; opacity: .9; }
.chip.warn { background: rgba(230, 165, 50, .22); border-color: rgba(230, 165, 50, .5); }
.chip.crit { background: rgba(208, 80, 74, .28); border-color: rgba(208, 80, 74, .6); }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn.light { background: #fff; color: var(--navy-800); border-color: #fff; box-shadow: 0 8px 22px rgba(0, 0, 0, .2); transition: transform .15s; }
.btn.light:hover { color: var(--primary-600); transform: translateY(-1px); }
.btn.glass { background: rgba(255, 255, 255, .08); color: #fff; border-color: rgba(255, 255, 255, .3); }
.btn.glass:hover { background: rgba(255, 255, 255, .16); color: #fff; }
.ring.anim { background: conic-gradient(#4fb3b8 calc(var(--ring) * 1%), rgba(255, 255, 255, .18) 0); animation: ringfill 1.4s .5s ease forwards; }
.ring.anim span { background: #12395a; color: #fff; }
@keyframes ringfill { to { --ring: var(--p); } }

.letter {
  position: relative; margin: 0 34px 34px; padding: 22px 24px 20px 64px; border-radius: 16px;
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14);
}
.letter::before { content: "\201C"; position: absolute; left: 18px; top: 2px; font-size: 64px; font-weight: 800; color: #6ee7d6; line-height: 1; }
.letter p { margin: 0 0 10px; line-height: 1.65; color: #e6f1f7; font-size: 15px; }
.letter .sign { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-size: 13px; color: #b8d4e3; }
.letter .sign .mark { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--brand-grad); }
.letter .sign .mark svg { width: 18px; height: 18px; color: #fff; }

.video-card { position: relative; border-radius: 16px; overflow: hidden; aspect-ratio: 16 / 9; background: #081726; box-shadow: 0 18px 40px rgba(0, 0, 0, .35); border: 1px solid rgba(255, 255, 255, .14); }
.video-card video { width: 100%; height: 100%; display: block; object-fit: contain; background: #000; }
.video-meter { height: 5px; border-radius: 99px; background: rgba(255, 255, 255, .15); margin-top: 10px; overflow: hidden; }
.video-meter i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #6ee7d6, #2a7fc0); transition: width .4s; }
.video-hint { font-size: 12px; color: #b8d4e3; margin-top: 6px; }
.video-hint.done { color: #9fe3dd; font-weight: 600; }

.glance { margin-top: 16px; }
.track { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); position: relative; padding-top: 6px; }
.track::before { content: ""; position: absolute; left: calc(50% / var(--n)); right: calc(50% / var(--n)); top: 26px; height: 3px; background: var(--neutral-bg); border-radius: 3px; }
.track .fill { position: absolute; left: calc(50% / var(--n)); top: 26px; height: 3px; border-radius: 3px; background: var(--brand-grad); width: 0; animation: fill 1.2s .6s ease forwards; }
@keyframes fill { to { width: var(--fill); } }
.milestone { position: relative; display: grid; justify-items: center; gap: 8px; text-align: center; padding: 0 4px; color: inherit; text-decoration: none; border: 0; background: none; cursor: pointer; font: inherit; }
.milestone .dot { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: #fff; border: 2px solid var(--line-strong); color: var(--ink-3); z-index: 1; }
.milestone .dot svg { width: 19px; height: 19px; }
.milestone.done .dot { background: var(--good-ink); border-color: var(--good-ink); color: #fff; }
.milestone.now .dot { background: var(--primary); border-color: var(--primary); color: #fff; animation: ping-blue 2s infinite; }
@keyframes ping-blue { 0% { box-shadow: 0 0 0 0 rgba(38, 119, 184, .5); } 70%, 100% { box-shadow: 0 0 0 12px rgba(38, 119, 184, 0); } }
.milestone span { font-size: 12px; font-weight: 600; color: var(--ink-2); line-height: 1.3; }
.milestone small { font-size: 11px; color: var(--ink-3); }

.begin { position: relative; overflow: hidden; border-left: 5px solid var(--teal-400); }
.begin .head { display: flex; gap: 14px; align-items: center; margin-bottom: 12px; }
.begin .badge { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-50); color: var(--accent-ink); flex: none; }
.begin .badge svg { width: 22px; height: 22px; }
.begin h2 { font-size: 18px; color: var(--navy-800); }
.points { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 10px; counter-reset: pt; }
.points li { counter-increment: pt; display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: start; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); line-height: 1.5; }
.points li::before { content: counter(pt); width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff; background: var(--navy-800); }
.begin .prose-text { margin-bottom: 16px; }
.ack-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.ack .tick { width: 0; height: 18px; transition: width .2s; }
.ack.done { background: var(--good-ink); border-color: var(--good-ink); color: #fff; box-shadow: none; }
.ack.done .tick { width: 18px; }
.ack .tick path { stroke-dasharray: 24; stroke-dashoffset: 24; }
.ack.done .tick path { animation: draw .45s ease forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.link-remark { border: 0; background: none; color: var(--primary); font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; padding: 4px 0; }
.link-remark svg { width: 16px; height: 16px; }
.confetti { position: absolute; inset: 0; pointer-events: none; }
.confetti i { position: absolute; width: 7px; height: 11px; border-radius: 2px; top: 70%; opacity: 0; animation: pop 1.1s ease-out forwards; }
@keyframes pop { 0% { opacity: 1; transform: translate(0, 0) rotate(0); } 100% { opacity: 0; transform: translate(var(--x), var(--y)) rotate(var(--r)); } }

/* Leave A Remark */
.steps .step-wrap { display: grid; }
.step-actions.stacked { flex-direction: column; align-items: flex-end; gap: 8px; }
.remark-btn { border: 1px dashed var(--line-strong); background: transparent; color: var(--ink-2); border-radius: 8px; padding: 5px 10px; font-weight: 600; font-size: 12px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; }
.remark-btn svg { width: 14px; height: 14px; }
.remark-btn:hover { border-color: var(--primary); color: var(--primary); }
.remark { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .35s ease; margin: 0 14px; }
.remark.open { grid-template-rows: 1fr; }
.remark > div { overflow: hidden; }
.remark-box { margin-top: -6px; padding: 18px 16px 14px; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 14px 14px; background: linear-gradient(180deg, #f3f8fb, #fff); display: grid; gap: 10px; }
.remark.flat { margin: 0; }
.remark.flat .remark-box { margin-top: 12px; border-top: 1px solid var(--line); border-radius: 12px; }
.remark-box p { margin: 0; font-size: 12px; color: var(--ink-3); }
.remark-box .row { display: flex; gap: 8px; justify-content: flex-end; }
.remark-sent { display: flex; align-items: center; gap: 10px; color: var(--good-ink); font-weight: 600; font-size: 13px; }
.remark-sent svg { width: 18px; height: 18px; }

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; padding: 24px; }
  .letter { margin: 0 20px 22px; padding-left: 56px; }
  .hero h1 { font-size: 30px; }
  .track { grid-template-columns: repeat(var(--n), minmax(72px, 1fr)); overflow-x: auto; }
}
@media (max-width: 860px) {
  .step-actions.stacked { align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  .reveal, .aurora span, .eyebrow i, .hero h1 .wave, .milestone.now .dot, .ring.anim, .track .fill, .confetti i, .ack .tick path { animation: none !important; }
  .reveal { opacity: 1; transform: none; }
  .track .fill { width: var(--fill); }
  .ring.anim { --ring: var(--p); }
  .ack.done .tick path { stroke-dashoffset: 0; }
  .remark { transition: none; }
}

/* ---------- Assessment / survey builder ---------- */
.fb-settings { margin-bottom: 14px; }
.fb-settings .form-grid { max-width: none; }
.toggles { display: flex; flex-wrap: wrap; gap: 10px 22px; }
.fb-summary { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 12px; }
.fb-summary span { padding: 5px 12px; border-radius: 99px; background: var(--navy-800); color: #fff; font-size: 12px; font-weight: 700; }
.fb-section { margin-bottom: 14px; display: grid; gap: 10px; border-top: 4px solid var(--teal-400); }
.fb-section-head { display: flex; justify-content: space-between; align-items: center; }
.fb-section-tag { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-ink); }
.fb-section-title { font-size: 17px; font-weight: 700; }
.fb-desc { font-size: 13px; }
.fb-questions { display: grid; gap: 10px; }
.fb-q { border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: grid; gap: 8px; background: var(--surface-2); }
.fb-q:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(38, 117, 163, .12); background: #fff; }
.fb-q-head { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.fb-q-head .select { width: auto; min-width: 210px; }
.fb-num { display: grid; place-items: center; min-width: 28px; height: 28px; border-radius: 8px; background: var(--navy-800); color: #fff; font-size: 12px; font-weight: 700; }
.fb-points { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.fb-points .input { width: 70px; min-height: 32px; padding: 4px 8px; }
.fb-req { font-size: 13px; }
.fb-tools { margin-left: auto; display: inline-flex; gap: 2px; }
.fb-options { display: grid; gap: 6px; }
.fb-option { display: flex; align-items: center; gap: 8px; }
.fb-option input[type=radio], .fb-option input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--good-ink); flex: none; }
.fb-option .input { flex: 1; min-height: 34px; }
.fb-bullet { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line-strong); flex: none; }
.fb-bullet.square { border-radius: 3px; }
.fb-preview { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; color: var(--ink-3); }
.fb-preview .star svg { width: 24px; height: 24px; color: var(--line-strong); }
.fb-preview .nps { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 7px; font-size: 12px; }
.fake-input { display: inline-block; min-width: 260px; padding: 7px 10px; border-bottom: 1px dashed var(--line-strong); font-size: 13px; }
.small-empty { padding: 16px; }
.add-section { margin-bottom: 80px; }
.save-bar {
  position: sticky; bottom: 14px; z-index: 25; margin: 0 auto; max-width: 520px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 12px 10px 18px; border-radius: 14px; background: var(--navy-800); color: #fff; box-shadow: var(--shadow-lg); font-weight: 600; font-size: 13px;
}
.problem-list { margin: 6px 0 0; padding-left: 20px; display: grid; gap: 4px; }

/* Results */
.meter.low i { background: linear-gradient(90deg, #e6a532, #d0504a); }
.small-b { font-size: 20px !important; }
.q-result .card-head h2 { font-size: 15px; }
.bars-h { display: grid; gap: 8px; margin-top: 10px; }
.bar-row { display: grid; grid-template-columns: minmax(110px, 1.2fr) minmax(0, 2fr) 34px 38px; gap: 10px; align-items: center; font-size: 13px; }
.bar-row .hbar-track { height: 12px; }
.bar-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.big-stat { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.big-stat b { font-size: 34px; font-weight: 800; color: var(--navy-800); line-height: 1; }
.stars { display: inline-flex; gap: 2px; }
.stars .star svg { width: 20px; height: 20px; color: var(--line-strong); }
.stars .star.on svg { color: #e6a532; }
.text-answers { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; max-height: 360px; overflow: auto; }
.text-answers li { padding: 10px 12px; border-radius: 10px; background: var(--surface-2); display: grid; gap: 4px; }

/* ---------- Learner: taking an assessment or survey ---------- */
.chips.light .chip { background: var(--surface-2); border-color: var(--line); color: var(--ink-2); }
.chips.light .chip svg { color: var(--primary); }
.quiz-intro { display: grid; gap: 4px; max-width: 760px; }
.quiz-intro .chips { margin: 12px 0 14px; }
.quiz-intro .btn { justify-self: start; }
.quiz-bar {
  position: sticky; top: 8px; z-index: 15; max-width: 760px; display: flex; justify-content: space-between; align-items: center; gap: 10px;
  margin-bottom: 14px; padding: 10px 16px; border-radius: 12px; background: var(--navy-800); color: #fff; font-weight: 600; font-size: 13px; box-shadow: var(--shadow);
}
.timer { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; background: rgba(255, 255, 255, .12); }
.timer svg { width: 16px; height: 16px; }
.timer b { font-variant-numeric: tabular-nums; font-size: 15px; }
.timer.warn { background: #e6a532; color: #1b1b1b; }
.timer.crit { background: var(--crit); color: #fff; animation: ping-red 1.2s infinite; }
@keyframes ping-red { 0% { box-shadow: 0 0 0 0 rgba(208, 80, 74, .6); } 70%, 100% { box-shadow: 0 0 0 10px rgba(208, 80, 74, 0); } }
.form-section { margin-top: 8px; }
.form-section h2 { font-size: 17px; color: var(--navy-800); }
.form-section p { margin: 4px 0 0; }
.question legend { align-items: flex-start; }
.question .req, .identity .req { color: var(--crit); font-weight: 700; }
.q-pts { margin-left: auto; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 99px; background: var(--primary-50); color: var(--primary-600); white-space: nowrap; }
.q-hint { margin: -2px 0 2px; }
.q-error { color: var(--crit-ink); font-size: 12px; font-weight: 600; }
.question.missing, .identity.missing { border-color: var(--crit); box-shadow: 0 0 0 3px rgba(208, 80, 74, .12); }
.rate { display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; gap: 4px; }
.rate input { position: absolute; opacity: 0; pointer-events: none; }
.rate label { cursor: pointer; color: var(--line-strong); transition: transform .1s, color .1s; }
.rate label svg { width: 34px; height: 34px; }
.rate label:hover, .rate label:hover ~ label, .rate input:checked ~ label { color: #e6a532; }
.rate label:hover { transform: scale(1.1); }
.rate input:focus-visible + label { outline: 2px solid var(--primary); border-radius: 6px; }
.scale { display: flex; flex-wrap: wrap; gap: 6px; }
.scale-opt { cursor: pointer; }
.scale-opt input { position: absolute; opacity: 0; pointer-events: none; }
.scale-opt span { display: inline-block; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--ink-2); background: #fff; }
.scale-opt input:checked + span { background: var(--primary); border-color: var(--primary); color: #fff; }
.scale-opt input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
.nps-scale .scale-opt span { width: 40px; padding: 8px 0; text-align: center; }
.scale-ends { display: flex; justify-content: space-between; max-width: 490px; }
.score-big { display: flex; align-items: baseline; gap: 12px; }
.score-big b { font-size: 44px; font-weight: 800; color: var(--navy-800); line-height: 1; }
.review { max-width: 760px; }
.review-item { display: grid; gap: 6px; border-left: 4px solid var(--line-strong); }
.review-item.right { border-left-color: #5aa65a; }
.review-item.wrong { border-left-color: var(--crit); }
.review-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.review-head .pill { margin-left: auto; }
.identity { border: 1px solid var(--line); display: grid; gap: 8px; }
.identity legend { float: left; width: 100%; font-weight: 600; font-size: 15px; margin-bottom: 4px; }
.id-opt { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.id-opt:has(input:checked) { border-color: var(--primary); background: var(--primary-50); }
.id-opt input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--primary); }
.id-opt span { display: grid; gap: 2px; }
.thanks { max-width: 560px; display: grid; justify-items: center; text-align: center; gap: 8px; padding: 34px 24px; }
.thanks-icon { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--good-bg); color: var(--good-ink); animation: rise .5s ease; }
.thanks-icon svg { width: 32px; height: 32px; }
.thanks p { margin: 0 0 8px; }

/* Dashboard feedback and per-learner steps */
.feedback-grid .kpi.feedback::before { background: linear-gradient(180deg, #6db59e, #4fb3b8); }
.feedback-grid .kpi.feedback b { color: var(--accent-ink); }
.step-icon.mini { width: 28px; height: 28px; border-radius: 8px; flex: none; }
.step-icon.mini svg { width: 15px; height: 15px; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 60; display: grid; gap: 8px; }
.toast {
  background: var(--navy-800); color: #fff; padding: 10px 14px; border-radius: 10px; box-shadow: var(--shadow-lg);
  font-size: 13px; max-width: 360px;
}
.toast.err { background: var(--crit); }

/* ---------- Phone width ---------- */
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .sidebar { position: static; height: auto; padding: 14px 16px; }
  .brand { padding: 0 0 12px; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .sidebar-foot { margin-top: 12px; }
  main { padding: 0 16px 32px; }
  .topbar { margin: 0 -16px 16px; padding: 16px; flex-wrap: wrap; position: static; }
  .topbar h1 { font-size: 22px; }
  .toolbar .input, .toolbar .select { min-width: 0; flex: 1 1 140px; }
  .two, .form-grid { grid-template-columns: 1fr; }
  .step { grid-template-columns: 28px minmax(0, 1fr); }
  .step-icon { display: none; }
  .step-actions { grid-column: 1 / -1; flex-wrap: wrap; }
  .kpi-row, .learn-grid { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chart-grid { grid-template-columns: 1fr; }
  .module-frame iframe { height: calc(100vh - 240px); }
}

/* Dashboard (redesign) */
.dash-hero {
  position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: center;
  margin-bottom: 16px; padding: 26px 30px; border-radius: 18px; color: #fff;
  background: radial-gradient(120% 140% at 100% 0%, rgba(79, 179, 184, .38) 0%, rgba(79, 179, 184, 0) 55%), linear-gradient(135deg, #0a1a2c 0%, #12304d 60%, #1a4a6b 100%);
  box-shadow: var(--shadow);
}
.dash-hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: var(--brand-grad); }
.dash-hero h2 { font-size: 24px; font-weight: 700; letter-spacing: -.01em; margin: 6px 0 4px; }
.dash-hero p { margin: 0; color: #c4dbe8; font-size: 14px; }
.hero-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
.hero-stats div { padding: 12px 14px; border-radius: 12px; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .12); display: grid; gap: 2px; }
.hero-stats b { font-size: 24px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.hero-stats span { font-size: 12px; color: #a9c6d8; }
.hero-ring { --size: 148px; }
.hero-ring.ring.anim span { width: calc(var(--size) - 22px); height: calc(var(--size) - 22px); display: grid; align-content: center; gap: 2px; text-align: center; font-size: 11px; font-weight: 600; color: #a9c6d8; background: #10304c; line-height: 1.25; padding: 0 18px; }
.hero-ring span b { font-size: 32px; font-weight: 800; color: #fff; }

.tile-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.tile { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: center; transition: transform .15s, box-shadow .15s; }
.tile:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(18, 48, 77, .06), 0 12px 28px rgba(18, 48, 77, .1); }
.tile > div { display: grid; gap: 1px; min-width: 0; }
.tile .label { font-size: 12px; font-weight: 600; color: var(--ink-3); }
.tile b { font-size: 26px; line-height: 1.15; font-variant-numeric: tabular-nums; color: var(--navy-800); }
.tile-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; }
.tile-icon svg { width: 22px; height: 22px; }
.tile.teal .tile-icon { background: var(--accent-50); color: var(--accent-ink); }
.tile.sky .tile-icon { background: var(--primary-50); color: var(--primary-600); }
.tile.crit .tile-icon { background: var(--crit-bg); color: var(--crit-ink); }
.tile.warn .tile-icon { background: var(--warn-bg); color: var(--warn-ink); }

.dash-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.dash-grid .span2 { grid-column: span 2; }
.chart-stats { display: flex; gap: 26px; margin: 2px 0 12px; }
.chart-stats div { display: grid; }
.chart-stats b { font-size: 20px; color: var(--navy-800); }
.chart-stats span { font-size: 12px; color: var(--ink-3); }
.cols { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 8px; height: 210px; }
.cols-axis { display: flex; flex-direction: column; justify-content: space-between; text-align: right; font-size: 10px; color: var(--ink-3); padding-bottom: 20px; }
.cols-axis span { transform: translateY(-50%); }
.cols-axis span:last-child { transform: none; }
.cols-plot { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 3px; position: relative; }
.cols-plot::before { content: ""; position: absolute; inset: 0 0 20px 0; pointer-events: none; background: repeating-linear-gradient(to bottom, var(--line) 0 1px, transparent 1px 25%); }
.col { display: grid; grid-template-rows: minmax(0, 1fr) 20px; min-width: 0; }
.col i { align-self: end; position: relative; display: block; width: 100%; max-width: 30px; margin: 0 auto; border-radius: 6px 6px 0 0; background: linear-gradient(180deg, #4fb3b8, #2a7fc0); transform-origin: bottom; animation: grow .7s ease both; }
.col:hover i { filter: brightness(1.12); }
.col em { position: absolute; left: 50%; bottom: 100%; transform: translateX(-50%); font-style: normal; font-size: 10px; font-weight: 700; color: var(--ink-2); padding-bottom: 2px; }
.col > span { font-size: 10px; color: var(--ink-3); text-align: center; padding-top: 5px; white-space: nowrap; border-top: 1px solid var(--line-strong); }
@keyframes grow { from { transform: scaleY(0); } }

.donut-wrap { display: grid; justify-items: center; gap: 16px; padding-top: 6px; }
.donut { width: 156px; height: 156px; border-radius: 50%; display: grid; place-items: center; }
.donut > span { width: 104px; height: 104px; border-radius: 50%; background: var(--surface); display: grid; align-content: center; text-align: center; font-size: 11px; color: var(--ink-3); }
.donut b { font-size: 28px; color: var(--navy-800); line-height: 1.1; }
.legend { list-style: none; margin: 0; padding: 0; width: 100%; display: grid; gap: 7px; }
.legend li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto 38px; gap: 8px; align-items: center; font-size: 13px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; }
.legend b { font-variant-numeric: tabular-nums; }
.legend li > span { text-align: right; color: var(--ink-3); font-size: 12px; }

.prog-bars { display: grid; gap: 4px; }
.prog-bar { display: grid; gap: 5px; padding: 9px 10px; margin: 0 -10px; border-radius: 10px; text-decoration: none; color: inherit; }
.prog-bar:hover { background: var(--surface-2); }
.prog-bar-top { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.prog-bar-top strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.prog-bar-top b { color: var(--navy-800); }

.fb-card { display: grid; align-content: start; gap: 14px; }
.fb-rating { display: flex; gap: 14px; align-items: center; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); }
.fb-rating > b { font-size: 34px; font-weight: 800; color: var(--navy-800); line-height: 1; }
.fb-rating > b small { font-size: 14px; color: var(--ink-3); font-weight: 600; }
.fb-rating > div { display: grid; gap: 2px; }
.star-meter { position: relative; display: inline-block; justify-self: start; width: max-content; font-size: 20px; letter-spacing: 2px; line-height: 1; color: var(--line-strong); }
.star-meter span:last-child { position: absolute; inset: 0 auto 0 0; width: var(--fill); overflow: hidden; color: #e6a532; white-space: nowrap; }
.fb-row { display: grid; gap: 6px; }
.fb-label { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-2); }
.fb-label b { color: var(--navy-800); }
.nps-track { position: relative; height: 10px; border-radius: 99px; background: linear-gradient(90deg, #d0504a 0%, #e6a532 50%, #4fb3b8 75%, #6db59e 100%); }
.nps-track i { position: absolute; top: 50%; width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 3px solid var(--navy-800); transform: translate(-50%, -50%); box-shadow: 0 2px 6px rgba(0, 0, 0, .2); }
.nps-ticks { display: flex; justify-content: space-between; font-size: 10px; color: var(--ink-3); }

.att-list { display: grid; gap: 2px; }
.att-item { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 10px; margin: 0 -10px; border-radius: 10px; text-decoration: none; color: inherit; }
.att-item:hover { background: var(--surface-2); }
.att-dot { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; }
.att-dot svg { width: 17px; height: 17px; }
.att-dot.crit { background: var(--crit-bg); color: var(--crit-ink); }
.att-dot.warn { background: var(--warn-bg); color: var(--warn-ink); }
.att-dot.prog { background: var(--primary-50); color: var(--primary-600); }
.att-text { display: grid; min-width: 0; font-size: 13px; }
.att-text strong { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.att-text span { font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.att-go { font-size: 12px; font-weight: 700; color: var(--primary-600); }
.all-clear { display: flex; gap: 12px; align-items: center; padding: 16px; border-radius: 12px; background: var(--good-bg); }
.all-clear > span { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: #fff; color: var(--good-ink); }
.all-clear svg { width: 18px; height: 18px; }
.all-clear div { display: grid; }
.all-clear strong { color: var(--good-ink); }

@media (max-width: 1100px) {
  .dash-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .dash-hero { grid-template-columns: 1fr; padding: 20px; }
  .dash-hero-ring { justify-self: start; }
  .hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-grid, .tile-grid { grid-template-columns: 1fr; }
  .dash-grid .span2 { grid-column: auto; }
}
@media (prefers-reduced-motion: reduce) { .col i { animation: none; } .tile:hover { transform: none; } }
.pill-btn { border: 0; cursor: pointer; font: inherit; font-size: 12px; font-weight: 600; }
.pill-btn:hover { filter: brightness(.96); }
button.prog-bar { border: 0; background: none; font: inherit; color: inherit; text-align: left; width: calc(100% + 20px); cursor: pointer; }
.mini-seg { margin: 0 0 10px; }
.mini-seg button { padding: 5px 10px; font-size: 12px; }

/* Dashboard filter bar: compact chips */
.filter-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin-bottom: 16px;
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: 0 1px 2px rgba(18, 48, 77, .04);
}
.seg.seg-sm { border: 0; background: var(--surface-2); border-radius: 10px; padding: 3px; gap: 2px; }
.seg.seg-sm button { padding: 5px 11px; font-size: 12.5px; border-radius: 8px; color: var(--ink-2); }
.seg.seg-sm button:hover { color: var(--navy-800); }
.seg.seg-sm button.on { background: var(--surface); color: var(--navy-800); box-shadow: 0 1px 3px rgba(18, 48, 77, .14); }
.filter-sep { width: 1px; height: 22px; background: var(--line); }
.filter-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; flex: 1 1 380px; min-width: 0; }
.chip-select {
  appearance: none; -webkit-appearance: none; height: 30px; max-width: 190px; padding: 0 26px 0 11px;
  border: 1px solid var(--line); border-radius: 99px; background: var(--surface-2); color: var(--ink-2);
  font: inherit; font-size: 12.5px; font-weight: 500; cursor: pointer; text-overflow: ellipsis;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%235b6f82' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
.chip-select:hover { border-color: var(--line-strong); color: var(--navy-800); }
.chip-select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(38, 117, 163, .15); }
.chip-select.active {
  background-color: var(--primary-50); border-color: rgba(38, 119, 184, .35); color: var(--primary-600); font-weight: 600;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%231d6299' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
}
.clear-filters { border: 0; background: none; color: var(--ink-3); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; padding: 4px 6px; text-decoration: underline; text-underline-offset: 3px; }
.clear-filters:hover { color: var(--crit-ink); }

/* Subtle export menu */
.btn.subtle { border-color: var(--line); background: transparent; color: var(--ink-2); font-weight: 600; box-shadow: none; }
.btn.subtle:hover { background: var(--surface); border-color: var(--line-strong); color: var(--navy-800); }
.btn.subtle svg { width: 15px; height: 15px; opacity: .8; }
.btn .caret { font-size: 10px; opacity: .6; margin-left: -2px; }
.export-menu .menu-list { position: absolute; right: 0; top: calc(100% + 6px); min-width: 230px; }
.export-menu .menu-list button { display: grid; gap: 1px; }
.export-menu .menu-list b { font-size: 13.5px; color: var(--navy-800); }
.export-menu .menu-list span { font-size: 12px; color: var(--ink-3); }

/* By Designation chart */
.dash-grid .span3 { grid-column: 1 / -1; }
.desig-card .card-head { flex-wrap: wrap; align-items: center; }
.desig-legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--ink-2); }
.desig-legend span { display: inline-flex; align-items: center; gap: 6px; }
.desig-legend i { width: 10px; height: 10px; border-radius: 3px; }
.desig-head, .desig-row { display: grid; grid-template-columns: minmax(140px, 1.1fr) minmax(0, 3fr) 120px 90px; gap: 16px; align-items: center; }
.desig-head { padding: 6px 10px; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); border-bottom: 1px solid var(--line); }
.desig-rows { display: grid; }
.desig-row { border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; padding: 10px; border-radius: 10px; border-bottom: 1px solid var(--line); }
.desig-row:last-child { border-bottom: 0; }
.desig-row:hover { background: var(--surface-2); }
.desig-name { display: grid; min-width: 0; }
.desig-name strong { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.desig-name span { font-size: 12px; color: var(--ink-3); }
.desig-stack { display: flex; height: 22px; border-radius: 6px; overflow: hidden; gap: 2px; animation: grow-x .7s ease both; transform-origin: left; }
.desig-stack i { display: grid; place-items: center; min-width: 18px; font-style: normal; font-size: 11px; font-weight: 700; color: #fff; }
.desig-stack i[style*="#c9d5df"] { color: var(--ink-2); }
@keyframes grow-x { from { transform: scaleX(0); } }
.desig-pct { display: flex; align-items: center; gap: 8px; }
.desig-pct b, .desig-score b { color: var(--navy-800); font-variant-numeric: tabular-nums; }
.ring-mini { width: 22px; height: 22px; border-radius: 50%; background: conic-gradient(#4fb3b8 calc(var(--p) * 1%), var(--neutral-bg) 0); -webkit-mask: radial-gradient(circle, transparent 6px, #000 7px); mask: radial-gradient(circle, transparent 6px, #000 7px); }

@media (max-width: 860px) {
  .filter-sep { display: none; }
  .chip-select { max-width: none; flex: 1 1 140px; }
  .desig-head { display: none; }
  .desig-row { grid-template-columns: 1fr auto; }
  .desig-row .desig-stack { grid-column: 1 / -1; width: 100% !important; order: 3; }
  .desig-score { display: none; }
}
@media (prefers-reduced-motion: reduce) { .desig-stack { animation: none; } }
.top-actions { align-items: center; }
.top-actions .seg-sm { background: var(--neutral-bg); }
.filter-label { display: inline-flex; align-items: center; gap: 6px; padding: 0 4px 0 2px; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); }
.filter-label svg { width: 14px; height: 14px; }
.filter-bar { padding: 8px 12px; }
.filter-chips { flex: 1 1 auto; }
.filter-bar { flex-wrap: nowrap; }
.filter-chips { flex: 1 1 0; }
.filter-label { flex: none; align-self: flex-start; height: 30px; }
@media (max-width: 860px) { .filter-label { display: none; } }
