:root {
  --ink: #17233b;
  --ink-2: #4a5872;
  --paper: #f5f7fa;
  --white: #ffffff;
  --rule: #d5dde8;
  --mark: #ffd93d;
  --teal: #0e7c86;
  --teal-dark: #0a5f67;
  --font-head: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --font-body: "Public Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}
img { max-width: 100%; display: block; }
a { color: var(--teal-dark); text-underline-offset: 3px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; }

h1, h2, h3 { font-family: var(--font-head); line-height: 1.15; letter-spacing: -0.01em; margin: 0 0 0.5em; }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 800; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 700; margin-top: 2.2em; }
h3 { font-size: 1.15rem; font-weight: 700; }
p { margin: 0 0 1em; }

.wrap { width: min(1120px, 100% - 40px); margin-inline: auto; }
.narrow { width: min(720px, 100% - 40px); margin-inline: auto; }

/* ---------- header / footer ---------- */
.site-header { background: var(--white); border-bottom: 1.5px solid var(--ink); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; flex-wrap: wrap; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-head); font-weight: 800; font-size: 1.35rem; color: var(--ink); text-decoration: none; }
.logo svg { width: 30px; height: 30px; }
.nav { display: flex; gap: 22px; flex-wrap: wrap; }
.nav a { color: var(--ink); text-decoration: none; font-weight: 600; font-size: 1rem; padding: 10px 2px; min-height: 44px; display: inline-flex; align-items: center; border-bottom: 3px solid transparent; }
.nav a:hover, .nav a[aria-current="page"] { border-bottom-color: var(--mark); }

.site-footer { margin-top: 80px; background: var(--ink); color: #dbe3f0; padding: 44px 0 36px; font-size: 0.95rem; }
.site-footer a { color: #fff; }
.site-footer .cols { display: grid; gap: 28px; grid-template-columns: 1.4fr 1fr 1fr; }
.site-footer h3 { color: #fff; font-size: 1rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.site-footer .fine { margin-top: 30px; padding-top: 18px; border-top: 1px solid #34425e; font-size: 0.85rem; color: #9fb0cc; }

/* ---------- hero ---------- */
.hero {
  background-color: var(--white);
  background-image:
    linear-gradient(var(--rule) 1px, transparent 1px),
    linear-gradient(90deg, var(--rule) 1px, transparent 1px);
  background-size: 28px 28px;
  border-bottom: 1.5px solid var(--ink);
  overflow: hidden;
}
.hero .wrap { display: grid; gap: 40px; padding: 56px 0 64px; align-items: center; grid-template-columns: 1fr; }
.hero h1 { max-width: 14ch; }
.hero p.lead { font-size: 1.2rem; max-width: 46ch; color: var(--ink-2); }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 24px; }
.hero-sheet {
  --s: 0.36;
  position: relative;
  width: calc(979px * var(--s));
  height: calc(701px * var(--s));
  transform: rotate(-3deg);
  justify-self: center;
  margin-right: 14px;
}
.hero-sheet::before {
  content: "";
  position: absolute;
  inset: 14px -14px -14px 14px;
  background: var(--mark);
  border: 1.5px solid var(--ink);
}
.hero-sheet .sheet {
  position: absolute; left: 0; top: 0;
  transform: scale(var(--s)); transform-origin: top left;
  pointer-events: none;
}
@media (min-width: 560px) { .hero-sheet { --s: 0.5; } }
@media (min-width: 900px) {
  .hero .wrap { grid-template-columns: 1fr auto; gap: 56px; }
  .hero-sheet { --s: 0.56; }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-block; cursor: pointer;
  font: 700 1rem/1 var(--font-body);
  color: var(--white); background: var(--ink);
  border: 1.5px solid var(--ink); padding: 15px 22px;
  text-decoration: none;
}
.btn:hover { background: var(--teal-dark); border-color: var(--teal-dark); color: var(--white); }
.btn.ghost { background: var(--white); color: var(--ink); }
.btn.ghost:hover { background: var(--mark); border-color: var(--ink); color: var(--ink); }

/* ---------- printable index ---------- */
.section-title { margin-top: 56px; }
.grid { display: grid; gap: 26px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); margin-top: 22px; }
.card { display: block; background: var(--white); border: 1.5px solid var(--ink); color: var(--ink); text-decoration: none; transition: transform 0.12s, box-shadow 0.12s; }
.card:hover { transform: translate(-3px, -3px); box-shadow: 6px 6px 0 var(--mark); color: var(--ink); }
.card img { width: 100%; height: auto; aspect-ratio: 2 / 3; object-fit: cover; border-bottom: 1.5px solid var(--ink); background: var(--paper); }
.card .meta { padding: 14px 16px 18px; }
.card h3 { margin: 0 0 4px; }
.card p { margin: 0; font-size: 0.93rem; color: var(--ink-2); }

.steps { counter-reset: step; list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 18px; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 44px 1fr; gap: 14px; align-items: start; }
.steps li::before { content: counter(step); display: grid; place-items: center; width: 44px; height: 44px; background: var(--mark); border: 1.5px solid var(--ink); font: 800 1.2rem var(--font-head); }
.steps strong { display: block; }

/* ---------- printable page ---------- */
.crumbs { font-size: 0.9rem; padding: 18px 0 0; color: var(--ink-2); }
.crumbs a { color: var(--ink-2); }
.page-head { padding: 12px 0 8px; }
.page-head p.lead { font-size: 1.15rem; color: var(--ink-2); max-width: 62ch; }
.toolbar { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; margin: 22px 0 26px; }
.toolbar label { font-weight: 600; font-size: 0.95rem; display: flex; align-items: center; gap: 8px; }
.toolbar select { font: inherit; padding: 12px 12px; border: 1.5px solid var(--ink); background: var(--white); color: var(--ink); }
.hint { font-size: 0.9rem; color: var(--ink-2); margin: -10px 0 22px; }

.ad-slot { margin: 26px auto; text-align: center; overflow: hidden; }
.ad-slot:empty { display: none; }
.ad-rail { position: fixed; top: 140px; margin: 0; z-index: 5; width: 160px; }
.ad-rail-l { left: 12px; }
.ad-rail-r { right: 12px; }
.sponsored { font-size: 0.8rem; opacity: 0.8; margin-top: 10px; }

.sheet-wrap { width: 100%; overflow: hidden; margin-bottom: 8px; }
.prose { max-width: 68ch; }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: 0.5em; }
details { border-top: 1.5px solid var(--ink); padding: 4px 0 10px; }
details:last-of-type { border-bottom: 1.5px solid var(--ink); }
summary { cursor: pointer; font-weight: 700; font-family: var(--font-head); font-size: 1.1rem; min-height: 44px; display: flex; align-items: center; padding: 6px 0; }
details p { margin: 10px 0 0; }

/* ---------- the printable sheet itself ---------- */
.sheet {
  --line: #c4cfdc;
  --sheet-ink: #17233b;
  background: #fff;
  color: var(--sheet-ink);
  border: 1.5px solid var(--sheet-ink);
  padding: 0.28in 0.3in;
  display: flex; flex-direction: column;
  font-family: var(--font-body);
  font-size: 12px; line-height: 1.2;
  transform-origin: top left;
}
.sheet.portrait { width: 7.7in; height: 9.9in; }
.sheet.landscape { width: 10.2in; height: 7.2in; }
.sheet h2 { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -0.01em; }
.sheet h3 { margin: 0; font-size: 12.5px; font-weight: 800; }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; padding-bottom: 8px; margin-bottom: 8px; border-bottom: 3px solid var(--sheet-ink); }
.fields { display: flex; gap: 18px; flex-wrap: wrap; justify-content: flex-end; }
.field { display: inline-flex; align-items: flex-end; gap: 6px; font-size: 12px; }
.field b { font-weight: 700; white-space: nowrap; }
.fill { display: inline-block; min-width: 110px; border-bottom: 1.5px solid var(--sheet-ink); min-height: 16px; padding: 0 3px; outline: none; }
.fill:focus { background: #fff6bf; }
.sheet-foot { margin-top: 6px; font-size: 10px; color: #7c8aa3; text-align: right; }

.box { border: 1.5px solid var(--sheet-ink); padding: 6px 8px; display: flex; flex-direction: column; min-height: 0; }
.box h3 { padding-bottom: 4px; border-bottom: 1px solid var(--sheet-ink); margin-bottom: 2px; }
.lines {
  flex: 1;
  background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 25px, var(--line) 25px, var(--line) 26px);
}
.rows { display: flex; flex-direction: column; flex: 1; }
.row { flex: 1; min-height: 14px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 7px; }
.cb { width: 12px; height: 12px; border: 1.5px solid var(--sheet-ink); flex: none; }
.cb.lg { width: 16px; height: 16px; }

.wk-grid { flex: 1; display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: 1fr 1fr; gap: 8px; min-height: 0; }

.bud-cols { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; min-height: 0; }
.bud-col { display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.bud-sec { display: flex; flex-direction: column; min-height: 0; }
.bud-sec h3 { background: var(--sheet-ink); color: #fff; padding: 4px 8px; }
.bud-sec.grow { flex: none; }
.bt { display: grid; border-bottom: 1px solid var(--line); flex: none; height: 34px; }
.bt.c3 { grid-template-columns: 1.6fr 1fr 1fr; }
.bt.c4 { grid-template-columns: 1.5fr 0.9fr 1fr 1fr; }
.bt span { border-left: 1px solid var(--line); padding: 2px 5px; }
.bt span:first-child { border-left: none; }
.bt.hd { flex: none; height: 22px; align-items: center; font-weight: 700; font-size: 10.5px; background: #eef2f7; }
.bud-sum { margin-top: 10px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.bud-sum div { border: 1.5px solid var(--sheet-ink); padding: 6px 8px; min-height: 46px; font-weight: 700; }

.split { flex: 1; display: grid; grid-template-columns: 1fr 190px; gap: 10px; min-height: 0; }
.meal { display: grid; grid-template-columns: 78px repeat(4, 1fr); grid-template-rows: 26px repeat(7, 1fr); border-top: 1.5px solid var(--sheet-ink); border-left: 1.5px solid var(--sheet-ink); min-height: 0; }
.meal > div { border-right: 1.5px solid var(--sheet-ink); border-bottom: 1.5px solid var(--sheet-ink); padding: 4px 6px; }
.meal .h { background: #eef2f7; font-weight: 800; display: flex; align-items: center; }
.meal .d { font-weight: 800; background: #eef2f7; display: flex; align-items: center; }

.habit { flex: 1; display: grid; grid-template-columns: 170px repeat(31, 1fr); grid-template-rows: 26px repeat(14, 1fr); border-top: 1.5px solid var(--sheet-ink); border-left: 1.5px solid var(--sheet-ink); min-height: 0; }
.habit > div { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.habit .h { background: #eef2f7; font-weight: 800; font-size: 9.5px; display: flex; align-items: center; justify-content: center; border-right: 1px solid var(--sheet-ink); border-bottom: 1.5px solid var(--sheet-ink); }
.habit .h.name { justify-content: flex-start; padding-left: 6px; font-size: 12px; }
.habit .n { border-right: 1.5px solid var(--sheet-ink); }

.cal { flex: 1; display: grid; grid-template-columns: repeat(7, 1fr); grid-template-rows: 26px repeat(6, 1fr); border-top: 1.5px solid var(--sheet-ink); border-left: 1.5px solid var(--sheet-ink); min-height: 0; }
.cal > div { border-right: 1.5px solid var(--sheet-ink); border-bottom: 1.5px solid var(--sheet-ink); }
.cal .h { background: #eef2f7; font-weight: 800; display: flex; align-items: center; justify-content: center; }

.two { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; min-height: 0; }
.col { display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.col .box { flex: 1; }
.col .box.tight { flex: none; }
.col .box .rows { margin-top: 2px; }
.big { font-size: 13px; }
.sched .row { font-size: 11px; color: #4a5872; }
.sched .row b { width: 38px; color: var(--sheet-ink); }

.clean { flex: 1; display: grid; grid-template-columns: 1fr repeat(7, 36px); grid-template-rows: 28px repeat(22, 1fr); border-top: 1.5px solid var(--sheet-ink); border-left: 1.5px solid var(--sheet-ink); min-height: 0; }
.clean > div { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; align-items: center; padding: 0 6px; }
.clean .h { background: #eef2f7; font-weight: 800; justify-content: center; border-right: 1px solid var(--sheet-ink); border-bottom: 1.5px solid var(--sheet-ink); }
.clean .h.name { justify-content: flex-start; }
.clean .t { font-size: 12px; border-right: 1.5px solid var(--sheet-ink); }
.clean .o { justify-content: center; }
.clean .o::after { content: ""; width: 11px; height: 11px; border: 1.5px solid var(--sheet-ink); border-radius: 50%; }

.groc { flex: 1; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: repeat(3, 1fr); gap: 10px; min-height: 0; }

/* ---------- responsive ---------- */
@media (max-width: 760px) {
  body { font-size: 16.5px; }
  .site-footer .cols { grid-template-columns: 1fr; }
  .toolbar .btn { width: 100%; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card { transition: none; }
}

/* ---------- printing: only the sheet comes out ---------- */
@media print {
  html, body { background: #fff !important; }
  .site-header, .site-footer, .crumbs, .page-head, .toolbar, .hint, .ad-slot, .page-content, .no-print { display: none !important; }
  .wrap { width: 100% !important; margin: 0 !important; }
  .sheet-wrap { height: auto !important; overflow: visible !important; margin: 0 !important; }
  .sheet { transform: none !important; width: 100% !important; box-shadow: none !important; }
  .sheet.portrait { height: 9.9in !important; }
  .sheet.landscape { height: 7.2in !important; }
  .fill:focus { background: none; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
