/* ============================================================
   Revise Direct — Learning Engine styles
   Loaded on top of style.css for topic pages, hubs and practice pages.
   ============================================================ */

/* ---------- Banner art ---------- */
.rd-banner { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9;
  border-radius: var(--radius-lg); margin: 22px 0 8px; object-fit: cover;
  box-shadow: var(--shadow-md); }

/* ---------- Layout: sidebar + main ---------- */
.rd-wrap { display: grid; grid-template-columns: 268px minmax(0, 1fr); gap: 40px; align-items: start; }
.rd-side { position: sticky; top: 92px; max-height: calc(100vh - 112px); overflow-y: auto; padding-right: 6px; }
.rd-side h4 { font-family: var(--font-display); font-size: 12px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ink-soft); margin: 20px 0 8px; }
.rd-side h4:first-child { margin-top: 0; }
.rd-side a { display: block; padding: 7px 11px; border-radius: 9px; font-size: 14.5px;
  color: var(--ink); line-height: 1.35; }
.rd-side a:hover { background: var(--bg-soft); text-decoration: none; }
.rd-side a.here { background: var(--accent-soft); color: var(--accent-hover); font-weight: 600; }
.rd-side .done-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); margin-right: 7px; vertical-align: middle; opacity: 0; }
.rd-side a.done .done-dot { opacity: 1; }

/* ---------- Breadcrumbs ---------- */
.rd-crumbs { font-size: 13.5px; margin-bottom: 18px; color: var(--ink-soft); }
.rd-crumbs a { color: var(--ink-soft); }
.rd-crumbs span.sep { margin: 0 7px; opacity: 0.5; }

/* ---------- Topic hero ---------- */
.rd-hero { padding: 46px 0 30px; background: radial-gradient(900px 340px at 78% -30%, var(--accent-soft), transparent 62%); }
.rd-hero .rd-eyebrow { font-family: var(--font-display); font-weight: 600; font-size: 12.5px;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.rd-hero h1 { font-size: clamp(30px, 4vw, 42px); margin: 10px 0 14px; }
.rd-hero .rd-sum { font-size: 17.5px; max-width: 68ch; color: var(--ink-soft); }

/* Progress ring / bar */
.rd-mastery { display: flex; align-items: center; gap: 14px; margin-top: 24px; flex-wrap: wrap; }
.rd-mastery .mbar { flex: 1; min-width: 190px; height: 9px; border-radius: 999px;
  background: var(--line); overflow: hidden; }
.rd-mastery .mbar i { display: block; height: 100%; width: 0%; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--navy)); transition: width 0.5s ease; }
.rd-mastery .mlab { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.rd-mastery .rd-stage-btns { display: flex; gap: 6px; }
.rd-stage-btns button { font-size: 12.5px; padding: 6px 11px; border-radius: 999px;
  border: 1.5px solid var(--line); background: #fff; color: var(--ink-soft);
  cursor: pointer; font-family: var(--font-body); font-weight: 500; }
.rd-stage-btns button:hover { border-color: var(--accent); color: var(--accent); }
.rd-stage-btns button.on { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }

/* ---------- Syllabus points ---------- */
.rd-syllabus { background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 24px; box-shadow: var(--shadow-sm); margin-top: 26px; }
.rd-syllabus h3 { font-size: 14px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--ink-soft); margin-bottom: 12px; font-family: var(--font-display); }
.rd-syllabus ul { list-style: none; }
.rd-syllabus li { display: flex; gap: 10px; font-size: 14.5px; padding: 5px 0; align-items: flex-start; }
.rd-syllabus li svg { color: var(--accent); flex-shrink: 0; margin-top: 3px; }

/* ---------- Learn blocks ---------- */
.rd-blocks { display: flex; flex-direction: column; gap: 22px; margin-top: 34px; }
.rd-block { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 30px 32px; box-shadow: var(--shadow-sm); }
.rd-block > h2 { font-size: 22px; margin: 0 0 16px; }
.rd-block p { font-size: 16px; margin-bottom: 12px; color: var(--ink-soft); }
.rd-block p:last-child { margin-bottom: 0; }
.rd-block strong { color: var(--ink); font-weight: 600; }
.rd-block ul.rd-list { list-style: none; margin: 12px 0; display: flex; flex-direction: column; gap: 8px; }
.rd-block ul.rd-list li { display: flex; gap: 10px; font-size: 15.5px; align-items: flex-start; }
.rd-block ul.rd-list li::before { content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); margin-top: 9px; flex-shrink: 0; }

.rd-callout { margin-top: 18px; background: var(--accent-soft); border-left: 4px solid var(--accent);
  border-radius: 10px; padding: 15px 18px; font-size: 15px; color: #0b5d5b; }
.rd-callout b, .rd-callout strong { color: var(--accent-hover); }

/* ---------- Tables ---------- */
.rd-tablewrap { overflow-x: auto; margin: 18px 0; border: 1px solid var(--line); border-radius: 12px; }
table.rd-table { width: 100%; border-collapse: collapse; font-size: 14.5px; min-width: 520px; }
table.rd-table th { background: var(--bg-soft); color: var(--ink); font-family: var(--font-display);
  font-weight: 600; text-align: left; padding: 11px 14px; font-size: 13.5px;
  border-bottom: 1px solid var(--line); white-space: nowrap; }
table.rd-table td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--ink-soft); }
table.rd-table tr:last-child td { border-bottom: none; }
table.rd-table td:first-child { color: var(--ink); font-weight: 500; }

/* ---------- Figures ---------- */
.rd-figure { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 22px; margin: 20px 0; box-shadow: var(--shadow-sm); }
.rd-figure svg { width: 100%; height: auto; display: block; }
.rd-figure figcaption { font-size: 13.5px; color: var(--ink-soft); margin-top: 14px;
  padding-top: 12px; border-top: 1px solid var(--line); }
.rd-figure .rd-figfallback { font-size: 14.5px; color: var(--ink-soft); }

/* ---------- Key terms ---------- */
.rd-terms { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.rd-term { background: var(--bg-soft); border-radius: 11px; padding: 14px 16px; }
.rd-term dt { font-family: var(--font-display); font-weight: 600; font-size: 14.5px; color: var(--ink); margin-bottom: 4px; }
.rd-term dd { font-size: 14px; color: var(--ink-soft); }

/* ---------- Sport examples ---------- */
.rd-sports { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.rd-sport { border: 1px solid var(--line); border-radius: 11px; padding: 15px 17px; }
.rd-sport .lab { font-family: var(--font-display); font-weight: 700; font-size: 13px;
  color: var(--accent); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 6px; }
.rd-sport p { font-size: 14.5px; margin: 0; }

/* ---------- Flashcards ---------- */
.rd-flashgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 18px; }
.rd-flash { perspective: 1000px; height: 156px; cursor: pointer; }
.rd-flash .inner { position: relative; width: 100%; height: 100%; transition: transform 0.5s;
  transform-style: preserve-3d; }
.rd-flash.flipped .inner { transform: rotateY(180deg); }
.rd-flash .face { position: absolute; inset: 0; backface-visibility: hidden; border-radius: 12px;
  padding: 18px; display: flex; align-items: center; justify-content: center; text-align: center;
  font-size: 14.5px; border: 1px solid var(--line); }
.rd-flash .front { background: #fff; color: var(--ink); font-weight: 500; box-shadow: var(--shadow-sm); }
.rd-flash .back { background: var(--navy); color: #fff; transform: rotateY(180deg); }
.rd-flash .tick { position: absolute; top: 9px; right: 11px; font-size: 11px; color: var(--ink-soft);
  background: var(--bg-soft); border-radius: 999px; padding: 2px 8px; }
.rd-flashbar { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; align-items: center; }
.rd-flashbar .count { font-size: 14px; color: var(--ink-soft); margin-left: auto; }

/* ---------- Questions ---------- */
.rd-q { border: 1px solid var(--line); border-radius: var(--radius); background: #fff;
  padding: 22px 24px; margin-bottom: 16px; }
.rd-q .qmeta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.rd-chip { font-family: var(--font-display); font-weight: 700; font-size: 11.5px;
  letter-spacing: 0.05em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; }
.chip-cmd { background: var(--accent-soft); color: var(--accent-hover); }
.chip-ao1 { background: #eef2ff; color: #3730a3; }
.chip-ao2 { background: #fef3c7; color: #92400e; }
.chip-mk { background: var(--bg-soft); color: var(--ink); }
.rd-q .qtext { font-size: 16.5px; color: var(--ink); font-weight: 500; margin-bottom: 14px; }
.rd-q textarea { width: 100%; min-height: 96px; padding: 12px 14px; border: 1.5px solid var(--line);
  border-radius: 11px; font-family: var(--font-body); font-size: 15px; resize: vertical; color: var(--ink); }
.rd-q textarea:focus { outline: none; border-color: var(--accent); }
.rd-q .qrow { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; align-items: center; }
.rd-q .qrow .score { margin-left: auto; font-family: var(--font-display); font-weight: 700; font-size: 15px; color: var(--ink); }
.rd-ms { display: none; margin-top: 16px; border-top: 1px dashed var(--line); padding-top: 14px; }
.rd-ms.show { display: block; }
.rd-ms h4 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-soft);
  margin-bottom: 10px; font-family: var(--font-display); }
.rd-ms ul { list-style: none; display: flex; flex-direction: column; gap: 7px; }
.rd-ms li { display: flex; gap: 10px; font-size: 15px; align-items: flex-start;
  padding: 8px 12px; border-radius: 9px; background: var(--bg-soft); }
.rd-ms li input { margin-top: 5px; accent-color: var(--accent); flex-shrink: 0; }
.rd-ms li.ticked { background: #e6f7ed; }
.rd-tip { margin-top: 12px; font-size: 14px; color: #0b5d5b; background: var(--accent-soft);
  border-radius: 9px; padding: 11px 14px; }
.rd-ms-item { font-size: 15px; background: var(--bg-soft); border-radius: 9px; padding: 13px 15px;
  color: var(--ink); border-left: 3px solid var(--accent); }

/* ---------- Mistakes ("Why did I lose the mark?") ---------- */
.rd-mistake { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 14px; }
.rd-mistake .given { background: #fdeaea; padding: 16px 20px; font-size: 15px; color: #7f1d1d; }
.rd-mistake .given .lbl { font-family: var(--font-display); font-weight: 700; font-size: 11.5px;
  letter-spacing: 0.06em; text-transform: uppercase; display: block; margin-bottom: 5px; opacity: 0.8; }
.rd-mistake .why { padding: 14px 20px; font-size: 14.5px; border-bottom: 1px solid var(--line); }
.rd-mistake .why .lbl { font-family: var(--font-display); font-weight: 700; font-size: 11.5px;
  letter-spacing: 0.06em; text-transform: uppercase; display: block; margin-bottom: 5px; color: var(--danger); }
.rd-mistake .fixed { padding: 16px 20px; background: #e6f7ed; font-size: 15px; color: #14532d; }
.rd-mistake .fixed .lbl { font-family: var(--font-display); font-weight: 700; font-size: 11.5px;
  letter-spacing: 0.06em; text-transform: uppercase; display: block; margin-bottom: 5px; color: #11632c; }

/* ---------- Prev / next ---------- */
.rd-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 34px; }
.rd-pager a { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px;
  background: #fff; box-shadow: var(--shadow-sm); }
.rd-pager a:hover { border-color: var(--accent); text-decoration: none; }
.rd-pager .dir { font-size: 12.5px; color: var(--ink-soft); text-transform: uppercase;
  letter-spacing: 0.06em; font-family: var(--font-display); font-weight: 600; }
.rd-pager .ttl { font-family: var(--font-display); font-weight: 600; color: var(--ink); font-size: 15.5px; margin-top: 5px; }
.rd-pager .next { text-align: right; }

/* ---------- Hub components ---------- */
.rd-areagrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; margin-top: 34px; }
.rd-areacard { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 26px 28px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; }
.rd-areacard .num { font-family: var(--font-display); font-weight: 800; font-size: 12.5px;
  color: var(--accent); letter-spacing: 0.06em; text-transform: uppercase; }
.rd-areacard h3 { font-size: 21px; margin: 8px 0 10px; }
.rd-areacard p { font-size: 14.5px; margin-bottom: 16px; }
.rd-areacard ul { list-style: none; display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.rd-areacard li a { font-size: 14.5px; }
.rd-areacard .go { margin-top: auto; }

.rd-tools { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 30px; }
.rd-tool { background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow-sm); }
.rd-tool h3 { font-size: 16.5px; margin-bottom: 8px; }
.rd-tool p { font-size: 14px; margin-bottom: 14px; }
.rd-tool-pick { cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s; }
.rd-tool-pick:hover { border-color: var(--accent); box-shadow: var(--shadow-md, 0 8px 24px rgba(15,23,42,.1)); transform: translateY(-2px); }
.rd-tool-pick:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.rd-pick { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); font-weight: 600; font-size: 14px; }

/* Syllabus chooser modal (click an exam-practice tool card on the home page). */
.rd-choice {
  position: fixed; inset: 0; z-index: 10001;
  display: flex; align-items: center; justify-content: center;
  background: rgba(2, 6, 23, .72);
  padding: 22px;
}
.rd-choice-box {
  position: relative; width: min(520px, 100%);
  background: #fff; border-radius: 16px; padding: 26px 26px 22px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .45);
}
.rd-choice-box h2 { font-size: 22px; margin: 0 0 6px; }
.rd-choice-sub { color: var(--ink-soft); font-size: 14px; margin: 0 0 18px; }
.rd-choice-close {
  position: absolute; top: 14px; right: 14px;
  width: 36px; height: 36px; border: none; border-radius: 50%;
  background: var(--soft, #F1F5F9); color: var(--ink-soft);
  font-size: 22px; line-height: 1; cursor: pointer;
}
.rd-choice-close:hover { background: var(--line, #E2E8F0); }
.rd-choice-list { display: flex; flex-direction: column; gap: 8px; }
.rd-choice-list a {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px 16px; border: 1px solid var(--line, #E2E8F0); border-radius: 10px;
  text-decoration: none; color: var(--ink, #0F172A); font-weight: 600; font-size: 15px;
  transition: border-color .15s, box-shadow .15s;
}
.rd-choice-list a:hover { border-color: var(--accent); box-shadow: var(--shadow-sm, 0 2px 8px rgba(15,23,42,.08)); }
.rd-choice-list .rc-code { color: var(--ink-soft); font-weight: 500; font-size: 13px; }

/* ---------- Filters (question bank) ---------- */
.rd-filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow-sm); margin-top: 26px; }
.rd-filters label { font-size: 13px; font-weight: 600; color: var(--ink); margin-right: 4px; }
.rd-filters select { padding: 8px 11px; border: 1.5px solid var(--line); border-radius: 9px;
  font-family: var(--font-body); font-size: 14px; color: var(--ink); background: #fff; }
.rd-filters select:focus { outline: none; border-color: var(--accent); }

/* ---------- Score report ---------- */
.rd-report { background: var(--navy); color: #fff; border-radius: var(--radius-lg);
  padding: 30px 34px; margin-top: 24px; display: none; }
.rd-report.show { display: block; }
.rd-report h3 { color: #fff; font-size: 24px; margin-bottom: 6px; }
.rd-report .big { font-family: var(--font-display); font-weight: 800; font-size: 44px; color: var(--gold); line-height: 1.1; }
.rd-report p { color: rgba(255,255,255,0.85); font-size: 15px; }
.rd-bars { margin-top: 20px; display: flex; flex-direction: column; gap: 11px; }
.rd-bar { display: grid; grid-template-columns: 1fr 60px; gap: 12px; align-items: center; }
.rd-bar .nm { font-size: 14px; color: rgba(255,255,255,0.9); }
.rd-bar .tr { grid-column: 1 / -1; height: 8px; border-radius: 999px; background: rgba(255,255,255,0.15); overflow: hidden; }
.rd-bar .tr i { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.rd-bar .pc { text-align: right; font-family: var(--font-display); font-weight: 700; font-size: 14px; }

/* ---------- Progress dashboard ---------- */
.rd-prog-area { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 24px 26px; margin-bottom: 16px; box-shadow: var(--shadow-sm); }
.rd-prog-area h3 { font-size: 18px; margin-bottom: 4px; }
.rd-prog-area .sub { font-size: 14px; color: var(--ink-soft); margin-bottom: 16px; }
.rd-prog-list { display: flex; flex-direction: column; gap: 9px; }
.rd-prog-row { display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: center;
  padding: 9px 0; border-bottom: 1px solid var(--line); }
.rd-prog-row:last-child { border-bottom: none; }
.rd-prog-row .nm { font-size: 14.5px; color: var(--ink); }
.rd-pips { display: flex; gap: 4px; }
.rd-pip { width: 22px; height: 8px; border-radius: 999px; background: var(--line); }
.rd-pip.on { background: var(--accent); }

/* ---------- "Revise tonight" ---------- */
.rd-tonight { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 26px; }
.rd-plan { background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow-sm); }
.rd-plan h3 { font-size: 17px; margin-bottom: 4px; }
.rd-plan .mins { font-size: 13px; color: var(--accent); font-weight: 600; margin-bottom: 12px; }
.rd-plan ol { margin-left: 18px; font-size: 14.5px; display: flex; flex-direction: column; gap: 7px; }

/* ---------- Generic utility ---------- */
.rd-muted { color: var(--ink-soft); font-size: 14.5px; }
.rd-mt { margin-top: 22px; }
.rd-mb { margin-bottom: 18px; }
.rd-hide { display: none !important; }
.rd-freebadge { display: inline-block; background: var(--gold); color: #fff; font-family: var(--font-display);
  font-weight: 700; font-size: 11.5px; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 4px 11px; border-radius: 999px; }

/* ---------- Responsive ---------- */
@media (max-width: 1040px) {
  .rd-wrap { grid-template-columns: 1fr; }
  .rd-side { position: static; max-height: none; border: 1px solid var(--line);
    border-radius: var(--radius); padding: 16px; background: #fff; }
  .rd-tools, .rd-tonight { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 800px) {
  .rd-areagrid, .rd-terms, .rd-sports, .rd-flashgrid { grid-template-columns: 1fr; }
  .rd-tools, .rd-tonight { grid-template-columns: 1fr; }
  .rd-block { padding: 22px 20px; }
  .rd-pager { grid-template-columns: 1fr; }
  .rd-pager .next { text-align: left; }
  .rd-flash { height: 172px; }
}

/* --- Pictures that break up the text ------------------------------------- */
/* A smaller figure placed inside a learn block, and a picture beside a worked
   example, so a long topic reads as text + image instead of a wall of prose. */
.rd-figure-break {
  max-width: 620px;
  margin: 26px auto 30px;
}
.rd-figure-break svg { width: 100%; height: auto; display: block; }
.rd-figure-break figcaption {
  margin-top: 10px;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink-soft);
  text-align: center;
}

/* Picture inside a "why students lose marks" example */
.rd-mistake-pic .rd-figure-break {
  max-width: 460px;
  margin: 18px auto 4px;
}
.rd-mistake-pic .rd-figure-break svg {
  border: 1px solid var(--line, #E2E8F0);
  border-radius: 10px;
  background: #fff;
}

/* "Will this help me?" — the lines that answer it, in place of headline counts.
   Numbers like "997 exam-style questions" answer a question no student is asking. */
.rd-helps { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 10px; max-width: 780px; }
.rd-helps li { position: relative; padding-left: 30px; font-size: 16.5px; line-height: 1.5; color: var(--ink-soft); }
.rd-helps li::before {
  content: ""; position: absolute; left: 0; top: 2px;
  width: 20px; height: 20px; border-radius: 999px; background: var(--accent-soft, #e6f7f6);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230ea5a3' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: center; background-size: 12px;
}
@media (max-width: 560px) { .rd-helps li { font-size: 15.5px; } }

/* ---------------------------------------------------------------
   The subject strip on the front page.
   A visitor has to be able to tell which subjects the site covers
   without scrolling — a PE-only hero told a Biology student nothing.
   --------------------------------------------------------------- */
.rd-subjects { display: flex; flex-wrap: wrap; gap: 10px; }
.rd-subjects .rd-subject {
  display: inline-flex; align-items: center;
  padding: 11px 17px; border-radius: 999px;
  border: 1px solid var(--line, #E2E8F0); background: #fff;
  font-family: var(--font-display); font-weight: 700; font-size: 15px;
  color: var(--ink, #0F172A); text-decoration: none; line-height: 1; cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.rd-subjects .rd-subject:hover {
  border-color: var(--accent); box-shadow: var(--shadow-sm, 0 2px 8px rgba(15,23,42,.08));
  transform: translateY(-1px);
}
.rd-subjects .rd-subject.active {
  border-color: var(--accent); background: var(--accent); color: #fff;
  box-shadow: var(--shadow-sm, 0 2px 8px rgba(15,23,42,.08));
}
@media (max-width: 560px) {
  .rd-subjects { gap: 8px; }
  .rd-subjects .rd-subject { padding: 9px 13px; font-size: 14px; }
}

/* ---------------------------------------------------------------
   Click to enlarge a diagram (site-wide).
   Figures are inline SVG, so the overlay scales them without losing
   sharpness; click the figure (or Esc / the X) to close.
   --------------------------------------------------------------- */
.rd-figure { position: relative; }
.rd-figure-zoom { cursor: zoom-in; }
.rd-zoom-hint {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 11px; border-radius: 999px;
  background: rgba(15, 23, 42, .72); color: #fff;
  font-size: 12px; font-weight: 600; line-height: 1; letter-spacing: .02em;
  opacity: .5; transition: opacity .15s;
  pointer-events: none;
}
.rd-figure-zoom:hover .rd-zoom-hint,
.rd-figure-zoom:focus-within .rd-zoom-hint { opacity: 1; }
.rd-figure-zoom:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.rd-zoom {
  position: fixed; inset: 0; z-index: 10000;
  display: flex; overflow: auto;
  background: rgba(2, 6, 23, .88);
  padding: 24px;
  cursor: zoom-out;
}
.rd-zoom-inner {
  margin: auto;
  width: min(1120px, 100%);
  max-width: 92vw;
}
.rd-zoom figure {
  margin: 0; padding: 16px;
  background: #fff; border-radius: 12px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .55);
}
.rd-zoom .rd-figure-break { max-width: none; }
.rd-zoom svg { width: 100%; height: auto; display: block; }
.rd-zoom figcaption {
  margin: 14px 4px 2px; font-size: 14px; line-height: 1.5;
  color: var(--ink-soft); text-align: center;
}
.rd-zoom-close {
  position: fixed; top: 16px; right: 16px; z-index: 10001;
  width: 44px; height: 44px; border: none; border-radius: 50%;
  background: rgba(255, 255, 255, .14); color: #fff;
  font-size: 28px; line-height: 1; cursor: pointer;
}
.rd-zoom-close:hover { background: rgba(255, 255, 255, .28); }
