/* ═══════════════════════════════════════════════════════════
   Certification Design System — Optimizely Documentation Portal
   Shared across all certification pages for consistent branding.
   Visual language consistent with admin.css, adapted for Starlight.
   ═══════════════════════════════════════════════════════════ */

/* ── Starlight overrides — hide redundant chrome on cert pages still in Starlight ── */
main:has(.cert-page) .content-panel:has(h1#_top) { display: none; }
.cert-page button, .cert-page div, .cert-page span, .cert-page a { margin-top: 0; }
.cert-page input, .cert-page select, .cert-page textarea,
#cert-exam-root input, #cert-exam-root select, #cert-exam-root textarea { box-sizing: border-box; }

/* ═══════════════════════════════════════════════════════════
   Cert App Shell — Layout for pages using CertLayout.astro
   Uses --t-* tokens from optimizely.css (auto dark mode).
   ═══════════════════════════════════════════════════════════ */

html, body { height: 100%; }
body { margin: 0; }

.cert-shell {
  display: grid; grid-template-rows: 56px 1fr;
  height: 100vh; min-height: 0;
  font-family: var(--t-font);
  color: var(--t-text);
  /* Bridge --sl-* vars used by header-widgets.js inline styles */
  --sl-color-accent: var(--t-primary);
  --sl-color-white: var(--t-text);
  --sl-color-bg: var(--t-bg);
  --sl-color-gray-5: var(--t-border);
  --sl-color-gray-3: var(--t-text-muted);
}

/* ── Global Bar ─────────────────────────────────────────── */
.cert-global-bar {
  display: flex; align-items: center; gap: 16px;
  padding: 0 16px 0 20px;
  background: var(--t-bg);
  border-bottom: 1px solid var(--t-border);
  z-index: 30;
}

.cert-brand {
  display: flex; align-items: center; gap: 14px;
  text-decoration: none; color: inherit;
}
.cert-logo { height: 40px; width: auto; display: block; }
.cert-logo-dark { display: none; }
:root[data-theme="dark"] .cert-logo-light { display: none; }
:root[data-theme="dark"] .cert-logo-dark { display: block; }
/* Compact favicon mark — hidden until the small-phone breakpoint */
.cert-logo-mini { display: none; height: 22px; width: auto; }

/* Profile-menu items that only appear on small phones (search + theme).
   Shown via the small-phone media query below. */
.auth-mobile-item { display: none; align-items: center; gap: 0.5rem; }
.cert-brand-text { font-size: 15px; font-weight: 700; }
.cert-brand-sep { width: 1px; height: 18px; background: var(--t-border); }
.cert-brand-product { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; cursor: default; user-select: none; }

.cert-grow { flex: 1; }
.cert-bar-actions { display: flex; align-items: center; gap: 4px; }

.cert-shell-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: var(--t-radius-sm);
  border: none; background: transparent; cursor: pointer;
  color: var(--t-text-secondary); transition: background var(--t-transition-fast); position: relative;
}
.cert-shell-btn:hover { background: var(--t-surface); }

.cert-dot {
  position: absolute; top: 5px; right: 5px; width: 7px; height: 7px;
  border-radius: 50%; background: #ef4444; border: 1.5px solid var(--t-bg);
}

/* Override inline styles on auth/signin buttons created by header-widgets.js */
.cert-shell .auth-btn-wrapper > button {
  background: var(--t-primary) !important;
  color: var(--t-on-primary) !important;
  border: 1px solid var(--t-accent-4) !important;
  transition: transform var(--t-transition), box-shadow var(--t-transition) !important;
}
.cert-shell .auth-btn-wrapper > button:hover {
  transform: translate(1px, -2px) !important;
  box-shadow: -2px 2px 0 var(--t-accent-4) !important;
}
.cert-shell .signin-btn-wrapper > button {
  color: var(--t-text-secondary) !important;
}

/* ── App Grid ───────────────────────────────────────────── */
.cert-app {
  display: grid; grid-template-columns: 240px 1fr;
  min-height: 0; overflow: hidden;
}
.cert-app--full { grid-template-columns: 1fr; }

/* ── Sidebar ────────────────────────────────────────────── */
.cert-sidebar {
  background: var(--t-bg);
  border-right: 1px solid var(--t-border);
  padding: 16px 12px; display: flex; flex-direction: column; gap: 4px;
  overflow-y: auto;
}

.cert-nav-section {
  font-family: var(--t-font-mono); font-size: var(--t-font-size-xs); text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--t-text-muted); padding: 14px 8px 4px;
  cursor: default; user-select: none;
}
.cert-nav-section:first-child { padding-top: 0; }

.cert-nv {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px;
  border-radius: var(--t-radius-sm); font-size: 0.875rem; font-weight: 500;
  color: var(--t-text-secondary); cursor: pointer; user-select: none;
  text-decoration: none; transition: background var(--t-transition-fast);
}
.cert-nv .material-symbols-rounded { font-size: 20px; color: var(--t-text-muted); }
.cert-nv:hover { background: var(--t-surface); }
.cert-nv.active {
  background: var(--t-accent-1-bg); color: var(--t-text); font-weight: 600;
  border-left: 3px solid var(--t-primary-hover); padding-left: 7px;
}
.cert-nv.active .material-symbols-rounded { color: var(--t-text); }

.cert-nv-pill {
  margin-left: auto; font-family: var(--t-font-mono); font-size: 0.69rem;
  color: var(--t-text-muted);
}

/* Level card at bottom of sidebar */
.cert-level-card {
  margin-top: auto; border: 1px solid var(--t-border);
  border-radius: var(--t-radius-sm); padding: 14px;
  display: flex; flex-direction: column; gap: 10px;
  background: var(--t-surface);
}
.cert-lc-top { display: flex; align-items: center; gap: 10px; }
.cert-lc-medal {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--t-primary); color: var(--t-on-primary);
  display: flex; align-items: center; justify-content: center; flex: none;
}
.cert-lc-medal .material-symbols-rounded { font-size: 20px; }
.cert-lc-title { font-size: 0.81rem; font-weight: 600; line-height: 1.2; }
.cert-lc-sub {
  font-family: var(--t-font-mono); font-size: var(--t-font-size-xs);
  color: var(--t-text-muted); text-transform: uppercase; letter-spacing: 0.04em;
}
.cert-lc-bar { height: 6px; border-radius: 999px; background: var(--t-surface-raised); overflow: hidden; }
.cert-lc-bar > i {
  display: block; height: 100%; border-radius: 999px;
  background: var(--t-primary); width: 0;
  transition: width 1.1s cubic-bezier(.22,1,.36,1);
}
.cert-lc-meta {
  display: flex; justify-content: space-between;
  font-family: var(--t-font-mono); font-size: 0.69rem; color: var(--t-text-muted);
}

/* ── Main Area ──────────────────────────────────────────── */
.cert-main {
  overflow: auto; display: flex; flex-direction: column;
  background: var(--t-surface);
}

.cert-topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 28px; border-bottom: 1px solid var(--t-border);
  background: color-mix(in srgb, var(--t-bg) 82%, transparent);
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 20;
}
.cert-crumbs {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--t-text-muted);
}
.cert-crumbs a { color: var(--t-text-muted); text-decoration: none; }
.cert-crumbs a:hover { color: var(--t-text-secondary); }
.cert-crumbs strong { color: var(--t-text); font-weight: 600; }

.cert-main-content { padding: 0; flex: 1; }

/* ── Responsive — sidebar drawer ────────────────────────── */
.cert-nav-toggle { display: none; }
.cert-nav-scrim { display: none; }

@media (max-width: 900px) {
  .cert-nav-toggle { display: inline-flex; }
  .cert-app { grid-template-columns: 1fr !important; }

  .cert-sidebar {
    position: fixed; top: 56px; bottom: 0; left: 0;
    width: 268px; z-index: 45;
    transform: translateX(-100%);
    transition: transform 250ms cubic-bezier(.22,1,.36,1);
    box-shadow: var(--t-shadow-lg);
    overscroll-behavior: contain; padding-bottom: 20px;
  }
  body[data-cert-nav-open] .cert-sidebar { transform: none; }
  /* In the scrollable drawer, margin-top:auto on the level card triggers the
     flexbox auto-margin + overflow bug (its bottom becomes unreachable by
     scroll, so it looks cut off). Let it flow after the nav and scroll normally. */
  .cert-sidebar .cert-level-card { margin-top: 16px; }

  .cert-nav-scrim {
    display: block; position: fixed; inset: 56px 0 0 0;
    background: rgba(0,0,0,0.32); z-index: 44;
    opacity: 0; pointer-events: none; transition: opacity 250ms;
  }
  body[data-cert-nav-open] .cert-nav-scrim { opacity: 1; pointer-events: auto; }
}

@media (max-width: 640px) {
  .cert-page { padding-left: 1rem !important; padding-right: 1rem !important; }
  /* Match the global bar's horizontal padding (0 16px 0 20px) so the breadcrumb
     bar aligns with the header above it. */
  .cert-topbar { padding-left: 20px; padding-right: 16px; }
}

/* ── Cert-specific tokens (only what optimizely.css doesn't provide) ── */
.cert-page {
  /* Tier colors — certification-specific, no equivalent in --t-* */
  --tier-foundation: #197050;                    /* Light Fir — legible on light bg */
  --tier-foundation-bg: var(--t-accent-4-bg, #EEFFD9); /* Grass tint */
  --tier-core: #007B79;                         /* Dark Blue — PANTONE 2223 C (legible on light bg) */
  --tier-core-bg: var(--t-accent-2-bg, #E0F5F5); /* Light Blue tint */
  --tier-advanced: #8F4764; /* Dark Pink — PANTONE 682 C */
  --tier-advanced-bg: #F9EFF3;

  /* Meta-credential colors */
  --meta-champion: #007B79;               /* Dark Blue — PANTONE 2223 C */
  --meta-champion-bg: #E0F5F5;
  --meta-master: #197050;                 /* Light Fir — PANTONE 2244 C */
  --meta-master-bg: #E7F2EB;
  --meta-legend: #8F4764;                 /* Dark Pink — PANTONE 682 C */
  --meta-legend-bg: #F9EFF3;

  /* Blueprint accent ramp — was an undefined "purple" ramp; retargeted to the
     brand Dark Blue / Light Blue (teal) family so the planner stays on-brand. */
  --cert-purple-100: #E0F5F5;   /* Light Blue tint */
  --cert-purple-400: #91DBDA;   /* Light Blue — PANTONE 629 C */
  --cert-purple-600: #007B79;   /* Dark Blue — PANTONE 2223 C */
  --cert-purple-700: #007B79;   /* Dark Blue (readable on the -100 tint) */

  /* Dark hero background */
  --cert-ink: var(--t-surface-inverted, #1C1F1C);

  color: var(--t-text);
  font-family: var(--t-font);
}

/* ── Legacy --cert-* palette compatibility shim ────────────────────────────
   The gray/green/amber/red/blue ramps, radius, and shadow tokens were never
   defined anywhere, so ~276 `var(--cert-*)` references were resolving to IACVT
   fallbacks (borders dropping, backgrounds going transparent, square corners).
   Rather than migrate every call site, we alias the ramps here: neutrals +
   greens map to the theme-aware --t-* tokens (so they adapt to dark
   automatically — :root carries the theme attribute); amber/red/blue use
   literals since --t-* has no semantic warning/danger/info equivalents.
   Defined at :root (not .cert-page) so layout-level elements that render
   outside a .cert-page wrapper — e.g. the results.astro loading spinner, which
   mounts directly in CertLayout's .cert-main-content — resolve them too. Live
   impact was concentrated on the leaderboard (bar chart, expand rows, delta
   arrows, dark tables), the loading spinner, and results; this repairs all of
   them with no markup changes. */
:root {
  --cert-gray-50:  var(--t-surface);
  --cert-gray-100: var(--t-surface);
  --cert-gray-200: var(--t-border);
  --cert-gray-300: var(--t-border-strong);
  --cert-gray-400: var(--t-text-muted);
  --cert-gray-500: var(--t-text-muted);
  --cert-gray-700: var(--t-text-secondary);
  --cert-gray-800: var(--t-text);
  --cert-gray-900: var(--t-text);

  --cert-green-50:  var(--t-surface);
  --cert-green-100: var(--t-accent-4-bg);
  --cert-green-500: var(--t-primary);
  --cert-green-600: var(--t-primary-text);
  --cert-green-700: var(--t-primary-text);

  --cert-amber-50:  #fffbeb;
  --cert-amber-100: #fef3c7;
  --cert-amber-500: #f59e0b;
  --cert-amber-600: #d97706;
  --cert-amber-700: #b45309;

  --cert-red-50:  #fef2f2;
  --cert-red-500: #ef4444;
  --cert-red-700: #b91c1c;

  --cert-blue-100: #dbeafe;
  --cert-blue-500: #3b82f6;
  --cert-blue-700: #1d4ed8;

  --cert-radius-sm: 8px;
  --cert-radius:    var(--t-radius-sm);
  --cert-radius-lg: var(--t-radius-md);

  --cert-shadow-sm: var(--t-shadow-sm);
  --cert-shadow:    var(--t-shadow-sm);
  --cert-shadow-md: var(--t-shadow-md);
  --cert-shadow-lg: var(--t-shadow-lg);
}

/* ── Dark theme — tier/meta color adjustments only ─────── */
:root[data-theme="dark"] .cert-page {
  --tier-foundation: #7DDD3D; --tier-foundation-bg: rgba(125, 221, 61, 0.12);  /* Grass reads on dark bg */
  --tier-core: #91dbda; --tier-core-bg: rgba(145, 219, 218, 0.12);  /* Light Blue reads on dark bg */
  --tier-advanced: #D68CAC; --tier-advanced-bg: #3a1e2a;
  --meta-champion: #91dbda; --meta-champion-bg: rgba(145, 219, 218, 0.12);  /* Light Blue on dark */
  --meta-master: #7DDD3D; --meta-master-bg: rgba(125, 221, 61, 0.12);       /* Grass on dark */
  --meta-legend: #D68CAC; --meta-legend-bg: #3a1e2a;       /* lightened Dark Pink, matches Advanced */
}

/* ── Material Symbols (icon font) — loaded via <link> in component, not @import ── */
.cert-page .material-symbols-rounded {
  font-family: 'Material Symbols Rounded'; font-weight: 300; font-style: normal;
  font-size: 24px; line-height: 1; letter-spacing: normal; text-transform: none;
  display: inline-block; vertical-align: -0.18em; direction: ltr;
  -webkit-font-smoothing: antialiased;
  font-variation-settings: "FILL" 0, "wght" 300, "GRAD" 200, "opsz" 40;
}
.cert-page .material-symbols-rounded.filled {
  font-variation-settings: "FILL" 1, "wght" 300, "GRAD" 200, "opsz" 40;
}

/* ── Official product icons (SVG) ── */
/* Product icons render as a single-color glyph that takes the card's track
   color (var --c), sitting in the same tinted box as the Foundation icon.
   The SVG silhouette is used as a CSS mask. Opal is a full-color raster
   illustration, so it stays a real (shrunk) image instead. */
.prod-icon { display: block; }
.prod-icon-mask {
  width: 56%; height: 56%;
  background-color: var(--c, var(--t-text-muted));
  -webkit-mask: var(--prod-mask) center / contain no-repeat;
  mask: var(--prod-mask) center / contain no-repeat;
}
.prod-icon-img { width: 72%; height: 72%; object-fit: contain; }

/* ── Layout ─────────────────────────────────────────────── */
.cert-page { max-width: 72rem; margin: 0 auto; padding: 1.5rem 1.75rem 3rem; }
/* ── Auth prompt (shown on protected pages when logged out) ── */
.cert-auth-prompt {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 50vh; padding: 3rem 1.5rem; text-align: center; gap: 1rem;
}
.cert-auth-prompt .material-symbols-rounded { font-size: 48px; color: var(--t-text-muted); opacity: 0.4; }
.cert-auth-prompt h2 { font-size: 1.25rem; font-weight: 700; margin: 0; }
.cert-auth-prompt p { font-size: 0.88rem; color: var(--t-text-muted); margin: 0; max-width: 360px; }
.cert-auth-prompt .cert-auth-actions { display: flex; gap: 0.75rem; margin-top: 0.5rem; }

.cert-section { margin-bottom: 2.75rem; }
.cert-section > .cert-section-head { text-align: center; max-width: 37rem; margin: 0 auto 1.75rem; }

/* ── Hero (dark ink) ────────────────────────────────────── */
.cert-hero {
  position: relative; overflow: hidden; text-align: center;
  background: #08251a; border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--t-radius-md); padding: 3.25rem 3rem;
  color: #eff6e9; margin-bottom: 2.75rem;
}
.cert-hero::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(700px 320px at 50% -30%, rgba(171,255,68,0.18), transparent 62%);
  pointer-events: none;
}
.cert-hero .cert-hero-inner { position: relative; z-index: 1; max-width: 45rem; margin: 0 auto; }
/* Hero always uses dark-ink palette — hardcoded so it doesn't flip with theme */
.cert-hero, .cert-hero .t-overline, .cert-hero .t-display-2, .cert-hero .t-body-sm {
  color: #eff6e9;
}
.cert-hero .t-overline { color: #aaff42; }
.cert-hero h1 { margin: 1rem 0 0; }
.cert-hero h1 .lime { color: #aaff42; }
.cert-hero .tagline {
  font-size: 1rem; line-height: 1.55; color: #a0ab8c;
  margin: 1rem auto 0; max-width: 35rem;
}
/* Dark mode: topbar dark-stroke button needs light border/text */
:root[data-theme="dark"] .cert-topbar .btn--dark-stroke {
  color: var(--t-text); border-color: var(--t-border-strong);
}

.cert-hero .btn--white-stroke {
  color: #eff6e9 !important;
  border-color: rgba(255,255,255,0.3) !important;
}
.cert-hero .btn--white-stroke:hover {
  border-color: rgba(255,255,255,0.5) !important;
}
.cert-hero-ctas { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; padding: 2rem 0; }
.cert-hero-stats {
  display: flex; justify-content: center; gap: 2.5rem; margin-top: 2.5rem;
  padding-top: 1.75rem; border-top: 1px solid rgba(255,255,255,0.1); flex-wrap: wrap;
}
.cert-hero-stat .n { font-weight: 900; font-size: 2rem; color: #eff6e9; line-height: 1; }
.cert-hero-stat .n .lime { color: #aaff42; }
.cert-hero-stat .l { color: #a0ab8c; margin-top: 0.5rem; }

/* ── 2024 theme overrides — blue instead of green ────────── */
:root[data-ods-theme="2024"] .cert-hero { background: #10141d; }
:root[data-ods-theme="2024"] .cert-hero::before {
  background: radial-gradient(700px 320px at 50% -30%, rgba(25,75,255,0.25), transparent 62%);
}
:root[data-ods-theme="2024"] .cert-hero,
:root[data-ods-theme="2024"] .cert-hero .t-overline,
:root[data-ods-theme="2024"] .cert-hero .t-display-2,
:root[data-ods-theme="2024"] .cert-hero .t-body-sm,
:root[data-ods-theme="2024"] .cert-hero-stat .n { color: #e9ebf1; }
:root[data-ods-theme="2024"] .cert-hero .t-overline { color: #a0b8ff; }
:root[data-ods-theme="2024"] .cert-hero h1 .lime,
:root[data-ods-theme="2024"] .cert-hero-stat .n .lime { color: #5176fe; }
:root[data-ods-theme="2024"] .cert-hero .tagline,
:root[data-ods-theme="2024"] .cert-hero-stat .l { color: #969cac; }
:root[data-ods-theme="2024"] .cert-closing { background: var(--t-bg); border-color: var(--t-primary); }
:root[data-ods-theme="2024"] .cert-nv.active { background: color-mix(in srgb, var(--t-primary) 10%, var(--t-bg)); border-left-color: var(--t-primary); }

/* ── Buttons — use .btn / .btn--* from optimizely.css ──── */

/* ── Tier Cards ─────────────────────────────────────────── */
.cert-tiers {
  display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; align-items: stretch; gap: 0;
  max-width: 56rem; margin: 0 auto;
}
.cert-tier-card {
  --c: var(--t-primary-text);
  text-align: left; padding: 1.5rem; border-radius: var(--t-radius-sm);
  border: 1px solid var(--t-border); background: var(--t-bg);
  display: flex; flex-direction: column; gap: 0.75rem;
}
.cert-tier-icon {
  width: 48px; height: 48px; border-radius: var(--t-radius-sm);
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--c) 14%, var(--t-bg));
}
.cert-tier-icon .material-symbols-rounded { font-size: 28px; color: var(--c); }
.cert-tier-name { color: var(--c); }
.cert-tier-desc { flex: 1; }
.cert-tier-meta {
  display: flex; flex-direction: column; gap: 0.3rem;
  padding-top: 0.75rem; border-top: 1px solid var(--t-border);
}
.cert-tier-meta span { display: flex; align-items: center; gap: 0.4rem; }
.cert-tier-meta .material-symbols-rounded { font-size: 14px; }
.cert-tier-card[data-tier="foundation"] { --c: var(--tier-foundation); }
.cert-tier-card[data-tier="core"] { --c: var(--tier-core); }
.cert-tier-card[data-tier="advanced"] { --c: var(--tier-advanced); }
.cert-tier-arrow {
  display: flex; align-items: center; justify-content: center; padding: 0 0.6rem;
  color: var(--t-text-muted);
}
.cert-tier-arrow .material-symbols-rounded { font-size: 24px; }

/* ── Role Selector ───────────────────────────────────────── */
.cert-role-bar {
  display: flex; gap: 0.6rem; justify-content: center; flex-wrap: wrap; margin-bottom: 1.5rem;
}
.cert-role-btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  height: 2.5rem; padding: 0 1.1rem; border: 1px solid var(--t-border-strong); border-radius: 999px;
  background: var(--t-bg); font-size: 0.875rem; font-weight: 500; cursor: pointer;
  color: var(--t-text-secondary); transition: all var(--t-transition-fast); margin-top: 0;
}
.cert-role-btn .material-symbols-rounded { font-size: 18px; color: var(--t-text-muted); }
.cert-role-btn:hover { background: var(--t-surface); }
.cert-role-btn.active {
  background: var(--t-surface-inverted); color: var(--t-text-inverted); border-color: var(--t-surface-inverted);
}
.cert-role-btn.active .material-symbols-rounded { color: var(--t-text-inverted); }
.cert-role-hint {
  text-align: center; font-size: 0.81rem; color: var(--t-text-muted); margin-bottom: 1.25rem; min-height: 1.2rem;
}

/* ── Foundations Banner ──────────────────────────────────── */
.cert-track-foundations {
  display: flex; align-items: center; gap: 1.1rem;
  background: var(--t-bg); border: 1px solid var(--t-primary); border-radius: var(--t-radius-sm);
  padding: 1.1rem 1.4rem; margin-bottom: 1rem; position: relative; overflow: hidden;
  text-decoration: none; color: inherit; cursor: pointer;
}
.cert-track-foundations::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--t-primary);
}
.cert-track-foundations .f-ico {
  width: 48px; height: 48px; border-radius: var(--t-radius-sm);
  background: var(--t-primary); color: var(--t-on-primary);
  display: flex; align-items: center; justify-content: center; flex: none;
}
.cert-track-foundations .f-ico .material-symbols-rounded { font-size: 28px; }
.cert-track-foundations .f-body { flex: 1; }
.cert-track-foundations .f-title {
  font-weight: 600; font-size: 0.94rem; display: flex; align-items: center; gap: 0.5rem;
}
.cert-track-foundations .f-sub { font-size: 0.81rem; color: var(--t-text-muted); margin-top: 0.2rem; }
.cert-track-foundations .f-meta {
  font-family: var(--t-font-mono); font-size: 0.75rem; color: var(--t-text-muted); white-space: nowrap;
}
/* On phones, match the other cert cards: icon + title (+ Start here) on one row,
   description and meta full-width below. */
@media (max-width: 640px) {
  .cert-track-foundations {
    display: grid; grid-template-columns: auto 1fr; column-gap: 14px; row-gap: 8px; align-items: center;
    padding: 14px 16px;
  }
  .cert-track-foundations > * { grid-column: 1 / -1; min-width: 0; }
  .cert-track-foundations .f-ico { grid-column: 1; grid-row: 1; align-self: center; }
  .cert-track-foundations .f-body { display: contents; }
  .cert-track-foundations .f-title { grid-column: 2; grid-row: 1; align-self: center; flex-wrap: wrap; }
  .cert-track-foundations .f-sub { grid-column: 1 / -1; grid-row: 2; margin-top: 0; }
  .cert-track-foundations .f-meta { grid-column: 1 / -1; grid-row: 3; white-space: normal; }
}

/* ── Track Grid ──────────────────────────────────────────── */
.cert-track-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.75rem;
}
.cert-track-card {
  --c: var(--t-text-muted);
  position: relative; background: var(--t-bg); border: 1px solid var(--t-border);
  border-radius: var(--t-radius-sm); padding: 1rem; text-decoration: none; color: inherit;
  display: flex; flex-direction: column; gap: 0.6rem; transition: all 200ms; cursor: pointer;
}
.cert-track-card::before {
  content: ""; position: absolute; top: 0; left: 0.875rem; right: 0.875rem; height: 3px;
  background: var(--c); border-radius: 0 0 3px 3px;
}
.cert-track-card:hover { transform: translateY(-2px); box-shadow: var(--t-shadow-md); border-color: var(--t-border-strong); }
.cert-track-card.dim { opacity: 0.4; filter: saturate(0.5); }
.cert-track-card.rec { border-color: var(--t-primary); box-shadow: 0 0 0 1px var(--t-primary); }
.cert-track-top { display: flex; align-items: center; gap: 0.6rem; }
.cert-track-ico {
  width: 34px; height: 34px; border-radius: var(--t-radius-sm);
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--c) 16%, var(--t-bg)); flex: none;
}
.cert-track-ico .material-symbols-rounded { font-size: 20px; color: var(--c); }
.cert-track-name { font-weight: 600; font-size: 0.875rem; line-height: 1.15; }
.cert-track-desc { font-size: 0.75rem; line-height: 1.45; color: var(--t-text-muted); flex: 1; }
.cert-track-tiers { display: flex; gap: 0.3rem; flex-wrap: wrap; }
.cert-track-rec {
  position: absolute; top: 0.75rem; right: 0.75rem; opacity: 0; transition: opacity 150ms;
}
.cert-track-card.rec .cert-track-rec { opacity: 1; }
.cert-tier-badge {
  font-family: var(--t-font-mono); font-size: 0.56rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.04em;
  padding: 0.12rem 0.44rem; border-radius: 999px;
}
.cert-tier-badge[data-tier="foundation"] { background: var(--tier-foundation-bg); color: var(--tier-foundation); }
.cert-tier-badge[data-tier="core"] { background: var(--tier-core-bg); color: var(--tier-core); }
.cert-tier-badge[data-tier="advanced"] { background: var(--tier-advanced-bg); color: var(--tier-advanced); }
.cert-tier-badge.mini { background: var(--t-surface); color: var(--t-text-muted); }
.cert-tier-badge.inactive { opacity: 0.35; text-decoration: line-through; }
.cert-badge-start {
  font-family: var(--t-font-mono); font-size: 0.56rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.04em; white-space: nowrap;
  padding: 0.12rem 0.44rem; border-radius: 999px; flex: none;
  background: var(--t-primary); color: var(--t-on-primary);
}

/* ── Meta-Credentials ────────────────────────────────────── */
.cert-meta-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.875rem;
  max-width: 56rem; margin: 0 auto;
}
.cert-meta-card {
  --c: var(--meta-champion);
  position: relative; text-align: center; padding: 1.5rem;
  border-radius: var(--t-radius-sm); border: 1px solid var(--t-border);
  background: var(--t-bg); display: flex; flex-direction: column; align-items: center; gap: 0.6rem;
  overflow: hidden;
}
.cert-meta-card::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(220px 120px at 50% -10%, color-mix(in srgb, var(--c) 18%, transparent), transparent 70%);
  pointer-events: none;
}
.cert-meta-card[data-level="champion"] { --c: var(--meta-champion); }
.cert-meta-card[data-level="master"] { --c: var(--meta-master); }
.cert-meta-card[data-level="legend"] { --c: var(--meta-legend); }
.cert-meta-medal {
  width: 60px; height: 60px; display: flex; align-items: center; justify-content: center;
  position: relative; z-index: 1;
}
.cert-meta-medal .disc {
  position: absolute; inset: 0;
  clip-path: polygon(50% 0,93% 25%,93% 75%,50% 100%,7% 75%,7% 25%);
  background: color-mix(in srgb, var(--c) 22%, var(--t-bg));
  border: 1px solid color-mix(in srgb, var(--c) 45%, transparent);
}
.cert-meta-medal .material-symbols-rounded { font-size: 30px; color: var(--c); position: relative; z-index: 1; }
.cert-meta-name { position: relative; z-index: 1; }
.cert-meta-card[data-level="champion"] .cert-meta-name { color: var(--meta-champion); }
.cert-meta-card[data-level="master"] .cert-meta-name { color: var(--meta-master); }
.cert-meta-card[data-level="legend"] .cert-meta-name { color: var(--meta-legend); }
.cert-meta-req { position: relative; z-index: 1; }
.cert-meta-desc {
  position: relative; z-index: 1;
}

/* ── How It Works ────────────────────────────────────────── */
.cert-steps {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0;
  max-width: 56rem; margin: 0 auto; position: relative;
}
.cert-step {
  padding: 0 1.1rem; text-align: center; position: relative;
}
.cert-step:not(:last-child)::after {
  content: ""; position: absolute; top: 22px; right: -2px; left: calc(50% + 30px);
  height: 2px; background: var(--t-border);
}
.cert-step-num {
  width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-family: var(--t-font-headline); font-size: 1.1rem; font-weight: 900;
  color: var(--t-on-primary); background: var(--t-primary); margin: 0 auto 1rem;
  position: relative; z-index: 1;
}
.cert-step-title { font-weight: 600; font-size: 0.94rem; margin-bottom: 0.4rem; }
.cert-step-desc { font-size: 0.81rem; color: var(--t-text-muted); line-height: 1.5; }
.cert-step-link {
  font-size: 0.81rem; color: var(--t-primary-text); text-decoration: none; font-weight: 500;
  margin-top: 0.6rem; display: inline-flex; align-items: center; gap: 0.2rem; cursor: pointer;
}
.cert-step-link:hover { text-decoration: underline; }
.cert-step-link .material-symbols-rounded { font-size: 15px; }

/* ── Closing CTA ─────────────────────────────────────────── */
.cert-closing {
  background: var(--t-accent-1-bg); border: 1px solid var(--t-primary);
  border-radius: var(--t-radius-md); padding: 2.25rem; text-align: center;
  margin-bottom: 2rem;
}
.cert-closing h2 { margin: 0; }
.cert-closing p { margin: 0.6rem 0 1.4rem; }

/* ═══════════════════════════════════════════════════════════
   Leaderboard Page
   ═══════════════════════════════════════════════════════════ */

.lb-yourrank {
  display: flex; align-items: center; gap: 1rem;
  background: var(--t-accent-1-bg); border: 1px solid var(--t-primary);
  border-radius: var(--t-radius-sm); padding: 0.85rem 1.25rem; margin-bottom: 1.25rem;
}
.lb-yr-rank { font-family: var(--t-font-headline); font-weight: 900; font-size: 1.75rem; color: var(--t-primary-text); line-height: 1; }
.lb-yr-avatar {
  width: 38px; height: 38px; border-radius: 50%; font-size: 13px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--t-accent-5-bg); color: var(--t-accent-5); flex: none;
}
.lb-yr-main { flex: 1; }
.lb-yr-name { font-weight: 600; font-size: 0.875rem; }

.lb-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--t-border); margin-bottom: 1.25rem; }
.lb-tab {
  display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.7rem 1rem;
  font-size: 14px; font-weight: 500; color: var(--t-text-muted);
  border: none; border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer;
  background: none; font-family: inherit; transition: color 150ms;
}
.lb-tab .material-symbols-rounded { font-size: 18px; }
.lb-tab:hover { color: var(--t-text); }
.lb-tab[aria-selected="true"] { color: var(--t-text); border-bottom-color: var(--t-primary); font-weight: 600; }

.lb-controls { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 1rem; }

/* Podium */
.lb-podium { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0.875rem; margin-bottom: 1.25rem; align-items: end; }
.lb-pod {
  position: relative; background: var(--t-bg); border: 1px solid var(--t-border);
  border-radius: var(--t-radius-sm); padding: 1.25rem 1.1rem 1.1rem; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 0.35rem;
}
.lb-pod.p1 { border-color: color-mix(in srgb, var(--t-accent-3) 55%, transparent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--t-accent-3) 30%, transparent); padding-top: 1.75rem; }
.lb-crown { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); }
.lb-pod-medal {
  width: 46px; height: 46px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-family: var(--t-font-headline); font-weight: 900; font-size: 18px; color: #fff;
}
.lb-pod.p1 .lb-pod-medal { background: var(--t-accent-3); color: var(--t-on-primary); }
.lb-pod.p2 .lb-pod-medal { background: var(--t-text-muted); }
.lb-pod.p3 .lb-pod-medal { background: var(--t-accent-3); opacity: 0.7; }
.lb-pod-name { font-weight: 600; font-size: 0.94rem; line-height: 1.2; }
.lb-pod-score { font-family: var(--t-font-headline); font-weight: 900; font-size: 1.5rem; margin-top: 0.25rem; }
.lb-pod-score small { display: block; margin-top: 0.15rem; }

/* Table */
.lb-panel { display: none; background: transparent; border: none; border-radius: 0; overflow: visible; }
.lb-panel.active { display: block; }
.lb-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.lb-table thead th {
  text-align: left; padding: 0.7rem 1.1rem; font-family: var(--t-font-mono); font-size: 11px;
  color: var(--t-text-muted); font-weight: 400; text-transform: uppercase; letter-spacing: 0.06em;
  border-bottom: 1px solid var(--t-border);
}
.lb-th-rank { width: 48px; }
.lb-table tbody td { padding: 0.75rem 1.1rem; border-bottom: 1px solid var(--t-border); vertical-align: middle; }
.lb-table tbody tr:last-child td { border-bottom: 0; }
.lb-table tbody tr:hover { background: var(--t-surface); }

@media (max-width: 900px) { .lb-podium { grid-template-columns: 1fr; } }

/* ═══════════════════════════════════════════════════════════
   Exam Catalog Page
   ═══════════════════════════════════════════════════════════ */

.ec-filters {
  background: var(--t-bg); border: 1px solid var(--t-border); border-radius: var(--t-radius-sm);
  padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: 1rem; margin-bottom: 1rem;
}
.ec-filters-body { display: flex; flex-direction: column; gap: 1rem; }
.ec-filters-toggle {
  display: none; align-items: center; justify-content: space-between; width: 100%;
  background: none; border: 0; padding: 0; cursor: pointer; font: inherit;
  color: var(--t-text); font-weight: 600; font-size: 0.9rem;
}
.ec-filters-toggle-label { display: inline-flex; align-items: center; gap: 0.5rem; }
.ec-filters-chevron { transition: transform 0.2s; color: var(--t-text-muted); }
.ec-filter-row { display: flex; align-items: center; gap: 0.85rem; flex-wrap: wrap; }
.ec-flabel { width: 46px; flex: none; }

.ec-chip {
  display: inline-flex; align-items: center; gap: 0.4rem; height: 30px; padding: 0 0.75rem;
  border-radius: 999px; border: 1px solid var(--t-border); background: var(--t-bg);
  font-size: 13px; font-weight: 500; color: var(--t-text-muted); cursor: pointer;
  transition: all 150ms;
}
.ec-chip .material-symbols-rounded { font-size: 16px; }
.ec-chip:hover { background: var(--t-surface); color: var(--t-text); }
.ec-chip.active { background: var(--t-accent-1-bg); border-color: var(--t-primary); color: var(--t-primary-text); }

.ec-search-box {
  display: flex; align-items: center; gap: 0.5rem; height: 38px; padding: 0 0.6rem;
  background: var(--t-bg); border: 1px solid var(--t-border); border-radius: var(--t-radius-sm);
  width: 100%; box-sizing: border-box;
}
.ec-search-box input {
  border: 0; outline: 0; background: transparent; flex: 1; font: inherit; font-size: 14px;
  color: var(--t-text); min-width: 0; padding: 0;
}
.ec-search-box input::placeholder { color: var(--t-text-muted); }
.ec-search-box:focus-within { border-color: var(--t-primary); outline: 2px solid var(--t-border-focus); outline-offset: 1px; }

.ec-results-bar {
  display: flex; align-items: center; gap: 0.75rem; padding: 0.5rem 0; margin-bottom: 0.75rem;
}
.ec-count b { font-family: var(--t-font-mono); }
.ec-clear { font-size: 13px; color: var(--t-primary-text); cursor: pointer; font-weight: 500; }
.ec-clear:hover { text-decoration: underline; }
.ec-sort { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 13px; color: var(--t-text-muted); }
.ec-sort select {
  font: inherit; font-size: 13px; font-weight: 500; color: var(--t-text); background: var(--t-bg);
  border: 1px solid var(--t-border); border-radius: var(--t-radius-sm); padding: 0.35rem 0.6rem; cursor: pointer;
}

.ec-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
@media (max-width: 1080px) { .ec-grid { grid-template-columns: 1fr; } }

.ec-card {
  --c: var(--t-text-muted);
  position: relative; background: var(--t-bg); border: 1px solid var(--t-border);
  border-radius: var(--t-radius-sm); padding: 1.1rem 1.25rem 1rem;
  display: flex; flex-direction: column; gap: 0.75rem; overflow: hidden;
  transition: transform 200ms, box-shadow 200ms, border-color 200ms;
}
.ec-card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--c); }
.ec-card:hover { transform: translateY(-2px); box-shadow: var(--t-shadow-md); border-color: var(--t-border-strong); }
.ec-card.locked { opacity: 0.88; }

.ec-top { display: flex; align-items: flex-start; gap: 0.75rem; }
.ec-ico {
  width: 42px; height: 42px; border-radius: var(--t-radius-sm);
  display: flex; align-items: center; justify-content: center; flex: none;
  background: color-mix(in srgb, var(--c) 16%, var(--t-bg));
}
.ec-ico .material-symbols-rounded { font-size: 24px; color: var(--c); }
.ec-headings { flex: 1; min-width: 0; }
.ec-title { font-size: 1rem; font-weight: 600; line-height: 1.2; letter-spacing: -0.01em; }
.ec-tags { display: flex; align-items: center; gap: 0.4rem; margin-top: 0.4rem; flex-wrap: wrap; }
.ec-tier {
  font-family: var(--t-font-mono); font-size: 10px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.04em; padding: 2px 8px; border-radius: 999px;
}
.ec-tier--foundation { background: var(--tier-foundation-bg); color: var(--tier-foundation); }
.ec-tier--core { background: var(--tier-core-bg); color: var(--tier-core); }
.ec-tier--advanced { background: var(--tier-advanced-bg); color: var(--tier-advanced); }
.ec-tier--mini { background: color-mix(in srgb, #717863 16%, transparent); color: #5c6356; }

.ec-badge {
  font-family: var(--t-font-mono); font-size: 10px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.04em; padding: 2px 8px;
  border-radius: 999px; margin-left: auto; flex: none; display: inline-flex; align-items: center; gap: 4px;
}
.ec-badge--pass { background: var(--t-accent-1-bg); color: var(--t-primary-text); }
.ec-badge--info { background: var(--t-accent-2-bg); color: var(--t-accent-2); }
.ec-badge--warn { background: var(--t-accent-3-bg); color: var(--t-accent-3); }

.ec-meta {
  display: flex; align-items: center; gap: 0.85rem; flex-wrap: wrap;
}
.ec-meta span { display: inline-flex; align-items: center; gap: 0.3rem; }
.ec-meta .material-symbols-rounded { font-size: 15px; }

.ec-prereq {
  display: flex; align-items: center; gap: 0.4rem; font-size: 12px;
  color: var(--t-accent-3); background: var(--t-accent-3-bg);
  padding: 0.4rem 0.6rem; border-radius: var(--t-radius-sm);
}
.ec-prereq .material-symbols-rounded { font-size: 15px; }

.ec-foot {
  display: flex; align-items: center; gap: 0.6rem; margin-top: auto;
  padding-top: 0.85rem; border-top: 1px solid var(--t-border);
  flex-wrap: wrap; row-gap: 0.5rem;
}
.ec-pass-info, .ec-prog-info {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-family: var(--t-font-mono); font-size: 12px; color: var(--t-text-muted);
}

/* Continue strip */
.ec-continue { display: flex; flex-direction: column; gap: 0.6rem; margin-bottom: 1rem; }
.ec-continue-card {
  display: flex; align-items: center; gap: 0.85rem; background: var(--t-bg);
  border: 1px solid var(--t-primary); border-radius: var(--t-radius-sm);
  padding: 0.85rem 1.1rem; position: relative; overflow: hidden;
}
.ec-continue-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--c, var(--t-primary)); }
.ec-continue-card .ec-ico {
  width: 40px; height: 40px; background: color-mix(in srgb, var(--c) 16%, var(--t-bg));
}

/* Detail panel */
.ec-detail { display: none; padding: 1rem 0 0; border-top: 1px solid var(--t-border); margin-top: 0.75rem; }
.ec-detail.open { display: block; }
.ec-detail-toggle {
  display: inline-flex; align-items: center; gap: 0.25rem; background: none; border: none;
  cursor: pointer; color: var(--t-text-muted); font: inherit; padding: 0;
  transition: color 150ms;
}
.ec-detail-toggle:hover { color: var(--t-text); }
.ec-detail-heading { font-size: 0.72rem; font-weight: 700; color: var(--t-text-muted); text-transform: uppercase; letter-spacing: 0.04em; margin: 0 0 0.5rem; }
.ec-domain-row { display: flex; align-items: center; gap: 0.5rem; padding: 0.2rem 0; font-size: 0.78rem; }
.ec-domain-name { flex: 1; color: var(--t-text-secondary); }
.ec-domain-weight { font-weight: 700; color: var(--t-text-muted); min-width: 2.5rem; text-align: right; font-family: var(--t-font-mono); font-size: 0.72rem; }
.ec-domain-bar { width: 60px; height: 6px; border-radius: 3px; background: var(--t-surface-raised); overflow: hidden; }
.ec-domain-fill { height: 100%; border-radius: 3px; }
.ec-detail-grid { display: flex; flex-direction: column; gap: 0.3rem; }
.ec-detail-item { display: flex; align-items: center; gap: 0.4rem; font-size: 0.78rem; color: var(--t-text-secondary); }
.ec-detail-item .material-symbols-rounded { color: var(--t-text-muted); }
.ec-detail-links { display: flex; flex-direction: column; gap: 0.3rem; }
.ec-detail-link {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.78rem; color: var(--t-primary-text); text-decoration: none; font-weight: 500;
}
.ec-detail-link:hover { text-decoration: underline; }

/* ═══════════════════════════════════════════════════════════
   Achievements Page
   ═══════════════════════════════════════════════════════════ */

.ach-summary { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr; gap: 14px; }
.ach-sm {
  background: var(--t-bg); border: 1px solid var(--t-border); border-radius: var(--t-radius-sm);
  padding: 18px 20px; display: flex; flex-direction: column; gap: 8px;
}
.ach-sm .s-top { display: flex; align-items: center; gap: 8px; }
.ach-sm .s-ico {
  width: 30px; height: 30px; border-radius: var(--t-radius-sm);
  display: flex; align-items: center; justify-content: center; flex: none;
}
.ach-sm .s-ico .material-symbols-rounded { font-size: 18px; }
.ach-sm .value {
  font-family: var(--t-font-headline); font-weight: 900; font-size: 28px; line-height: 1;
  display: flex; align-items: baseline; gap: 6px;
}
.ach-sm .value small { font-family: var(--t-font); font-size: 13px; font-weight: 500; color: var(--t-text-muted); }
.ach-sm .track { height: 6px; border-radius: 999px; background: var(--t-surface-raised); overflow: hidden; margin-top: 2px; }
.ach-sm .track > i { display: block; height: 100%; border-radius: 999px; background: var(--t-primary); }

.ach-controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding-top: 1rem; }
.ach-seg {
  display: inline-flex; background: var(--t-surface-alt); border-radius: var(--t-radius-sm);
  padding: 3px; gap: 2px; flex-wrap: wrap;
}
.ach-seg button {
  border: 0; background: transparent; font: inherit; font-size: 13px; font-weight: 500;
  color: var(--t-text-muted); padding: 5px 13px; border-radius: calc(var(--t-radius-sm) - 2px);
  cursor: pointer; white-space: nowrap; transition: all 150ms;
}
.ach-seg button[aria-pressed="true"] {
  background: var(--t-bg); color: var(--t-text); font-weight: 600; box-shadow: var(--t-shadow-sm);
}

.ach-controls-spacer { flex: 1; }
/* Mobile filter dropdowns — hidden on desktop (tabs are used there). */
.ach-filter-selects { display: none; }
.ach-filter-select {
  flex: 1; min-width: 0; height: 2.5rem; padding: 0 0.75rem; box-sizing: border-box;
  border: 1px solid var(--t-border); border-radius: var(--t-radius-sm);
  background: var(--t-bg); color: var(--t-text); font: inherit; font-size: 0.85rem; cursor: pointer;
}

.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(238px, 1fr)); gap: 14px; }

.ach-card {
  --mc: var(--t-surface-raised); --mfg: var(--t-text-muted); --ac: var(--t-text-muted);
  background: var(--t-bg); border: 1px solid var(--t-border); border-radius: var(--t-radius-sm);
  padding: 20px 18px 16px; display: flex; flex-direction: column; align-items: center;
  text-align: center; gap: 10px; cursor: pointer; position: relative;
  transition: transform 200ms, box-shadow 200ms, border-color 200ms;
}
.ach-card:hover { transform: translateY(-2px); box-shadow: var(--t-shadow-md); }
.ach-card.earned { border-color: color-mix(in srgb, var(--ac) 40%, var(--t-border)); }
.ach-card.earned.legendary {
  background: radial-gradient(150px 90px at 50% -8%, color-mix(in srgb, var(--ac) 18%, transparent), transparent 70%), var(--t-bg);
  border-color: color-mix(in srgb, var(--ac) 55%, transparent);
}
.ach-card.locked { opacity: 0.82; }

.ach-medal { width: 66px; height: 66px; position: relative; display: flex; align-items: center; justify-content: center; flex: none; margin-top: 2px; }
.ach-medal .disc { position: absolute; inset: 0; clip-path: polygon(50% 0,93% 25%,93% 75%,50% 100%,7% 75%,7% 25%); }
.ach-medal .material-symbols-rounded { position: relative; z-index: 1; font-size: 30px; }
.ach-card.earned .ach-medal .disc { background: var(--mc); }
.ach-card.earned .ach-medal .material-symbols-rounded { color: var(--mfg); }
.ach-card.progress .ach-medal .disc { background: var(--t-surface-raised); border: 1px solid var(--t-border); }
.ach-card.progress .ach-medal .material-symbols-rounded { color: var(--t-text-muted); }
.ach-card.locked .ach-medal .disc { background: var(--t-surface-raised); }
.ach-card.locked .ach-medal .material-symbols-rounded { color: var(--t-text-muted); }
.ach-medal .lockpip {
  position: absolute; bottom: -2px; right: -2px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--t-bg); border: 1px solid var(--t-border);
  display: flex; align-items: center; justify-content: center; z-index: 2;
}
.ach-medal .lockpip .material-symbols-rounded { font-size: 13px; color: var(--t-text-muted); }

.ach-card .a-rar { display: inline-flex; align-items: center; gap: 6px; }
.a-rar .rar-chip {
  font-family: var(--t-font-mono); font-size: 10px; font-weight: 500; text-transform: uppercase;
  letter-spacing: 0.04em; padding: 2px 8px; border-radius: 999px;
  color: var(--ac); background: color-mix(in srgb, var(--ac) 14%, var(--t-bg));
}
.ach-card .a-name { font-size: 14px; font-weight: 600; line-height: 1.2; }
.ach-card .a-desc { font-size: 12px; line-height: 1.45; color: var(--t-text-muted); flex: 1; }
.a-holders {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--t-font-mono); font-size: 11px; color: var(--t-text-muted);
}
.a-holders .material-symbols-rounded { font-size: 14px; margin-right: 2px; }
.a-holders b { color: var(--t-text-secondary); font-weight: 600; }
.a-holders.rareflag b { color: var(--t-primary-text); }

.a-foot { width: 100%; margin-top: 4px; }
.a-foot .earned-on {
  font-family: var(--t-font-mono); font-size: 11px; color: var(--t-primary-text);
  display: inline-flex; align-items: center; gap: 5px;
}
.a-foot .earned-on .material-symbols-rounded { font-size: 14px; }
.a-foot .prog { display: flex; flex-direction: column; gap: 6px; }
.a-foot .pbar { height: 6px; border-radius: 999px; background: var(--t-surface-raised); overflow: hidden; }
.a-foot .pbar > i { display: block; height: 100%; border-radius: 999px; background: var(--ac); }
.a-foot .ptxt { font-family: var(--t-font-mono); font-size: 11px; color: var(--t-text-muted); }
.a-foot .hint {
  font-family: var(--t-font-mono); font-size: 11px; color: var(--t-text-muted);
  display: inline-flex; align-items: center; gap: 5px;
}
.a-foot .hint .material-symbols-rounded { font-size: 14px; }

.ach-cat-head { display: flex; align-items: center; gap: 10px; margin: 8px 0 -4px; }
.ach-cat-head h2 { font-weight: 600; font-size: 15px; margin: 0; }
.ach-cat-head .cnt { font-family: var(--t-font-mono); font-size: 12px; color: var(--t-text-muted); }
.ach-cat-head .line { flex: 1; height: 1px; background: var(--t-border); }

/* Detail modal */
.ach-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.4);
  z-index: 80; align-items: center; justify-content: center; padding: 24px;
}
.ach-overlay.show { display: flex; }
.ach-modal {
  background: var(--t-bg); border: 1px solid var(--t-border); border-radius: var(--t-radius-md);
  padding: 28px; max-width: 400px; width: 100%; box-sizing: border-box; box-shadow: var(--t-shadow-lg); text-align: center;
}
.ach-modal .m-medal { width: 88px; height: 88px; margin: 0 auto 16px; position: relative; display: flex; align-items: center; justify-content: center; }
.ach-modal .m-medal .disc { position: absolute; inset: 0; clip-path: polygon(50% 0,93% 25%,93% 75%,50% 100%,7% 75%,7% 25%); }
.ach-modal .m-medal .material-symbols-rounded { position: relative; z-index: 1; font-size: 40px; }
.ach-modal .m-status {
  margin-top: 18px; padding: 14px; border-radius: var(--t-radius-sm);
  background: var(--t-surface); font-size: 13px;
}

@media (max-width: 1080px) { .ach-summary { grid-template-columns: repeat(2, 1fr); } }
/* Keep summary tiles 2-per-row on phones (was collapsing to 1) with centred content. */
@media (max-width: 560px) {
  .ach-summary { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .ach-sm { align-items: center; text-align: center; padding: 14px 12px; }
  .ach-sm .s-top { justify-content: center; }
}

/* ── Achievements on phones ─────────────────────────────────
   Tabs → two dropdowns on one line; cards → horizontal strips
   (icon left, rarity + name right, everything else below). */
@media (max-width: 40rem) {
  .ach-seg, .ach-controls-spacer { display: none; }
  .ach-filter-selects { display: flex; gap: 0.5rem; width: 100%; }

  .ach-grid { grid-template-columns: 1fr; gap: 10px; }
  .ach-card {
    display: grid; grid-template-columns: auto 1fr;
    column-gap: 14px; row-gap: 6px; text-align: left; align-items: center;
    padding: 14px;
  }
  .ach-card > * { grid-column: 1 / -1; min-width: 0; }
  .ach-card .ach-medal {
    grid-column: 1; grid-row: 1 / span 2; align-self: center;
    width: 48px; height: 48px; margin-top: 0;
  }
  .ach-card .ach-medal .material-symbols-rounded { font-size: 24px; }
  .ach-card .a-rar { grid-column: 2; grid-row: 1; align-self: end; }
  .ach-card .a-name { grid-column: 2; grid-row: 2; align-self: start; }
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 1080px) {
  .cert-track-grid { grid-template-columns: repeat(2, 1fr); }
  .cert-tiers { grid-template-columns: 1fr; }
  .cert-tier-arrow { transform: rotate(90deg); padding: 0.4rem 0; }
  .cert-meta-grid { grid-template-columns: 1fr; }
  .cert-steps { grid-template-columns: repeat(2, 1fr); gap: 1.75rem 0; }
  .cert-step::after { display: none !important; }
}
@media (max-width: 640px) {
  .cert-track-grid { grid-template-columns: 1fr; }
  .cert-hero h1 { font-size: 2.25rem; }
  .cert-hero { padding: 2rem 1.5rem; }
  .cert-hero-stats { gap: 1.5rem; }
}

/* ── Filter Bar ──────────────────────────────────────────── */
.cert-filter-bar {
  display: flex; flex-wrap: wrap; gap: 1.25rem; padding: 1rem 1.25rem; align-items: flex-end;
  background: var(--t-bg); border: 1px solid var(--t-border); border-radius: var(--t-radius-sm);
  margin-bottom: 1rem;
}
.cert-filter-group { display: flex; flex-direction: column; gap: 0.4rem; min-width: 0; }
.cert-filter-search-group { flex: 1; min-width: 180px; display: flex; flex-direction: column; gap: 0.4rem; }
.cert-filter-label {
  font-family: var(--t-font-mono); font-size: 0.625rem; font-weight: 600; color: var(--t-text-muted);
  text-transform: uppercase; letter-spacing: 0.06em; line-height: 1; white-space: nowrap;
}
.cert-filter-chips {
  display: inline-flex; gap: 2px; flex-wrap: wrap; align-items: center;
  background: var(--t-surface-alt); border-radius: var(--t-radius-sm); padding: 3px;
  height: 2.25rem; box-sizing: border-box;
}
.cert-filter-chip {
  padding: 0.35rem 0.85rem; border: none; border-radius: calc(var(--t-radius-sm) - 2px);
  background: transparent; font-size: 13px; font-weight: 500; cursor: pointer;
  color: var(--t-text-muted); transition: all 150ms; white-space: nowrap;
  height: auto; display: inline-flex; align-items: center; line-height: 1; margin-top: 0;
  box-sizing: border-box;
}
.cert-filter-chip:hover { color: var(--t-text); }
.cert-filter-chip.active { background: var(--t-bg); color: var(--t-text); font-weight: 600; box-shadow: var(--t-shadow-sm); }

/* ── Multi-select dropdown ───────────────────────────────── */
.ms-drop { position: relative; min-width: 160px; }
.ms-trigger {
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
  height: 2.25rem; padding: 0 0.75rem; border: 1px solid var(--t-border);
  border-radius: var(--t-radius-sm); background: var(--t-bg); cursor: pointer;
  font: inherit; font-size: 0.875rem; color: var(--t-text); width: 100%;
  transition: border-color 150ms; box-sizing: border-box;
}
.ms-trigger:hover { border-color: var(--t-border-strong); }
.ms-trigger.open { border-color: var(--t-primary); }
.ms-trigger .ms-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ms-trigger .ms-arrow { font-size: 18px; color: var(--t-text-muted); flex: none; transition: transform 150ms; }
.ms-trigger.open .ms-arrow { transform: rotate(180deg); }
.ms-count {
  font-family: var(--t-font-mono); font-size: 10px; font-weight: 600;
  background: var(--t-primary); color: var(--t-on-primary);
  width: 18px; height: 18px; border-radius: 50%; display: inline-flex;
  align-items: center; justify-content: center; flex: none;
}
.ms-menu {
  display: none; position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  background: var(--t-bg); border: 1px solid var(--t-border); border-radius: var(--t-radius-sm);
  box-shadow: var(--t-shadow-lg); z-index: 50; max-height: 240px; overflow-y: auto; padding: 4px 0;
}
.ms-drop.open .ms-menu { display: block; }
.ms-option {
  display: flex; align-items: center; gap: 0.5rem; padding: 0.4rem 0.75rem;
  font-size: 0.84rem; cursor: pointer; transition: background 100ms; color: var(--t-text);
}
.ms-option:hover { background: var(--t-surface); }
.ms-check {
  width: 16px; height: 16px; border: 1.5px solid var(--t-border-strong); border-radius: 3px;
  display: flex; align-items: center; justify-content: center; flex: none; transition: all 150ms;
}
.ms-option.selected .ms-check { background: var(--t-primary); border-color: var(--t-primary); }
.ms-option.selected .ms-check::after { content: '✓'; font-size: 11px; color: var(--t-on-primary); font-weight: 700; }
.ms-opt-label { flex: 1; }
.ms-clear {
  display: block; padding: 0.35rem 0.75rem; font-size: 0.75rem; color: var(--t-primary-text);
  cursor: pointer; border-top: 1px solid var(--t-border); text-align: center; font-weight: 500;
}
.ms-clear:hover { background: var(--t-surface); }

.cert-filter-search {
  width: 100%; box-sizing: border-box; padding: 0.45rem 0.75rem; border: 1px solid var(--t-border);
  border-radius: var(--t-radius-sm); font-size: 0.875rem; color: var(--t-text);
  background: var(--t-bg); outline: none; transition: border-color 150ms;
  height: 2.25rem;
}
.cert-filter-search:focus { border-color: var(--t-primary); outline: 2px solid var(--t-border-focus); outline-offset: 1px; }
.cert-filter-search:focus { border-color: var(--cert-green-500); }

.lb-search-wrap {
  display: flex; align-items: center; gap: 0.4rem; height: 2.25rem;
}
.lb-search-wrap .cert-filter-search {
  flex: 1; min-width: 0; height: 2.25rem; box-sizing: border-box;
}
.lb-search-nav-group {
  display: none; align-items: center; height: 2.25rem; box-sizing: border-box;
  border: 1px solid var(--t-border); border-radius: var(--t-radius-sm);
  background: var(--t-bg); overflow: hidden;
}
.lb-search-nav-group.visible { display: flex; }
.lb-search-count {
  font-size: 0.72rem; color: var(--t-text-muted); white-space: nowrap; padding: 0 0.5rem;
  font-variant-numeric: tabular-nums;
}
.lb-search-nav {
  display: flex; align-items: center; justify-content: center;
  width: 1.5rem; height: 100%; border: none; border-left: 1px solid var(--t-border);
  background: transparent; color: var(--t-text-muted); font-size: 0.55rem;
  cursor: pointer; padding: 0; transition: background 120ms, color 120ms;
}
.lb-search-nav:hover:not(:disabled) { background: var(--t-surface); color: var(--t-text); }
.lb-search-nav:disabled { opacity: 0.3; cursor: default; }
:root[data-theme="dark"] .lb-search-nav { color: var(--cert-gray-400); border-left-color: var(--cert-gray-300); }
:root[data-theme="dark"] .lb-search-nav:hover:not(:disabled) { background: var(--cert-gray-200); color: var(--cert-gray-900); }


/* ── Results Page ────────────────────────────────────────── */
.cert-results-loading {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 300px; gap: 1rem; color: var(--cert-gray-500); font-size: 0.9rem;
}
.cert-results-spinner {
  width: 36px; height: 36px; border: 3px solid var(--cert-gray-200);
  border-top-color: var(--cert-green-500); border-radius: 50%;
  animation: cert-spin 0.8s linear infinite;
}
@keyframes cert-spin { to { transform: rotate(360deg); } }


/* Confetti */
.cert-confetti-wrap {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 1000; overflow: hidden;
}
.cert-confetti-piece {
  position: absolute; top: -10px; width: 8px; height: 8px;
  border-radius: 2px; opacity: 0.85;
  animation: cert-confetti-fall linear forwards;
}
@keyframes cert-confetti-fall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .cert-confetti-wrap { display: none !important; }
}

/* ═══════════════════════════════════════════════════════════
   Exam Result page (.exam-result) — CertLayout redesign
   ═══════════════════════════════════════════════════════════ */
.exam-result {
  max-width: 600px; margin: 0 auto; padding: 40px 4px 64px;
  text-align: center; width: 100%; box-sizing: border-box;
}

/* Medal */
.exam-result .medal {
  width: 92px; height: 92px; margin: 0 auto 22px; position: relative;
  display: flex; align-items: center; justify-content: center;
}
.exam-result .medal .disc {
  position: absolute; inset: 0;
  clip-path: polygon(50% 0, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%);
  background: var(--t-secondary);
}
.exam-result .medal .material-symbols-rounded {
  font-size: 46px; color: #08251a; position: relative; z-index: 1;
  width: auto; height: auto;
}
.exam-result.is-fail .medal .disc { background: var(--t-surface-alt); }
.exam-result.is-fail .medal .material-symbols-rounded { color: var(--t-text-muted); }

.exam-result h1 {
  font-weight: 900; font-size: 34px; letter-spacing: -0.025em;
  margin: 0; color: var(--t-text);
}
.exam-result .result-meta {
  font-size: 12px; color: var(--t-text-muted); margin-top: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.exam-result .big-score {
  font-weight: 900; font-size: 56px; line-height: 1; margin: 18px 0 4px;
  color: var(--t-text);
}
.exam-result .pass-mark {
  font-size: 12px; color: var(--t-text-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.exam-result .er-tag {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 999px;
  margin-top: 12px;
}
.exam-result .er-tag--practice { background: var(--t-accent-2-bg); color: var(--t-accent-2); }
.exam-result .er-tag--beta { background: var(--t-accent-3-bg); color: var(--t-accent-3); }

/* Breakdown */
.exam-result .breakdown {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  margin: 28px 0; text-align: left;
}
.exam-result .breakdown.single { grid-template-columns: 1fr; }
.exam-result .bd {
  background: var(--t-bg); border: 1px solid var(--t-border);
  border-radius: var(--t-radius-lg); padding: 16px; box-sizing: border-box;
}
.exam-result .bd .bd-l {
  font-size: 12px; color: var(--t-text-muted);
  display: flex; justify-content: space-between;
}
.exam-result .bd .bd-n { font-weight: 900; font-size: 24px; margin: 4px 0 8px; color: var(--t-text); }
.exam-result .bd .bd-n.weak { color: #dc2626; }
.exam-result .bd .bar {
  height: 6px; border-radius: 999px; background: var(--t-surface-alt); overflow: hidden;
}
.exam-result .bd .bar > i {
  display: block; height: 100%; border-radius: 999px; background: var(--t-secondary);
}
.exam-result .bd .bar > i.weak { background: #ef4444; }

/* Panels */
.exam-result .res-panel {
  background: var(--t-bg); border: 1px solid var(--t-border);
  border-radius: var(--t-radius-lg); padding: 20px; margin-bottom: 16px;
  text-align: left; box-sizing: border-box;
}
.exam-result .res-panel.accent {
  border-color: color-mix(in srgb, var(--t-secondary) 45%, var(--t-border));
  background: color-mix(in srgb, var(--t-secondary) 8%, var(--t-bg));
}
.exam-result .rp-head {
  display: flex; align-items: center; gap: 9px;
  font-weight: 600; font-size: 15px; margin-bottom: 14px; color: var(--t-text);
}
.exam-result .rp-head .material-symbols-rounded { font-size: 20px; color: var(--t-secondary); }
.exam-result .rp-note {
  display: flex; align-items: center; gap: 8px; font-size: 12px;
  color: var(--t-text-muted); margin: 14px 0;
}
.exam-result .rp-note .material-symbols-rounded { font-size: 16px; }
.exam-result .rp-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }

/* Credential rows */
.exam-result .cred-row {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 10px 0; border-bottom: 1px solid var(--t-border); font-size: 14px;
}
.exam-result .cred-row:last-child { border-bottom: 0; }
.exam-result .cred-row .cr-l { color: var(--t-text-muted); }
.exam-result .cred-row .cr-v {
  font-weight: 500; text-align: right; display: inline-flex; align-items: center; gap: 8px;
  color: var(--t-text);
}
.exam-result .cred-row .cr-v.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px;
}

/* What's next */
.exam-result .next-rec {
  display: flex; align-items: center; gap: 14px;
  background: var(--t-bg); border: 1px solid var(--t-border);
  border-radius: var(--t-radius-md); padding: 14px;
}
.exam-result .next-rec .nr-ico {
  width: 40px; height: 40px; border-radius: var(--t-radius-md);
  background: color-mix(in srgb, var(--t-secondary) 12%, var(--t-bg));
  display: flex; align-items: center; justify-content: center; flex: none;
}
.exam-result .next-rec .nr-ico .material-symbols-rounded { color: var(--t-secondary); font-size: 22px; }
.exam-result .next-rec .nr-main { flex: 1; min-width: 0; }
.exam-result .next-rec .nr-t { font-weight: 600; font-size: 14px; color: var(--t-text); }
.exam-result .next-rec .nr-d { font-size: 12px; color: var(--t-text-muted); margin-top: 2px; line-height: 1.4; }
.exam-result .next-links { display: flex; gap: 18px; margin-top: 14px; flex-wrap: wrap; }
.exam-result .next-links a { font-size: 13px; font-weight: 500; color: var(--t-secondary); text-decoration: none; }
.exam-result .next-links a:hover { text-decoration: underline; }

/* Domain performance */
.exam-result .dom-row {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 0; border-bottom: 1px solid var(--t-border);
}
.exam-result .dom-row:last-child { border-bottom: 0; }
.exam-result .dom-row .dom-name { flex: 1; min-width: 0; font-size: 14px; color: var(--t-text); }
.exam-result .dom-row .dom-bar {
  width: 120px; height: 6px; border-radius: 999px;
  background: var(--t-surface-alt); overflow: hidden; flex: none;
}
.exam-result .dom-row .dom-bar > i { display: block; height: 100%; border-radius: 999px; background: var(--t-secondary); }
.exam-result .dom-row .dom-bar > i.weak { background: #ef4444; }
.exam-result .dom-row .dom-pct {
  width: 86px; text-align: right; font-size: 13px; font-weight: 600; flex: none;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--t-text);
}
.exam-result .dom-row .dom-pct.weak { color: #dc2626; }
.exam-result .dom-row .dom-pct .frac { color: var(--t-text-muted); font-weight: 400; }

/* Study resources / remediation */
.exam-result .study-list { display: flex; flex-direction: column; gap: 2px; }
.exam-result .study-item {
  display: flex; gap: 11px; padding: 11px 0;
  border-bottom: 1px solid var(--t-border); text-decoration: none;
}
.exam-result .study-item:last-child { border-bottom: 0; }
.exam-result .study-item .material-symbols-rounded { font-size: 18px; color: var(--t-secondary); flex: none; margin-top: 1px; }
.exam-result .study-item .si-text { font-size: 13px; line-height: 1.5; color: var(--t-text); }
.exam-result .study-item:hover .si-text { text-decoration: underline; }
.exam-result .study-dom { margin: 4px 0 12px; }
.exam-result .study-dom-title { font-size: 12px; font-weight: 700; color: #dc2626; margin-bottom: 4px; }
.exam-result .study-weak { font-size: 13px; color: var(--t-text-muted); line-height: 1.5; }

/* Bottom actions */
.exam-result .r-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 8px; }

@media (max-width: 30rem) {
  .exam-result .breakdown { grid-template-columns: 1fr; }
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 48rem) {
  .cert-hero h1 { font-size: 1.6rem; }
  .cert-tiers { grid-template-columns: 1fr; }
  /* Icon + title on one line, description/meta full-width below. */
  .cert-tier-card { display: grid; grid-template-columns: auto 1fr; column-gap: 12px; row-gap: 0.75rem; align-items: center; }
  .cert-tier-card > * { grid-column: 1 / -1; min-width: 0; }
  .cert-tier-card .cert-tier-icon { grid-column: 1; grid-row: 1; }
  .cert-tier-card .cert-tier-name { grid-column: 2; grid-row: 1; align-self: center; }
  .cert-tier-arrow { display: none !important; }
  .cert-meta-grid { grid-template-columns: 1fr; }
  .cert-steps { grid-template-columns: repeat(2, 1fr); }
  .cert-track-grid { grid-template-columns: 1fr 1fr; }
  /* Stretch to full width — base align-items:flex-end otherwise collapsed the
     groups to ~160px on the right, leaving a big empty gap on the left. */
  .cert-filter-bar { flex-direction: column; align-items: stretch; gap: 0.75rem; padding: 0.85rem 1rem; }
  .cert-filter-bar .cert-filter-group,
  .cert-filter-bar .cert-filter-search-group { width: 100%; min-width: 0; }
  .cert-filter-bar .ms-drop { min-width: 0; width: 100%; }
}
@media (max-width: 30rem) {
  .cert-track-grid { grid-template-columns: 1fr; }
  .cert-steps { grid-template-columns: 1fr; }
  /* Stack domain rows earlier (was only <=360px) so the score bar/pct don't
     crush the domain name between 361–480px. */
  .exam-result .dom-row { flex-wrap: wrap; }
  .exam-result .dom-row .dom-name { flex: 1 1 auto; }
  .exam-result .dom-row .dom-bar { order: 3; width: 100%; }
}

/* ── Phones (≤640px): tidy the header ────────────────────────
   Swap the wordmark for the compact favicon mark, and collapse just
   search + theme into the profile menu. The notification bell stays in
   the bar (with its own badge). */
@media (max-width: 40rem) {
  .cert-brand:has(.cert-logo-mini) .cert-logo { display: none; }
  .cert-logo-mini { display: block; }

  .cert-bar-actions > a.cert-shell-btn[href="/"] { display: none; }
  #certThemeToggle { display: none; }
  .auth-mobile-item { display: flex; }

  /* The bell isn't the rightmost item, so its right-anchored panel can run off
     the left edge — drop it to a full-width fixed sheet under the header bar.
     !important overrides header-widgets.js inline styles. */
  .notif-dropdown {
    position: fixed !important;
    top: 60px !important;
    left: 0.75rem !important;
    right: 0.75rem !important;
    width: auto !important;
    max-width: none !important;
  }
}

/* ── Small phones — keep everything usable down to 320px ──────
   Applies at ≤360px (so 320px is covered). Tightens padding,
   shrinks oversized display type, and makes the few remaining
   fixed-ish rows fluid so nothing overflows the viewport. */

@media (max-width: 22.5rem) {
  /* Reclaim vertical space — drop the breadcrumb bar on tiny screens */
  .cert-topbar { display: none; }

  /* Collapsible exam-catalog filters */
  .ec-filters-toggle { display: flex; }
  .ec-filters-body { display: none; }
  .ec-filters.open .ec-filters-body { display: flex; }
  .ec-filters.open .ec-filters-chevron { transform: rotate(180deg); }

  /* (Header search/theme/notifications already collapsed into the profile
     menu at ≤40rem above.) */

  /* Tighter gutters */
  .cert-page { padding-left: 0.75rem !important; padding-right: 0.75rem !important; }

  /* Display headings that are too large at 320px */
  .cert-hero h1 { font-size: 1.5rem; }
  .cert-hero .tagline { font-size: 0.9rem; }
  .cert-hero-stats { gap: 1rem 1.5rem; }

  /* Hero CTAs stack full-width instead of crowding */
  .cert-hero-ctas { flex-direction: column; align-items: stretch; }
  .cert-hero-ctas .btn { width: 100%; justify-content: center; }

  /* Exam result page */
  .exam-result { padding: 28px 2px 48px; }
  .exam-result h1 { font-size: 26px; }
  .exam-result .big-score { font-size: 44px; }
  .exam-result .res-panel,
  .exam-result .bd { padding: 14px; }
  .exam-result .r-actions .btn { width: 100%; }
  /* Domain rows: drop the bar to its own full-width line so the
     name + percentage aren't squeezed. */
  .exam-result .dom-row { flex-wrap: wrap; }
  .exam-result .dom-row .dom-name { flex: 1 1 auto; }
  .exam-result .dom-row .dom-bar { order: 3; width: 100%; }
  /* Long verification code shouldn't push the credential row wide */
  .exam-result .cred-row { flex-wrap: wrap; gap: 2px 16px; }
  .exam-result .cred-row .cr-v { text-align: left; }
  .exam-result .cred-row .cr-v.mono { word-break: break-all; }

  /* Leaderboard "your rank" banner wraps instead of overflowing */
  .lb-your-stats { flex-wrap: wrap; }
  .lb-your-stats .btn { width: 100%; }
}

/* ═══════════════════════════════════════════════════════════
   My Credentials Page (Step 20)
   ═══════════════════════════════════════════════════════════ */

/* ── Loading / Empty ─────────────────────────────────────── */
.creds-loading {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 300px; gap: 1rem; color: var(--cert-gray-500); font-size: 0.9rem;
}

/* ═══════════════════════════════════════════════════════════
   VERIFICATION PAGE (Step 23)
   ═══════════════════════════════════════════════════════════ */

/* ── Verify form ──────────────────────────────────────────── */
.cert-verify-form { max-width: 30rem; margin: 1.5rem auto; display: flex; gap: 0.5rem; }
.cert-verify-input { flex: 1; box-sizing: border-box; padding: 0.7rem 0.9rem; border: 1px solid var(--t-border-strong); border-radius: var(--t-radius-sm); font-size: 0.9rem; font-family: var(--t-font); color: var(--t-text); background: var(--t-bg); transition: border-color 150ms, box-shadow 150ms; }
.cert-verify-input:focus { outline: none; border-color: var(--t-primary); box-shadow: 0 0 0 3px var(--t-border-focus); }
.cert-verify-input::placeholder { color: var(--t-text-muted); }
.cert-verify-submit { padding: 0.7rem 1.4rem; background: var(--t-primary); color: var(--t-on-primary); border: none; border-radius: var(--t-radius-sm); font-size: 0.85rem; font-weight: 700; font-family: var(--t-font); cursor: pointer; white-space: nowrap; transition: background 150ms; }
.cert-verify-submit:hover { background: var(--t-primary-hover); }
.cert-verify-submit:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Verify result card ───────────────────────────────────── */
.cert-verify-result { max-width: 34rem; margin: 1.5rem auto 0; background: var(--t-bg); border: 1px solid var(--t-border); border-radius: var(--t-radius-md); box-shadow: var(--t-shadow-md); overflow: hidden; }
.cert-verify-banner { display: flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 1.15rem 1.5rem; font-size: 1.05rem; font-weight: 800; text-align: center; }
.cert-verify-banner .material-symbols-rounded { font-size: 24px; }
.cert-verify-banner.valid { background: var(--t-surface); color: var(--t-primary-text); border-bottom: 2px solid var(--t-primary); }
.cert-verify-banner.expired { background: var(--cert-amber-100, #fef3c7); color: var(--cert-amber-700, #b45309); border-bottom: 2px solid var(--cert-amber-600, #d97706); }
.cert-verify-banner.not-found { background: var(--t-surface); color: var(--t-text-muted); border-bottom: 2px solid var(--t-border-strong); }
.cert-verify-body { padding: 0.75rem 1.75rem 1.75rem; }
.cert-verify-grid { font-size: 0.9rem; }
.cert-verify-grid .cvr { display: grid; grid-template-columns: minmax(7rem, auto) 1fr; align-items: center; gap: 0 1rem; padding: 0.7rem 0; border-top: 1px solid var(--t-border); }
.cert-verify-grid .cvr:first-child { border-top: none; padding-top: 0.25rem; }
.cert-verify-grid dt { color: var(--t-text-muted); font-weight: 700; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.06em; }
.cert-verify-grid dd { color: var(--t-text); font-weight: 500; margin: 0; min-width: 0; overflow-wrap: anywhere; }
.cert-verify-code { display: inline-block; font-family: var(--t-font-mono); font-weight: 600; font-size: 0.8rem; letter-spacing: 0.01em; color: var(--t-text); background: var(--t-surface); border: 1px solid var(--t-border); border-radius: var(--t-radius-sm); padding: 0.2rem 0.55rem; }
.cert-verify-tier-badge { display: inline-block; padding: 0.15rem 0.55rem; border-radius: var(--t-radius-pill); font-size: 0.68rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; }
.cert-verify-tier-badge[data-tier="foundation"] { background: var(--tier-foundation-bg); color: var(--tier-foundation); }
.cert-verify-tier-badge[data-tier="core"] { background: var(--tier-core-bg); color: var(--tier-core); }
.cert-verify-tier-badge[data-tier="advanced"] { background: var(--tier-advanced-bg); color: var(--tier-advanced); }
.cert-verify-actions { display: flex; gap: 0.6rem; margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--t-border); justify-content: center; flex-wrap: wrap; }
.cert-verify-not-found { max-width: 30rem; margin: 0 auto; text-align: center; padding: 1.5rem; color: var(--t-text-muted); font-size: 0.9rem; }
.cert-verify-not-found-icon { color: var(--t-text-muted); margin-bottom: 0.5rem; }
.cert-verify-not-found-icon .material-symbols-rounded { font-size: 44px; }

/* ── Profile view ─────────────────────────────────────────── */
.cert-verify-profile { max-width: 40rem; margin: 1.5rem auto 0; }
.cert-verify-profile-header { text-align: center; margin-bottom: 1.5rem; }
.cert-verify-profile-name { font-size: 1.35rem; font-weight: 800; color: var(--t-text); }
.cert-verify-profile-count { font-size: 0.85rem; color: var(--t-text-muted); margin-top: 0.25rem; }
.cert-verify-profile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: 0.75rem; }
.cert-verify-profile-card { background: var(--t-bg); border: 1px solid var(--t-border); border-radius: var(--t-radius-md); padding: 1.1rem; box-shadow: var(--t-shadow-sm); transition: box-shadow 150ms, transform 150ms; }
.cert-verify-profile-card:hover { box-shadow: var(--t-shadow-md); transform: translateY(-2px); }
.cert-verify-profile-card-name { font-size: 0.95rem; font-weight: 700; color: var(--t-text); margin-bottom: 0.3rem; display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.cert-verify-profile-card-meta { font-size: 0.78rem; color: var(--t-text-muted); }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 48rem) {
  .cert-verify-form { flex-direction: column; }
  .cert-verify-body { padding: 0.75rem 1.25rem 1.25rem; }
  .cert-verify-profile-grid { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════════════════════
   Step 29: Exam Blueprint & Study Plan
   ══════════════════════════════════════════════════════════ */

/* ── Loading / error states ── */
.cert-bp-loading {
    text-align: center;
    padding: 4rem;
    color: #6b7280;
}

.cert-bp-error {
    max-width: 480px;
    margin: 4rem auto;
    text-align: center;
    padding: 2rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
}

/* ── Hero ── */
.cert-bp-hero {
    text-align: center;
    margin-bottom: 1.5rem;
}

/* ── Stats row ── */
.cert-bp-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2rem;
}

/* ── "Exam at a glance" panel: question-type matrix + fact cells ── */
.cert-bp-glance {
    width: 100%;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    display: grid;
    grid-template-columns: 1.7fr 1fr 1fr;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.03);
}

.cert-bp-matrix {
    grid-row: span 2;
    border-right: 1px solid #e5e7eb;
    padding: 1rem 1.15rem;
    background: #E0F5F5;
}

.cert-bp-matrix-title {
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #9ca3af;
    margin-bottom: 0.6rem;
}

.cert-bp-mtab {
    width: 100%;
    border-collapse: collapse;
}

    .cert-bp-mtab th,
    .cert-bp-mtab td {
        text-align: center;
        padding: 0.35rem 0.25rem;
        font-size: 0.82rem;
    }

    .cert-bp-mtab thead th {
        font-size: 0.58rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.03em;
        color: #9ca3af;
        border-bottom: 1px solid #e5e7eb;
    }

    .cert-bp-mtab tbody th {
        text-align: left;
        font-size: 0.6rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.03em;
        color: #6b7280;
    }

    .cert-bp-mtab tbody td {
        font-weight: 800;
        color: #007B79;
    }

.cert-bp-matrix-foot {
    font-size: 0.72rem;
    color: #6b7280;
    margin-top: 0.6rem;
}

.cert-bp-gcell {
    padding: 0.9rem 1.05rem;
    border-right: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

    .cert-bp-gcell.nr { border-right: none; }
    .cert-bp-gcell.nb { border-bottom: none; }

.cert-bp-glabel {
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #9ca3af;
}

.cert-bp-gval {
    font-size: 1.3rem;
    font-weight: 800;
    color: #007B79;
    margin: 0.15rem 0 0.1rem;
}

.cert-bp-gsub {
    font-size: 0.72rem;
    color: #6b7280;
    line-height: 1.35;
}

@media (max-width: 640px) {
    .cert-bp-glance { grid-template-columns: 1fr; }
    .cert-bp-matrix { grid-row: auto; border-right: none; border-bottom: 1px solid #e5e7eb; }
    .cert-bp-glance .cert-bp-gcell { border-right: none; border-bottom: 1px solid #e5e7eb; }
    .cert-bp-glance .cert-bp-gcell:last-child { border-bottom: none; }
}

/* ── Readiness card ── */
.cert-bp-readiness-card {
    display: flex;
    align-items: center;
    gap: 2rem;
    justify-content: center;
    flex-wrap: wrap;
    background: linear-gradient(135deg, #EFF6E9, #E4F0DA);
    border: 1px solid #D8E4CB;
    border-radius: 14px;
    padding: 1.5rem 2rem;
    margin-bottom: 2rem;
}

.cert-bp-readiness-score {
    text-align: center;
}

.cert-bp-readiness-ring {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.5rem;
}

    .cert-bp-readiness-ring span {
        background: #fff;
        width: 60px;
        height: 60px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.1rem;
        font-weight: 800;
        color: #374151;
    }

.cert-bp-readiness-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #007B79;
}

.cert-bp-readiness-breakdown {
    font-size: 0.82rem;
    color: #374151;
}

.cert-bp-rb-row {
    display: flex;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 0.25rem 0;
    border-bottom: 1px solid rgba(126,34,206,0.1);
}

    .cert-bp-rb-row:last-child {
        border-bottom: none;
    }

    .cert-bp-rb-row span:last-child {
        font-weight: 600;
        color: #007B79;
    }

/* ── Domain sections ── */
/* ── Blueprint index (directory of exams shown at /blueprint/ with no params) ── */
.cert-bp-idx-toggle {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.82rem;
    color: #4b5563;
    cursor: pointer;
}

    .cert-bp-idx-toggle input {
        accent-color: #007B79;
    }

.cert-bp-idx-count {
    font-size: 0.8rem;
    color: #6b7280;
    margin: 0 0 0.75rem;
}

.cert-bp-index {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 0.75rem;
    margin: 0 0 2rem;
}

.cert-bp-idx-card {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    padding: 0.85rem 1rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    text-decoration: none;
    box-shadow: 0 1px 4px rgba(0,0,0,0.03);
    transition: border-color 150ms, box-shadow 150ms;
}

    .cert-bp-idx-card:hover {
        border-color: #91DBDA;
        box-shadow: 0 2px 8px rgba(126,34,206,0.08);
    }

.cert-bp-idx-top {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cert-bp-idx-name {
    flex: 1;
    font-size: 0.9rem;
    font-weight: 700;
    color: #1f2937;
}

.cert-bp-idx-arrow {
    font-size: 18px;
    color: #007B79;
}

.cert-bp-idx-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.cert-bp-idx-b {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
}

    .cert-bp-idx-b.core { background: color-mix(in srgb, #91DBDA 22%, transparent); color: #007B79; }
    .cert-bp-idx-b.adv { background: color-mix(in srgb, #8F4764 14%, transparent); color: #8F4764; }
    .cert-bp-idx-b.fnd { background: color-mix(in srgb, #7DDD3D 16%, transparent); color: #197050; }
    .cert-bp-idx-b.role { background: color-mix(in srgb, #717863 16%, transparent); color: #5c6356; }
    .cert-bp-idx-b.ready { background: #dcfce7; color: #15803d; }
    .cert-bp-idx-b.soon { background: #f3f4f6; color: #6b7280; }
    .cert-bp-idx-b.closed { background: #fee2e2; color: #b91c1c; }

.cert-bp-idx-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: #6b7280;
    font-size: 0.9rem;
    padding: 2rem;
}

/* ── Role tab selector (reuses .ec-chip for the chips themselves) ── */
.cert-bp-roletabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

/* Disabled role tabs (exam not active / not yet available / closed) */
.cert-bp-roletabs .ec-chip.disabled,
.cert-bp-roletabs .ec-chip:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    background: #f9fafb;
    color: #9ca3af;
    border-color: #e5e7eb;
}

    .cert-bp-roletabs .ec-chip.disabled:hover,
    .cert-bp-roletabs .ec-chip:disabled:hover {
        background: #f9fafb;
        color: #9ca3af;
        border-color: #e5e7eb;
    }

.cert-bp-tab-note {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-left: 0.4rem;
    padding: 0.05rem 0.35rem;
    border-radius: 999px;
    background: #e5e7eb;
    color: #6b7280;
    vertical-align: middle;
}

.cert-bp-rolehint {
    background: linear-gradient(180deg, #E0F5F5 0%, #F4FBFB 100%);
    border: 1px solid #B7E4E3;
    border-left: 3px solid #91DBDA;
    border-radius: 10px;
    padding: 1rem 1.2rem;
    margin-bottom: 1.25rem;
}

.cert-bp-rolehint-eyebrow {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #007B79;
    margin-bottom: 0.25rem;
}

.cert-bp-rolehint-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: #007B79;
    line-height: 1.2;
}

.cert-bp-rolehint-tag {
    font-size: 0.85rem;
    font-style: italic;
    color: #007B79;
    margin-top: 0.15rem;
}

.cert-bp-rolehint-desc {
    font-size: 0.86rem;
    color: #4b5563;
    line-height: 1.55;
    margin: 0.65rem 0 0.75rem;
}

.cert-bp-rolehint-who {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
}

.cert-bp-rolehint-who-lbl {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #9ca3af;
    margin-right: 0.2rem;
}

.cert-bp-rolehint-chip {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    background: #fff;
    border: 1px solid #B7E4E3;
    color: #007B79;
}

/* ── "Topics covered" feature chips ── */
.cert-bp-topics {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.3rem;
    margin-bottom: 0.75rem;
}

.cert-bp-topics-lbl {
    font-size: 0.78rem;
    font-weight: 600;
    color: #6b7280;
    margin-right: 0.15rem;
}

.cert-bp-topic {
    font-size: 0.7rem;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    background: #E4F0DA;
    color: #197050;
    border: 1px solid #D8E4CB;
    white-space: nowrap;
}

    .cert-bp-topic.cert-bp-topic-extra {
        display: none;
    }

    .cert-bp-topics.expanded .cert-bp-topic-extra {
        display: inline-block;
    }

.cert-bp-topic-toggle {
    font-size: 0.7rem;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    background: #fff;
    color: #007B79;
    border: 1px dashed #91DBDA;
    cursor: pointer;
    font-weight: 600;
}

    .cert-bp-topic-toggle:hover {
        background: #E0F5F5;
    }

.cert-bp-domain {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.03);
}

.cert-bp-domain-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.cert-bp-domain-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1f2937;
}

.cert-bp-domain-meta {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.cert-bp-badge {
    font-size: 0.7rem;
    padding: 0.15rem 0.5rem;
    background: #f3f4f6;
    border-radius: 4px;
    color: #6b7280;
    font-weight: 600;
    white-space: nowrap;
}

.cert-bp-bar {
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.cert-bp-bar-fill {
    height: 100%;
    background: #007B79;
    border-radius: 3px;
    transition: width 600ms ease;
}

/* ── Tagged pages ── */
.cert-bp-pages {
    margin-top: 0.25rem;
}

.cert-bp-pages-lbl {
    font-size: 0.78rem;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 0.35rem;
}

.cert-bp-pg-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.5rem;
    border-radius: 6px;
    text-decoration: none;
    color: #374151;
    font-size: 0.82rem;
    transition: background 150ms;
}

    .cert-bp-pg-link:hover {
        background: #f9fafb;
    }

.cert-bp-pg-title {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #007B79;
}

.cert-bp-type {
    font-size: 0.65rem;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    background: #E0F5F5;
    color: #007B79;
    font-weight: 600;
    text-transform: capitalize;
    white-space: nowrap;
}

    .cert-bp-type[data-type="learning-path"] {
        background: #d1fae5;
        color: #065f46;
    }

    .cert-bp-type[data-type="tutorial"] {
        background: #dbeafe;
        color: #1e40af;
    }

    .cert-bp-type[data-type="concept"] {
        background: #fef3c7;
        color: #92400e;
    }

    .cert-bp-type[data-type="guide"] {
        background: #fce7f3;
        color: #9d174d;
    }

.cert-bp-pg-time {
    font-size: 0.68rem;
    color: #9ca3af;
    white-space: nowrap;
}

.cert-bp-no-content {
    font-size: 0.82rem;
    color: #9ca3af;
    font-style: italic;
    margin: 0.5rem 0;
}

/* ── Actions ── */
.cert-bp-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    margin: 2rem 0;
}

/* Blueprint CTAs use the standard .btn system (btn--primary / btn--dark-stroke). */

/* ── Readiness badge (catalog cards + registration) ── */
.ce-readiness {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
    font-size: 0.82rem;
    color: #6b7280;
    margin: 0.5rem 0;
    padding: 0.4rem 0.75rem;
    background: #E0F5F5;
    border: 1px solid #B7E4E3;
    border-radius: 8px;
}

.ce-readiness-label {
    font-weight: 600;
}

.ce-readiness-value {
    font-size: 0.95rem;
}

.ce-readiness-link {
    font-size: 0.78rem;
    color: #007B79;
    text-decoration: none;
    margin-left: auto;
}

.ce-readiness-link:hover {
    text-decoration: underline;
}

/* ── Remediation plan (fail results) ── */
.cert-remediation-domain {
    margin-bottom: 1rem;
}

.cert-remediation-domain-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #b91c1c;
    margin-bottom: 0.35rem;
}

.cert-remediation-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.cert-remediation-list li {
    padding: 0.3rem 0;
}

.cert-remediation-list a {
    font-size: 0.82rem;
    color: #007B79;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.cert-remediation-list a:hover {
    text-decoration: underline;
}

.cert-remediation-type {
    font-size: 0.62rem;
    padding: 0.08rem 0.3rem;
    background: #f3f4f6;
    border-radius: 3px;
    color: #6b7280;
}

/* ═══════════════════════════════════════════════════════════
   LEADERBOARD PAGE
   ═══════════════════════════════════════════════════════════ */

/* ── Medal color tokens ──────────────────────────────────── */
.cert-page {
  --lb-gold: #d4a017; --lb-gold-bg: linear-gradient(135deg, #fef9e7 0%, #fff8e1 100%); --lb-gold-tint: rgba(212,160,23,0.06);
  --lb-silver: #9ca3af; --lb-silver-bg: linear-gradient(135deg, #f3f4f6 0%, #f9fafb 100%); --lb-silver-tint: rgba(156,163,175,0.06);
  --lb-bronze: #cd7f32; --lb-bronze-bg: linear-gradient(135deg, #fef3e2 0%, #fff8f0 100%); --lb-bronze-tint: rgba(205,127,50,0.06);
}
:root[data-theme="dark"] .cert-page {
  --lb-gold: #fbbf24; --lb-gold-bg: linear-gradient(135deg, #2a2215 0%, #332a1a 100%); --lb-gold-tint: rgba(251,191,36,0.08);
  --lb-silver: #d1d5db; --lb-silver-bg: linear-gradient(135deg, #1f2937 0%, #252f3d 100%); --lb-silver-tint: rgba(209,213,219,0.06);
  --lb-bronze: #f59e0b; --lb-bronze-bg: linear-gradient(135deg, #2a1f15 0%, #33261a 100%); --lb-bronze-tint: rgba(245,158,11,0.06);
}

/* ── Tab Bar (updated to underline style matching prototype) ── */
.lb-tab-bar {
  display: flex; gap: 0; border-bottom: 1px solid var(--t-border); margin-bottom: 1.25rem;
}
.lb-tab {
  display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.7rem 1rem;
  font-size: 14px; font-weight: 500; color: var(--t-text-muted);
  border: none; border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer;
  background: none; font-family: inherit; transition: color 150ms;
}
.lb-tab .material-symbols-rounded { font-size: 18px; }
.lb-tab-icon { display: none; }
.lb-tab-label { font-size: 14px; font-weight: 500; }
.lb-tab:hover { color: var(--t-text); }
.lb-tab.active { color: var(--t-text); border-bottom-color: var(--t-primary); font-weight: 600; }
.lb-tab.active .lb-tab-label { font-weight: 600; }

/* ── Panels (legacy — old leaderboard, kept for non-migrated pages) ── */
.lb-panel > .cert-filter-bar {
  border-top: none;
  border-radius: 0;
  margin-top: -1.5px;
}

/* ── Select (dropdown) ───────────────────────────────────── */
.lb-select {
  padding: 0.45rem 0.75rem; margin: 0; border: 1px solid var(--t-border);
  border-radius: var(--t-radius-sm); font-size: 0.875rem; color: var(--t-text);
  background: var(--t-bg); outline: none; cursor: pointer; min-width: 160px;
  transition: border-color 150ms; height: 2.25rem; box-sizing: border-box;
  font-family: inherit;
}
.lb-select:focus { border-color: var(--t-primary); outline: 2px solid var(--t-border-focus); outline-offset: 1px; }

/* ── Podium (updated to prototype style) ──────────────── */
.lb-podium {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0.875rem;
  margin-bottom: 1.25rem; align-items: end;
}
.lb-podium-card {
  text-align: center; padding: 1.25rem 1.1rem 1.1rem; box-sizing: border-box;
  border-radius: var(--t-radius-sm); border: 1px solid var(--t-border);
  background: var(--t-bg); transition: transform 200ms, box-shadow 200ms;
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 0.35rem;
}
.lb-podium-card:hover { transform: translateY(-2px); box-shadow: var(--t-shadow-md); }
.lb-podium-card[data-place="1"] {
  border-color: color-mix(in srgb, var(--t-accent-3) 55%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--t-accent-3) 30%, transparent);
  padding-top: 1.75rem; order: 2;
}
.lb-podium-card[data-place="2"] { order: 1; }
.lb-podium-card[data-place="3"] { order: 3; }
.lb-podium-medal { margin-bottom: 0.35rem; display: block; line-height: 1; }
.lb-medal-circle {
  width: 46px; height: 46px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--t-font-headline); font-weight: 900; font-size: 18px; color: #fff;
}
.lb-medal-circle.p1 { background: #d4a017; color: #fff; }
.lb-medal-circle.p2 { background: #9ca3af; color: #fff; }
.lb-medal-circle.p3 { background: #8b5e3c; color: #fff; }
.lb-crown { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); }
.lb-podium-name { font-size: 0.94rem; font-weight: 600; line-height: 1.2; }
.lb-podium-company { font-size: 0.75rem; color: var(--t-text-muted); line-height: 1.3; min-height: 1.3em; }
.lb-podium-stats { display: flex; flex-direction: row; gap: 1rem; align-items: flex-start; justify-content: center; margin-top: 0.25rem; }
.lb-podium-stat { font-size: 0.78rem; color: var(--t-text-secondary); text-align: center; }
.lb-podium-stat strong { font-family: var(--t-font-headline); font-weight: 900; font-size: 1.5rem; display: block; }
.lb-podium-stat small { font-family: var(--t-font-mono); font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--t-text-muted); }
.lb-podium-badge { margin-top: 0.4rem; }

/* ── Table ───────────────────────────────────────────────── */
.lb-table-wrap {
  overflow-x: auto; margin-bottom: 1.5rem;
  border-radius: var(--t-radius-sm); border: 1px solid var(--t-border);
  background: var(--t-bg);
}
/* min-width makes .lb-table-wrap's overflow-x:auto actually scroll on phones
   instead of crushing 6–9 columns into an unreadable width. */
.lb-table { width: 100%; min-width: 640px; border-collapse: collapse; font-size: 13px; }
.lb-table th {
  text-align: left; padding: 0.7rem 1.1rem; font-family: var(--t-font-mono); font-size: 11px;
  color: var(--t-text-muted); font-weight: 400; text-transform: uppercase; letter-spacing: 0.06em;
  border-bottom: 1px solid var(--t-border);
}
.lb-table td {
  padding: 0.75rem 1.1rem; border-bottom: 1px solid var(--t-border);
  color: var(--t-text); vertical-align: middle;
}
.lb-table tbody tr:last-child td { border-bottom: 0; }
.lb-table tbody tr:hover { background: var(--t-surface); }
.lb-th-rank { width: 48px; text-align: center; }

/* ── Column-header tooltips (ODR-237) ────────────────────── */
.lb-th-info {
  position: relative; display: inline-flex; align-items: center;
  margin-left: 0.25rem; padding: 0; border: 0; background: none;
  color: var(--t-text-muted); cursor: help; vertical-align: middle; line-height: 0;
}
.lb-th-info:hover, .lb-th-info:focus-visible { color: var(--t-primary-text); }
.lb-th-info:focus-visible { outline: 2px solid var(--t-primary-text); outline-offset: 2px; border-radius: 50%; }
.lb-th-info-icon { font-size: 14px; }
.lb-th-tip {
  position: absolute; top: calc(100% + 6px); left: 0;
  width: max-content; max-width: 220px;
  padding: 0.5rem 0.6rem; border-radius: var(--t-radius-sm, 6px);
  background: var(--t-text, #1a1a1a); color: var(--t-bg, #fff);
  font-family: var(--t-font-sans, system-ui, sans-serif); font-size: 11px; line-height: 1.4;
  font-weight: 400; text-transform: none; letter-spacing: normal; white-space: normal; text-align: left;
  box-shadow: 0 4px 14px rgba(0,0,0,0.18);
  opacity: 0; visibility: hidden; transform: translateY(-2px);
  transition: opacity 120ms ease, transform 120ms ease;
  z-index: 20; pointer-events: none;
}
.lb-th-info--right .lb-th-tip { left: auto; right: 0; }
.lb-th-info:hover .lb-th-tip, .lb-th-info:focus-visible .lb-th-tip { opacity: 1; visibility: visible; transform: translateY(0); }

/* ── Row styles ──────────────────────────────────────────── */
.lb-row { cursor: pointer; }
.lb-row.lb-you { background: var(--t-accent-1-bg) !important; }
.lb-row.lb-you td { font-weight: 600; color: var(--t-primary-text); }
.lb-row.lb-search-hit td { background: var(--cert-amber-50, #fffbeb); }
.lb-row.lb-search-hit td:first-child { box-shadow: inset 3px 0 0 var(--cert-amber-500, #f59e0b); }
:root[data-theme="dark"] .lb-row.lb-search-hit td { background: rgba(245,158,11,0.15); }

/* ── Rank cell ───────────────────────────────────────────── */
.lb-rank-cell {
  text-align: center; font-weight: 800; font-size: 0.78rem;
}
.lb-rank-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--t-surface-raised); color: var(--t-text-muted);
  font-size: 0.72rem; font-weight: 800;
}

/* ── Top 3 highlighted rows ──────────────────────────────── */
.lb-row[data-place="1"] td { background: rgba(212,160,23,0.06); }
.lb-row[data-place="1"] td:first-child { border-left: 3px solid #d4a017; }
.lb-row[data-place="1"] .lb-rank-num { background: #d4a017; color: #fff; }

.lb-row[data-place="2"] td { background: rgba(156,163,175,0.06); }
.lb-row[data-place="2"] td:first-child { border-left: 3px solid #9ca3af; }
.lb-row[data-place="2"] .lb-rank-num { background: #9ca3af; color: #fff; }

.lb-row[data-place="3"] td { background: rgba(139,94,60,0.06); }
.lb-row[data-place="3"] td:first-child { border-left: 3px solid #8b5e3c; }
.lb-row[data-place="3"] .lb-rank-num { background: #8b5e3c; color: #fff; }

.lb-row[data-place="1"]:hover td { background: rgba(212,160,23,0.1); }
.lb-row[data-place="2"]:hover td { background: rgba(156,163,175,0.1); }
.lb-row[data-place="3"]:hover td { background: rgba(139,94,60,0.1); }

/* ── Expand row ──────────────────────────────────────────── */
.lb-expand-row td { padding: 0 !important; border-bottom: 2px solid var(--cert-gray-200); }
.lb-expand-content {
  padding: 1rem 1.5rem; background: var(--cert-gray-50);
  border-top: 1px dashed var(--cert-gray-200);
}
.lb-expand-toggle {
  background: none; border: none; cursor: pointer; font-size: 0.85rem;
  color: var(--cert-gray-400); padding: 0.2rem 0.5rem; transition: transform 200ms;
}
.lb-expand-toggle:hover { color: var(--cert-green-500); }
.lb-expand-toggle.open { transform: rotate(90deg); }

/* ── Heatmap (org expand) ────────────────────────────────── */
.lb-heatmap { margin-bottom: 0.75rem; }
.lb-heatmap table { width: 100%; border-collapse: collapse; font-size: 0.72rem; }
.lb-heatmap th {
  padding: 0.3rem 0.5rem; font-size: 0.62rem; font-weight: 700;
  color: var(--cert-gray-400); text-transform: uppercase; text-align: center;
}
.lb-heatmap td {
  padding: 0.3rem 0.5rem; text-align: center; border-radius: 3px; font-weight: 600;
}
.lb-heatmap td.empty { color: var(--cert-gray-300); }
.lb-heatmap .lb-hm-track { text-align: left; font-weight: 600; color: var(--cert-gray-700); white-space: nowrap; }

/* ── Meta-credential summary ─────────────────────────────── */
.lb-meta-summary {
  display: flex; gap: 1rem; flex-wrap: wrap; font-size: 0.78rem; font-weight: 600;
}
.lb-meta-summary span { display: inline-flex; align-items: center; gap: 0.3rem; }

/* ── Individual badge grid ───────────────────────────────── */
.lb-badge-grid { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.lb-badge {
  font-size: 0.62rem; font-weight: 700; padding: 0.15rem 0.5rem; border-radius: 3px;
  color: #fff; white-space: nowrap;
}

/* ── Delta indicator ─────────────────────────────────────── */
.lb-delta { font-size: 0.78rem; font-weight: 700; }
.lb-delta.up { color: var(--cert-green-600); }
.lb-delta.down { color: var(--cert-red-500); }
.lb-delta.flat { color: var(--cert-gray-400); }

/* ── Your Stats Banner (above tabs) ─────────────────────── */
.lb-your-stats {
  display: flex; align-items: center; gap: 1rem;
  background: var(--t-accent-1-bg); border: 1px solid var(--t-primary);
  border-radius: var(--t-radius-sm); padding: 0.85rem 1.25rem;
  margin-bottom: 1.25rem;
}
.lb-your-stats:empty { display: none; }
.lb-stats-row {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
}
.lb-stats-cta {
  font-size: 0.78rem; font-weight: 700; color: var(--cert-green-700);
  text-decoration: none; white-space: nowrap;
}
.lb-stats-cta:hover { text-decoration: underline; }
.lb-stats-anon-text { font-size: 0.82rem; color: var(--cert-gray-500); }
.lb-your-stats--anon .lb-stats-row { justify-content: space-between; }

/* ── Bar Charts (role / industry comparison) ─────────────── */
.lb-bar-chart { max-width: 32rem; }
.lb-bar-row { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.5rem; }
.lb-bar-label {
  min-width: 7.5rem; font-size: 0.78rem; font-weight: 600; color: var(--cert-gray-700);
  text-align: right; white-space: nowrap;
}
.lb-bar-label.is-you { color: var(--cert-green-700); }
.lb-bar-track { flex: 1; height: 14px; background: var(--cert-gray-100); border-radius: 7px; overflow: hidden; }
.lb-bar-fill { height: 100%; border-radius: 7px; transition: width 600ms ease; background: var(--cert-green-500); }
.lb-bar-fill.highlight { background: var(--cert-green-600); }
.lb-bar-fill.muted { background: var(--cert-gray-300); }
.lb-bar-value { min-width: 3rem; font-size: 0.78rem; font-weight: 700; color: var(--cert-gray-700); }
.lb-bar-n { font-size: 0.68rem; color: var(--cert-gray-400); margin-left: 0.25rem; }


/* ── Section subtitle (within tabs) ──────────────────────── */
.lb-section-title { font-size: 1rem; font-weight: 800; color: var(--cert-gray-800); margin: 1.75rem 0 0.35rem; text-align: center; }
.lb-section-sub { font-size: 0.8rem; color: var(--cert-gray-400); text-align: center; margin-bottom: 1.25rem; }

/* ── Pagination ─────────────────────────────────────────── */
.lb-pagination {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.5rem; padding: 1rem 0; flex-wrap: wrap;
}
.lb-page-info {
  font-size: 0.81rem; color: var(--t-primary-text); font-weight: 500;
}
.lb-page-nums { display: flex; align-items: center; gap: 0.3rem; }
.lb-page-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 2rem; height: 2rem; padding: 0 0.5rem;
  border: 1px solid var(--t-border); border-radius: var(--t-radius-sm);
  background: var(--t-bg); color: var(--t-text-secondary);
  font-size: 0.81rem; font-weight: 600; cursor: pointer;
  transition: all 150ms; font-family: var(--t-font-mono);
}
.lb-page-btn:hover:not(:disabled):not(.active) {
  border-color: var(--t-primary); color: var(--t-text);
  background: var(--t-surface);
}
.lb-page-btn.active {
  border-color: var(--t-secondary); background: var(--t-secondary);
  color: #fff; cursor: default;
}
.lb-page-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.lb-page-prev, .lb-page-next { font-weight: 700; font-size: 0.875rem; }
.lb-page-ellipsis {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2rem; height: 2rem; color: var(--t-text-muted);
  font-size: 0.82rem; user-select: none;
}

/* ── Dark theme ──────────────────────────────────────────── */
:root[data-theme="dark"] .lb-tab { background: var(--cert-gray-50); border-color: var(--cert-gray-300); }
:root[data-theme="dark"] .lb-tab:hover { color: var(--cert-green-500); background: var(--cert-gray-100); border-color: var(--cert-green-500); }
:root[data-theme="dark"] .lb-tab.active { color: var(--cert-green-500); background: var(--cert-gray-100); border-color: var(--cert-green-500); border-bottom-color: var(--cert-gray-100); }
:root[data-theme="dark"] .lb-panel > .cert-filter-bar { background: var(--cert-gray-100); }
:root[data-theme="dark"] .lb-table-wrap { border-color: var(--cert-gray-300); }
:root[data-theme="dark"] .lb-table th { background: var(--cert-gray-100); border-bottom-color: var(--cert-gray-300); }
:root[data-theme="dark"] .lb-table td { border-bottom-color: var(--cert-gray-200); }
:root[data-theme="dark"] .lb-row:hover td { background: var(--cert-gray-100); }
:root[data-theme="dark"] .lb-row.lb-you { background: var(--cert-green-50); }
:root[data-theme="dark"] .lb-row.lb-you td { color: var(--cert-green-500); }
:root[data-theme="dark"] .lb-expand-content { background: var(--cert-gray-100); border-top-color: var(--cert-gray-300); }
:root[data-theme="dark"] .lb-your-stats { border-color: var(--cert-green-500); }
:root[data-theme="dark"] .lb-bar-track { background: var(--cert-gray-200); }
:root[data-theme="dark"] .lb-podium-card { background: var(--cert-gray-50); }
:root[data-theme="dark"] .lb-podium-card[data-place="1"] { box-shadow: 0 6px 24px rgba(251,191,36,0.12); }
:root[data-theme="dark"] .lb-rank-num { background: var(--cert-gray-200); }
/* dark mode pagination handled by --t-* tokens in main rules */

/* ── 2024 theme overrides ── */
:root[data-ods-theme="2024"] .lb-your-stats,
:root[data-ods-theme="2024"] .lb-yourrank { background: rgba(25, 75, 255, 0.08); border-color: var(--t-primary); }
:root[data-ods-theme="2024"] .lb-row.lb-you { background: rgba(25, 75, 255, 0.06) !important; }
:root[data-ods-theme="2024"] .lb-row.lb-you td { color: var(--t-primary) !important; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 48rem) {
  .lb-tab { padding: 0.5rem 0.35rem; }
  .lb-tab-label { font-size: 0.7rem; }
  /* Compact 3-up podium on mobile — smaller side-by-side cards instead of big
     stacked ones. Keeps the desktop 2·1·3 order (winner centred + raised). */
  .lb-podium { grid-template-columns: repeat(3, 1fr); gap: 0.5rem; align-items: stretch; }
  .lb-podium-card { padding: 0.7rem 0.35rem; height: auto !important; min-width: 0; gap: 0.2rem; }
  .lb-podium-card[data-place="1"] { padding-top: 1.2rem; }
  .lb-medal-circle { width: 34px; height: 34px; font-size: 14px; }
  .lb-podium-name { font-size: 0.72rem; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .lb-podium-company { font-size: 0.6rem; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .lb-podium-stats { gap: 0.4rem; margin-top: 0.15rem; }
  .lb-podium-stat strong { font-size: 1.05rem; }
  .lb-podium-stat small { font-size: 0.55rem; }
  .lb-crown { top: -9px; }
  .lb-crown .material-symbols-rounded { font-size: 16px !important; }
  .lb-stats-row { gap: 0.75rem; }
  .lb-bar-label { min-width: 5.5rem; font-size: 0.72rem; }
  /* Centre the pager and enlarge tap targets ~50% for easier interaction. */
  .lb-pagination { gap: 0.4rem; justify-content: center; }
  .lb-page-nums { justify-content: center; width: 100%; gap: 0.4rem; }
  .lb-page-btn { min-width: 2.6rem; height: 2.6rem; font-size: 0.95rem; }
  .lb-page-ellipsis { width: 2.6rem; height: 2.6rem; }
  .lb-page-info { display: block; width: 100%; text-align: center; margin-left: 0; margin-top: 0; margin-bottom: 0.5rem; order: -1; }
}
@media (max-width: 30rem) {
  .lb-tab-bar { flex-wrap: wrap; }
  .lb-tab { padding: 0.45rem 0.35rem; }
  .lb-tab-label { font-size: 0.68rem; }
  .lb-your-stats { padding: 0.6rem 1rem; }
  .lb-podium-card { padding: 1rem 0.75rem; }
}

/* ══════════════════════════════════════════════════════════
   HOME — Launcher + Chat
   ══════════════════════════════════════════════════════════ */

.home-stage {
  overflow: auto; display: flex; flex-direction: column; align-items: center;
  height: 100%;
}

/* ── Launcher ── */
.home-launcher {
  width: 100%; max-width: 760px; box-sizing: border-box; padding: 40px 24px; margin: auto;
  display: flex; flex-direction: column; align-items: center;
}

.home-greet {
  text-align: center; margin-bottom: 30px;
  display: flex; flex-direction: column; align-items: center;
}

.home-spark {
  width: 46px; height: 46px; border-radius: var(--t-radius-md, 8px);
  background: linear-gradient(135deg, var(--t-primary), var(--t-secondary));
  display: flex; align-items: center; justify-content: center;
  color: #fff; margin-bottom: 22px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}
.home-spark .material-symbols-rounded { font-size: 26px; }

.home-hi {
  font-size: 14px; font-weight: 500;
  color: var(--t-text-muted); display: none;
}

.home-greet h1 {
  font-family: var(--t-font-heading, var(--t-font));
  font-weight: 900; font-size: 46px; line-height: 1.5;
  letter-spacing: -0.03em; margin: 8px 0 0;
  background: linear-gradient(135deg, var(--t-primary), var(--t-secondary));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.home-tag {
  font-size: 15px; color: var(--t-text-muted); margin-top: 12px;
}

/* ── Search bar ── */
.home-searchbar {
  width: 100%; box-sizing: border-box; display: flex; align-items: center; gap: 12px;
  background: #fff; border: 1px solid var(--t-border);
  border-radius: var(--t-radius-sm, 4px);
  padding: 6px 6px 6px 18px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.home-searchbar:focus-within {
  border-color: var(--t-primary);
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}
.home-search-icon {
  font-size: 22px; color: var(--t-text-muted); flex: none;
}
.home-searchbar input {
  flex: 1; border: 0; outline: 0; background: transparent;
  font: inherit; font-size: 16px; color: var(--t-text);
  padding: 8px 0; min-width: 0;
}
.home-searchbar input::placeholder { color: var(--t-text-muted); }

.home-send-btn {
  flex: none; width: 44px; height: 44px;
  border-radius: var(--t-radius-sm, 4px); border: 0; cursor: pointer;
  background: linear-gradient(135deg, var(--t-primary), var(--t-secondary));
  color: #fff; display: flex; align-items: center; justify-content: center;
  transition: opacity 0.15s;
}
.home-send-btn:hover { opacity: 0.9; }
.home-send-btn:disabled {
  background: var(--t-surface-alt); color: var(--t-text-muted);
  cursor: not-allowed;
}
.home-send-btn .material-symbols-rounded { font-size: 22px; }

/* ── Suggestions ── */
.home-suggest {
  width: 100%; margin-top: 22px;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.home-suggest-label {
  font-family: var(--t-font-mono, monospace);
  font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--t-text-muted);
}
.home-suggest-chips {
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: center;
}
.home-sg {
  font-size: 13px; padding: 9px 16px;
  border-radius: var(--t-radius-pill, 999px);
  border: 1px dashed var(--t-border); background: transparent;
  color: var(--t-text-muted); cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.home-sg:hover {
  border-style: solid; border-color: var(--t-primary);
  color: var(--t-text); background: var(--t-surface);
}

/* ── Quick links ── */
.home-quicklinks {
  display: flex; flex-wrap: wrap; gap: 10px;
  justify-content: center; margin-top: 40px;
}
.home-ql {
  display: inline-flex; align-items: center; gap: 8px;
  height: 42px; padding: 0 18px;
  border-radius: var(--t-radius-pill, 999px);
  border: 1px solid var(--t-border); background: #fff;
  font-size: 14px; font-weight: 500; color: var(--t-text);
  cursor: pointer; text-decoration: none;
  transition: all 0.15s;
}
.home-ql:hover {
  background: var(--t-surface-alt);
  border-color: var(--t-primary);
  transform: translateY(-1px);
}
.home-ql .material-symbols-rounded { color: var(--t-text-muted); }

/* ── Chat ── */
.home-chat {
  width: 100%; max-width: 760px; box-sizing: border-box; padding: 28px 24px 140px;
  display: none; flex-direction: column; gap: 20px;
}

.home-chat-head {
  display: flex; align-items: center; gap: 10px; margin-bottom: 4px;
}
.home-chat-head .home-badge { margin-right: auto; }
.home-chat-head #homeNewChat { margin-left: auto; }

.home-badge {
  display: inline-flex; align-items: center;
  font-size: 12px; font-weight: 600;
  padding: 4px 10px; border-radius: var(--t-radius-sm, 4px);
  background: var(--t-surface-alt); color: var(--t-text-muted);
}

/* Messages */
.home-msg { display: flex; gap: 12px; max-width: 100%; margin-bottom: 16px; }
.home-msg-user { justify-content: flex-end; }
.home-msg-ai { align-items: flex-start; }

.home-bubble-user {
  background: var(--t-text); color: var(--t-bg);
  border-radius: 14px 14px 4px 14px;
  padding: 11px 15px; font-size: 14px; max-width: 80%;
}

.home-ai-avatar {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--t-primary), var(--t-secondary));
  color: #fff;
}

.home-bubble-ai {
  background: #fff;
  border: 1px solid var(--t-border);
  border-radius: 4px 14px 14px 14px;
  padding: 14px 16px; font-size: 14px; line-height: 1.55;
  color: var(--t-text); max-width: 88%;
}
.home-bubble-ai b, .home-bubble-ai strong { font-weight: 600; }
.home-bubble-ai p { margin: 0 0 10px; }
.home-bubble-ai p:last-child { margin-bottom: 0; }
.home-bubble-ai ul, .home-bubble-ai ol { margin: 0 0 10px; padding-left: 20px; }
.home-bubble-ai li { margin: 2px 0; }
.home-bubble-ai code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.9em;
  background: var(--t-surface-alt); padding: 1px 5px; border-radius: 4px;
}

/* Markdown tables */
.home-md-tablewrap { overflow-x: auto; margin: 0 0 10px; }
.home-md-table {
  border-collapse: collapse; width: 100%; font-size: 13px; line-height: 1.45;
}
.home-md-table th, .home-md-table td {
  border: 1px solid var(--t-border); padding: 7px 10px; text-align: left; vertical-align: top;
}
.home-md-table th { background: var(--t-surface-alt); font-weight: 600; white-space: nowrap; }
.home-md-table tbody tr:nth-child(even) { background: var(--t-surface); }

/* Answer links */
.home-ans-links {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px;
}
.home-ans-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 500;
  padding: 7px 12px; border-radius: var(--t-radius-sm, 4px);
  border: 1px solid var(--t-border); background: var(--t-surface);
  color: var(--t-secondary); text-decoration: none; cursor: pointer;
}
.home-ans-link:hover { background: var(--t-surface-alt); }

/* Typing animation */
.home-typing {
  display: inline-flex; gap: 4px; align-items: center; padding: 4px 0;
}
.home-typing i {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--t-text-muted);
  animation: homeBlink 1.2s infinite ease-in-out;
}
.home-typing i:nth-child(2) { animation-delay: 0.2s; }
.home-typing i:nth-child(3) { animation-delay: 0.4s; }
@keyframes homeBlink {
  0%, 80%, 100% { opacity: 0.3; } 40% { opacity: 1; }
}

/* Docked input */
.home-dock {
  display: none; position: fixed;
  left: 50%; transform: translateX(-50%);
  bottom: 24px; width: 100%; max-width: 760px; box-sizing: border-box;
  padding: 0 24px; z-index: 5;
}
.home-dock .home-searchbar {
  box-shadow: 0 6px 24px rgba(0,0,0,0.15);
}

/* ── Dark mode ── */
:root[data-theme="dark"] .home-searchbar { background: var(--t-surface); }
:root[data-theme="dark"] .home-ql { background: var(--t-surface); }
:root[data-theme="dark"] .home-bubble-ai { background: var(--t-surface); }
:root[data-theme="dark"] .home-ans-link { color: var(--t-primary); }

/* ── Responsive ── */
@media (max-width: 600px) {
  .home-greet h1 { font-size: 32px; }
  .home-launcher { padding: 28px 16px; }
  .home-quicklinks { gap: 8px; }
  .home-ql { height: 38px; padding: 0 14px; font-size: 13px; }
  .home-chat { padding: 20px 16px 140px; }
}

/* ══════════════════════════════════════════════════════════
   EXAM HISTORY
   ══════════════════════════════════════════════════════════ */

.eh-header { margin-bottom: 4px; }

/* ── Summary cards ── */
.eh-summary {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
}
.eh-card {
  background: #fff; border: 1px solid var(--t-border);
  border-radius: var(--t-radius-sm, 4px); padding: 16px 18px;
  display: flex; flex-direction: column; gap: 6px;
}
.eh-card-top {
  display: flex; align-items: center; gap: 8px;
}
.eh-card-ico {
  width: 30px; height: 30px; border-radius: var(--t-radius-md, 8px);
  display: flex; align-items: center; justify-content: center; flex: none;
}
.eh-card-ico .material-symbols-rounded { font-size: 18px; }
.eh-card-label {
  font-size: 11px; color: var(--t-text-muted); font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.eh-card-value {
  font-family: var(--t-font-headline, var(--t-font));
  font-weight: 900; font-size: 28px; line-height: 1;
  color: var(--t-text); display: flex; align-items: baseline; gap: 4px;
}
.eh-card-value small {
  font-family: var(--t-font); font-size: 13px; font-weight: 500;
  color: var(--t-text-muted);
}
:root[data-theme="dark"] .eh-card { background: var(--t-surface); }

/* ── Controls ── */
.cert-page .eh-controls {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin: 16px 0 8px;
}
.eh-seg {
  display: inline-flex;
  background: color-mix(in srgb, var(--t-primary) 15%, #fff);
  border-radius: var(--t-radius-sm, 4px); padding: 3px; gap: 2px;
}
.eh-seg button {
  border: 0; background: transparent; font: inherit;
  font-size: 13px; font-weight: 500; color: var(--t-text-muted);
  padding: 5px 13px; border-radius: var(--t-radius-sm, 4px); cursor: pointer;
}
.eh-seg button[aria-pressed="true"] {
  background: #fff; color: var(--t-text);
  font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
:root[data-theme="dark"] .eh-seg { background: color-mix(in srgb, var(--t-primary) 15%, var(--t-surface)); }
:root[data-theme="dark"] .eh-seg button[aria-pressed="true"] { background: var(--t-surface); }

/* ── Table panel ── */
.eh-panel {
  background: #fff; border: 1px solid var(--t-border);
  border-radius: var(--t-radius-sm, 4px); overflow: hidden;
}
:root[data-theme="dark"] .eh-panel { background: var(--t-surface); }
.eh-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
.eh-table thead th {
  text-align: left; padding: 12px 18px;
  font-family: var(--t-font-mono, monospace);
  font-size: 11px; color: var(--t-text-muted); font-weight: 400;
  text-transform: uppercase; letter-spacing: 0.06em;
  border-bottom: 1px solid var(--t-border);
}
.eh-table thead th.eh-num { text-align: right; }
.eh-table tbody td {
  padding: 14px 18px; border-bottom: 1px solid var(--t-border);
  vertical-align: middle; color: var(--t-text);
}
.eh-table tbody tr:last-child td { border-bottom: 0; }
.eh-table tbody tr:hover { background: var(--t-surface-alt); }
.eh-table td.eh-num {
  text-align: right; font-family: var(--t-font-mono, monospace);
}

/* Exam cell */
.eh-exam-cell { display: flex; align-items: center; gap: 12px; }
.eh-exam-ico {
  width: 34px; height: 34px; border-radius: var(--t-radius-md, 8px);
  background: var(--t-surface-alt); display: flex;
  align-items: center; justify-content: center; flex: none;
}
.eh-exam-ico .material-symbols-rounded { font-size: 19px; color: var(--t-text-muted); }
.eh-exam-name { font-weight: 600; }
.eh-exam-sub { font-size: 12px; color: var(--t-text-muted); margin-top: 1px; }

/* Tier badges */
.eh-tier {
  font-family: var(--t-font-mono, monospace);
  font-size: 10px; font-weight: 500; text-transform: uppercase;
  letter-spacing: 0.04em; padding: 2px 7px;
  border-radius: var(--t-radius-pill, 999px);
}
.eh-tier-foundation { background: color-mix(in srgb, #7DDD3D 16%, transparent); color: #197050; }
.eh-tier-core { background: color-mix(in srgb, #91DBDA 22%, transparent); color: #007B79; }
.eh-tier-advanced { background: color-mix(in srgb, #8F4764 14%, transparent); color: #8F4764; }

/* Result badges */
.eh-res {
  display: inline-flex; align-items: center; gap: 5px;
  font-weight: 600; font-size: 13px;
}
.eh-res .material-symbols-rounded { font-size: 16px; }
.eh-pass { color: #16a34a; }
.eh-fail { color: #dc2626; }

/* Score */
.eh-score { font-family: var(--t-font-mono, monospace); font-weight: 600; }

/* Score */

/* Action link */
.eh-row-act {
  border: 0; background: none; cursor: pointer;
  color: var(--t-secondary); font-size: 13px;
  font-weight: 500; font-family: inherit; text-decoration: none;
}
.eh-row-act:hover { text-decoration: underline; }

/* Empty state */
.eh-empty {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 8px; padding: 48px 24px;
  color: var(--t-text-muted); font-size: 14px;
}

/* ── Dark mode ── */
:root[data-theme="dark"] .eh-tier-foundation { background: color-mix(in srgb, #7DDD3D 18%, transparent); color: #7DDD3D; }
:root[data-theme="dark"] .eh-tier-core { background: color-mix(in srgb, #91DBDA 18%, transparent); color: #91DBDA; }
:root[data-theme="dark"] .eh-tier-advanced { background: color-mix(in srgb, #D68CAC 18%, transparent); color: #D68CAC; }
:root[data-theme="dark"] .eh-pass { color: #4ade80; }
:root[data-theme="dark"] .eh-fail { color: #f87171; }

/* ── Responsive ── */
@media (max-width: 860px) {
  .eh-summary { grid-template-columns: repeat(2, 1fr); }
  .eh-hide-sm { display: none; }
}
@media (max-width: 480px) {
  .eh-summary { grid-template-columns: 1fr 1fr; gap: 10px; }
  .eh-card { padding: 12px 14px; }
  .eh-card-value { font-size: 22px; }
}

/* ══════════════════════════════════════════════════════════
   SETTINGS
   ══════════════════════════════════════════════════════════ */

.st-layout {
  display: grid; grid-template-columns: 180px 1fr;
  gap: 32px; max-width: 980px; width: 100%; margin: 0 auto;
  padding: 26px 28px 80px;
}
.st-header { grid-column: 1 / -1; }

/* ── Section nav ── */
.st-secnav {
  position: sticky; top: 84px; align-self: start;
  display: flex; flex-direction: column; gap: 2px;
}
.st-secnav a {
  font-size: 13px; font-weight: 500; color: var(--t-text-muted);
  text-decoration: none; padding: 7px 10px;
  border-radius: var(--t-radius-sm, 4px);
  border-left: 2px solid transparent;
}
.st-secnav a:hover { background: var(--t-surface-alt); color: var(--t-text); }
.st-secnav a.active {
  color: var(--t-text); font-weight: 600;
  background: var(--t-surface-alt);
}

/* ── Sections ── */
.st-sections { display: flex; flex-direction: column; gap: 18px; min-width: 0; }

/* ── Card ── */
.st-card {
  background: #fff; border: 1px solid var(--t-border);
  border-radius: var(--t-radius-sm, 4px); padding: 22px 24px;
  scroll-margin-top: 84px;
}
:root[data-theme="dark"] .st-card { background: var(--t-surface); }
.st-card h2 {
  font-family: var(--t-font); font-weight: 600; font-size: 16px;
  margin: 0 0 4px;
}
.st-desc { font-size: 13px; color: var(--t-text-muted); margin: 0 0 18px; }

/* ── Profile head ── */
.st-profile-head {
  display: flex; align-items: center; gap: 16px; margin-bottom: 20px;
}
.st-avatar {
  width: 64px; height: 64px; border-radius: 50%;
  background: color-mix(in srgb, var(--t-primary) 15%, var(--t-surface));
  color: var(--t-secondary); font-size: 22px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex: none;
}
.st-ph-actions { display: flex; gap: 8px; }

/* ── Fields ── */
.st-field { margin-bottom: 16px; }
.st-field:last-child { margin-bottom: 0; }
.st-field > label {
  display: block; font-size: 13px; font-weight: 600; margin-bottom: 7px;
}
.st-field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.st-input {
  height: 40px; width: 100%; font: inherit; font-size: 14px;
  color: var(--t-text); background: var(--t-surface);
  border: 1px solid var(--t-border); border-radius: var(--t-radius-sm, 4px);
  padding: 0 12px; box-sizing: border-box;
}
.st-input:focus { outline: none; border-color: var(--t-primary); }
.st-input[readonly] { opacity: 0.6; cursor: not-allowed; }
.st-select {
  height: 40px; width: 100%; font: inherit; font-size: 14px;
  color: var(--t-text); background: var(--t-surface);
  border: 1px solid var(--t-border); border-radius: var(--t-radius-sm, 4px);
  padding: 0 12px; cursor: pointer; box-sizing: border-box;
}

/* ── Card footer ── */
.st-card-foot {
  display: flex; justify-content: flex-end; gap: 10px;
  margin-top: 20px; padding-top: 18px;
  border-top: 1px solid var(--t-border);
}

/* ── Setting rows ── */
.st-row {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 0; border-bottom: 1px solid var(--t-border);
}
.st-row:first-of-type { padding-top: 0; }
.st-row:last-of-type { border-bottom: 0; padding-bottom: 0; }
.st-row-main { flex: 1; min-width: 0; }
.st-row-title { font-size: 14px; font-weight: 500; }
.st-row-desc { font-size: 12px; color: var(--t-text-muted); margin-top: 2px; line-height: 1.45; }

/* ── Toggle switch ── */
.st-switch {
  width: 40px; height: 23px; border-radius: 999px;
  background: var(--t-surface-alt); border: 1px solid var(--t-border);
  position: relative; cursor: pointer; flex: none;
  transition: background 0.15s, border-color 0.15s;
}
.st-switch[data-on] { background: var(--t-primary); border-color: var(--t-primary); }
.st-knob {
  position: absolute; top: 2px; left: 2px;
  width: 17px; height: 17px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.12);
  transition: transform 0.15s;
}
.st-switch[data-on] .st-knob { transform: translateX(17px); }

/* ── Theme segmented ── */
.st-theme-seg {
  display: inline-flex;
  background: color-mix(in srgb, var(--t-primary) 15%, #fff);
  border-radius: var(--t-radius-sm, 4px); padding: 3px; gap: 2px; flex: none;
}
.st-theme-seg button {
  border: 0; background: transparent; font: inherit;
  font-size: 13px; font-weight: 500; color: var(--t-text-muted);
  padding: 6px 14px; border-radius: var(--t-radius-sm, 4px);
  cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
}
.st-theme-seg button[aria-pressed="true"] {
  background: #fff; color: var(--t-text);
  font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
:root[data-theme="dark"] .st-theme-seg { background: color-mix(in srgb, var(--t-primary) 15%, var(--t-surface)); }
:root[data-theme="dark"] .st-theme-seg button[aria-pressed="true"] { background: var(--t-surface); }

/* ── Danger rows ── */
.st-danger-row {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 0; border-bottom: 1px solid var(--t-border);
}
.st-danger-row:last-child { border-bottom: 0; padding-bottom: 0; }
.st-danger-text { color: #dc2626; }
.st-danger-btn { border-color: #dc2626 !important; color: #dc2626 !important; }
.st-danger-btn:hover { background: #dc2626 !important; color: #fff !important; }

/* ── Toast ── */
.st-toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--t-text); color: var(--t-bg);
  padding: 12px 18px; border-radius: var(--t-radius-sm, 4px);
  font-size: 14px; font-weight: 500;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  z-index: 90; opacity: 0; pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  display: flex; align-items: center; gap: 8px;
}
.st-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Responsive ── */
@media (max-width: 860px) {
  .st-layout { grid-template-columns: 1fr; gap: 18px; padding-left: 16px; padding-right: 16px; }
  .st-secnav { display: none; }
  .st-field-grid { grid-template-columns: 1fr; }
  /* Wide controls (e.g. theme segmented, flex:none) drop below the label
     instead of overflowing the card on narrow screens. */
  .st-row { flex-wrap: wrap; }
}

/* ══════════════════════════════════════════════════════════
   MY CERTIFICATIONS
   ══════════════════════════════════════════════════════════ */

.mc-header { margin-bottom: 4px; }

/* ── Summary cards ── */
.mc-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.mc-scard {
  background: #fff; border: 1px solid var(--t-border);
  border-radius: var(--t-radius-sm, 4px); padding: 16px 18px;
  display: flex; flex-direction: column; gap: 6px; box-sizing: border-box;
}
:root[data-theme="dark"] .mc-scard { background: var(--t-surface); }
.mc-scard-top { display: flex; align-items: center; gap: 8px; }
.mc-scard-ico {
  width: 30px; height: 30px; border-radius: var(--t-radius-md, 8px);
  display: flex; align-items: center; justify-content: center; flex: none;
}
.mc-scard-ico .material-symbols-rounded { font-size: 18px; }
.mc-scard-label { font-size: 11px; color: var(--t-text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: 0.04em; }
.mc-scard-value { font-family: var(--t-font-headline, var(--t-font)); font-weight: 900; font-size: 28px; line-height: 1; color: var(--t-text); }
.mc-scard-value--sm { font-size: 20px; }

/* ── Tabs ── */
.cert-page .mc-tabs {
  display: flex; gap: 4px; border-bottom: 1px solid var(--t-border);
  margin: 16px 0 8px;
}
.mc-tab {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 11px 16px; font-size: 14px; font-weight: 500;
  color: var(--t-text-muted); border: 0; border-bottom: 2px solid transparent;
  margin-bottom: -1px; cursor: pointer; background: none; font-family: inherit;
}
.mc-tab:hover { color: var(--t-text); }
.mc-tab[aria-selected="true"] {
  color: var(--t-text); border-bottom-color: var(--t-primary); font-weight: 600;
}
.mc-tab-cnt {
  font-family: var(--t-font-mono, monospace); font-size: 11px; opacity: 0.7;
}

/* ── Credential list ── */
.mc-list { display: flex; flex-direction: column; gap: 14px; }

/* ── Credential card ── */
.mc-cred {
  display: grid; grid-template-columns: auto 1fr auto; gap: 20px;
  align-items: center; background: #fff; border: 1px solid var(--t-border);
  border-radius: var(--t-radius-sm, 4px); padding: 20px 22px;
  box-sizing: border-box;
}
:root[data-theme="dark"] .mc-cred { background: var(--t-surface); }

/* ── Medal (hexagon) ── */
.mc-medal {
  width: 60px; height: 60px; position: relative;
  display: flex; align-items: center; justify-content: center; flex: none;
}
.mc-disc {
  position: absolute; inset: 0;
  clip-path: polygon(50% 0, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%);
  background: var(--t-primary);
}
.mc-medal .material-symbols-rounded {
  position: relative; z-index: 1; font-size: 30px; color: var(--t-bg);
}
.mc-medal--gray .mc-disc { background: var(--t-surface-alt); }
.mc-medal--gray .material-symbols-rounded { color: var(--t-text-muted); }

/* ── Card content ── */
.mc-main { min-width: 0; }
.cert-page .mc-name {
  font-size: 17px; font-weight: 600; letter-spacing: -0.01em;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 4px;
}
.mc-tier {
  font-family: var(--t-font-mono, monospace); font-size: 10px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.04em;
  padding: 3px 8px; border-radius: var(--t-radius-pill, 999px);
}
.mc-tier-foundation { background: color-mix(in srgb, #7DDD3D 16%, transparent); color: #197050; }
.mc-tier-core { background: color-mix(in srgb, #91DBDA 22%, transparent); color: #007B79; }
.mc-tier-advanced { background: color-mix(in srgb, #8F4764 14%, transparent); color: #8F4764; }
/* Meta-credentials (champion/master/legend) — Dark Pink, the brand's prestige accent. */
.mc-tier-meta { background: color-mix(in srgb, #8F4764 14%, transparent); color: #8F4764; }

.mc-meta { display: flex; gap: 22px; margin-top: 12px; flex-wrap: wrap; }
.mc-mi { display: flex; flex-direction: column; gap: 2px; }
.mc-k {
  font-family: var(--t-font-mono, monospace); font-size: 10px;
  text-transform: uppercase; letter-spacing: 0.05em; color: var(--t-text-muted);
}
.mc-v {
  font-size: 13px; font-weight: 500; color: var(--t-text);
  display: inline-flex; align-items: center; gap: 6px;
}
.mc-mono { font-family: var(--t-font-mono, monospace); font-size: 12px; overflow-wrap: anywhere; min-width: 0; }

/* ── Copy button ── */
.mc-copy-btn {
  border: 0; background: none; cursor: pointer; color: var(--t-text-muted);
  display: inline-flex; padding: 2px; border-radius: 4px;
}
.mc-copy-btn:hover { color: var(--t-secondary); background: var(--t-surface-alt); }
.mc-copy-btn .material-symbols-rounded { font-size: 15px; }

/* ── Score breakdown ── */
.mc-score-breakdown { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.mc-score-part {
  font-size: 12px; font-weight: 500; padding: 2px 7px; border-radius: 4px;
  background: var(--t-surface-alt); color: var(--t-text-muted);
}

/* ── Card side ── */
.mc-side { display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.mc-actions { display: flex; gap: 8px; align-items: center; }
.mc-badge {
  font-family: var(--t-font-mono, monospace); font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.04em; padding: 4px 10px;
  border-radius: var(--t-radius-pill, 999px);
}
.mc-badge-pass { background: color-mix(in srgb, #22c55e 14%, transparent); color: #16a34a; }
.mc-badge-fail { background: color-mix(in srgb, #ef4444 14%, transparent); color: #dc2626; }
.mc-badge-expired { background: color-mix(in srgb, #f59e0b 16%, transparent); color: #b45309; }
/* Expired credential card: muted, with a desaturated medal. */
.mc-cred--expired { opacity: 0.72; }
.mc-cred--expired .mc-medal { filter: grayscale(1); }
.mc-expiry {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; color: var(--t-text-muted);
  font-family: var(--t-font-mono, monospace);
}
.mc-expiry .material-symbols-rounded { font-size: 14px; }

/* ── Empty state ── */
.mc-empty {
  text-align: center; padding: 56px 20px; color: var(--t-text-muted);
}
.mc-empty h3 {
  font-family: var(--t-font); font-weight: 600; font-size: 16px;
  color: var(--t-text); margin: 12px 0 4px;
}

/* ── Dark mode ── */
:root[data-theme="dark"] .mc-tier-foundation { background: color-mix(in srgb, #7DDD3D 18%, transparent); color: #7DDD3D; }
:root[data-theme="dark"] .mc-tier-core { background: color-mix(in srgb, #91DBDA 18%, transparent); color: #91DBDA; }
:root[data-theme="dark"] .mc-tier-advanced { background: color-mix(in srgb, #D68CAC 18%, transparent); color: #D68CAC; }
:root[data-theme="dark"] .mc-tier-meta { background: color-mix(in srgb, #D68CAC 18%, transparent); color: #D68CAC; }
:root[data-theme="dark"] .mc-badge-pass { background: color-mix(in srgb, #4ade80 18%, transparent); color: #4ade80; }
:root[data-theme="dark"] .mc-badge-fail { background: color-mix(in srgb, #f87171 18%, transparent); color: #f87171; }
:root[data-theme="dark"] .mc-badge-expired { background: color-mix(in srgb, #fbbf24 18%, transparent); color: #fbbf24; }

/* ── Responsive ── */
@media (max-width: 860px) {
  .mc-cred { grid-template-columns: auto 1fr; }
  .mc-side { grid-column: 1 / -1; align-items: stretch; flex-direction: row; flex-wrap: wrap; }
}
/* Keep the 3 summary tiles on one line on phones (was collapsing to 1-per-row);
   stack icon/label/value inside each and shrink type so all three fit. */
@media (max-width: 640px) {
  .mc-summary { gap: 8px; }
  .mc-scard { padding: 12px 10px; gap: 6px; align-items: center; text-align: center; }
  /* Icon + title on one line; the value (main stat) centred below. */
  .mc-scard-top { flex-direction: row; align-items: center; justify-content: center; gap: 6px; }
  .mc-scard-ico { width: 26px; height: 26px; }
  .mc-scard-ico .material-symbols-rounded { font-size: 16px; }
  .mc-scard-label { font-size: 10px; line-height: 1.25; }
  .mc-scard-value { font-size: 22px; }
  .mc-scard-value--sm { font-size: 15px; }
}

/* Credential card on phones: icon + title on one line, the detail rows full-width
   below, then the badge/actions/renewal stacked. CTAs go two-per-row (equal
   height) instead of one cramped uneven row; the Active pill sits top-left. */
@media (max-width: 640px) {
  .mc-cred { grid-template-columns: auto 1fr; column-gap: 14px; row-gap: 12px; align-items: center; padding: 16px; }
  .mc-medal { grid-column: 1; grid-row: 1; width: 44px; height: 44px; }
  .mc-medal .material-symbols-rounded { font-size: 22px; }
  .mc-main { display: contents; }
  .cert-page .mc-name { grid-column: 2; grid-row: 1; align-self: center; margin-bottom: 0; }
  .mc-meta { grid-column: 1 / -1; grid-row: 2; gap: 10px 22px; margin-top: 0; }
  .mc-side { grid-column: 1 / -1; grid-row: 3; flex-direction: column; align-items: stretch; gap: 10px; }
  .mc-badge { align-self: flex-start; }
  /* All four actions are half-width → Certificate + View on Credly on row 1,
     LinkedIn + copy-link on row 2. */
  .mc-actions { display: flex; flex-wrap: wrap; gap: 8px; }
  .mc-actions .btn,
  .mc-actions .mc-copy-btn { flex: 1 1 calc(50% - 4px); justify-content: center; min-height: 40px; }
  .mc-actions .mc-copy-btn { border: 1px solid var(--t-border); border-radius: var(--t-radius-sm, 4px); color: var(--t-text-secondary); }
}

/* ══════════════════════════════════════════════════════════
   DASHBOARD
   ══════════════════════════════════════════════════════════ */

.db-page { max-width: 1440px; }
.db-header { margin-bottom: 4px; }
.db-accent { color: var(--t-secondary); }

/* ── Hero ── */
.db-hero {
  position: relative; overflow: hidden;
  background: #1C1F1C; border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--t-radius-sm, 4px); padding: 28px 30px;
  display: grid; grid-template-columns: 1fr auto; gap: 30px; align-items: center;
  color: #e0e0e0;
}
.db-hero::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(620px 280px at 88% -20%, rgba(171,255,68,0.16), transparent 60%);
  pointer-events: none;
}
.db-hero-left { position: relative; z-index: 1; }
.db-hero-eyebrow {
  font-family: var(--t-font-mono, monospace); font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--t-primary); display: flex; align-items: center; gap: 8px;
}
.db-hero-title {
  font-family: var(--t-font-headline, var(--t-font));
  font-weight: 900; font-size: 30px; line-height: 1.05;
  letter-spacing: -0.02em; color: #fff; margin: 12px 0 4px;
}
.db-hero-meta { font-size: 13px; color: #aaa; }
.db-hero-actions { display: flex; align-items: center; gap: 12px; }
.db-hero-ghost {
  background: transparent !important; color: #ddd !important;
  border: 1px solid rgba(255,255,255,0.2) !important;
}
.db-hero-ghost:hover { background: rgba(255,255,255,0.08) !important; }

/* Steps */
.db-steps { display: flex; align-items: center; gap: 0; margin: 22px 0 24px; }
.db-step { display: flex; align-items: center; gap: 10px; }
.db-step-node {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; flex: none;
  font-family: var(--t-font-mono, monospace); font-size: 12px; font-weight: 600;
}
.db-step-done .db-step-node { background: var(--t-primary); color: #1C1F1C; }
.db-step-done .db-step-node .material-symbols-rounded { font-size: 18px; }
.db-step-current .db-step-node { background: transparent; color: var(--t-primary); border: 2px solid var(--t-primary); }
.db-step-todo .db-step-node { background: rgba(255,255,255,0.08); color: #888; border: 1px solid rgba(255,255,255,0.16); }
.db-step-lbl { font-size: 13px; font-weight: 500; color: #ddd; white-space: nowrap; }
.db-step-todo .db-step-lbl { color: #888; }
.db-step-conn { width: 38px; height: 2px; background: rgba(255,255,255,0.14); margin: 0 12px; border-radius: 2px; }
.db-step-conn-done { background: var(--t-primary); }

/* Progress ring */
.db-ring-wrap {
  position: relative; z-index: 1; width: 168px; height: 168px;
  display: grid; place-items: center;
}
.db-ring-wrap svg { transform: rotate(-90deg); }
.db-ring-bg { fill: none; stroke: rgba(255,255,255,0.1); }
.db-ring-fg { fill: none; stroke: var(--t-primary); stroke-linecap: round; transition: stroke-dashoffset 1.4s cubic-bezier(.22,1,.36,1); }
.db-ring-label {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.db-ring-pct {
  font-family: var(--t-font-headline, var(--t-font));
  font-weight: 900; font-size: 38px; line-height: 1; color: #fff;
}
.db-ring-cap {
  font-family: var(--t-font-mono, monospace); font-size: 10px;
  text-transform: uppercase; letter-spacing: 0.08em; color: #888; margin-top: 4px;
}

/* ── Stats ── */
.cert-page .db-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 16px 0 8px; }
.db-stat {
  background: #fff; border: 1px solid var(--t-border);
  border-radius: var(--t-radius-sm, 4px); padding: 16px 18px;
  display: flex; flex-direction: column; gap: 6px; box-sizing: border-box;
}
:root[data-theme="dark"] .db-stat { background: var(--t-surface); }
.db-stat-top { display: flex; align-items: center; gap: 8px; }
.db-stat-ico {
  width: 30px; height: 30px; border-radius: var(--t-radius-md, 8px);
  display: flex; align-items: center; justify-content: center; flex: none;
}
.db-stat-ico .material-symbols-rounded { font-size: 18px; }
.db-stat-label { font-size: 11px; color: var(--t-text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: 0.04em; }
.db-stat-value {
  font-family: var(--t-font-headline, var(--t-font));
  font-weight: 900; font-size: 30px; line-height: 1; color: var(--t-text);
  display: flex; align-items: baseline; gap: 6px;
}
.db-stat-value small { font-family: var(--t-font); font-size: 13px; font-weight: 500; color: var(--t-text-muted); }
.db-stat-delta { font-family: var(--t-font-mono, monospace); font-size: 12px; color: var(--t-text-muted); }
.db-delta-up { color: #16a34a; }

/* ── Columns ── */
.db-cols { display: grid; grid-template-columns: 1fr 340px; gap: 18px; align-items: start; }
.db-col { display: flex; flex-direction: column; gap: 18px; min-width: 0; }

/* ── Panel ── */
.db-panel {
  background: #fff; border: 1px solid var(--t-border);
  border-radius: var(--t-radius-sm, 4px); overflow: hidden; box-sizing: border-box;
}
:root[data-theme="dark"] .db-panel { background: var(--t-surface); }
.db-panel-head {
  display: flex; align-items: center; padding: 16px 18px; gap: 10px;
}
.db-panel-head h3 { font-family: var(--t-font); font-weight: 600; font-size: 15px; margin: 0; }
.db-badge-count {
  font-family: var(--t-font-mono, monospace); font-size: 11px;
  color: var(--t-text-muted); padding: 2px 8px;
  background: var(--t-surface-alt); border-radius: var(--t-radius-sm, 4px);
}
.db-link {
  font-size: 13px; font-weight: 500; color: var(--t-secondary);
  cursor: pointer; display: inline-flex; align-items: center; gap: 2px;
  text-decoration: none;
}
.db-link:hover { text-decoration: underline; }
.db-link .material-symbols-rounded { font-size: 16px; }

/* ── Credential grid ── */
.db-cred-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
  padding: 4px 18px 18px;
}
.db-cred {
  border: 1px solid var(--t-border); border-radius: var(--t-radius-sm, 4px);
  padding: 16px 14px; display: flex; flex-direction: column;
  align-items: center; text-align: center; gap: 10px;
  cursor: pointer; background: var(--t-surface);
  transition: transform 0.2s, box-shadow 0.2s; text-decoration: none; color: var(--t-text);
}
.db-cred:hover { transform: translateY(-3px); box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.db-medal {
  width: 64px; height: 64px; position: relative;
  display: flex; align-items: center; justify-content: center; flex: none;
}
.db-disc {
  position: absolute; inset: 0;
  clip-path: polygon(50% 0, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%);
}
.db-cred-earned .db-disc { background: var(--t-primary); }
.db-cred-earned .db-medal .material-symbols-rounded {
  position: relative; z-index: 1; font-size: 30px; color: var(--t-bg);
}
.db-medal-add .db-disc { background: var(--t-surface-alt); border: 1px dashed var(--t-border); }
.db-medal-add .material-symbols-rounded {
  position: relative; z-index: 1; font-size: 26px; color: var(--t-text-muted);
}
.db-cred-name { font-size: 13px; font-weight: 600; line-height: 1.2; }
.db-cred-level {
  font-family: var(--t-font-mono, monospace); font-size: 10px;
  text-transform: uppercase; letter-spacing: 0.05em; color: var(--t-text-muted);
}
.db-cred-add { border-style: dashed; }
.db-cred-add .db-cred-name { color: var(--t-text-muted); }

/* ── Exam rows ── */
.db-exam-row {
  display: flex; align-items: center; gap: 14px; padding: 14px 18px;
  border-top: 1px solid var(--t-border);
}
.db-exam-ico {
  width: 40px; height: 40px; border-radius: var(--t-radius-md, 8px);
  background: var(--t-surface-alt); display: flex;
  align-items: center; justify-content: center; flex: none;
}
.db-exam-ico .material-symbols-rounded { font-size: 22px; color: var(--t-text-muted); }
.db-exam-main { flex: 1; min-width: 0; }
.db-exam-name { font-size: 14px; font-weight: 600; }
.db-exam-meta {
  font-size: 12px; color: var(--t-text-muted); margin-top: 3px;
  display: flex; align-items: center; gap: 6px;
}

/* ── AI Coach (Opal) ── */
.db-opal {
  border-radius: var(--t-radius-sm, 4px); padding: 1px;
  background: linear-gradient(135deg, var(--t-primary), var(--t-secondary), #91dbda);
}
.db-opal-inner {
  background: #fff; border-radius: calc(var(--t-radius-sm, 4px) - 1px);
  padding: 16px 18px; display: flex; flex-direction: column; gap: 12px;
}
:root[data-theme="dark"] .db-opal-inner { background: var(--t-surface); }
.db-opal-head {
  font-family: var(--t-font-headline, var(--t-font));
  font-weight: 900; font-size: 16px;
  display: flex; align-items: center; gap: 9px;
}
.db-opal-glyph {
  width: 24px; height: 24px; border-radius: 50%;
  background: linear-gradient(135deg, var(--t-primary), var(--t-secondary));
  display: inline-flex; align-items: center; justify-content: center; color: #fff;
}
.db-opal-body { font-size: 13px; line-height: 1.5; color: var(--t-text-muted); }

/* ── Leaderboard mini ── */
.db-lb-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 18px;
  border-top: 1px solid var(--t-border);
}
.db-lb-rank {
  font-family: var(--t-font-mono, monospace); font-size: 13px; font-weight: 600;
  color: var(--t-text-muted); width: 26px; text-align: center; flex: none;
}
.db-lb-podium .db-lb-rank { color: var(--t-text); }
.db-lb-avatar {
  width: 26px; height: 26px; border-radius: 50%; font-size: 10px; font-weight: 600;
  background: color-mix(in srgb, var(--t-primary) 15%, var(--t-surface));
  color: var(--t-secondary); display: flex; align-items: center; justify-content: center; flex: none;
}
.db-lb-name {
  flex: 1; font-size: 13px; font-weight: 500; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.db-lb-pts {
  font-family: var(--t-font-mono, monospace); font-size: 13px; font-weight: 600;
  color: var(--t-text-muted);
}
.db-lb-you { background: color-mix(in srgb, var(--t-primary) 8%, transparent); }
.db-lb-you .db-lb-name { font-weight: 700; }
.db-lb-you .db-lb-rank, .db-lb-you .db-lb-pts { color: var(--t-secondary); }

/* ── Responsive ── */
@media (max-width: 1080px) {
  .db-cols { grid-template-columns: 1fr; }
  /* Must match the base '.cert-page .db-stats' specificity (0,2,0) or the base
     4-column grid wins even inside these media queries and the tiles overflow. */
  .cert-page .db-stats { grid-template-columns: repeat(2, 1fr); }
  .db-hero { grid-template-columns: 1fr; }
  .db-ring-wrap { display: none; }
}
@media (max-width: 600px) {
  .cert-page .db-stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .db-cred-grid { grid-template-columns: repeat(2, 1fr); }
  .db-hero { padding: 20px; }
  .db-hero-title { font-size: 22px; }
  /* Vertical stepper with connector lines between the tiers (desktop is
     horizontal); the line drops under the 28px node's centre (~13px). */
  .db-steps { flex-direction: column; align-items: flex-start; gap: 0; }
  .db-step-conn { display: block; width: 2px; height: 18px; margin: 4px 0 4px 13px; }
  .db-hero-actions { flex-wrap: wrap; }
  .db-hero-actions .btn { flex: 1 1 auto; justify-content: center; }
  /* Centre the progress ring below the hero content. */
  .db-ring-wrap { justify-self: center; margin-top: 4px; }
  /* Stat tiles: 2 per row with centred content. */
  .db-stat { align-items: center; text-align: center; }
  .db-stat-top { justify-content: center; }
  .db-stat-value { justify-content: center; }
}