/* Thousand A Month: one stylesheet for every page.
   System fonts only (no font requests, nothing third party).
   Palette from the show: paper, ink, green for money in and progress,
   mustard for interest and short months. No red anywhere. */

:root {
  color-scheme: light;
  --paper: #FAF7F0;
  --ink: #1A2228;
  --green: #227858;
  --green-dark: #16543E;
  --mustard: #E6A03C;
  --mustard-text: #A86A12;
  --mustard-small: #8F5A0F;  /* mustard text one step darker, for small type, so it passes AA on paper */
  --muted: #4F585E;
  --rule: #E4DDCF;
  --shade: #ECE7DC;
  --card: #FFFFFF;
  --drop: #E3D9C6;           /* the beige offset shadow the episodes draw under the sheet */
  --tint-green: #EAF3EE;
  --tint-mustard: #FBF0DC;
  --radius: 12px;
  --wrap: 1080px;
  --gutter: 20px;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: ui-rounded, "SF Pro Rounded", "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--font-sans);
  overflow-wrap: break-word;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--green-dark); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.12; letter-spacing: -0.015em; margin: 0 0 .5em; }
h1 { font-size: clamp(2.1rem, 1.3rem + 3.6vw, 3.4rem); font-weight: 800; letter-spacing: -0.025em; }
h2 { font-size: clamp(1.55rem, 1.2rem + 1.5vw, 2.15rem); font-weight: 800; }
h3 { font-size: 1.2rem; font-weight: 750; }
p, ul, ol, dl { margin: 0 0 1em; }
strong, b { font-weight: 700; }
code { font-family: var(--font-mono); font-size: .9em; background: var(--shade); padding: .1em .35em; border-radius: 4px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 20; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 8px; }
.skip-link:focus { top: 12px; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: 46rem; }
.section { padding: clamp(48px, 8vw, 88px) 0; border-top: 1px solid var(--rule); }
.lede { font-size: 1.15rem; max-width: 38rem; }
.muted { color: var(--muted); }
.small { font-size: .92rem; }
.eyebrow {
  font: 700 .8rem/1.3 var(--font-sans); letter-spacing: .09em; text-transform: uppercase;
  color: var(--mustard-small); margin: 0 0 .9rem;
}

/* setup bar, shown by main.js while site/config.js still has square-bracket placeholders */
.setup-bar { background: var(--tint-mustard); border-bottom: 1px solid var(--mustard); font-size: .88rem; padding: 8px 0; }
.setup-bar summary { cursor: pointer; }
.setup-bar p { margin: 6px 0 0; font-family: var(--font-mono); font-size: .8rem; }

/* header */
.site-header { padding: 18px 0; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font: 800 1.05rem/1 var(--font-display); letter-spacing: -0.01em; }
.brand img { width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--ink); }
.brand span b { color: var(--green); font-weight: 800; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 54px; padding: 12px 22px;
  font: 700 1.05rem/1.2 var(--font-sans); text-align: center; text-decoration: none;
  color: #fff; background: var(--green-dark);
  border: 2px solid var(--ink); border-radius: 10px;
  box-shadow: 3px 3px 0 var(--ink);
  cursor: pointer; transition: transform .12s ease, box-shadow .12s ease, background-color .12s ease;
}
.btn:hover { background: #10432F; text-decoration: none; }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn-secondary { color: var(--ink); background: var(--card); }
.btn-secondary:hover { background: var(--shade); }
.btn:disabled, .btn[aria-disabled="true"] {
  color: #3E464B; background: var(--shade); border-color: #8C8F88; box-shadow: none; cursor: not-allowed; transform: none;
}
.btn-row { display: flex; flex-wrap: wrap; gap: 14px; margin: 1.4rem 0 1rem; }
.btn-row .btn { flex: 1 1 15rem; }
.under-btn { font-size: .92rem; color: var(--muted); margin-top: .8rem; }

/* the opt-in form */
.optin { margin: 1.6rem 0 0; max-width: 34rem; }
.optin label { display: block; font-weight: 700; margin-bottom: 6px; }
.optin-row { display: flex; flex-direction: column; gap: 12px; }
.optin input[type="email"] {
  width: 100%; min-height: 54px; padding: 12px 14px;
  font: 400 1.1rem/1.3 var(--font-sans); color: var(--ink); background: var(--card);
  border: 2px solid var(--ink); border-radius: 10px;
}
.optin input[type="email"]::placeholder { color: #6B7277; }
.optin input[type="email"]:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; }
.optin .btn { width: 100%; }
.consent { font-size: .9rem; color: var(--muted); margin: .9rem 0 0; }
.hint { margin: .6rem 0 0; font-size: .95rem; }
.hint button { font: inherit; color: var(--green-dark); background: none; border: 0; padding: 0; text-decoration: underline; cursor: pointer; }
.setup-notice {
  margin: .8rem 0 0; padding: 10px 12px; font-size: .9rem;
  background: var(--tint-mustard); border: 1px solid var(--mustard); border-radius: 8px;
}
.setup-notice[hidden], .hint[hidden] { display: none; }
.cfg-missing { background: var(--tint-mustard); border-bottom: 1px dashed var(--mustard-small); padding: 0 .2em; font-size: .92em; }
@media (min-width: 560px) {
  .optin-row { flex-direction: row; }
  .optin-row input[type="email"] { flex: 1 1 auto; }
  .optin .btn { width: auto; flex: 0 0 auto; }
}

/* hero */
.hero { padding: clamp(16px, 4vw, 44px) 0 clamp(48px, 8vw, 88px); }
.hero-grid { display: grid; gap: 40px; align-items: center; }
@media (min-width: 900px) { .hero-grid { grid-template-columns: 1.05fr 1fr; gap: 56px; } }

/* the Planner, drawn the way the episodes draw it */
.planner-figure { margin: 0; }
.planner-stage { position: relative; }
.planner-stage .host-point { display: none; }
@media (min-width: 620px) {
  .planner-stage { padding-left: 128px; }
  .planner-stage .host-point { display: block; position: absolute; left: 0; bottom: -4px; width: 150px; height: auto; }
}
.month-pill {
  display: inline-flex; align-items: baseline; gap: 14px; margin: 0 0 14px;
  padding: 6px 18px; background: var(--card); border: 2.5px solid var(--ink); border-radius: 999px;
  box-shadow: 4px 4px 0 var(--drop); font: 700 1.05rem/1.2 var(--font-display);
}
.month-pill b { color: var(--green); font-size: 1.3rem; }
.sheet {
  width: 100%; border-collapse: separate; border-spacing: 0;
  background: var(--card); border: 2.5px solid var(--ink); border-radius: var(--radius);
  box-shadow: 7px 7px 0 var(--drop); font-variant-numeric: tabular-nums;
}
.sheet th, .sheet td { padding: 7px 16px; text-align: left; font-weight: 500; border-bottom: 1px solid var(--shade); }
.sheet td { text-align: right; font-weight: 700; white-space: nowrap; }
.sheet thead th { font: 800 1.08rem/1.3 var(--font-display); padding: 14px 16px 10px; border-bottom: 2px solid var(--green); }
.sheet thead th.sheet-month { text-align: right; color: var(--green-dark); font-size: .9rem; }
.sheet .is-income td { color: var(--green); }
.sheet .is-card td { color: var(--mustard-small); }
.sheet .is-empty td::after { content: ""; display: inline-block; width: 3.2em; height: 1.1em; vertical-align: middle; border: 1px solid #B9D3C5; border-radius: 3px; }
.sheet tfoot th, .sheet tfoot td { font-weight: 800; font-size: 1.08rem; border-bottom: 0; }
.sheet tfoot tr:first-child th, .sheet tfoot tr:first-child td { border-top: 2px solid var(--ink); }
.sheet .is-left th, .sheet .is-left td { color: var(--green); }
.planner-figure figcaption { margin-top: 14px; font-size: .9rem; color: var(--muted); }

/* tab list ("What's inside") */
.tabs-list { list-style: none; padding: 0; margin: 1.5rem 0 0; }
.tabs-list li { padding: 18px 0; border-bottom: 1px solid var(--rule); display: grid; gap: 8px; }
.tabs-list li:first-child { border-top: 1px solid var(--rule); }
.tabs-list p { margin: 0; }
@media (min-width: 720px) { .tabs-list li { grid-template-columns: 13rem 1fr; gap: 24px; } }
.tab-name {
  justify-self: start; align-self: start; font: 700 .95rem/1.2 var(--font-sans);
  padding: 7px 12px; background: var(--card); border: 1.5px solid var(--ink); border-bottom-width: 3px; border-radius: 8px 8px 4px 4px;
}

/* numbered steps */
.steps { list-style: none; counter-reset: step; padding: 0; margin: 1.5rem 0 0; display: grid; gap: 18px; }
@media (min-width: 820px) { .steps { grid-template-columns: repeat(3, 1fr); gap: 24px; } }
.steps li { counter-increment: step; background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: 22px 22px 20px; }
.steps li::before {
  content: counter(step); display: inline-grid; place-items: center; width: 38px; height: 38px; margin-bottom: 12px;
  font: 800 1.1rem/1 var(--font-display); color: var(--green-dark); background: var(--tint-green);
  border: 2px solid var(--ink); border-radius: 50%;
}
.steps p { margin: 0; }

/* plain two-column split */
.split { display: grid; gap: 32px; align-items: start; }
@media (min-width: 820px) { .split { grid-template-columns: 1fr 1fr; gap: 56px; } }

.key { display: flex; flex-wrap: wrap; gap: 10px; margin: 1rem 0 0; padding: 0; list-style: none; }
.key li { display: inline-flex; align-items: center; gap: 8px; font-size: .95rem; background: var(--card); border: 1px solid var(--rule); border-radius: 8px; padding: 6px 10px; }
.swatch { width: 14px; height: 14px; border-radius: 3px; border: 1px solid var(--ink); }
.swatch-green { background: var(--green); }
.swatch-mustard { background: var(--mustard); }

/* FAQ: no boxes, ruled rows, + and - drawn in CSS */
.faq { margin-top: 1.4rem; border-top: 1px solid var(--rule); }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary {
  list-style: none; cursor: pointer; position: relative; padding: 18px 44px 18px 0;
  font: 700 1.08rem/1.35 var(--font-sans);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before, .faq summary::after {
  content: ""; position: absolute; right: 8px; top: 50%; width: 16px; height: 2.5px; margin-top: -1px; background: var(--ink); border-radius: 2px;
  transition: transform .15s ease;
}
.faq summary::after { transform: rotate(90deg); }
.faq details[open] summary::after { transform: rotate(0deg); }
.faq details > div { padding: 0 0 18px; max-width: 42rem; }
.faq details > div p:last-child { margin-bottom: 0; }

/* callout card (Workbook block, price) */
.card { background: var(--card); border: 2px solid var(--ink); border-radius: var(--radius); box-shadow: 6px 6px 0 var(--drop); padding: clamp(22px, 4vw, 36px); }
.card > :last-child { margin-bottom: 0; }
.price-line { font-weight: 700; }

.segments { display: grid; gap: 18px; margin-top: 1.4rem; }
@media (min-width: 760px) { .segments { grid-template-columns: 1fr 1fr; gap: 22px; } }
.segment { background: var(--card); border: 1px solid var(--rule); border-left: 5px solid var(--green); border-radius: 10px; padding: 20px 22px; scroll-margin-top: 16px; }
.segment:target { border-color: var(--ink); border-left-color: var(--green); box-shadow: 5px 5px 0 var(--drop); }
.segment h3 { margin-bottom: .4em; }
.segment p { margin: 0; }
.segment .tag { display: inline-block; font: 700 .75rem/1 var(--font-sans); letter-spacing: .08em; text-transform: uppercase; color: var(--green-dark); background: var(--tint-green); border-radius: 999px; padding: 5px 9px; margin-bottom: 10px; }

.facts { margin: 1.2rem 0; padding: 0; }
.facts div { display: grid; gap: 2px; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.facts div:first-child { border-top: 1px solid var(--rule); }
@media (min-width: 600px) { .facts div { grid-template-columns: 13rem 1fr; gap: 16px; } }
.facts dt { font-weight: 700; }
.facts dd { margin: 0; }

.divider { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: .9rem; letter-spacing: .06em; text-transform: uppercase; margin: 0 0 1.4rem; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--rule); }

.check-list, .x-list { list-style: none; padding: 0; margin: 0 0 1rem; }
.check-list li, .x-list li { position: relative; padding: 10px 0 10px 30px; border-bottom: 1px solid var(--rule); }
.check-list li::before { content: ""; position: absolute; left: 4px; top: 17px; width: 12px; height: 7px; border-left: 3px solid var(--green); border-bottom: 3px solid var(--green); transform: rotate(-45deg); }
.x-list li::before, .x-list li::after { content: ""; position: absolute; left: 3px; top: 21px; width: 15px; height: 3px; background: var(--mustard-small); transform: rotate(45deg); }
.x-list li::after { transform: rotate(-45deg); }

.ol-plain { padding-left: 1.3em; }
.ol-plain li { margin-bottom: .6em; padding-left: .2em; }

/* the sales page */
.wb-visual { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.wb-visual img { border: 2px solid var(--ink); border-radius: 6px; box-shadow: 6px 6px 0 var(--drop); background: #fff; }
.wb-visual img + img { margin-top: 36px; }
.wb-visual figcaption { grid-column: 1 / -1; font-size: .9rem; color: var(--muted); margin-top: 6px; }
.months { width: 100%; border-collapse: collapse; margin-top: 1.4rem; }
.months th, .months td { text-align: left; vertical-align: top; padding: 14px 12px; border-bottom: 1px solid var(--rule); }
.months thead th { font-size: .82rem; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); border-bottom: 2px solid var(--ink); }
.months td:first-child { font: 800 1.15rem/1.2 var(--font-display); color: var(--green); width: 4.5rem; }
.months td:nth-child(2) { font-weight: 700; width: 15rem; }
@media (max-width: 719px) {
  .months thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .months, .months tbody, .months td { display: block; width: auto; }
  .months tr { padding: 14px 0; border-bottom: 1px solid var(--rule); display: grid; grid-template-columns: 2.6rem 1fr; column-gap: 8px; }
  .months td { border: 0; padding: 0; }
  .months td:first-child { grid-row: 1 / 3; width: auto; }
  .months td:nth-child(2) { width: auto; margin-bottom: 2px; }
}
.price-big { font: 800 clamp(2.6rem, 2rem + 3vw, 3.6rem)/1 var(--font-display); color: var(--green-dark); margin: 0 0 .4rem; }

/* host images */
.page-head { display: grid; gap: 20px; align-items: end; }
@media (min-width: 760px) { .page-head { grid-template-columns: 1fr auto; gap: 40px; } }
.page-head .host { height: 200px; width: auto; }
@media (min-width: 760px) { .page-head .host { height: 280px; } }
.aside-host { display: grid; gap: 24px; align-items: end; }
.aside-host .host { height: 180px; width: auto; }
@media (min-width: 820px) { .aside-host { grid-template-columns: auto 1fr; gap: 36px; } .aside-host .host { height: 260px; } }

/* legal pages */
.legal h1 { font-size: clamp(1.9rem, 1.4rem + 2vw, 2.6rem); }
.legal h2 { font-size: 1.4rem; margin-top: 2.2rem; }
.legal h3 { margin-top: 1.6rem; }
.legal li { margin-bottom: .45em; }
.table-scroll { overflow-x: auto; margin: 0 0 1.2rem; border: 1px solid var(--rule); border-radius: 10px; background: var(--card); }
.legal table { border-collapse: collapse; width: 100%; min-width: 40rem; font-size: .94rem; }
.legal th, .legal td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--rule); }
.legal thead th { background: var(--shade); }

/* footer */
.site-footer { border-top: 1px solid var(--rule); padding: 36px 0 44px; font-size: .92rem; color: var(--muted); }
.site-footer p { margin: 0 0 .7rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0 0 1rem; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.site-footer a { color: var(--ink); }
.footer-tag { color: var(--ink); font-weight: 700; }
.site-footer .footer-line { color: var(--ink); font-size: 1rem; margin-top: 1rem; }

/* the launch price (only on /workbook/ and the two Planner thank-you pages, never on / or /planner/):
   the launch line, the countdown, the fixed launch bar, the exit-intent dialog and the slide-in card.
   Fixed positions and reserved space, so neither the timer nor the bar moves the page. */
.launch-line { font-weight: 600; background: var(--tint-green); border-left: 4px solid var(--green); border-radius: 6px; padding: 8px 12px; max-width: 34rem; }
.countdown { font-variant-numeric: tabular-nums; white-space: nowrap; }
.countdown.is-pending { visibility: hidden; }
.cd-unit b { display: inline-block; min-width: 2ch; text-align: right; font-weight: 800; }
.cd-label { margin-right: .15em; }

body.has-launch-bar { padding-bottom: 72px; }
.launch-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--ink); color: #fff; font-size: .95rem; }
.launch-bar-row { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; min-height: 64px; padding-top: 8px; padding-bottom: 8px; padding-right: 52px; }
.lb-text { margin: 0; flex: 1 1 auto; }
.launch-bar .countdown b { color: var(--mustard); }
.btn-bar { min-height: 44px; padding: 8px 16px; font-size: .95rem; border-color: #fff; box-shadow: none; }
.btn-bar:active { transform: none; box-shadow: none; }
.pop-close {
  position: absolute; top: 8px; right: 8px; width: 44px; height: 44px; padding: 0;
  font: 400 1.7rem/1 var(--font-sans); color: inherit; background: transparent; border: 0; border-radius: 8px; cursor: pointer;
}
.pop-close:hover { background: var(--shade); }
.lb-close { top: 50%; right: 4px; transform: translateY(-50%); }
.lb-close:hover { background: #2C363D; }
@media (max-width: 639px) {
  body.has-launch-bar { padding-bottom: 104px; }
  .launch-bar-row { gap: 4px 10px; padding-right: var(--gutter); }
  .lb-text { flex-basis: 100%; padding-right: 40px; font-size: .9rem; }
  .lb-time { display: none; }
  .launch-bar .countdown { font-size: .88rem; }
  .launch-bar .btn-bar { margin-left: auto; min-height: 40px; padding: 6px 14px; }
  .lb-close { top: 2px; right: 6px; transform: none; width: 40px; height: 40px; }
}

.pop-modal {
  width: min(30rem, calc(100% - 32px)); max-height: calc(100% - 32px); overflow: auto; padding: 0;
  color: var(--ink); background: var(--card); border: 2px solid var(--ink); border-radius: var(--radius); box-shadow: 8px 8px 0 var(--drop);
}
.pop-modal::backdrop { background: rgba(26, 34, 40, .55); }
.pop-inner { position: relative; padding: 28px 24px 22px; }
.pop-inner:focus { outline: none; }
.pop-h { font-size: 1.45rem; margin-right: 40px; }
.pop-count { font-weight: 700; color: var(--green-dark); }
.pop-list li { padding: 7px 0 7px 30px; }
.pop-list li::before { top: 14px; }
.pop-btn { width: 100%; }
.pop-modal .under-btn { text-align: center; margin-bottom: 0; }

.pop-slide {
  position: fixed; right: 16px; bottom: 16px; z-index: 31; width: min(22rem, calc(100% - 32px));
  padding: 20px 20px 14px; background: var(--card); border: 2px solid var(--ink); border-radius: var(--radius); box-shadow: 6px 6px 0 var(--drop);
}
.pop-slide[hidden] { display: none; }
.pop-slide .pop-h { font-size: 1.15rem; }
.pop-slide p { margin-bottom: .7em; font-size: .95rem; }
.pop-slide .pop-more { margin: .7em 0 0; text-align: center; }
body.has-launch-bar .pop-slide { bottom: 84px; }
@media (max-width: 639px) { body.has-launch-bar .pop-slide { bottom: 116px; } }

@media (prefers-reduced-motion: no-preference) {
  .pop-slide { opacity: 0; transform: translateY(14px); transition: opacity .25s ease, transform .25s cubic-bezier(.16, 1, .3, 1); }
  .pop-modal { opacity: 0; transform: translateY(10px); transition: opacity .2s ease, transform .2s cubic-bezier(.16, 1, .3, 1); }
  .pop-slide.is-in, .pop-modal.is-in { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .cd-sec { display: none; }
}

@media (prefers-reduced-motion: no-preference) {
  .planner-figure .sheet { animation: rise .6s cubic-bezier(.16, 1, .3, 1) both; }
  @keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
@media print {
  .site-header, .setup-bar, .optin, .btn, .launch-bar, .pop { display: none !important; }
  body { background: #fff; }
}
