/* css/nav.css — navigation and app shell styles for Activate
 * Covers the topnav/sidebar system (.topnav__*, .sidebar__*)
 * and the Activate app shell (.tnav, .sb, .tm__*, .tt__*, .bnav, .pz etc.)
 * Tokens are defined in css/tokens.css which must load first.
 * No colour values are hardcoded here — all use var() tokens.
 */

/* ── Top nav ── */

.topnav {
  height: var(--topnav-height);
  background: var(--color-bg-surface);
  border-bottom: 0.5px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-6);
  position: sticky;
  top: 0;
  z-index: 100;
}

.topnav__logo {
  flex: 1;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
}

.topnav__logo-img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  background: white;
  flex-shrink: 0;
}

.topnav__logo-text {
  font-size: var(--font-size-md);
  font-weight: 500;
  color: var(--color-text-primary);
  line-height: 1;
}

.topnav__logo-text span {
  color: var(--color-primary);
}

.topnav__links {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: var(--space-1);
}

.topnav__link {
  font-size: var(--font-size-base);
  padding: 6px var(--space-3);
  border-radius: var(--radius-md);
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.topnav__link:hover {
  background: var(--color-bg-subtle);
  color: var(--color-text-primary);
  text-decoration: none;
}

.topnav__link--active {
  background: var(--color-primary-light);
  color: var(--color-primary);
  font-weight: 500;
}

.topnav__link--active:hover {
  background: var(--color-primary-light);
  color: var(--color-primary);
}

.topnav__right {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
}

.topnav__badge {
  font-size: var(--font-size-xs);
  background: var(--color-primary-light);
  color: var(--color-primary);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-weight: 500;
  white-space: nowrap;
}

.topnav__avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--color-primary);
  color: white;
  font-size: var(--font-size-xs);
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  border: none;
}

/* ── Sidebar ── */

.sidebar {
  width: var(--sidebar-width);
  background: var(--brand-950);
  border-right: 0.5px solid rgba(255,255,255,0.07);
  padding: var(--space-4) 0;
  flex-shrink: 0;
  overflow-y: auto;
  position: sticky;
  top: var(--topnav-height);
  height: calc(100vh - var(--topnav-height));
}

.sidebar__section {
  margin-bottom: var(--space-4);
}

.sidebar__label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.60);
  padding: 0 var(--space-4);
  margin-bottom: var(--space-2);
  margin-top: var(--space-1);
}

.sidebar__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px var(--space-4);
  font-size: 12px;
  color: rgba(255,255,255,0.72);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
  gap: var(--space-2);
  line-height: 1.4;
}

.sidebar__item:hover {
  background: rgba(255,255,255,0.06);
  color: white;
  text-decoration: none;
}

.sidebar__item--active {
  background: rgba(0,119,182,0.16);
  color: var(--brand-300);
  font-weight: 600;
  border-left: 2px solid rgba(0,136,204,0.7);
  padding-left: calc(var(--space-4) - 2px);
}

.sidebar__item--active:hover {
  background: rgba(0,119,182,0.20);
  color: var(--brand-300);
}

.sidebar__item-left {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex: 1;
  min-width: 0;
}

.sidebar__item-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar__item-meta {
  font-size: 10px;
  color: rgba(255,255,255,0.52);
  flex-shrink: 0;
}

.sidebar__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.18);
  flex-shrink: 0;
}

.sidebar__dot--done    { background: rgba(0,136,204,0.75); }
.sidebar__dot--active  { background: var(--brand-300); }
.sidebar__dot--partial { background: rgba(0,119,182,0.4); }
.sidebar__dot--locked  { background: rgba(255,255,255,0.07); }

.sidebar__divider {
  height: 0.5px;
  background: rgba(255,255,255,0.07);
  margin: var(--space-2) var(--space-4);
}


/* ═══════════════════════════════════════════════════════════════════════════
   Activate app shell — dark topnav + module-tree sidebar
   Used by: p-dashboard, c-dashboard, topic, exam, exam-hub,
            profile, progress, revision, help, checkpoint, readiness
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Reset ───────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  font-family: var(--font-sans);
  background: var(--slate-50);
  color: var(--slate-900);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
a { text-decoration: none; color: inherit; }
input { font-family: inherit; }
:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 2px; border-radius: 3px; }

/* Scrollbar — light on main, dark on sidebar */
::-webkit-scrollbar       { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--slate-100); }
::-webkit-scrollbar-thumb { background: var(--slate-300); border-radius: var(--radius-full); }
.sb ::-webkit-scrollbar-track { background: var(--brand-950); }
.sb ::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: var(--radius-full); }

/* ── App shell ───────────────────────────────────────────────────────────── */
.app  { display: flex; flex-direction: column; height: 100vh; }
.body { display: flex; flex: 1; overflow: hidden; }
.main { flex: 1; overflow-y: scroll; padding: 36px 48px; background: var(--slate-50); }

/* ── Topnav ──────────────────────────────────────────────────────────────── */
.tnav {
  height: 50px; flex-shrink: 0;
  background: var(--brand-950);
  border-bottom: 1px solid rgba(255,255,255,.05);
  display: flex; align-items: center;
  padding: 0 18px; justify-content: space-between; z-index: 20;
  position: sticky; top: 0;
}
.tnav__left        { display: flex; align-items: center; gap: 12px; }
.tnav__hamburger   { color: var(--brand-300); padding: 4px; display: flex; transition: color var(--transition-fast); border-radius: 4px; }
.tnav__hamburger:hover { color: var(--brand-100); }
.tnav__brand       { display: flex; align-items: center; gap: 7px; cursor: pointer; }
.tnav__word        { font-size: 13px; font-weight: 600; color: white; letter-spacing: -.01em; }
.tnav__div         { width: 1px; height: 13px; background: rgba(255,255,255,.1); }
.tnav__ctx         { font-size: 12px; color: var(--brand-300); }
.tnav__avatar      { width: 28px; height: 28px; border-radius: 50%; background: var(--brand-500); font-size: 10px; font-weight: 700; color: white; display: flex; align-items: center; justify-content: center; flex-shrink: 0; position: relative; cursor: pointer; }
.tnav__dd          { display: none; position: absolute; right: 0; top: 36px; background: var(--brand-900); border: 1px solid rgba(255,255,255,.08); border-radius: 8px; padding: 6px 0; min-width: 162px; z-index: 100; box-shadow: var(--shadow-lg); }
.tnav__dd.open     { display: block; }
.tnav__ddi         { display: block; width: 100%; text-align: left; padding: 7px 14px; font-size: 12px; color: rgba(255,255,255,.72); transition: background var(--transition-fast); }
.tnav__ddi:hover   { background: rgba(255,255,255,.07); color: white; }
.tnav__ddi--n      { color: white; font-weight: 600; pointer-events: none; }
.tnav__ddi--t      { color: rgba(255,255,255,.4); pointer-events: none; }
.tnav__ddsep       { height: 1px; background: rgba(255,255,255,.06); margin: 4px 0; }

/* ── Context bar ─────────────────────────────────────────────────────────── */
.ctx-bar      { display: none; align-items: center; gap: 6px; padding: 6px 18px; background: rgba(0,119,182,.06); border-bottom: 1px solid rgba(255,255,255,.05); font-size: 11px; }
.ctx-bar.show { display: flex; }
.ctx-bar a    { color: var(--brand-300); font-weight: 600; }

/* ── Sidebar ─────────────────────────────────────────────────────────────── */
.sb           { width: 256px; flex-shrink: 0; background: var(--brand-950); border-right: 1px solid rgba(255,255,255,.05); display: flex; flex-direction: column; overflow: hidden; transition: width var(--transition-base); align-self: stretch; }
.sb.collapsed { width: 0; }
.sb__inner    { flex: 1; display: flex; flex-direction: column; min-width: 256px; overflow: hidden; }

/* ── Progress zone ───────────────────────────────────────────────────────── */
.pz           { padding: 14px 18px 12px; border-bottom: 1px solid rgba(255,255,255,.05); }
.pz__row      { display: flex; align-items: center; gap: 12px; }
.pz__meta p   { font-size: 13px; font-weight: 600; color: white; margin-bottom: 2px; }
.pz__meta span { font-size: 11px; color: var(--brand-300); display: flex; align-items: center; gap: 4px; margin-top: 2px; }

/* ── Module tree ─────────────────────────────────────────────────────────── */
.tree         { flex: 1; overflow-y: auto; padding: 8px 0; }
.tm__btn      { width: 100%; display: flex; align-items: center; gap: 4px; padding: 8px 8px 8px 14px; transition: background var(--transition-fast); min-width: 0; }
.tm__btn:hover { background: rgba(255,255,255,.07); }
.tm__chev     { color: rgba(255,255,255,.3); display: flex; flex-shrink: 0; transition: transform .18s, color var(--transition-fast); }
.tm__chev.open { transform: rotate(90deg); color: var(--brand-300); }
.tm__name     { font-size: 14px; color: rgba(255,255,255,0.85); flex: 1; line-height: 1.4; text-align: left; font-weight: 400; transition: color var(--transition-fast); }
.tm__btn.open { background: rgba(0,119,182,0.16); border-left: 2px solid rgba(0,136,204,0.7); }
.tm__btn.open .tm__name { color: white; font-weight: 600; }
.tm__audio    { color: var(--brand-300); display: flex; align-items: center; justify-content: center; align-self: center; width: 18px; flex-shrink: 0; opacity: 1; transition: opacity var(--transition-fast); cursor: pointer; line-height: 0; }
.tm__audio svg { display: block; }
.tm__audio:hover { opacity: 1; }
.tm__cnt      { font-size: 10px; color: rgba(255,255,255,.65); flex-shrink: 0; white-space: nowrap; width: 28px; text-align: right; padding-right: 6px; }
.tt__btn      { width: 100%; display: flex; align-items: center; gap: 8px; padding: 7px 18px 7px 28px; transition: background var(--transition-fast); border-left: 3px solid transparent; }
.tt__btn:hover { background: rgba(255,255,255,.07); }
.tt__btn.active { border-left-color: rgba(0,136,204,0.7); border-left-width: 2px; background: rgba(0,119,182,0.16); }
.tt__ind      { flex-shrink: 0; display: flex; align-items: center; }
.tt__name     { font-size: 14px; color: rgba(255,255,255,0.85); line-height: 1.4; flex: 1; text-align: left; font-weight: 500; }
.tt__btn.active .tt__name { color: #ffffff; font-weight: 600; }
.tt__score    { font-size: 10px; color: var(--warning); flex-shrink: 0; }

/* ── Bottom nav ──────────────────────────────────────────────────────────── */
.bnav         { border-top: 1px solid rgba(255,255,255,.05); display: flex; flex-shrink: 0; flex-wrap: wrap; }
.bnav__btn    { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; transition: color var(--transition-fast), border-color var(--transition-fast); border-top: 2px solid transparent; color: rgba(255,255,255,0.4); }
.bnav__btn i  { font-size: 18px; line-height: 1; }
.bnav__btn:hover { color: rgba(255,255,255,0.72); }
.bnav__btn.active { border-top-color: #4a9eff; color: #4a9eff; }
.bnav__lbl    { font-size: 10px; font-weight: 500; }

/* ── View area ───────────────────────────────────────────────────────────── */
.view   { max-width: 100%; }
.view-h { font-family: var(--font-display); font-size: 22px; font-weight: 400; color: var(--slate-900); margin-bottom: 4px; }
.view-s { font-size: 13px; color: var(--slate-500); margin-bottom: 22px; }
.sec-lbl { font-size: 10px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--slate-500); margin-bottom: 12px; }

/* ── Continue bar ────────────────────────────────────────────────────────── */
.cbar         { display: none; align-items: center; justify-content: space-between; background: var(--brand-50); border: 1px solid var(--brand-100); border-radius: 8px; padding: 11px 18px; margin-bottom: 28px; max-width: 660px; }
.cbar.show    { display: flex; }
.cbar__dot    { width: 7px; height: 7px; border-radius: 50%; background: var(--brand-500); flex-shrink: 0; }
.cbar__kick   { font-size: 10px; color: var(--slate-500); text-transform: uppercase; letter-spacing: .07em; margin-bottom: 2px; }
.cbar__title  { font-size: 13px; color: var(--slate-900); font-weight: 500; }
.cbar__btn    { background: var(--brand-700); color: white; border-radius: 5px; padding: 7px 16px; font-size: 12px; font-weight: 600; transition: background var(--transition-fast); flex-shrink: 0; }
.cbar__btn:hover { background: var(--brand-900); }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn-p       { background: var(--brand-700); color: white; border-radius: 6px; padding: 10px 22px; font-size: 13px; font-weight: 600; transition: background var(--transition-fast); display: inline-flex; align-items: center; }
.btn-p:hover { background: var(--brand-900); }
.btn-g       { background: white; color: var(--slate-700); border: 1px solid var(--slate-200); border-radius: 6px; padding: 10px 22px; font-size: 13px; font-weight: 500; transition: border-color var(--transition-fast), color var(--transition-fast); display: inline-flex; align-items: center; }
.btn-g:hover { border-color: var(--brand-300); color: var(--slate-900); }
.btn-sm      { padding: 7px 16px; font-size: 12px; }

/* ── Stat cards ──────────────────────────────────────────────────────────── */
.stats-row    { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; margin-bottom: 26px; }
.stat-card    { background: white; border: 1px solid var(--slate-200); border-radius: var(--radius-lg); padding: 15px 16px; box-shadow: var(--shadow-card); }
.stat-card__v { font-size: 20px; font-weight: 700; color: var(--slate-900); margin-bottom: 3px; }
.stat-card__l { font-size: 11px; color: var(--slate-500); }

/* ── Progress bars ───────────────────────────────────────────────────────── */
.bar-t { height: 3px; background: var(--slate-200); border-radius: 2px; }
.bar-f { height: 3px; border-radius: 2px; transition: width .4s ease; }

/* ── Badges ──────────────────────────────────────────────────────────────── */
.badge      { display: inline-flex; border-radius: 4px; padding: 3px 9px; font-size: 10px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; flex-shrink: 0; }
.badge--g   { background: var(--green-bg); color: var(--success); border: 1px solid rgba(16,185,129,.25); }
.badge--l   { background: var(--slate-100); color: var(--slate-600); border: 1px solid var(--slate-200); }

/* ── Exam cards ──────────────────────────────────────────────────────────── */
.exam-card        { background: white; border: 1px solid var(--slate-200); border-radius: var(--radius-lg); padding: 22px 24px; margin-bottom: 12px; box-shadow: var(--shadow-card); }
.exam-card.locked { opacity: .55; }
.exam-card__hd    { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; }
.exam-card__title { font-size: 14px; font-weight: 600; color: var(--slate-900); margin-bottom: 3px; }
.exam-card__sub   { font-size: 12px; color: var(--slate-500); }

/* ── Weak panel ──────────────────────────────────────────────────────────── */
.weak      { background: var(--warn-bg); border: 1px solid rgba(245,158,11,.25); border-radius: 8px; padding: 14px 18px; margin-bottom: 22px; }
.weak__h   { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; color: var(--warning); margin-bottom: 10px; }
.weak__row { display: flex; justify-content: space-between; padding: 5px 0; border-bottom: 1px solid rgba(245,158,11,.15); font-size: 12px; }
.weak__row:last-child { border-bottom: none; }
.weak__row span:first-child { color: var(--slate-700); }
.weak__row span:last-child  { color: var(--warning); font-weight: 600; }

/* ── Module progress row ─────────────────────────────────────────────────── */
.mpr       { margin-bottom: 16px; }
.mpr__hd   { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.mpr__nm   { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--slate-700); }
.mpr__rb   { display: inline-flex; align-items: center; gap: 4px; background: var(--brand-50); border: 1px solid var(--brand-100); border-radius: 4px; padding: 2px 8px; font-size: 10px; font-weight: 600; color: var(--brand-500); transition: background var(--transition-fast); }
.mpr__rb:hover { background: var(--brand-100); }
.mpr__rt   { display: flex; gap: 12px; align-items: center; }
.mpr__avg  { font-size: 11px; }
.mpr__cnt  { font-size: 11px; color: var(--slate-500); }

/* ── Orientation modal ───────────────────────────────────────────────────── */
#oo        { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); backdrop-filter: blur(4px); z-index: 1000; align-items: center; justify-content: center; padding: 20px; }
#oo.show   { display: flex; }
#om        { background: white; border: 1px solid var(--slate-200); border-radius: var(--radius-xl); max-width: 520px; width: 100%; padding: 30px; box-shadow: var(--shadow-lg); animation: oin .22s cubic-bezier(.34,1.56,.64,1); }
@keyframes oin { from { opacity:0; transform:translateY(14px) scale(.97) } to { opacity:1; transform:translateY(0) scale(1) } }
.ob        { display: inline-flex; align-items: center; gap: 5px; font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 3px 9px; border-radius: 4px; margin-bottom: 14px; }
.ob--aw    { background: var(--brand-50); color: var(--brand-500); }
.ob--fo    { background: rgba(123,31,162,.1); color: #7B1FA2; }
.om__h     { font-size: 19px; font-weight: 700; color: var(--slate-900); margin-bottom: 8px; line-height: 1.3; }
.om__in    { font-size: 13px; color: var(--slate-600); line-height: 1.6; margin-bottom: 18px; }
.osteps    { display: flex; flex-direction: column; gap: 8px; margin-bottom: 22px; }
.ostep     { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; background: var(--slate-50); border-radius: 8px; border: 1px solid var(--slate-200); }
.ostep__ic { font-size: 14px; flex-shrink: 0; margin-top: 1px; }
.ostep__tt { font-size: 12px; font-weight: 600; color: var(--slate-900); margin-bottom: 2px; }
.ostep__ds { font-size: 11px; color: var(--slate-500); line-height: 1.5; }
.om__cta   { width: 100%; padding: 12px 20px; background: var(--brand-700); color: white; font-size: 13px; font-weight: 600; border-radius: var(--radius-md); transition: background var(--transition-fast); }
.om__cta:hover { background: var(--brand-900); }
.om__skip  { display: block; margin-top: 10px; text-align: center; font-size: 12px; color: var(--slate-500); width: 100%; padding: 4px; transition: color var(--transition-fast); }
.om__skip:hover { color: var(--slate-900); }

/* ── Audio player ────────────────────────────────────────────────────────── */
.aplayer         { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 200; background: #0f1e30; border: 1px solid #2a4268; border-radius: var(--radius-lg); padding: 16px 20px; width: 320px; box-shadow: var(--shadow-lg); display: none; }
.aplayer.open    { display: block; }
.aplayer__hd     { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.aplayer__kk     { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: #7a9bbe; margin-bottom: 3px; }
.aplayer__ttl    { font-size: 13px; font-weight: 600; color: #dde6f0; }
.aplayer__cl     { font-size: 16px; color: #7a9bbe; transition: color var(--transition-fast); }
.aplayer__cl:hover { color: #dde6f0; }
.aplayer__track  { height: 3px; background: #2a4268; border-radius: 2px; margin-bottom: 10px; cursor: pointer; }
.aplayer__fill   { height: 3px; background: var(--brand-500); border-radius: 2px; transition: width .1s linear; }
.aplayer__ctrl   { display: flex; justify-content: space-between; align-items: center; }
.aplayer__time   { font-size: 11px; color: #7a9bbe; }
.aplayer__play   { width: 34px; height: 34px; border-radius: 50%; background: var(--brand-500); display: flex; align-items: center; justify-content: center; transition: background var(--transition-fast); }
.aplayer__play:hover { background: var(--brand-700); }

/* ── Focus mode ──────────────────────────────────────────────────────────── */
body.focus-mode .sb   { width: 0; }
body.focus-mode .tnav { opacity: .3; transition: opacity var(--transition-base); }
body.focus-mode .tnav:hover { opacity: 1; }
.fbar             { display: none; position: fixed; bottom: 0; left: 0; right: 0; height: 3px; background: rgba(0,0,0,.08); z-index: 50; }
body.focus-mode .fbar { display: block; }
.fbar__fill       { height: 100%; background: var(--brand-500); transition: width .4s ease; }
.fexit            { display: none; position: fixed; bottom: 18px; right: 18px; width: 34px; height: 34px; border-radius: 50%; background: white; border: 1px solid var(--slate-200); z-index: 51; align-items: center; justify-content: center; color: var(--slate-400); transition: background var(--transition-fast), color var(--transition-fast); box-shadow: var(--shadow-md); }
body.focus-mode .fexit { display: flex; }
.fexit:hover      { background: var(--slate-100); color: var(--slate-900); }

/* ── Flashcards ──────────────────────────────────────────────────────────── */
.rev-tabs       { display: flex; gap: 8px; margin-bottom: 22px; }
.rev-tab        { padding: 7px 16px; border-radius: var(--radius); font-size: 12px; font-weight: 600; background: white; color: var(--slate-600); border: 1px solid var(--slate-200); transition: all var(--transition-fast); }
.rev-tab.active { background: var(--brand-700); color: white; border-color: var(--brand-700); }
.flashcard        { background: white; border: 1px solid var(--slate-200); border-radius: var(--radius-lg); padding: 44px 32px; cursor: pointer; text-align: center; min-height: 200px; display: flex; flex-direction: column; justify-content: center; margin-bottom: 18px; transition: background .22s, border-color .22s; box-shadow: var(--shadow-card); }
.flashcard.flipped { background: var(--brand-500); border-color: var(--brand-500); }
.fc__prompt       { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--slate-400); margin-bottom: 14px; }
.flashcard.flipped .fc__prompt { color: rgba(255,255,255,.5); }
.fc__content      { font-size: 16px; font-weight: 700; color: var(--slate-900); line-height: 1.5; }
.flashcard.flipped .fc__content { font-size: 14px; font-weight: 400; color: white; }
.fc-nav           { display: flex; justify-content: space-between; align-items: center; }
.fc-nav__cnt      { font-size: 12px; color: var(--slate-500); }

/* ── Glossary ────────────────────────────────────────────────────────────── */
.g-search         { width: 100%; padding: 10px 14px; background: white; border: 1px solid var(--slate-200); border-radius: 8px; color: var(--slate-900); font-size: 13px; outline: none; margin-bottom: 16px; transition: border-color var(--transition-fast), box-shadow var(--transition-fast); }
.g-search:focus   { border-color: var(--brand-500); box-shadow: 0 0 0 3px rgba(0,119,182,.15); }
.g-search::placeholder { color: var(--slate-400); }
.g-term           { padding: 12px 0; border-bottom: 1px solid var(--slate-100); }
.g-term__w        { font-size: 13px; font-weight: 600; color: var(--slate-900); margin-bottom: 4px; }
.g-term__d        { font-size: 13px; color: var(--slate-600); line-height: 1.65; }

/* ── Profile cards ───────────────────────────────────────────────────────── */
.pcard { background: white; border: 1px solid var(--slate-200); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-card); }

/* ── Inline forms ────────────────────────────────────────────────────────── */
.inline-form            { display: none; padding: 14px 16px; border-top: 1px solid var(--slate-100); background: var(--slate-50); }
.inline-form.open       { display: block; }
.inline-form__input     { width: 100%; padding: 9px 12px; background: white; border: 1px solid var(--slate-200); border-radius: 6px; color: var(--slate-900); font-size: 13px; font-family: inherit; margin-bottom: 8px; outline: none; transition: border-color var(--transition-fast), box-shadow var(--transition-fast); }
.inline-form__input:focus { border-color: var(--brand-500); box-shadow: 0 0 0 3px rgba(0,119,182,.15); }
.inline-form__err       { font-size: 12px; color: var(--danger); min-height: 16px; margin-bottom: 8px; display: none; }
.inline-form__err.show  { display: block; }
.inline-form__err.success { display: block; color: var(--success); }
.inline-form__row       { display: flex; gap: 8px; justify-content: flex-end; }

/* ── Goal picker ─────────────────────────────────────────────────────────── */
.goal-picker        { display: none; position: absolute; left: 0; right: 0; top: 100%; background: white; border: 1px solid var(--slate-200); border-radius: 8px; padding: 8px; z-index: 50; box-shadow: var(--shadow-lg); }
.goal-picker.open   { display: block; }
.goal-option        { padding: 10px 12px; border-radius: 6px; cursor: pointer; margin-bottom: 4px; transition: background var(--transition-fast); }
.goal-option:hover  { background: var(--slate-100); }
.goal-option--selected { background: var(--brand-50); }

/* ── History table ───────────────────────────────────────────────────────── */
.history-row        { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; border-bottom: 1px solid var(--slate-100); font-size: 13px; }
.history-row:last-child { border-bottom: none; }
.history-row__date  { font-size: 11px; color: var(--slate-500); }
.history-row__qual  { color: var(--slate-700); font-weight: 500; }
.history-row__score { font-size: 14px; font-weight: 700; color: var(--slate-900); }
.history-row__type  { font-size: 11px; color: var(--slate-500); }
.history-badge      { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: .04em; padding: 2px 8px; border-radius: 4px; }
.history-badge--pass { background: var(--green-bg); color: var(--success); }
.history-badge--fail { background: var(--red-light); color: var(--danger); }
.history-empty, .qual-empty { font-size: 13px; color: var(--slate-500); padding: 16px; }

/* ── Qual cards ──────────────────────────────────────────────────────────── */
.qual-card         { background: white; border: 1px solid var(--slate-200); border-radius: 8px; padding: 14px 16px; }
.qual-card__header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.qual-card__pill   { font-size: 10px; font-weight: 700; letter-spacing: .06em; background: var(--brand-50); color: var(--brand-500); padding: 2px 8px; border-radius: 4px; }
.qual-card__title  { font-size: 13px; font-weight: 600; color: var(--slate-900); }
.qual-card__body   { display: flex; justify-content: space-between; align-items: flex-end; }
.qual-card__meta   { font-size: 12px; color: var(--slate-600); line-height: 1.6; }



/* ── Nav PSW: pathway switcher (standalone pages) ───────────────────────────── */
.nav-psw { padding:10px 14px 8px; border-bottom:1px solid rgba(255,255,255,0.06); position:relative; }
.nav-psw__btn { display:flex; align-items:center; gap:7px; padding:5px 8px; border-radius:5px; width:100%; background:#0a1c31; border:1px solid rgba(255,255,255,0.12); transition:border-color .15s; cursor:pointer; }
.nav-psw__btn:hover { border-color:rgba(0,119,182,.35); }
.nav-psw__dot  { width:6px; height:6px; border-radius:50%; flex-shrink:0; }
.nav-psw__name { font-size:11px; font-weight:600; color:rgba(255,255,255,0.75); flex:1; text-align:left; }
.nav-psw__code { font-size:9px; font-weight:700; letter-spacing:.06em; color:#0077B6; background:rgba(0,119,182,.12); padding:2px 6px; border-radius:3px; flex-shrink:0; }
.nav-psw__chev { color:rgba(255,255,255,0.4); display:flex; flex-shrink:0; transition:transform .18s; }
.nav-psw__chev.open { transform:rotate(90deg); }
.nav-psw__pop  { display:none; position:absolute; left:10px; right:10px; top:calc(100% - 2px); background:#0a1c31; border:1px solid rgba(255,255,255,0.12); border-radius:7px; padding:6px; z-index:50; box-shadow:0 8px 24px rgba(0,0,0,.6); }
.nav-psw__pop.open { display:block; }
.nav-psw__pi { display:flex; align-items:center; gap:8px; padding:7px 8px; border-radius:5px; width:100%; transition:background .1s; cursor:pointer; }
.nav-psw__pi:hover:not([disabled]) { background:rgba(255,255,255,0.06); }
.nav-psw__pi--act { background:rgba(0,119,182,.08); }
.nav-psw__pi--lk  { opacity:.4; cursor:default; }
.nav-psw__pidot   { width:6px; height:6px; border-radius:50%; flex-shrink:0; }
.nav-psw__piname  { font-size:12px; color:rgba(255,255,255,0.65); flex:1; text-align:left; }
.nav-psw__picode  { font-size:9px; font-weight:700; color:rgba(255,255,255,0.4); }
.nav-psw__pibadge { font-size:9px; font-weight:600; color:#c97c2a; background:rgba(180,83,9,.1); padding:1px 5px; border-radius:3px; }

/* ── Dark mode overrides ─────────────────────────────────────────────────── */
body.dark           { background: #040a14 !important; color: #dde6f0; }
body.dark .app      { background: #040a14; }
body.dark .tnav     { background: #040a14; border-bottom-color: #0a1628; }
body.dark .sb       { background: #040a14; border-right-color: #0a1628; }
body.dark .main     { background: #040a14; }
body.dark .pcard,
body.dark .stat-card,
body.dark .exam-card,
body.dark .flashcard:not(.flipped) { background: #060e1a; border-color: #0a1628; }

/* ── OpenDyslexic font ───────────────────────────────────────────────────── */
@font-face {
  font-family: 'OpenDyslexic';
  src: url('https://cdn.jsdelivr.net/gh/antijingoist/opendyslexic/compiled/OpenDyslexic-Regular.woff2') format('woff2'),
       url('https://cdn.jsdelivr.net/gh/antijingoist/opendyslexic/compiled/OpenDyslexic-Regular.otf') format('opentype');
  font-weight: normal;
}
body.font-dyslexic,
body.font-dyslexic * { font-family: 'OpenDyslexic', sans-serif !important; line-height: 1.9 !important; letter-spacing: .05em; }

/* ── Background tint (accessibility) ─────────────────────────────────────── */
:root { --tint-bg: #f8fafc; }
.main { background: var(--tint-bg); }
html.dark .main { background: #040a14 !important; }

/* ── Dark mode body class (from html element) ─────────────────────────────── */
html.dark body { background: #040a14; color: #dde6f0; }
html.dark .main { background: #040a14 !important; }
html.dark .tnav { background: #040a14; border-bottom-color: #0a1628; }
html.dark .sb   { background: #040a14; border-right-color: #0a1628; }

/* ── OpenDyslexic (from html element) ─────────────────────────────────────── */
html.font-dyslexic * { font-family: 'OpenDyslexic', sans-serif !important; line-height: 1.9 !important; letter-spacing: .05em; }
