/* Your books · design tokens shared with the course site. Change a value here, the page follows. */
@font-face { font-family: 'Abhaya Libre'; font-weight: 400; src: url('fonts/abhaya-libre-latin-400-normal.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Abhaya Libre'; font-weight: 600; src: url('fonts/abhaya-libre-latin-600-normal.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 400; src: url('fonts/ibm-plex-sans-latin-400-normal.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 500; src: url('fonts/ibm-plex-sans-latin-500-normal.woff2') format('woff2'); font-display: swap; }

:root {
  /* Brand kit v1: forest, gold, cream and ink. Gold is detailing only, never body text on cream. */
  --forest: #1E3121; --gold: #A8884F; --page: #EAE1CB; --parchment: #E6D6B0; --linen: #E4DAC2;
  --sand: #E0D6BA; --ink: #33241A; --umber: #5A4835; --ink-soft: #6A5A45; --stone: #C9BC9C; --rose: #8A3B45;
  /* older names, pointing at the kit */
  --bark: var(--forest); --olive: var(--forest); --sage: var(--sand); --panel: var(--sand);
  --cream: var(--linen); --cream-soft: var(--stone);
  --rule: rgba(51,36,26,0.2); --rule-soft: rgba(51,36,26,0.14); --rule-strong: var(--gold);
  --serif: 'Abhaya Libre', Georgia, serif; --sans: 'IBM Plex Sans', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; }
body { margin: 0; background: var(--page); color: var(--umber); font-family: var(--serif); font-size: 18px; line-height: 1.5; }
h1, h2 { margin: 0; font-weight: 600; color: var(--ink); }
p { margin: 0; }
a { color: var(--olive); }
button, input, textarea { font: inherit; border-radius: 0; }
:focus-visible { outline: 2px solid var(--olive); outline-offset: 3px; }
/* The page moves focus to <main> after each view change, so screen readers start in the right
   place. That focus is for them, not a control: no ring around the whole page. */
main:focus, main:focus-visible { outline: none; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

.skip { position: absolute; left: -999px; top: 8px; background: var(--forest); color: var(--parchment); padding: 8px 14px; font-family: var(--sans); font-size: 13px; z-index: 100; }
.skip:focus { left: 8px; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 20px; }
@media (min-width: 720px) { .wrap { padding: 0 28px; } }
.kicker { font-family: var(--sans); font-size: 10.5px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--olive); margin-bottom: 14px; }
.kicker--dark { color: var(--gold); }
.meta { font-family: var(--sans); font-size: 13px; line-height: 1.55; color: var(--ink-soft); }
.meta--dark { color: var(--cream-soft); }
.lede { font-size: 20px; line-height: 1.55; max-width: 640px; }
.na { color: var(--ink-soft); }
.print-only { display: none; }

.btn { display: inline-block; background: var(--forest); color: var(--parchment); border: none; padding: 14px 24px; min-height: 46px; font-family: var(--sans); font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase; cursor: pointer; text-decoration: none; line-height: 1.2; }
.btn:hover { background: var(--forest); color: var(--gold); }
.btn--ghost { background: none; border: 1px solid var(--forest); color: var(--forest); }
.btn--ghost:hover { background: var(--sage); color: var(--ink); }
.btn--danger:hover { background: var(--rose); color: var(--parchment); border-color: var(--rose); }
.btn[disabled] { opacity: 0.45; cursor: default; }
.btn[disabled]:hover { background: none; color: var(--ink); }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.actions--tight { margin-top: 14px; }
.confirm { margin-top: 18px; padding: 18px 20px; background: var(--cream); border: 1px solid var(--rule-strong); max-width: 640px; }
.confirm p { font-size: 17px; }
.banner { margin: 18px 0 22px; padding: 12px 16px; background: var(--panel); border-left: 3px solid var(--gold); font-family: var(--sans); font-size: 13.5px; }
.status { min-height: 1.6em; margin: 12px 0 0; }
.status:empty { margin: 0; min-height: 0; }

/* header */
.hdr { border-bottom: 1px solid var(--gold); background: var(--forest); color: var(--parchment); }
.hdr__bar { display: flex; align-items: center; justify-content: space-between; gap: 18px 28px; flex-wrap: wrap; min-height: 92px; padding-top: 16px; padding-bottom: 16px; }
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; color: inherit; }
.brand img { height: 52px; width: auto; }
.brand__name { display: block; font-size: 18px; letter-spacing: 0.16em; text-transform: uppercase; line-height: 1.1; }
.brand__by { display: block; font-family: var(--sans); font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); margin-top: 3px; }
.hdr__nav { display: flex; gap: 6px; }
.hdr__nav a { font-family: var(--sans); font-size: 12.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--parchment); text-decoration: none; padding: 12px 14px; border-bottom: 2px solid transparent; }
.hdr__nav a:hover { color: var(--gold); }
.hdr__nav a.is-active { border-bottom-color: var(--gold); color: var(--gold); }
.hdr__note { font-family: var(--sans); font-size: 12.5px; color: var(--stone); max-width: 42ch; }
@media (max-width: 720px) { .hdr__note { display: none; } .brand img { height: 36px; } .hdr__nav a { padding: 14px; } }

.intro { padding: clamp(56px, 7vw, 88px) 0 40px; max-width: 760px; }
.promise { margin-top: 16px; padding: 12px 16px; background: var(--panel); border-left: 3px solid var(--gold); font-family: var(--sans); font-size: 14px; line-height: 1.5; max-width: 640px; }
.intro__cta { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; margin-top: 26px; }
.intro__practice { margin-top: 18px; }
.linkbtn { background: none; border: none; padding: 0 0 2px; font: inherit; color: var(--forest); border-bottom: 1px solid var(--gold); cursor: pointer; }
.linkbtn:hover { color: var(--ink); }
.link { font-family: var(--sans); font-size: 13.5px; color: var(--olive); }
.more { margin-top: 28px; border-top: 1px solid var(--rule); }
.more summary { display: flex; flex-direction: column; gap: 4px; padding: 20px 0; cursor: pointer; list-style: none; }
.more summary::-webkit-details-marker { display: none; }
.more summary .kicker { margin: 0; }
.more__t { font-size: 24px; font-weight: 600; line-height: 1.1; }
.more__t::before { content: '+ '; color: var(--gold); font-family: var(--sans); font-weight: 400; }
.more[open] .more__t::before { content: '\2212 '; }
.more summary:hover .more__t { color: var(--olive); }
.more .card { margin-bottom: 8px; }
.intro h1 { font-size: clamp(30px,4vw,50px); line-height: 1.02; margin-bottom: 18px; text-wrap: pretty; }
.back { display: inline-block; font-family: var(--sans); font-size: 12.5px; letter-spacing: 0.08em; color: var(--ink-soft); text-decoration: none; padding: clamp(40px, 5vw, 64px) 0 22px; }
.back:hover { color: var(--olive); }

/* the three cards of inputs */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 28px; align-items: start; }
.card { background: var(--panel); padding: clamp(22px,3vw,32px); }
.card h2 { font-size: 24px; line-height: 1.1; margin-bottom: 18px; }
.card__note { margin: -8px 0 12px; }
.rows { display: flex; flex-direction: column; }
.row { display: grid; grid-template-columns: minmax(0,1fr) 160px; gap: 14px; align-items: center; padding: 10px 0; border-top: 1px solid var(--rule-soft); }
.row label { display: flex; flex-direction: column; gap: 2px; font-size: 17px; line-height: 1.3; }
.row small { font-family: var(--sans); font-size: 13px; color: var(--ink-soft); }
.row__field { display: flex; flex-direction: column; gap: 4px; }
.row input { width: 100%; font-family: var(--sans); font-size: 16px; text-align: right; padding: 11px 10px; min-height: 44px; border: 1px solid var(--rule); background: var(--cream); color: var(--ink); }
.row--bad input { border-color: var(--rose); }
.row__err { font-family: var(--sans); font-size: 13px; color: var(--rose); text-align: right; }
.row input[readonly] { background: var(--panel); color: var(--ink-soft); cursor: default; }
@media (max-width: 720px) { .row { grid-template-columns: 1fr; } .row input { text-align: left; } .row__err { text-align: left; } body { font-size: 17px; } .kicker { font-size: 12px; } .meta { font-size: 14px; } .whatif__t thead { display: none; } .whatif__t tr { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 10px 0; border-top: 1px solid var(--rule-soft); } .whatif__t th, .whatif__t td { border: none; padding: 0; } .whatif__t td:last-child { grid-column: 1 / -1; } }

/* readings */
.out { background: var(--forest); color: var(--linen); border-top: 1px solid var(--gold); border-bottom: 1px solid var(--gold); padding: clamp(28px,4.5vw,64px) clamp(20px,4vw,64px); margin-top: 40px; }
.out--inline { margin-top: 0; padding: clamp(22px,3vw,32px); }
.out--inline .outgrid { grid-template-columns: 1fr; }
.out--inline .stat { padding: 16px 0; border-top: 1px solid rgba(168,136,79,0.45); }
.out--inline .stat + .stat { padding-left: 0; }
.out h2 { font-size: clamp(24px,2.8vw,36px); line-height: 1.05; margin-bottom: 28px; color: var(--parchment); }
.outgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0; margin: 0; }
.stat { background: var(--bark); padding: 18px 20px 18px 0; border-top: 1px solid rgba(168,136,79,0.45); }
.stat + .stat { padding-left: 20px; }
.stat dt, .stat dd { margin: 0; }
.stat__k { font-family: var(--sans); font-size: 10.5px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--cream-soft); margin-bottom: 8px; }
.stat__v { font-family: var(--sans); font-size: 26px; line-height: 1; margin-bottom: 8px; }
.stat__n { font-size: 16px; line-height: 1.4; color: var(--cream-soft); }
.stat--empty .stat__v { color: var(--cream-soft); font-size: 16px; }
.outnote { margin-top: 18px; }

.keep { padding: 48px 0 0; max-width: 680px; }
.keep__ws { margin-top: 14px; }
.foot { padding: 56px 0 64px; font-family: var(--sans); font-size: 12px; line-height: 1.7; color: var(--ink-soft); border-top: 1px solid var(--rule); margin-top: 48px; }
.foot a { color: var(--ink-soft); }
.foot__links { margin-top: 8px; }

/* worksheets index */
.wslist { display: flex; flex-direction: column; border-top: 1px solid var(--rule); }
.wsrow { display: flex; flex-direction: column; gap: 6px; padding: 22px 0; border-bottom: 1px solid var(--rule-soft); text-decoration: none; color: inherit; }
.wsrow:hover { background: rgba(51,36,26,0.04); }
.wsrow .kicker { margin: 0; }
.wsrow__t { font-size: 24px; line-height: 1.15; font-weight: 600; }
.wsnote { padding: 18px 0; }

/* one worksheet */
.ws { max-width: 880px; padding-bottom: 40px; }
.ws__title { font-size: clamp(30px,4vw,50px); line-height: 1.02; margin-bottom: 18px; text-wrap: pretty; }
.ws__needs { margin-top: 36px; background: var(--panel); padding: clamp(18px,3vw,28px); }
.ws__needs .rows { max-width: 640px; }
.ws__needs .promise { margin-top: 18px; }
.ws__missing { margin-top: 12px; }
.ws__steps { margin-top: 44px; }
.steps { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); counter-reset: step; }
.step { padding: 22px 0 24px; border-bottom: 1px solid var(--rule-soft); counter-increment: step; }
.step__head { display: flex; align-items: baseline; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-bottom: 10px; }
.step__label::before { content: counter(step) '. '; font-family: var(--sans); font-size: 13px; color: var(--gold); margin-right: 6px; }
.step__label { font-size: 24px; font-weight: 600; line-height: 1.1; }
.step__v { font-family: var(--sans); font-size: 24px; color: var(--bark); }
.step__line { font-size: 19px; line-height: 1.5; margin-bottom: 8px; }
.step__plain { font-size: 17px; line-height: 1.5; color: var(--ink-soft); max-width: 60ch; }
.ws__whatif { margin-top: 44px; background: var(--cream); border: 1px solid var(--rule); padding: clamp(18px,3vw,28px); }
.ws__explain { max-width: 60ch; margin-bottom: 18px; }
.whatif__ctl label { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; font-family: var(--sans); font-size: 14px; margin-bottom: 8px; }
.whatif__ctl output { font-size: 22px; font-family: var(--sans); color: var(--bark); }
.whatif__ctl input[type=range] { width: 100%; accent-color: var(--bark); height: 44px; }
.whatif__t { width: 100%; border-collapse: collapse; margin-top: 18px; font-size: 17px; }
.whatif__t th, .whatif__t td { text-align: left; padding: 10px 12px 10px 0; border-top: 1px solid var(--rule-soft); vertical-align: top; }
.whatif__t thead th { font-family: var(--sans); font-size: 10.5px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--olive); border-top: none; }
.whatif__t .num { font-family: var(--sans); white-space: nowrap; }
.whatif__t td:last-child { font-family: var(--sans); font-size: 13px; color: var(--ink-soft); }
.ws__prompts { margin-top: 44px; }
.prompt { margin-bottom: 26px; }
.prompt label { display: block; font-size: 19px; line-height: 1.45; margin-bottom: 10px; max-width: 60ch; }
.prompt textarea { width: 100%; max-width: 720px; font-family: var(--serif); font-size: 18px; line-height: 1.5; padding: 12px 14px; border: 1px solid rgba(51,36,26,0.3); background: var(--cream); color: var(--ink); resize: vertical; }
.ws__saved { margin-top: -8px; }
.ws__closing { margin-top: 36px; font-size: 21px; line-height: 1.45; max-width: 60ch; padding: 22px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.actions--ws { margin-bottom: 12px; }

/* print: the worksheet as a clean document; the dashboard as a one-page record */
@media print {
  @page { margin: 18mm; }
  body { background: #fff; color: #000; font-size: 12pt; }
  .skip, .hdr__nav, .hdr__note, .actions, .confirm, .status, .back, .keep, .banner, .ws__saved, .row__err, .whatif__ctl input[type=range], .promise, .intro__cta, .intro__practice, .foot__links { display: none !important; }
  .print-only { display: block; }
  .hdr { border-bottom: 1px solid #000; background: #fff; color: #000; }
  .brand__by { color: #000; }
  .brand img { height: 34px; }
  .card, .ws__needs, .ws__whatif, .out { background: #fff; color: #000; border: 1px solid #999; break-inside: avoid; }
  .stat { background: #fff; }
  .stat__k, .stat__n, .kicker, .kicker--dark, .meta, .meta--dark, .step__plain { color: #333; }
  .step__v { color: #000; }
  .row input { border: none; background: none; font-weight: 600; padding: 0; min-height: 0; text-align: left; }
  .row { grid-template-columns: minmax(0,1fr) 140px; }
  .prompt textarea { display: none; }
  .prompt__print { white-space: pre-wrap; border-left: 2px solid #999; padding-left: 10px; min-height: 2.5em; }
  .step, .prompt { break-inside: avoid; }
  .foot { font-size: 9pt; }
  a { color: #000; text-decoration: none; }
}
