/* ==========================================================================
   FDE 101 — Components: hero, stat tiles, charts, quizzes, evaluator, arena
   ========================================================================== */

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(1200px 500px at 15% -10%, color-mix(in srgb, var(--brand) 16%, transparent), transparent 65%),
    radial-gradient(900px 420px at 88% 8%, color-mix(in srgb, #6a4df5 13%, transparent), transparent 62%),
    var(--surface);
  border-bottom: 1px solid var(--hairline);
  padding-block: clamp(52px, 9vw, 96px);
}
.hero__grid {
  position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image:
    linear-gradient(var(--hairline) 1px, transparent 1px),
    linear-gradient(90deg, var(--hairline) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 35%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 35%, transparent 78%);
}
.hero__inner { position: relative; }
.hero h1 { max-width: 17ch; }
.hero .lede { max-width: 60ch; margin-top: 18px; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }

.hero-stats {
  display: grid; gap: 14px; margin-top: 44px;
  grid-template-columns: repeat(auto-fit, minmax(158px, 1fr));
}

/* ==========================================================================
   Stat tiles
   ========================================================================== */
.stat {
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--r-md); padding: 16px 18px; box-shadow: var(--shadow-1);
}
.stat__value {
  font-size: clamp(1.6rem, 3.4vw, 2.15rem); font-weight: 750;
  letter-spacing: -.035em; line-height: 1.05; color: var(--ink);
}
.stat__value sup { font-size: .5em; font-weight: 700; top: -.7em; }
.stat__label { font-size: .8rem; color: var(--ink-2); margin-top: 5px; line-height: 1.35; }
.stat__meta { margin-top: 9px; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.stat--accent .stat__value { color: var(--brand-ink); }

/* ==========================================================================
   Charts
   ========================================================================== */
.figure {
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--r-lg); padding: 20px; box-shadow: var(--shadow-1);
}
.figure__head { margin-bottom: 4px; }
.figure__title { font-weight: 700; font-size: 1.02rem; letter-spacing: -.01em; }
.figure__sub { font-size: .84rem; color: var(--ink-2); margin-top: 4px; }
.figure__note {
  margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--hairline);
  font-size: .77rem; color: var(--ink-muted); display: flex; flex-wrap: wrap;
  gap: 8px; align-items: center;
}
.figure__note a { color: var(--ink-2); }
.figure__body { overflow-x: auto; margin-top: 14px; }
.figure svg { display: block; overflow: visible; }

.chart-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 12px; }
.chart-legend__item { display: inline-flex; align-items: center; gap: 7px; font-size: .81rem; color: var(--ink-2); }
.chart-legend__swatch { width: 11px; height: 11px; border-radius: 3px; flex: none; }

/* Toggle between chart and its data table */
.figure__toggle { display: flex; gap: 4px; background: var(--surface-sunk); padding: 3px; border-radius: var(--r-sm); }
.figure__toggle button {
  border: 0; background: transparent; padding: 5px 12px; border-radius: 4px;
  font-size: .78rem; font-weight: 650; color: var(--ink-muted); cursor: pointer;
}
.figure__toggle button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }

/* Chart text roles — never the series colour */
.c-axis    { fill: var(--ink-muted); font-size: 11px; }
.c-label   { fill: var(--ink-2);     font-size: 11.5px; font-weight: 600; }
.c-value   { fill: var(--ink);       font-size: 12px;   font-weight: 700; font-variant-numeric: tabular-nums; }
.c-grid    { stroke: var(--grid);     stroke-width: 1; }
.c-baseline{ stroke: var(--baseline); stroke-width: 1; }

/* Tooltip */
.viz-tip {
  position: fixed; z-index: 300; pointer-events: none; opacity: 0;
  background: var(--surface); border: 1px solid var(--hairline-strong);
  border-radius: var(--r-sm); box-shadow: var(--shadow-3);
  padding: 9px 12px; font-size: .82rem; max-width: 260px;
  transition: opacity .12s var(--ease); line-height: 1.45;
}
.viz-tip[data-show="true"] { opacity: 1; }
.viz-tip__title { font-weight: 700; margin-bottom: 3px; }
.viz-tip__row { display: flex; align-items: center; gap: 7px; color: var(--ink-2); }
.viz-tip__row b { color: var(--ink); font-variant-numeric: tabular-nums; margin-left: auto; }
.viz-tip__dot { width: 9px; height: 9px; border-radius: 3px; flex: none; }

/* ==========================================================================
   Region / segmented control
   ========================================================================== */
.segmented {
  display: inline-flex; flex-wrap: wrap; gap: 3px; padding: 4px;
  background: var(--surface-sunk); border-radius: var(--r-sm);
  border: 1px solid var(--hairline);
}
.segmented button {
  border: 0; background: transparent; cursor: pointer;
  padding: 7px 14px; border-radius: 5px; font-size: .84rem; font-weight: 600;
  color: var(--ink-2); transition: background .14s var(--ease), color .14s var(--ease);
}
.segmented button:hover { color: var(--ink); }
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--brand-ink); box-shadow: var(--shadow-1); }

.filter-row {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
  margin-bottom: 20px;
}
.field { display: inline-flex; flex-direction: column; gap: 5px; }
.field > label { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-muted); }
select, input[type="text"], input[type="search"] {
  padding: 8px 11px; border-radius: var(--r-sm); border: 1px solid var(--hairline-strong);
  background: var(--surface); color: var(--ink); font-size: .88rem; min-width: 150px;
}
input[type="range"] { accent-color: var(--brand); }

/* ==========================================================================
   Quiz
   ========================================================================== */
.quiz {
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-1);
}
.quiz__head {
  padding: 18px 22px; border-bottom: 1px solid var(--hairline);
  background: linear-gradient(180deg, var(--brand-wash), transparent);
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.quiz__icon {
  width: 34px; height: 34px; border-radius: 9px; flex: none; display: grid; place-items: center;
  background: var(--brand); color: #fff; font-size: 1rem;
}
.quiz__title { font-weight: 700; font-size: 1.04rem; }
.quiz__meta { font-size: .8rem; color: var(--ink-2); }
.quiz__progress { margin-left: auto; font-size: .8rem; color: var(--ink-muted); font-variant-numeric: tabular-nums; font-weight: 650; }
.quiz__body { padding: 22px; }

.quiz__question { font-weight: 650; font-size: 1.03rem; margin-bottom: 16px; }
.quiz__scenario {
  background: var(--surface-sunk); border-left: 3px solid var(--series-7);
  padding: 12px 15px; border-radius: 0 var(--r-sm) var(--r-sm) 0;
  font-size: .89rem; color: var(--ink-2); margin-bottom: 16px;
}
.quiz__options { display: grid; gap: 9px; }
.quiz__option {
  display: flex; align-items: flex-start; gap: 11px; width: 100%; text-align: left;
  padding: 13px 15px; border: 1px solid var(--hairline); border-radius: var(--r-md);
  background: var(--surface); cursor: pointer; font-size: .92rem; line-height: 1.5;
  transition: border-color .14s var(--ease), background .14s var(--ease), transform .14s var(--ease);
}
.quiz__option:hover:not(:disabled) { border-color: var(--brand); background: var(--brand-wash); transform: translateX(2px); }
.quiz__option:disabled { cursor: default; }
.quiz__key {
  width: 23px; height: 23px; flex: none; border-radius: 6px; display: grid; place-items: center;
  background: var(--surface-sunk); border: 1px solid var(--hairline);
  font-size: .74rem; font-weight: 700; color: var(--ink-muted);
}
.quiz__option[data-state="correct"] {
  border-color: var(--good); background: color-mix(in srgb, var(--good) 10%, transparent);
}
.quiz__option[data-state="correct"] .quiz__key { background: var(--good); color: #fff; border-color: var(--good); }
.quiz__option[data-state="wrong"] {
  border-color: var(--critical); background: color-mix(in srgb, var(--critical) 9%, transparent);
}
.quiz__option[data-state="wrong"] .quiz__key { background: var(--critical); color: #fff; border-color: var(--critical); }

.quiz__feedback {
  margin-top: 16px; padding: 14px 16px; border-radius: var(--r-md);
  font-size: .89rem; line-height: 1.6; display: none; border-left: 3px solid;
}
.quiz__feedback[data-show="true"] { display: block; animation: fadeUp .3s var(--ease); }
.quiz__feedback[data-kind="correct"] { background: color-mix(in srgb, var(--good) 9%, transparent); border-color: var(--good); }
.quiz__feedback[data-kind="wrong"]   { background: color-mix(in srgb, var(--critical) 8%, transparent); border-color: var(--critical); }
.quiz__feedback b { display: block; margin-bottom: 4px; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.quiz__foot {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 16px 22px; border-top: 1px solid var(--hairline); background: var(--surface-2);
}
.quiz__foot .quiz__score { font-size: .86rem; color: var(--ink-2); font-weight: 600; }

.quiz__result { text-align: center; padding: 14px 0; }
.quiz__result-score {
  font-size: 3rem; font-weight: 800; letter-spacing: -.04em; line-height: 1;
  color: var(--brand-ink);
}
.quiz__result-label { color: var(--ink-2); margin-top: 8px; }

/* Drag-to-sort game */
.sorter { display: grid; gap: 18px; }
.sorter__pool {
  display: flex; flex-wrap: wrap; gap: 9px; min-height: 64px; padding: 14px;
  background: var(--surface-sunk); border: 1px dashed var(--hairline-strong);
  border-radius: var(--r-md);
}
.sorter__bins { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.sorter__bin {
  border: 2px dashed var(--hairline-strong); border-radius: var(--r-md);
  padding: 14px; min-height: 130px; background: var(--surface);
  transition: border-color .14s var(--ease), background .14s var(--ease);
}
.sorter__bin.is-over { border-color: var(--brand); background: var(--brand-wash); }
.sorter__bin-title { font-weight: 700; font-size: .88rem; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.sorter__bin-drop { display: flex; flex-wrap: wrap; gap: 8px; }
.sorter__card {
  padding: 8px 13px; border-radius: 999px; background: var(--surface);
  border: 1px solid var(--hairline-strong); font-size: .84rem; font-weight: 600;
  cursor: grab; user-select: none; box-shadow: var(--shadow-1);
  transition: transform .14s var(--ease), box-shadow .14s var(--ease);
}
.sorter__card:hover { transform: translateY(-1px); box-shadow: var(--shadow-2); }
.sorter__card:active { cursor: grabbing; }
.sorter__card.is-dragging { opacity: .4; }
.sorter__card[data-state="correct"] { border-color: var(--good); background: color-mix(in srgb, var(--good) 12%, transparent); }
.sorter__card[data-state="wrong"]   { border-color: var(--critical); background: color-mix(in srgb, var(--critical) 10%, transparent); }

/* ==========================================================================
   Explainer player
   ========================================================================== */
.explainer {
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-2);
}
.explainer__stage {
  position: relative; background: var(--surface-sunk);
  aspect-ratio: 16 / 9; width: 100%; overflow: hidden;
}
.explainer__stage svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.explainer__scene { opacity: 0; transition: opacity .45s var(--ease); pointer-events: none; }
.explainer__scene[data-active="true"] { opacity: 1; }

.explainer__poster {
  position: absolute; inset: 0; display: grid; place-items: center; gap: 14px;
  background: color-mix(in srgb, var(--surface-sunk) 92%, transparent);
  backdrop-filter: blur(3px); z-index: 3; cursor: pointer;
  transition: opacity .3s var(--ease);
}
.explainer__poster[hidden] { display: none; }
.explainer__poster-inner { text-align: center; padding: 20px; }
.explainer__play {
  width: 66px; height: 66px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--brand); color: #fff; display: grid; place-items: center;
  box-shadow: var(--shadow-3); margin: 0 auto 14px;
  transition: transform .18s var(--ease);
}
.explainer__play:hover { transform: scale(1.07); }
.explainer__play svg { width: 26px; height: 26px; margin-left: 3px; }

/* The scrim must be fully opaque where the text actually sits — a soft gradient
   leaves white captions unreadable over the light-theme stage. */
.explainer__captions {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  padding: 46px 22px 16px;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0) 0%,
    rgba(0,0,0,.58) 32%,
    rgba(0,0,0,.84) 62%,
    rgba(0,0,0,.88) 100%);
  color: #fff; font-size: clamp(.85rem, 1.7vw, 1rem); font-weight: 550;
  line-height: 1.45; text-align: center; text-wrap: balance;
  text-shadow: 0 1px 4px rgba(0,0,0,.85);
}
.explainer__captions:empty { display: none; }

.explainer__controls {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  border-top: 1px solid var(--hairline); background: var(--surface);
  flex-wrap: wrap;
}
.explainer__btn {
  width: 36px; height: 36px; border-radius: 50%; border: 0; flex: none;
  background: var(--brand); color: #fff; display: grid; place-items: center; cursor: pointer;
}
.explainer__btn svg { width: 15px; height: 15px; }
.explainer__btn--quiet { background: var(--surface-sunk); color: var(--ink-2); }
.explainer__time {
  font-size: .78rem; color: var(--ink-muted); font-variant-numeric: tabular-nums;
  min-width: 74px; text-align: center;
}
.explainer__scrub { flex: 1 1 160px; min-width: 120px; }
.explainer__scrub input { width: 100%; }

.explainer__meta { padding: 16px 20px; border-top: 1px solid var(--hairline); }
.explainer__title { font-weight: 700; font-size: 1.02rem; }
.explainer__desc { font-size: .86rem; color: var(--ink-2); margin-top: 4px; }

.explainer__transcript summary {
  cursor: pointer; font-size: .82rem; font-weight: 650; color: var(--brand-ink);
  padding: 6px 0; list-style: none;
}
.explainer__transcript summary::-webkit-details-marker { display: none; }
.explainer__transcript summary::before { content: "▸ "; display: inline-block; transition: transform .15s var(--ease); }
.explainer__transcript[open] summary::before { content: "▾ "; }
.explainer__transcript ol { font-size: .85rem; color: var(--ink-2); padding-left: 1.2em; margin-top: 8px; }
.explainer__transcript li { margin-bottom: 6px; }
.explainer__transcript li.is-current { color: var(--ink); font-weight: 600; }

/* Explainer SVG helpers */
.ex-fill-surface { fill: var(--surface); }
.ex-fill-sunk    { fill: var(--surface-sunk); }
.ex-stroke       { stroke: var(--hairline-strong); }
.ex-ink          { fill: var(--ink); }
.ex-ink-2        { fill: var(--ink-2); }
.ex-muted        { fill: var(--ink-muted); }

/* ==========================================================================
   Company evaluator
   ========================================================================== */
.co-table td.co-name { font-weight: 650; white-space: nowrap; }
.co-table th[data-sortable] { cursor: pointer; user-select: none; }
.co-table th[data-sortable]:hover { color: var(--ink); }
.co-table th[data-sortable]::after { content: " ↕"; opacity: .35; font-size: .9em; }
.co-table th[data-sort="asc"]::after  { content: " ↑"; opacity: 1; color: var(--brand-ink); }
.co-table th[data-sort="desc"]::after { content: " ↓"; opacity: 1; color: var(--brand-ink); }

.score-bar { display: flex; align-items: center; gap: 8px; min-width: 92px; }
.score-bar__track {
  flex: 1; height: 6px; border-radius: 3px; background: var(--surface-sunk); overflow: hidden;
}
.score-bar__fill { height: 100%; border-radius: 3px; background: var(--seq-450); }
.score-bar__num { font-size: .8rem; font-weight: 700; font-variant-numeric: tabular-nums; min-width: 26px; text-align: right; }

.co-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.co-pick {
  padding: 7px 13px; border-radius: 999px; border: 1px solid var(--hairline-strong);
  background: var(--surface); cursor: pointer; font-size: .83rem; font-weight: 600;
  color: var(--ink-2); display: inline-flex; align-items: center; gap: 7px;
  transition: all .14s var(--ease);
}
.co-pick:hover { border-color: var(--brand); color: var(--ink); }
.co-pick[aria-pressed="true"] { color: var(--ink); border-width: 2px; padding: 6px 12px; }
.co-pick__dot { width: 9px; height: 9px; border-radius: 3px; background: var(--hairline-strong); flex: none; }
.co-pick[aria-pressed="true"] .co-pick__dot { background: var(--pick-color, var(--brand)); }

.co-detail { display: grid; gap: 14px; }
.co-detail__head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.co-detail__name { font-weight: 750; font-size: 1.2rem; letter-spacing: -.02em; }
.co-attrs { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.co-attr__label { font-size: .69rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-muted); font-weight: 700; }
.co-attr__value { font-size: .89rem; font-weight: 600; margin-top: 2px; }

/* Score-my-offer */
.offer-q { border: 1px solid var(--hairline); border-radius: var(--r-md); padding: 16px 18px; background: var(--surface); }
.offer-q + .offer-q { margin-top: 12px; }
.offer-q__label { font-weight: 650; margin-bottom: 4px; }
.offer-q__hint { font-size: .82rem; color: var(--ink-muted); margin-bottom: 12px; }
.offer-q__opts { display: grid; gap: 7px; }
.offer-opt {
  display: flex; align-items: center; gap: 10px; padding: 10px 13px;
  border: 1px solid var(--hairline); border-radius: var(--r-sm);
  cursor: pointer; font-size: .88rem; background: var(--surface);
  transition: all .14s var(--ease);
}
.offer-opt:hover { border-color: var(--brand); background: var(--brand-wash); }
.offer-opt input { accent-color: var(--brand); flex: none; }
.offer-opt:has(input:checked) { border-color: var(--brand); background: var(--brand-wash); font-weight: 600; }

.verdict {
  text-align: center; padding: 28px 22px; border-radius: var(--r-lg);
  border: 2px solid; margin-top: 20px;
}
.verdict__score { font-size: 3.2rem; font-weight: 800; letter-spacing: -.04em; line-height: 1; }
.verdict__title { font-size: 1.25rem; font-weight: 750; margin-top: 10px; }
.verdict__body { color: var(--ink-2); margin: 10px auto 0; max-width: 52ch; font-size: .92rem; }
.verdict[data-tier="strong"] { border-color: var(--good);     background: color-mix(in srgb, var(--good) 8%, transparent); }
.verdict[data-tier="strong"] .verdict__score { color: var(--good-text); }
.verdict[data-tier="hybrid"] { border-color: var(--warning);  background: color-mix(in srgb, var(--warning) 10%, transparent); }
.verdict[data-tier="hybrid"] .verdict__score { color: #9a6a00; }
.verdict[data-tier="weak"]   { border-color: var(--critical); background: color-mix(in srgb, var(--critical) 8%, transparent); }
.verdict[data-tier="weak"] .verdict__score { color: #a02a2a; }
:root[data-theme="dark"] .verdict[data-tier="hybrid"] .verdict__score { color: #ffc233; }
:root[data-theme="dark"] .verdict[data-tier="weak"] .verdict__score { color: #ff8f8f; }

/* ==========================================================================
   Arena / gamification
   ========================================================================== */
.arena-hero {
  background: linear-gradient(135deg, var(--brand-deep), #2b1a6e 55%, #4a1f6b);
  color: #fff; border-radius: var(--r-xl); padding: clamp(28px, 5vw, 46px);
  position: relative; overflow: hidden;
}
.arena-hero::after {
  content: ""; position: absolute; inset: 0; opacity: .18; pointer-events: none;
  background-image: radial-gradient(circle at 20% 30%, #fff 1px, transparent 1px),
                    radial-gradient(circle at 70% 65%, #fff 1px, transparent 1px);
  background-size: 44px 44px, 66px 66px;
}
.arena-hero > * { position: relative; z-index: 1; }
.arena-hero h1 { color: #fff; }
.arena-hero p { color: rgba(255,255,255,.82); max-width: 56ch; }

.level-bar { margin-top: 26px; max-width: 460px; }
.level-bar__meta { display: flex; justify-content: space-between; font-size: .82rem; margin-bottom: 7px; color: rgba(255,255,255,.85); font-weight: 600; }
.level-bar__track { height: 10px; border-radius: 5px; background: rgba(255,255,255,.2); overflow: hidden; }
.level-bar__fill {
  height: 100%; border-radius: 5px;
  background: linear-gradient(90deg, #4c9dff, #a78bfa);
  transition: width .7s var(--ease);
}

.badge-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.badge {
  text-align: center; padding: 20px 14px; border-radius: var(--r-md);
  border: 1px solid var(--hairline); background: var(--surface);
  transition: transform .18s var(--ease), box-shadow .18s var(--ease);
}
.badge.is-locked { opacity: .5; }
.badge.is-earned { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent); }
.badge.is-earned:hover { transform: translateY(-3px); box-shadow: var(--shadow-2), 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent); }
.badge__icon {
  width: 48px; height: 48px; margin: 0 auto 11px; border-radius: 14px;
  display: grid; place-items: center; font-size: 1.4rem;
  background: var(--surface-sunk);
}
.badge.is-earned .badge__icon { background: linear-gradient(135deg, var(--accent), #ff8a3d); }
.badge__name { font-weight: 700; font-size: .87rem; }
.badge__desc { font-size: .76rem; color: var(--ink-muted); margin-top: 4px; line-height: 1.4; }

/* Simulator */
.sim { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-2); }
.sim__head { padding: 18px 22px; background: linear-gradient(135deg, var(--brand-deep), #3b2a7a); color: #fff; }
.sim__head h3 { color: #fff; }
.sim__head p { color: rgba(255,255,255,.8); font-size: .87rem; margin-top: 4px; }
.sim__stagebar { display: flex; gap: 5px; padding: 12px 22px; background: var(--surface-2); border-bottom: 1px solid var(--hairline); overflow-x: auto; }
.sim__step {
  flex: 1 0 auto; min-width: 62px; height: 5px; border-radius: 3px; background: var(--surface-sunk);
  transition: background .3s var(--ease);
}
.sim__step.is-done { background: var(--good); }
.sim__step.is-current { background: var(--brand); }
.sim__body { padding: 24px 22px; }
.sim__stage-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; color: var(--brand-ink); }
.sim__narrative { margin-top: 10px; font-size: 1rem; line-height: 1.65; }
.sim__prompt { margin-top: 18px; font-weight: 700; }
.sim__choices { display: grid; gap: 10px; margin-top: 14px; }
.sim__choice {
  text-align: left; padding: 14px 16px; border: 1px solid var(--hairline);
  border-radius: var(--r-md); background: var(--surface); cursor: pointer;
  font-size: .92rem; line-height: 1.5;
  transition: all .14s var(--ease);
}
.sim__choice:hover { border-color: var(--brand); background: var(--brand-wash); transform: translateX(3px); }
.sim__outcome {
  margin-top: 16px; padding: 15px 17px; border-radius: var(--r-md);
  border-left: 3px solid var(--series-7); background: var(--surface-sunk);
  font-size: .9rem; line-height: 1.6; animation: fadeUp .3s var(--ease);
}
.sim__delta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.sim__delta-chip { font-size: .74rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.sim__delta-chip[data-dir="up"]   { background: color-mix(in srgb, var(--good) 15%, transparent); color: var(--good-text); }
.sim__delta-chip[data-dir="down"] { background: color-mix(in srgb, var(--critical) 13%, transparent); color: #a02a2a; }
:root[data-theme="dark"] .sim__delta-chip[data-dir="down"] { color: #ff8f8f; }

.rubric-row { display: grid; grid-template-columns: minmax(120px, 1.4fr) 1fr auto; gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--hairline); }
.rubric-row:last-child { border-bottom: 0; }
.rubric-row__name { font-size: .87rem; font-weight: 600; }
.rubric-row__weight { font-size: .74rem; color: var(--ink-muted); font-weight: 600; }

/* Certificate */
.cert-preview {
  border: 1px solid var(--hairline); border-radius: var(--r-md);
  overflow: hidden; background: var(--surface-sunk); padding: 14px;
}
.cert-preview canvas { width: 100%; height: auto; display: block; border-radius: var(--r-sm); box-shadow: var(--shadow-2); }

/* ==========================================================================
   Course map (landing)
   ========================================================================== */
.map-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); }
.map-card {
  position: relative; display: flex; flex-direction: column; gap: 9px;
  padding: 20px; border: 1px solid var(--hairline); border-radius: var(--r-lg);
  background: var(--surface); text-decoration: none; box-shadow: var(--shadow-1);
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), border-color .18s var(--ease);
  overflow: hidden;
}
.map-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--map-accent, var(--brand)); opacity: 0;
  transition: opacity .18s var(--ease);
}
.map-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-3); border-color: var(--hairline-strong); }
.map-card:hover::before { opacity: 1; }
.map-card__top { display: flex; align-items: center; gap: 10px; }
.map-card__num {
  width: 27px; height: 27px; border-radius: 8px; flex: none; display: grid; place-items: center;
  background: var(--surface-sunk); color: var(--ink-muted);
  font-size: .76rem; font-weight: 750; font-variant-numeric: tabular-nums;
}
.map-card.is-done .map-card__num { background: var(--good); color: #fff; }
.map-card__title { font-weight: 700; font-size: 1.02rem; letter-spacing: -.015em; color: var(--ink); }
.map-card__desc { font-size: .86rem; color: var(--ink-2); line-height: 1.5; flex: 1; }
.map-card__foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 3px; }
.map-card__time { font-size: .76rem; color: var(--ink-muted); font-weight: 600; }

/* Track picker */
.track-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.track {
  padding: 20px; border-radius: var(--r-lg); border: 1px solid var(--hairline);
  background: var(--surface); cursor: pointer; text-align: left; width: 100%;
  transition: all .16s var(--ease);
}
.track:hover { border-color: var(--brand); transform: translateY(-2px); box-shadow: var(--shadow-2); }
.track[aria-pressed="true"] { border-color: var(--brand); border-width: 2px; padding: 19px; background: var(--brand-wash); }
.track__icon { font-size: 1.5rem; margin-bottom: 9px; }
.track__name { font-weight: 700; margin-bottom: 4px; }
.track__desc { font-size: .84rem; color: var(--ink-2); line-height: 1.5; }

/* ==========================================================================
   Toast
   ========================================================================== */
.toast-host {
  position: fixed; right: 18px; bottom: 18px; z-index: 400;
  display: flex; flex-direction: column-reverse; gap: 10px; pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 12px; padding: 13px 17px;
  background: var(--surface); border: 1px solid var(--hairline-strong);
  border-radius: var(--r-md); box-shadow: var(--shadow-3);
  min-width: 232px; max-width: 320px;
  animation: toastIn .35s var(--ease);
}
.toast.is-out { animation: toastOut .3s var(--ease) forwards; }
@keyframes toastIn  { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px) scale(.97); } }
.toast__icon {
  width: 34px; height: 34px; border-radius: 10px; flex: none; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), #ff8a3d); font-size: 1.05rem;
}
.toast__title { font-weight: 700; font-size: .88rem; }
.toast__sub { font-size: .78rem; color: var(--ink-2); }

/* ==========================================================================
   Misc
   ========================================================================== */
.checklist { display: grid; gap: 10px; }
.check-item {
  display: flex; align-items: flex-start; gap: 12px; padding: 13px 15px;
  border: 1px solid var(--hairline); border-radius: var(--r-md);
  background: var(--surface); cursor: pointer; transition: all .14s var(--ease);
}
.check-item:hover { border-color: var(--brand); }
.check-item[data-checked="true"] { background: color-mix(in srgb, var(--good) 8%, transparent); border-color: var(--good); }
.check-item__box {
  width: 21px; height: 21px; flex: none; border-radius: 6px; margin-top: 1px;
  border: 2px solid var(--hairline-strong); display: grid; place-items: center;
  font-size: .75rem; color: transparent; transition: all .14s var(--ease);
}
.check-item[data-checked="true"] .check-item__box { background: var(--good); border-color: var(--good); color: #fff; }
.check-item__title { font-weight: 650; font-size: .93rem; }
.check-item__desc { font-size: .84rem; color: var(--ink-2); margin-top: 2px; line-height: 1.5; }

.timeline { position: relative; padding-left: 30px; }
.timeline::before { content: ""; position: absolute; left: 8px; top: 6px; bottom: 6px; width: 2px; background: var(--hairline); }
.timeline__item { position: relative; padding-bottom: 26px; }
.timeline__item:last-child { padding-bottom: 0; }
.timeline__dot {
  position: absolute; left: -30px; top: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--surface); border: 3px solid var(--brand);
}
.timeline__year { font-size: .74rem; font-weight: 750; letter-spacing: .07em; text-transform: uppercase; color: var(--brand-ink); }
.timeline__body { margin-top: 4px; }
.timeline__body strong { display: block; margin-bottom: 3px; }

.kv { display: grid; gap: 2px; }
.kv__k { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-muted); font-weight: 700; }
.kv__v { font-weight: 600; }

.pill-row { display: flex; flex-wrap: wrap; gap: 7px; }

@media (max-width: 640px) {
  .site-header__bar { gap: 10px; }
  .brand__sub { display: none; }
  .card { padding: 18px; }
  .rubric-row { grid-template-columns: 1fr auto; }
  .rubric-row__bar { grid-column: 1 / -1; }
}
