/* exercise-hub.css - engagement layer for exercise hubs (post_type: EX).
 * Consumes the markup in _build/exercise-hub-contract.md.
 * Loaded alongside engagement.css; engagement.js is NOT loaded on EX pages.
 * All classes are `xh-` prefixed (plus the contract's `exercise-*`).
 */

/* ============================================================
   Tokens
   ============================================================ */
:root {
  --xh-ink: #1e293b;
  --xh-mut: #64748b;
  --xh-faint: #94a3b8;
  --xh-line: #e7ebf1;
  --xh-border: #d4dce6;
  --xh-bg: #f8fafc;
  --xh-card: #ffffff;
  --xh-accent: #2563eb;
  --xh-accent-soft: #eef4ff;
  --xh-accent-line: #c5d8fb;
  --xh-pass-bg: #e7f8ed; --xh-pass-fg: #15803d; --xh-pass-line: #86efac;
  --xh-warn-bg: #fef5e1; --xh-warn-fg: #92590e; --xh-warn-line: #fcd77f;
  --xh-err-bg: #fdeceb;  --xh-err-fg: #b42318;  --xh-err-line: #f6b9b3;
  --xh-shadow: 0 1px 2px rgba(2, 6, 23, .05);
  --xh-shadow-lift: 0 4px 14px rgba(2, 6, 23, .09);
  --xh-ease: cubic-bezier(.4, 0, .2, 1);
}
html.dark {
  --xh-ink: #e8edf4;
  --xh-mut: #97a3b6;
  --xh-faint: #6b7888;
  --xh-line: #2b3648;
  --xh-border: #38465c;
  --xh-bg: #0f172a;
  --xh-card: #1a2336;
  --xh-accent: #6ea8ff;
  --xh-accent-soft: #1d2c4a;
  --xh-accent-line: #2f4673;
  --xh-pass-bg: #16331f; --xh-pass-fg: #86efac; --xh-pass-line: #2f6b3f;
  --xh-warn-bg: #3a2c0c; --xh-warn-fg: #fcd77f; --xh-warn-line: #6b5118;
  --xh-err-bg: #3a1a16;  --xh-err-fg: #fca5a0;  --xh-err-line: #7a3631;
  --xh-shadow: 0 1px 2px rgba(0, 0, 0, .3);
  --xh-shadow-lift: 0 4px 14px rgba(0, 0, 0, .4);
}

/* ============================================================
   Progress map (section lanes) - replaces the old status bar
   ============================================================ */
.xh-map {
  --xh-node-off: #cdd3dd;
  --xh-rail-off: #e4e6e2;
  --xh-green: #178a4e;
  --xh-green-ring: #33ab70;
  --xh-green-rail: #a9d6bf;
  --xh-green-soft: #edf6f1;
  margin: 16px 0 22px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
html.dark .xh-map {
  --xh-node-off: #455066;
  --xh-rail-off: #33415a;
  --xh-green: #4ade80;
  --xh-green-ring: #3f9e63;
  --xh-green-rail: #2f6b45;
  --xh-green-soft: #16311f;
}
.xh-map-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.xh-map-eyebrow {
  font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--xh-mut);
}
.xh-map-goal {
  font-size: 11.5px; font-weight: 600; color: var(--xh-mut);
  background: var(--xh-bg); border: 1px solid var(--xh-line);
  padding: 2px 8px; border-radius: 999px; font-variant-numeric: tabular-nums;
}
.xh-map-goal[hidden] { display: none; }
.xh-map-goal.is-met { color: var(--xh-green); background: var(--xh-green-soft); border-color: var(--xh-green-ring); }
.xh-map-count { margin-left: auto; font-size: 13px; color: var(--xh-mut); font-variant-numeric: tabular-nums; }
.xh-map-count b { color: var(--xh-ink); font-weight: 600; display: inline-block; }
.xh-map-count b.xh-bump { animation: xh-bump .6s var(--xh-ease); }
@keyframes xh-bump { 30% { transform: scale(1.5); color: #16a34a; } }
.xh-map-continue {
  flex: none; appearance: none; cursor: pointer;
  font: 600 12.5px 'Inter', -apple-system, sans-serif;
  color: var(--xh-accent); background: transparent; border: 0; padding: 2px 4px;
  display: inline-flex; align-items: center; gap: 5px;
}
.xh-map-continue[hidden] { display: none; }
.xh-map-continue:hover { text-decoration: underline; }
.xh-map-continue:focus-visible { outline: 2px solid var(--xh-accent); outline-offset: 2px; }
.xh-cont-arrow { transition: transform .15s var(--xh-ease); }
.xh-map-continue:hover .xh-cont-arrow { transform: translateX(2px); }

.xh-map-lanes { display: flex; flex-direction: column; }
.xh-lane {
  display: grid;
  grid-template-columns: 24px minmax(120px, 1fr) auto 46px;
  align-items: center; gap: 12px;
  padding: 7px 8px; margin: 0 -8px; border-radius: 9px;
}
.xh-lane:hover { background: var(--xh-bg); }
.xh-map-single .xh-lane { grid-template-columns: 1fr auto; }
.xh-lane-idx {
  width: 22px; height: 22px; border-radius: 50%;
  border: 1.5px solid var(--xh-node-off); display: grid; place-items: center;
  font: 600 11px ui-monospace, monospace; color: var(--xh-mut);
  font-variant-numeric: tabular-nums; position: relative;
}
.xh-lane.is-done .xh-lane-idx { background: var(--xh-green-soft); border-color: var(--xh-green-ring); color: transparent; }
.xh-lane.is-done .xh-lane-idx::after {
  content: ""; position: absolute; left: 7.5px; top: 5px; width: 4.5px; height: 9px;
  border: solid var(--xh-green); border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.xh-lane-name {
  font-size: 14.5px; color: var(--xh-ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.xh-lane-nodes { position: relative; display: flex; align-items: center; justify-self: end; height: 18px; }
.xh-rail-bg, .xh-rail-fill { position: absolute; left: 8px; top: 50%; height: 1.5px; transform: translateY(-50%); }
.xh-rail-bg { right: 8px; background: var(--xh-rail-off); }
.xh-rail-fill { width: 0; background: var(--xh-green-rail); transition: width .45s var(--xh-ease); }
.xh-node {
  position: relative; z-index: 1; width: 16px; height: 16px; border-radius: 50%;
  background: var(--xh-card); border: 1.5px solid var(--xh-node-off);
  margin-right: 8px; padding: 0; cursor: pointer; flex: none;
  transition: border-color .15s, transform .12s;
}
.xh-node:last-child { margin-right: 0; }
.xh-node:hover { border-color: var(--xh-green-ring); transform: translateY(-1px); }
.xh-node:focus-visible { outline: 2px solid var(--xh-accent); outline-offset: 2px; }
.xh-node.solved { border-color: var(--xh-green-ring); }
.xh-node.solved::after {
  content: ""; position: absolute; left: 4px; top: 2px; width: 3.4px; height: 6.6px;
  border: solid var(--xh-green); border-width: 0 1.6px 1.6px 0; transform: rotate(45deg);
}
.xh-node.xh-node-pop { animation: xh-node-pop .5s var(--xh-ease); }
@keyframes xh-node-pop { 40% { transform: scale(1.45); } }
.xh-lane-count {
  font: 600 12px ui-monospace, monospace; color: var(--xh-mut);
  text-align: right; font-variant-numeric: tabular-nums;
}
.xh-lane.is-done .xh-lane-count { color: var(--xh-green); }

/* ============================================================
   Exercise card  (.xh-card added to <section class="exercise">)
   ============================================================ */
section.exercise {
  background: var(--xh-card);
  border: 1px solid var(--xh-border);
  border-radius: 10px;
  margin: 12px 0;
  box-shadow: var(--xh-shadow);
}
section.exercise:not(.xh-card) { padding: 6px 18px; }
.exercise.xh-card {
  padding: 0;
  overflow: hidden;
  transition: box-shadow .2s var(--xh-ease), border-color .2s var(--xh-ease);
}
.exercise.xh-card.is-open { box-shadow: var(--xh-shadow-lift); }
.exercise.xh-card:hover { border-color: #b9c4d4; }
.exercise.xh-card.is-solved { border-color: var(--xh-pass-line); }
/* the site caps heading width for measure - undo it inside cards */
.exercise.xh-card > .exercise-title {
  margin: 0 !important;   /* beats the site's #content h3 heading margin */
  width: 100%;
  max-width: none;
  font-family: inherit;
}

/* header - a real <button>, single row: number, title, difficulty, time.
   The title may wrap to 2 lines; the meta chips hold their place on the right. */
.xh-ex-head {
  display: flex;
  align-items: flex-start;
  gap: 4px 9px;
  width: 100%;
  padding: 14px 16px 12px;
  background: none;
  border: 0;
  text-align: left;
  cursor: pointer;
  color: inherit;
  line-height: 23px;
  /* the site's #content h3 rule forces serif - override explicitly */
  font-family: 'Helvetica Neue', Roboto, Arial, sans-serif;
}
.is-solved .xh-ex-head { background: linear-gradient(180deg, var(--xh-pass-bg), transparent 75%); }
.xh-ex-head:hover { background: var(--xh-accent-soft); }
.xh-ex-head:focus-visible { outline: 2px solid var(--xh-accent); outline-offset: -2px; }
.xh-ex-num {
  flex-shrink: 0;
  font-family: monospace;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--xh-faint);
}
.xh-ex-name {
  flex: 1;
  min-width: 0;
  font-family: 'IBM Plex Serif', Georgia, 'Times New Roman', serif;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--xh-ink);
}

/* difficulty - NEUTRAL dot rating (green/red are reserved for verdicts) */
.xh-diff {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--xh-mut);
}
.xh-diff-dots {
  display: inline-flex;
  gap: 3px;
}
.xh-diff-dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--xh-accent);
}
.xh-diff-dots i.xh-dot-off { background: var(--xh-border); }

.xh-time {
  flex-shrink: 0;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--xh-mut);
  white-space: nowrap;
}
.xh-state {
  flex-shrink: 0;
  width: 21px;
  height: 21px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 2px solid var(--xh-border);
  font-size: 12px;
  font-weight: 700;
  color: transparent;
}
.is-solved .xh-state { background: #16a34a; border-color: #16a34a; color: #fff; }
.xh-chevron {
  flex-shrink: 0;
  width: 16px;
  text-align: center;
  color: var(--xh-faint);
  font-size: 11px;
  transition: transform .2s var(--xh-ease);
}
.xh-card.is-open .xh-chevron { transform: rotate(180deg); }

/* body - one 16px left edge, shared with the header.
   The body folds open/shut: setCardOpen() in exercise-hub.js animates an
   explicit pixel height, then hands back to these rules (height:0 when shut,
   auto when open). overflow:hidden clips the padded inner during the fold.
   The transition is gated on .xh-anim so cards do not animate open on load. */
.xh-ex-body {
  overflow: hidden;
  padding: 0;
}
.xh-card:not(.is-open) .xh-ex-body { height: 0; }
.xh-card.xh-anim .xh-ex-body { transition: height .3s var(--xh-ease); }
.xh-ex-inner { padding: 2px 16px 16px; }
.xh-card.xh-anim .xh-ex-inner { transition: opacity .24s var(--xh-ease); }
.xh-card:not(.is-open) .xh-ex-inner { opacity: 0; }
@media (prefers-reduced-motion: reduce) {
  .xh-card.xh-anim .xh-ex-body,
  .xh-card.xh-anim .xh-ex-inner { transition: none; }
}

/* three zones: problem, workspace, help - separated by whitespace */
.xh-zone + .xh-zone { margin-top: 22px; }
.xh-zone > .webr-container { margin: 0; }
.xh-zone-help {
  background: var(--xh-bg);
  border: 1px solid var(--xh-line);
  border-radius: 10px;
  padding: 13px 15px;
}

/* zone 1 - the problem (task + expected result) */
.exercise .exercise-task {
  margin: 0 0 14px;
  font-size: 16px;
  line-height: 1.65;
}
.exercise .exercise-expected { margin: 0; }
.exercise .exercise-expected > p:first-child {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--xh-mut);
  margin: 0 0 7px;
}
.exercise .exercise-expected pre {
  width: max-content;
  max-width: 100%;
  margin: 0;
  background: var(--xh-bg);
  border: 1px solid var(--xh-line);
  border-radius: 7px;
  padding: 11px 14px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--xh-mut);
  overflow: auto;
}
.exercise .exercise-expected pre code { background: none; padding: 0; color: inherit; }
.xh-card .xh-difficulty-src { display: none; }

/* ============================================================
   Help zone - hints + solution share one recessed panel.
   The solution disclosure has no card of its own; the panel is its frame.
   ============================================================ */
.xh-zone-help .xh-hints { margin: 0; }
/* hints and solution read as one continuous ladder - just a gap, no rule */
.xh-zone-help .xh-hints + details.exercise-solution { margin-top: 10px; }
/* the site has a generic details{} style (border/bg/radius) - reset it */
details.exercise-solution {
  margin: 0;
  border: 0;
  background: none;
  border-radius: 0;
}
details.exercise-solution > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
  padding: 3px 0;
  background: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--xh-accent);
  cursor: pointer;
  user-select: none;
}
details.exercise-solution > summary::-webkit-details-marker { display: none; }
details.exercise-solution > summary:hover { color: var(--xh-ink); }
details.exercise-solution > summary:focus-visible {
  outline: 2px solid var(--xh-accent);
  outline-offset: 2px;
}
/* chevron drawn from borders - points right, rotates down when open */
details.exercise-solution > summary::before {
  content: '';
  width: 7px;
  height: 7px;
  flex-shrink: 0;
  margin: 0 1px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform .2s var(--xh-ease);
}
details.exercise-solution[open] > summary::before { transform: rotate(45deg); }
details.exercise-solution > .webr-container { margin-top: 11px; }
details.exercise-solution > .exercise-explanation {
  margin: 11px 0 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--xh-mut);
}
details.exercise-solution > .exercise-explanation strong { color: var(--xh-ink); }

/* ============================================================
   Verdict - aria-live region under the Your-turn block
   ============================================================ */
.xh-verdict {
  display: none;
  align-items: flex-start;
  gap: 9px;
  margin: 12px 0 0;
  padding: 11px 13px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.5;
}
.xh-verdict.is-shown { display: flex; }
.xh-verdict.is-running { background: var(--xh-bg); border-color: var(--xh-line); color: var(--xh-mut); }
.xh-verdict.is-pass { background: var(--xh-pass-bg); border-color: var(--xh-pass-line); color: var(--xh-pass-fg); }
.xh-verdict.is-mismatch { background: var(--xh-warn-bg); border-color: var(--xh-warn-line); color: var(--xh-warn-fg); }
.xh-verdict.is-error { background: var(--xh-err-bg); border-color: var(--xh-err-line); color: var(--xh-err-fg); }
/* the resolved verdict eases up into place */
.xh-verdict.is-pass,
.xh-verdict.is-mismatch,
.xh-verdict.is-error { animation: xh-verdict-in .3s var(--xh-ease); }
@keyframes xh-verdict-in {
  from { transform: translateY(5px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
/* drawn checkmark in the 'correct' verdict */
.xh-check-svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.xh-check-svg path {
  stroke-dasharray: 28;
  stroke-dashoffset: 28;
  animation: xh-draw .45s .05s ease forwards;
}
@keyframes xh-draw { to { stroke-dashoffset: 0; } }
/* milestone toast at 25 / 50 / 75 percent solved */
.xh-milestone {
  position: fixed;
  bottom: 26px;
  left: 50%;
  z-index: 60;
  transform: translateX(-50%) translateY(14px);
  background: linear-gradient(150deg, #0f1d3a, #1e3a6b);
  color: #fff;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(2, 6, 23, .3);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s var(--xh-ease), transform .3s var(--xh-ease);
}
.xh-milestone::before { content: '\2728\00a0'; }
.xh-milestone.is-shown { opacity: 1; transform: translateX(-50%) translateY(0); }
.xh-verdict-icon { flex-shrink: 0; font-size: 14px; line-height: 1.4; }
.xh-verdict-body { flex: 1; }
.xh-verdict-detail {
  display: block;
  margin-top: 3px;
  font-weight: 400;
  font-size: 12.5px;
  opacity: .9;
}
.xh-spinner {
  display: inline-block;
  width: 11px; height: 11px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: xh-spin .6s linear infinite;
}
@keyframes xh-spin { to { transform: rotate(360deg); } }
.xh-setup-btn {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 6px;
  border: 1px solid currentColor;
  background: none;
  color: inherit;
  cursor: pointer;
}

/* "Check answer" button + the inline status pill beside it */
.xh-check-row {
  display: flex;
  align-items: center;
  gap: 11px;
  flex-wrap: wrap;
  margin: 12px 0 0;
}
.xh-check-btn {
  font-size: 13.5px;
  font-weight: 700;
  color: #fff;
  background: var(--xh-accent);
  border: 0;
  border-radius: 7px;
  padding: 9px 18px;
  cursor: pointer;
}
.xh-check-btn:hover { opacity: .92; color: #fff; }
.xh-check-btn:focus-visible { outline: 2px solid var(--xh-accent); outline-offset: 2px; }
/* "Mark as done" - self-reported completion for static (webr:false) hubs */
.xh-done-btn {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--xh-accent);
  background: var(--xh-accent-soft);
  border: 1px solid var(--xh-accent-line);
  border-radius: 7px;
  padding: 8px 17px;
  cursor: pointer;
}
.xh-done-btn:hover { background: #e3ecfd; }
.xh-done-btn:disabled {
  color: var(--xh-pass-fg);
  background: var(--xh-pass-bg);
  border-color: var(--xh-pass-line);
  cursor: default;
}
.xh-done-btn:focus-visible { outline: 2px solid var(--xh-accent); outline-offset: 2px; }
.xh-check-status {
  display: none;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: 7px;
}
.xh-check-status.is-shown { display: inline-flex; }
.xh-check-status.is-running { color: var(--xh-mut); background: var(--xh-bg); }
.xh-check-status.is-pass { color: var(--xh-pass-fg); background: var(--xh-pass-bg); }
.xh-check-status.is-mismatch { color: var(--xh-warn-fg); background: var(--xh-warn-bg); }
.xh-check-status.is-error { color: var(--xh-err-fg); background: var(--xh-err-bg); }
.xh-check-status .xh-check-svg { width: 15px; height: 15px; }

/* ============================================================
   Progressive hints
   ============================================================ */
.xh-hints { margin: 0; }
.xh-hintbar {
  display: flex;
  align-items: center;
  gap: 8px 14px;
  flex-wrap: wrap;
}
.xh-hintbar-label { font-size: 12px; font-weight: 700; color: var(--xh-mut); }
.xh-hint-link {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--xh-accent);
  background: none;
  border: 0;
  padding: 4px 0;
  cursor: pointer;
}
.xh-hint-link:hover { text-decoration: underline; }
.xh-hint-link:focus-visible { outline: 2px solid var(--xh-accent); outline-offset: 2px; }
.xh-hint-link[disabled] { color: var(--xh-faint); cursor: default; text-decoration: none; }
.xh-hint {
  margin-top: 9px;
  padding: 10px 13px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--xh-ink);
  background: var(--xh-accent-soft);
  border-left: 3px solid var(--xh-accent-line);
  border-radius: 0 7px 7px 0;
}
.xh-hint b {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--xh-accent);
  margin-bottom: 3px;
}

/* ============================================================
   Card footer - Next button
   ============================================================ */
.xh-ex-foot {
  display: flex;
  justify-content: flex-end;
  margin-top: 20px;
}
.xh-next {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--xh-accent);
  background: var(--xh-accent-soft);
  border: 1px solid var(--xh-accent-line);
  border-radius: 7px;
  padding: 8px 15px;
  cursor: pointer;
}
.xh-next:hover { background: var(--xh-accent); color: #fff; }
.xh-next:focus-visible { outline: 2px solid var(--xh-accent); outline-offset: 2px; }
.xh-next-arrow { transition: transform .15s var(--xh-ease); }
.xh-next:hover .xh-next-arrow { transform: translateX(3px); }

/* ============================================================
   Completion badge
   ============================================================ */
.xh-badge {
  display: none;
  margin: 26px 0 10px;
  padding: 28px 24px;
  text-align: center;
  color: #fff;
  background: linear-gradient(155deg, #0f1d3a, #1e3a6b);
  border-radius: 14px;
  box-shadow: var(--xh-shadow-lift);
}
.xh-badge.is-shown { display: block; animation: xh-rise .5s var(--xh-ease); }
@keyframes xh-rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
.xh-badge-medal { font-size: 46px; line-height: 1; }
/* 2-class selectors so the site's id-scoped #content h3/p rules cannot win */
.xh-badge .xh-badge-title {
  margin: 8px 0 4px;
  font-size: 22px;
  font-weight: 700;
  color: #fff;
}
.xh-badge .xh-badge-desc { margin: 0 0 16px; font-size: 14px; color: #c3cfe3; }
.xh-badge-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.xh-badge .xh-badge-btn {
  font-size: 13px;
  font-weight: 700;
  padding: 9px 18px;
  border-radius: 8px;
  border: 0;
  cursor: pointer;
  text-decoration: none;
}
.xh-badge .xh-badge-btn-primary { background: #fbbf24; color: #1e293b; }
.xh-badge .xh-badge-btn-primary:hover { background: #f5b30a; color: #1e293b; }
.xh-badge .xh-badge-btn-ghost { background: rgba(255, 255, 255, .14); color: #fff; }

/* ============================================================
   End-of-hub CTA
   ============================================================ */
.xh-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin: 22px 0 0;
  padding: 18px 22px;
  background: var(--xh-card);
  border: 1px solid var(--xh-border);
  border-radius: 12px;
  box-shadow: var(--xh-shadow);
}
.xh-cta-text strong { display: block; font-size: 15px; color: var(--xh-ink); }
.xh-cta-text span { font-size: 13px; color: var(--xh-mut); }
.xh-cta-btn {
  flex-shrink: 0;
  font-size: 13.5px;
  font-weight: 700;
  color: #fff;
  background: var(--xh-accent);
  border-radius: 8px;
  padding: 10px 18px;
  text-decoration: none;
  white-space: nowrap;
}
.xh-cta-btn:hover { opacity: .9; color: #fff; }

/* ============================================================
   Mobile
   ============================================================ */
@media (max-width: 600px) {
  .xh-hint-link { padding: 8px 0; }
  .xh-cta { flex-direction: column; align-items: flex-start; }
  .xh-lane { grid-template-columns: 22px 1fr auto; gap: 9px; }
  .xh-lane-count { display: none; }
  .xh-lane-nodes { justify-self: start; }
  .xh-map-head { flex-wrap: wrap; }
  /* card head, mobile v2: the five fixed-width items (num, pill, clock, check,
     chevron) leave the title ~20px on narrow phones, wrapping it letter-by-letter.
     Wrap the row instead: meta stays on line 1, title gets a full line below. */
  .xh-ex-head { flex-wrap: wrap; }
  .xh-ex-name { order: 10; flex: 1 1 100%; font-size: 18.5px; }
  /* dots-only difficulty on phones (the label pushes the check + chevron onto
     a stray second line); the title attribute still names the level */
  .xh-diff { margin-left: auto; font-size: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .xh-chevron, .xh-next-arrow, .xh-badge.is-shown,
  .xh-verdict.is-pass, .xh-verdict.is-mismatch, .xh-verdict.is-error,
  .xh-rail-fill, .xh-node, .xh-node.xh-node-pop, .xh-map-count b.xh-bump,
  .xh-milestone { transition: none; animation: none; }
  .xh-check-svg path { animation: none; stroke-dashoffset: 0; }
  .xh-spinner { animation-duration: 1.4s; }
}
