:root {
  --bg: #0e1117;
  --panel: #161b22;
  --panel-2: #1f2630;
  --panel-3: #2a313c;
  --text: #e6edf3;
  --muted: #8b949e;
  --border: #30363d;
  --accent: #58a6ff;
  --link: #58a6ff;
  /* Tier accent: used for text labels, pills, borders. Saturated tones
     so they read on the dark panel background. */
  --tier-introductory: #93b8d8;
  --tier-foundational: #5fa8e6;
  --tier-associate:    #5fcc94;
  --tier-professional: #f0c84a;
  --tier-expert:       #ff7a7a;
  --tier-specialty:    #c89bf2;
  /* Arrow colors — bright on dark */
  --rel-prereq: #a5b4fc;
  --rel-next:   #6ee7b7;
}

[data-theme="light"] {
  --bg: #ffffff;
  --panel: #f6f8fa;
  --panel-2: #ffffff;
  --panel-3: #eaeef2;
  --text: #1f2328;
  --muted: #57606a;
  --border: #d0d7de;
  --accent: #0969da;
  --link: #0969da;
  /* Tier accent: deeper / more saturated so they read on white */
  --tier-introductory: #4a6584;
  --tier-foundational: #1a6dba;
  --tier-associate:    #1f7a4f;
  --tier-professional: #966b00;
  --tier-expert:       #c0392b;
  --tier-specialty:    #6d28d9;
  /* Arrow colors — darker on light for contrast */
  --rel-prereq: #4338ca;
  --rel-next:   #047857;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Kaku Gothic ProN", "Noto Sans CJK JP", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.4;
  display: flex;
  flex-direction: column;
  /* Reserve space for the fixed About footer at the bottom of the viewport. */
  padding-bottom: 38px;
  transition: padding-bottom 0.18s ease-out;
}
/* When a cert is selected, the detail panel slides up from above the
   footer. We grow body's padding-bottom by the panel's max-height so the
   matrix-wrap (flex:1) shrinks correspondingly and the bottom-most tier
   (Introductory) stays scrollable into view rather than hidden. */
body.detail-open { padding-bottom: calc(38px + 45vh); }

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ----------------------- Top bar ----------------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  padding: 0.4rem 0.8rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.topbar h1 { font-size: 1rem; margin: 0; font-weight: 600; }
.topbar h1 .byline {
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--muted);
  margin-left: 0.5rem;
  letter-spacing: 0.02em;
}
.topbar-nav { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.topbar-nav a { color: var(--muted); font-size: 0.86rem; padding: 0 0.3rem; }
.topbar-nav a:hover { color: var(--text); }

.icon-btn {
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.83rem;
  font-family: inherit;
  line-height: 1.2;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }
.icon-btn[aria-pressed="true"] {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.theme-label::before { content: "🌙 Dark"; }
[data-theme="light"] .theme-label::before { content: "☀️ Light"; }

/* ----------------------- Header search ----------------------- */
.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
#search-input {
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.25rem 1.6rem 0.25rem 0.6rem;
  border-radius: 6px;
  font-size: 0.83rem;
  font-family: inherit;
  width: 200px;
  outline: none;
  transition: border-color 0.1s, width 0.15s;
}
#search-input:focus { border-color: var(--accent); width: 240px; }
#search-input::-webkit-search-cancel-button { display: none; }
.search-clear {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 4px;
  display: none;
}
.search-clear:hover { background: var(--panel-3); color: var(--text); }
body.has-search .search-clear { display: inline-block; }

/* ----------------------- Search match highlight + non-match dim ----------------------- */
/* Matched cards get a warm-yellow border + soft glow + slight scale, on
   top of any selection / relationship state. */
.cert-card.search-match {
  border-color: #ffb84d;
  box-shadow: 0 0 0 2px rgba(255, 184, 77, 0.55), 0 0 8px rgba(255, 184, 77, 0.5);
  z-index: 3;
}
[data-theme="light"] .cert-card.search-match {
  border-color: #d97706;
  box-shadow: 0 0 0 2px rgba(217, 119, 6, 0.45), 0 0 8px rgba(217, 119, 6, 0.4);
}
/* Dim everything that isn't a match (only when a search is actively
   running — empty query removes the body class). Selection still wins
   visually because .selected gets its own bright outline above. */
body.has-search .cert-card:not(.search-match):not(.selected) {
  opacity: 0.28;
  filter: grayscale(0.4);
}

/* ----------------------- Vendor filter panel ----------------------- */
.vendor-panel {
  position: absolute;
  top: 100%;
  right: 1rem;
  width: 320px;
  max-height: 60vh;
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  display: none;
  z-index: 40;
}
.vendor-panel.open { display: block; }
.vendor-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}
.vendor-actions { display: flex; gap: 0.4rem; }
.vendor-actions .link {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
}
.vendor-actions .link:hover { text-decoration: underline; }
.vendor-list { display: flex; flex-direction: column; gap: 0.15rem; }
.vendor-row {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0.15rem 0.3rem;
  border-radius: 4px;
}
.vendor-row:hover { background: var(--panel-2); }
.vendor-row .vendor-count { color: var(--muted); font-size: 0.75rem; }
.vendor-row input { accent-color: var(--accent); }

/* ----------------------- Status / legend bar ----------------------- */
.controls {
  padding: 0.3rem 0.8rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 42px;
  z-index: 25;
  font-size: 0.78rem;
}
.meta { color: var(--muted); }
.legend { color: var(--muted); display: flex; gap: 1rem; flex-wrap: wrap; margin-left: auto; }
.legend .lg-prereq { color: var(--rel-prereq); }
.legend .lg-next { color: var(--rel-next); }
.legend .lg-depth { font-size: 0.78rem; opacity: 0.8; }
.legend .lg-hint { font-size: 0.78rem; }

/* ----------------------- Matrix grid ----------------------- */
.matrix-wrap {
  flex: 1;
  overflow: auto;
  padding: 0;
}
.grid-and-arrows {
  position: relative;
  /* No min-width: the grid shrinks to fill the viewport width.
     Cards inside dense cells wrap to multiple rows instead of pushing
     the matrix horizontally. */
  min-width: 0;
  min-height: 100%;
}

.roadmap-grid {
  display: grid;
  grid-template-columns: 100px;
  background: var(--bg);
  position: relative;
  z-index: 1;
}
.roadmap-grid .loading { padding: 1.2rem; color: var(--muted); grid-column: 1 / -1; }

.cell, .domain-head, .tier-head, .corner {
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--panel-2);
}

.corner {
  position: sticky;
  top: 0;
  left: 0;
  z-index: 12;
  background: var(--panel);
  text-align: center;
  font-size: 0.55rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.2rem;
}

.domain-head {
  position: sticky;
  top: 0;
  z-index: 8;
  background: var(--panel);
  text-align: center;
  font-size: 0.66rem;
  font-weight: 600;
  color: var(--text);
  padding: 0.25rem 0.2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  min-height: 36px;
}
.domain-head .swatch { width: 7px; height: 7px; border-radius: 2px; }
.domain-head .label { line-height: 1.1; }

.tier-head {
  position: sticky;
  left: 0;
  z-index: 7;
  background: var(--panel);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-right: 1px solid var(--border);
  padding: 0.25rem 0.1rem;
}
.tier-head[data-tier="introductory"] { color: var(--tier-introductory); }
.tier-head[data-tier="foundational"] { color: var(--tier-foundational); }
.tier-head[data-tier="associate"]    { color: var(--tier-associate); }
.tier-head[data-tier="professional"] { color: var(--tier-professional); }
.tier-head[data-tier="expert"]       { color: var(--tier-expert); }
.tier-head[data-tier="specialty"]    { color: var(--tier-specialty); }

.cell {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5px;
  padding: 2px;
  align-content: flex-start;
  justify-content: center;
  min-height: 32px;
  background: var(--panel-2);
}
.cell.empty { background: var(--bg); }
/* Density-adaptive cells: tighter gap + padding when many cards must fit. */
.cell.cell-medium     { gap: 1.5px; padding: 1.5px; }
.cell.cell-dense      { gap: 1px;   padding: 1.5px; }
.cell.cell-very-dense { gap: 1px;   padding: 1px; }
/* Subtle tier-tinted background — uses color-mix so it works on both
   themes without needing per-theme overrides. The 9% mix keeps the
   panel-2 background dominant; the tier color only hints. */
.cell[data-tier="introductory"] { background: color-mix(in srgb, var(--tier-introductory) 9%, var(--panel-2)); border-left: 3px solid var(--tier-introductory); }
.cell[data-tier="foundational"] { background: color-mix(in srgb, var(--tier-foundational) 9%, var(--panel-2)); border-left: 3px solid var(--tier-foundational); }
.cell[data-tier="associate"]    { background: color-mix(in srgb, var(--tier-associate)    9%, var(--panel-2)); border-left: 3px solid var(--tier-associate); }
.cell[data-tier="professional"] { background: color-mix(in srgb, var(--tier-professional) 9%, var(--panel-2)); border-left: 3px solid var(--tier-professional); }
.cell[data-tier="expert"]       { background: color-mix(in srgb, var(--tier-expert)       9%, var(--panel-2)); border-left: 3px solid var(--tier-expert); }
.cell[data-tier="specialty"]    { background: color-mix(in srgb, var(--tier-specialty)    9%, var(--panel-2)); border-left: 3px solid var(--tier-specialty); }

/* ----------------------- Cert cards (2:1 landscape, abbr-only, compact) ----------------------- */
.cert-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  width: 52px;
  height: 26px;            /* roughly 2:1 width:height */
  padding: 1px 2px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--panel-3);
  color: var(--text);
  cursor: pointer;
  position: relative;
  text-decoration: none;
  overflow: hidden;
  transition: transform 0.06s ease-out, border-color 0.1s;
  flex: 0 0 auto;
}
.cert-card:hover {
  border-color: var(--accent);
  text-decoration: none;
  transform: translateY(-1px);
}
.cert-card .abbr {
  font-weight: 700;
  font-size: 0.6rem;
  line-height: 1.05;
  word-break: break-word;
  max-width: 100%;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Density-adaptive card sizing — applied via the cell's density class.
   Cards in dense cells shrink uniformly so all cards in the same cell
   stay aligned (avoids ragged rows). The clickable area never goes
   below ~40×18px to keep mouse / touch targets reasonable. */
.cell.cell-medium .cert-card     { width: 48px; height: 24px; }
.cell.cell-medium .cert-card .abbr     { font-size: 0.56rem; }
.cell.cell-dense  .cert-card     { width: 44px; height: 22px; padding: 1px; }
.cell.cell-dense  .cert-card .abbr     { font-size: 0.54rem; line-height: 1; }
.cell.cell-very-dense .cert-card { width: 42px; height: 20px; padding: 0 1px; border-radius: 2px; }
.cell.cell-very-dense .cert-card .abbr { font-size: 0.52rem; line-height: 1; }
/* Vendor name is intentionally hidden on the compact card.
   Full vendor info appears in the detail panel and the cert hover title. */
.cert-card .vendor { display: none; }
.cert-card.jp::before {
  content: "";
  position: absolute;
  top: 1px;
  right: 1px;
  width: 5px;
  height: 5px;
  background: #d32f2f;
  border-radius: 50%;
  z-index: 2;
}

/* Unavailable certs (paused / retired / coming-soon) get a striped overlay
   and dimmed body so they are clearly not actionable but still visible
   for context (e.g. OSMR sitting next to its OffSec siblings). */
.cert-card.unavail {
  opacity: 0.62;
}
.cert-card.unavail .abbr {
  text-decoration: line-through;
  text-decoration-color: rgba(255,255,255,0.5);
}
[data-theme="light"] .cert-card.unavail .abbr {
  text-decoration-color: rgba(0,0,0,0.4);
}
.cert-card.unavail::after {
  content: attr(data-avail);
  position: absolute;
  bottom: 1px;
  left: 2px;
  font-size: 0.5rem;
  letter-spacing: 0.06em;
  font-weight: 700;
  color: white;
  background: #b04848;
  padding: 0 3px;
  border-radius: 2px;
  line-height: 1.2;
}
.cert-card.unavail-paused::after    { content: "PAUSED";  background: #b08428; }
.cert-card.unavail-retired::after   { content: "RETIRED"; background: #6e7378; }
.cert-card.unavail-coming-soon::after { content: "SOON";  background: #2f78b6; }
.cert-card.selected {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  z-index: 4;
}
.cert-card.rel-prereq {
  outline: 2px solid var(--rel-prereq);
  outline-offset: 1px;
  z-index: 3;
}
.cert-card.rel-next {
  outline: 2px dashed var(--rel-next);
  outline-offset: 1px;
  z-index: 3;
}
/* Depth-2 and depth-3 related cards get fainter outlines */
.cert-card.rel-d2 { outline-width: 1.5px; }
.cert-card.rel-d3 { outline-width: 1px;   }

/* When a cert is selected, fade unrelated cards so the selected one and its
   relationship neighbours pop. Body class is toggled by app.js. */
body.has-selection .cert-card {
  transition: opacity 0.15s ease-out, filter 0.15s ease-out;
}
body.has-selection .cert-card:not(.selected):not(.rel-prereq):not(.rel-next) {
  opacity: 0.18;
  filter: grayscale(0.7);
}
body.has-selection .cert-card.selected,
body.has-selection .cert-card.rel-prereq,
body.has-selection .cert-card.rel-next {
  opacity: 1;
  filter: none;
}

/* ----------------------- Arrow overlay ----------------------- */
#arrows-overlay {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 2;
}

/* ----------------------- Right-click context menu ----------------------- */
.cert-context-menu {
  position: fixed;
  z-index: 60;
  min-width: 180px;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.45);
  padding: 4px;
  font-size: 0.85rem;
  user-select: none;
}
.cert-context-menu .ctx-header {
  padding: 6px 10px 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
  font-weight: 700;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.cert-context-menu .ctx-vendor {
  font-weight: 400;
  font-size: 0.7rem;
  color: var(--muted);
}
.cert-context-menu .ctx-item {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  color: var(--text);
  padding: 6px 10px;
  border-radius: 4px;
  cursor: pointer;
  font: inherit;
}
.cert-context-menu .ctx-item:hover:not(:disabled) {
  background: var(--accent);
  color: white;
}
.cert-context-menu .ctx-item:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ----------------------- Detail panel ----------------------- */
/* Use a fixed `height` (not `max-height`) so the panel always exactly fills
   the area body.detail-open reserves via padding-bottom. Otherwise short
   cert details leave a visible empty gap between the panel and the matrix. */
.detail-panel {
  position: fixed;
  bottom: 38px;            /* sits above the fixed About footer */
  left: 0;
  right: 0;
  height: 45vh;
  overflow-y: auto;
  background: var(--panel);
  border-top: 2px solid var(--accent);
  padding: 0.8rem 1rem 1.2rem;
  transform: translateY(calc(100% + 38px));
  transition: transform 0.18s ease-out;
  z-index: 50;
  font-size: 0.85rem;
  box-shadow: 0 -8px 24px rgba(0,0,0,0.35);
}
.detail-panel.open { transform: translateY(0); }

/* ----------------------- Floating "Show details" CTA -----------------------
   Visible only when a cert is selected (body.has-selection) AND the panel
   has been dismissed (body.panel-dismissed). Sits above the About footer. */
.show-details-cta {
  position: fixed;
  right: 1rem;
  bottom: calc(38px + 1rem);
  z-index: 46;
  display: none;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.9rem;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 999px;
  font: 600 0.85rem/1 inherit;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0,0,0,0.35);
  transition: transform 0.12s ease-out, box-shadow 0.12s ease-out;
}
.show-details-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.42);
}
body.has-selection.panel-dismissed .show-details-cta { display: inline-flex; }

.detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
  margin-bottom: 0.6rem;
  flex-wrap: wrap;
}
.detail-title { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.detail-abbr {
  font-weight: 800;
  font-size: 1.05rem;
}
.detail-name { color: var(--muted); font-size: 0.92rem; }
.detail-actions { display: flex; align-items: center; gap: 0.5rem; }
.detail-link {
  background: var(--accent);
  color: white;
  padding: 0.3rem 0.7rem;
  border-radius: 6px;
  font-size: 0.83rem;
}
.detail-link:hover { text-decoration: none; opacity: 0.9; }

.tier-pill {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 99px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--panel-3);
}
.tier-pill[data-tier="introductory"] { background: var(--tier-introductory); color: white; }
.tier-pill[data-tier="foundational"] { background: var(--tier-foundational); color: white; }
.tier-pill[data-tier="associate"]    { background: var(--tier-associate);    color: white; }
.tier-pill[data-tier="professional"] { background: var(--tier-professional); color: white; }
.tier-pill[data-tier="expert"]       { background: var(--tier-expert);       color: white; }
.tier-pill[data-tier="specialty"]    { background: var(--tier-specialty);    color: white; }

.jp-badge {
  background: #d32f2f;
  color: white;
  font-size: 0.65rem;
  padding: 1px 6px;
  border-radius: 3px;
  letter-spacing: 0.04em;
}

.avail-badge {
  font-size: 0.65rem;
  padding: 1px 6px;
  border-radius: 3px;
  letter-spacing: 0.05em;
  font-weight: 700;
  color: white;
  background: #b08428;
}
.avail-badge.avail-paused      { background: #b08428; }
.avail-badge.avail-retired     { background: #6e7378; }
.avail-badge.avail-coming-soon { background: #2f78b6; }

.avail-banner {
  margin: 0 0 0.6rem;
  padding: 0.5rem 0.7rem;
  border-radius: 5px;
  background: rgba(176,132,40,0.12);
  border-left: 3px solid #b08428;
  font-size: 0.85rem;
}
.avail-banner.avail-retired     { background: rgba(110,115,120,0.16); border-left-color: #6e7378; }
.avail-banner.avail-coming-soon { background: rgba(47,120,182,0.14);  border-left-color: #2f78b6; }
.avail-banner strong { color: var(--text); }

/* ----------------------- Detail panel: 4-zone layout ----------------------- */
/* Zones flow vertically with prominent / de-emphasized weighting:
   1. zone-quick     — at-a-glance facts (most prominent)
   2. zone-relations — roadmap context
   3. zone-ai        — AI evaluation (clearly demarcated)
   4. zone-evidence  — supporting facts (smallest, muted)                  */
.detail-panel .zone {
  margin-top: 0.6rem;
  padding: 0.5rem 0.6rem;
  border-radius: 6px;
  background: var(--panel-2);
  border: 1px solid var(--border);
}
.detail-panel .zone-head {
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 0.07em;
  font-weight: 700;
  margin-bottom: 0.4rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--border);
}
/* Zone 1: At-a-glance — give it the strongest emphasis (slight tier-blue
   left accent, larger font in vendor/cta) */
.detail-panel .zone-quick {
  background: var(--panel-3);
  border-left: 3px solid var(--accent);
}
.quick-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(280px, 1.2fr);
  gap: 0.8rem 1.6rem;
}
.quick-meta { display: flex; flex-direction: column; gap: 0.45rem; }
.meta-row { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.meta-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 0.06em;
  font-weight: 600;
  min-width: 60px;
}
.meta-vendor {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
}
.meta-vendor:hover { color: var(--accent); }
.meta-cta { margin-top: 0.3rem; gap: 0.5rem; }
.cta-primary {
  background: var(--accent);
  color: white !important;
  padding: 0.35rem 0.85rem;
  border-radius: 5px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  display: inline-block;
}
.cta-primary:hover { opacity: 0.9; text-decoration: none; }
.cta-secondary {
  color: var(--accent);
  font-size: 0.8rem;
  text-decoration: none;
  padding: 0.3rem 0.4rem;
}
.cta-secondary:hover { text-decoration: underline; }
.domain-pill {
  display: inline-block;
  font-size: 0.74rem;
  padding: 1px 7px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
}
.detail-panel .zone-quick .domain-pill { background: var(--panel); }
.quick-logistics { font-size: 0.82rem; }
.quick-logistics li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 2px 0;
  border-bottom: 1px dashed var(--border);
}
.quick-logistics .kv-key { color: var(--muted); flex-shrink: 0; }
.quick-logistics .kv-val { text-align: right; }

/* Zone 2: Roadmap context */
.rel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0.6rem 1.4rem;
}

/* Zone 3: AI evaluation (clearly marked as AI judgment) */
.detail-panel .zone-ai {
  background: color-mix(in srgb, var(--accent) 6%, var(--panel-2));
  border-left: 3px solid var(--accent);
}
.zone-head-ai { color: var(--accent); }
.ai-rationale {
  font-size: 0.88rem;
  margin: 0 0 0.45rem;
  font-style: italic;
  color: var(--text);
}
.ai-meta { margin-top: 0.4rem; font-size: 0.7rem; }

/* Zone 4: Supporting evidence (de-emphasized) */
.detail-panel .zone-evidence { background: transparent; }
.zone-head-evidence { opacity: 0.75; }
.evidence-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.5rem 1.2rem;
  font-size: 0.78rem;
}
.evidence-grid h5 {
  margin: 0 0 0.2rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 0.06em;
  font-weight: 600;
}

/* Universal lists used inside zones (factors / sources / personas) */
.detail-panel ul.factors,
.detail-panel ul.sources,
.detail-panel ul.personas {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.detail-panel ul.factors li,
.detail-panel ul.sources li,
.detail-panel ul.personas li {
  word-break: break-word;
}
.detail-panel .muted { color: var(--muted); }
.detail-panel .small { font-size: 0.72rem; }
.detail-panel ul.personas { font-size: 0.85rem; gap: 0.3rem; }
.weight { color: var(--muted); font-size: 0.7rem; }
.rel-block { margin-bottom: 0.6rem; }
.rel-list { display: flex; flex-direction: column; gap: 0.35rem !important; }
.rel-list li {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 4px 8px;
  border-left: 3px solid var(--border);
  background: var(--panel-2, transparent);
  border-radius: 0 4px 4px 0;
}
.rel-list a {
  display: inline-flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 2px 0;
}
.rel-list .missing { color: var(--muted); }
.rel-rationale { font-size: 0.74rem; line-height: 1.35; padding-left: 0; }

/* Required prerequisites — strong red accent (these are HARD prereqs). */
.rel-list.required li {
  border-left-color: var(--tier-expert, #ff5252);
  background: color-mix(in srgb, var(--tier-expert, #ff5252) 6%, transparent);
}

/* Recommended prior certs — muted neutral; per-entry source badge supplies
   the visual distinction between official / vendor-ladder / community. */
.rel-list.recommended li { border-left-color: var(--tier-associate, #4caf50); }

/* Source provenance badges */
.src-badge {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 1px 5px;
  border-radius: 3px;
  margin-right: 0.35rem;
  vertical-align: 1px;
  text-transform: uppercase;
}
.src-official-recommended { background: rgba(88, 166, 255, 0.18); color: #58a6ff; border: 1px solid rgba(88, 166, 255, 0.4); }
.src-vendor-ladder        { background: rgba(180, 180, 180, 0.15); color: var(--muted); border: 1px solid rgba(180, 180, 180, 0.3); }
.src-community            { background: rgba(255, 178, 102, 0.15); color: #ffb266;     border: 1px solid rgba(255, 178, 102, 0.35); }

[data-theme="light"] .src-official-recommended { background: rgba(8, 87, 175, 0.12); color: #0857af; border-color: rgba(8, 87, 175, 0.3); }
[data-theme="light"] .src-vendor-ladder        { background: rgba(80, 80, 80, 0.08);  color: #555;    border-color: rgba(80, 80, 80, 0.25); }
[data-theme="light"] .src-community            { background: rgba(189, 99, 0, 0.12);  color: #bd6300; border-color: rgba(189, 99, 0, 0.3); }

.src-evidence {
  margin-left: 0.2rem;
  font-size: 0.7rem;
  text-decoration: none;
  color: var(--muted);
}
.src-evidence:hover { color: var(--accent, #58a6ff); }

/* ----------------------- About footer (fixed, always visible) ----------------------- */
.about {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 38px;
  padding: 0 1rem;
  background: var(--panel);
  color: var(--muted);
  font-size: 0.78rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  z-index: 45;            /* below detail-panel (50) but above grid */
}
.about .about-block { display: inline; }
.about .about-sep { color: var(--border); }
.about .about-version { margin-left: auto; font-size: 0.72rem; opacity: 0.85; }
.about .about-version a { color: var(--muted); }
.about .about-version a:hover { color: var(--accent); }
.about a { color: var(--link); }

@media (max-width: 900px) {
  .topbar h1 { font-size: 0.9rem; }
  .topbar-nav { gap: 0.4rem; }
  .topbar-nav a { font-size: 0.78rem; }
  .icon-btn { padding: 0.2rem 0.5rem; font-size: 0.78rem; }
  .vendor-panel { right: 0.4rem; width: calc(100vw - 0.8rem); max-width: 360px; }
  .legend .lg-hint { display: none; }
}
