/* Skin Oncology — preview stylesheet
   Brand palette aligned to skinoncology.net logo:
     · Primary navy        — #0E2D4D
     · Brand teal (accent) — #4FA1AA
     · Lesion terracotta   — #C77F40
*/

:root {
  --ink: #0D1114;
  --ink-soft: #2A2F34;
  --ink-muted: #5A6169;
  --ink-subtle: #8A9098;
  --paper: #FBFBFB;
  --paper-soft: #F2F4F6;
  --paper-warm: #E8ECF0;

  /* Brand primary — deep navy from the logo's magnifying glass + 'skin' wordmark */
  --primary: #0E2D4D;
  --primary-dark: #061528;
  --primary-light: #1F4870;
  --primary-mist: #DCE3EE;

  /* Brand accent — teal from the logo's 'oncology' wordmark and skin waves */
  --accent: #4FA1AA;
  --accent-dark: #347880;
  --accent-mist: #DDEAEC;

  /* Lesion-orange highlight — used sparingly as the warm pop colour */
  --terracotta: #C77F40;
  --terracotta-dark: #934F2A;

  /* Clinical signal colours (unchanged) */
  --clinical-red: #9B2C2C;
  --clinical-amber: #B7791F;
  --clinical-green: #2F6D4C;
  --clinical-blue: #1E4E8C;

  --line: #D7DDE5;
  --radius: 8px;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --serif: "Source Serif 4", "Source Serif Pro", Georgia, serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5 {
  font-family: var(--serif);
  color: var(--ink);
  letter-spacing: -0.01em;
  text-wrap: balance;
  margin: 0;
}

a { color: var(--primary); }
a:hover { color: var(--primary-dark); }

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 2px;
}

img { max-width: 100%; height: auto; display: block; }

.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }
.container-prose { max-width: 720px; margin: 0 auto; padding: 0 24px; }

.page-main {
  padding-top: 32px;
  padding-bottom: 64px;
}
.page-main-narrow {
  max-width: 880px;
}
.page-title {
  font-size: 44px;
  font-weight: 600;
  margin-top: 16px;
}
.page-lede {
  margin-top: 12px;
  max-width: 760px;
  color: var(--ink-muted);
  font-size: 17px;
  line-height: 1.55;
}
.page-lede-compact {
  margin-top: 8px;
  color: var(--ink-muted);
}
@media (max-width: 640px) {
  .page-title { font-size: 38px; }
}

/* --------------------- header --------------------- */
.site-header {
  position: sticky; top: 0; z-index: 30;
  background: rgba(251, 249, 244, 0.88);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .inner {
  display: flex; align-items: center; gap: 24px;
  height: 64px;
}
.logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: var(--primary);
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1;
}
.logo-img {
  display: block;
  height: 40px;
  width: auto;
  max-width: 100%;
}
.logo-img-compact { display: none; height: 36px; width: auto; }
.logo .dot { color: var(--accent); }
.logo .suffix {
  margin-left: 8px;
  font-family: var(--sans);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--ink-muted);
  font-weight: 500;
}
/* Footer logo (icon-only at the start of footer brand block) */
.site-footer .logo-img { height: 48px; }
@media (max-width: 640px) {
  .logo-img { display: none; }
  .logo-img-compact { display: block; }
}
.nav { display: flex; gap: 4px; align-items: center; }
.nav a {
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-soft);
  text-decoration: none;
}
.nav a:hover { background: var(--paper-soft); color: var(--primary); }
.nav a.current { color: var(--primary); }

/* Nav dropdown ("CPD ▾") — button toggles a small menu of CPD items.
   Works on hover (desktop) AND click/tap (mobile) via JS in script.js. */
.nav-dropdown { position: relative; }
.nav-dropdown-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 12px;
  border-radius: 6px;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-soft);
  background: transparent;
  border: 0;
  cursor: pointer;
}
.nav-dropdown-toggle:hover,
.nav-dropdown-toggle:focus-visible { background: var(--paper-soft); color: var(--primary); outline: none; }
.nav-dropdown.current > .nav-dropdown-toggle { color: var(--primary); }
.nav-dropdown-caret { font-size: 10px; transition: transform 0.15s ease; }
.nav-dropdown[aria-expanded="true"] > .nav-dropdown-toggle .nav-dropdown-caret { transform: rotate(180deg); }
.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 240px;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--paper);
  border: 1px solid var(--line, #E1E5EA);
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(14, 45, 77, 0.10);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.12s ease, transform 0.12s ease, visibility 0.12s linear 0.12s;
  z-index: 50;
}
.nav-dropdown[aria-expanded="true"] > .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition-delay: 0s;
}
.nav-dropdown-menu li { margin: 0; }
.nav-dropdown-menu a {
  display: block;
  padding: 9px 12px;
  border-radius: 6px;
  font-size: 14px;
  color: var(--ink);
  text-decoration: none;
  line-height: 1.35;
}
.nav-dropdown-menu a small {
  display: block;
  font-size: 12px;
  color: var(--ink-muted);
  margin-top: 2px;
}
.nav-dropdown-menu a:hover,
.nav-dropdown-menu a:focus-visible {
  background: var(--paper-soft);
  color: var(--primary);
  outline: none;
}
.nav-dropdown-menu a.current { background: var(--primary-mist); color: var(--primary); font-weight: 600; }

@media (max-width: 768px) {
  /* In mobile menu (when .nav.open), turn the dropdown into a stacked list. */
  .nav.open .nav-dropdown { width: 100%; }
  .nav.open .nav-dropdown-toggle { width: 100%; text-align: left; justify-content: space-between; }
  .nav.open .nav-dropdown-menu {
    position: static; opacity: 1; visibility: visible; transform: none;
    box-shadow: none; border: 0; padding: 4px 0 4px 16px; min-width: 0; max-height: 0;
    overflow: hidden;
    transition: max-height 0.18s ease;
  }
  .nav.open .nav-dropdown[aria-expanded="true"] > .nav-dropdown-menu { max-height: 360px; }
}

.header-spacer { flex: 1; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.12s, color 0.12s, border-color 0.12s;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); color: white; }
.btn-secondary { background: var(--paper-warm); color: var(--ink); border-color: var(--line); }
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }
.btn-ghost { background: transparent; color: var(--primary); }
.btn-ghost:hover { background: rgba(14, 45, 77, 0.06); }

.header-search-wrap { position: relative; display: inline-flex; }
.header-search-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(520px, calc(100vw - 32px));
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  box-shadow: 0 18px 42px rgba(14, 45, 77, 0.18);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.12s ease, transform 0.12s ease, visibility 0.12s linear 0.12s;
  z-index: 80;
}
.header-search-wrap.open .header-search-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition-delay: 0s;
}
.header-search-input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  background: var(--paper-soft);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
}
.header-search-input:focus { outline: 0; border-color: var(--primary); background: var(--paper); }
.header-search-hint { margin: 8px 2px 10px; font-size: 12px; color: var(--ink-muted); }
.header-search-results { display: flex; flex-direction: column; gap: 6px; max-height: min(58vh, 520px); overflow: auto; }
.header-search-result {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: inherit;
  text-decoration: none;
}
.header-search-result:hover,
.header-search-result:focus-visible,
.header-search-result.active {
  background: var(--accent-mist);
  border-color: rgba(79, 161, 170, 0.35);
  outline: none;
}
.header-search-cat {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-dark);
}
.header-search-result strong {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
}
.header-search-result span:last-child { font-size: 12.5px; color: var(--ink-muted); line-height: 1.35; }
.header-search-empty { padding: 18px 12px; color: var(--ink-muted); font-size: 13px; }
.header-search-all {
  display: inline-flex;
  margin-top: 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
}
.header-search-all:hover { text-decoration: underline; }
@media (max-width: 640px) {
  .header-search-panel {
    right: -8px;
    width: calc(100vw - 24px);
    max-height: calc(100vh - 92px);
    overflow: auto;
  }
  .header-search-result strong { font-size: 15px; }
}

/* --------------------- badges --------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.badge-neutral { background: var(--paper-warm); color: var(--ink-soft); border-color: var(--line); }
.badge-primary { background: rgba(14, 45, 77, 0.10); color: var(--primary); border-color: rgba(14, 45, 77, 0.22); }
.badge-accent { background: rgba(79, 161, 170, 0.14); color: var(--accent-dark); border-color: rgba(79, 161, 170, 0.32); }
.badge-terracotta { background: rgba(199, 127, 64, 0.14); color: var(--terracotta-dark); border-color: rgba(199, 127, 64, 0.32); }
.badge-success { background: rgba(47, 109, 76, 0.1); color: var(--clinical-green); border-color: rgba(47, 109, 76, 0.3); }
.badge-info { background: rgba(30, 78, 140, 0.1); color: var(--clinical-blue); border-color: rgba(30, 78, 140, 0.3); }
.badge-warn { background: rgba(183, 121, 31, 0.15); color: var(--clinical-amber); border-color: rgba(183, 121, 31, 0.3); }
.badge-danger { background: rgba(155, 44, 44, 0.1); color: var(--clinical-red); border-color: rgba(155, 44, 44, 0.3); }

/* --------------------- hero --------------------- */
.hero {
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--paper-warm), var(--paper));
}
.hero .inner {
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 64px; align-items: center;
  padding: 80px 0 96px;
}
.hero h1 {
  font-size: clamp(36px, 5vw, 60px);
  font-weight: 600;
  line-height: 1.05;
}
.hero h1 em { color: var(--primary); font-style: normal; }
.hero p.lede {
  margin-top: 20px;
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 560px;
}
.hero .cta-row { margin-top: 28px; display: flex; gap: 10px; flex-wrap: wrap; }
.hero .disclaimer { margin-top: 20px; font-size: 12px; color: var(--ink-muted); }

.hero-aside {
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 1px 2px rgba(13,17,20,0.04), 0 2px 8px rgba(13,17,20,0.04);
}
.hero-aside h2 {
  font-size: 20px; font-weight: 600; margin-top: 6px;
}
.hero-aside .eyebrow {
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.15em;
  color: var(--accent-dark);
}
.task-list { list-style: none; padding: 0; margin: 14px 0 0; border-top: 1px solid var(--line); }
.task-list li { border-bottom: 1px solid var(--line); }
.task-list a {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 0;
  font-size: 14px;
  color: var(--ink);
  text-decoration: none;
}
.task-list a:hover { color: var(--primary); }
.task-list .arr { color: var(--ink-muted); }
.task-list a:hover .arr { color: var(--primary); }

/* --------------------- sections --------------------- */
section.band { padding: 64px 0; }
section.band.tinted { background: rgba(243, 239, 231, 0.6); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
section.band.primary {
  background: var(--primary);
  color: white;
}
section.band.primary h2,
section.band.primary dt { color: white; }
section.band.primary p,
section.band.primary dd { color: rgba(255,255,255,0.8); }

.section-head {
  display: flex; justify-content: space-between; align-items: flex-end;
  margin-bottom: 32px; gap: 16px;
}
.section-head .titles h2 {
  font-size: 28px; font-weight: 600; margin-top: 4px;
}
.eyebrow-accent {
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.15em;
  color: var(--accent-dark);
}
.section-head a.view-all {
  font-size: 14px; font-weight: 500; color: var(--primary); text-decoration: none;
}
.section-head a.view-all:hover { text-decoration: underline; }

.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.card {
  display: block;
  padding: 20px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.12s, border-color 0.12s;
}
.card:hover {
  box-shadow: 0 1px 2px rgba(13,17,20,0.04), 0 4px 16px rgba(13,17,20,0.06);
}
.card .eyebrow {
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.15em;
  color: var(--accent-dark); margin-bottom: 8px;
}
.card h3 {
  font-family: var(--serif); font-size: 18px; font-weight: 600;
  margin: 0 0 6px; transition: color 0.12s;
}
.card:hover h3 { color: var(--primary); }
.card p {
  margin: 0;
  font-size: 14px;
  color: var(--ink-muted);
  line-height: 1.55;
}
.card .meta {
  margin-top: 16px;
  display: flex; gap: 8px; flex-wrap: wrap;
  font-size: 12px;
  color: var(--ink-muted);
}

/* --------------------- prose (monograph body) --------------------- */
.prose {
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink);
}
.prose p { margin: 0 0 20px; }
.prose h2 {
  font-size: 26px;
  font-weight: 600;
  margin: 48px 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 96px;
}
.prose h3 {
  font-size: 20px;
  font-weight: 600;
  margin: 32px 0 12px;
}
.prose h4 {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  margin: 24px 0 8px;
}
.prose ul, .prose ol { margin: 0 0 20px; padding-left: 24px; }
.prose li { margin: 0 0 6px; }
.prose a { color: var(--primary); text-decoration: underline; text-decoration-color: rgba(14, 45, 77,0.3); text-underline-offset: 2px; }
.prose a:hover { text-decoration-color: var(--primary); }
.prose strong { font-weight: 600; color: var(--ink); }
.prose table { width: 100%; margin: 24px 0; border-collapse: collapse; font-size: 14px; font-family: var(--sans); }
.prose thead th { background: var(--paper-soft); text-align: left; padding: 10px 12px; border-bottom: 2px solid var(--line); font-weight: 600; }
.prose tbody td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose tbody tr:hover { background: rgba(243, 239, 231, 0.5); }
@media (max-width: 640px) {
  .prose table { table-layout: fixed; }
  .prose th,
  .prose td { overflow-wrap: anywhere; padding: 8px; }
  .prose td code { white-space: normal; overflow-wrap: anywhere; }
}

/* --------------------- callouts --------------------- */
.callout {
  margin: 24px 0;
  padding: 16px 18px;
  border-left: 4px solid var(--line);
  background: rgba(243, 239, 231, 0.4);
  border-radius: 0 6px 6px 0;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
}
.callout .label {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-right: 8px;
  margin-bottom: 8px;
  color: white;
}
.callout.guideline { border-left-color: var(--clinical-blue); background: rgba(30, 78, 140, 0.05); }
.callout.guideline .label { background: var(--clinical-blue); }
.callout.warning { border-left-color: var(--clinical-red); background: rgba(155, 44, 44, 0.05); }
.callout.warning .label { background: var(--clinical-red); }
.callout.pearl { border-left-color: var(--accent); background: rgba(79, 161, 170, 0.05); }
.callout.pearl .label { background: var(--accent); }
.callout.uk-practice { border-left-color: var(--primary); background: rgba(14, 45, 77, 0.05); }
.callout.uk-practice .label { background: var(--primary); }

/* --------------------- monograph layout --------------------- */
.monograph-grid {
  display: grid; grid-template-columns: 1fr 280px; gap: 40px;
  margin-top: 32px;
}
.toc {
  position: sticky; top: 96px;
  font-size: 14px;
  background: var(--paper);
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  z-index: 5;
  /* Cap to viewport so very long TOCs (11+ items) don't push past sibling panels */
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}
.toc .eyebrow { margin-bottom: 12px; }
.toc ol {
  list-style: none;
  padding: 0 0 0 12px;
  margin: 0;
  border-left: 1px solid var(--line);
}
.toc li { margin: 6px 0; }
.toc a {
  color: var(--ink-soft);
  text-decoration: none;
}
.toc a:hover { color: var(--primary); }
.toc .num { color: var(--ink-muted); margin-right: 8px; font-variant-numeric: tabular-nums; }

.mono-header {
  border-bottom: 1px solid var(--line);
  padding-bottom: 32px;
  margin-bottom: 32px;
}
.mono-header .codes { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.mono-header h1 {
  font-size: 44px;
  font-weight: 600;
  line-height: 1.1;
}
.mono-header .synonyms {
  margin-top: 6px;
  color: var(--ink-muted);
  font-style: italic;
}
.mono-header .abstract {
  margin-top: 20px;
  font-size: 18px;
  color: var(--ink-soft);
  line-height: 1.6;
  max-width: 780px;
}
.mono-header .author-block {
  margin-top: 24px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
  font-size: 13px;
}
.mono-header .author-block .label {
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--ink-muted);
  margin-bottom: 4px;
}
.mono-header .author-block .role { color: var(--ink-muted); }
.review-status {
  margin-top: 20px; font-size: 12px; color: var(--ink-muted);
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
}

.keyfacts {
  margin: 24px 0 32px;
  padding: 20px 24px;
  border: 1px solid rgba(14, 45, 77, 0.2);
  background: rgba(14, 45, 77, 0.05);
  border-radius: 10px;
}
.keyfacts h2 {
  font-family: var(--serif);
  font-size: 16px; font-weight: 600; color: var(--primary-dark); margin: 0 0 12px;
}
.keyfacts ul { list-style: none; padding: 0; margin: 0; }
.keyfacts li {
  position: relative;
  padding-left: 18px;
  margin: 8px 0;
  font-size: 15px;
  line-height: 1.55;
}
.keyfacts li::before {
  content: "";
  position: absolute;
  left: 0; top: 9px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--primary);
}

.refs {
  margin-top: 64px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}
.refs h2 { font-size: 22px; font-weight: 600; margin-bottom: 20px; }
.refs ol { padding-left: 28px; font-size: 14px; color: var(--ink-soft); }
.refs li { margin: 10px 0; }
.refs em { font-style: italic; }
.refs a { color: var(--primary); word-break: break-all; }

.launch-source-basis {
  box-sizing: border-box;
  width: calc(100% - 48px);
  max-width: 960px;
  margin-left: auto;
  margin-right: auto;
}

.correction-route {
  box-sizing: border-box;
  width: calc(100% - 48px);
  max-width: 960px;
  margin: 18px auto 0;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--primary);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.55;
}
.correction-route h2 {
  margin: 0 0 6px;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--ink);
}
.correction-route p { margin: 0; }
.correction-route a {
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
}
.correction-route a:hover { text-decoration: underline; }
@media (max-width: 640px) {
  .launch-source-basis {
    width: calc(100% - 32px);
  }
  .correction-route {
    width: calc(100% - 32px);
    padding: 16px 18px;
  }
}

.monograph-quiz {
  margin-top: 56px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(180deg, var(--paper) 0%, var(--paper-soft) 100%);
}
.monograph-quiz-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 18px;
}
.monograph-quiz h2 {
  margin: 4px 0 0;
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
  color: var(--primary);
}
.monograph-quiz-body { display: grid; gap: 14px; }
.mono-mcq-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}
.mono-mcq-stem {
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  margin-bottom: 12px;
}
.mono-mcq-stem > span {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
}
.mono-mcq-options { display: grid; gap: 8px; }
.mono-mcq-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--line);
  border-radius: 7px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.mono-mcq-option:hover:not([disabled]) { border-color: var(--accent); background: var(--accent-mist); }
.mono-mcq-option span {
  flex: 0 0 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--paper-soft);
  color: var(--ink-muted);
  font-size: 12px;
  font-weight: 700;
}
.mono-mcq-option strong { font-size: 14px; font-weight: 500; line-height: 1.45; }
.mono-mcq-option.correct { border-color: #2BAE66; background: #EAFBF1; }
.mono-mcq-option.correct span { background: #2BAE66; color: white; }
.mono-mcq-option.incorrect { border-color: #D14747; background: #FDECEC; }
.mono-mcq-option.incorrect span { background: #D14747; color: white; }
.mono-mcq-feedback {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 7px;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink-soft);
}
.mono-mcq-feedback.correct { background: #EAFBF1; border-left: 4px solid #2BAE66; }
.mono-mcq-feedback.incorrect { background: #FDECEC; border-left: 4px solid #D14747; }
.mono-mcq-feedback strong { color: var(--ink); }
@media (max-width: 640px) {
  .monograph-quiz { padding: 18px; }
  .monograph-quiz-head { flex-direction: column; }
  .monograph-quiz-head .btn { width: 100%; justify-content: center; }
}

.guidelines-panel {
  border: 1px solid var(--line);
  background: rgba(243, 239, 231, 0.5);
  border-radius: var(--radius);
  padding: 20px;
  font-size: 14px;
}
.guidelines-panel h3 {
  font-family: var(--serif);
  font-size: 16px;
  margin-bottom: 12px;
}
.guidelines-panel ul { list-style: none; padding: 0; margin: 0; }
.guidelines-panel li { margin: 10px 0; display: flex; gap: 8px; align-items: flex-start; }
.guidelines-panel a { text-decoration: none; color: var(--ink); }
.guidelines-panel a:hover { color: var(--primary); }

/* --------------------- breadcrumbs --------------------- */
.breadcrumbs {
  font-size: 13px;
  color: var(--ink-muted);
  margin: 24px 0 0;
}
.breadcrumbs a { color: inherit; text-decoration: none; }
.breadcrumbs a:hover { color: var(--primary); text-decoration: underline; }
.breadcrumbs .sep { margin: 0 6px; }

/* --------------------- tool layout --------------------- */
.tool-grid {
  display: grid; grid-template-columns: 1fr 300px; gap: 40px;
  margin-top: 24px;
}
.tool-page-layout {
  margin-top: 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 40px;
}
.tool-page-inner-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  margin-top: 24px;
}
.tool-form { display: flex; flex-direction: column; gap: 20px; }
.tool-form fieldset { border: 0; padding: 0; margin: 0; }
.tool-form legend {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  margin-bottom: 8px;
}
.tool-form label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 4px; }
.tool-form select,
.tool-form input[type=text],
.tool-form input[type=number] {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
}
.tool-form select:focus,
.tool-form input:focus {
  outline: 0;
  border-color: var(--primary);
}
.segmented {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}
.segmented button {
  padding: 9px 16px;
  border: 0;
  background: var(--paper);
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  color: var(--ink-soft);
}
.segmented button:hover { background: var(--paper-soft); }
.segmented button.active { background: var(--primary); color: white; }

.check-card {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.1s;
  font-size: 14px;
}
.check-card:hover { border-color: var(--primary); }
.check-card input { margin-top: 3px; }
.check-card .label { font-weight: 500; }
.check-card .desc { font-size: 12px; color: var(--ink-muted); margin-top: 2px; }
.check-card .desc::before { content: " — "; color: var(--ink-subtle); }

.result-panel {
  border: 1px solid var(--line);
  background: rgba(243, 239, 231, 0.5);
  border-radius: 10px;
  padding: 24px;
}
.result-panel .eyebrow { margin-bottom: 8px; }
.result-panel .big-stage {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
}
.result-panel .big-stage .value {
  font-family: var(--serif);
  font-size: 52px; font-weight: 600; color: var(--primary); line-height: 1;
}
.result-panel .rationale {
  margin: 16px 0 0;
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.6;
}
.result-panel h3 {
  font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--ink-soft);
  font-family: var(--sans);
  margin: 24px 0 8px;
}
.result-panel ul { padding-left: 20px; font-size: 14px; }
.result-panel li { margin: 4px 0; }
.tool-disclaimer {
  margin-top: 40px;
  padding: 18px 20px;
  border: 1px solid rgba(183, 121, 31, 0.3);
  background: rgba(183, 121, 31, 0.05);
  border-radius: 8px;
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.6;
}
.tool-disclaimer strong { color: var(--ink); }

/* --------------------- footer --------------------- */
footer.site-footer {
  margin-top: 96px;
  border-top: 1px solid var(--line);
  background: rgba(243, 239, 231, 0.6);
  padding: 48px 0 32px;
  font-size: 14px;
}
footer.site-footer .grid {
  display: grid; grid-template-columns: 1.2fr repeat(4, 1fr); gap: 32px;
}
footer.site-footer h5 {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
  margin: 0 0 12px;
}
footer.site-footer ul { list-style: none; padding: 0; margin: 0; }
footer.site-footer li { margin: 6px 0; }
footer.site-footer a { color: var(--ink); text-decoration: none; }
footer.site-footer a:hover { color: var(--primary); }
footer.site-footer .tagline {
  font-size: 13px; line-height: 1.55; color: var(--ink-muted); max-width: 280px; margin-top: 12px;
}
.legal-row {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; color: var(--ink-muted); gap: 16px;
}

/* (ad-zone CSS removed — the site no longer carries any advertising) */

/* --------------------- cookie consent banner ---------------------
   Driven by script.js. The banner appears at the bottom of the
   viewport on first visit, lets the user accept or reject anonymous
   GA4 analytics, and persists the choice in localStorage. A
   "Cookie preferences" footer link (data-cookie-prefs) re-opens it. */
.consent-banner {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 100;
  background: var(--paper);
  border-top: 1px solid var(--line);
  box-shadow: 0 -10px 30px -10px rgba(8, 35, 40, 0.18);
  padding: 16px 24px;
  font-family: var(--sans);
}
.consent-banner-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 28px;
  align-items: center;
}
.consent-banner-copy h3 {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 4px;
  letter-spacing: -0.01em;
}
.consent-banner-copy p {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 720px;
}
.consent-banner-copy a {
  color: var(--primary);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
.consent-banner-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  white-space: nowrap;
}
.consent-banner-actions .btn { padding: 8px 18px; }

@media (max-width: 640px) {
  .consent-banner { padding: 6px 12px; }
  .consent-banner-inner {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
  }
  .consent-banner-copy { line-height: 1.15; }
  .consent-banner-copy h3 { display: inline; font-size: 12px; margin: 0 4px 0 0; }
  .consent-banner-copy p { display: inline; font-size: 10.5px; line-height: 1.15; }
  .consent-banner-actions {
    flex-direction: row;
    justify-content: center;
    gap: 5px;
  }
  .consent-banner-actions .btn { min-width: 58px; min-height: 30px; padding: 5px 8px; font-size: 12px; }
}

/* --------------------- search --------------------- */
.search-input {
  width: 100%;
  padding: 16px 20px;
  font-size: 18px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  font-family: inherit;
}
.search-input:focus { border-color: var(--primary); outline: 0; }
.filter-chip-row,
.search-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.filter-chip,
.search-filter-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink-soft);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  min-height: 34px;
  padding: 7px 12px;
  text-transform: uppercase;
}
.filter-chip:hover,
.search-filter-chip:hover {
  border-color: var(--accent);
  color: var(--primary);
}
.filter-chip.active,
.search-filter-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.filter-status {
  color: var(--ink-muted);
  font-size: 12px;
}
.search-filter-row { margin-top: 14px; }
.search-results { margin-top: 24px; }
.search-result {
  padding: 16px 20px;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 6px;
  margin-bottom: 10px;
  display: block;
  text-decoration: none;
  color: inherit;
}
.search-result:hover { border-color: var(--primary); }
.search-result-cat {
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  margin-bottom: 4px;
  text-transform: uppercase;
}
.search-result h3 { font-family: var(--serif); font-size: 17px; font-weight: 600; margin: 0 0 4px; color: var(--ink); }
.search-result .ctx { font-size: 13px; color: var(--ink-muted); }
.search-result mark { background: rgba(79, 161, 170, 0.25); color: inherit; padding: 0 2px; border-radius: 2px; }
.search-empty {
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--ink-muted);
  padding: 36px 24px;
  text-align: center;
}

/* --------------------- custom 404 --------------------- */
.not-found-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: 32px;
  align-items: start;
  margin-top: 32px;
}
.not-found-panel {
  padding: 22px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: var(--paper-soft);
}
.not-found-panel h2 {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 12px;
  color: var(--primary);
}
.not-found-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}
@media (max-width: 820px) {
  .not-found-layout { grid-template-columns: 1fr; }
}

/* --------------------- print --------------------- */
@media print {
  .site-header, footer.site-footer, .nav, .breadcrumbs, .toc, aside { display: none !important; }
  body { background: white; color: black; }
  .container, .container-prose { max-width: 100%; padding: 0; }
  .prose, .prose-clinical { font-size: 11pt; line-height: 1.45; }
}

/* --------------------- visual hero --------------------- */
.hero-v2 {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(1200px 600px at 80% -20%, rgba(79, 161, 170,0.18), transparent 60%),
    radial-gradient(900px 500px at 0% 110%, rgba(14, 45, 77,0.18), transparent 60%),
    linear-gradient(180deg, var(--paper-warm), var(--paper));
  border-bottom: 1px solid var(--line);
}
.hero-v2 .hero-inner {
  display: grid; grid-template-columns: 1.6fr 1fr; gap: 56px; align-items: center;
  padding: 88px clamp(24px, 3vw, 40px) 96px;
  position: relative; z-index: 2;
}
.hero-v2 h1 {
  font-size: clamp(40px, 5.6vw, 68px);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -0.015em;
}
.hero-v2 h1 em {
  color: var(--primary); font-style: normal;
  background: linear-gradient(120deg, var(--primary) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-v2 .lede {
  margin-top: 22px;
  font-size: 19px;
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 580px;
  font-family: var(--serif);
}

#home .hero-v2 .hero-inner {
  gap: 36px;
  padding: 54px clamp(28px, 3.2vw, 44px) 62px;
}
#home .hero-v2 h1 {
  font-size: clamp(34px, 4.4vw, 46px);
  margin: 0;
}
#home .hero-v2 .lede {
  margin-top: 12px;
  margin-bottom: 0;
  font-size: 16px;
  line-height: 1.45;
}
#home .hero-actions {
  margin-top: 16px;
}
#home .hero-actions .btn-primary,
#home .hero-actions .btn-secondary,
#home .hero-actions .btn-ghost {
  background: rgba(255,255,255,0.82);
  border-color: rgba(14,45,77,0.34);
  border-width: 2px;
  box-shadow: 0 2px 8px -5px rgba(14,45,77,0.45);
  color: var(--primary);
  font-weight: 600;
}
#home .hero-actions .btn-primary:hover,
#home .hero-actions .btn-secondary:hover,
#home .hero-actions .btn-ghost:hover {
  background: var(--paper);
  border-color: var(--primary);
  color: var(--primary-dark);
}
#home .hero-fineprint {
  margin-top: 10px;
  margin-bottom: 0;
}

.hero-image {
  position: relative;
  width: 100%;
  max-width: 380px;          /* ~1/3 smaller than the previous fluid size */
  justify-self: end;          /* keep right-aligned in its grid column */
  aspect-ratio: 4/5;
  border-radius: 18px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(14, 45, 77,0.85), rgba(8,35,40,0.7)),
    radial-gradient(circle at 30% 20%, var(--accent) 0%, transparent 40%),
    radial-gradient(circle at 70% 80%, var(--primary-light) 0%, transparent 40%),
    var(--primary-dark);
  box-shadow: 0 30px 80px -30px rgba(8,35,40,0.4), 0 12px 24px -10px rgba(13,17,20,0.15);
}
.hero-image::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgba(8,35,40,0.5));
  pointer-events: none;
}
.hero-image .ph-content {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 28px;
  color: white;
  z-index: 2;
}
.hero-image .ph-content .ph-icon { font-size: 32px; margin-bottom: 12px; opacity: 0.7; }
.hero-image .ph-content strong { font-family: var(--serif); font-size: 22px; font-weight: 600; line-height: 1.2; display: block; margin-bottom: 6px; }
.hero-image .ph-content small { display: block; font-size: 12px; font-family: var(--mono, monospace); opacity: 0.7; margin-top: 8px; word-break: break-all; }

/* --------------------- stat band --------------------- */
.stat-band {
  background: var(--primary);
  color: white;
  padding: 48px 0;
  border-top: 1px solid rgba(255,255,255,0.1);
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.stat-band .stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  text-align: center;
}
.stat-band .stat .num {
  font-family: var(--serif);
  font-size: 44px;
  font-weight: 600;
  color: white;
  line-height: 1;
  display: block;
  letter-spacing: -0.02em;
}
.stat-band .stat .num em { color: var(--accent); font-style: normal; }
.stat-band .stat .label {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.75);
  margin-top: 8px;
  display: block;
}
.stat-band .stat .sub { display: block; font-size: 11px; color: rgba(255,255,255,0.55); margin-top: 4px; }

/* --------------------- category cards --------------------- */
.cat-card {
  display: flex; flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  overflow: hidden;
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
  text-decoration: none;
  color: inherit;
  position: relative;
}
.cat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px -16px rgba(13,17,20,0.18), 0 4px 12px -4px rgba(13,17,20,0.06);
  border-color: var(--primary);
}
.cat-card .cat-image {
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  position: relative;
  overflow: hidden;
}
.cat-card.cat-melanoma .cat-image { background: linear-gradient(135deg, #1a1a1a, #3a2a2a 50%, #5a3030); }
.cat-card.cat-bcc .cat-image { background: linear-gradient(135deg, #6e3a1f, #b8764d, #d99a73); }
.cat-card.cat-cscc .cat-image { background: linear-gradient(135deg, #7a4f1a, #b7791f, #d4a040); }
.cat-card.cat-merkel .cat-image { background: linear-gradient(135deg, #4a2150, #6e3680, #8a4ea0); }
.cat-card.cat-lymphoma .cat-image { background: linear-gradient(135deg, #1e3a5e, #2c5282, #4a73a8); }
.cat-card.cat-kaposi .cat-image { background: linear-gradient(135deg, #5a1f3a, #8b3060, #b04880); }
.cat-card.cat-dfsp .cat-image { background: linear-gradient(135deg, #2a4a3a, #3d6e54, #5a8e74); }
.cat-card.cat-syndrome .cat-image { background: linear-gradient(135deg, #2d3548, #4a5570, #6c7894); }
.cat-card.cat-premalignant .cat-image { background: linear-gradient(135deg, #6a4c2a, #9a7848, #c0a070); }
.cat-card.cat-special .cat-image { background: linear-gradient(135deg, #4a3a2a, #6e5a44, #968068); }
.cat-card.cat-recon .cat-image { background: linear-gradient(135deg, #0E2D4D, #1F4870, #4d8088); }
.cat-card.cat-tool .cat-image { background: linear-gradient(135deg, #2A2F34, #5A6169, #8A9098); }

.cat-card .cat-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cat-card .cat-image .ph-overlay {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 16px;
  color: rgba(255,255,255,0.9);
  font-size: 11px; font-family: var(--mono, monospace);
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
  letter-spacing: 0.05em;
}
.cat-card .cat-image .ph-overlay strong { font-family: var(--serif); font-size: 16px; font-weight: 600; letter-spacing: 0; margin-bottom: 4px; display: block; }

.cat-card .cat-body { padding: 20px 22px 22px; flex: 1; display: flex; flex-direction: column; }
.cat-card .cat-body .eyebrow {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.18em;
  color: var(--accent-dark);
  margin-bottom: 6px;
}
.cat-card .cat-body h3 {
  font-family: var(--serif); font-size: 19px; font-weight: 600; margin: 0 0 8px;
  letter-spacing: -0.01em;
}
.cat-card .cat-body p {
  font-size: 14px; line-height: 1.55; color: var(--ink-muted);
  margin: 0 0 14px;
  flex: 1;
}
.cat-card .cat-body .cat-meta {
  display: flex; gap: 6px; flex-wrap: wrap; align-items: center;
  margin-top: auto;
  font-size: 11px;
  color: var(--ink-muted);
}

/* --------------------- figure / image system --------------------- */
.figure {
  margin: 28px 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--paper);
}
.figure-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin: 24px 0;
}
.figure-grid .figure { margin: 0; }
.figure img,
.figure-img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  object-position: center;
  background: var(--paper-soft);
}
.figure figcaption {
  padding: 12px 16px 14px;
  font-size: 13px;
  color: var(--ink-soft);
  background: var(--paper-soft);
  border-top: 1px solid var(--line);
  line-height: 1.5;
  font-family: var(--sans);
}
.figure figcaption strong { color: var(--ink); font-weight: 600; }

.dermnet-figure {
  border-color: #C9D5E2;
}
.dermnet-figure figcaption {
  background: #F4F7FA;
}
.dermnet-figure figcaption::before {
  content: "DermNet image";
  display: inline-block;
  margin-right: 8px;
  padding: 2px 6px;
  border: 1px solid #C9D5E2;
  border-radius: 4px;
  color: var(--primary);
  background: #FFFFFF;
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  vertical-align: 1px;
}

.figure-placeholder {
  aspect-ratio: 4/3;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background:
    linear-gradient(135deg, rgba(14, 45, 77,0.06), rgba(79, 161, 170,0.06)),
    repeating-linear-gradient(45deg, rgba(0,0,0,0.015) 0 12px, transparent 12px 24px),
    var(--paper-soft);
  padding: 24px;
  text-align: center;
  color: var(--ink-soft);
  position: relative;
  border-bottom: 1px solid var(--line);
}
.figure-placeholder .ph-tag {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-weight: 700;
  color: var(--accent-dark);
  margin-bottom: 8px;
}
.figure-placeholder strong {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  display: block;
  max-width: 90%;
  line-height: 1.4;
  margin-bottom: 8px;
}
.figure-placeholder code {
  font-family: var(--mono, "JetBrains Mono", ui-monospace, monospace);
  font-size: 11px;
  color: var(--ink-muted);
  background: var(--paper);
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid var(--line);
  margin-top: 8px;
  display: inline-block;
  word-break: break-all;
  max-width: 95%;
}

.figure-placeholder.ph-surgical { background: linear-gradient(135deg, rgba(14, 45, 77,0.08), rgba(31, 72, 112,0.1)), var(--paper-soft); }
.figure-placeholder.ph-surgical .ph-tag { color: var(--primary); }
.figure-placeholder.ph-diagram { background: linear-gradient(135deg, rgba(30,78,140,0.08), rgba(74,109,168,0.08)), var(--paper-soft); }
.figure-placeholder.ph-diagram .ph-tag { color: var(--clinical-blue); }
.figure-placeholder.ph-radiology { background: linear-gradient(135deg, rgba(42,47,52,0.1), rgba(90,97,105,0.1)), var(--paper-soft); }
.figure-placeholder.ph-radiology .ph-tag { color: var(--ink-soft); }

/* --------------------- inline image + side-by-side --------------------- */
.figure-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 24px 0;
}
.figure-row .figure { margin: 0; }
.figure-row .figure:only-child { grid-column: 1 / -1; }

/* --------------------- pull-quote --------------------- */
.pull-quote {
  margin: 32px 0;
  padding: 24px 28px;
  border-left: 4px solid var(--accent);
  background: linear-gradient(90deg, rgba(79, 161, 170,0.06), transparent 80%);
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1.5;
  color: var(--ink);
  font-style: italic;
}
.pull-quote cite {
  display: block;
  margin-top: 12px;
  font-size: 13px;
  font-style: normal;
  color: var(--ink-muted);
  font-family: var(--sans);
}
.pull-quote cite::before { content: "— "; }

/* --------------------- DermNet-style 'who-what-how' subsections --------------------- */
.dn-section { margin-top: 48px; }
.dn-section > h2 {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 600;
  color: var(--ink);
  border-left: 4px solid var(--primary);
  padding-left: 16px;
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}

/* --------------------- key-fact strip --------------------- */
.key-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin: 32px 0;
  padding: 24px;
  background: var(--paper-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.key-strip .item .label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-muted); font-weight: 600;
  margin-bottom: 4px;
  display: block;
}
.key-strip .item .value {
  font-family: var(--serif); font-size: 22px; font-weight: 600; color: var(--primary-dark);
  line-height: 1.2; display: block;
}
.key-strip .item .sub { font-size: 12px; color: var(--ink-muted); margin-top: 2px; display: block; }

/* --------------------- definition-list --------------------- */
dl.dl-grid {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 8px 20px;
  margin: 16px 0 24px;
  font-size: 14px;
}
dl.dl-grid dt {
  font-weight: 600;
  color: var(--ink);
  font-family: var(--sans);
}
dl.dl-grid dd { margin: 0; color: var(--ink-soft); line-height: 1.55; }

/* --------------------- timeline --------------------- */
.timeline {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr;
  gap: 12px;
  margin: 32px 0;
}
.timeline .step {
  position: relative;
  padding: 16px 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  font-size: 13px;
  line-height: 1.5;
  transition: border-color 0.15s, transform 0.15s;
}
.timeline .step:hover { border-color: var(--primary); transform: translateY(-2px); }
.timeline .step::before {
  content: attr(data-step);
  position: absolute; top: -10px; left: 12px;
  background: var(--primary); color: white;
  width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
}
.timeline .step h4 { font-family: var(--serif); font-size: 14px; font-weight: 600; margin: 0 0 4px; color: var(--ink); }
.timeline .step p { margin: 0; color: var(--ink-muted); font-size: 12px; }

/* --------------------- chip set --------------------- */
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0; }
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  color: var(--ink-soft);
  text-decoration: none;
}
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.chip-on { background: var(--primary); color: white; border-color: var(--primary); }

/* --------------------- icon bullets --------------------- */
.icon-list { list-style: none; padding: 0; margin: 16px 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.icon-list li {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  font-size: 14px; line-height: 1.5;
}
.icon-list .ic {
  flex-shrink: 0;
  width: 32px; height: 32px;
  border-radius: 6px;
  background: var(--primary-mist);
  color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  font-weight: 700;
}
.icon-list strong { display: block; color: var(--ink); margin-bottom: 2px; font-weight: 600; }

/* --------------------- big-CTA --------------------- */
.bigcta {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
  padding: 28px 32px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  margin: 32px 0;
}
.bigcta h3 { font-family: var(--serif); font-size: 22px; font-weight: 600; margin: 0 0 4px; color: white; }
.bigcta p { margin: 0; color: rgba(255,255,255,0.8); font-size: 14px; line-height: 1.5; }
.bigcta .btn-primary { background: var(--accent); border-color: var(--accent); }
.bigcta .btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }

/* --------------------- responsive --------------------- */
@media (max-width: 1024px) {
  .hero .inner, .hero-v2 .hero-inner { grid-template-columns: 1fr; gap: 40px; padding: 56px clamp(24px, 4vw, 36px) 64px; }
  .hero-image { justify-self: center; max-width: 340px; }
  .monograph-grid { grid-template-columns: 1fr; }
  .tool-page-layout { grid-template-columns: 1fr; gap: 28px; }
  .tool-grid { grid-template-columns: 1fr; }
  .toc { position: static; }
  .stat-band .stats { grid-template-columns: repeat(2, 1fr); }
  .key-strip { grid-template-columns: repeat(2, 1fr); }
  .timeline { grid-template-columns: repeat(3, 1fr); }
  .figure-row { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .nav { display: none; }
  .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; }
  footer.site-footer .grid { grid-template-columns: 1fr 1fr; }
  .mono-header .author-block { grid-template-columns: 1fr; }
  .stat-band .stats { grid-template-columns: 1fr; }
  .timeline { grid-template-columns: 1fr; }
  .bigcta { grid-template-columns: 1fr; }
  .hero-v2 h1 { font-size: 36px; }
}

/* ==================================================================
   Mobile menu (hamburger) — accessible <button aria-expanded>
   pattern, with a tiny JS toggle in script.js. The button is a
   real interactive control with visible focus ring and a
   meaningful aria-expanded state for assistive tech.
   ================================================================== */
.nav-toggle-button {
  display: none;                /* hidden until the mobile breakpoint */
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0;
  width: 44px;                  /* WCAG-compliant tap target */
  height: 44px;
  color: var(--ink);
  align-items: center;
  justify-content: center;
  margin-left: auto;
}
.nav-toggle-button:hover  { background: var(--paper-soft); border-color: var(--primary); }
.nav-toggle-button:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Hamburger / X icon constructed with a single bar + ::before / ::after */
.nav-toggle-button .bars,
.nav-toggle-button .bars::before,
.nav-toggle-button .bars::after {
  display: block; width: 22px; height: 2px;
  background: currentColor; border-radius: 2px;
  position: relative;
  transition: transform 0.15s ease, top 0.15s ease, background-color 0.15s ease;
}
.nav-toggle-button .bars::before,
.nav-toggle-button .bars::after {
  content: ""; position: absolute; left: 0;
}
.nav-toggle-button .bars::before { top: -7px; }
.nav-toggle-button .bars::after  { top:  7px; }
.nav-toggle-button[aria-expanded="true"] .bars { background: transparent; }
.nav-toggle-button[aria-expanded="true"] .bars::before { top: 0; transform: rotate(45deg); }
.nav-toggle-button[aria-expanded="true"] .bars::after  { top: 0; transform: rotate(-45deg); }

/* Visually-hidden text for screen readers */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 768px) {
  .site-header .inner { gap: 12px; flex-wrap: nowrap; }
  .header-spacer { display: none; }
  .nav-toggle-button { display: inline-flex; }
  /* Default `.nav { display: none }` already hides it on mobile.
     The .open class (added by script.js) reveals the drawer.       */
  .nav.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 64px; left: 0; right: 0;
    background: var(--paper);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    padding: 8px 16px;
    gap: 0;
    z-index: 25;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
  }
  .nav.open a {
    padding: 14px 8px;          /* >=44px tap target with 16px font */
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    font-size: 16px;
    line-height: 1.4;
  }
  .nav.open a:last-child { border-bottom: 0; }
  /* Make the search button hit the WCAG 44px target on mobile too */
  .site-header .btn { min-height: 44px; padding: 8px 14px; }
}

/* ==================================================================
   Evidence-key helper link — used after a mini-key inline so a
   reader can jump to the full key without scrolling.
   ================================================================== */
.evi-help {
  font-size: 11px;
  color: var(--ink-muted);
  text-decoration: none;
  border-bottom: 1px dotted var(--ink-subtle);
  white-space: nowrap;
}
.evi-help:hover { color: var(--primary); border-bottom-color: var(--primary); }

/* Source-note line under the homepage stat band */
.stat-band-source {
  margin: 18px 0 0;
  font-size: 12px;
  color: var(--ink-muted);
  line-height: 1.55;
  text-align: center;
  max-width: 780px;
  margin-left: auto;
  margin-right: auto;
}
.stat-band-source a { color: var(--ink-muted); border-bottom: 1px dotted var(--ink-subtle); text-decoration: none; }
.stat-band-source a:hover { color: var(--primary); border-bottom-color: var(--primary); }

/* ==================================================================
   Evidence grading badges — applied to management bullets / blocks.
   Each one is a small inline pill that sits to the LEFT of a claim.
   The full key lives at evidence-key.html.
   ================================================================== */
.evi {
  display: inline-flex; align-items: center;
  padding: 1px 7px;
  margin-right: 6px;
  border-radius: 999px;
  border: 1px solid;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  vertical-align: 2px;
  font-family: var(--sans);
}
.evi-guideline { background: rgba(30, 78, 140, 0.10); color: var(--clinical-blue); border-color: rgba(30, 78, 140, 0.30); }
.evi-trial     { background: rgba(47, 109, 76, 0.10); color: var(--clinical-green); border-color: rgba(47, 109, 76, 0.30); }
.evi-nice      { background: rgba(14, 45, 77, 0.10); color: var(--primary); border-color: rgba(14, 45, 77, 0.28); }
.evi-consensus { background: rgba(183, 121, 31, 0.14); color: var(--clinical-amber); border-color: rgba(183, 121, 31, 0.32); }
.evi-mdt       { background: rgba(199, 127, 64, 0.12); color: var(--terracotta-dark); border-color: rgba(199, 127, 64, 0.30); }

/* Inline mini-key shown next to the management heading on monographs */
.evi-mini-key {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin: 8px 0 16px;
  font-size: 11px;
}
.evi-mini-key a { color: var(--ink-muted); text-decoration: none; border-bottom: 1px dotted var(--ink-subtle); }
.evi-mini-key a:hover { color: var(--primary); border-bottom-color: var(--primary); }

/* ==================================================================
   "How to use this site" homepage block
   ================================================================== */
.use-block {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 36px;
  align-items: start;
}
.use-block .use-intro h2 {
  font-size: 28px;
  font-weight: 600;
}
.use-block .use-intro p {
  margin-top: 12px;
  color: var(--ink-soft);
  line-height: 1.6;
  font-size: 16px;
}
.use-block ul.use-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}
.use-block ul.use-list li {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  padding: 12px 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 15px;
  line-height: 1.45;
}
.use-block ul.use-list li::before {
  content: "→";
  color: var(--accent-dark);
  font-weight: 700;
  font-size: 16px;
  line-height: 1.4;
}
@media (max-width: 768px) {
  .use-block { grid-template-columns: 1fr; gap: 20px; }
}

/* ==================================================================
   Single-author / authorship block — replaces the false editorial
   board on the homepage and on dedicated pages.
   ================================================================== */
.author-credentials {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: flex-start;
}
.author-credentials .lead h2 {
  font-size: 28px;
  font-weight: 600;
}
.author-credentials .lead p {
  margin-top: 16px;
  max-width: 520px;
  line-height: 1.6;
}
.author-credentials .points {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin: 0;
}
.author-credentials .points dt {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
}
.author-credentials .points dd {
  margin: 6px 0 0;
  font-size: 14px;
  line-height: 1.55;
}
@media (max-width: 768px) {
  .author-credentials { grid-template-columns: 1fr; gap: 24px; }
  .author-credentials .points { grid-template-columns: 1fr; gap: 16px; }
}

/* ==================================================================
   Pattern-replacement classes (start of inline-style migration).
   These cover the most repeated inline patterns so the homepage,
   topics page, guidelines and editorial pages can drop their
   inline style="..." blobs.
   ================================================================== */

/* Hero badge / CTA rows */
.hero-badges  { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.hero-actions { margin-top: 28px; display: flex; gap: 10px; flex-wrap: wrap; }
.hero-fineprint { margin-top: 20px; font-size: 12px; color: var(--ink-muted); }

/* Follow-up scheduler: replaces inline two-column grids so the mobile
   breakpoint can collapse reliably without horizontal overflow. */
.follow-up-layout {
  margin-top: 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 40px;
}
.follow-up-tool-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  margin-top: 24px;
}
@media (max-width: 1024px) {
  .follow-up-layout { grid-template-columns: 1fr; gap: 28px; }
}
@media (max-width: 700px) {
  .tool-page-inner-grid { grid-template-columns: 1fr; }
  .follow-up-tool-grid { grid-template-columns: 1fr; }
  .segmented { display: flex; flex-wrap: wrap; }
  .segmented button { min-width: 0; flex: 1 1 46%; }
}

/* Two-column section layout used on the homepage premalignant + special-populations row */
.split-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
@media (max-width: 768px) { .split-2 { grid-template-columns: 1fr; gap: 28px; } }

/* Section heading row used inside .split-2 */
.split-2 .col-head h2 { font-size: 24px; font-weight: 600; margin: 6px 0 16px; }

/* Compact card row used for premalignant + special populations links */
.cardrow { display: grid; gap: 12px; }
.cardrow .cat-card { display: grid; grid-template-columns: 130px 1fr; }
.cardrow .cat-card .cat-image { aspect-ratio: auto; }
.cardrow .cat-card .cat-body  { padding: 14px 18px; }
.cardrow .cat-card .cat-body h3 { font-size: 16px; }
.cardrow .cat-card .cat-body p  { font-size: 13px; margin: 4px 0 0; }

/* Section headings used by topic / tools pages */
.section-h2 { font-size: 32px; font-weight: 600; }
.section-h2-sm { font-size: 24px; font-weight: 600; }

/* Tagged pill row used above big section titles */
.lede-muted { margin-top: 8px; color: var(--ink-muted); max-width: 640px; }

/* Big-CTA button row alignment */
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 24px; }

/* Compact metadata bar used after a monograph headline */
.meta-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; font-size: 13px; color: var(--ink-muted); margin-top: 6px; }

/* Site notice — used on monographs to call out single-author authorship link */
.author-notice {
  font-size: 12px;
  color: var(--ink-muted);
  background: var(--paper-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 12px;
  margin: 12px 0;
  line-height: 1.45;
}
.author-notice a { color: var(--primary); }


/* ===========================================================================
   CPD module — landing-page cards, MCQ engine, results page, certificate
   =========================================================================== */

/* Landing-page tiles on cpd.html and mcqs.html */
.cpd-card {
  display: block;
  padding: 22px 22px 20px;
  background: linear-gradient(180deg, var(--accent-mist) 0%, var(--paper) 60%);
  border: 1px solid var(--line);
  border-radius: 10px;
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  position: relative;
}
.cpd-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(14, 45, 77, 0.10);
  border-color: var(--accent);
}
.cpd-icon { font-size: 32px; line-height: 1; margin-bottom: 12px; }
.cpd-card h2 { font-family: var(--serif); font-size: 20px; font-weight: 600; margin: 0 0 8px; color: var(--primary); }
.cpd-card p { font-size: 14px; color: var(--ink-soft); line-height: 1.5; margin: 0 0 14px; }
.cpd-meta { display: inline-block; font-size: 12px; font-weight: 500; color: var(--ink-muted); text-transform: uppercase; letter-spacing: 0.06em; }

/* MCQ topic cards on mcqs.html */
.mcq-page-lede {
  margin-top: 12px;
  max-width: 820px;
  color: var(--ink-muted);
  font-size: 16px;
  line-height: 1.6;
}
.mcq-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 24px;
}
.mcq-overview a {
  display: block;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: var(--paper-soft);
  color: inherit;
  text-decoration: none;
}
.mcq-overview a:hover { border-color: var(--primary); background: var(--paper); }
.mcq-overview span {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-dark);
  margin-bottom: 5px;
}
.mcq-overview strong {
  display: block;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  color: var(--primary);
}
.mcq-overview small {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink-soft);
}
.mcq-section { margin-top: 44px; }
.mcq-section-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.mcq-section-header h2 {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 600;
  margin: 4px 0 0;
  color: var(--ink);
}
.mcq-section-header p {
  max-width: 780px;
  margin: 8px 0 0;
  color: var(--ink-muted);
  font-size: 14px;
  line-height: 1.55;
}
.mcq-subsection-head {
  margin: 26px 0 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.mcq-topic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; margin-top: 18px; }
.mcq-category-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-top: 0; }
.mcq-sampler-grid { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.mcq-topic-card {
  display: flex; flex-direction: column;
  padding: 19px 20px 18px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.mcq-topic-card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(14, 45, 77, 0.10); border-color: var(--accent); }
.mcq-topic-card .mcq-topic-icon { display: none; }
.mcq-card-kicker {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-dark);
  margin-bottom: 8px;
}
.mcq-topic-card h3 { font-family: var(--serif); font-size: 18px; font-weight: 600; margin: 0 0 6px; color: var(--primary); }
.mcq-topic-card p { font-size: 13.5px; color: var(--ink-soft); line-height: 1.5; margin: 0 0 14px; flex: 1; }
.mcq-topic-card .mcq-topic-meta { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--ink-muted); }
.mcq-topic-card .mcq-topic-meta span { background: var(--paper-soft); border-radius: 4px; padding: 2px 8px; }
.mcq-topic-card .mcq-topic-cta { margin-top: 14px; font-size: 13px; font-weight: 600; color: var(--accent); }
.mcq-topic-card:hover .mcq-topic-cta { color: var(--primary); }
.mcq-topic-card-category {
  padding: 15px 16px 14px;
  border-left-color: var(--primary-light);
}
.mcq-topic-card-category h3 { font-size: 16px; line-height: 1.25; }
.mcq-topic-card-category p { font-size: 13px; margin-bottom: 12px; }
.mcq-topic-card-sampler { border-left-color: var(--primary); }

@media (max-width: 780px) {
  .mcq-overview { grid-template-columns: 1fr; }
  .mcq-topic-grid,
  .mcq-category-grid,
  .mcq-sampler-grid { grid-template-columns: 1fr; }
}

/* MCQ exam page */
.mcq-stage { max-width: 760px; margin: 0 auto; padding: 24px 0; }
.mcq-intro { padding: 28px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; text-align: center; }
.mcq-intro h1 { font-family: var(--serif); font-size: 28px; font-weight: 600; margin: 0 0 8px; color: var(--primary); }
.mcq-intro .mcq-instructions { text-align: left; max-width: 480px; margin: 16px auto; }
.mcq-intro .mcq-instructions li { margin: 6px 0; font-size: 14px; color: var(--ink-soft); }
.mcq-intro .mcq-meta { display: flex; gap: 20px; justify-content: center; margin: 20px 0; font-size: 13px; color: var(--ink-muted); }
.mcq-intro .mcq-meta strong { color: var(--primary); }

.mcq-progress-wrap { margin: 0 0 24px; }
.mcq-progress-meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-muted); margin-bottom: 8px; font-weight: 500; }
.mcq-progress-bar { display: flex; gap: 3px; height: 6px; }
.mcq-progress-segment { flex: 1; background: var(--paper-soft); border-radius: 3px; transition: background 0.2s ease; }
.mcq-progress-segment.answered { background: var(--accent); }
.mcq-progress-segment.current { background: var(--primary); }

.mcq-question { padding: 28px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; }
.mcq-stem { font-family: var(--serif); font-size: 17px; line-height: 1.65; color: var(--ink); margin: 0 0 24px; }
.mcq-stem strong { color: var(--primary); }

.mcq-options { display: flex; flex-direction: column; gap: 10px; margin: 0 0 20px; }
.mcq-option {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 14px 16px;
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--ink);
  font-family: inherit;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.mcq-option:hover:not([disabled]) { border-color: var(--accent); background: var(--accent-mist); }
.mcq-option .mcq-option-letter {
  flex: 0 0 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--paper-soft);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600;
  color: var(--ink-muted);
  transition: background 0.12s ease, color 0.12s ease;
}
.mcq-option.selected { border-color: var(--accent); background: var(--accent-mist); }
.mcq-option.selected .mcq-option-letter { background: var(--accent); color: white; }
.mcq-option[disabled] { cursor: default; opacity: 0.95; }
.mcq-option.correct { border-color: #2BAE66; background: #EAFBF1; }
.mcq-option.correct .mcq-option-letter { background: #2BAE66; color: white; }
.mcq-option.incorrect { border-color: #D14747; background: #FDECEC; }
.mcq-option.incorrect .mcq-option-letter { background: #D14747; color: white; }
.mcq-option-text { flex: 1; }

.mcq-feedback { margin-top: 20px; padding: 16px 18px; border-radius: 8px; font-size: 14px; line-height: 1.6; }
.mcq-feedback.correct { background: #EAFBF1; border-left: 4px solid #2BAE66; }
.mcq-feedback.incorrect { background: #FDECEC; border-left: 4px solid #D14747; }
.mcq-feedback h4 { margin: 0 0 8px; font-size: 14px; font-weight: 600; color: var(--ink); display: flex; align-items: center; gap: 6px; }
.mcq-feedback h4 .icon { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; font-size: 12px; color: white; }
.mcq-feedback.correct h4 .icon { background: #2BAE66; }
.mcq-feedback.incorrect h4 .icon { background: #D14747; }
.mcq-feedback p { margin: 0 0 6px; color: var(--ink-soft); }
.mcq-feedback .mcq-refs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.mcq-feedback .mcq-refs a, .mcq-feedback .mcq-refs span { background: var(--paper); border: 1px solid var(--line); border-radius: 4px; padding: 2px 8px; font-size: 12px; color: var(--ink-soft); text-decoration: none; }
.mcq-feedback .mcq-refs a:hover { color: var(--primary); border-color: var(--accent); }

.mcq-controls { display: flex; justify-content: space-between; align-items: center; margin-top: 20px; gap: 12px; }
.mcq-controls .mcq-keyboard-hint { font-size: 11.5px; color: var(--ink-muted); }
.mcq-btn {
  padding: 10px 22px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  border: 0;
  cursor: pointer;
  font-family: inherit;
}
.mcq-btn-primary { background: var(--primary); color: white; }
.mcq-btn-primary:hover:not([disabled]) { background: var(--primary-dark); }
.mcq-btn-primary[disabled] { background: var(--paper-warm); color: var(--ink-muted); cursor: not-allowed; }
.mcq-btn-ghost { background: transparent; color: var(--ink-soft); border: 1px solid var(--line); }
.mcq-btn-ghost:hover { background: var(--paper-soft); color: var(--primary); }

/* Results page */
.mcq-results { max-width: 760px; margin: 0 auto; }
.mcq-result-headline { padding: 32px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; text-align: center; }
.mcq-score-donut { width: 160px; height: 160px; margin: 0 auto 16px; }
.mcq-score-big { font-family: var(--serif); font-size: 48px; font-weight: 600; color: var(--primary); }
.mcq-score-pct { font-size: 18px; color: var(--ink-muted); margin-top: 4px; }
.mcq-score-band { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 600; margin-top: 12px; text-transform: uppercase; letter-spacing: 0.06em; }
.mcq-score-band.pass { background: #EAFBF1; color: #2BAE66; }
.mcq-score-band.fail { background: #FDECEC; color: #D14747; }
.mcq-score-band.merit { background: #F3EFFB; color: #6645B2; }

.mcq-subtopic-bars { padding: 24px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; margin-top: 20px; }
.mcq-subtopic-bars h3 { font-family: var(--serif); font-size: 16px; font-weight: 600; margin: 0 0 16px; color: var(--primary); }
.mcq-bar-row { display: grid; grid-template-columns: 140px 1fr 56px; align-items: center; gap: 12px; margin: 10px 0; font-size: 13px; }
.mcq-bar-label { color: var(--ink-soft); }
.mcq-bar-track { background: var(--paper-soft); border-radius: 4px; height: 10px; overflow: hidden; }
.mcq-bar-fill { background: var(--accent); height: 100%; border-radius: 4px; transition: width 0.6s ease; }
.mcq-bar-count { color: var(--ink-muted); text-align: right; font-variant-numeric: tabular-nums; }

.mcq-review { padding: 24px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; margin-top: 20px; }
.mcq-review h3 { font-family: var(--serif); font-size: 16px; font-weight: 600; margin: 0 0 16px; color: var(--primary); }
.mcq-review-item { border-top: 1px solid var(--line); padding: 14px 0; }
.mcq-review-item:first-of-type { border-top: 0; padding-top: 0; }
.mcq-review-summary { display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 4px 0; font-size: 14px; }
.mcq-review-summary .mcq-review-icon { width: 22px; height: 22px; border-radius: 50%; color: white; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; flex: 0 0 22px; }
.mcq-review-summary .correct-icon { background: #2BAE66; }
.mcq-review-summary .incorrect-icon { background: #D14747; }
.mcq-review-stem { color: var(--ink); flex: 1; }
.mcq-review-details { display: none; margin-top: 10px; padding: 12px 14px; background: var(--paper-soft); border-radius: 6px; font-size: 13.5px; line-height: 1.55; color: var(--ink-soft); }
.mcq-review-item.open .mcq-review-details { display: block; }

.mcq-cert-section { padding: 24px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; margin-top: 20px; }
.mcq-cert-section h3 { font-family: var(--serif); font-size: 16px; font-weight: 600; margin: 0 0 12px; color: var(--primary); }
.mcq-cert-section p { font-size: 13.5px; color: var(--ink-soft); margin: 0 0 16px; }
.mcq-cert-section input[type="text"] { width: 100%; max-width: 360px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; font: inherit; }
.mcq-cert-section .mcq-cert-actions { margin-top: 14px; display: flex; gap: 10px; flex-wrap: wrap; }

/* Certificate print layout (visible only when triggered) */
@media print {
  .site-header, .site-footer, .breadcrumbs, .nav, #consent-banner, .mcq-cert-section, .mcq-results > *:not(.mcq-cert-print) { display: none !important; }
  .mcq-cert-print { display: block !important; }
  body { background: white; }
}

.mcq-cert-print {
  display: none;
  max-width: 800px;
  margin: 0 auto;
  padding: 60px;
  background: white;
  border: 12px double var(--primary);
  text-align: center;
  font-family: var(--serif);
}
.mcq-cert-print .cert-logo { height: 70px; margin-bottom: 30px; }
.mcq-cert-print h1 { font-size: 36px; color: var(--primary); margin: 0 0 8px; font-weight: 600; }
.mcq-cert-print .cert-sub { font-size: 14px; color: var(--ink-muted); margin-bottom: 32px; text-transform: uppercase; letter-spacing: 0.16em; }
.mcq-cert-print .cert-this-is-to-certify { font-size: 16px; color: var(--ink-soft); margin: 24px 0 12px; }
.mcq-cert-print .cert-name { font-size: 32px; color: var(--primary); margin: 8px 0; font-weight: 600; border-bottom: 1px solid var(--ink-soft); display: inline-block; padding: 0 40px 6px; }
.mcq-cert-print .cert-body { font-size: 16px; color: var(--ink-soft); margin: 24px 0; line-height: 1.6; }
.mcq-cert-print .cert-body strong { color: var(--primary); }
.mcq-cert-print .cert-score { font-size: 28px; color: var(--primary); margin: 20px 0; font-weight: 600; }
.mcq-cert-print .cert-footer { margin-top: 40px; font-size: 11px; color: var(--ink-muted); line-height: 1.5; font-family: var(--sans, Inter, sans-serif); }
.mcq-cert-print .cert-meta-row { display: flex; justify-content: space-between; margin-top: 30px; font-size: 13px; color: var(--ink-muted); font-family: var(--sans, Inter, sans-serif); }

/* === Phase 2 CPD modules ================================================== */
/* Dermoscopy quiz image stems ----------------------------------------------- */
.mcq-image-figure {
  margin: 0 0 20px;
  text-align: center;
}
.mcq-image {
  max-width: 100%;
  max-height: 360px;
  border-radius: 8px;
  border: 1px solid var(--line);
  display: inline-block;
  background: var(--paper-soft);
}
.mcq-image-placeholder {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  max-width: 460px;
  min-height: 240px;
  padding: 28px;
  background: linear-gradient(135deg, var(--paper-soft) 0%, #F3F1EC 100%);
  border: 2px dashed var(--line);
  border-radius: 8px;
}
.mcq-image-placeholder .ph-tag {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 4px 10px;
  background: rgba(79, 161, 170, 0.1);
  border-radius: 4px;
}
.mcq-image-placeholder strong {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 15px;
  color: var(--primary);
  text-align: center;
}
.mcq-image-placeholder code {
  font-size: 11px;
  color: var(--ink-muted);
  font-family: var(--mono, 'JetBrains Mono', monospace);
}
.mcq-image-caption {
  margin-top: 8px;
  font-size: 12px;
  color: var(--ink-muted);
  font-style: italic;
}

/* Dermoscopy / mock-SCE / flashcards deck-selection cards ------------------- */
.deck-grid {
  margin-top: 32px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.deck-card {
  display: block;
  padding: 24px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.deck-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 14px rgba(14, 45, 77, 0.08);
  transform: translateY(-1px);
}
.deck-card-icon {
  font-size: 28px;
  margin-bottom: 12px;
  line-height: 1;
}
.deck-card h2,
.deck-card h3 {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 8px;
  color: var(--primary);
}
.deck-card p {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.55;
}
.deck-card-meta {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

/* Mock SCE timer + state ---------------------------------------------------- */
.sce-timer-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  padding: 12px 16px;
  margin: -24px -16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  font-size: 14px;
}
.sce-timer-clock {
  font-family: var(--mono, 'JetBrains Mono', monospace);
  font-weight: 600;
  font-size: 16px;
  color: var(--primary);
}
.sce-timer-clock.warning { color: #C77F40; }
.sce-timer-clock.critical { color: #D14747; }
.sce-timer-meta {
  color: var(--ink-soft);
  display: flex;
  gap: 16px;
}
.sce-question-pager {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
  max-width: 720px;
}
.sce-pager-cell {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--paper);
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-soft);
  transition: all 0.1s;
}
.sce-pager-cell:hover { border-color: var(--accent); }
.sce-pager-cell.answered { background: var(--paper-soft); border-color: var(--accent); color: var(--accent); }
.sce-pager-cell.flagged { background: rgba(199, 127, 64, 0.12); border-color: #C77F40; color: #C77F40; }
.sce-pager-cell.current { border-color: var(--primary); border-width: 2px; color: var(--primary); font-weight: 700; }
.sce-flag-btn {
  background: none;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 6px 12px;
  font-size: 13px;
  color: var(--ink-soft);
  cursor: pointer;
  margin-right: 8px;
}
.sce-flag-btn.flagged { background: rgba(199, 127, 64, 0.12); border-color: #C77F40; color: #C77F40; }
.sce-controls-bottom {
  margin-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.sce-intro-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin: 16px 0;
}
.sce-option-pill {
  padding: 10px 14px;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  text-align: center;
  font-family: inherit;
  color: var(--ink);
  transition: all 0.1s;
}
.sce-option-pill:hover { border-color: var(--accent); }
.sce-option-pill.selected {
  border-color: var(--primary);
  background: var(--paper-soft);
  color: var(--primary);
  font-weight: 600;
}

/* Flashcards ---------------------------------------------------------------- */
.fc-stage {
  max-width: 720px;
  margin: 0 auto;
}
.fc-progress {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.fc-progress-item {
  text-align: center;
}
.fc-progress-value {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
  color: var(--primary);
  line-height: 1;
}
.fc-progress-label {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-top: 4px;
}
.fc-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 40px 32px;
  min-height: 320px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(14, 45, 77, 0.06);
  position: relative;
}
.fc-card-face {
  text-align: center;
}
.fc-card-side-label {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 16px;
  font-weight: 600;
}
.fc-card-front {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  color: var(--primary);
  line-height: 1.4;
}
.fc-card-back-prompt {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 500;
  color: var(--ink-muted);
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
  line-height: 1.4;
}
.fc-card-answer {
  font-size: 17px;
  color: var(--ink);
  line-height: 1.55;
  text-align: left;
  margin-bottom: 12px;
}
.fc-card-answer strong { color: var(--primary); }
.fc-card-note {
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.5;
  text-align: left;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  margin-top: 12px;
}
.fc-card-tag {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 4px 10px;
  background: rgba(79, 161, 170, 0.1);
  border-radius: 4px;
}
.fc-controls {
  margin-top: 20px;
  text-align: center;
}
.fc-flip-btn {
  background: var(--primary);
  color: #fff;
  border: 0;
  padding: 12px 32px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.fc-flip-btn:hover { background: #143963; }
.fc-grade-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 20px;
  max-width: 720px;
}
.fc-grade-btn {
  padding: 14px 8px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--paper);
  cursor: pointer;
  font-family: inherit;
  text-align: center;
  transition: all 0.1s;
}
.fc-grade-btn:hover { transform: translateY(-1px); }
.fc-grade-btn .grade-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
}
.fc-grade-btn .grade-key {
  display: block;
  font-size: 10px;
  color: var(--ink-muted);
  font-family: var(--mono, 'JetBrains Mono', monospace);
}
.fc-grade-btn.grade-again { border-color: #D14747; }
.fc-grade-btn.grade-again .grade-label { color: #D14747; }
.fc-grade-btn.grade-hard { border-color: #C77F40; }
.fc-grade-btn.grade-hard .grade-label { color: #C77F40; }
.fc-grade-btn.grade-good { border-color: var(--accent); }
.fc-grade-btn.grade-good .grade-label { color: var(--accent); }
.fc-grade-btn.grade-easy { border-color: #6645B2; }
.fc-grade-btn.grade-easy .grade-label { color: #6645B2; }
.fc-deck-complete {
  text-align: center;
  padding: 40px 24px;
}
.fc-deck-complete h2 {
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 600;
  color: var(--primary);
  margin: 0 0 12px;
}
.fc-mode-toggle {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 20px;
}
.fc-mode-toggle button {
  background: var(--paper);
  border: 0;
  padding: 8px 16px;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  color: var(--ink-soft);
  transition: all 0.1s;
}
.fc-mode-toggle button.active {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
}

@media (max-width: 640px) {
  .fc-grade-row { grid-template-columns: repeat(2, 1fr); }
  .fc-card { padding: 28px 20px; min-height: 240px; }
  .fc-card-front { font-size: 18px; }
  .sce-timer-bar { flex-wrap: wrap; }
}

/* === Enhanced certificate (module-branded) ================================ */
.mcq-cert-print {
  /* Top accent stripe — set by inline style.borderTop from the engine to match module */
  border-top: 8px solid var(--primary);
}
.mcq-cert-print .cert-module-badge {
  display: inline-block;
  padding: 5px 14px;
  margin: 0 0 12px;
  font-family: var(--sans, Inter, sans-serif);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fff;
  background: var(--primary);
  border-radius: 999px;
}
.mcq-cert-print .cert-band {
  display: inline-block;
  margin: 10px 0 0;
  padding: 6px 16px;
  font-family: var(--sans, Inter, sans-serif);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  border-radius: 999px;
}
.mcq-cert-print .cert-band.merit  { background: rgba(102, 69, 178, 0.12); color: #6645B2; border: 1px solid #6645B2; }
.mcq-cert-print .cert-band.pass   { background: rgba(43, 174, 102, 0.12); color: #2BAE66; border: 1px solid #2BAE66; }
.mcq-cert-print .cert-band.fail   { background: rgba(209, 71, 71, 0.12);  color: #D14747; border: 1px solid #D14747; }
.mcq-cert-print .cert-meta-row { font-variant-numeric: tabular-nums; }
.mcq-cert-print .cert-meta-row > div { display: flex; flex-direction: column; gap: 2px; }
.mcq-cert-print .cert-meta-row .meta-label {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  font-weight: 600;
}
.mcq-cert-print .cert-meta-row .meta-value { font-weight: 500; color: var(--ink); }
.mcq-cert-print .cert-id {
  margin-top: 18px;
  font-family: var(--mono, 'JetBrains Mono', monospace);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
}

/* === Topics page A-Z / Categories view toggle ============================ */
.view-toggle {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}
.view-toggle button {
  background: var(--paper);
  border: 0;
  padding: 9px 22px;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-soft);
  transition: all 0.1s;
}
.view-toggle button:not(.active):hover {
  background: var(--paper-soft);
  color: var(--ink);
}
.view-toggle button.active {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
}

.az-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px 20px;
  margin-top: 4px;
}
@media (max-width: 900px) {
  .az-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 580px) {
  .az-grid { grid-template-columns: 1fr; }
}
.az-card {
  display: block;
  padding: 10px 14px;
  border-left: 3px solid var(--accent);
  background: var(--paper);
  text-decoration: none;
  color: var(--ink);
  border-radius: 0 4px 4px 0;
  transition: background 0.12s, border-left-color 0.12s, transform 0.12s;
}
.az-card:hover {
  background: var(--paper-soft);
  border-left-color: var(--primary);
  transform: translateX(2px);
}
.az-card h3 {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 3px;
  color: var(--primary);
  line-height: 1.25;
}
.az-card .az-eyebrow {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin: 0 0 4px;
}
.az-card .az-desc {
  font-size: 12.5px;
  color: var(--ink-soft);
  line-height: 1.42;
  margin: 0;
}

/* === Topics page · Categories view (text-only category cards) =============
   Scoped to #view-categories so the .cat-card pattern on index.html and
   treatments.html is unaffected. */
#view-categories .cat-card {
  display: block;
  padding: 18px 22px 20px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--accent);   /* default accent — overridden per cat-Y below */
  border-radius: 6px;
  background: var(--paper);
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
#view-categories .cat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px -10px rgba(13,17,20,0.18), 0 3px 8px -4px rgba(13,17,20,0.06);
  border-color: var(--primary);
}
/* Per-category left-border accent (uses representative mid-tones from the old
   gradient palette so the cue is preserved without images). */
#view-categories .cat-card.cat-melanoma     { border-left-color: #5a3030; }
#view-categories .cat-card.cat-bcc          { border-left-color: #b8764d; }
#view-categories .cat-card.cat-cscc         { border-left-color: #b7791f; }
#view-categories .cat-card.cat-merkel       { border-left-color: #6e3680; }
#view-categories .cat-card.cat-lymphoma     { border-left-color: #2c5282; }
#view-categories .cat-card.cat-kaposi       { border-left-color: #8b3060; }
#view-categories .cat-card.cat-dfsp         { border-left-color: #3d6e54; }
#view-categories .cat-card.cat-syndrome     { border-left-color: #4a5570; }
#view-categories .cat-card.cat-premalignant { border-left-color: #9a7848; }
#view-categories .cat-card.cat-special      { border-left-color: #6e5a44; }

#view-categories .cat-card:hover.cat-melanoma     { border-color: #5a3030; }
#view-categories .cat-card:hover.cat-bcc          { border-color: #b8764d; }
#view-categories .cat-card:hover.cat-cscc         { border-color: #b7791f; }
#view-categories .cat-card:hover.cat-merkel       { border-color: #6e3680; }
#view-categories .cat-card:hover.cat-lymphoma     { border-color: #2c5282; }
#view-categories .cat-card:hover.cat-kaposi       { border-color: #8b3060; }
#view-categories .cat-card:hover.cat-dfsp         { border-color: #3d6e54; }
#view-categories .cat-card:hover.cat-syndrome     { border-color: #4a5570; }
#view-categories .cat-card:hover.cat-premalignant { border-color: #9a7848; }
#view-categories .cat-card:hover.cat-special      { border-color: #6e5a44; }

/* The card body wrapper no longer needs flex/column layout — flatten. */
#view-categories .cat-card .cat-body {
  display: block;
  padding: 0;
}
#view-categories .cat-card .cat-body .eyebrow {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--accent-dark);
  margin: 0 0 6px;
  display: block;
}
#view-categories .cat-card .cat-body h3 {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.3;
  margin: 0 0 8px;
  letter-spacing: -0.01em;
  color: var(--primary);
}
#view-categories .cat-card .cat-body p {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink-muted);
  margin: 0 0 8px;
}
#view-categories .cat-card .cat-body .cat-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
  margin: 6px 0 0;
  font-size: 11px;
  color: var(--ink-muted);
}

/* === A-Z view · per-letter dividers ====================================== */
.az-letter {
  grid-column: 1 / -1;          /* span all columns in az-grid */
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin: 18px 0 4px;
  padding: 6px 0 6px;
  border-bottom: 2px solid var(--accent);
  font-family: var(--serif);
  font-weight: 400;
}
.az-letter:first-child {
  margin-top: 0;
}
.az-letter .letter {
  font-size: 30px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
  letter-spacing: -0.01em;
}
.az-letter .count {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-muted);
  font-family: var(--sans, Inter, sans-serif);
}

/* === Treatments page (text-only category cards) ============================
   Scoped to #treatments-grid so the .cat-card pattern on index.html is
   unaffected. Mirrors the topics page Categories-view aesthetic — coloured
   left-border accent, no images. */
#treatments-grid .cat-card {
  display: block;
  padding: 18px 22px 20px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--accent);
  border-radius: 6px;
  background: var(--paper);
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
#treatments-grid .cat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px -10px rgba(13,17,20,0.18), 0 3px 8px -4px rgba(13,17,20,0.06);
  border-color: var(--primary);
}
#treatments-grid .cat-card.cat-recon { border-left-color: #1F4870; }
#treatments-grid .cat-card.cat-tool  { border-left-color: #5A6169; }
#treatments-grid .cat-card:hover.cat-recon { border-color: #1F4870; }
#treatments-grid .cat-card:hover.cat-tool  { border-color: #5A6169; }

#treatments-grid .cat-card .cat-body {
  display: block;
  padding: 0;
}
#treatments-grid .cat-card .cat-body .eyebrow {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--accent-dark);
  margin: 0 0 6px;
  display: block;
}
#treatments-grid .cat-card .cat-body h3 {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.3;
  margin: 0 0 8px;
  letter-spacing: -0.01em;
  color: var(--primary);
}
#treatments-grid .cat-card .cat-body p {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink-muted);
  margin: 0;
}

/* === Latest News widget + archive ======================================== */
.news-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.news-header h2 {
  margin: 4px 0 0;
}
.news-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
@media (max-width: 1100px) {
  .news-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .news-grid { grid-template-columns: 1fr; }
}
.news-card {
  display: flex;
  flex-direction: column;
  padding: 16px 18px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 6px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  min-height: 180px;
}
.news-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px -8px rgba(13,17,20,0.16);
}
.news-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.news-card-date {
  font-size: 11px;
  font-family: var(--mono, 'JetBrains Mono', monospace);
  letter-spacing: 0.04em;
  color: var(--ink-muted);
}
.news-card-cat {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid currentColor;
  background: var(--paper);
  white-space: nowrap;
}
.news-card-title {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
  margin: 0 0 8px;
  color: var(--primary);
  letter-spacing: -0.01em;
}
.news-card-summary {
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.5;
  margin: 0 0 12px;
  flex: 1;
}
.news-card-footer {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 11px;
  margin-top: auto;
}
.news-card-link, .news-card-mono {
  color: var(--accent-dark);
  text-decoration: none;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.news-card-mono:hover { text-decoration: underline; }

.news-archive-note {
  max-width: 760px;
  margin: 18px 0 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.55;
}

.news-filter-panel {
  max-width: 980px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-soft);
  box-shadow: 0 8px 24px -24px rgba(13,17,20,0.2);
}
.news-filter-intro {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}
.news-filter-intro strong {
  font-family: var(--serif);
  font-size: 19px;
  color: var(--primary);
}
.news-filter-intro span {
  font-size: 13px;
  color: var(--ink-muted);
  line-height: 1.45;
}
.news-filter-grid {
  display: grid;
  grid-template-columns: minmax(260px, 2fr) repeat(3, minmax(130px, 1fr));
  gap: 12px;
}
.news-filter-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.news-filter-field span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.news-filter-input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line-strong, var(--line));
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  padding: 10px 12px;
}
.news-filter-input:focus {
  outline: 3px solid rgba(79, 161, 170, 0.22);
  border-color: var(--accent);
}
.news-filter-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}
.news-filter-reset {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  color: var(--primary);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 12px;
  cursor: pointer;
}
.news-filter-reset:hover {
  background: #fff;
  border-color: var(--primary);
}

/* Archive list — vertical layout */
.news-archive-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.news-archive-section {
  max-width: 980px;
  margin-top: 28px;
}
.news-archive-section:first-child {
  margin-top: 0;
}
.news-archive-section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.news-archive-section-header h2 {
  margin: 0 0 4px;
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
  color: var(--ink);
}
.news-archive-section-header p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 13px;
  line-height: 1.45;
}
.news-archive-count {
  flex: 0 0 auto;
  color: var(--ink-muted);
  font-family: var(--mono, 'JetBrains Mono', monospace);
  font-size: 11px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.news-archive-item {
  display: flex;
  flex-direction: column;
  padding: 16px 20px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 6px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.12s, box-shadow 0.12s;
}
.news-archive-item:hover {
  transform: translateX(2px);
  box-shadow: 0 4px 14px -6px rgba(13,17,20,0.12);
}
.news-archive-item a {
  position: relative;
  z-index: 1;
}
.news-archive-item-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 8px;
}
.news-archive-item-title {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.3;
  margin: 0 0 6px;
  color: var(--primary);
}
.news-archive-item-summary {
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.55;
  margin: 0 0 10px;
}
.news-archive-item-footer {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 12px;
}
.news-archive-groups {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.news-archive-month {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  overflow: hidden;
}
.news-archive-month summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  cursor: pointer;
  list-style: none;
}
.news-archive-month summary::-webkit-details-marker {
  display: none;
}
.news-archive-month summary::before {
  content: '+';
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--primary);
  font-weight: 700;
  margin-right: 2px;
}
.news-archive-month[open] summary::before {
  content: '−';
}
.news-archive-month-title {
  flex: 1;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  color: var(--primary);
}
.news-archive-month-count {
  color: var(--ink-muted);
  font-family: var(--mono, 'JetBrains Mono', monospace);
  font-size: 11px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.news-archive-month .news-archive-list {
  padding: 0 14px 14px;
}
.news-archive-empty {
  max-width: 760px;
  padding: 20px;
  text-align: center;
  color: var(--ink-muted);
  font-size: 14px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--paper-soft);
}
@media (max-width: 900px) {
  .news-filter-intro {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
  .news-filter-grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 620px) {
  .news-filter-panel {
    padding: 14px;
  }
  .news-filter-grid {
    grid-template-columns: 1fr;
  }
  .news-archive-section-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }
  .news-archive-month summary {
    align-items: flex-start;
  }
  .news-archive-month-title {
    font-size: 17px;
  }
  .news-archive-item {
    padding: 14px 15px;
  }
}

/* Filter chips */
.news-archive-controls {
  display: block;
}
.news-filter-chip {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
  cursor: pointer;
  font-family: inherit;
  transition: background 0.12s, color 0.12s;
}
.news-filter-chip:hover { background: var(--paper-soft); }
.news-filter-chip.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  font-weight: 600;
}

/* Editor view styles */
.editor-summary-row {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  padding: 14px 18px;
  background: var(--paper-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 13px;
  color: var(--ink-soft);
}
.editor-summary-row strong { color: var(--primary); margin-right: 4px; }
.editor-card.is-starred { background: rgba(102, 69, 178, 0.04); }
.editor-card.is-seen { opacity: 0.6; }
.editor-manual-section {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}
.editor-manual-grid {
  display: grid;
  grid-template-columns: minmax(240px, 2fr) auto minmax(150px, 0.7fr) minmax(170px, 0.9fr);
  gap: 12px;
  align-items: end;
}
.editor-manual-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.editor-manual-field span {
  color: var(--ink-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.editor-manual-field input,
.editor-manual-field select,
.editor-manual-field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper-soft);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  padding: 10px 11px;
}
.editor-manual-field textarea {
  resize: vertical;
  min-height: 76px;
}
.editor-manual-field input:focus,
.editor-manual-field select:focus,
.editor-manual-field textarea:focus {
  outline: 2px solid rgba(79, 161, 170, 0.35);
  border-color: var(--accent);
}
.editor-manual-title,
.editor-manual-summary {
  grid-column: 1 / -1;
}
.editor-manual-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.editor-manual-status {
  color: var(--ink-muted);
  font-size: 12px;
  line-height: 1.4;
}
.editor-manual-status.is-ok { color: #2BAE66; }
.editor-manual-status.is-error { color: #B42318; }
.editor-home-preview-section {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-soft);
}
.editor-home-preview {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.editor-home-preview .news-card {
  min-height: 220px;
  background: var(--paper);
}
.editor-footer { align-items: center; }
.editor-actions {
  display: flex;
  gap: 6px;
  margin-left: auto;
  flex-wrap: wrap;
}
.editor-action-btn {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  color: var(--ink-soft);
  transition: all 0.1s;
}
.editor-action-btn:hover { border-color: var(--accent); color: var(--accent); }
.editor-action-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.editor-action-btn:disabled {
  cursor: wait;
  opacity: 0.65;
}
.editor-action-publish {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 700;
}
.editor-action-publish:hover {
  background: #0A233C;
  border-color: #0A233C;
  color: #fff;
}
.editor-action-unapprove {
  border-color: #8b3060;
  color: #8b3060;
  font-weight: 700;
}
.editor-action-unapprove:hover {
  background: #8b3060;
  border-color: #8b3060;
  color: #fff;
}

@media (max-width: 1100px) {
  .editor-manual-grid {
    grid-template-columns: minmax(220px, 1fr) auto;
  }
  .editor-manual-field:not(.editor-manual-url) {
    grid-column: 1 / -1;
  }
  .editor-home-preview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .editor-manual-grid {
    grid-template-columns: 1fr;
  }
  .editor-manual-fetch {
    width: 100%;
  }
  .editor-home-preview { grid-template-columns: 1fr; }
}

/* === Homepage (text-only category cards) ==================================
   Scoped to #home so the .cat-card pattern can be different on the homepage
   vs the (image-bearing) topics/treatments pages historically — and remain
   consistent with the topics-Categories-view + treatments-grid aesthetic. */
#home .cat-card {
  display: block;
  padding: 20px 22px 22px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--accent);
  border-radius: 6px;
  background: var(--paper);
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
#home .cat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px -10px rgba(13,17,20,0.18), 0 3px 8px -4px rgba(13,17,20,0.06);
  border-color: var(--primary);
}
/* Per-category left-border accent (same palette as topics + treatments) */
#home .cat-card.cat-melanoma     { border-left-color: #5a3030; }
#home .cat-card.cat-bcc          { border-left-color: #b8764d; }
#home .cat-card.cat-cscc         { border-left-color: #b7791f; }
#home .cat-card.cat-merkel       { border-left-color: #6e3680; }
#home .cat-card.cat-lymphoma     { border-left-color: #2c5282; }
#home .cat-card.cat-kaposi       { border-left-color: #8b3060; }
#home .cat-card.cat-dfsp         { border-left-color: #3d6e54; }
#home .cat-card.cat-syndrome     { border-left-color: #4a5570; }
#home .cat-card.cat-premalignant { border-left-color: #9a7848; }
#home .cat-card.cat-special      { border-left-color: #6e5a44; }
#home .cat-card.cat-recon        { border-left-color: #1F4870; }
#home .cat-card.cat-tool         { border-left-color: #5A6169; }

#home .cat-card:hover.cat-melanoma     { border-color: #5a3030; }
#home .cat-card:hover.cat-bcc          { border-color: #b8764d; }
#home .cat-card:hover.cat-cscc         { border-color: #b7791f; }
#home .cat-card:hover.cat-merkel       { border-color: #6e3680; }
#home .cat-card:hover.cat-lymphoma     { border-color: #2c5282; }
#home .cat-card:hover.cat-kaposi       { border-color: #8b3060; }
#home .cat-card:hover.cat-dfsp         { border-color: #3d6e54; }
#home .cat-card:hover.cat-syndrome     { border-color: #4a5570; }
#home .cat-card:hover.cat-premalignant { border-color: #9a7848; }
#home .cat-card:hover.cat-special      { border-color: #6e5a44; }
#home .cat-card:hover.cat-recon        { border-color: #1F4870; }
#home .cat-card:hover.cat-tool         { border-color: #5A6169; }

#home .cat-card .cat-body {
  display: block;
  padding: 0;
}
#home .cat-card .cat-body .eyebrow {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--accent-dark);
  margin: 0 0 6px;
  display: block;
}
#home .cat-card .cat-body h3 {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.3;
  margin: 0 0 8px;
  letter-spacing: -0.01em;
  color: var(--primary);
}
#home .cat-card .cat-body p {
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-muted);
  margin: 0 0 10px;
}
#home .cat-card .cat-body .cat-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
  margin: 8px 0 0;
  font-size: 11px;
  color: var(--ink-muted);
}

#home #latest-news {
  padding: 24px 0 22px;
}
#home #latest-news .news-header {
  align-items: center;
  margin-bottom: 10px;
}
#home #latest-news .news-header h2 {
  font-size: 22px;
}
#home #latest-news .news-header p {
  display: none;
}
#home #latest-news .news-grid {
  gap: 12px;
}
#home #latest-news .news-card {
  min-height: 0;
  min-height: 348px;
  height: auto;
  overflow: visible;
  padding: 18px 18px;
}
#home #latest-news .news-card-header {
  margin-bottom: 10px;
}
#home #latest-news .news-card-title {
  display: block;
  overflow: visible;
  font-size: 17px;
  line-height: 1.32;
  margin-bottom: 12px;
}
#home #latest-news .news-card-summary {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 13px;
  line-height: 1.45;
  margin-bottom: 12px;
}
#home #latest-news .news-card-footer {
  gap: 10px;
  font-size: 11px;
}

section.task-start-band {
  padding: 30px 0 36px;
}
.task-start-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  margin-bottom: 16px;
}
.task-start-head h2 {
  font-size: 26px;
  font-weight: 600;
  margin: 4px 0 0;
}
.task-start-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}
.task-start-card {
  display: flex;
  flex-direction: column;
  min-height: 124px;
  padding: 16px 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 6px;
  background: var(--paper);
  color: inherit;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.task-start-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px -12px rgba(13,17,20,0.18);
  border-color: var(--primary);
}
.task-start-card span {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--primary);
}
.task-start-card small {
  display: block;
  margin-top: 8px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--ink-muted);
}
.task-start-card.task-diagnose { border-left-color: #2c5282; }
.task-start-card.task-stage { border-left-color: #6e3680; }
.task-start-card.task-excise { border-left-color: #b7791f; }
.task-start-card.task-reconstruct { border-left-color: #1F4870; }
.task-start-card.task-follow { border-left-color: #2f6d4c; }
.task-start-card.task-revise { border-left-color: #5A6169; }
@media (max-width: 1100px) {
  .task-start-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  #home .hero-v2 .hero-inner { padding: 28px 20px 30px; gap: 24px; }
  #home .hero-v2 h1 { font-size: 34px; }
  #home .hero-v2 .lede { font-size: 16px; }
  #home .hero-side { display: none; }
  #home #latest-news { padding: 26px 0; }
  #home #latest-news .news-header {
    display: block;
    margin-bottom: 8px;
  }
  #home #latest-news .news-header h2 {
    margin-top: 2px;
  }
  #home #latest-news-meta {
    display: none;
  }
  #home #latest-news .news-grid {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 8px;
  }
  #home #latest-news .news-card {
    min-height: 276px;
    height: auto;
    flex: 0 0 268px;
    scroll-snap-align: start;
  }
  .task-start-grid { grid-template-columns: 1fr 1fr; }
  .task-start-card { min-height: 112px; }
  section.task-start-band { padding: 24px 0 30px; }
}

/* === Homepage hero — right-column content card (replaces hero-image) ===== */
#home .hero-side {
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  width: 100%;
}
#home .hero-side-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 18px 20px 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-top: 5px solid var(--accent);
  border-radius: 8px;
  box-shadow: 0 4px 22px -12px rgba(13,17,20,0.15);
}
#home .hero-side-eyebrow {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--accent-dark);
  margin: 0 0 8px;
}
#home .hero-side-list {
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
  flex: 1;
}
#home .hero-side-list li {
  border-top: 1px solid var(--line);
}
#home .hero-side-list li:first-child {
  border-top: 0;
}
#home .hero-side-list a {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 7px 4px;
  text-decoration: none;
  color: var(--ink);
  transition: color 0.12s, transform 0.12s;
}
#home .hero-side-list a:hover {
  color: var(--primary);
  transform: translateX(2px);
}
#home .hero-side-list .hs-num {
  flex: 0 0 38px;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  color: var(--primary);
  text-align: right;
  line-height: 1;
  letter-spacing: -0.02em;
}
#home .hero-side-list .hs-label {
  font-size: 12.5px;
  line-height: 1.35;
  color: var(--ink-soft);
}
#home .hero-side-list a:hover .hs-label { color: var(--ink); }
#home .hero-side-footnote {
  font-size: 10px;
  color: var(--ink-muted);
  font-family: var(--mono, 'JetBrains Mono', monospace);
  letter-spacing: 0.04em;
  border-top: 1px dashed var(--line);
  padding-top: 9px;
  margin-top: auto;
}

/* On narrow screens the hero collapses to single column; the side card should
   still feel like a sidebar but not dominate. */
@media (max-width: 900px) {
  #home .hero-side-card {
    margin-top: 24px;
  }
}
@media (max-width: 640px) {
  #home .hero-side { display: none; }
}

/* === Homepage two-column grid (Pre-malignant + High-risk groups) ========= */
#home .two-col-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}
@media (max-width: 800px) {
  #home .two-col-grid { grid-template-columns: 1fr; gap: 24px; }
}

/* === Homepage reconstruction anatomy tiles ============================== */
#home .recon-anatomy-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}
@media (max-width: 760px) {
  #home .recon-anatomy-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  #home .recon-anatomy-grid { grid-template-columns: 1fr; }
}
#home .recon-tile {
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
#home .recon-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px -10px rgba(13,17,20,0.18), 0 3px 8px -4px rgba(13,17,20,0.06);
  border-color: var(--primary);
}
#home .recon-tile-image {
  aspect-ratio: 16 / 10;
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  object-position: center;
  background: var(--paper-soft);
}
#home .recon-tile-body {
  padding: 10px 14px 12px;
  text-align: center;
}
#home .recon-tile-body h3 {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 600;
  margin: 0;
  color: var(--primary);
}

/* === Homepage Pathway section — richer step cards ========================
   Replaces the original .timeline mini-tiles with substantive cards. */
.pathway-timeline {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin: 24px 0;
}
@media (max-width: 980px) { .pathway-timeline { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 580px) { .pathway-timeline { grid-template-columns: 1fr; } }

.pathway-step {
  display: flex;
  flex-direction: column;
  padding: 20px 22px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 5px solid var(--accent);
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.pathway-step:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px -10px rgba(13,17,20,0.18), 0 3px 8px -4px rgba(13,17,20,0.06);
  border-color: var(--primary);
}
.pathway-step-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.pathway-num {
  flex: 0 0 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: -0.02em;
}
.pathway-step h4 {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  margin: 0;
  color: var(--primary);
  letter-spacing: -0.01em;
}
.pathway-step > p {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink-soft);
  margin: 0 0 12px;
}
.pathway-bullets {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.pathway-bullets li {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--accent-dark);
  padding-left: 14px;
  position: relative;
}
.pathway-bullets li::before {
  content: "›";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--accent);
  font-weight: 700;
}

/* === Pathway step pages — shared layout for the 6 deep pages ============= */
.pathway-page-header {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 20px 0 12px;
}
.pathway-page-num {
  flex: 0 0 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: -0.02em;
}
.pathway-progress {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 24px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.pathway-progress-dot {
  flex: 0 0 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--paper);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-muted);
  text-decoration: none;
  transition: all 0.12s;
}
.pathway-progress-dot:hover { border-color: var(--primary); color: var(--primary); }
.pathway-progress-dot.current {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.pathway-progress-bar {
  flex: 1;
  height: 1px;
  background: var(--line);
  min-width: 6px;
  max-width: 30px;
}
.pathway-content {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 48px;
  margin-top: 28px;
}
@media (max-width: 900px) { .pathway-content { grid-template-columns: 1fr; } }

.pathway-prose h2 {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  margin: 32px 0 10px;
  color: var(--primary);
}
.pathway-prose h2:first-child { margin-top: 0; }
.pathway-prose h3 {
  font-family: var(--sans, Inter, sans-serif);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-dark);
  margin: 18px 0 6px;
}
.pathway-prose p,
.pathway-prose ul,
.pathway-prose ol {
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink);
  margin: 0 0 12px;
}
.pathway-prose ul, .pathway-prose ol { padding-left: 22px; }
.pathway-prose ul li, .pathway-prose ol li { margin-bottom: 4px; }
.pathway-prose strong { color: var(--primary); }
.pathway-prose .pathway-callout {
  margin: 18px 0;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 6px;
  background: var(--paper-soft);
  font-size: 14px;
  line-height: 1.55;
}
.pathway-prose .pathway-callout strong { color: var(--primary); }
.pathway-prose .pathway-table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
  font-size: 13.5px;
}
.pathway-prose .pathway-table th,
.pathway-prose .pathway-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.pathway-prose .pathway-table th {
  background: var(--paper-soft);
  font-weight: 600;
  color: var(--primary);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.pathway-sidebar .guidelines-panel { margin-bottom: 18px; }
.pathway-sidebar .guidelines-panel h3 {
  font-family: var(--sans, Inter, sans-serif);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-dark);
  margin: 0 0 10px;
}
.pathway-sidebar .guidelines-panel ul {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 13.5px;
  line-height: 1.7;
}
.pathway-sidebar .guidelines-panel a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px dotted var(--line);
}
.pathway-sidebar .guidelines-panel a:hover { color: var(--primary); border-color: var(--primary); }

.pathway-step-nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.pathway-step-nav a {
  display: block;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, transform 0.15s;
  max-width: 48%;
}
.pathway-step-nav a:hover { border-color: var(--primary); transform: translateY(-1px); }
.pathway-step-nav .nav-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 4px;
}
.pathway-step-nav .nav-title {
  display: block;
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 600;
  color: var(--primary);
}
.pathway-step-nav .nav-next { text-align: right; }

.formkit-powered-by-convertkit-container,
.formkit-powered-by-convertkit {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
}
