:root {
  --ground: #f3efed;
  --surface: #f8f5f3;
  --raised: #e9e2df;
  --active: #e1d9d5;
  --border: #d4cbc7;
  --rule: #e1d9d5;
  --control: #b9aca6;
  --ink: #2b2622;
  --muted: #605854;
  --faint: #605854;
  --primary: #164578;
  --accent: #164578;
  --positive: #0f7d45;
  --negative: #b83e42;
  --warning: #8b5a12;
  --radius-card: 2px;
  --radius-control: 2px;
  --sidebar-width: 240px;
  --gap: 16px;
  --font: "Inter", Arial, sans-serif;
  --heading-font: "Sora", Arial, sans-serif;
  font-family: var(--font);
  color: var(--ink);
  background: var(--ground);
}

.topic-completion-gate { display: grid; gap: 6px; margin-top: 12px; padding: 12px 14px; border-left: 4px solid #8b5a12; color: var(--ink); background: #f3ead8; box-shadow: 0 2px 7px rgb(43 38 34 / 8%); }
.topic-completion-state { color: #71470f; font: 700 11px/16px var(--font); letter-spacing: .04em; text-transform: uppercase; }
.topic-completion-copy { color: var(--ink); font: 400 12px/18px var(--font); }
.topic-completion-gate[data-complete="true"] { border-left-color: #287450; background: #e5efe8; }
.topic-completion-gate[data-complete="true"] .topic-completion-state { color: #1d6442; }
.topic-completion-open { justify-self: start; min-height: 38px; margin-top: 3px; padding: 8px 11px; border: 0; border-radius: 0; color: #fff; background: #164578; box-shadow: 0 2px 6px rgb(22 69 120 / 22%); font: 600 12px/17px var(--font); cursor: pointer; }
.topic-completion-open:hover { background: #0f355b; box-shadow: 0 4px 9px rgb(22 69 120 / 28%); }
.topic-completion-open:focus-visible { outline: 3px solid #164578; outline-offset: 3px; }
.topic-completion-open[hidden] { display: none; }
.topic-completion-gate[data-complete="true"] .topic-completion-open { background: #1d6442; }
.topic-completion-gate[data-complete="true"] .topic-completion-open:hover { background: #154d33; }
@media (max-width: 760px) { .topic-completion-gate { margin-top: 10px; padding: 11px 12px; } .topic-completion-open { width: 100%; justify-self: stretch; } }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { min-width: 0; width: 100%; margin: 0; background: var(--ground); color: var(--ink); font-family: var(--font); font-size: 14px; line-height: 1.45; }
body { overflow-wrap: break-word; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible, [tabindex="0"]:focus-visible { outline: 2px solid var(--accent) !important; outline-offset: 2px !important; }

#topic-shell { display: grid !important; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); grid-template-rows: minmax(100svh, auto); align-items: start; min-width: 0; width: 100%; background: var(--ground); }
#topic-top { grid-column: 1; grid-row: 1; position: sticky; inset-block-start: 0; z-index: 20; display: flex; flex-direction: column; flex-wrap: nowrap !important; align-items: stretch !important; gap: 26px; width: var(--sidebar-width); height: 100svh; min-width: 0; overflow-x: clip; overflow-y: auto; padding: 28px 12px 18px; border: 0 !important; border-right: 1px solid var(--border) !important; background: var(--ground) !important; }
#topic-top .hub-top-line { display: flex; flex-direction: column; align-items: stretch; gap: 23px; width: 100%; max-width: 100%; min-width: 0; margin: 0; padding: 0 8px; }
#hub-brand { min-width: 0; max-width: 100%; gap: 10px; color: var(--ink); }
#hub-brand > span:first-child { display: grid; flex: 0 0 32px; width: 32px; height: 32px; color: var(--ink) !important; background: transparent !important; }
#hub-brand > span:first-child .material-symbols-outlined { font-size: 23px; }
#hub-brand > span:last-child > span:first-child { color: var(--ink) !important; font: 600 14px/20px var(--font) !important; }
#hub-brand > span:last-child > span:last-child { color: var(--muted) !important; font: 400 12px/17px var(--font) !important; }
#topic-top .hub-top-line > div:last-child { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; width: 100%; }
#topic-top .hub-top-line > div:last-child > span { flex: 0 1 auto; padding: 0; border-radius: 0; color: var(--muted) !important; background: transparent !important; font: 400 12px/18px var(--font) !important; }
#topic-top .hub-top-line > div:last-child > span .material-symbols-outlined { display: none; }
#hub-reset { min-height: 34px; padding: 6px 8px !important; border: 1px solid var(--control) !important; border-radius: var(--radius-control) !important; color: var(--ink) !important; background: var(--surface) !important; font: 500 12px/18px var(--font) !important; white-space: nowrap; }
#hub-reset:hover { background: var(--raised) !important; }
#topic-top > nav { flex: 1 1 auto; min-height: 0; width: 100%; max-width: 100%; min-width: 0; overflow-x: clip; overflow-y: visible; border: 0 !important; background: transparent !important; }
.hub-topic-nav { display: flex; flex-direction: column; align-items: stretch; gap: 4px; width: 100%; max-width: 100%; min-width: 0; margin: 0; padding: 0; overflow-x: clip; overflow-y: visible; }
#nav-all-topics, #topic-menu button { display: flex; align-items: center; justify-content: flex-start; gap: 9px; width: 100%; max-width: 100%; min-width: 0; min-height: 36px; padding: 7px 9px !important; border: 0 !important; border-radius: 6px !important; color: var(--muted) !important; background: transparent !important; font: 400 13px/18px var(--font) !important; text-align: left; white-space: normal !important; overflow-wrap: anywhere; }
#nav-all-topics:hover, #topic-menu button:hover { background: #e9eaec !important; color: var(--ink) !important; }
#nav-all-topics[aria-current="page"], #topic-menu button[aria-current="page"] { background: var(--active) !important; color: var(--ink) !important; font-weight: 500 !important; }
#nav-all-topics .material-symbols-outlined, #topic-menu .material-symbols-outlined { flex: 0 0 17px; width: 17px; color: currentColor; font-size: 17px; }
#topic-menu { display: grid; gap: 3px; width: 100%; max-width: 100%; min-width: 0; overflow-x: clip; }
@media (min-width: 921px) {
  #topic-shell header#topic-top { padding: 28px 12px 18px; overflow-x: clip; overflow-y: auto; }
}

#hub-landing, #topic-detail { grid-column: 2; grid-row: 1; width: 100%; max-width: none; min-width: 0; margin: 0; padding: 34px clamp(20px, 3.2vw, 48px) 48px; }
#hub-landing { display: flex; flex-direction: column; gap: 28px; }
#hub-landing > section:first-child { display: grid !important; grid-template-columns: minmax(0, 1.12fr) minmax(270px, .88fr) !important; gap: 36px !important; align-items: start !important; padding: 0 !important; border: 0 !important; border-radius: 0 !important; background: transparent !important; }
#hub-landing > section:first-child > div:first-child { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; min-width: 0; }
#hub-landing > section:first-child > div:first-child > span { padding: 0 !important; border-radius: 0 !important; color: var(--muted) !important; background: transparent !important; font: 500 12px/18px var(--font) !important; }
#hub-landing h1 { max-width: 660px; margin: 0; color: var(--ink) !important; font: 600 28px/1.18 var(--font) !important; letter-spacing: -.025em !important; text-wrap: balance; }
#hub-landing > section:first-child > div:first-child > p { max-width: 66ch; margin: 0; color: var(--muted) !important; font: 400 14px/1.55 var(--font) !important; }
#hub-case-start, #hub-start { min-height: 38px !important; padding: 8px 12px !important; border: 1px solid var(--control) !important; border-radius: var(--radius-control) !important; color: var(--ink) !important; background: var(--surface) !important; font: 500 13px/18px var(--font) !important; }
#hub-case-start { color: #fff !important; border-color: var(--primary) !important; background: var(--primary) !important; }
#hub-case-start:hover { background: #303236 !important; }
#hub-start:hover { background: var(--raised) !important; }
#hub-landing > section:first-child > aside { display: flex; flex-direction: column; gap: 0; min-width: 0; padding: 0; border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--surface) !important; }
#hub-landing > section:first-child > aside > div:first-child { display: flex; justify-content: space-between; gap: 12px; padding: 13px 15px; border-bottom: 1px solid var(--rule); }
#hub-landing > section:first-child > aside > div:first-child > span:first-child { color: var(--ink) !important; font: 500 14px/20px var(--font) !important; }
#hub-landing > section:first-child > aside > div:first-child > span:last-child { padding: 0 !important; color: var(--muted) !important; background: transparent !important; font: 400 12px/18px var(--font) !important; }
#hub-landing > section:first-child > aside > div:last-child { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0; margin: 0; }
#hub-landing > section:first-child > aside > div:last-child > div { min-width: 0; padding: 12px 15px; border: 0 !important; border-radius: 0 !important; background: transparent !important; }
#hub-landing > section:first-child > aside > div:last-child > div:nth-child(odd) { border-right: 1px solid var(--rule) !important; }
#hub-landing > section:first-child > aside > div:last-child > div:nth-child(n+3) { border-top: 1px solid var(--rule) !important; }
#hub-landing > section:first-child > aside > div:last-child span:first-child { color: var(--muted) !important; font: 400 12px/17px var(--font) !important; }
#hub-landing > section:first-child > aside > div:last-child > div > span:last-child, #hub-landing > section:first-child > aside > div:last-child > div > span:last-child > span { color: var(--ink) !important; font: 400 21px/1.25 "Geist Mono", ui-monospace, monospace !important; font-variant-numeric: tabular-nums; }
#landing-bank { color: var(--accent) !important; }

#hub-landing > section:nth-child(2) { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
#hub-landing > section:nth-child(2) > div:first-child { align-items: end; padding-bottom: 11px; border-bottom: 1px solid var(--border); }
#hub-landing h2 { margin: 0; color: var(--ink) !important; font: 550 17px/23px var(--font) !important; letter-spacing: -.01em; }
#hub-landing > section:nth-child(2) > div:first-child p { margin: 4px 0 0; color: var(--muted) !important; font: 400 13px/19px var(--font) !important; }
#hub-landing > section:nth-child(2) > div:first-child .lesson-format { margin: 0; color: var(--muted) !important; font: 400 12px/18px var(--font) !important; white-space: nowrap; }
#hub-landing > section:nth-child(2) > div:first-child > div:last-child { padding: 0 !important; color: var(--muted) !important; background: transparent !important; font: 400 12px/18px var(--font) !important; }
#hub-cards { display: block; min-width: 0; border-top: 1px solid var(--rule); }
#hub-cards > article { position: relative; display: block !important; min-width: 0; min-height: 75px; height: auto !important; padding: 14px 150px 13px 10px !important; border: 0 !important; border-bottom: 1px solid var(--rule) !important; border-radius: 0 !important; background: transparent !important; box-shadow: none !important; cursor: pointer; }
#hub-cards > article:hover { background: #eceef0 !important; }
#hub-cards > article > div:first-child { display: block !important; min-width: 0; }
#hub-cards > article header { display: flex; justify-content: flex-end; min-height: 0; margin: 0; }
#hub-cards > article header > div { display: none !important; }
#hub-cards .topic-status { position: absolute; inset-inline-end: 10px; inset-block-start: 14px; min-height: 18px; padding: 1px 6px !important; border-radius: 4px !important; color: var(--muted) !important; background: var(--raised) !important; font: 400 11px/16px var(--font) !important; }
#hub-cards .topic-status[class*="bg-success-container"] { color: #124a30 !important; background: #e4f0e9 !important; }
#hub-cards > article h3 { margin: 0; color: var(--ink) !important; font: 500 14px/20px var(--font) !important; }
#hub-cards > article p { max-width: 72ch; margin: 3px 0 0; color: var(--muted) !important; font: 400 13px/19px var(--font) !important; }
#hub-cards > article > div:first-child > div:last-child { display: flex; flex-wrap: wrap; gap: 12px; padding-top: 7px; color: var(--muted) !important; font: 400 11px/16px var(--font) !important; }
#hub-cards > article > footer { position: absolute; inset-inline-end: 8px; inset-block-start: 50%; transform: translateY(-50%); padding: 0; border: 0; }
#hub-cards > article > footer button { min-height: 34px; padding: 5px 7px; border: 0; border-radius: 5px; color: var(--ink); background: transparent; font: 500 12px/18px var(--font); white-space: nowrap; }
#hub-cards > article > footer button:hover { background: var(--active); }

#topic-detail { padding-top: 30px; }
#topic-detail > div:first-child { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 0 22px; padding-bottom: 17px; border-bottom: 1px solid var(--border); }
#topic-detail > div:first-child > div { min-width: 0; }
#topic-icon { display: none !important; }
#topic-eyebrow { color: var(--muted) !important; font: 400 12px/18px var(--font) !important; text-transform: none !important; }
#topic-title { margin: 2px 0 0 !important; color: var(--ink) !important; font: 600 24px/31px var(--font) !important; letter-spacing: -.02em; text-wrap: balance; }
#topic-subtitle { max-width: 72ch; margin: 4px 0 0 !important; color: var(--muted) !important; font: 400 13px/19px var(--font) !important; }
#hub-back { min-height: 34px; flex: 0 0 auto; padding: 6px 9px !important; border: 1px solid var(--control) !important; border-radius: var(--radius-control) !important; color: var(--ink) !important; background: var(--surface) !important; font: 500 12px/18px var(--font) !important; }
#hub-back:hover { background: var(--raised) !important; }
#topic-detail > .grid { display: grid !important; grid-template-columns: minmax(0,1.55fr) minmax(265px,.7fr) !important; align-items: start !important; gap: 24px !important; min-width: 0; }
#topic-detail > .grid > section, #topic-detail > .grid > aside { min-width: 0; }
#topic-flow { display: flex; align-items: center; gap: 8px; min-height: 34px; margin-bottom: 3px; }
#topic-flow > span:not(.material-symbols-outlined) { padding: 5px 0 !important; border-radius: 0 !important; color: var(--muted) !important; background: transparent !important; font: 400 12px/18px var(--font) !important; }
#topic-detail aside { display: flex; flex-direction: column; gap: 16px; }
#topic-detail aside > section { display: flex; flex-direction: column; gap: 9px; padding: 15px 0 !important; border: 0 !important; border-bottom: 1px solid var(--border) !important; border-radius: 0 !important; background: transparent !important; }
#topic-detail aside > section :where(h2,p,span,label) { color: var(--ink) !important; font-family: var(--font) !important; }
#topic-detail aside > section p { color: var(--muted) !important; font-size: 13px !important; line-height: 1.5 !important; }
#topic-detail aside button { min-height: 36px; padding: 7px 10px; border: 1px solid var(--control); border-radius: var(--radius-control); color: var(--ink); background: var(--surface); font: 500 13px/18px var(--font); }
#topic-detail aside button:hover { background: var(--raised); }
#topic-detail aside #guide-next { color: #fff; border-color: var(--primary); background: var(--primary); }
#topic-detail aside #guide-next:hover { background: #303236; }
#topic-detail aside [role="status"] { min-height: 18px; font-size: 12px !important; }

#topic-app #practice-lab { min-width: 0; padding: 0; border: 0; color: var(--ink); background: transparent; font-family: var(--font); }
#topic-app #practice-lab .lab-stage { min-width: 0; padding: 20px; border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--surface); }
#topic-app #practice-lab .lab-stage:focus { outline: none; }
#topic-app #practice-lab .lab-stage :where(h2,h3,h4) { color: var(--ink); font: 550 16px/1.35 var(--font); letter-spacing: 0; }
#topic-app #practice-lab .lab-stage :where(p,label,small,li,th,td,caption,summary) { font-family: var(--font); line-height: 1.5; }
#topic-app #practice-lab .lab-stage p, #topic-app #practice-lab .lab-stage li { color: var(--muted); font-size: 14px; }
#topic-app #practice-lab .lab-stage .lab-card, #topic-app #practice-lab .lab-stage .lab-stat { border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--surface); }
#topic-app #practice-lab .lab-stage .lab-stat { border-radius: 0; box-shadow: none; }
#topic-app #practice-lab .lab-stage .lab-stat strong { color: var(--ink); font: 400 20px/1.3 "Geist Mono", ui-monospace, monospace; font-variant-numeric: tabular-nums; }
#topic-app #practice-lab .lab-stage .lab-note { border: 1px solid var(--border); border-radius: var(--radius-card); color: var(--ink); background: var(--raised); font-size: 13px; }
#topic-app #practice-lab .lab-stage .lab-good { border-color: #c7ddcf; color: #16492e; background: #edf5ef; }
#topic-app #practice-lab .lab-stage .lab-form { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
#topic-app #practice-lab .lab-stage .lab-field { min-width: 0; }
#topic-app #practice-lab .lab-stage .lab-field label { color: var(--ink); font: 500 13px/18px var(--font); }
#topic-app #practice-lab .lab-stage .lab-field :where(input,select,textarea) { width: 100%; min-width: 0; min-height: 40px; padding: 8px 10px; border: 1px solid var(--control); border-radius: var(--radius-control); color: var(--ink); background: #fff; font: 400 14px/20px var(--font); }
#topic-app #practice-lab .lab-stage :where(button,.lab-btn) { min-height: 36px; max-width: 100%; padding: 7px 10px; border: 1px solid var(--control); border-radius: var(--radius-control); color: var(--ink); background: var(--surface); font: 500 13px/18px var(--font); white-space: normal; }
#topic-app #practice-lab .lab-stage :where(button,.lab-btn):hover { background: var(--raised); box-shadow: none; transform: none; }
#topic-app #practice-lab .lab-stage .lab-btn.primary { color: #fff; border-color: var(--primary); background: var(--primary); }
#topic-app #practice-lab .lab-stage .lab-table-wrap { width: 100%; min-width: 0; max-width: 100%; overflow: auto; overscroll-behavior-inline: contain; border: 1px solid var(--border); border-radius: var(--radius-card); }
#topic-app #practice-lab .lab-stage table { width: 100%; min-width: 560px; border-collapse: collapse; background: var(--surface); font: 400 13px/1.4 var(--font); font-variant-numeric: tabular-nums; }
#topic-app #practice-lab .lab-stage caption { padding: 10px 12px; color: var(--muted); font: 500 12px/18px var(--font); text-align: left; }
#topic-app #practice-lab .lab-stage :where(th,td) { padding: 9px 11px; border-bottom: 1px solid var(--rule); color: var(--ink); font: 400 13px/18px var(--font); white-space: normal; }
#topic-app #practice-lab .lab-stage thead { position: sticky; top: 0; z-index: 1; background: var(--raised); }
#topic-app #practice-lab .lab-stage th { font-weight: 500; text-align: left; }
#topic-app #practice-lab .lab-stage td.num { text-align: right; font-variant-numeric: tabular-nums; }
#topic-app #practice-lab .lab-stage details { border-color: var(--border); border-radius: var(--radius-card); }

@media (max-width: 920px) {
  #topic-shell { display: flex !important; flex-direction: column; min-height: 100svh; }
  #topic-top { position: sticky; inset-block-start: 0; z-index: 30; display: block; width: 100%; height: auto; overflow: visible; padding: 0; border: 0 !important; border-bottom: 1px solid var(--border) !important; }
  #topic-top .hub-top-line { display: flex; flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 8px 18px; }
  #topic-top .hub-top-line > div:last-child { display: flex; flex-direction: row; align-items: center; justify-content: flex-end; gap: 8px; width: auto; }
  #topic-top > nav { width: 100%; overflow: hidden; border-top: 1px solid var(--rule) !important; }
  .hub-topic-nav { display: grid; grid-template-columns: minmax(0,1fr); align-items: stretch; gap: 8px; width: 100%; min-width: 0; padding: 10px 14px 14px; overflow: visible; }
  #nav-all-topics, #topic-menu button { flex: initial; width: 100%; min-height: 42px; white-space: normal !important; }
  #topic-menu { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; width: 100%; min-width: 0; }
  #hub-landing, #topic-detail { width: 100%; max-width: none; min-width: 0; margin: 0; padding: 24px clamp(18px, 4vw, 32px) 38px; }
  #topic-detail > .grid { grid-template-columns: minmax(0,1fr) !important; }
  #topic-detail > .grid > aside { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); align-items: start; }
}
@media (max-width: 760px) {
  #hub-landing > section:first-child { grid-template-columns: minmax(0,1fr) !important; gap: 20px !important; }
  #hub-landing > section:first-child > aside { max-width: 620px; }
  #hub-landing > section:nth-child(2) > div:first-child { align-items: flex-start; flex-direction: column; gap: 8px; }
  #hub-cards > article { padding-right: 12px !important; }
  #hub-cards > article > footer { position: static; display: flex; justify-content: flex-start; transform: none; margin-top: 7px; }
  #hub-cards .topic-status { position: static; margin-left: auto; }
  #topic-detail > .grid > aside { grid-template-columns: minmax(0,1fr); }
  #topic-app #practice-lab .lab-stage { padding: 16px; }
  #topic-app #practice-lab .lab-stage .lab-form { grid-template-columns: minmax(0,1fr); }
  #topic-app #practice-lab .lab-stage .lab-field.full { grid-column: auto; }
  #topic-app #practice-lab .lab-stage .lab-grid { grid-template-columns: minmax(0,1fr); }
  .topic-case #sim > main { grid-template-columns: minmax(0,1fr); }
  .topic-case #map { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 480px) {
  #topic-top .hub-top-line { gap: 8px; padding: 7px 12px; }
  #hub-brand > span:first-child { flex-basis: 26px; width: 26px; height: 28px; }
  #hub-brand > span:last-child > span:first-child { font-size: 13px !important; }
  #hub-brand > span:last-child > span:last-child { font-size: 11px !important; }
  #topic-top .hub-top-line > div:last-child > span { display: none; }
  #hub-reset { min-height: 34px; padding-inline: 7px !important; }
  .hub-topic-nav { padding-inline: 10px; }
  #hub-landing, #topic-detail { padding: 20px 14px 32px; }
  #hub-landing { gap: 23px; }
  #hub-landing h1 { font-size: 24px !important; line-height: 1.22 !important; }
  #hub-landing > section:first-child > div:first-child > div { display: flex; flex-direction: column; align-items: stretch; width: 100%; }
  #hub-case-start, #hub-start { justify-content: center; width: 100%; min-height: 42px !important; }
  #hub-landing > section:first-child > aside > div:last-child > div { padding: 10px 11px; }
  #hub-landing > section:first-child > aside > div:last-child > div > span:last-child, #hub-landing > section:first-child > aside > div:last-child > div > span:last-child > span { font-size: 18px !important; }
  #hub-cards > article { min-height: 0; padding: 12px 4px !important; }
  #hub-cards .topic-status { position: static; }
  #topic-detail { padding-top: 20px; }
  #topic-detail > div:first-child { align-items: flex-start; flex-direction: column; gap: 11px; }
  #topic-title { font-size: 21px !important; line-height: 27px !important; }
  #topic-detail > .grid { gap: 16px !important; }
  #topic-app #practice-lab .lab-stage { padding: 13px; }
  #topic-app #practice-lab .lab-stage .lab-table-wrap { max-width: calc(100vw - 48px); }
  #topic-app #practice-lab .lab-stage :where(button,.lab-btn) { min-height: 42px; }
  #dlg { width: calc(100vw - 24px); max-height: calc(100dvh - 24px); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* Case-study workflow: retain the learner guide, swimlanes, and saved journal explanation. */
.topic-case #topic-detail > .grid { grid-template-columns: minmax(0,1.55fr) minmax(265px,.7fr) !important; }
.topic-case #topic-detail > .grid > aside { display: flex !important; }
.topic-case #topic-flow { flex-wrap: wrap; gap: 6px 12px; margin-bottom: 12px; }
.topic-case #case-host { width: 100%; min-width: 0; }
.topic-case #sim { width: 100%; min-width: 0; max-width: none; overflow: visible; }
.topic-case #sim > main { display: grid; grid-template-columns: minmax(0,1fr); gap: 10px; width: 100%; min-width: 0; max-width: none; margin: 0; padding: 10px 0 18px; }
.topic-case #sim > main > aside { display: none !important; }
.topic-case #sim > main > #mission,
.topic-case #sim > main > #recap,
.topic-case #sim > main > #map { grid-column: 1; min-width: 0; width: 100%; }
.topic-case #mission { position: relative; z-index: 2; padding: 16px 18px; border: 1px solid var(--border); border-inline-start: 3px solid var(--accent); border-radius: 8px; background: var(--surface); }
.topic-case #mission h4 { margin: 2px 0 6px; color: var(--ink); font: 600 19px/1.25 var(--font); }
.topic-case #mission p { margin: 0 0 8px; color: var(--muted); font: 400 13px/1.5 var(--font); }
.topic-case #mission .n { color: var(--accent); font: 600 11px/16px var(--font); letter-spacing: .06em; }
.topic-case #mission .mentor-prompt { padding: 9px 11px; border-inline-start: 2px solid var(--accent); color: var(--ink); background: var(--raised); }
.topic-case #mission .btn { min-height: 42px; padding: 8px 12px; border: 1px solid var(--control); border-radius: 6px; color: var(--ink); background: #fff; font: 550 13px/18px var(--font); }
.topic-case #mission .btn.primary { border-color: var(--primary); color: #fff; background: var(--primary); }
.topic-case #recap { min-width: 0; margin: 0; padding: 15px 18px; border: 1px solid var(--border); border-radius: 8px; color: var(--ink); background: var(--surface); }
.topic-case #recap .recap-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font: 500 11px/16px var(--font); letter-spacing: .04em; text-transform: uppercase; }
.topic-case #recap .recap-heading strong { color: #176a42; font: 600 12px/18px var(--font); letter-spacing: 0; text-transform: none; }
.topic-case #recap h3 { margin: 8px 0 4px; color: var(--ink); font: 600 16px/22px var(--font); }
.topic-case #recap p { color: var(--muted); font: 400 13px/1.5 var(--font); }
.topic-case #recap .saved-explanation { margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--rule); }
.topic-case #recap .saved-explanation summary { color: var(--ink); font: 500 12px/18px var(--font); }
.topic-case #recap .saved-explanation p { margin: 8px 0 0; }
.topic-case #recap .no-entry-note { padding: 9px 11px; border-inline-start: 2px solid var(--control); background: var(--raised); }
.topic-case #recap .table-wrap { width: 100%; max-width: 100%; overflow: auto; overscroll-behavior-inline: contain; border: 1px solid var(--border); border-radius: 6px; }
.topic-case #recap table.j { width: 100%; min-width: 460px; margin: 0; border-collapse: collapse; font: 400 12px/1.4 var(--font); font-variant-numeric: tabular-nums; }
.topic-case #recap table.j caption { padding: 8px 10px; color: var(--muted); font: 500 11px/16px var(--font); text-align: left; }
.topic-case #recap table.j th, .topic-case #recap table.j td { padding: 7px 9px; border-bottom: 1px solid var(--rule); color: var(--ink); background: #fff; font: 400 12px/17px var(--font); white-space: normal; }
.topic-case #recap table.j th { font-weight: 500; text-align: left; }
.topic-case #recap table.j .r { text-align: right; font-variant-numeric: tabular-nums; }
.topic-case #map { position: relative; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0; width: 100%; min-width: 0; max-width: none; padding: 0; overflow: visible; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.topic-case #map .workflow-phase { position: relative; z-index: 1; min-width: 0; padding: 15px 14px; border-bottom: 1px solid var(--border); background: transparent; }
.topic-case #map .workflow-phase:nth-of-type(odd) { border-right: 1px solid var(--border); }
.topic-case #map .workflow-phase:nth-of-type(1) { border-inline-start: 3px solid #1d5fbf; }
.topic-case #map .workflow-phase:nth-of-type(2) { border-inline-start: 3px solid #785626; }
.topic-case #map .workflow-phase:nth-of-type(3) { border-inline-start: 3px solid #54717f; }
.topic-case #map .workflow-phase:nth-of-type(4) { border-inline-start: 3px solid #586575; }
.topic-case #map .workflow-phase header { display: block; margin: 0 0 9px; padding: 0; border: 0; background: transparent; }
.topic-case #map .workflow-phase h3 { margin: 0; color: var(--ink); font: 600 13px/19px var(--font); letter-spacing: 0; text-transform: none; }
.topic-case #map .workflow-phase p { margin: 2px 0 0; color: var(--muted); font: 400 11px/16px var(--font); }
.topic-case #map .workflow-phase .nodes { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 4px; min-width: 0; }
.topic-case #map .workflow-phase .nd { display: grid; grid-template-columns: 30px minmax(0,1fr); grid-template-rows: auto auto; align-items: center; column-gap: 8px; width: 100%; min-width: 0; min-height: 58px; padding: 8px 66px 8px 6px; border: 1px solid transparent; border-radius: 6px; color: var(--ink); background: transparent; font: 400 12px/16px var(--font); text-align: left; overflow-wrap: anywhere; }
.topic-case #map .workflow-phase .nd:hover { transform: none; border-color: var(--border); background: var(--raised); }
.topic-case #map .workflow-phase .nd .ic { grid-column: 1; grid-row: 1 / span 2; display: grid; place-items: center; width: 26px; height: 26px; margin: 0; border: 1px solid var(--control); border-radius: 50%; color: var(--muted); background: #fff; font: 600 11px/1 var(--font); }
.topic-case #map .workflow-phase .nd .l { grid-column: 2; color: var(--ink); font: 550 12px/16px var(--font); }
.topic-case #map .workflow-phase .nd .w { grid-column: 2; margin: 1px 0 0; color: var(--muted); font: 400 10px/14px var(--font); }
.topic-case #map .workflow-phase .nd.done { border-color: #c9ddcf; background: #f5faf6; }
.topic-case #map .workflow-phase .nd.done .ic { border-color: #176a42; color: #176a42; background: #edf5ef; }
.topic-case #map .workflow-phase .nd.done::after { content: "✓ Done"; position: absolute; inset-block-start: 5px; inset-inline-end: 5px; min-width: 53px; padding: 2px 5px; border: 1px solid #c9ddcf; border-radius: 999px; color: #176a42; background: #f5faf6; font: 600 10px/14px var(--font); text-align: center; }
.topic-case #map .workflow-phase .nd.hint { z-index: 3; border-color: var(--accent); outline: 2px solid var(--accent); outline-offset: 2px; box-shadow: 0 0 0 0 rgb(29 95 191 / 30%); animation: case-target-pulse 1.25s ease-in-out infinite; }
.topic-case #map .workflow-phase .nd.hint .ic { border-color: var(--accent); color: var(--accent); }
.topic-case #map .workflow-phase .nd.hint::before { content: "NEXT"; position: absolute; inset-block-start: 4px; inset-inline-end: 7px; padding: 2px 5px; border-radius: 4px; color: var(--accent); background: #eaf1fb; font: 600 10px/14px var(--font); letter-spacing: .04em; }
.topic-case #map .edge { stroke: #aeb3bb; stroke-width: 1.5; stroke-dasharray: 4 5; opacity: .75; }
.topic-case #map .edge.on { stroke: #176a42; stroke-width: 2.5; stroke-dasharray: none; opacity: 1; }
.topic-case #map #tok { z-index: 4; width: 34px; height: 34px; border: 1px solid var(--accent); border-radius: 50%; color: var(--accent); background: #fff; font: 600 11px/32px var(--font); text-align: center; }
.topic-case #tl { gap: 5px; padding: 10px 0 2px; }
.topic-case #tl i { height: 7px; border: 0; border-radius: 2px; background: #d8dbe0; }
.topic-case #tl i.d { background: #176a42; }
.topic-case #tl i.c { background: var(--accent); outline: 2px solid var(--accent); outline-offset: 2px; }
.topic-case #intro { max-width: none; padding: 18px 0 28px; font: 400 13px/1.5 var(--font); }
.topic-case #intro > .g3:first-of-type { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
.topic-case #intro > .g3:first-of-type .card { padding: 8px 12px; border: 0; border-inline-start: 2px solid var(--border); border-radius: 0; background: transparent; font: 400 12px/1.5 var(--font); }
.topic-case #intro > .g3:first-of-type .card-mark { display: none; }
.topic-case #intro > .g3:first-of-type .card h3 { margin: 0 0 3px; font: 550 12px/18px var(--font); }
.topic-case #intro .primer { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.topic-case #intro .primer > summary { padding: 10px 0; color: var(--ink); font: 500 12px/18px var(--font); }
.topic-case #intro .primer-body { padding: 0 0 12px; }
.topic-case #intro > .card { padding: 12px 0; border: 0; border-block: 1px solid var(--border); border-radius: 0; background: transparent; font: 400 12px/1.5 var(--font); }
.topic-case #intro > .card h3 { font: 550 13px/19px var(--font); }
.topic-case #intro .scenario-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.topic-case #intro .scenario-grid .card { min-width: 0; padding: 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); font: 400 12px/1.5 var(--font); }
.topic-case #intro .scenario-grid .card h3 { font: 600 14px/20px var(--font); }
.topic-case #intro .scenario-grid .card table.j { font: 400 12px/1.4 var(--font); }
.topic-case #intro .scenario-grid .card table.j td, .topic-case #intro .scenario-grid .card table.j th { padding: 6px 8px; }
.topic-case #intro #scenario-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 8px 0; padding: 10px 12px; border: 1px solid var(--border); border-radius: 6px; color: var(--ink); background: var(--surface); font: 400 12px/18px var(--font); }
.topic-case #intro #scenario-controls legend { padding: 0 5px; color: var(--muted); font: 500 11px/16px var(--font); }
.topic-case #intro #scenario-controls label { display: inline-flex; align-items: center; gap: 6px; }
.topic-case #intro #scenario-controls input { accent-color: var(--accent); }
@keyframes case-target-pulse { 0%,100% { box-shadow: 0 0 0 0 rgb(29 95 191 / 22%); } 50% { box-shadow: 0 0 0 5px rgb(29 95 191 / 8%); } }
@media (max-width: 760px) {
  .topic-case #map { grid-template-columns: minmax(0,1fr); }
  .topic-case #map .workflow-phase:nth-of-type(odd) { border-right: 0; }
  .topic-case #intro > .g3:first-of-type { grid-template-columns: minmax(0,1fr); gap: 4px; }
  .topic-case #intro .scenario-grid { grid-template-columns: minmax(0,1fr); }
  .topic-case #map .workflow-phase .nodes { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 420px) {
  .topic-case #map .workflow-phase .nodes { grid-template-columns: minmax(0,1fr); }
  .topic-case #mission, .topic-case #recap { padding: 12px; }
  .topic-case #map .workflow-phase { padding: 12px 9px; }
}
@media (prefers-reduced-motion: reduce) {
  .topic-case #map .workflow-phase .nd.hint { animation: none !important; outline: 2px solid var(--accent); outline-offset: 2px; }
}

/* Workflow board: distinct stakeholder areas with software-like, connected activity tiles. */
.topic-case #map { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; padding: 12px; border: 0; border-radius: 0; background: transparent; }
.topic-case #map > #svg,
.topic-case #map > #tok { display: none !important; }
.topic-case #map .workflow-phase { --lane-color: var(--accent); min-width: 0; padding: 14px; border: 1px solid var(--border); border-top: 3px solid var(--lane-color); background: var(--surface); transition: border-color .18s ease, box-shadow .18s ease; }
.topic-case #map .workflow-phase:nth-of-type(2) { --lane-color: #785626; }
.topic-case #map .workflow-phase:nth-of-type(3) { --lane-color: #54717f; }
.topic-case #map .workflow-phase:nth-of-type(4) { --lane-color: #586575; }
.topic-case #map .workflow-phase.is-active-lane { border-color: color-mix(in srgb, var(--lane-color) 62%, white); border-top-color: var(--lane-color); box-shadow: 0 0 0 2px color-mix(in srgb, var(--lane-color) 25%, transparent), 0 0 16px color-mix(in srgb, var(--lane-color) 16%, transparent); animation: lane-border-glow 1.7s ease-in-out infinite; }
.topic-case #map .workflow-phase header { margin: 0 0 12px; padding: 0 0 9px; border-bottom: 1px solid var(--border-soft); }
.topic-case #map .workflow-phase h3 { color: var(--lane-color); font-size: 12px; font-weight: 650; letter-spacing: .055em; text-transform: uppercase; }
.topic-case #map .workflow-phase p { margin-top: 3px; font-size: 11px; }
.topic-case #map .workflow-phase .nodes { display: flex; align-items: stretch; gap: 6px; min-width: 0; }
.topic-case #map .workflow-phase .nd { position: relative; display: flex; flex: 1 1 0; flex-direction: column; align-items: center; justify-content: flex-start; gap: 5px; width: auto; min-width: 0; min-height: 106px; padding: 10px 5px 8px; border: 1px solid var(--border); border-radius: 2px; color: var(--ink); background: var(--surface-bright); text-align: center; transition: border-color .16s ease, background-color .16s ease; }
.topic-case #map .workflow-phase .nd:hover { border-color: var(--lane-color); background: #fff; }
.topic-case #map .workflow-phase .nd:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.topic-case #map .workflow-phase .nd .ic { display: grid; flex: 0 0 auto; place-items: center; width: 32px; height: 32px; margin: 0; border: 1px solid color-mix(in srgb, var(--lane-color) 38%, white); border-radius: 2px; color: var(--lane-color); background: color-mix(in srgb, var(--lane-color) 8%, white); font-size: 12px; }
.topic-case #map .workflow-phase .nd .l { display: block; color: var(--ink); font-size: 11px; line-height: 14px; }
.topic-case #map .workflow-phase .nd .w { display: block; margin: 0; color: var(--muted); font-size: 10px; line-height: 13px; }
.topic-case #map .workflow-phase .workflow-arrow { display: grid; flex: 0 0 14px; place-items: center; align-self: center; color: #8b9399; font: 500 16px/1 var(--font); }
.topic-case #map .workflow-phase .node-state { min-height: 13px; margin-top: auto; color: var(--accent); font: 650 9px/13px var(--font); letter-spacing: .035em; text-transform: uppercase; }
.topic-case #map .workflow-phase .nd.done { border-color: #b8d2bf; background: #f5faf6; }
.topic-case #map .workflow-phase .nd.done .ic { border-color: #176a42; color: #176a42; background: #edf5ef; }
.topic-case #map .workflow-phase .nd.done .node-state { color: #176a42; }
.topic-case #map .workflow-phase .nd.hint { z-index: 3; border: 2px solid var(--accent); outline: 3px solid rgb(22 69 120 / 28%); outline-offset: 2px; background: #edf4ff; box-shadow: 0 0 0 4px rgb(22 69 120 / 22%), 0 0 24px rgb(22 69 120 / 56%); animation: guided-stage-glow 1.15s ease-in-out infinite; }
.topic-case #map .workflow-phase .nd.hint .ic { border-color: var(--accent); color: var(--accent); background: #dceaff; }
.topic-case #map .workflow-phase .nd.hint .node-state { color: var(--accent); }
.topic-case #map .workflow-phase .nd[aria-disabled="true"] { cursor: not-allowed; background: #f1f0ec; }
.topic-case #map .workflow-phase .nd[aria-disabled="true"]:hover { border-color: var(--border); background: #f1f0ec; }
.topic-case #map .workflow-phase .nd[aria-disabled="true"] .l,
.topic-case #map .workflow-phase .nd[aria-disabled="true"] .ic { color: #68727b; }
.topic-case #map .workflow-phase .nd[aria-disabled="true"] .node-state { color: #75551d; }
.topic-case #map .workflow-phase .nd.done::after,
.topic-case #map .workflow-phase .nd.hint::before { content: none; }
.topic-case #mission { padding: 14px 16px; border: 1px solid var(--border); border-inline-start: 3px solid var(--accent); border-radius: 0; background: var(--surface); }
.topic-case #mission:empty { display: none; }
@keyframes guided-stage-glow { 0%,100% { box-shadow: 0 0 0 2px rgb(22 69 120 / 23%), 0 0 12px rgb(22 69 120 / 32%); } 50% { box-shadow: 0 0 0 5px rgb(22 69 120 / 38%), 0 0 28px rgb(22 69 120 / 66%); } }
@keyframes lane-border-glow { 0%,100% { box-shadow: 0 0 0 1px color-mix(in srgb, var(--lane-color) 18%, transparent), 0 0 8px color-mix(in srgb, var(--lane-color) 10%, transparent); } 50% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--lane-color) 25%, transparent), 0 0 16px color-mix(in srgb, var(--lane-color) 18%, transparent); } }
@media (max-width: 760px) {
  .topic-case #map { grid-template-columns: minmax(0,1fr); gap: 10px; padding: 8px 0; }
  .topic-case #map .workflow-phase { padding: 12px; }
  .topic-case #map .workflow-phase .nodes { display: flex; flex-direction: column; gap: 5px; }
  .topic-case #map .workflow-phase .nd { display: grid; grid-template-columns: 34px minmax(0,1fr) auto; grid-template-rows: auto auto; align-items: center; justify-items: start; column-gap: 9px; min-height: 60px; padding: 8px 10px; text-align: left; }
  .topic-case #map .workflow-phase .nd .ic { grid-column: 1; grid-row: 1 / span 2; }
  .topic-case #map .workflow-phase .nd .l { grid-column: 2; grid-row: 1; }
  .topic-case #map .workflow-phase .nd .w { grid-column: 2; grid-row: 2; }
  .topic-case #map .workflow-phase .nd .node-state { grid-column: 3; grid-row: 1 / span 2; align-self: center; margin: 0; }
  .topic-case #map .workflow-phase .workflow-arrow { flex-basis: 12px; height: 12px; transform: rotate(90deg); font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .topic-case #map .workflow-phase.is-active-lane,
  .topic-case #map .workflow-phase .nd.hint { animation: none !important; }
  .topic-case #map .workflow-phase.is-active-lane { outline: 2px solid var(--lane-color); outline-offset: 2px; }
  .topic-case #map .workflow-phase .nd.hint { outline: 2px solid var(--accent); outline-offset: 2px; }
}

/* Use EkkySoft type, color, shape and control tokens throughout the simulator. */
#topic-shell { color: var(--ink); font-family: var(--font); }
#topic-shell :where(body,button,input,select,textarea,p,li,small,label,summary,td,th,caption,span,div) { font-family: var(--font) !important; }
#topic-shell :where(h1,h2,h3,h4) { font-family: var(--heading-font) !important; color: var(--ink); }
#topic-shell :where(button,input,select,textarea) { border-radius: var(--radius-control); font-size: 14px; line-height: 1.4; }
#topic-shell .material-symbols-outlined { font-family: "Material Symbols Outlined" !important; }
#topic-title { font-family: var(--heading-font) !important; font-size: 24px !important; line-height: 1.2 !important; }
#hub-landing h1 { font-family: var(--heading-font) !important; }
.topic-case #intro,
.topic-case #sim,
.topic-case #case-host,
.topic-case #case-host :where(p,li,small,label,summary,td,th,caption,span,div,button,input,select,textarea) { color: var(--ink); font-family: var(--font) !important; font-size: 14px; line-height: 1.5; }
.topic-case #intro :where(h1,h2,h3,h4),
.topic-case #sim :where(h2,h3,h4),
.topic-case #mission h4,
.topic-case #recap h3 { color: var(--ink); font-family: var(--heading-font) !important; }
.topic-case #intro h2 { font-size: 24px; line-height: 1.2; }
.topic-case #intro h3,
.topic-case #sim .box h2 { font-size: 16px; line-height: 1.35; }
.topic-case #intro > .g3:first-of-type .card { border: 1px solid var(--border); border-inline-start: 1px solid var(--border); border-radius: 2px; color: var(--ink); background: var(--surface); }
.topic-case #intro > div.g3:first-of-type .card:nth-child(n) { border: 1px solid var(--border) !important; border-top: 1px solid var(--border) !important; border-inline-start: 2px solid var(--border) !important; border-radius: 2px !important; color: var(--ink) !important; background: var(--surface) !important; font-size: 13px !important; }
.topic-case #intro > .g3:first-of-type .card h3 { color: var(--ink); font-family: var(--heading-font) !important; font-size: 15px; line-height: 1.35; }
.topic-case #intro .scenario-grid .card { border: 1px solid var(--border); border-radius: 2px; color: var(--ink); background: var(--surface); }
.topic-case #intro .scenario-grid .card { font-size: 13px !important; }
.topic-case #intro .primer { border: 1px solid var(--border); border-radius: 2px; background: var(--surface); }
.topic-case #intro .primer > summary { padding: 11px 12px; border: 0; border-radius: 2px; color: var(--ink); background: transparent; font: 600 13px/1.4 var(--font); }
.topic-case #intro .primer-body { padding: 0 12px 12px; border-top: 1px solid var(--border); color: var(--ink); background: var(--surface); }
.topic-case #intro #scenario-controls { border-radius: 2px; color: var(--ink); background: var(--surface); }
.topic-case #intro .say { border-inline-start: 2px solid var(--accent); border-radius: 2px; color: var(--ink); background: var(--raised); }
.topic-case #intro .scenario-grid .card h3 { color: var(--ink); font-family: var(--heading-font) !important; font-size: 16px; }
.topic-case #intro .scenario-grid .card table.j,
.topic-case #recap table.j,
.topic-case #sim .led { font-family: var(--font) !important; font-variant-numeric: tabular-nums; }
.topic-case #sim .box,
.topic-case #intro,
.topic-case #recap,
.topic-case #mission { border-radius: 2px; }
.topic-case #sim .report-launch { border-color: var(--border); border-radius: 2px; color: var(--ink); background: var(--surface); font-family: var(--font) !important; }
.topic-case #sim .report-launch h2 { color: var(--ink); font-family: var(--heading-font) !important; font-size: 16px; }
.topic-case #sim .report-launch .btn,
.topic-case #mission .btn { border-radius: 2px; font-family: var(--font) !important; font-size: 14px; }
.topic-case #mission .btn.primary { color: #fff; background: var(--primary); }
body.topic-case #dlg,
body.topic-case #dlg :where(p,li,label,button,input,select,textarea,td,th,caption,summary,span,div) { color: var(--ink); font-family: var(--font) !important; font-size: 14px; line-height: 1.5; }
body.topic-case #dlg :where(h3,h4) { color: var(--ink); font-family: var(--heading-font) !important; }
body.topic-case #dlg h3 { font-size: 21px; line-height: 1.25; }
body.topic-case #dlg h4 { font-size: 16px; line-height: 1.35; }
body.topic-case #dlg { border: 1px solid var(--border); border-radius: 2px; color: var(--ink); background: var(--surface-bright); }
body.topic-case #dlg :where(button,input,select,textarea) { min-height: 44px; border-radius: 2px; font-family: var(--font) !important; font-size: 14px; }
body.topic-case #dlg .btn { border: 1px solid var(--control); color: var(--ink); background: var(--surface); }
body.topic-case #dlg .b { border: 1px solid var(--primary); color: #fff; background: var(--primary); }
body.topic-case #dlg table.j { font-family: var(--font) !important; font-variant-numeric: tabular-nums; }
body.topic-case #dlg .accounting-lens { border-radius: 2px; background: var(--raised); }
body.topic-case #dlg :where(input,select,textarea) { border: 1px solid var(--control); color: var(--ink); background: #fff; }

/* Give the working area room and make transactions read as real software actions. */
#topic-shell > main { width: calc(100% - 96px); max-width: 1600px; }
.topic-case #map .workflow-phase .nd { gap: 4px; min-height: 114px; padding: 16px 7px 10px; border: 1px solid transparent; background: transparent; }
.topic-case #map .workflow-phase .nd:hover { border-color: var(--border); background: var(--surface-bright); }
.topic-case #map .workflow-phase .nd .activity-index { position: absolute; inset-block-start: 5px; inset-inline-start: 7px; color: var(--muted); font: 500 10px/13px var(--font); font-variant-numeric: tabular-nums; }
.topic-case #map .workflow-phase .activity-icon { display: grid; flex: 0 0 auto; place-items: center; width: 32px; height: 32px; margin: 0 0 2px; color: var(--accent); }
.topic-case #map .workflow-phase .activity-icon svg { display: block; width: 29px; height: 29px; }
.topic-case #map .workflow-phase .nd.done .activity-icon { color: var(--positive); }
.topic-case #map .workflow-phase .nd .l { font-size: 12px; line-height: 15px; }
.topic-case #map .workflow-phase .nd .w { font-size: 11px; line-height: 14px; }
.topic-case #map .workflow-phase .nd.hint { border: 2px solid var(--accent); background: var(--surface-bright); }
.topic-case #map .workflow-phase .workflow-arrow { flex-basis: 18px; color: var(--muted); font-size: 17px; }
.topic-case #map .workflow-phase .node-state { font-size: 10px; }
.topic-case #intro .primer { margin-block: 16px; }
.topic-case #intro .primer > summary { min-height: 44px; }

/* A resized iframe changes its own small viewport units; don't let that create a height feedback loop. */
html.embedded-simulator #topic-shell { grid-template-rows: auto !important; min-height: 0 !important; }
html.embedded-simulator #topic-top { height: auto; max-height: none; }

@media (max-width: 1100px) {
  #topic-shell > main { width: calc(100% - 56px); }
}
@media (max-width: 760px) {
  #topic-shell > main { width: calc(100% - 40px); padding-inline: 0; }
  .topic-case #map .workflow-phase .nd { min-height: 64px; padding: 8px 11px; }
  .topic-case #map .workflow-phase .nd .activity-index { inset-block-start: 4px; inset-inline-end: 7px; inset-inline-start: auto; }
  .topic-case #map .workflow-phase .activity-icon { grid-column: 1; grid-row: 1 / span 2; width: 30px; height: 30px; margin: 0; }
  .topic-case #map .workflow-phase .activity-icon svg { width: 27px; height: 27px; }
  .topic-case #map .workflow-phase .nd .l { font-size: 13px; line-height: 17px; }
  .topic-case #map .workflow-phase .nd .w { font-size: 12px; line-height: 16px; }
}

/* Case-study surfaces: tonal grouping, crisp corners and soft working elevation. */
.topic-case #intro > .g3:first-of-type .card,
.topic-case #intro > div.g3:first-of-type .card:nth-child(n),
.topic-case #intro .scenario-grid .card,
.topic-case #intro > .card,
.topic-case #mission,
.topic-case #recap,
.topic-case #sim .box,
.topic-case #sim .report-launch {
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: 0 3px 10px rgb(43 38 34 / 9%), 0 1px 2px rgb(43 38 34 / 6%);
}
.topic-case #intro > .g3:first-of-type .card { min-height: 126px; padding: 16px; }
.topic-case #intro > div.g3:first-of-type .card:nth-child(1) { background: #e7efe8 !important; }
.topic-case #intro > div.g3:first-of-type .card:nth-child(2) { background: #e7eef7 !important; }
.topic-case #intro > div.g3:first-of-type .card:nth-child(3) { background: #f3ebdb !important; }
.topic-case #intro > .g3:first-of-type .card h3 { margin-bottom: 7px; }
.topic-case #intro .scenario-grid .card { padding: 18px; background: #e8eff7; }
.topic-case #intro .scenario-grid .card:nth-child(even) { background: #f2ece1; }
.topic-case #intro .scenario-grid .card h3 { margin-bottom: 8px; }
.topic-case #intro > .card { padding: 16px; background: #e9e2df; }
.topic-case #intro .primer { border: 0; border-radius: 0; background: #f8f5f3; box-shadow: 0 3px 10px rgb(43 38 34 / 8%); }
.topic-case #intro .primer-body { border-top: 1px solid rgb(43 38 34 / 10%); }
.topic-case #intro .say,
.topic-case #dlg .say { border: 0; border-inline-start: 4px solid #164578; border-radius: 0; color: #24384d; background: #e7eef7; }
.topic-case #intro #scenario-controls { border: 0; border-radius: 0; background: #e9e2df; box-shadow: 0 2px 7px rgb(43 38 34 / 7%); }

/* Swimlanes stay distinct through their own quiet fills, not enclosing lines. */
.topic-case #map .workflow-phase,
.topic-case #map .workflow-phase.is-active-lane {
  border: 0 !important;
  border-top: 0 !important;
  border-radius: 0;
  box-shadow: 0 3px 11px rgb(43 38 34 / 9%);
}
.topic-case #map .workflow-phase:nth-of-type(1) { --lane-color: #245f9d; background: #e7eef7; }
.topic-case #map .workflow-phase:nth-of-type(2) { --lane-color: #785626; background: #f2ece1; }
.topic-case #map .workflow-phase:nth-of-type(3) { --lane-color: #276a50; background: #e7efe8; }
.topic-case #map .workflow-phase:nth-of-type(4) { --lane-color: #536679; background: #e9edf0; }
.topic-case #map .workflow-phase header { border: 0; }
.topic-case #map .workflow-phase .nd {
  border: 0;
  border-radius: 0;
  color: var(--ink);
  background: rgb(255 255 255 / 76%);
  box-shadow: 0 2px 5px rgb(43 38 34 / 8%);
}
.topic-case #map .workflow-phase .nd:hover:not(:disabled) {
  border: 0;
  background: #fff;
  box-shadow: 0 4px 10px rgb(43 38 34 / 14%);
}
.topic-case #map .workflow-phase .nd .activity-icon { color: var(--lane-color); }
.topic-case #map .workflow-phase .nd .activity-index { color: color-mix(in srgb, var(--lane-color) 78%, var(--ink)); }
.topic-case #map .workflow-phase .nd.done { border: 0; background: #e1efe4; box-shadow: 0 2px 6px rgb(15 125 69 / 14%); }
.topic-case #map .workflow-phase .nd.hint {
  z-index: 3;
  border: 2px solid var(--accent);
  outline: 3px solid rgb(22 69 120 / 30%);
  outline-offset: 2px;
  background: #edf4ff;
  box-shadow: 0 0 0 4px rgb(22 69 120 / 22%), 0 0 26px rgb(22 69 120 / 60%);
  animation: guided-stage-glow 1.1s ease-in-out infinite;
}
.topic-case #map .workflow-phase.is-active-lane { animation: lane-border-glow 1.7s ease-in-out infinite; }

/* Square, borderless controls: color carries hierarchy and shadow lifts them from the page. */
.topic-case :where(#intro, #mission, #sim, #dlg, #relationship-simulator) button,
.topic-case #map .workflow-phase .nd {
  border-radius: 0 !important;
  transition: background-color .16s ease, color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.topic-case :where(#intro, #mission, #sim, #dlg, #relationship-simulator) button:not(.nd) {
  min-height: 44px;
  border: 0 !important;
  padding: 10px 16px;
  color: #2b2622;
  background: #e9e2df;
  box-shadow: 0 2px 6px rgb(43 38 34 / 12%);
  font: 600 13px/1.35 var(--font);
}
.topic-case :where(#intro, #mission, #sim, #dlg, #relationship-simulator) button:not(.nd):hover:not(:disabled) {
  background: #ddd3ce;
  box-shadow: 0 4px 10px rgb(43 38 34 / 17%);
  transform: translateY(-1px);
}
.topic-case :where(#intro, #mission, #sim, #dlg, #relationship-simulator) button:focus-visible,
.topic-case #map .workflow-phase .nd:focus-visible { outline: 3px solid #164578; outline-offset: 3px; }
.topic-case :where(#intro, #mission, #sim, #dlg, #relationship-simulator) button:disabled { color: #605854; background: #e9e2df; box-shadow: none; opacity: .7; }
.topic-case :where(#intro, #mission, #sim, #dlg, #relationship-simulator) button.primary,
.topic-case :where(#intro, #mission, #sim, #dlg, #relationship-simulator) button.b,
.topic-case #intro .scenario-grid .card button,
.topic-case #mission .btn.primary,
.topic-case #sim .report-launch .btn.primary {
  color: #fff;
  background: #164578;
  box-shadow: 0 3px 8px rgb(22 69 120 / 24%);
}
.topic-case :where(#intro, #mission, #sim, #dlg, #relationship-simulator) button.primary:hover:not(:disabled),
.topic-case :where(#intro, #mission, #sim, #dlg, #relationship-simulator) button.b:hover:not(:disabled),
.topic-case #intro .scenario-grid .card button:hover:not(:disabled) {
  color: #fff;
  background: #0f355b;
  box-shadow: 0 5px 12px rgb(22 69 120 / 30%);
}
.topic-case #dlg {
  max-width: min(680px, calc(100vw - 32px));
  max-height: min(88dvh, 900px);
  overflow: auto;
  border: 0;
  border-radius: 0;
  padding: clamp(18px, 3vw, 30px);
  background: #f8f5f3;
  box-shadow: 0 18px 48px rgb(23 31 40 / 28%), 0 4px 12px rgb(23 31 40 / 14%);
}
.topic-case #dlg::backdrop { background: rgb(31 39 48 / 58%); }
.topic-case #dlg .n { color: #164578; font-size: 11px; font-weight: 700; letter-spacing: .08em; }
.topic-case #dlg h3 { margin-block: 7px 14px; }
.topic-case #dlg .say { margin-block: 12px 16px; padding: 12px 14px; }
.topic-case #dlg .form { overflow: hidden; border: 0; border-radius: 0; background: #fffaf8; box-shadow: 0 2px 8px rgb(43 38 34 / 8%); }
.topic-case #dlg .fh { padding: 11px 15px; border: 0; color: #164578; background: #e7eef7; font-weight: 650; }
.topic-case #dlg .record-fields { display: grid; gap: 0; padding: 5px 15px 10px; }
.topic-case #dlg .record-row { display: grid; grid-template-columns: minmax(150px, .8fr) minmax(0, 1fr); align-items: baseline; gap: 12px; padding: 10px 0; border: 0; border-bottom: 1px solid rgb(43 38 34 / 8%); }
.topic-case #dlg .record-row:last-child { border-bottom: 0; }
.topic-case #dlg .record-row dt { color: #605854; font-size: 13px; font-weight: 550; }
.topic-case #dlg .record-row .in { min-width: 0; padding: 0; border: 0; color: #2b2622; background: transparent; font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.topic-case #dlg .btns { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.topic-case #dlg .btns .b { order: 2; }
.topic-case #dlg .btns .btn { order: 1; }
.topic-case #dlg .accounting-lens { border: 0; border-radius: 0; padding: 14px 16px; background: #e7efe8; box-shadow: 0 2px 8px rgb(43 38 34 / 8%); }
.topic-case #dlg .table-wrap { border: 0; border-radius: 0; box-shadow: 0 2px 8px rgb(43 38 34 / 9%); }
@media (max-width: 520px) {
  .topic-case #dlg { width: calc(100vw - 24px); max-width: none; max-height: 90dvh; padding: 17px; }
  .topic-case #dlg .record-row { grid-template-columns: minmax(0, 1fr); gap: 3px; padding: 9px 0; }
  .topic-case #dlg .btns { justify-content: stretch; }
  .topic-case #dlg .btns button { flex: 1 1 auto; }
}
@media (prefers-reduced-motion: reduce) {
  .topic-case #map .workflow-phase.is-active-lane { animation: none !important; outline: 2px solid var(--lane-color); outline-offset: 2px; }
  .topic-case #map .workflow-phase .nd.hint { animation: none !important; }
  .topic-case :where(#intro, #mission, #sim, #dlg, #relationship-simulator) button { transition: none; }
}

/* Topic catalog: replace the narrow ledger list with a scannable practice grid. */
#hub-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  align-items: stretch;
  gap: 14px;
  border: 0;
}
#hub-cards > article {
  position: relative;
  display: flex !important;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  min-height: 220px;
  height: auto !important;
  padding: 16px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: #e7eef7 !important;
  box-shadow: 0 3px 10px rgb(43 38 34 / 9%), 0 1px 2px rgb(43 38 34 / 6%) !important;
  cursor: pointer;
  transition: background-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
#hub-cards > article:nth-child(3n + 2) { background: #e7efe8 !important; }
#hub-cards > article:nth-child(3n) { background: #f2ece1 !important; }
#hub-cards > article:hover { background: #fffaf8 !important; box-shadow: 0 6px 15px rgb(43 38 34 / 14%) !important; transform: translateY(-2px); }
#hub-cards > article > div:first-child { display: flex !important; flex-direction: column; align-items: stretch; gap: 8px; min-width: 0; }
#hub-cards > article header { display: flex; align-items: flex-start; justify-content: flex-end; min-height: 22px; margin: 0; }
#hub-cards > article header > div { display: none !important; }
#hub-cards .topic-status { position: static; min-height: 20px; width: fit-content; margin-inline-start: auto; padding: 2px 7px !important; border-radius: 0 !important; color: #164578 !important; background: #d7e4f4 !important; font: 600 11px/16px var(--font) !important; }
#hub-cards .topic-status[class*="bg-success-container"] { color: #145d38 !important; background: #d9ebdd !important; }
#hub-cards > article h3 { margin: 0; color: var(--ink) !important; font: 600 16px/22px var(--heading-font) !important; }
#hub-cards > article p { max-width: 50ch; margin: 0; color: #4f4945 !important; font: 400 13px/1.55 var(--font) !important; }
#hub-cards > article > div:first-child > div:last-child { display: flex; flex-wrap: wrap; gap: 9px 14px; padding-top: 2px; color: #605854 !important; font: 500 11px/16px var(--font) !important; }
#hub-cards > article > footer { position: static; display: flex; justify-content: flex-start; margin-top: 15px; padding: 0; border: 0; }
#hub-cards > article > footer button { min-height: 42px; padding: 9px 12px; border: 0; border-radius: 0; color: #fff; background: #164578; box-shadow: 0 3px 8px rgb(22 69 120 / 22%); font: 600 12px/17px var(--font); white-space: nowrap; }
#hub-cards > article > footer button:hover { color: #fff; background: #0f355b; box-shadow: 0 5px 12px rgb(22 69 120 / 30%); }
#hub-cards :where(article,button):focus-visible { outline: 3px solid #164578; outline-offset: 3px; }

/* Shared lesson windows use the same square, tonal surfaces and elevated actions. */
#topic-detail aside button,
#topic-detail aside #guide-next,
#topic-detail aside #trivia-options button {
  min-height: 44px;
  border: 0 !important;
  border-radius: 0 !important;
  padding: 10px 13px;
  color: #2b2622 !important;
  background: #e9e2df !important;
  box-shadow: 0 2px 6px rgb(43 38 34 / 12%);
  font: 600 13px/1.35 var(--font) !important;
  text-align: left;
  transition: background-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
#topic-detail aside button:hover:not(:disabled) { background: #ddd3ce !important; box-shadow: 0 4px 10px rgb(43 38 34 / 17%); transform: translateY(-1px); }
#topic-detail aside #guide-next { color: #fff !important; background: #164578 !important; box-shadow: 0 3px 8px rgb(22 69 120 / 24%); }
#topic-detail aside #guide-next:hover:not(:disabled) { background: #0f355b !important; }
#topic-detail aside #guide-prev:disabled { box-shadow: none; opacity: .65; }
#topic-detail aside #trivia-options { display: grid; gap: 8px; }
#topic-detail aside #trivia-options button { width: 100%; background: #e7eef7 !important; }
#topic-detail aside #trivia-options button:hover:not(:disabled) { background: #d8e5f3 !important; }
#topic-detail aside button:focus-visible,
#topic-app :where(button,input,select,textarea):focus-visible { outline: 3px solid #164578 !important; outline-offset: 3px !important; }
#topic-app #relationship-simulator {
  border: 0 !important;
  border-radius: 0 !important;
  padding: clamp(16px, 2vw, 24px) !important;
  background: #e7eef7 !important;
  box-shadow: 0 3px 11px rgb(43 38 34 / 10%);
}
#topic-app #relationship-simulator > div:first-child { align-items: flex-start; }
#topic-app #relationship-simulator > div:first-child > span { border-radius: 0 !important; color: #164578 !important; background: #d7e4f4 !important; }
#topic-app #relationship-simulator > div:nth-child(2) { align-items: stretch; }
#topic-app #relationship-simulator button {
  min-height: 44px;
  border: 0 !important;
  border-radius: 0 !important;
  padding: 10px 13px !important;
  color: #2b2622 !important;
  background: #fffaf8 !important;
  box-shadow: 0 2px 6px rgb(43 38 34 / 10%);
  font: 600 13px/1.35 var(--font) !important;
}
#topic-app #relationship-simulator button:hover { background: #fff !important; box-shadow: 0 4px 10px rgb(43 38 34 / 16%); }
#topic-app #relationship-result > div { min-width: 0; border-radius: 0 !important; box-shadow: 0 2px 7px rgb(43 38 34 / 8%); }
#topic-app #relationship-result > div:first-child { background: #f8f5f3 !important; }
#topic-app #relationship-result > div:last-child { background: #e7efe8 !important; }

/* Repair the legacy workspace after its retired side navigation is hidden. */
#topic-app #lab-app,
#topic-app #practice-lab,
#topic-app #practice-lab .lab-layout,
#topic-app #practice-lab .lab-workspace,
#topic-app #practice-lab .lab-stage { width: 100%; max-width: none; min-width: 0; margin: 0; }
#topic-app #lab-app,
#topic-app #practice-lab .lab-layout,
#topic-app #practice-lab .lab-workspace { display: block !important; }
#topic-app #lab-app { padding: 0; background: transparent; }
#topic-app #practice-lab .lab-stage {
  min-height: 0;
  padding: clamp(16px, 2vw, 24px);
  border: 0 !important;
  border-radius: 0 !important;
  background: #f8f5f3;
  box-shadow: 0 3px 11px rgb(43 38 34 / 10%);
  overflow: visible;
}
#topic-app #practice-lab .lab-stage .lab-card,
#topic-app #practice-lab .lab-stage .lab-stat,
#topic-app #practice-lab .lab-stage .lab-note,
#topic-app #practice-lab .lab-stage details {
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: 0 2px 7px rgb(43 38 34 / 8%);
}
#topic-app #practice-lab .lab-stage .lab-card { background: #e7eef7; }
#topic-app #practice-lab .lab-stage .lab-stat { background: #e9e2df; }
#topic-app #practice-lab .lab-stage .lab-note { background: #f2ece1; }
#topic-app #practice-lab .lab-stage .lab-note.lab-good { color: #145d38; background: #e7efe8; }
#topic-app #practice-lab .lab-stage .lab-table-wrap { border: 0; border-radius: 0; box-shadow: 0 2px 7px rgb(43 38 34 / 8%); }
#topic-app #practice-lab .lab-stage table { background: #fffaf8; }
#topic-app #practice-lab .lab-stage thead { background: #e9e2df; }
#topic-app #practice-lab .lab-stage :where(button,.lab-btn) {
  min-height: 44px;
  border: 0 !important;
  border-radius: 0 !important;
  padding: 10px 13px;
  color: #2b2622;
  background: #e9e2df;
  box-shadow: 0 2px 6px rgb(43 38 34 / 12%);
  font: 600 13px/1.35 var(--font);
}
#topic-app #practice-lab .lab-stage :where(button,.lab-btn):hover:not(:disabled) { background: #ddd3ce; box-shadow: 0 4px 10px rgb(43 38 34 / 17%); transform: translateY(-1px); }
#topic-app #practice-lab .lab-stage .lab-btn.primary,
#topic-app #practice-lab .lab-stage .lab-btn.green { color: #fff; background: #164578; box-shadow: 0 3px 8px rgb(22 69 120 / 24%); }
#topic-app #practice-lab .lab-stage .lab-btn.green { background: #0f7d45; box-shadow: 0 3px 8px rgb(15 125 69 / 22%); }
#topic-app #practice-lab .lab-stage .lab-field :where(input,select,textarea) { max-width: 100%; min-width: 0; border-radius: 0; }
@media (max-width: 760px) {
  #hub-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
  #hub-cards > article { min-height: 205px; padding: 13px !important; }
}
@media (max-width: 560px) {
  #hub-cards { grid-template-columns: minmax(0, 1fr); }
  #hub-cards > article { min-height: 0; }
}
@media (prefers-reduced-motion: reduce) {
  #hub-cards > article,
  #hub-cards > article > footer button,
  #topic-detail aside button,
  #topic-app #relationship-simulator button,
  #topic-app #practice-lab .lab-stage button { transition: none; }
}
#hub-case-start,
#hub-start,
#hub-back,
#hub-reset {
  min-height: 44px !important;
  border: 0 !important;
  border-radius: 0 !important;
  padding: 10px 14px !important;
  color: #2b2622 !important;
  background: #e9e2df !important;
  box-shadow: 0 2px 6px rgb(43 38 34 / 12%);
  font: 600 13px/1.35 var(--font) !important;
  transition: background-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
#hub-case-start { color: #fff !important; background: #164578 !important; box-shadow: 0 3px 8px rgb(22 69 120 / 24%); }
#hub-case-start:hover:not(:disabled) { color: #fff !important; background: #0f355b !important; box-shadow: 0 5px 12px rgb(22 69 120 / 30%); }
#hub-start:hover:not(:disabled), #hub-back:hover:not(:disabled), #hub-reset:hover:not(:disabled) { background: #ddd3ce !important; box-shadow: 0 4px 10px rgb(43 38 34 / 17%); transform: translateY(-1px); }
#nav-all-topics,
#topic-menu button { border-radius: 0 !important; box-shadow: none; }
#nav-all-topics[aria-current="page"],
#topic-menu button[aria-current="page"] { background: #ddd3ce !important; }
@media (prefers-reduced-motion: reduce) {
  #hub-case-start,#hub-start,#hub-back,#hub-reset { transition: none; }
}

/* Inset the work canvases and bring every case briefing panel onto the same square surface system. */
.topic-case #intro {
  margin-block: 18px 22px;
  padding: clamp(20px, 2.8vw, 32px) !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: #f8f5f3;
  box-shadow: 0 3px 11px rgb(43 38 34 / 9%);
}
.topic-case #intro .card {
  min-width: 0;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: 0 3px 10px rgb(43 38 34 / 9%), 0 1px 2px rgb(43 38 34 / 6%);
}
.topic-case #case-start-cards {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-block: 16px;
}
.topic-case #case-start-cards .card { min-height: 158px; padding: 18px !important; }
.topic-case #case-start-cards .card:nth-child(1) { background: #e7efe8 !important; }
.topic-case #case-start-cards .card:nth-child(2) { background: #e7eef7 !important; }
.topic-case #case-start-cards .card:nth-child(3) { background: #f2ece1 !important; }
.topic-case #case-start-cards .card h3 { margin-bottom: 8px; }
.topic-case #sim {
  margin-block: 18px 24px;
  padding: 14px;
  border: 0;
  border-radius: 0;
  background: #e9e2df;
}
.topic-case #sim > main { gap: 16px; padding: 0; }
.topic-case #map { margin: 0; padding: 12px; }
#topic-app #relationship-simulator { margin-block: 16px 22px; }
#topic-app #practice-lab .lab-stage { margin-block: 16px 22px; }
@media (max-width: 980px) {
  .topic-case #case-start-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topic-case #case-start-cards .card:last-child { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .topic-case #intro { margin-block: 14px 18px; padding: 18px !important; }
  .topic-case #case-start-cards { grid-template-columns: minmax(0, 1fr); gap: 10px; margin-block: 12px; }
  .topic-case #case-start-cards .card { min-height: 0; grid-column: auto; padding: 15px !important; }
  .topic-case #sim { margin-block: 14px 20px; padding: 10px; }
  .topic-case #map { padding: 8px; }
  #topic-app #practice-lab .lab-stage { margin-block: 12px 18px; padding: 18px; }
}
@media (max-width: 920px) {
  #topic-top > nav { border-top: 1px solid var(--border-soft) !important; }
  .hub-topic-nav { align-items: stretch; gap: 8px; padding: 10px 14px 14px; }
  .hub-topic-nav::-webkit-scrollbar { display: none; width: 0; height: 0; }
  .hub-topic-nav::-webkit-scrollbar-track,
  .hub-topic-nav::-webkit-scrollbar-thumb,
  .hub-topic-nav::-webkit-scrollbar-button { display: none; width: 0; height: 0; background: transparent; }
  #nav-all-topics, #topic-menu button {
    min-height: 42px;
    padding: 8px 11px !important;
    font-size: 12px !important;
  }
}
@media (max-width: 520px) {
  .hub-topic-nav { gap: 8px; padding-inline: 10px; }
  #nav-all-topics, #topic-menu button { min-height: 40px; padding-inline: 10px !important; }
  #topic-menu .material-symbols-outlined { font-size: 16px; }
}
#mobile-topics-toggle { display: none; }
@media (max-width: 920px) {
  #mobile-topics-toggle {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 94px;
    min-height: 44px;
    padding: 8px 12px;
    border: 0;
    border-radius: 0;
    color: var(--ink);
    background: #e9e2df;
    box-shadow: 0 2px 6px rgb(43 38 34 / 12%);
    font: 600 13px/1.3 var(--font);
    cursor: pointer;
  }
  #mobile-topics-toggle:hover { background: #ddd3ce; box-shadow: 0 4px 10px rgb(43 38 34 / 17%); }
  #mobile-topics-toggle:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
  #mobile-topics-toggle .menu-mark { display: block; width: 20px; height: 20px; overflow: visible; }
  #mobile-topics-toggle .menu-line { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: square; transition: opacity .16s ease, transform .16s ease; transform-origin: center; }
  #mobile-topics-toggle[aria-expanded="true"] .menu-line-top { transform: translateY(6px) rotate(45deg); }
  #mobile-topics-toggle[aria-expanded="true"] .menu-line-middle { opacity: 0; }
  #mobile-topics-toggle[aria-expanded="true"] .menu-line-bottom { transform: translateY(-6px) rotate(-45deg); }
  #topic-top > nav { display: none; width: 100%; max-height: min(68dvh, 560px); overflow: auto; overscroll-behavior: contain; border-top: 1px solid var(--border-soft) !important; background: #f8f5f3 !important; box-shadow: 0 9px 18px rgb(43 38 34 / 12%); }
  #topic-shell.mobile-topics-open #topic-top > nav { display: block !important; }
  #topic-top .hub-topic-nav {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    gap: 8px;
    width: 100%;
    max-width: none;
    min-width: 0;
    padding: 12px 14px 16px;
    overflow: visible;
  }
  #topic-top #nav-all-topics { grid-column: 1 / -1; width: 100%; }
  #topic-top #topic-menu {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    width: 100%;
    min-width: 0;
  }
  #topic-top #nav-all-topics,
  #topic-top #topic-menu button {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    width: 100%;
    min-width: 0;
    min-height: 48px;
    padding: 8px 10px !important;
    border: 0 !important;
    border-radius: 0 !important;
    color: var(--ink) !important;
    background: #e9e2df !important;
    box-shadow: 0 2px 6px rgb(43 38 34 / 9%);
    font: 550 12px/1.35 var(--font) !important;
    text-align: left;
    white-space: normal !important;
    overflow-wrap: anywhere;
  }
  #topic-top #nav-all-topics[aria-current="page"],
  #topic-top #topic-menu button[aria-current="page"] { color: #164578 !important; background: #e2ebf6 !important; box-shadow: 0 2px 7px rgb(22 69 120 / 16%); }
  #topic-top #topic-menu .material-symbols-outlined { flex: 0 0 18px; width: 18px; color: #605854; font-size: 17px; }
  #topic-top #topic-menu button > span:last-child { min-width: 0; }
  #topic-top .hub-top-line > div:last-child > span { display: none; }
}
@media (max-width: 520px) {
  #topic-top .hub-top-line > div:last-child { display: flex; align-items: center; justify-content: space-between; width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  #mobile-topics-toggle .menu-line { transition: none; }
}

/* Keep every native simulator dialog legible, including report and lesson dialogs. */
dialog#dlg {
  color-scheme: light;
  color: #242a31;
  background: #fffaf6;
  opacity: 1;
  text-shadow: none;
}
dialog#dlg::backdrop { background: rgb(24 32 42 / 66%); }
dialog#dlg .n {
  margin: 0 0 7px;
  color: #164578;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: .08em;
  line-height: 1.4;
}
dialog#dlg h3 {
  margin: 0 0 12px;
  color: #17243c;
  font: 650 clamp(23px, 3vw, 30px)/1.2 var(--heading-font);
  letter-spacing: -.015em;
}
dialog#dlg h4 { color: #17243c; font-weight: 700; }
dialog#dlg > p,
dialog#dlg .say,
dialog#dlg .accounting-lens p,
dialog#dlg .report-caveat {
  color: #343b44;
  font-size: 16px;
  line-height: 1.6;
}
dialog#dlg .report-picker { gap: 10px; margin-block: 16px 18px; }
dialog#dlg .report-option {
  min-height: 58px;
  padding: 13px 16px;
  border: 0;
  border-radius: 0;
  color: #242a31;
  background: #e9e2df;
  box-shadow: 0 2px 6px rgb(43 38 34 / 12%);
  font: 650 15px/1.35 var(--font);
  text-align: left;
}
dialog#dlg .report-option:hover { background: #ded5d0; box-shadow: 0 4px 10px rgb(43 38 34 / 16%); }
dialog#dlg .report-option[aria-pressed="true"] {
  color: #123c68;
  background: #dce8f5;
  box-shadow: inset 4px 0 #164578, 0 3px 8px rgb(22 69 120 / 16%);
}
dialog#dlg #report-output {
  padding: clamp(15px, 2.2vw, 22px);
  border: 0;
  border-radius: 0;
  color: #242a31;
  background: #f2f6fa;
  box-shadow: 0 3px 10px rgb(43 38 34 / 10%);
}
dialog#dlg #report-output h4 { margin: 0 0 8px; color: #17243c; font-size: 21px; line-height: 1.3; }
dialog#dlg #report-output p { color: #343b44; font-size: 15px; line-height: 1.55; }
dialog#dlg #report-output table.j { color: #242a31; }
dialog#dlg #report-output table.j caption { color: #17243c; font-size: 15px; }
dialog#dlg #report-output table.j th,
dialog#dlg #report-output table.j td { color: #242a31; }
@media (max-width: 520px) {
  dialog#dlg h3 { font-size: 24px; }
  dialog#dlg > p,
  dialog#dlg .say,
  dialog#dlg .accounting-lens p,
  dialog#dlg .report-caveat { font-size: 15px; }
  dialog#dlg .report-option { min-height: 52px; padding: 11px 12px; font-size: 14px; }
}

/* Native modal top-layer sizing and contrast take priority over embedded legacy rules. */
body dialog#dlg:modal {
  box-sizing: border-box !important;
  width: min(840px, calc(100vw - 32px)) !important;
  max-width: calc(100vw - 32px) !important;
  max-height: min(90dvh, 900px) !important;
  margin: auto !important;
  overflow: auto !important;
  isolation: isolate;
  overscroll-behavior: contain;
  color: #242a31 !important;
  background-color: #fffaf6 !important;
  opacity: 1 !important;
  text-shadow: none !important;
}
body dialog#dlg::backdrop { overflow: hidden; overscroll-behavior: contain; }
body.topic-case dialog#dlg:modal { background-color: #fffaf6 !important; }
body dialog#dlg:modal .n { color: #164578 !important; font-size: 12px !important; line-height: 1.4 !important; }
body dialog#dlg:modal h3 { margin: 0 0 12px; color: #17243c !important; font-size: clamp(24px, 3vw, 30px) !important; line-height: 1.2 !important; }
body dialog#dlg:modal > p { color: #343b44 !important; font-size: 16px !important; line-height: 1.6 !important; }
body dialog#dlg:modal .quiz-debrief {
  margin: 18px 0 22px;
  padding: 16px;
  color: #202b37;
  background: #edf4f2;
  box-shadow: 0 3px 10px rgb(23 36 60 / 10%);
}
body dialog#dlg:modal .quiz-debrief h4 { margin: 0 0 12px; color: #14583f; font-size: 18px; line-height: 1.3; }
body dialog#dlg:modal .quiz-debrief .recap-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; color: #14583f; font-size: 13px; font-weight: 700; }
body dialog#dlg:modal .quiz-debrief h3 { margin: 0 0 8px; color: #17243c; font-size: 18px !important; }
body dialog#dlg:modal .quiz-debrief p { color: #343b44; font-size: 15px; line-height: 1.55; }
body dialog#dlg:modal .quiz-debrief .table-wrap { max-width: 100%; overflow-x: auto; }
body dialog#dlg:modal .quiz-debrief table.j { width: 100%; min-width: 360px; table-layout: fixed; }
body dialog#dlg:modal .quiz-debrief table.j th,
body dialog#dlg:modal .quiz-debrief table.j td { overflow-wrap: anywhere; }
body dialog#dlg:modal .quiz-debrief .saved-explanation { margin-top: 14px; color: #343b44; font-size: 14px; line-height: 1.5; }
body dialog#dlg:modal .quiz-debrief .no-entry-note { padding: 12px; background: #fffaf6; box-shadow: 0 2px 7px rgb(23 36 60 / 8%); }
body dialog#dlg:modal #report-output { background-color: #f2f6fa !important; }
body dialog#dlg:modal #report-output h4 { color: #17243c !important; }
body dialog#dlg:modal #report-output p { color: #343b44 !important; }
@media (max-width: 520px) {
  body dialog#dlg:modal { width: calc(100vw - 24px) !important; max-width: calc(100vw - 24px) !important; max-height: calc(100dvh - 24px) !important; padding: 17px !important; }
  body dialog#dlg:modal > p { font-size: 15px !important; }
  body dialog#dlg:modal h3 { font-size: 24px !important; }
}
body dialog#dlg:modal #report-output table.j {
  width: 100% !important;
  min-width: 0 !important;
  table-layout: fixed;
}
body dialog#dlg:modal #report-output table.j th,
body dialog#dlg:modal #report-output table.j td {
  white-space: normal !important;
  overflow-wrap: anywhere;
}
body dialog#dlg:modal #report-output table.j th:last-child,
body dialog#dlg:modal #report-output table.j td:last-child { width: 28%; }

/* The quick check is the learner's immediate next action after a saved case step. */
.topic-case #mission .pending-check-pulse {
  position: relative;
  outline: 2px solid #164578;
  outline-offset: 3px;
  box-shadow: 0 0 0 0 rgb(22 69 120 / 30%), 0 4px 12px rgb(22 69 120 / 24%);
  animation: pending-check-glow 1.4s ease-in-out infinite;
}
@keyframes pending-check-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgb(22 69 120 / 28%), 0 4px 12px rgb(22 69 120 / 22%); }
  50% { box-shadow: 0 0 0 6px rgb(22 69 120 / 8%), 0 5px 14px rgb(22 69 120 / 28%); }
}
@media (prefers-reduced-motion: reduce) {
  .topic-case #mission .pending-check-pulse { animation: none !important; outline: 2px solid #164578; outline-offset: 3px; }
}

/* Four scenario cards remain legible as a balanced two-by-two practice deck. */
.topic-case #intro .scenario-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 760px) {
  .topic-case #intro .scenario-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 920px) {
  .topic-case #topic-detail > .grid { grid-template-columns: minmax(0,1fr) !important; }
  .topic-case #topic-detail > .grid > aside { display: grid !important; grid-template-columns: minmax(0,1fr) !important; grid-row: 1; }
  .topic-case #topic-detail > .grid > section { grid-row: 2; }
}

/* Master records use a compact desktop form grid with readable, square software surfaces. */
#practice-lab .master-record-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
#practice-lab .master-record {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 12px 16px;
  min-width: 0;
  padding: 20px;
  border: 0;
  border-inline-start: 4px solid #287765;
  border-radius: 0;
  background: #f5f7f5;
  box-shadow: 0 5px 16px rgb(35 54 48 / 12%);
}
#practice-lab .master-record:nth-child(2) { border-inline-start-color: #ad7140; background: #f8f5f1; }
#practice-lab .master-record:nth-child(3) { border-inline-start-color: #496b98; background: #f2f5f9; }
#practice-lab .master-record:nth-child(4) { border-inline-start-color: #9b7b26; background: #faf7ed; }
#practice-lab .master-record > h4,
#practice-lab .master-record > p,
#practice-lab .master-record > button,
#practice-lab .master-record > .inventory-fields { grid-column: 1 / -1; }
#practice-lab .master-record > .item-guide,
#practice-lab .master-record > .item-next-step { grid-column: 1 / -1; margin: 0; }
#practice-lab .item-guide ol,
#practice-lab .item-next-step ol { margin: 6px 0 0; padding-left: 20px; font-size: 14px; line-height: 1.45; }
#topic-app #practice-lab .lab-stage .item-guide ol,
#topic-app #practice-lab .lab-stage .item-next-step ol,
#practice-lab .lab-stage .item-guide ol,
#practice-lab .lab-stage .item-next-step ol { list-style: decimal; }
#practice-lab .item-guide li,
#practice-lab .item-next-step li { display: list-item; list-style: inherit; }
#practice-lab .item-guide li + li,
#practice-lab .item-next-step li + li { margin-top: 6px; }
#practice-lab .item-guide li b,
#practice-lab .item-next-step li b,
#practice-lab .item-next-step p b { font-size: inherit; font-weight: 700; }
#practice-lab .item-next-step > b { display: block; font-size: 15px; }
#practice-lab .item-next-step p { margin: 6px 0 0; font-size: 14px; }
#practice-lab .item-next-step .lab-btn { margin-top: 12px; }
#practice-lab .master-record .lab-field { min-width: 0; }
#practice-lab .master-record .lab-field.full { grid-column: 1 / -1; }
#practice-lab .master-record label,
#practice-lab .master-record legend { color: #273b4c; font-size: 14px; font-weight: 750; }
#practice-lab .master-record input,
#practice-lab .master-record select,
#practice-lab .master-record textarea { min-width: 0; font-size: 15px; }
#practice-lab .master-record textarea { resize: vertical; }
#practice-lab .master-record .lab-btn { justify-self: start; border: 0; border-radius: 0; box-shadow: 0 3px 8px rgb(23 36 60 / 16%); }
#practice-lab .master-record .inventory-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; margin: 4px 0; padding: 14px; border: 0; border-top: 1px solid #c9d2d0; background: #edf2ef; }
#practice-lab .master-record .inventory-fields[hidden] { display: none; }
#practice-lab .master-record .inventory-fields legend { padding: 0 6px; }
#master-record-details { margin-top: 26px; }
#master-record-details h3 { margin: 24px 0 12px; }
@media (max-width: 760px) {
  #practice-lab .master-record-grid,
  #practice-lab .master-record { grid-template-columns: minmax(0, 1fr); }
  #practice-lab .master-record { padding: 16px; }
  #practice-lab .master-record > h4,
  #practice-lab .master-record > p,
  #practice-lab .master-record > button,
  #practice-lab .master-record > .inventory-fields,
  #practice-lab .master-record > .item-guide,
  #practice-lab .master-record > .item-next-step,
  #practice-lab .master-record .lab-field.full { grid-column: 1; }
  #practice-lab .master-record .inventory-fields { grid-template-columns: minmax(0, 1fr); }
}


/* Relationships lesson: real item setup, bill, sale and cross-topic navigation. */
.practice-session-note{margin:12px 0 20px;padding:10px 14px;background:#edf4f7;color:#40546c;border-left:4px solid #2c6d8b;font:500 13px/1.5 "Inter",Arial,sans-serif}
.linked-relationship-banner{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:8px 18px;margin:12px 0 20px;padding:16px 18px;background:#e9f3f0;box-shadow:0 6px 18px rgba(24,55,74,.12);border-left:6px solid #1d8063;color:#183d38}
.linked-relationship-banner[hidden]{display:none}
.linked-relationship-banner .relationship-label,.relationship-label{display:block;color:#245d79;font:800 11px/1.35 "Inter",Arial,sans-serif;letter-spacing:.1em;text-transform:uppercase}
.linked-relationship-banner p{grid-column:1/-1;margin:0;color:#354d5c;font:500 14px/1.55 "Inter",Arial,sans-serif}
.linked-relationship-banner .relationship-task{padding:11px 13px;background:#fff9e9;box-shadow:0 3px 10px rgba(91,71,33,.08);color:#594a2a;font-weight:700}
.relationship-practice{min-width:0;overflow:hidden;background:#fff;box-shadow:0 12px 30px rgba(24,46,71,.12);border-top:5px solid #255f93}
.relationship-practice-head{display:flex;justify-content:space-between;align-items:flex-start;gap:18px;padding:24px 26px 18px;background:linear-gradient(100deg,#eef4fa 0%,#fff 62%,#f9f1e3 100%)}
.relationship-kicker{margin:0 0 8px;color:#24628f;font:800 11px/1.3 "Inter",Arial,sans-serif;letter-spacing:.12em}
.relationship-practice-head h2{margin:0;color:#172b43;font:700 clamp(21px,2.2vw,28px)/1.15 "Sora",Arial,sans-serif;letter-spacing:-.025em}
.relationship-practice-head p:not(.relationship-kicker){max-width:720px;margin:9px 0 0;color:#43556a;font:500 14px/1.6 "Inter",Arial,sans-serif}
.relationship-flow-count{flex:none;padding:8px 10px;background:#dceaf4;color:#204e71;font:800 12px/1.2 "Inter",Arial,sans-serif}
.relationship-steps{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin:0;padding:0 26px 20px;list-style:none}
.relationship-steps li{display:grid;grid-template-columns:34px minmax(0,1fr);gap:3px 10px;align-content:start;min-width:0;padding:13px 14px;background:#f0f3f5;color:#4b5e70;box-shadow:0 4px 12px rgba(23,43,67,.08);transition:background-color .18s ease,box-shadow .18s ease}
.relationship-steps li>span{grid-row:span 2;display:grid;place-items:center;width:30px;height:30px;background:#dce5ed;color:#234867;font:800 12px "Inter",Arial,sans-serif}
.relationship-steps li>b{font:700 14px/1.35 "Sora",Arial,sans-serif;color:#263a51}
.relationship-steps li>small{font:500 12px/1.45 "Inter",Arial,sans-serif;color:#5a6c7e}
.relationship-steps li[data-state="active"]{background:#e3f0f8;box-shadow:inset 0 -4px #2b75a5,0 7px 17px rgba(35,92,138,.16)}
.relationship-steps li[data-state="active"]>span{background:#245f93;color:white}
.relationship-steps li[data-state="complete"]{background:#e5f2ed;box-shadow:inset 0 -4px #268061,0 5px 13px rgba(32,111,82,.11)}
.relationship-steps li[data-state="complete"]>span{background:#267b61;color:white}
.relationship-practice-body{display:grid;grid-template-columns:minmax(0,1.05fr) minmax(260px,.95fr);gap:12px;padding:0 26px 22px}
.relationship-explainer,.relationship-ledger-preview{min-width:0;padding:18px 20px;background:#f3f6f8;box-shadow:0 5px 16px rgba(25,45,68,.09)}
.relationship-explainer{background:#edf4f8}
.relationship-explainer h3{margin:7px 0;color:#193b59;font:700 18px/1.3 "Sora",Arial,sans-serif}
.relationship-explainer>p{margin:7px 0 12px;color:#344c61;font:500 14px/1.55 "Inter",Arial,sans-serif}
.relationship-sample{display:grid;gap:3px;margin:12px 0;padding:11px 13px;background:#fff0d5;box-shadow:0 3px 9px rgba(103,77,30,.09);color:#674a1e;font:500 13px/1.5 "Inter",Arial,sans-serif}
.relationship-sample b{font-weight:800}
.relationship-flow-feedback{color:#9c3e28!important;font-weight:700!important}
.relationship-primary-action,.relationship-secondary-action,.relationship-topic-actions button{display:inline-flex;justify-content:center;align-items:center;gap:8px;min-height:44px;padding:11px 15px;border:0;border-radius:0;background:#245f93;color:#fff;box-shadow:0 5px 0 #174267,0 9px 16px rgba(26,71,109,.18);font:700 13px/1.35 "Inter",Arial,sans-serif;text-align:left;cursor:pointer}
.relationship-primary-action:hover,.relationship-topic-actions button:hover{background:#174d7c;transform:translateY(-1px)}
.relationship-primary-action:focus-visible,.relationship-secondary-action:focus-visible,.relationship-topic-actions button:focus-visible,.relationship-dialog-options button:focus-visible{outline:3px solid #f1b845;outline-offset:3px}
.relationship-secondary-action{background:#dfe9f0;color:#24455f;box-shadow:0 4px 0 #bdcad5,0 7px 12px rgba(25,45,68,.12)}
.relationship-link-row{display:grid;grid-template-columns:minmax(95px,.7fr) minmax(0,1.3fr);gap:10px;padding:11px 0;border-bottom:1px solid #d4dee5;color:#506275;font:500 13px/1.45 "Inter",Arial,sans-serif}
.relationship-link-row>b{color:#223f5b;font-weight:700}
.relationship-ledger-preview>p{margin:12px 0 0;color:#53657a;font:500 13px/1.5 "Inter",Arial,sans-serif}
.relationship-next-topics{margin:0 26px 24px;padding:16px 18px;background:#e5f2ed;box-shadow:0 6px 16px rgba(20,76,58,.11)}
.relationship-next-topics[hidden]{display:none}
.relationship-next-topics p{margin:7px 0 12px;color:#35574b;font:500 14px/1.5 "Inter",Arial,sans-serif}
.relationship-topic-actions{display:flex;flex-wrap:wrap;gap:10px}
.relationship-topic-actions button{background:#247456;box-shadow:0 5px 0 #175b42,0 8px 14px rgba(23,91,66,.16)}
.relationship-practice-dialog{width:min(620px,calc(100vw - 28px));max-height:min(86dvh,820px);overflow:auto;padding:0;border:0;border-top:6px solid #245f93;border-radius:0;background:#fff;box-shadow:0 26px 75px rgba(12,30,51,.32);color:#1b2c40}
.relationship-practice-dialog::backdrop{background:rgba(14,28,45,.64);backdrop-filter:blur(2px)}
.relationship-dialog-inner{padding:24px 26px 26px}
.relationship-dialog-inner h2{margin:0 0 9px;color:#173d60;font:700 23px/1.2 "Sora",Arial,sans-serif}
.relationship-dialog-question{margin:0 0 14px;color:#324a60;font:600 15px/1.55 "Inter",Arial,sans-serif}
.relationship-dialog-options{display:grid;gap:8px}
.relationship-dialog-options button{min-height:48px;padding:12px 14px;border:0;border-left:4px solid #7191a8;background:#edf3f6;color:#253c52;box-shadow:0 3px 10px rgba(24,47,70,.09);font:600 14px/1.45 "Inter",Arial,sans-serif;text-align:left;cursor:pointer}
.relationship-dialog-options button:hover{background:#e2edf3;border-left-color:#245f93}
.relationship-dialog-options button:disabled{cursor:default}
.relationship-dialog-options button[data-result="correct"]{background:#e3f2e9;border-left-color:#21805b}
.relationship-dialog-options button[data-result="incorrect"]{background:#faeae4;border-left-color:#b45438}
.relationship-dialog-feedback{margin:12px 0;color:#476074;font:700 13px/1.5 "Inter",Arial,sans-serif}
.relationship-dialog-effect{margin:14px 0 17px;padding:14px 16px;background:#f0f6f4;box-shadow:0 5px 14px rgba(25,74,57,.12);color:#2d4d40;font:500 13px/1.55 "Inter",Arial,sans-serif}
.relationship-dialog-effect[hidden]{display:none}
.relationship-dialog-effect p{margin:6px 0}
.relationship-dialog-effect ul{margin:6px 0;padding-left:20px}
.relationship-journal-wrap{max-width:100%;overflow:auto;margin:9px 0}
.relationship-journal-wrap table{width:100%;border-collapse:collapse;font:500 12px/1.4 "Inter",Arial,sans-serif}
.relationship-journal-wrap th,.relationship-journal-wrap td{padding:7px 9px;border-bottom:1px solid #cdd9e0;text-align:left}
.relationship-journal-wrap td{text-align:right;font-variant-numeric:tabular-nums}
.relationship-field-focus{position:relative;z-index:1;animation:relationship-field-pulse 1.6s ease-in-out infinite;background:#e9f4fa;box-shadow:0 0 0 3px #3983ad,0 0 18px rgba(40,121,170,.34)}
.topic-milestone-dialog{position:fixed;inset:0;margin:auto;height:fit-content;overflow:auto;width:min(600px,calc(100vw - 28px));max-height:min(86dvh,780px);padding:0;border:0;border-top:6px solid #247456;border-radius:0;background:#fff;color:#1b2c40;box-shadow:0 26px 75px rgba(12,30,51,.32)}
.topic-milestone-dialog::backdrop{background:rgba(14,28,45,.64);backdrop-filter:blur(2px)}
.topic-milestone-inner{padding:24px 26px 26px}
.topic-milestone-kicker{margin:0 0 8px;color:#247456;font:800 11px/1.3 "Inter",Arial,sans-serif;letter-spacing:.12em}
.topic-milestone-inner h2{margin:0;color:#173d60;font:700 24px/1.2 "Sora",Arial,sans-serif}
.topic-milestone-inner>p:not(.topic-milestone-kicker){color:#42566c;font:500 14px/1.55 "Inter",Arial,sans-serif}
.topic-milestone-prompt{font-weight:800!important;color:#243d55!important}
.topic-milestone-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:18px}
.topic-milestone-actions button{width:100%;min-height:48px;text-align:center}
@keyframes relationship-field-pulse{0%,100%{box-shadow:0 0 0 2px #3983ad,0 0 11px rgba(40,121,170,.22)}50%{box-shadow:0 0 0 4px #3983ad,0 0 20px rgba(40,121,170,.4)}}
@media(max-width:760px){.relationship-practice-head{padding:20px 18px 14px}.relationship-steps{grid-template-columns:1fr;padding:0 18px 16px}.relationship-steps li{grid-template-columns:34px minmax(0,1fr)}.relationship-practice-body{grid-template-columns:minmax(0,1fr);padding:0 18px 18px}.relationship-next-topics{margin:0 18px 18px}.linked-relationship-banner{grid-template-columns:minmax(0,1fr);padding:14px}.relationship-dialog-inner{padding:20px 18px}.relationship-flow-count{white-space:nowrap}}
@media(max-width:520px){.topic-milestone-inner{padding:20px 18px}.topic-milestone-actions{grid-template-columns:minmax(0,1fr)}}
@media(prefers-reduced-motion:reduce){.relationship-field-focus{animation:none}.relationship-steps li,.relationship-primary-action{transition:none}}
/* Portable practice file (Claude Code, 2026-11-22) */
.session-file-dialog{width:min(640px,calc(100vw - 28px))}
.session-file-section{margin-top:18px;padding-top:16px;border-top:1px solid #d5dee8}
.session-file-section h3{margin:0 0 6px;color:#173d60;font:700 17px/1.3 "Sora",Arial,sans-serif}
.session-file-hint,.session-file-label{display:block;margin:6px 0;color:#42566c;font:500 13px/1.5 "Inter",Arial,sans-serif}
.session-file-label{font-weight:700;color:#243d55}
.session-file-section input[type=file]{display:block;width:100%;max-width:100%;padding:10px;border:1px dashed #7f93a8;background:#f6f9fc;font:500 14px/1.4 "Inter",Arial,sans-serif}
.session-file-section input[type=file]:focus-visible{outline:3px solid #247456;outline-offset:2px}
.session-file-status{min-height:1.4em;margin:8px 0 0;color:#1d5c44;font:600 13px/1.45 "Inter",Arial,sans-serif}
.session-file-error{min-height:1.4em;margin:8px 0 0;color:#a3341a;font:700 13px/1.45 "Inter",Arial,sans-serif}
.session-file-error:empty,.session-file-status:empty{min-height:0}
.session-file-preview{margin-top:12px;padding:14px 16px;border-left:4px solid #247456;background:#f1f8f4}
.session-file-preview h4{margin:0 0 8px;color:#173d60;font:700 15px/1.35 "Inter",Arial,sans-serif}
.session-file-preview dl{display:grid;grid-template-columns:minmax(0,max-content) minmax(0,1fr);gap:4px 14px;margin:0;font:500 13px/1.45 "Inter",Arial,sans-serif}
.session-file-preview dt{color:#42566c}.session-file-preview dd{margin:0;color:#1b2c40;font-weight:700;overflow-wrap:anywhere}
.session-file-warning{margin:10px 0 0;color:#8a3b12;font:700 13px/1.45 "Inter",Arial,sans-serif}
.session-file-dialog .topic-milestone-actions button[hidden]{display:none}
.session-file-section input[type=file]{min-height:52px;cursor:pointer}
.session-file-section input[type=file]::file-selector-button{min-height:40px;margin-right:12px;padding:8px 14px;border:0;border-radius:0;background:#dfe9f0;color:#24455f;font:700 13px/1.3 "Inter",Arial,sans-serif;cursor:pointer}
.session-file-section input[type=file]:hover::file-selector-button{background:#cfdde8}
/* The action bar stays pinned to the bottom of the dialog while its content scrolls. */
.session-file-dialog{overscroll-behavior:contain}
#session-file-title:focus{outline:none}
.session-file-dialog .session-file-actions{position:sticky;bottom:0;z-index:1;margin:18px -26px -26px;padding:12px 26px 14px;background:#fff;box-shadow:0 -1px 0 #d5dee8,0 -10px 18px rgba(255,255,255,.9)}
@media(max-width:520px){
.session-file-dialog{width:calc(100vw - 16px)}
.session-file-dialog .topic-milestone-inner{padding:18px 16px 16px}
.session-file-dialog .topic-milestone-inner h2{font-size:20px}
.session-file-dialog .session-file-intro{margin:8px 0 0;font-size:13px!important}
.session-file-section{margin-top:14px;padding-top:12px}
.session-file-section h3{font-size:16px}
.session-file-hint,.session-file-label{font-size:12.5px}
#session-file-export{width:100%;min-height:48px;justify-content:center;text-align:center}
.session-file-section input[type=file]{padding:6px;font-size:13px}
.session-file-section input[type=file]::file-selector-button{display:block;width:100%;margin:0 0 6px;min-height:44px}
.session-file-dialog .session-file-actions{margin:14px -16px -16px;padding:10px 16px calc(10px + env(safe-area-inset-bottom))}
.session-file-preview{padding:12px}
.session-file-preview dl{grid-template-columns:minmax(0,1fr)}
.session-file-preview dd{margin-bottom:6px}
}

/* Bank reconciliation checklist (DEF-026) */
.bank-rec-lines{display:grid;gap:6px;border:1px solid var(--line,#d5dbe3);border-radius:8px;padding:10px 12px}
.bank-rec-lines legend{font-weight:600;padding:0 4px}
.bank-rec-line{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:10px;min-height:32px;font-size:14px}
.bank-rec-line input{width:18px;height:18px}
.bank-rec-line b{font-variant-numeric:tabular-nums}

/* Classified statements (DEF-040) */
#topic-app #practice-lab #report-output tr.report-section th{text-align:left;font-weight:700;font-size:13px;letter-spacing:.04em;text-transform:uppercase;color:#4a5b6e;padding-top:16px}
#topic-app #practice-lab #report-output tr.report-subtotal th,#topic-app #practice-lab #report-output tr.report-subtotal td{font-weight:700;color:#17243c;border-top:1.5px solid #8494a7}
#topic-app #practice-lab #report-output tr.report-subtotal th{text-align:left}

/* Tanzania tax setup & compliance workspace */
.tax-progress { margin: 10px 0 4px; color: #1e3d5a; }
.tax-step { margin: 18px 0; padding: 16px; border: 1px solid #d8e0ea; border-radius: 12px; background: #fff; scroll-margin-top: 90px; }
.tax-step h4 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 8px; }
.tax-step ul { margin: 6px 0 0; padding-left: 20px; }
.tax-pill { padding: 3px 8px; border-radius: 999px; background: #eef1f5; color: #43536a; font-size: 12px; font-weight: 600; white-space: nowrap; }
.tax-pill-done { background: #e4f4ec; color: #126043; }
#practice-lab .lab-field label.tax-check, #topic-app #practice-lab .lab-stage .lab-field label.tax-check { display: flex; flex-direction: row; align-items: center; gap: 10px; font-weight: 600; }
#practice-lab .lab-field label.tax-check input, #topic-app #practice-lab .lab-stage .lab-field label.tax-check input[type=checkbox] { width: 22px; height: 22px; min-height: 0; margin: 0; padding: 0; flex: none; accent-color: #164578; }
.tax-feedback { min-height: 1.4em; margin: 8px 0 0; font-weight: 600; }
.tax-feedback.good { color: #145d38; }
.tax-feedback.bad { color: #8a2a12; }
.tax-effect { margin-top: 12px; }
.tax-link-list { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 10px; padding: 0 !important; }
.tax-link-list li { display: flex; flex-direction: column; justify-content: space-between; gap: 8px; padding: 12px; border: 1px solid #e1e7ef; border-radius: 10px; background: #f8fafc; }
.tax-link-list p { margin: 0; font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
.tax-link-list .lab-btn { align-self: flex-start; }
.case-tax-angle { padding: 10px 12px; border-left: 4px solid #3782c4; border-radius: 8px; background: #eef6ff; color: #1e3d5a; }
.case-tax-link { margin-left: 4px; padding: 0; border: 0; background: none; color: #164578; font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; }
.topic-completion-secondary { color: #164578; background: #fff; border: 1px solid #164578; box-shadow: none; }
.topic-completion-secondary:hover { color: #fff; }
.tax-goal { margin: 0 0 8px; line-height: 1.5; }
#topic-app #practice-lab .lab-stage .tax-goal, #topic-app #practice-lab .lab-stage .tax-goal b { color: #26364a; }
.tax-how { margin: 12px 0; padding: 12px 16px; border: 1px solid #e1e7ef; border-radius: 10px; background: #fafbfd; }
#topic-app #practice-lab .lab-stage .tax-how .tax-how-h { margin: 0 0 6px; font-weight: 700; color: #1e3d5a; }
#topic-app #practice-lab .lab-stage .tax-how ol { margin: 0; padding-left: 24px; list-style: decimal; }
#topic-app #practice-lab .lab-stage .tax-how li { display: list-item; color: #26364a; line-height: 1.5; }
#topic-app #practice-lab .lab-stage .tax-how li::marker { color: #164578; font-weight: 700; }
.tax-how li + li { margin-top: 5px; }
#topic-app #practice-lab .lab-stage .tax-how ol + p { margin: 8px 0 0; }
.tax-step .lab-guide p { margin: 8px 0 0; }
.tax-step .lab-guide .lab-table-wrap { margin-top: 8px; }
.tax-nowrap { white-space: nowrap; }
.tax-worked { margin-top: 10px; }
#topic-app #practice-lab .lab-stage .tax-worked summary { display: inline-flex; align-items: center; min-height: 40px; cursor: pointer; font-weight: 600; color: #164578; }
.tax-worked summary:focus-visible { outline: 2px solid #164578; outline-offset: 2px; border-radius: 4px; }
#topic-app #practice-lab .lab-stage .tax-worked-list { display: grid; gap: 6px; margin: 4px 0 8px; padding: 0; list-style: none; }
#topic-app #practice-lab .lab-stage .tax-worked-list li { display: grid; grid-template-columns: minmax(9em, 1fr) minmax(0, 2.4fr) auto; gap: 4px 14px; align-items: baseline; padding: 9px 12px; border: 1px solid #e1e7ef; border-radius: 8px; background: #f8fafc; color: #26364a; }
.tax-worked-box { font-weight: 700; color: #1e3d5a; }
.tax-worked-answer { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; color: #145d38; }
@media (max-width: 640px) { #topic-app #practice-lab .lab-stage .tax-worked-list li { grid-template-columns: 1fr; } .tax-worked-answer { text-align: left; } }
