/* ============================================================
   Examplar homepage v2 - "Control Room"
   Replaces homepage-styles.css + index-inline.css on index.html.
   Loads AFTER the legacy shared sheets (style-new, multi-exam,
   modern-enhancements, exam-enhancements), which keep powering the
   inline exam/results screens; later rules here win the landing
   surfaces. Every class generated by homepage.js is covered.
   ============================================================ */

/* ===== Tokens (shared with exam-v2) ===== */
:root {
  --rail-bg: #1d232f;
  --rail-bg-soft: #252c3a;
  --rail-text: #aab2c0;
  --rail-text-strong: #e8ebf0;
  --rail-line: #313947;
  --accent-bright: #2dd4bf;

  --h-bg: #dde1e9;
  --h-surface: #ffffff;
  --h-surface-soft: #f7f8fa;
  --h-panel: #e7ebf2;        /* recessed library panel so the white cards pop */
  --card-hover-mix: 14%;     /* exam-card hover tint strength */
  --h-text: #1f2733;
  --h-text-soft: #5b6573;
  --h-text-faint: #8d95a3;
  --h-line: #e3e6ea;
  --h-line-strong: #cfd4db;

  --h-accent: #0f766e;
  --h-accent-deep: #0b5d57;
  --h-accent-tint: #ecf6f4;
  --h-accent-chip-border: #cde7e2;

  --h-good: #1f7a4d;
  --h-good-tint: #ecf6f0;
  --h-good-line: #cfe5db;
  --h-bad: #b03a3a;
  --h-bad-tint: #faeeee;
  --h-bad-line: #ecd2d2;
  --h-flag: #b07d2b;
  --h-flag-tint: #fdf6e7;
  --h-flag-line: #ecdcb8;

  --h-btn-primary-text: #ffffff;
  --h-card-shadow: 0 1px 2px rgba(31, 39, 51, 0.04);
  --h-overlay: rgba(15, 23, 42, 0.55);
  --h-radius: 8px;
  --h-radius-lg: 12px;
  --h-font-num: 'Cascadia Mono', Consolas, ui-monospace, monospace;
}

[data-theme="dark"], body.dark-mode {
  --rail-bg: #161b24;
  --rail-bg-soft: #1f2530;
  --rail-line: #2b3340;

  --h-bg: #10141b;
  --h-surface: #1a212c;
  --h-surface-soft: #1f2733;
  --h-panel: var(--h-surface);  /* dark: panel sits flush with the surface */
  --card-hover-mix: 11%;
  --h-text: #e2e7ee;
  --h-text-soft: #a8b1bf;
  --h-text-faint: #79828f;
  --h-line: #28303d;
  --h-line-strong: #39434f;

  --h-accent: #2bb3a3;
  --h-accent-deep: #4ecdbd;
  --h-accent-tint: #182d2b;
  --h-accent-chip-border: #28534d;

  --h-good: #5fc28e;
  --h-good-tint: #1a2c23;
  --h-good-line: #2b4a3a;
  --h-bad: #dd8f8f;
  --h-bad-tint: #2f2022;
  --h-bad-line: #4d3032;
  --h-flag: #d3aa64;
  --h-flag-tint: #2e271a;
  --h-flag-line: #4a3e26;

  --h-btn-primary-text: #0d1a18;
  --h-card-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  --h-overlay: rgba(0, 0, 0, 0.6);
}

/* ===== Base overrides (kill legacy gradients) ===== */
body {
  background: var(--h-bg);
  color: var(--h-text);
  font-size: 15px;
  overflow-x: clip;
}
/* the dark band must touch the top edge */
main#main-content { padding-top: 0; }
[data-theme="dark"] body, .dark-mode body,
body.dark-mode, body[data-theme="dark"] { background: var(--h-bg); }

/* page column: centering used to come from the retired style-new.css */
.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 0.75rem;
}

/* ===== Theme controls (live in the top nav; the inline exam rail keeps
   exam-v2's display:contents treatment) ===== */
.cr-topnav .theme-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.cr-topnav .theme-controls .theme-public-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  height: 36px;
  padding: 0 0.8rem;
  border-radius: var(--h-radius);
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.15s, border-color 0.15s;
}

/* legacy style-new centers the whole welcome screen; restore natural flow */
#welcome-screen {
  text-align: left;
  display: block;
  min-height: 0;
  padding: 0;
}

/* ===== Board ===== */
.home-board {
  background: transparent;
  border: none;
  box-shadow: none;
  border-radius: 0;
  padding: 0.5rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}
body:not(.dark-mode) .home-board { border-color: transparent; }

/* ===== Hero: dark control-room band, edge to edge ===== */
.cr-hero-zone {
  position: relative;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  /* soft teal bloom behind the stats column */
  background:
    radial-gradient(640px 300px at 78% 12%, rgba(45, 212, 191, 0.08), transparent 70%),
    var(--rail-bg);
  border-bottom: 1px solid var(--rail-line);
  color: var(--rail-text);
  margin-bottom: 1.4rem;
  overflow: hidden;
}
/* faint blueprint grid, fading out towards the lower-left */
.cr-hero-zone::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(170, 178, 192, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(170, 178, 192, 0.055) 1px, transparent 1px);
  background-size: 34px 34px;
  -webkit-mask-image: radial-gradient(130% 130% at 75% 0%, #000 25%, transparent 72%);
  mask-image: radial-gradient(130% 130% at 75% 0%, #000 25%, transparent 72%);
  pointer-events: none;
}
.cr-hero-zone > * { position: relative; z-index: 1; }
.cr-topnav {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0.6rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--rail-line);
}
.cr-topnav-brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0;
}
.cr-topnav-brand .logo-img { width: 26px; height: auto; }
.cr-topnav-brand h1 {
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
  -webkit-text-fill-color: currentcolor;
  color: var(--rail-text-strong);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  margin: 0;
}
.cr-topnav-brand .logo-accent { color: var(--accent-bright); }
.cr-topnav-links {
  display: flex;
  align-items: center;
  gap: 1.1rem;
}
.cr-topnav-links > a {
  color: var(--rail-text);
  text-decoration: none;
  font-size: 0.8438rem;
  font-weight: 600;
  transition: color 0.15s;
}
.cr-topnav-links > a:hover { color: var(--rail-text-strong); }
.cr-topnav-links > a:focus-visible { outline: 2px solid var(--accent-bright); outline-offset: 2px; }
/* theme controls live in the nav here, not floating */
.cr-topnav .theme-toggle {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  cursor: pointer;
  border-radius: var(--h-radius);
  background: transparent;
  border: 1px solid var(--rail-line);
  color: var(--rail-text);
  box-shadow: none;
  transition: color 0.15s, border-color 0.15s;
}
.cr-topnav .theme-toggle:hover { color: var(--accent-bright); border-color: var(--accent-bright); }
.cr-topnav .theme-toggle:focus-visible { outline: 2px solid var(--accent-bright); outline-offset: 2px; }
.cr-topnav .theme-controls .theme-public-link {
  background: transparent;
  border: 1px solid var(--rail-line);
  color: var(--rail-text);
  box-shadow: none;
}
.cr-topnav .theme-controls .theme-public-link:hover { color: var(--accent-bright); border-color: var(--accent-bright); }

/* Sticky control-room top bar: the nav stays pinned while the page scrolls. It lives
   OUTSIDE the (tall) hero-zone so it can pin to the viewport instead of scrolling away
   with the hero; it keeps the intentional dark-header look as a full-bleed graphite
   bar. Shared by the home and the roadmaps page. */
.cr-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  background: var(--rail-bg);
  color: var(--rail-text);
  border-bottom: 1px solid var(--rail-line);
}
.cr-topbar .cr-topnav { border-bottom: none; }

.hero-header.hero-banner {
  background: transparent;
  border: none;
  border-radius: 0;
  color: var(--rail-text);
  padding: 0;
}
.hero-banner__inner {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  gap: 2rem;
  align-items: center;
  padding: 1.6rem 1.5rem 2rem;
}
.hero-headline {
  color: var(--rail-text-strong);
  font-size: 1.85rem;
  line-height: 1.18;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 0 0 0.6rem;
  text-wrap: balance;
}
.hero-headline-accent { color: var(--accent-bright); }
.hero-subtitle {
  color: var(--rail-text);
  font-size: 0.9375rem;
  line-height: 1.5;
  max-width: 58ch;
  margin-bottom: 0.8rem;
}
.hero-subtitle strong { color: var(--rail-text-strong); }
.hero-trust {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0 0 1rem;
  padding: 0;
}
.trust-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--rail-text);
  border: 1px solid var(--rail-line);
  border-radius: 999px;
  padding: 0.28rem 0.7rem;
}
.trust-chip i { color: var(--accent-bright); font-size: 0.7rem; }
.hero-cta-row { display: flex; }
.hero-cta-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--accent-bright);
  color: #08312d;
  font-weight: 700;
  font-size: 0.9375rem;
  border-radius: var(--h-radius);
  padding: 0.65rem 1.4rem;
  text-decoration: none;
  transition: filter 0.15s;
}
.hero-cta-primary:hover { filter: brightness(1.08); }
.hero-cta-primary:focus-visible { outline: 2px solid var(--accent-bright); outline-offset: 2px; }

.hero-proof { min-width: 0; }
.hero-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}
.stat-card {
  background: var(--rail-bg-soft);
  border: 1px solid var(--rail-line);
  border-radius: 10px;
  padding: 0.65rem 0.9rem;
}
.stat-card .stat-value {
  display: block;
  font-family: var(--h-font-num);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--rail-text-strong);
  font-variant-numeric: tabular-nums;
}
.stat-card .stat-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  color: var(--rail-text);
  opacity: 0.85;
  margin-top: 2px;
}
.stat-card .stat-label-icon { color: var(--accent-bright); }
/* image support tile stays out of the hero (kept from previous layout decision) */
.hero-proof .support-card { display: none; }

/* ===== How it works ===== */
.home-steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  padding: 0;
  margin: 0;
}
.home-step {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  background: var(--h-surface);
  border: 1px solid var(--h-line);
  border-radius: var(--h-radius-lg);
  padding: 0.9rem 1rem;
  box-shadow: var(--h-card-shadow);
}
body:not(.dark-mode) .home-step { background: var(--h-surface); border-color: var(--h-line); }
.home-step-n {
  font-family: var(--h-font-num);
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--h-accent-deep);
  background: var(--h-accent-tint);
  border: 1px solid var(--h-accent-chip-border);
  border-radius: 7px;
  width: 26px;
  height: 26px;
  min-width: 26px;
  display: grid;
  place-items: center;
}
.home-step h3 { font-size: 0.9rem; font-weight: 700; color: var(--h-text); margin-bottom: 1px; }
.home-step p { font-size: 0.8125rem; color: var(--h-text-soft); line-height: 1.45; }

/* ===== Layout containers ===== */
.content-grid { display: flex; flex-direction: column; gap: 1.4rem; }
.main-content { display: flex; flex-direction: column; gap: 1.4rem; width: 100%; }

/* ===== Exam library ===== */
/* Light: --h-panel is a soft recessed gray so the white cards pop; dark: it tracks
   --h-surface. Theme-token driven, so it is correct for both .dark-mode and
   [data-theme="dark"] without a fragile :not() guard. */
.exam-library-section {
  background: var(--h-panel);
  border: 1px solid var(--h-line);
  border-radius: var(--h-radius-lg);
  padding: 1.25rem 1.4rem 1.4rem;
  box-shadow: var(--h-card-shadow);
  position: relative;
}
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.9rem;
  flex-wrap: wrap;
}
.section-header > div { display: flex; align-items: center; gap: 0.8rem; }
.section-header h2 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--h-text);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.section-header h2 i { color: var(--h-accent); font-size: 0.95rem; }
.section-subtitle { font-size: 0.8125rem; color: var(--h-text-faint); }
.library-filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--h-text-soft);
  background: var(--h-surface);
  border: 1px solid var(--h-line-strong);
  border-radius: var(--h-radius);
  padding: 0.45rem 0.9rem;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.library-filter-toggle:hover { border-color: var(--h-accent); color: var(--h-accent); }
.library-filter-toggle:focus-visible { outline: 2px solid var(--h-accent); outline-offset: 2px; }
.library-filter-count {
  background: var(--h-accent);
  color: var(--h-btn-primary-text);
  border-radius: 999px;
  font-size: 0.68rem;
  padding: 0.05rem 0.45rem;
}
.library-filter-chevron { font-size: 0.7rem; opacity: 0.7; }

.library-controls { margin: 0 auto 0.6rem; }
.library-controls.filters-collapsed { margin: 0 auto 0.45rem; }
.library-controls [inert] { display: none; }
.library-control-topline { margin-bottom: 0.6rem; }
.library-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid var(--h-line-strong);
  background: var(--h-surface);
  border-radius: var(--h-radius);
  padding: 0.5rem 0.85rem;
  color: var(--h-text-faint);
}
.library-search:focus-within { border-color: var(--h-accent); }
.library-search input {
  border: none;
  outline: none;
  background: none;
  font: inherit;
  color: var(--h-text);
  flex: 1;
  min-width: 0;
}
.library-advanced-filters { margin-top: 0.6rem; }
.library-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: flex-end;
}
.library-filter-row label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--h-text-faint);
}
.library-filter-row select {
  font: inherit;
  font-size: 0.8438rem;
  color: var(--h-text);
  background: var(--h-surface);
  border: 1px solid var(--h-line-strong);
  border-radius: var(--h-radius);
  padding: 0.4rem 0.6rem;
  min-width: 130px;
}
.library-filter-row select:focus-visible { outline: 2px solid var(--h-accent); outline-offset: 1px; }
.library-clear-filters {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--h-text-soft);
  background: none;
  border: 1px solid var(--h-line-strong);
  border-radius: var(--h-radius);
  padding: 0.45rem 0.9rem;
  cursor: pointer;
}
.library-clear-filters:hover { border-color: var(--h-text-faint); color: var(--h-text); }
.library-result-count { font-size: 0.78rem; color: var(--h-text-faint); margin: 0.4rem 0 0; display: inline-block; }
.library-hidden-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin: 0.4rem 0 0 0.6rem;
  font: inherit;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--h-flag);
  background: var(--h-flag-tint);
  border: 1px solid var(--h-flag-line);
  border-radius: 999px;
  padding: 0.18rem 0.65rem;
  cursor: pointer;
  transition: border-color 0.15s;
}
.library-hidden-chip:hover { border-color: var(--h-flag); }
.library-hidden-chip:focus-visible { outline: 2px solid var(--h-accent); outline-offset: 2px; }

/* action toast (hide-card undo) */
.examplar-toast {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 14000;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--rail-bg);
  color: var(--rail-text-strong);
  border: 1px solid var(--rail-line);
  border-radius: 10px;
  padding: 0.65rem 0.9rem;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  max-width: min(560px, calc(100vw - 2rem));
  animation: cr-toast-in 0.2s ease;
}
@keyframes cr-toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(8px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.examplar-toast-text { font-size: 0.8438rem; }
.examplar-toast-action {
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  background: none;
  border: 1px solid var(--rail-line);
  color: var(--rail-text);
  border-radius: var(--h-radius);
  padding: 0.35rem 0.75rem;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
}
.examplar-toast-action:hover { color: var(--rail-text-strong); border-color: var(--rail-text); }
.examplar-toast-action.primary { color: var(--accent-bright); border-color: var(--accent-bright); }
.examplar-toast-action.primary:hover { filter: brightness(1.15); }
.examplar-toast-action:focus-visible { outline: 2px solid var(--accent-bright); outline-offset: 2px; }

/* drag-and-drop import overlay (calm rebuild of the legacy treatment) */
body.dragging-file .exam-library-section {
  outline: 2px dashed var(--h-accent);
  outline-offset: -2px;
}
body.dragging-file .exam-library-section::after {
  content: 'Drop exam pack to import';
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--h-surface) 88%, transparent);
  color: var(--h-accent-deep);
  font-weight: 700;
  font-size: 1rem;
  border-radius: var(--h-radius-lg);
  z-index: 5;
}

.library-empty-state {
  text-align: center;
  color: var(--h-text-faint);
  padding: 2rem 1rem;
}.library-empty-state i { font-size: 1.6rem; margin-bottom: 0.5rem; color: var(--h-text-faint); }
.library-empty-state h3 { color: var(--h-text); font-size: 1rem; margin-bottom: 0.25rem; }

/* ===== Exam cards ===== */
.exam-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 0.9rem;
}
.exam-card {
  position: relative;
  background: var(--h-surface);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  border: 1px solid var(--h-line);
  border-radius: var(--h-radius-lg);
  padding: 1.1rem 1.2rem;
  box-shadow: var(--h-card-shadow);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  transition: border-color 0.15s, background-color 0.15s, transform 0.15s;
}
/* modern-enhancements.css paints a full-card ::before overlay for an animated
   border; it swallows clicks once homepage-styles.css no longer overrides it */
.exam-card::before { content: none !important; animation: none !important; }

/* Per-exam accent: homepage.js assigns exam-c0..c11 by library position.
   A muted hue tints the top strip, code badge and icon so cards scan apart
   without reintroducing the old rainbow. */
.exam-card { border-top: 3px solid var(--card-accent, var(--h-line-strong)); }
.exam-c0  { --card-accent: #12877d; }
.exam-c1  { --card-accent: #5b6bbf; }
.exam-c2  { --card-accent: #a87926; }
.exam-c3  { --card-accent: #4e8a55; }
.exam-c4  { --card-accent: #a85585; }
.exam-c5  { --card-accent: #3e7ca6; }
.exam-c6  { --card-accent: #b05c4a; }
.exam-c7  { --card-accent: #7a8c3a; }
.exam-c8  { --card-accent: #8a64b8; }
.exam-c9  { --card-accent: #3a8fa3; }
.exam-c10 { --card-accent: #b04a6e; }
.exam-c11 { --card-accent: #74787e; }
[data-theme="dark"] .exam-c0, .dark-mode .exam-c0   { --card-accent: #3bb8aa; }
[data-theme="dark"] .exam-c1, .dark-mode .exam-c1   { --card-accent: #8b97e0; }
[data-theme="dark"] .exam-c2, .dark-mode .exam-c2   { --card-accent: #d3aa64; }
[data-theme="dark"] .exam-c3, .dark-mode .exam-c3   { --card-accent: #7dbb84; }
[data-theme="dark"] .exam-c4, .dark-mode .exam-c4   { --card-accent: #cf8ab4; }
[data-theme="dark"] .exam-c5, .dark-mode .exam-c5   { --card-accent: #74aed0; }
[data-theme="dark"] .exam-c6, .dark-mode .exam-c6   { --card-accent: #d99181; }
[data-theme="dark"] .exam-c7, .dark-mode .exam-c7   { --card-accent: #aabf6a; }
[data-theme="dark"] .exam-c8, .dark-mode .exam-c8   { --card-accent: #b596dd; }
[data-theme="dark"] .exam-c9, .dark-mode .exam-c9   { --card-accent: #6fbecf; }
[data-theme="dark"] .exam-c10, .dark-mode .exam-c10 { --card-accent: #d8849f; }
[data-theme="dark"] .exam-c11, .dark-mode .exam-c11 { --card-accent: #9aa0a8; }
.exam-card[class*="exam-c"] .exam-badge {
  color: color-mix(in srgb, var(--card-accent) 75%, var(--h-text));
  background: color-mix(in srgb, var(--card-accent) 10%, var(--h-surface));
  border-color: color-mix(in srgb, var(--card-accent) 35%, transparent);
}
.exam-card[class*="exam-c"] .exam-icon { color: var(--card-accent); }
/* hover tints the whole card with its own palette hue, not just the border */
/* Hover tint uses the per-theme --card-hover-mix (14% light, 11% dark) so the
   wash is strong enough over near-white in light mode. Flat, no glow/shadow. */
.exam-card:hover {
  border-color: color-mix(in srgb, var(--card-accent, var(--h-accent)) 70%, transparent);
  background: color-mix(in srgb, var(--card-accent, var(--h-accent)) var(--card-hover-mix), var(--h-surface));
  transform: translateY(-1px);
}
.exam-card:focus-visible { outline: 2px solid var(--h-accent); outline-offset: 2px; }
.exam-card.selected { border-color: var(--h-accent); box-shadow: 0 0 0 1px var(--h-accent); }
.exam-card .exam-badge {
  align-self: flex-start;
  font-family: var(--h-font-num);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--h-accent-deep);
  background: var(--h-accent-tint);
  border: 1px solid var(--h-accent-chip-border);
  border-radius: 6px;
  padding: 0.16rem 0.5rem;
  text-transform: none;
}
.exam-card .exam-icon {
  position: absolute;
  top: 1.05rem;
  right: 2.6rem;
  font-size: 1rem;
  color: var(--h-text-faint);
}
.exam-delete {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  background: none;
  border: none;
  color: var(--h-text-faint);
  cursor: pointer;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s;
}
.exam-card:hover .exam-delete, .exam-delete:focus-visible { opacity: 1; }
.exam-delete:hover { color: var(--h-bad); }
.exam-delete:focus-visible { outline: 2px solid var(--h-accent); outline-offset: 1px; }
.exam-card--preview .exam-preview-flag {
  position: absolute;
  top: 1.05rem;
  right: 2.6rem;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--h-flag);
  border: 1px solid var(--h-flag);
  border-radius: 5px;
  padding: 0.1rem 0.4rem;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.exam-card--preview .exam-icon { display: none; }
.exam-title { font-size: 1rem; font-weight: 700; color: var(--h-text); line-height: 1.3; }
.exam-subtitle { font-size: 0.8125rem; color: var(--h-text-soft); line-height: 1.4; }

.exam-taxonomy { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.15rem; }
.exam-taxonomy-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--h-text-soft);
  background: var(--h-surface-soft);
  border: 1px solid var(--h-line);
  border-radius: 999px;
  padding: 0.14rem 0.5rem;
}
.exam-taxonomy-chip i { font-size: 0.6rem; color: var(--h-text-faint); }
.exam-taxonomy-chip--code { color: var(--h-accent-deep); background: var(--h-accent-tint); border-color: var(--h-accent-chip-border); }
.exam-taxonomy-chip--code i { color: var(--h-accent); }

.exam-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--h-line);
  border-radius: var(--h-radius);
  overflow: hidden;
  margin-top: 0.3rem;
}
.exam-stat {
  background: var(--h-surface-soft);
  text-align: center;
  padding: 0.45rem 0.25rem;
  display: flex;
  flex-direction: column;
}
.exam-stat + .exam-stat { border-left: 1px solid var(--h-line); }
.exam-stat-number {
  font-family: var(--h-font-num);
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--h-text);
  font-variant-numeric: tabular-nums;
}
.exam-stat-label {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--h-text-faint);
}
.exam-total-info, .exam-study-info { font-size: 0.74rem; color: var(--h-text-faint); }
.exam-feature {
  font-size: 0.72rem;
  color: var(--h-text-faint);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.exam-card-actions { display: flex; gap: 0.5rem; margin-top: 0.45rem; }
.exam-card-start, .exam-card-study, .exam-card-unlock {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font: inherit;
  font-size: 0.8438rem;
  font-weight: 600;
  border-radius: var(--h-radius);
  padding: 0.5rem 0.6rem;
  min-height: 38px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.exam-card-start { background: var(--h-accent); color: var(--h-btn-primary-text); }
.exam-card-start:hover { background: var(--h-accent-deep); }
.exam-card-study { background: var(--h-surface); border-color: var(--h-line-strong); color: var(--h-text-soft); }
.exam-card-study:hover { border-color: var(--h-accent); color: var(--h-accent); }
.exam-card-unlock { background: var(--h-flag-tint); border-color: var(--h-flag-line); color: var(--h-flag); }
.exam-card-unlock:hover { border-color: var(--h-flag); }
.exam-card-labs {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
  margin-top: 0.45rem;
  font: inherit;
  font-size: 0.8438rem;
  font-weight: 600;
  border-radius: var(--h-radius);
  padding: 0.45rem 0.6rem;
  min-height: 36px;
  text-decoration: none;
  background: var(--h-surface);
  border: 1px solid var(--h-line-strong);
  color: var(--h-text-soft);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.exam-card-labs:hover { border-color: var(--h-accent); color: var(--h-accent); }
.exam-card-labs:focus-visible { outline: 2px solid var(--h-accent); outline-offset: 2px; }
.exam-card-start:focus-visible, .exam-card-study:focus-visible, .exam-card-unlock:focus-visible {
  outline: 2px solid var(--h-accent);
  outline-offset: 2px;
}
.exam-card.importing-exam { opacity: 0.6; pointer-events: none; }

/* ===== Exam details panel ===== */
/* Reads as its own elevated layer so it never blends into the card grid:
   teal top strip, tinted border, faint accent wash and a real shadow. */
.exam-details-placeholder {
  display: none;
  position: relative;
  background: var(--h-surface);
  border: 1px solid var(--h-accent-chip-border);
  border-top: 3px solid var(--h-accent);
  border-radius: var(--h-radius-lg);
  padding: 0;
  overflow: hidden;
  box-shadow: 0 14px 36px color-mix(in srgb, var(--h-text) 14%, transparent);
}
.exam-details-placeholder.visible { display: block; }
/* homepage.js parks the panel inside the exam grid; span every column */
.exam-grid .exam-details-placeholder {
  grid-column: 1 / -1;
  margin: 0.25rem 0 0.4rem;
}
/* graphite cockpit header band: title block on top, action row below,
   close pinned to the corner. Column flow keeps the layout identical no
   matter how long the exam title or taxonomy gets. */
.exam-details-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.85rem;
  margin: 0;
  padding: 1rem 1.25rem 1.05rem;
  background:
    radial-gradient(420px 160px at 85% 0%, rgba(45, 212, 191, 0.1), transparent 70%),
    var(--rail-bg);
  border-bottom: 1px solid var(--rail-line);
  color: var(--rail-text);
}
.exam-details-content {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1rem 1.25rem 1.15rem;
}
.exam-details-title-area h2 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--rail-text-strong);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 0.1rem;
}
.current-exam-indicator {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--accent-bright);
  background: rgba(45, 212, 191, 0.08);
  border: 1px solid rgba(45, 212, 191, 0.4);
  border-radius: 5px;
  padding: 0.12rem 0.45rem;
}
#details-exam-subtitle { font-size: 0.8438rem; color: var(--rail-text); margin: 0 0 0.5rem; }
.details-exam-taxonomy { display: flex; flex-wrap: wrap; gap: 0.35rem; }
/* taxonomy chips sit on the graphite band here */
.details-exam-taxonomy .exam-taxonomy-chip {
  background: var(--rail-bg-soft);
  border-color: var(--rail-line);
  color: var(--rail-text);
}
.details-exam-taxonomy .exam-taxonomy-chip i { color: var(--rail-text); }
.details-exam-taxonomy .exam-taxonomy-chip--code {
  background: rgba(45, 212, 191, 0.1);
  border-color: rgba(45, 212, 191, 0.35);
  color: var(--accent-bright);
}
.details-exam-taxonomy .exam-taxonomy-chip--code i { color: var(--accent-bright); }
/* ghost actions on the band */
.exam-details-header .btn-start-exam-inline.btn-study-inline,
.exam-details-header .btn-start-exam-inline.btn-review-inline {
  background: transparent !important;
  border-color: var(--rail-line) !important;
  color: var(--rail-text) !important;
}
.exam-details-header .btn-start-exam-inline.btn-study-inline:hover,
.exam-details-header .btn-start-exam-inline.btn-review-inline:hover {
  border-color: var(--accent-bright) !important;
  color: var(--accent-bright) !important;
}
/* corner close (X) pinned to the panel's top-right */
.exam-details-header { padding-right: 3.4rem; }
.exam-details-header .btn-close-details {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  width: 32px;
  height: 32px;
  min-height: 0;
  padding: 0;
  justify-content: center;
  background: transparent;
  border-color: var(--rail-line);
  color: var(--rail-text);
}
.exam-details-header .btn-close-details span { display: none; }
.exam-details-header .btn-close-details i { font-size: 0.8rem; }
.exam-details-header .btn-close-details:hover {
  border-color: var(--rail-text);
  color: var(--rail-text-strong);
}
.exam-details-header .btn-close-details:focus-visible {
  outline: 2px solid var(--accent-bright);
  outline-offset: 2px;
}
.exam-details-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
/* legacy style-new.css styles .btn-start-exam with !important; counter it */
.btn-start-exam-inline {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 0.4rem !important;
  min-width: 0 !important;
  margin: 0 !important;
  font: inherit;
  font-size: 0.8125rem !important;
  font-weight: 600 !important;
  text-transform: none !important;
  letter-spacing: normal !important;
  border-radius: var(--h-radius) !important;
  padding: 0.4rem 0.85rem !important;
  min-height: 34px;
  cursor: pointer;
  border: 1px solid transparent !important;
  background: var(--h-accent) !important;
  color: var(--h-btn-primary-text) !important;
  box-shadow: none !important;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.btn-start-exam-inline i { font-size: 0.72rem !important; }
.btn-start-exam-inline::before { content: none !important; }
.btn-start-exam-inline:hover {
  background: var(--h-accent-deep) !important;
  transform: none !important;
  box-shadow: none !important;
}
.btn-start-exam-inline:active { transform: none !important; }
.btn-start-exam-inline.btn-study-inline,
.btn-start-exam-inline.btn-review-inline,
.btn-start-exam-inline.btn-labs-inline {
  background: var(--h-surface) !important;
  border-color: var(--h-line-strong) !important;
  color: var(--h-text-soft) !important;
}
.btn-start-exam-inline.btn-labs-inline { text-decoration: none !important; }
.btn-start-exam-inline.btn-study-inline:hover,
.btn-start-exam-inline.btn-review-inline:hover,
.btn-start-exam-inline.btn-labs-inline:hover {
  border-color: var(--h-accent) !important;
  color: var(--h-accent) !important;
}
.btn-close-details {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  background: none;
  border: 1px solid var(--h-line-strong);
  border-radius: var(--h-radius);
  color: var(--h-text-faint);
  padding: 0.4rem 0.8rem;
  min-height: 34px;
  cursor: pointer;
}
.btn-close-details:hover { color: var(--h-text); border-color: var(--h-text-faint); }
.btn-start-exam-inline:focus-visible, .btn-close-details:focus-visible {
  outline: 2px solid var(--h-accent);
  outline-offset: 2px;
}

.exam-details-section h3 {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--h-text-faint);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.45rem;
}
.exam-details-section h3 i { color: var(--h-accent); font-size: 0.68rem; }

/* exam information: one joined strip, like the card stats */
.info-card-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0;
  margin: 0;
  border: 1px solid var(--h-line);
  border-radius: var(--h-radius);
  overflow: hidden;
}
.info-card {
  background: var(--h-surface-soft);
  border: none;
  border-radius: 0;
  padding: 0.45rem 0.4rem;
  text-align: center;
  box-shadow: none;
  transition: none;
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
}
.info-card + .info-card { border-left: 1px solid var(--h-line); }
.info-card::before { content: none; }
.info-card:hover { transform: none; box-shadow: none; }
[data-theme="dark"] .info-card, .dark-mode .info-card {
  background: var(--h-surface-soft);
  color: var(--h-text);
}
.info-card i { display: none; }
.info-card span { font-weight: 700; font-size: 0.8438rem; color: var(--h-text); }
.info-card small { font-size: 0.6rem; color: var(--h-text-faint); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700; }

.progress-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 0;
  margin-bottom: 0.5rem;
  border: 1px solid var(--h-line);
  border-radius: var(--h-radius);
  overflow: hidden;
}
.progress-item {
  background: var(--h-surface-soft);
  border: none;
  border-radius: 0;
  padding: 0.45rem 0.4rem;
  text-align: center;
  box-shadow: none;
}
.progress-item + .progress-item { border-left: 1px solid var(--h-line); }
[data-theme="dark"] .progress-item, .dark-mode .progress-item { background: var(--h-surface-soft); color: var(--h-text); }
.progress-item:hover { transform: none; }
.progress-label {
  font-size: 0.6rem;
  color: var(--h-text-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  margin-bottom: 0.1rem;
}
.progress-value {
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.35;
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
  -webkit-text-fill-color: currentcolor;
  color: var(--h-text);
}

/* legacy sheets dress this block as a glass card; flatten it */
.modules-and-resources,
[data-theme="dark"] .modules-and-resources,
.dark-mode .modules-and-resources {
  background: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  margin: 0;
}
.modules-and-resources h3 { margin-bottom: 0.45rem; }
.modules-resources-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.1rem;
  align-items: start;
}
/* strip any legacy panel chrome from the two columns */
.modules-resources-grid .modules-section,
.modules-resources-grid .resources-section {
  background: none;
  border: none;
  padding: 0;
  box-shadow: none;
}
.modules-section h4, .resources-section h4 {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--h-text-faint);
  margin-bottom: 0.4rem;
}
.modules-list { list-style: none; margin: 0; padding: 0; }
.modules-list li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--h-text-soft);
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--h-line);
}
[data-theme="dark"] .modules-list li, .dark-mode .modules-list li { border-bottom: 1px solid var(--h-line); }
.modules-list li:last-child { border-bottom: none; }
.modules-list i { color: var(--h-accent); }
.resources-compact { display: flex; flex-direction: column; gap: 0.4rem; margin: 0; }
/* the details panel renders bare <a> elements here (no class); give them
   the same quiet row treatment as .resource-link */
.resources-compact a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.65rem;
  background: var(--h-surface);
  border: 1px solid var(--h-line);
  border-radius: var(--h-radius);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--h-text);
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s;
}
.resources-compact a:hover { border-color: var(--h-accent); color: var(--h-accent); }
.resources-compact a:focus-visible { outline: 2px solid var(--h-accent); outline-offset: 1px; }
.resources-compact a i { color: var(--h-accent); font-size: 0.72rem; width: 14px; text-align: center; }
.resources-compact .muted { font-size: 0.78rem; color: var(--h-text-faint); opacity: 1; }
.resource-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  background: var(--h-surface);
  border: 1px solid var(--h-line);
  border-radius: var(--h-radius);
  font-size: 0.8438rem;
  font-weight: 600;
  color: var(--h-text);
  text-decoration: none;
  transition: border-color 0.15s;
}
.resource-link:hover { transform: none; box-shadow: none; border-color: var(--h-accent); }
.resource-link i { color: var(--h-accent); }
[data-theme="dark"] .resource-link, .dark-mode .resource-link {
  background: var(--h-surface);
  border-color: var(--h-line);
  color: var(--h-text);
}

/* ===== Empty state / drop zone ===== */
.no-exams-section .empty-state {
  text-align: center;
  background: var(--h-surface);
  border: 1px solid var(--h-line);
  border-radius: var(--h-radius-lg);
  padding: 2rem 1.5rem;
}
.empty-icon { font-size: 1.8rem; color: var(--h-text-faint); margin-bottom: 0.5rem; }
.empty-state h3 { color: var(--h-text); margin-bottom: 0.25rem; }
.empty-state p { color: var(--h-text-soft); font-size: 0.875rem; margin-bottom: 1rem; }
.drop-zone-simple {
  border: 2px dashed var(--h-line-strong);
  border-radius: var(--h-radius-lg);
  padding: 1.5rem;
  color: var(--h-text-faint);
  cursor: pointer;
  transition: border-color 0.15s;
}
.drop-zone-simple:hover, .drop-zone-simple.drag-over { border-color: var(--h-accent); color: var(--h-accent); }
.drop-zone-simple i { font-size: 1.4rem; margin-bottom: 0.4rem; }
.btn-import {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font: inherit;
  font-size: 0.8438rem;
  font-weight: 600;
  background: var(--h-accent);
  color: var(--h-btn-primary-text);
  border: none;
  border-radius: var(--h-radius);
  padding: 0.55rem 1.1rem;
  margin-top: 0.75rem;
  cursor: pointer;
}
.btn-import:hover { background: var(--h-accent-deep); }

/* ===== Sidebar cards (stacked below the library) ===== */
.sidebar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0.9rem;
  position: static;
}
.getting-started-card,
.progress-section {
  background: var(--h-surface);
  border: 1px solid var(--h-line);
  border-radius: var(--h-radius-lg);
  padding: 1.1rem 1.2rem;
  box-shadow: var(--h-card-shadow);
}
body:not(.dark-mode) .getting-started-card { background: var(--h-surface); border: 1px solid var(--h-line); }
.getting-started-card .gs-icon { color: var(--h-accent); font-size: 1.3rem; margin-bottom: 0.5rem; }
.getting-started-card h3 { font-size: 0.95rem; color: var(--h-text); margin-bottom: 0.35rem; }
.getting-started-card p { font-size: 0.8125rem; color: var(--h-text-soft); margin-bottom: 0.6rem; }
.gs-points { list-style: none; margin: 0 0 0.8rem; padding: 0; display: flex; flex-direction: column; gap: 0.3rem; }
.gs-points li { font-size: 0.78rem; color: var(--h-text-soft); display: flex; align-items: center; gap: 0.45rem; }
.gs-points i { color: var(--h-accent); font-size: 0.7rem; }
.gs-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8438rem;
  font-weight: 600;
  color: var(--h-accent);
  text-decoration: none;
}
.gs-cta:hover { text-decoration: underline; }

.progress-section h3 {
  font-size: 0.95rem;
  color: var(--h-text);
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.progress-section h3 i { color: var(--h-accent); font-size: 0.85rem; }
.progress-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.btn-progress {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  background: var(--h-surface);
  border: 1px solid var(--h-line-strong);
  color: var(--h-text-soft);
  border-radius: var(--h-radius);
  padding: 0.5rem 0.9rem;
  cursor: pointer;
}
.btn-progress:hover { border-color: var(--h-accent); color: var(--h-accent); }

/* ===== Library tools row ===== */
.home-tools { text-align: center; padding-bottom: 0.5rem; }
.home-tools-label {
  display: block;
  font-size: 0.78rem;
  color: var(--h-text-faint);
  margin-bottom: 0.6rem;
}
.quick-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: center; }
.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font: inherit;
  font-size: 0.8438rem;
  font-weight: 600;
  border-radius: var(--h-radius);
  padding: 0.55rem 1.1rem;
  min-height: 40px;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.action-btn.primary { background: var(--h-accent); color: var(--h-btn-primary-text); }
.action-btn.primary:hover { background: var(--h-accent-deep); }
.action-btn.secondary, .action-btn.public {
  background: var(--h-surface);
  border-color: var(--h-line-strong);
  color: var(--h-text-soft);
}
.action-btn.secondary:hover, .action-btn.public:hover { border-color: var(--h-accent); color: var(--h-accent); }
.action-btn.ghost { background: none; border-color: transparent; color: var(--h-text-faint); }
.action-btn.ghost:hover { color: var(--h-accent); }
.action-btn:focus-visible { outline: 2px solid var(--h-accent); outline-offset: 2px; }

/* ===== Pro modal ===== */
.pro-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: var(--h-overlay);
}
.pro-modal {
  position: relative;
  width: min(440px, 100%);
  background: var(--h-surface);
  border: 1px solid var(--h-line);
  border-radius: var(--h-radius-lg);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
  padding: 1.5rem;
  color: var(--h-text);
}
.pro-modal-close {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  background: none;
  border: none;
  color: var(--h-text-faint);
  width: 32px;
  height: 32px;
  border-radius: var(--h-radius);
  cursor: pointer;
  display: grid;
  place-items: center;
}
.pro-modal-close:hover { color: var(--h-text); background: var(--h-surface-soft); }
.pro-modal-close:focus-visible { outline: 2px solid var(--h-accent); outline-offset: 1px; }
.pro-modal-title { font-size: 1.15rem; font-weight: 700; margin: 0 0 0.4rem; padding-right: 2rem; }
.pro-modal-sub { font-size: 0.875rem; color: var(--h-text-soft); margin: 0 0 0.8rem; }
.pro-modal-list { list-style: none; margin: 0 0 1rem; padding: 0; display: flex; flex-direction: column; gap: 0.4rem; }
.pro-modal-list li { display: flex; align-items: center; gap: 0.5rem; font-size: 0.8438rem; color: var(--h-text-soft); }
.pro-modal-list i { color: var(--h-good); font-size: 0.75rem; }
.pro-modal-buy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  background: var(--h-accent);
  color: var(--h-btn-primary-text);
  border: none;
  border-radius: var(--h-radius);
  padding: 0.7rem 1rem;
  cursor: pointer;
  text-decoration: none;
}
.pro-modal-buy:hover { background: var(--h-accent-deep); }
.pro-modal-divider {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--h-text-faint);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0.9rem 0;
}
.pro-modal-divider::before, .pro-modal-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--h-line);
}
.pro-modal-import {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  font: inherit;
  font-size: 0.8438rem;
  font-weight: 600;
  background: var(--h-surface);
  border: 1px solid var(--h-line-strong);
  color: var(--h-text-soft);
  border-radius: var(--h-radius);
  padding: 0.6rem 1rem;
  cursor: pointer;
}
.pro-modal-import:hover { border-color: var(--h-accent); color: var(--h-accent); }
.pro-modal-activate-text { font-size: 0.74rem; color: var(--h-text-faint); margin-top: 0.6rem; text-align: center; }
.pro-modal-buy:focus-visible, .pro-modal-import:focus-visible { outline: 2px solid var(--h-accent); outline-offset: 2px; }

/* ===== Progress / manage / attempts modals (homepage copies) ===== */
.progress-modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--h-overlay);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  padding: 20px;
}
.progress-modal-content {
  background: var(--h-surface);
  color: var(--h-text);
  border: 1px solid var(--h-line);
  border-radius: var(--h-radius-lg);
  padding: 28px;
  max-width: 640px;
  width: 92%;
  max-height: 82vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}
.progress-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: inherit;
  opacity: 0.6;
  width: 34px;
  height: 34px;
  border-radius: var(--h-radius);
}
.progress-modal-close:hover { opacity: 1; background: var(--h-surface-soft); }
.progress-modal-close:focus-visible { outline: 2px solid var(--h-accent); outline-offset: 1px; }
.progress-modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.progress-modal-title i { color: var(--h-accent); }

/* progress statistics + attempt history (script-multi-exam.js modal) */
.progress-modal-sub { font-size: 0.8438rem; color: var(--h-text-faint); margin-bottom: 16px; }
.progress-stats-list { display: grid; gap: 14px; }
.progress-exam-card {
  background: var(--h-surface-soft);
  border: 1px solid var(--h-line);
  border-radius: var(--h-radius-lg);
  padding: 1rem 1.1rem;
}
.progress-exam-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.7rem;
  gap: 12px;
  flex-wrap: wrap;
}
.progress-exam-name {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--h-text);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}
.progress-exam-name i { color: var(--h-accent); font-size: 0.85rem; }
.progress-best {
  font-family: var(--h-font-num);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  border: 1px solid transparent;
}
.progress-best.passed { background: var(--h-good-tint); color: var(--h-good); border-color: var(--h-good-line); }
.progress-best.failed { background: var(--h-bad-tint); color: var(--h-bad); border-color: var(--h-bad-line); }
.progress-metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  border: 1px solid var(--h-line);
  border-radius: var(--h-radius);
  overflow: hidden;
  margin-bottom: 0.7rem;
}
.progress-metric-tile {
  background: var(--h-surface);
  padding: 0.55rem 0.4rem;
  text-align: center;
}
.progress-metric-tile + .progress-metric-tile { border-left: 1px solid var(--h-line); }
.progress-metric-label {
  color: var(--h-text-faint);
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}
.progress-metric-value {
  font-family: var(--h-font-num);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--h-text);
  font-variant-numeric: tabular-nums;
}
.view-attempts-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font: inherit;
  font-size: 0.8438rem;
  font-weight: 600;
  background: var(--h-surface);
  border: 1px solid var(--h-line-strong);
  color: var(--h-text-soft);
  border-radius: var(--h-radius);
  padding: 0.55rem;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.view-attempts-btn:hover { border-color: var(--h-accent); color: var(--h-accent); }
.view-attempts-btn:focus-visible { outline: 2px solid var(--h-accent); outline-offset: 2px; }
.attempt-card {
  background: var(--h-surface-soft);
  border: 1px solid var(--h-line);
  border-left: 3px solid var(--h-line-strong);
  border-radius: var(--h-radius);
  padding: 0.8rem 0.95rem;
}
.attempt-card.passed { border-left-color: var(--h-good); }
.attempt-card.failed { border-left-color: var(--h-bad); }
.attempt-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.attempt-title {
  font-weight: 700;
  font-size: 0.9375rem;
  color: var(--h-text);
  margin-bottom: 2px;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.attempt-title i { color: var(--h-accent); font-size: 0.8rem; }
.attempt-date-line { font-size: 0.78rem; color: var(--h-text-faint); }
.attempt-modules {
  font-size: 0.74rem;
  color: var(--h-text-soft);
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  line-height: 1.4;
}
.attempt-modules i { color: var(--h-text-faint); }
.attempt-modules-label { font-weight: 600; }
.attempt-modules-text {
  background: var(--h-surface);
  border: 1px solid var(--h-line);
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-block;
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.attempt-right { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.attempt-metric { text-align: center; }
.attempt-metric-label {
  color: var(--h-text-faint);
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}
.attempt-metric-value {
  font-family: var(--h-font-num);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--h-text);
  font-variant-numeric: tabular-nums;
}
.attempt-metric.passed .attempt-metric-value { color: var(--h-good); }
.attempt-metric.failed .attempt-metric-value { color: var(--h-bad); }
.attempt-status-chip {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.attempt-status-chip.passed { background: var(--h-good-tint); color: var(--h-good); border-color: var(--h-good-line); }
.attempt-status-chip.failed { background: var(--h-bad-tint); color: var(--h-bad); border-color: var(--h-bad-line); }
.progress-modal-footer-row { margin-top: 18px; text-align: center; }
.back-to-overview-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font: inherit;
  font-size: 0.8438rem;
  font-weight: 600;
  background: var(--h-surface);
  border: 1px solid var(--h-line-strong);
  color: var(--h-text-soft);
  border-radius: var(--h-radius);
  padding: 0.5rem 1.1rem;
  cursor: pointer;
}
.back-to-overview-btn:hover { border-color: var(--h-accent); color: var(--h-accent); }
.back-to-overview-btn:focus-visible { outline: 2px solid var(--h-accent); outline-offset: 2px; }

/* custom alert (utils.js showCustomAlert) */
.custom-alert-content {
  max-width: 400px;
  text-align: center;
  padding: 30px;
}
.custom-alert-icon { font-size: 2.6rem; margin-bottom: 16px; }
.custom-alert-icon.info { color: var(--h-accent); }
.custom-alert-icon.success { color: var(--h-good); }
.custom-alert-icon.warning { color: var(--h-flag); }
.custom-alert-icon.error { color: var(--h-bad); }
.custom-alert-title { margin: 0 0 8px; font-size: 1.15rem; font-weight: 700; color: var(--h-text); }
.custom-alert-desc { margin: 0 0 20px; font-size: 0.9rem; line-height: 1.5; color: var(--h-text-soft); }
.custom-alert-btn {
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.55rem 1.5rem;
  background: var(--h-accent);
  color: var(--h-btn-primary-text);
  border: none;
  border-radius: var(--h-radius);
  cursor: pointer;
  transition: background 0.15s;
}
.custom-alert-btn:hover { background: var(--h-accent-deep); }
.custom-alert-btn:focus-visible { outline: 2px solid var(--h-accent); outline-offset: 2px; }

/* manage exams (config) */
.config-exam-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 0.2rem;
  border-bottom: 1px solid var(--h-line);
}
.config-exam-item:last-child { border-bottom: none; }
.config-exam-info { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.config-exam-info strong { font-size: 0.9rem; color: var(--h-text); }
.config-exam-info span, .config-exam-images { font-size: 0.74rem; color: var(--h-text-faint); }
.config-exam-actions { display: flex; align-items: center; gap: 0.6rem; }
.config-toggle-wrapper { display: inline-flex; align-items: center; gap: 0.45rem; }
.config-toggle-status { font-size: 0.72rem; font-weight: 700; color: var(--h-text-faint); min-width: 46px; }
.config-switch { position: relative; display: inline-block; width: 42px; height: 24px; flex-shrink: 0; }
.config-switch input { opacity: 0; width: 0; height: 0; }
.config-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--h-line-strong);
  border-radius: 999px;
  transition: background 0.15s;
}
.config-slider::before {
  content: "";
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.15s;
}
.config-switch input:checked + .config-slider { background: var(--h-accent); }
.config-switch input:checked + .config-slider::before { transform: translateX(18px); }
.config-switch input:focus-visible + .config-slider { outline: 2px solid var(--h-accent); outline-offset: 2px; }
.config-delete-btn {
  background: none;
  border: 1px solid var(--h-line-strong);
  color: var(--h-text-faint);
  border-radius: var(--h-radius);
  width: 34px;
  height: 34px;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.config-delete-btn:hover { color: var(--h-bad); border-color: var(--h-bad); }
.config-empty-state { text-align: center; color: var(--h-text-faint); padding: 1.5rem 0; }

/* attempts history / review */
.attempt-history-summary { font-size: 0.8438rem; color: var(--h-text-soft); margin-bottom: 0.8rem; }
.attempt-history-list, .attempt-review-list { display: flex; flex-direction: column; gap: 0.6rem; }
.attempt-history-list > div, .attempt-review-item, .attempt-review-list > div {
  background: var(--h-surface-soft);
  border: 1px solid var(--h-line);
  border-radius: var(--h-radius);
  padding: 0.7rem 0.85rem;
}
.attempt-history-title { font-weight: 700; font-size: 0.875rem; color: var(--h-text); }
.attempt-history-subtitle, .attempt-history-date { font-size: 0.74rem; color: var(--h-text-faint); }
.attempt-history-metrics { display: flex; gap: 0.5rem; flex-wrap: wrap; margin: 0.4rem 0; }
.attempt-small-metric {
  font-family: var(--h-font-num);
  font-size: 0.74rem;
  color: var(--h-text-soft);
  background: var(--h-surface);
  border: 1px solid var(--h-line);
  border-radius: 6px;
  padding: 0.15rem 0.5rem;
}
.attempt-history-actions, .attempt-review-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.4rem; }
.attempt-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--h-surface);
  border: 1px solid var(--h-line-strong);
  color: var(--h-text-soft);
  border-radius: var(--h-radius);
  padding: 0.4rem 0.8rem;
  cursor: pointer;
}
.attempt-action-btn:hover { border-color: var(--h-accent); color: var(--h-accent); }
.attempt-action-btn.primary { background: var(--h-accent); border-color: var(--h-accent); color: var(--h-btn-primary-text); }
.attempt-action-btn.primary:hover { background: var(--h-accent-deep); }
.attempt-review-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.3rem;
}
.attempt-review-answers, .attempt-answer-row { font-size: 0.8125rem; color: var(--h-text-soft); }
.attempt-review-explanation {
  margin-top: 0.4rem;
  padding: 0.5rem 0.7rem;
  background: var(--h-surface);
  border-left: 3px solid var(--h-accent);
  border-radius: 4px;
  font-size: 0.8125rem;
  color: var(--h-text-soft);
}

/* module picker */
.modules-select-controls { display: flex; align-items: center; gap: 0.45rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
.modules-select-btn {
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  background: var(--h-surface);
  border: 1px solid var(--h-line-strong);
  color: var(--h-text-soft);
  border-radius: 6px;
  padding: 0.25rem 0.6rem;
  cursor: pointer;
}
.modules-select-btn:hover { border-color: var(--h-accent); color: var(--h-accent); }
.modules-select-btn:focus-visible { outline: 2px solid var(--h-accent); outline-offset: 1px; }
.modules-select-separator { color: var(--h-text-faint); }
.selectable-list { display: flex; flex-direction: column; gap: 0.35rem; max-height: 320px; overflow-y: auto; }
/* module li = clickable row; .module-checkbox-wrapper only hosts the box */
.modules-list li { cursor: pointer; border-radius: 6px; padding: 0.4rem 0.45rem; }
.modules-list li:hover { background: var(--h-accent-tint); }
.modules-list li:focus-visible { outline: 2px solid var(--h-accent); outline-offset: 1px; }
.module-item-content {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex: 1;
  min-width: 0;
}
.module-checkbox-wrapper { display: inline-flex; }
.module-checkbox-custom {
  width: 18px;
  height: 18px;
  min-width: 18px;
  border: 2px solid var(--h-line-strong);
  border-radius: 5px;
  display: grid;
  place-items: center;
  transition: border-color 0.12s, background 0.12s;
}
.checked .module-checkbox-custom {
  background: var(--h-accent);
  border-color: var(--h-accent);
}
.checked .module-checkbox-custom::after {
  content: "";
  width: 9px;
  height: 5px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: translateY(-1px) rotate(-45deg);
}
.module-icon { color: var(--h-accent); font-size: 0.8rem; }
.module-item-title { font-size: 0.8438rem; color: var(--h-text); }
.module-qcount-badge {
  margin-left: auto;
  font-family: var(--h-font-num);
  font-size: 0.7rem;
  color: var(--h-text-faint);
  background: var(--h-surface-soft);
  border: 1px solid var(--h-line);
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
}

/* ===== Manage exams modal (static markup, JS toggles display:flex) ===== */
.config-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--h-overlay);
  z-index: 11000;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow: auto;
}
.config-modal-content {
  background: var(--h-surface);
  color: var(--h-text);
  border: 1px solid var(--h-line);
  border-radius: var(--h-radius-lg);
  padding: 28px;
  max-width: 640px;
  width: 92%;
  max-height: 82vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}
.config-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: inherit;
  opacity: 0.6;
  width: 34px;
  height: 34px;
  border-radius: var(--h-radius);
}
.config-modal-close:hover { opacity: 1; background: var(--h-surface-soft); }
.config-modal-close:focus-visible { outline: 2px solid var(--h-accent); outline-offset: 1px; }
.config-modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.config-modal-title i { color: var(--h-accent); }
.config-modal-desc { font-size: 0.8438rem; color: var(--h-text-soft); margin-bottom: 14px; }
.config-modal-list { display: flex; flex-direction: column; }
.config-modal-footer {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--h-line);
  font-size: 0.78rem;
  color: var(--h-text-faint);
}
.config-modal-footer i { color: var(--h-accent); }

/* ===== Import progress modal (JS toggles .active) ===== */
#import-progress-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--h-overlay);
  z-index: 13000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
#import-progress-modal.active { display: flex; }
.import-progress-content {
  background: var(--h-surface);
  color: var(--h-text);
  border: 1px solid var(--h-line);
  border-radius: var(--h-radius-lg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  padding: 1.75rem 2rem;
  width: min(420px, 100%);
  text-align: center;
}
.import-progress-icon { font-size: 1.6rem; color: var(--h-accent); margin-bottom: 0.6rem; }
.import-progress-title { font-size: 1.05rem; font-weight: 700; margin-bottom: 0.2rem; }
.import-progress-subtitle { font-size: 0.8438rem; color: var(--h-text-soft); margin-bottom: 1rem; }
.import-progress-bar-container {
  height: 6px;
  background: var(--h-line);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 0.6rem;
}
.import-progress-bar {
  height: 100%;
  width: 0;
  background: var(--h-accent);
  border-radius: 999px;
  transition: width 0.3s ease;
}
.import-progress-stats {
  display: flex;
  justify-content: space-between;
  font-family: var(--h-font-num);
  font-size: 0.78rem;
  color: var(--h-text-faint);
}

/* ===== Responsive ===== */
@media (max-width: 880px) {
  .hero-banner__inner { grid-template-columns: 1fr; gap: 1.25rem; padding: 1.5rem 1.4rem; }
  .home-steps { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .hero-banner .hero-trust { display: none; }
  .quick-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .exam-grid { grid-template-columns: 1fr; }
  .exam-details-actions { width: 100%; }
  .section-subtitle { display: none; }
  .theme-controls .theme-public-link span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ===== Roadmap entry card (home-board) ===== */
.roadmap-entry-card {
	display: flex; align-items: center; gap: 0.85rem;
	padding: 0.9rem 1.1rem; margin: 0 0 1rem;
	background: var(--h-panel, var(--h-surface));
	border: 1px solid var(--border, rgba(127,127,127,0.25));
	border-radius: 12px; color: inherit; text-decoration: none;
}
.roadmap-entry-card:hover { border-color: var(--accent, #0f766e); }
.roadmap-entry-card > .fa-route { font-size: 1.4rem; color: var(--accent, #0f766e); }
.roadmap-entry-card strong { display: block; }
.roadmap-entry-card small { opacity: 0.8; }
.roadmap-entry-card .roadmap-entry-arrow { margin-left: auto; opacity: 0.6; }
