:root {
  --purple: #62429b;
  --purple-dark: #493176;
  --pale: #f5f2fa;
  --line: #d7d7dd;
  --muted: #555;
  --danger: #a5252b;
  font-family: Arial, Helvetica, sans-serif;
  color: #222;
  background: #fff;
  line-height: 1.5;
}
* { box-sizing: border-box; }
body { margin: 0; font-size: 16px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; color: inherit; }
button:disabled { cursor: default; opacity: .55; }
a { color: var(--purple-dark); text-underline-offset: 3px; }
button:focus-visible, a:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 3px solid var(--purple); outline-offset: 3px; }
.skip { position: absolute; left: 16px; top: -80px; background: white; padding: 12px; z-index: 9; }
.skip:focus { top: 12px; }
.top, .shell { max-width: 1000px; margin: auto; padding-left: 24px; padding-right: 24px; }
.top { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-top: 20px; padding-bottom: 14px; border-bottom: 2px solid var(--purple); }
.brand { font-size: 24px; font-weight: bold; color: var(--purple-dark); text-decoration: none; }
.top p { margin: 0; font-size: 14px; color: var(--muted); }
.shell { padding-top: 20px; }
.intro { margin-bottom: 20px; }
h1 { font-size: 25px; line-height: 1.3; margin: 0 0 10px; }
.intro p { max-width: 760px; margin: 0; }
.worlds { display: flex; flex-wrap: wrap; gap: 8px; padding-bottom: 20px; margin-bottom: 20px; border-bottom: 1px solid var(--line); }
.worlds button { flex: 1 1 150px; padding: 10px 8px; border: 1px solid #aaa; border-radius: 4px; background: #fafafa; font-size: 15px; }
.worlds button:hover { background: var(--pale); }
.worlds button[aria-current] { background: var(--purple); border-color: var(--purple); color: white; }
.module-head { margin-bottom: 18px; }
.module-head h2 { margin: 0 0 6px; font-size: 23px; }
.module-head p { margin: 0; max-width: 760px; }
.tag { display: block; margin-top: 8px; color: var(--muted); font-size: 14px; }
.layout { display: grid; grid-template-columns: 1.15fr 1fr; gap: 18px; align-items: start; }
.panel { min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: 4px; background: #fff; }
.result { background: #faf9fc; }
.panel h3 { margin: 0 0 14px; font-size: 18px; }
.panel p { margin-top: 0; }
.section-kicker { margin: 0 0 10px; color: var(--muted); font-size: 14px; }
.income { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; }
.income label { font-size: 15px; font-weight: bold; }
.income small { display: block; font-size: 14px; font-weight: normal; color: var(--muted); }
.amount-wrap { display: flex; align-items: center; gap: 5px; padding: 7px 8px; border: 1px solid #aaa; border-radius: 3px; background: white; }
.amount-wrap input { width: 112px; max-width: 100%; border: 0; padding: 0; background: transparent; color: #222; }
.amount-wrap input:focus { outline: none; }
.amount-wrap:focus-within { outline: 3px solid var(--purple); outline-offset: 2px; }
.field-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; font-size: 15px; }
.field-dot { display: none; }
.field-row .amount-wrap input { width: 104px; }
.divider { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 18px !important; }
.tiny { font-size: 14px; color: var(--muted); }
.balance-label { font-size: 16px; margin-bottom: 6px; }
.balance { font-size: 32px; font-weight: bold; line-height: 1.25; margin: 0 0 16px; overflow-wrap: anywhere; }
.negative { color: var(--danger); }
.positive { color: var(--purple-dark); }
.budget-bar, .legend { display: none; }
.callout { margin: 18px 0; padding: 12px; border: 1px solid #c9c1d8; border-radius: 3px; background: var(--pale); font-size: 15px; }
.callout strong { display: block; margin-bottom: 5px; }
.callout.warning { background: #fff9ea; border-color: #cbb579; }
.callout.error { background: #fff2f2; border-color: #d5a0a0; }
.mini-summary { display: flex; justify-content: space-between; gap: 16px; margin: 10px 0; font-size: 15px; }
.mini-summary strong { text-align: right; }
.primary, .secondary { padding: 9px 12px; border: 1px solid #aaa; border-radius: 4px; font-size: 15px; line-height: 1.4; background: #fff; }
.primary { background: var(--purple); border-color: var(--purple); color: white; }
.primary:hover { background: var(--purple-dark); }
.secondary:hover { background: var(--pale); }
.full { width: 100%; }
.action-row { display: flex; flex-wrap: wrap; gap: 8px; }
.exercise { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 16px; }
.exercise p { font-size: 15px; }
.source { font-size: 14px; margin-top: 18px !important; color: var(--muted); }
.choices { display: grid; gap: 10px; }
.choice { padding: 12px; border: 1px solid #bbb; border-radius: 3px; background: white; text-align: left; font-size: 15px; line-height: 1.5; }
.choice strong { display: block; margin-bottom: 3px; }
.choice:hover, .choice.selected { border-color: var(--purple); background: var(--pale); }
.feedback { margin-top: 16px; padding: 12px; border-left: 3px solid var(--purple); background: var(--pale); font-size: 15px; }
.feedback h4 { margin: 0 0 7px; font-size: 16px; }
.contract { margin: 16px 0; padding: 12px; border: 1px solid var(--line); background: #fafafa; }
.contract .mini-summary { border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.contract .mini-summary span { max-width: 50%; }
.list { padding-left: 22px; font-size: 15px; }
.list li { margin-bottom: 10px; }
.step-pill { color: var(--muted); margin-bottom: 10px; font-size: 14px; }
.subnav { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.subnav button[aria-pressed=true] { border-color: var(--purple); background: var(--pale); }
.checks { display: grid; gap: 12px; }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 15px; }
.check input { width: 18px; height: 18px; flex-shrink: 0; margin-top: 3px; accent-color: var(--purple); }
.stats { margin: 18px 0; }
.stat { display: flex; justify-content: space-between; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.stat strong { overflow-wrap: anywhere; text-align: right; }
.table-scroll { overflow-x: auto; max-width: 100%; margin: 18px 0; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 10px 6px; border-bottom: 1px solid var(--line); }
th { font-weight: bold; }
table select { width: 58px; padding: 6px; border: 1px solid #aaa; border-radius: 3px; background: white; }
table caption { text-align: left; margin-bottom: 12px; color: var(--muted); }
.score-row { margin: 14px 0; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.score-bar { display: none; }
.two-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stack-field { display: grid; gap: 6px; font-size: 15px; }
.stack-field select, .stack-field input { min-width: 0; width: 100%; padding: 8px; border: 1px solid #aaa; border-radius: 3px; background: white; }
.notice { margin-top: 18px; font-size: 14px; color: var(--muted); }
details { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 14px; font-size: 15px; }
summary { cursor: pointer; font-weight: bold; }
details p { margin-top: 12px !important; }
footer { border-top: 1px solid var(--line); padding: 16px 0 24px; margin-top: 28px; color: var(--muted); font-size: 14px; }
footer p { margin: 3px 0; }
input[aria-invalid=true] { color: var(--danger); }
.amount-wrap:has(input[aria-invalid=true]) { border-color: var(--danger); }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (max-width: 760px) {
  .top, .shell { padding-left: 18px; padding-right: 18px; }
  .top { align-items: flex-start; flex-direction: column; gap: 5px; }
  h1 { font-size: 23px; }
  .worlds { gap: 7px; }
  .worlds button { flex: 1 1 140px; }
  .layout { grid-template-columns: 1fr; }
  .panel { padding: 16px; }
  .two-fields { grid-template-columns: 1fr; }
  .module-head h2 { font-size: 22px; }
  .income { flex-wrap: wrap; }
}
@media (max-width: 380px) {
  .field-row { flex-wrap: wrap; }
  .field-row>label { flex: 1 1 130px; }
}

.example-field { margin-bottom: 6px; }
.reflection { border-top: 1px solid var(--line); margin-top: 24px; padding-top: 18px; }
.reflection h2 { font-size: 20px; margin: 0 0 8px; }
.reflection label { display: block; margin-bottom: 6px; font-size: 15px; font-weight: bold; }
.reflection textarea { display: block; width: 100%; min-height: 100px; padding: 10px; border: 1px solid #aaa; border-radius: 3px; resize: vertical; }
.about-project h3 { font-size: 16px; margin: 18px 0 6px; }
.about-project p { margin: 0 0 12px !important; max-width: 800px; }
