/* theory-v2.css — the Theory v2 design system. Chat A, 28 September 2026.
 *
 * Spec: Command Centre/theory-kit/SPEC-V2.md. Loaded after atlas-v3.css and
 * module-v2.css on every theory page (module, category, lane). A NEW FILENAME, not an
 * edit of theory-v1.css: Hostinger edge-caches CSS for seven days, so a v1 page still
 * in someone's cache keeps its own stylesheet and a v2 page can never get a stale one.
 *
 * Four ideas carry the whole file:
 *   1. One hue per category, set once on <body data-cat> and carried everywhere.
 *   2. One boxed component (.tbox), told apart by icon, label and colour only.
 *   3. A real dark mode. atlas-v3.css has none, so v1 painted dark boxes on a white
 *      page. Theory pages set their own surface tokens.
 *   4. Anything hidden stays in the DOM: `hidden="until-found"` for reveals, so
 *      find-in-page and crawlers see it, and a guard so no author `display` rule can
 *      defeat a plain [hidden] (the v1 bug that printed every answer on screen).
 */

/* ---- tokens ---------------------------------------------------------------- */
body.tv2 {
  --bg: #f6f8fc; --card: #ffffff; --ink: #12213f; --muted: #56627a; --line: #e3e7ef;
  --soft: #eef1f6;
  --cat: #1d5fcc; --cat-fill: #edf3fc; --cat-ink: #ffffff;
  --mis: #b42318; --mis-fill: #fdf0ef;
  --tip: #33405a; --tip-fill: #f1f3f7;
  --ok: #0f7a50; --ok-fill: #ecf8f2; --bad: #b42318; --bad-fill: #fdf0ef;
  --focus: #12213f;
  /* chart roles */
  --c-demand: #2563eb; --c-supply: #c2410c; --c-social: #9c2b8a; --c-cost: #6b4fbb;
  --c-mr: #4d6b12; --c-ref: #6b7280; --c-ink: #1d1d1f;
  --a-cs: rgba(37, 99, 235, .16); --a-ps: rgba(194, 65, 12, .15); --a-revenue: rgba(214, 170, 30, .32);
  --a-dwl: rgba(192, 57, 43, .16); --a-loss: rgba(192, 57, 43, .20); --a-gain: rgba(15, 122, 80, .18);
  --a-neutral: rgba(18, 33, 63, .07); --hatch: #b42318;
  background: var(--bg); color: var(--ink);
}
body.tv2[data-cat="the-economic-problem"] { --cat: #8a5a00; --cat-fill: #f7f1e6; }
body.tv2[data-cat="markets"]              { --cat: #1d5fcc; --cat-fill: #edf3fc; }
body.tv2[data-cat="market-failure"]       { --cat: #c2410c; --cat-fill: #fcf0ea; }
body.tv2[data-cat="firms"]                { --cat: #7a3fd6; --cat-fill: #f4effc; }
body.tv2[data-cat="work-and-pay"]         { --cat: #1b7a3a; --cat-fill: #ebf5ee; }
body.tv2[data-cat="macroeconomy"]         { --cat: #0d7571; --cat-fill: #e8f4f3; }
body.tv2[data-cat="policy"]               { --cat: #4b45c9; --cat-fill: #efeefb; }
body.tv2[data-cat="global-economy"]       { --cat: #b3246e; --cat-fill: #f9ecf3; }

@media (prefers-color-scheme: dark) {
  body.tv2 {
    --bg: #121417; --card: #1a1d22; --ink: #e8eaf0; --muted: #a3acbd; --line: #2b3039;
    --soft: #20242b;
    --cat-ink: #121417;
    --mis: #f28b8b; --mis-fill: #2a1c1d;
    --tip: #c9d1e0; --tip-fill: #1f232a;
    --ok: #6fcf9f; --ok-fill: #16271f; --bad: #f28b8b; --bad-fill: #2a1c1d;
    --focus: #e8eaf0;
    --c-demand: #7aa7ff; --c-supply: #ff9a5c; --c-social: #e07ad0; --c-cost: #b39dff;
    --c-mr: #a8cc5a; --c-ref: #9ca3af; --c-ink: #e8eaf0;
    --a-cs: rgba(122, 167, 255, .22); --a-ps: rgba(255, 154, 92, .20); --a-revenue: rgba(242, 201, 76, .26);
    --a-dwl: rgba(255, 107, 107, .20); --a-loss: rgba(255, 107, 107, .24); --a-gain: rgba(111, 207, 159, .20);
    --a-neutral: rgba(232, 234, 240, .10); --hatch: #f28b8b;
    color-scheme: dark;
  }
  body.tv2[data-cat="the-economic-problem"] { --cat: #e0b04a; --cat-fill: #272216; }
  body.tv2[data-cat="markets"]              { --cat: #7aaaf5; --cat-fill: #1b2230; }
  body.tv2[data-cat="market-failure"]       { --cat: #f59a6b; --cat-fill: #2a1f1a; }
  body.tv2[data-cat="firms"]                { --cat: #b99af5; --cat-fill: #221e2e; }
  body.tv2[data-cat="work-and-pay"]         { --cat: #6fcf8f; --cat-fill: #19251d; }
  body.tv2[data-cat="macroeconomy"]         { --cat: #5cc9c2; --cat-fill: #172524; }
  body.tv2[data-cat="policy"]               { --cat: #a3a0f5; --cat-fill: #1f1f2e; }
  body.tv2[data-cat="global-economy"]       { --cat: #f27fb8; --cat-fill: #2a1b23; }
  /* atlas-v3.css pieces that theory pages use */
  body.tv2 .tabs { background: #20242b; }
  body.tv2 .tab { color: var(--muted); }
  body.tv2 .tab.on { background: var(--card); color: var(--ink); box-shadow: none; }
  body.tv2 .logo { color: var(--ink); }
  body.tv2 .btn.sec { background: var(--soft); color: var(--ink); }
  body.tv2 .paywall, body.tv2 .paywall * { color: var(--ink); }
  body.tv2 .paywall { background: var(--card); border-color: var(--line); }
}

/* THE HIDDEN ATTRIBUTE HAS TO WIN (v1's lesson). `until-found` is exempt on purpose:
 * it is hidden by content-visibility, and a display:none here would stop the browser
 * finding and opening it. */
body.tv2 [hidden]:not([hidden="until-found"]) { display: none !important; }

body.tv2 a { color: var(--cat); }
body.tv2 .wrap { max-width: 680px; }
body.tv2 .ic { flex: 0 0 auto; }
.tv2 .btn { background: var(--cat); color: var(--cat-ink); border-radius: 10px; }
.tv2 .btn:focus-visible, .tv2 button:focus-visible, .tv2 a:focus-visible,
.tv2 [tabindex]:focus-visible, .tv2 input:focus-visible, .tv2 select:focus-visible {
  outline: 3px solid var(--focus); outline-offset: 2px;
}

/* ---- top navigation: prev · category · Learn · next. Sticky on a phone. ------ */
.tnav {
  display: flex; align-items: center; gap: 6px; margin: 0 -16px 10px; padding: 8px 16px;
  background: var(--bg); border-bottom: 1px solid var(--line); font-size: 13.5px;
}
.tnav a {
  display: inline-flex; align-items: center; gap: 5px; text-decoration: none; color: var(--ink);
  font-weight: 650; padding: 6px 9px; border-radius: 9px; min-height: 36px; white-space: nowrap;
}
.tnav a:hover { background: var(--soft); }
.tnav .ncat { color: var(--cat); overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 0 1 auto; }
.tnav .ncat span { overflow: hidden; text-overflow: ellipsis; }
.tnav .nsp { flex: 1 1 auto; }
.tnav .nhome span, .tnav .nlane span { }
.tnav .npn { border: 1px solid var(--line); background: var(--card); }
.tnav .npn[aria-disabled="true"] { opacity: .45; pointer-events: none; }
.tnav .nlab-s { display: none; }
@media (max-width: 720px) {
  .tnav { position: sticky; top: 0; z-index: 20; padding-top: calc(8px + env(safe-area-inset-top)); }
  .tnav .nlab-l { display: none; }
  .tnav .nlab-s { display: inline; }
}
@media (max-width: 380px) {
  .tnav { gap: 2px; font-size: 13px; }
  .tnav a { padding: 6px 6px; }
  .tnav .nlane { display: none; }
}
.tnav .tnprog { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: transparent; }
.tnav { position: relative; }
@media (max-width: 720px) { .tnav { position: sticky; } }
.tnav .tnprog span { display: block; height: 100%; width: 0; background: var(--cat); transition: width .28s ease; }

/* ---- header band ---------------------------------------------------------- */
.thero {
  margin: 0 -16px 18px; padding: 14px 16px 16px; background: var(--cat-fill);
  border-bottom: 1px solid var(--line);
}
@media (min-width: 712px) { .thero { margin: 0 0 18px; border-radius: 16px; border: 1px solid var(--line); padding: 18px 22px 18px; } }
.thero .crumb { margin: 0 0 10px; font-size: 12.5px; color: var(--muted); }
.thero .crumb a { color: var(--muted); }
.tkick { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; }
.ttile {
  width: 40px; height: 40px; border-radius: 11px; display: inline-flex; align-items: center;
  justify-content: center; background: var(--card); color: var(--cat); border: 1px solid var(--line); flex: 0 0 auto;
}
.tkick .kl { font-size: 12px; line-height: 16px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; color: var(--cat); }
.thero h1 { font-size: 28px; line-height: 32px; letter-spacing: -.02em; margin: 0 0 6px; font-weight: 800; }
@media (min-width: 720px) { .thero h1 { font-size: 36px; line-height: 40px; } }
.thero .tout { margin: 0 0 12px; font-size: 16px; line-height: 24px; color: var(--ink); }
.tchips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0; padding: 0; list-style: none; }
.tchips li { font-size: 12.5px; font-weight: 650; padding: 4px 9px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); color: var(--muted); }
.tall {
  display: inline-flex; align-items: center; gap: 8px; font: inherit; font-size: 12.5px; font-weight: 700;
  padding: 4px 10px 4px 5px; border-radius: 999px; border: 1px solid var(--line); background: var(--card);
  color: var(--ink); cursor: pointer; min-height: 30px;
}
.tall .sw { width: 30px; height: 18px; border-radius: 9px; background: var(--line); position: relative; transition: background .2s; }
.tall .sw::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--card); transition: left .2s; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.tall[aria-pressed="true"] .sw { background: var(--cat); }
.tall[aria-pressed="true"] .sw::after { left: 14px; }
.tprog2 { height: 4px; border-radius: 4px; background: var(--card); overflow: hidden; margin: 14px 0 0; border: 1px solid var(--line); }
.tprog2 span { display: block; height: 100%; width: 0; background: var(--cat); transition: width .28s ease; }

/* ---- blocks: rhythm -------------------------------------------------------- */
.tv2 main { font-size: 16px; line-height: 25px; }
.tv2 .tb { margin: 0 0 22px; }
.tv2 .tb p { margin: 0 0 10px; }
.tv2 .tb p:last-child { margin-bottom: 0; }
.tv2 .tb > h2, .tv2 .tsech {
  font-size: 21px; line-height: 27px; letter-spacing: -.012em; margin: 30px 0 8px; font-weight: 750;
}
.tv2 .tb:first-child > h2 { margin-top: 0; }
.tv2 .tb.explain > h2 { padding-left: 12px; border-left: 3px solid var(--cat); }

/* ---- the one boxed component ---------------------------------------------- */
.tbox {
  --rule: var(--cat); --fill: var(--card);
  background: var(--fill); border-radius: 12px; border: 1px solid var(--line);
  border-left: 4px solid var(--rule); padding: 16px 18px;
}
@media (min-width: 720px) { .tbox { padding: 20px 22px; } }
.tbox + .tbox { margin-top: 14px; }
.tlab {
  display: flex; align-items: center; gap: 8px; margin: 0 0 6px; padding: 0;
  font-size: 12px; line-height: 16px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--rule);
}
.tlab .ic { width: 18px; height: 18px; }
.tbox > h2, .tbox > h3 { margin: 0 0 6px; font-size: 17px; line-height: 23px; letter-spacing: -.01em; font-weight: 750; }
.tbox > :last-child { margin-bottom: 0; }
.tbox > .tlab + * { margin-top: 0; }

/* key terms: one box, divided rows */
.tdef { --fill: var(--cat-fill); }
.tdef dl { margin: 0; }
.tdef .tdrow { display: block; padding: 12px 0; border-top: 1px solid var(--line); }
.tdef .tdrow:first-child { padding-top: 4px; border-top: 0; }
.tdef .tdrow:last-child { padding-bottom: 0; }
.tdef dt { font-weight: 800; font-size: 16.5px; line-height: 22px; margin: 0 0 3px; }
.tdef dd { margin: 0; }
.tdef .tan { margin: 12px 0 0; padding: 10px 12px; border-radius: 9px; background: var(--card); font-size: 15px; line-height: 23px; }
.tdef .tan b { display: block; font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }

/* example / worked / mistake / tip / recap / movement / predict */
.texm { --rule: #a16207; --fill: var(--card); }
.twork { --rule: var(--cat); }
.tnote.mistake { --rule: var(--mis); --fill: var(--mis-fill); }
.tnote.examtip { --rule: var(--tip); --fill: var(--tip-fill); }
.trecap { --rule: var(--cat); --fill: var(--cat-fill); margin-top: 26px; }
.tmove { --rule: var(--cat); }
.tpred { --rule: var(--cat); --fill: var(--card); }
@media (prefers-color-scheme: dark) { .texm { --rule: #e0b04a; } }

.twork .tstem { font-weight: 650; margin-bottom: 12px; }
.twork ol { margin: 0; padding: 0; list-style: none; counter-reset: tstep; }
.twork li { counter-increment: tstep; margin: 0 0 12px; padding-left: 36px; position: relative; }
.twork li:last-child { margin-bottom: 0; }
.twork li::before {
  content: counter(tstep); position: absolute; left: 0; top: 0; width: 24px; height: 24px; border-radius: 50%;
  background: var(--cat-fill); color: var(--cat); font-weight: 800; font-size: 13px; line-height: 24px; text-align: center;
}
.twork .tsl { display: block; font-weight: 750; }
.twork .tansline { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); font-weight: 750; }

/* ---- reveal machinery ---------------------------------------------------- */
.trv { margin-top: 10px; }
.trvbtn {
  display: inline-flex; align-items: center; gap: 8px; font: inherit; font-size: 14.5px; font-weight: 700;
  padding: 9px 14px; border-radius: 10px; border: 1.5px solid var(--cat); background: transparent; color: var(--cat);
  cursor: pointer; min-height: 40px;
}
.trvbtn:hover { background: var(--cat-fill); }
.trvbtn .ic { width: 18px; height: 18px; }
.trvbtn[aria-expanded="true"] { display: none; }
.tcue { margin: 0 0 8px; font-weight: 650; }
.tcue .ic { width: 18px; height: 18px; vertical-align: -3px; margin-right: 6px; color: var(--muted); }

/* ---- concepts: retrieval cards ------------------------------------------ */
.tkicker { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--cat); margin: 30px 0 4px; }
.tkicker .ic { width: 18px; height: 18px; }
.tconc > h2 { margin-top: 0 !important; }
.tconc .tci { color: var(--muted); margin: 0 0 12px; }
.tcards { display: grid; gap: 10px; margin: 12px 0 0; }
.tcard { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--cat); border-radius: 12px; }
.tcard > h3 { margin: 0; font-size: 16.5px; line-height: 22px; }
.tterm {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%;
  font: inherit; font-weight: 750; font-size: 16.5px; line-height: 22px; text-align: left; color: var(--ink);
  padding: 13px 16px; background: none; border: 0; border-radius: 12px; cursor: pointer; min-height: 48px;
}
.tterm .chev { color: var(--cat); transition: transform .2s; }
.tterm[aria-expanded="true"] .chev { transform: rotate(90deg); }
.tterm .tap { font-size: 12.5px; font-weight: 650; color: var(--muted); margin-left: auto; }
.tterm[aria-expanded="true"] .tap { display: none; }
.tcbody { padding: 0 16px 14px; }
.tcbody[hidden], .trv[hidden] { padding: 0; margin: 0; }
.tcbody .sl { display: block; font-size: 11.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 2px; }
.tcbody p { margin: 0 0 10px; }
.tcex { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.tcex .trvbtn { font-size: 13.5px; padding: 6px 11px; min-height: 36px; }

/* ---- predict ------------------------------------------------------------- */
.tpred .tq { font-weight: 700; margin: 0 0 10px; }
.tpred .popts { display: grid; gap: 8px; }
.tpred .skip { font: inherit; font-size: 13.5px; color: var(--muted); background: none; border: 0; text-decoration: underline; cursor: pointer; margin-top: 8px; padding: 4px 0; }
.tpred .pwhy { margin-top: 10px; padding: 10px 12px; border-radius: 9px; background: var(--cat-fill); }

/* ---- checks -------------------------------------------------------------- */
.tcheck { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px 18px; }
.tcheck.bank0 { margin-top: 32px; }
.tcheck .qhead { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--cat); margin: 0 0 6px; }
.tcheck .qhead .ic { width: 18px; height: 18px; }
.tcheck .tq { font-weight: 700; font-size: 16.5px; line-height: 23px; margin: 0 0 12px; }
.tcheck .tmk { font-weight: 800; color: var(--muted); }
.opt, .oitem, .popt {
  display: block; width: 100%; text-align: left; margin: 0 0 8px; padding: 12px 14px;
  border: 1.5px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink);
  font: inherit; line-height: 1.45; cursor: pointer; min-height: 48px;
}
.popt { margin: 0; }
.opt:hover, .oitem:hover, .popt:hover { border-color: var(--cat); }
.opt[aria-disabled="true"], .oitem[aria-disabled="true"], .popt[aria-disabled="true"] { cursor: default; }
.opt.right, .oitem.right, .popt.right { border-color: var(--ok); background: var(--ok-fill); }
.opt.wrong, .oitem.wrong, .popt.wrong { border-color: var(--bad); background: var(--bad-fill); }
.opt.other, .oitem.other, .popt.other { opacity: .78; }
.opt.right::before, .oitem.right::before, .popt.right::before { content: '✓ '; color: var(--ok); font-weight: 800; }
.opt.wrong::before, .oitem.wrong::before, .popt.wrong::before { content: '✗ '; color: var(--bad); font-weight: 800; }
.twhy { display: block; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); font-size: 14.5px; line-height: 22px; color: var(--muted); }
.opt.right .twhy, .oitem.right .twhy { color: var(--ink); }
.toddone { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.toddone .oitem { margin: 0; }
.tv2 .toddone .oitem, .tv2 .toddone .oit { display: block; font-weight: 500; }
.toddone.done { grid-template-columns: 1fr; }
@media (max-width: 420px) { .toddone { grid-template-columns: 1fr; } }
.tnum { display: flex; align-items: stretch; gap: 8px; }
.tnum .tunit { display: flex; align-items: center; padding: 0 12px; font-weight: 800; border: 1.5px solid var(--line); border-radius: 10px; background: var(--soft); }
.tnum .tin { flex: 1 1 auto; min-width: 0; padding: 12px 14px; font: inherit; font-weight: 650; border: 1.5px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); }
.tnum .tin.bad, .tnum .tin.wrong { border-color: var(--bad); background: var(--bad-fill); }
.tnum .tin.right { border-color: var(--ok); background: var(--ok-fill); }
.tnum .tsub { flex: 0 0 auto; }
.tans { margin-top: 12px; padding: 12px 14px; border-left: 4px solid var(--ok); border-radius: 10px; background: var(--ok-fill); }
.tans .tal { font-weight: 800; margin: 0 0 6px; }
.tans .tsch { margin: 0; font-size: 14.5px; line-height: 22px; }
.tv2 .btn.sec.treveal { background: var(--soft); color: var(--ink); }
.tlive { margin-top: 10px; }
.tlive:empty { display: none; }
.tlive .fb { padding: 10px 12px; border-radius: 10px; border-left: 4px solid var(--ok); background: var(--ok-fill); font-size: 15px; line-height: 23px; }
.tlive .fb.no { border-left-color: var(--bad); background: var(--bad-fill); }
.tlive .fb b { display: block; }

/* ---- charts ---------------------------------------------------------------- */
.tfig { margin: 0 0 12px; }
.tfig .tchart { display: block; width: 100%; max-width: 520px; height: auto; margin: 0 auto; overflow: visible; }
.tfig figcaption { font-size: 14.5px; line-height: 22px; font-weight: 650; margin-top: 8px; }
.tchart text { font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; fill: var(--c-ink);
  paint-order: stroke; stroke: var(--card); stroke-width: 3px; stroke-linejoin: round; }
.tchart .axis { fill: none; stroke: var(--c-ink); stroke-width: 1.5; }
.tchart .atitle { font-size: 13px; font-weight: 600; }
.tchart .tick { font-size: 13px; font-weight: 600; }
.tchart .clab, .tchart .plab { font-size: 14px; font-weight: 700; }
.tchart .blab { font-size: 12.5px; font-weight: 650; }
.tchart .alab { font-size: 15px; font-weight: 800; }
.tchart .cline { fill: none; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.tchart .c-demand .cline { stroke: var(--c-demand); } .tchart .c-demand .clab { fill: var(--c-demand); }
.tchart .c-supply .cline { stroke: var(--c-supply); } .tchart .c-supply .clab { fill: var(--c-supply); }
.tchart .c-social .cline { stroke: var(--c-social); } .tchart .c-social .clab { fill: var(--c-social); }
.tchart .c-cost .cline { stroke: var(--c-cost); } .tchart .c-cost .clab { fill: var(--c-cost); }
.tchart .c-mr .cline { stroke: var(--c-mr); } .tchart .c-mr .clab { fill: var(--c-mr); }
.tchart .c-ref .cline, .tchart .refl { stroke: var(--c-ref); } .tchart .c-ref { fill: var(--c-ref); }
.tchart .c-ink .cline, .tchart .c-other .cline { stroke: var(--c-ink); }
.tchart .refl { fill: none; stroke-width: 1.6; stroke-dasharray: 6 4; }
.tchart .ghost .cline { stroke-dasharray: 5 4; opacity: .55; }
.tchart .ghost .clab { opacity: .7; }
.tchart .dropl { fill: none; stroke: var(--c-ink); stroke-width: 1; stroke-dasharray: 3 3; opacity: .7; }
.tchart .dot { fill: var(--c-ink); stroke: var(--card); stroke-width: 1.5; }
.tchart .arr, .tchart .brk { fill: none; stroke: var(--c-ink); stroke-width: 1.8; }
.tchart .ahead { fill: var(--c-ink); }
.tchart .afill { stroke: var(--card); stroke-width: 1.2; stroke-linejoin: round; }
.tchart .a-cs .afill, .tchart .a-consumer .afill { fill: var(--a-cs); }
.tchart .a-ps .afill, .tchart .a-producer .afill { fill: var(--a-ps); }
.tchart .a-revenue .afill, .tchart .a-profit .afill, .tchart .a-spend .afill { fill: var(--a-revenue); }
.tchart .a-dwl .afill { fill: var(--a-dwl); }
.tchart .a-loss .afill { fill: var(--a-loss); }
.tchart .a-gain .afill { fill: var(--a-gain); }
.tchart .a-neutral .afill { fill: var(--a-neutral); }
.tchart .hatch { stroke: var(--hatch); stroke-width: 1.3; opacity: .7; }
.tchart .ahatch { stroke: none; }
.tchart .edge .eline { fill: none; stroke: var(--c-ink); stroke-width: 1.8; }
.tchart .edge.e-real .eline { stroke: var(--c-supply); stroke-dasharray: 5 3; }
.tchart .edge.e-money .eline { stroke: var(--c-demand); }
.tchart .elab { font-size: 12.5px; font-weight: 650; }
.tchart .nbox { fill: var(--cat-fill); stroke: var(--cat); stroke-width: 1.5; }
.tchart .nlab { font-size: 13.5px; font-weight: 750; }
/* state set by theory-v2.js: steps, highlights, pending reveals */
.tchart .el { transition: opacity .35s ease; }
.tchart .el.stepoff, .tchart .el[data-pend="1"] { opacity: 0; }
.tchart.hl .el:not(.hlon) { opacity: .42; }
.tchart.hl .el.stepoff, .tchart.hl .el[data-pend="1"] { opacity: 0; }
/* targets */
.tchart .tgt { cursor: pointer; outline: none; }
.tchart .hit { fill: transparent; stroke: transparent; }
.tchart .hitline { stroke-width: 24; fill: none; pointer-events: stroke; }
.tchart .hitarea, .tchart .hitpt { pointer-events: all; }
.tchart .ring { fill: none; stroke: none; stroke-width: 3; pointer-events: none; }
.tchart .tgt:hover .ring { stroke: var(--cat); stroke-dasharray: 4 3; }
.tchart .tgt:focus .ring, .tchart .tgt:focus-visible .ring { stroke: var(--focus); stroke-dasharray: none; }
.tchart .tgt.picked .ring { stroke: var(--cat); stroke-dasharray: none; }
.tchart .tgt.right .ring { stroke: var(--ok); stroke-dasharray: none; stroke-width: 3.5; }
.tchart .tgt.wrong .ring { stroke: var(--bad); stroke-dasharray: 2 3; stroke-width: 3.5; }
.tsteps { display: flex; align-items: center; gap: 8px; justify-content: center; margin: 8px 0 0; }
.tsteps button { display: inline-flex; align-items: center; gap: 4px; font: inherit; font-size: 13.5px; font-weight: 700; padding: 6px 12px; border-radius: 9px; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; min-height: 36px; }
.tsteps button .ic { width: 16px; height: 16px; }
.tsteps button:disabled { opacity: .4; cursor: default; }
.tsteps .sn { font-size: 13px; color: var(--muted); min-width: 48px; text-align: center; }
.tstepcap { margin: 8px 0 0; font-size: 15px; line-height: 23px; min-height: 23px; }
.tstepcap b { display: block; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--cat); }
/* chart-check controls */
.tchips2 { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 0; border: 0; padding: 0; }
.tchips2 legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.tchips2 button { font: inherit; font-weight: 750; min-width: 48px; min-height: 44px; padding: 8px 14px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; }
.tchips2 button:hover { border-color: var(--cat); }
.tchips2 button.right { border-color: var(--ok); background: var(--ok-fill); }
.tchips2 button.wrong { border-color: var(--bad); background: var(--bad-fill); }
.tchips2 button[aria-disabled="true"] { cursor: default; }
.tlabels { display: grid; gap: 8px; margin: 10px 0 0; }
.tlabels label { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-weight: 700; min-width: 0; }
.tlabels label .lk { min-width: 64px; }
.tlabels select { flex: 1 1 180px; min-width: 0; max-width: 100%; width: 100%; font: inherit; padding: 10px 12px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); min-height: 44px; }
.tlabels select.right { border-color: var(--ok); background: var(--ok-fill); }
.tlabels select.wrong { border-color: var(--bad); background: var(--bad-fill); }
.tlabels + .btn { margin-top: 10px; }
.tshiftopts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0 0; }
.tshiftopts .opt { margin: 0; }
@media (max-width: 420px) { .tshiftopts { grid-template-columns: 1fr; } }
.treplay { font: inherit; font-size: 13.5px; font-weight: 700; margin-top: 8px; padding: 6px 12px; border-radius: 9px; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.treplay .ic { width: 16px; height: 16px; }

@media (prefers-reduced-motion: reduce) {
  .tchart .el, .tnav .tnprog span, .tprog2 span, .tall .sw, .tall .sw::after, .tterm .chev { transition: none !important; }
}
@media (forced-colors: active) {
  .tchart .cline, .tchart .axis, .tchart .refl, .tchart .dropl { stroke: CanvasText; }
  .tchart text { fill: CanvasText; stroke: Canvas; }
  .tchart .afill { fill: none; }
}

/* ---- score box and bottom navigation ------------------------------------- */
.tv2 .scorebox { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px; margin: 26px 0 0; text-align: center; color: var(--ink); }
.tv2 .scorebox .pin { color: var(--cat); }
.tv2 .scorebox .big { color: var(--ink); }
.tv2 .scorebox .bigsub { color: var(--muted); }
.tscorenav { display: grid; gap: 8px; margin-top: 14px; text-align: left; }
.tscorenav .btn { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 16px; text-decoration: none; font-weight: 750; }
.tscorenav .btn.sec { background: var(--soft); color: var(--ink); }
.tscorenav .retry { font: inherit; font-size: 13.5px; background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; padding: 6px 0; justify-self: center; }
.tfoot { margin: 28px 0 0; }
.tpn { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tpn a {
  display: flex; flex-direction: column; gap: 3px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--card); text-decoration: none; color: var(--ink); min-height: 64px;
}
.tpn a:hover { border-color: var(--cat); }
.tpn .dir { display: flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--cat); }
.tpn .dir .ic { width: 16px; height: 16px; }
.tpn .nx { text-align: right; align-items: flex-end; }
.tpn .ttl { font-weight: 700; font-size: 15px; line-height: 20px; }
@media (max-width: 420px) { .tpn { grid-template-columns: 1fr; } .tpn .nx { text-align: left; align-items: flex-start; } }
.tup { display: flex; flex-wrap: wrap; gap: 8px 14px; margin: 14px 0 0; font-size: 14px; font-weight: 650; }
.tup a { display: inline-flex; align-items: center; gap: 5px; text-decoration: none; }
.tup .ic { width: 16px; height: 16px; }

/* ---- credits -------------------------------------------------------------- */
.tv2 .tcred { margin-top: 26px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 12px; line-height: 1.55; color: var(--muted); }
.tv2 .tcred p { margin: 0 0 6px; font-size: 12.5px; line-height: 1.55; color: var(--muted); }
.tv2 .tcred summary { cursor: pointer; font-weight: 700; font-size: 13px; color: var(--muted); padding: 6px 0; min-height: 32px; }
.tv2 .tcred details[open] summary { margin-bottom: 6px; }
.tv2 .tcred a { color: inherit; overflow-wrap: anywhere; }

/* ---- paid half and the wall ---------------------------------------------- */
.tv2 .paidpart:empty { display: none; }

/* ---- lane and category pages ---------------------------------------------- */
.tlist { display: grid; gap: 10px; margin: 12px 0 0; }
.tmod {
  display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--card); text-decoration: none; color: var(--ink);
}
.tmod:hover { border-color: var(--cat); }
.tmod .n { flex: 0 0 auto; width: 32px; height: 32px; border-radius: 9px; background: var(--cat-fill); color: var(--cat); font-weight: 800; display: inline-flex; align-items: center; justify-content: center; font-size: 14px; }
.tmod .in { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.tmod .ttl { font-weight: 750; font-size: 16px; line-height: 21px; }
.tmod .dsc { font-size: 14px; line-height: 20px; color: var(--muted); }
.tmod .tag { font-size: 12.5px; font-weight: 650; color: var(--muted); }
.tmod .tag .free { color: var(--cat); font-weight: 800; }
.tcat { --cat: #1d5fcc; --cat-fill: #edf3fc; }
.tcat .ttile { background: var(--cat-fill); border-color: transparent; }
.tcat .ttl { color: var(--ink); }
.tcat[data-cat="the-economic-problem"] { --cat: #8a5a00; --cat-fill: #f7f1e6; }
.tcat[data-cat="markets"]              { --cat: #1d5fcc; --cat-fill: #edf3fc; }
.tcat[data-cat="market-failure"]       { --cat: #c2410c; --cat-fill: #fcf0ea; }
.tcat[data-cat="firms"]                { --cat: #7a3fd6; --cat-fill: #f4effc; }
.tcat[data-cat="work-and-pay"]         { --cat: #1b7a3a; --cat-fill: #ebf5ee; }
.tcat[data-cat="macroeconomy"]         { --cat: #0d7571; --cat-fill: #e8f4f3; }
.tcat[data-cat="policy"]               { --cat: #4b45c9; --cat-fill: #efeefb; }
.tcat[data-cat="global-economy"]       { --cat: #b3246e; --cat-fill: #f9ecf3; }
@media (prefers-color-scheme: dark) {
  .tcat[data-cat="the-economic-problem"] { --cat: #e0b04a; --cat-fill: #272216; }
  .tcat[data-cat="markets"]              { --cat: #7aaaf5; --cat-fill: #1b2230; }
  .tcat[data-cat="market-failure"]       { --cat: #f59a6b; --cat-fill: #2a1f1a; }
  .tcat[data-cat="firms"]                { --cat: #b99af5; --cat-fill: #221e2e; }
  .tcat[data-cat="work-and-pay"]         { --cat: #6fcf8f; --cat-fill: #19251d; }
  .tcat[data-cat="macroeconomy"]         { --cat: #5cc9c2; --cat-fill: #172524; }
  .tcat[data-cat="policy"]               { --cat: #a3a0f5; --cat-fill: #1f1f2e; }
  .tcat[data-cat="global-economy"]       { --cat: #f27fb8; --cat-fill: #2a1b23; }
}
.tstart { margin: 14px 0 0; }
.tstart .btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 18px; text-decoration: none; font-weight: 750; }
.tv2 .small { color: var(--muted); }
.tv2 h2.tlisth { font-size: 19px; margin: 26px 0 4px; }

.tfig-ex { margin: 14px 0 4px; padding: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.tfig-ex figcaption { color: var(--muted); font-weight: 600; }

/* ---- listrecall (R-L1, R-L2, R-L4) ------------------------------------------ */
.lst .llab { display: block; font-size: 14px; color: var(--muted); margin: 0 0 8px; }
.lst .ltxt { width: 100%; padding: 12px 14px; font: inherit; font-weight: 600; border: 1.5px solid var(--line);
  border-radius: 10px; background: var(--card); color: var(--ink); }
.lst .lents { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.lst .lent { padding: 4px 10px; border-radius: 999px; background: var(--soft); font-size: 14px; }
.lst .lcount { font-size: 13px; color: var(--muted); margin: 8px 0 0; min-height: 18px; }
.lst .lbtns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.lans { list-style: none; margin: 8px 0 0; padding: 0; columns: 2; column-gap: 16px; }
@media (max-width: 420px) { .lans { columns: 1; } }
.lans li { padding: 3px 0; break-inside: avoid; }
.lans .lmk { display: inline-block; width: 20px; font-weight: 800; }
.lans .got .lmk { color: var(--ok); }
.lans .missed { color: var(--muted); }
.lans .lmiss { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.tagain { margin: 0 0 12px; }

/* ---- grouped list (R-L3), ranked table (R-L5), data credit (R-L6) ------------- */
.tgroup { padding: 14px 16px; }
.tgroup h3 { margin: 0 0 4px; font-size: 16.5px; }
.tgroup .gwhy { color: var(--muted); margin: 0 0 8px; }
.tgroup .gitems { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tgroup .gitems li { padding: 4px 10px; border-radius: 999px; background: var(--cat-fill); color: var(--ink); font-size: 14.5px; font-weight: 600; }
.trank { overflow-x: auto; margin: 8px 0 0; }
.trank table { width: 100%; border-collapse: collapse; font-size: 15px; background: var(--card); border-radius: 12px; overflow: hidden; }
.trank caption { text-align: left; font-weight: 700; padding: 0 0 8px; }
.trank th, .trank td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; }
.trank th { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.trank .num { text-align: right; font-variant-numeric: tabular-nums; }
.tdenom, .tdcred { font-size: 13px; color: var(--muted); margin: 8px 0 0; }
.tdcred a { color: inherit; }
