:root {
  --bg: #f3f0eb; --paper: #fffdf9; --ink: #1d1915; --muted: #574d44; --line: #cfc5b8; --soft: #ebe5dc;
  --accent: #8a1f14; --accent-ink: #ffffff; --accent-soft: #f6e4df; --ok: #1d6b3a; --warn: #8a4b00; --warn-soft: #fbefd9;
  --p-agg: #b8322a; --p-prot: #2f63a0; --p-res: #177a7a; --p-adept: #9a6c00; --p-prag: #3a7d34;
  --head: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --r: 6px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14110f; --paper: #1e1a17; --ink: #efe8df; --muted: #bdb1a4; --line: #3d352e; --soft: #262019;
    --accent: #f0904f; --accent-ink: #1a0e06; --accent-soft: #3a2316; --ok: #7fd49c; --warn: #f2b45a; --warn-soft: #33260f;
    --p-agg: #ff8a7d; --p-prot: #8db8ff; --p-res: #62d0cc; --p-adept: #e7bd52; --p-prag: #92d47f;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; overflow-anchor: none; } /* app.js steady() keeps the view; the browser's own anchoring held the roll log while the plan grew (R4-1) */
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.55 var(--body); }
a { color: var(--accent); text-underline-offset: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
h1, h2, h3, h4 { font-family: var(--head); line-height: 1.2; font-weight: 700; }
h1 { font-size: clamp(1.75rem, 5.5vw, 2.6rem); margin: 0 0 .5rem; letter-spacing: -.005em; }
h2 { font-size: 1.6rem; margin: 2.4rem 0 .8rem; }
h3 { font-size: 1.2rem; margin: 1.2rem 0 .3rem; }
h4 { font-size: 1.08rem; margin: 0 0 .25rem; }
p, li { max-width: 70ch; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.skip { position: absolute; left: -999px; top: 0; }
.skip:focus { left: 8px; top: 8px; background: var(--paper); padding: .5rem .8rem; z-index: 20; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.top { border-bottom: 1px solid var(--line); background: var(--paper); }
.top-in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .2rem 1.2rem; padding-top: .45rem; padding-bottom: .45rem; }
.brand { display: inline-flex; align-items: center; gap: .5rem; color: var(--ink); text-decoration: none; font: 700 1.25rem var(--head); min-height: 44px; }
.brand svg { width: 28px; height: 28px; }
.top nav { display: flex; flex-wrap: wrap; gap: 0 1.1rem; }
.top nav a { color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; border-bottom: 3px solid transparent; }
.top nav a:hover, .top nav a[aria-current="page"] { border-bottom-color: var(--accent); }

.hero { padding: 1.1rem 0 .2rem; }
.lede { font-size: 1.1rem; margin: 0 0 .6rem; }
.checked { margin: 0; color: var(--muted); }
#season-note:not(:empty) { display: block; color: var(--warn); font-weight: 600; margin-top: .2rem; }
.crumbs { margin: 0 0 .4rem; color: var(--muted); }
.crumbs a { color: var(--muted); }

/* folds: the guide steps, "What you need" and the questions. Closed on phones, opened on wide screens by app.js. */
.fold > summary { list-style: none; display: flex; align-items: center; gap: .8rem; min-height: 48px; padding: .35rem 0; cursor: pointer; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary h3 { margin: 0; font-size: 1.15rem; }
.fold > summary::after { content: ""; flex: none; margin-left: auto; width: .55rem; height: .55rem; border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted); transform: translateY(-.15rem) rotate(45deg); transition: transform .15s; }
.fold[open] > summary::after { transform: translateY(.1rem) rotate(-135deg); }
.fold > summary:hover h3 { color: var(--accent); }
.fold > :not(summary) { margin-top: .1rem; }

/* the 11 steps: numerals down the left edge */
.steps { list-style: none; counter-reset: step; padding: 0; margin: 0; border-bottom: 1px solid var(--line); }
.steps > li { counter-increment: step; position: relative; padding: 0 0 0 2.9rem; max-width: 74ch; border-top: 1px solid var(--line); }
.steps > li::before { content: counter(step); position: absolute; left: 0; top: .55rem; width: 2.1rem; text-align: right;
  font: 700 1.6rem/1 var(--head); color: var(--accent); }
.steps p { margin: 0 0 .6rem; }
.steps details[open] { padding-bottom: .3rem; }
.cut { margin: .5rem 0; }
.order { margin: 0 0 1rem; font-size: 1.05rem; }
.need { margin: 0 0 1.2rem; max-width: 74ch; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.need ul { padding-left: 1.3rem; margin: 0 0 .7rem; }
.need li { margin-bottom: .45rem; }
.working { color: var(--muted); padding: .8rem 0; }
@media (min-width: 1000px) {
  .steps { columns: 2; column-gap: 2.5rem; border-bottom: 0; }
  .steps > li { break-inside: avoid; border-top: 0; border-bottom: 1px solid var(--line); margin-bottom: .7rem; }
}
.tag { display: inline-block; font-size: 1rem; font-weight: 700; padding: 0 .45rem; margin-right: .3rem; border: 1.5px solid var(--accent); color: var(--accent);
  border-radius: 3px; line-height: 1.5; }

/* planner */
.planner { margin-top: .6rem; }
.planner h2 { margin: .4rem 0 .6rem; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip { font: inherit; min-height: 44px; padding: .35rem .8rem; border-radius: var(--r); border: 1.5px solid var(--line); background: var(--paper);
  color: var(--ink); cursor: pointer; }
.chip:hover { border-color: var(--accent); }
.chip[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 -3px 0 var(--accent); font-weight: 700; }
.chip.add { border-style: dashed; }
.item-acts { margin: .3rem 0 .6rem; min-height: 44px; display: flex; align-items: center; }
.item-acts:empty { min-height: 0; margin: .2rem 0 .5rem; }
.confirm { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .6rem; }
.btn { font: inherit; font-weight: 600; min-height: 44px; padding: .45rem 1rem; border-radius: var(--r); border: 1.5px solid var(--accent);
  background: var(--accent); color: var(--accent-ink); cursor: pointer; }
.btn.ghost { background: var(--paper); color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--accent); }
.btn.danger { background: var(--paper); color: var(--accent); border-color: var(--accent); }
.link-btn { font: inherit; background: none; border: 0; color: var(--accent); text-decoration: underline; text-underline-offset: 2px; cursor: pointer;
  min-height: 44px; padding: 0 .2rem; }

.form { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: .9rem; }
.form label { display: block; font-weight: 600; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-bottom: .4rem; }
select { font: inherit; font-size: 16px; width: 100%; min-height: 44px; margin-top: .2rem; padding: .35rem .5rem; border-radius: var(--r);
  border: 1.5px solid var(--line); background: var(--paper); color: var(--ink); }
select:hover { border-color: var(--muted); }
.check { display: flex !important; align-items: center; gap: .5rem; min-height: 44px; font-weight: 400 !important; cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 0; accent-color: var(--accent); flex: none; }
.lines { border: 0; padding: 0; margin: .6rem 0 .2rem; min-width: 0; }
.lines legend { font: 700 1.1rem var(--head); padding: 0; margin-bottom: .1rem; }
.line-row { margin-bottom: .35rem; }
.line-row select { margin-top: 0; }
/* Greater, Enchanted and Must keep fit one row on a 390 px phone (fresh-eyes R2-3); narrower screens wrap */
.flags { display: flex; flex-wrap: wrap; gap: 0 .55rem; }
.flags .check { gap: .3rem; }
@media (max-width: 419px) { .form { padding: .9rem .7rem; } }
@media (min-width: 720px) {
  .line-row { display: grid; grid-template-columns: 1fr auto; gap: .6rem; align-items: center; }
  .flags { flex-wrap: nowrap; }
}

.result { margin-top: 1rem; }
.empty { color: var(--muted); padding: .8rem 0; }
.msg { border-radius: var(--r); padding: .6rem .9rem; }
.msg p { margin: .2rem 0; }
.msg.warn { background: var(--warn-soft); border: 1.5px solid var(--warn); }
.msg.warn p::before { content: "Check: "; font-weight: 700; }
.plan { background: var(--paper); border: 1.5px solid var(--ink); border-radius: var(--r); padding: .9rem 1rem 1rem; }
.plan-h { margin: 0 0 .4rem; font-size: 1.3rem; }
.plan-h:focus { outline: none; }
.strategy { margin: 0 0 .5rem; }
.total { margin: .5rem 0 .15rem; font-size: 1.05rem; }
.cost-rows { margin: 0 0 .5rem; }
.cost-rows div { display: flex; gap: .5rem; }
.cost-rows dt { font-weight: 700; flex: 0 0 4.3rem; }
.cost-rows dd { margin: 0; min-width: 0; }
.plan > .note { color: var(--muted); font-style: italic; margin: .2rem 0 .6rem; }
.alt { margin: 0 0 .6rem; color: var(--muted); }
.plan-steps { margin: .6rem 0 0; padding-left: 1.6rem; }
.plan-steps > li { margin-bottom: .9rem; padding-left: .2rem; }
.plan-steps > li::marker { font: 700 1.1rem var(--head); color: var(--accent); }
.plan-steps p { margin: .15rem 0; }
.plan-steps .cost { color: var(--muted); }
.plan-steps .note { color: var(--muted); font-style: italic; }
.now-step { background: var(--soft); border-radius: var(--r); padding: .6rem .7rem .7rem; margin-left: -.3rem; }
.rec { margin-top: .6rem; }
.rec label { display: block; font-weight: 700; }
.rec-row { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .2rem; }
.rec-row select { margin-top: 0; flex: 1 1 16rem; min-width: 0; }
/* the plan as a flow chart: boxes top to bottom, each with the odds of its results and where they lead */
.flow-h { margin: .9rem 0 .4rem; font-size: 1.05rem; }
.flow-note { margin: 0 0 .6rem; }
.flow { list-style: none; margin: 0; padding: 0; }
.fstep { position: relative; padding-bottom: 1.5rem; max-width: none; }
.fstep::after { content: ""; position: absolute; left: 1.15rem; bottom: .35rem; height: .85rem; border-left: 2px solid var(--muted); }
.fstep::before { content: ""; position: absolute; left: calc(1.15rem - 5px); bottom: .1rem; border: 6px solid transparent; border-top: 7px solid var(--muted); border-bottom: 0; }
.fstep:last-child { padding-bottom: .4rem; }
.fstep:last-child::before, .fstep:last-child::after { display: none; }
.fbox { background: var(--paper); border: 1.5px solid var(--line); border-radius: 4px; padding: .55rem .75rem .6rem; }
.fbox h4 { margin: 0; font-size: 1.05rem; overflow-wrap: anywhere; }
.fnum { font: 700 1.05rem var(--head); color: var(--accent); margin-right: .3rem; }
.fodds { margin: .15rem 0 0; color: var(--muted); }
.fga { margin: .3rem 0 0; font-weight: 600; }
.plan-note { margin: 0 0 .6rem; font-weight: 600; }
.keep-hint { margin: 0 0 .4rem; color: var(--muted); }
.fbody { display: none; }
.now > .fbox { background: var(--soft); border: 2px solid var(--ink); }
.fexits { list-style: none; margin: .4rem 0 0 1.15rem; padding: 0 0 0 .8rem; border-left: 2px solid var(--line); }
.fexits li { margin: .25rem 0; max-width: none; overflow-wrap: anywhere; }
.fexits ul { list-style: none; margin: .1rem 0 0; padding-left: 1rem; }
.fp { display: inline-block; min-width: 3.4em; font-weight: 700; font-variant-numeric: tabular-nums; }
.fto { font-weight: 600; }
.fdone { font-weight: 700; color: var(--ok); padding: .1rem 0 .4rem .2rem; max-width: none; }
.fbranch-h { margin: .4rem 0 .5rem; font-weight: 700; max-width: none; }
.fbranch { margin-left: .4rem; padding-left: .8rem; border-left: 2px dashed var(--line); }
.plan-text { margin: .4rem 0 0; }
.lock-alt { margin: 0 0 .6rem; }
.lock-alt > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; gap: .6rem; font-weight: 600; list-style: none; }
.lock-alt > summary::-webkit-details-marker { display: none; }
.lock-alt > summary::before { content: ""; flex: none; width: .5rem; height: .5rem; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg); transition: transform .15s; }
.lock-alt[open] > summary::before { transform: rotate(45deg); }
.lock-alt p, .lock-alt ol { margin: .2rem 0 .5rem; }
.lock-alt ol { padding-left: 1.4rem; }
.how-link { margin: .6rem 0 0; }
.how-link a { color: var(--muted); }
.plan-text > summary { cursor: pointer; font-weight: 700; min-height: 44px; display: flex; align-items: center; color: var(--accent); }
.plan-text .from { font-weight: 700; }
.plan-text .then-to { margin-top: .25rem; }
.then { padding-left: 1.4rem; margin: .2rem 0 0; }
.then li { margin-bottom: .3rem; }
.plan h3 { font-size: 1.15rem; margin: 1rem 0 .2rem; }

.prism { white-space: nowrap; font-weight: 700; }
.prism::before { content: ""; display: inline-block; width: .7em; height: .7em; border-radius: 50%; margin: 0 .3em .05em .1em; vertical-align: middle;
  background: currentColor; }
.p-agg::before { background: var(--p-agg); }
.p-prot::before { background: var(--p-prot); }
.p-res::before { background: var(--p-res); }
.p-adept::before { background: var(--p-adept); }
.p-prag::before { background: var(--p-prag); }
.p-chrom::before { background: conic-gradient(#d4473b 0 33%, #3f7fd0 0 66%, #e2b33b 0); }

.log { margin-top: 1rem; }
.log h3 { margin: 0 0 .2rem; }
.spent { margin: 0 0 .3rem; }
.rolls { margin: 0 0 .4rem; padding-left: 1.6rem; }
.more { color: var(--muted); margin: 0 0 .4rem; }
.tools-row { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0 .4rem; }
.store-note { background: var(--warn-soft); border: 1.5px solid var(--warn); border-radius: var(--r); padding: .5rem .8rem; }
.kept { margin: .6rem 0; }
.kept summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 600; }
.kept ul { padding-left: 1.2rem; margin: 0; }
.kept li { margin-bottom: .2rem; }
.why { color: var(--muted); }

@media (min-width: 980px) {
  .cols { display: grid; grid-template-columns: minmax(400px, 460px) 1fr; gap: 0 2rem; align-items: start; }
  .cols .result { margin-top: 0; }
  .line-row { grid-template-columns: 1fr; gap: 0; }
}

.faq .fold { border-top: 1px solid var(--line); max-width: 74ch; }
.faq .fold:last-of-type { border-bottom: 1px solid var(--line); }
.faq .fold p { margin: 0 0 .8rem; }
.sources { color: var(--muted); margin-top: 1.6rem !important; }

/* how the planner works */
.how-q { max-width: 74ch; border-top: 1px solid var(--line); padding-top: .4rem; margin-bottom: .6rem; }
.how-q h2 { font-size: 1.25rem; margin: .4rem 0 .5rem; }
.how-q p, .how-q ul { margin: 0 0 .7rem; }
.how-q li { margin-bottom: .35rem; }

/* recipes page */
.row3 { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.row3 label:last-child { grid-column: 1 / -1; }
@media (min-width: 640px) { .row3 { grid-template-columns: 1fr 1fr 1fr; } .row3 label:last-child { grid-column: auto; } }
.odds { margin-top: .8rem; max-width: 720px; }
.odds-form { max-width: 720px; }
caption { text-align: left; font-weight: 700; padding: 0 0 .3rem; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; margin: .4rem 0 1rem; background: var(--paper); }
th, td { text-align: left; vertical-align: top; padding: .45rem .6rem; border-bottom: 1px solid var(--line); }
th { font-weight: 700; border-bottom: 2px solid var(--ink); }
td.n, th.n { text-align: right; white-space: nowrap; }
@media (max-width: 600px) {
  table.stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: 100%; }
  table.stack tr { border-bottom: 1px solid var(--line); padding: .4rem 0; }
  table.stack td { border: 0; padding: .1rem .2rem; text-align: left; }
  table.stack td[data-h]::before { content: attr(data-h) ": "; font-weight: 700; }
}

.print-root { display: none; }
footer.site { margin-top: 3rem; padding: 1.4rem 0 2rem; border-top: 1px solid var(--line); background: var(--paper); color: var(--muted); }
footer.site a { color: var(--ink); }
.fan { margin: 0 0 .6rem; }

.toast { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); width: min(520px, calc(100% - 32px)); background: var(--ink); color: var(--bg);
  border-radius: var(--r); padding: .6rem .9rem; z-index: 30; pointer-events: none; box-shadow: 0 6px 20px rgba(0, 0, 0, .25); }

.chip, .btn, select { transition: border-color .15s, background-color .15s; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

@page { margin: 0.45in 0.55in; }
@media print {
  :root { --ink: #000; --muted: #333; --paper: #fff; --bg: #fff; --accent: #000; --line: #999; color-scheme: light; }
  body { background: #fff; color: #000; font: 10.5pt/1.3 var(--body); }
  body > :not(main), main > :not(#print-root) { display: none !important; }
  main.wrap { padding: 0; max-width: none; }
  .print-root { display: block !important; }
  .print-root h2 { font-size: 17pt; margin: 0 0 4pt; }
  .print-root p { margin: 0 0 5pt; max-width: none; }
  .print-root h3 { font-size: 12pt; margin: 6pt 0 1pt; break-after: avoid; }
  .print-root h4 { font-size: 11pt; margin: 0 0 2pt; }
  .print-steps { list-style: none; padding: 0; margin: 8pt 0 0; counter-reset: ps; }
  .print-steps > li { counter-increment: ps; display: grid; grid-template-columns: 16pt 16pt 1fr; gap: 0 6pt; padding: 3pt 0; border-top: .6pt solid #999;
    break-inside: avoid; max-width: none; }
  .print-steps > li::before { content: counter(ps) "."; font-weight: 700; font-size: 11pt; }
  .print-steps .box { width: 12pt; height: 12pt; border: 1pt solid #000; margin-top: 1pt; }
  .print-steps p { margin: .5pt 0; }
  .print-steps .cost { color: #333; }
  .print-root .print-cost { margin: 0; }
  .print-root .flow-wrap { margin-top: 6pt; }
  .print-root .fstep { padding-bottom: 9pt; break-inside: avoid; }
  .print-root .fstep::after { left: 10pt; bottom: 3pt; height: 6pt; border-left: 1pt solid #000; }
  .print-root .fstep::before { left: 7pt; bottom: 0; border-width: 4pt 3.5pt 0; border-top-color: #000; }
  .print-root .fbox { border: .8pt solid #000; border-radius: 0; padding: 4pt 6pt; position: relative; padding-left: 22pt; }
  .print-root .fbox .box { position: absolute; left: 5pt; top: 5pt; width: 11pt; height: 11pt; border: 1pt solid #000; }
  .print-root .fbox h4 { font-size: 11pt; }
  .print-root .fnum { color: #000; font-size: 11pt; }
  .print-root .fodds { color: #222; margin: 1pt 0 0; }
  .print-root .fbody { display: block; }
  .print-root .fbody p { margin: 1.5pt 0 0; }
  .print-root .fexits { margin: 3pt 0 0 10pt; padding-left: 7pt; border-left: 1pt solid #666; }
  .print-root .fexits li { margin: 1pt 0; }
  .print-root .fbranch { border-left: 1pt dashed #666; padding-left: 7pt; margin-left: 2pt; }
  .print-root .fbranch-h { margin: 4pt 0 3pt; break-after: avoid; }
  .print-root .fdone { color: #000; padding: 0 0 4pt; break-before: avoid; }
  .print-root .cost-rows dt { flex-basis: 48pt; }
  .print-root .cost-rows { margin: 0 0 4pt; }
  .tag { border-color: #000; color: #000; font-size: 9pt; }
  .prism::before { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .then { padding-left: 14pt; }
  .then li { max-width: none; margin-bottom: 0; break-inside: avoid; }
  .then { margin: 0; font-size: 10pt; line-height: 1.22; }
  .then li:nth-last-child(-n+2) { break-before: avoid; }
  .print-root .note { margin: 3pt 0 0; }
  .print-root .lock-alt > p:first-child { break-after: avoid; }
  .print-foot { break-before: avoid; margin-top: 6pt !important; font-size: 9pt; color: #333; border-top: .6pt solid #999; padding-top: 4pt; }
  a { color: #000; }
}
