:root {
  --bg: #f7f5ef; --card: #ffffff; --ink: #23201c; --muted: #6a645b; --line: #e3ddd0;
  --accent: #0f6e6e; --accent-ink: #ffffff; --soft: #dff0ee;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.55 ui-rounded, "Avenir Next", "Segoe UI", system-ui, sans-serif; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); }
main { max-width: 1040px; margin: 0 auto; padding: 0 16px 40px; }
.top { max-width: 1040px; margin: 0 auto; padding: 14px 16px; display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; justify-content: space-between; }
.brand { font-weight: 800; font-size: 20px; color: var(--ink); text-decoration: none; }
.brand::before { content: "✂️ "; }
.top nav { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 15px; }
.top nav a { color: var(--muted); text-decoration: none; }
.top nav a:hover { color: var(--accent); }
h1 { font-size: clamp(27px, 5vw, 40px); line-height: 1.15; margin: 18px 0 10px; text-wrap: balance; }
h2 { font-size: 24px; line-height: 1.25; margin: 0 0 10px; }
h3 { font-size: 19px; margin: 18px 0 6px; }
section { margin: 36px 0; }
.lede { font-size: 19px; color: var(--muted); max-width: 46em; margin: 0; }
.fine { font-size: 14px; color: var(--muted); }
.crumb { font-size: 14px; color: var(--muted); margin-top: 8px; }
.crumb a { color: var(--muted); }

button, .btn { font: inherit; font-weight: 700; cursor: pointer; border: 2px solid var(--accent); border-radius: 12px; padding: 12px 18px; background: var(--accent); color: var(--accent-ink); text-decoration: none; display: inline-block; }
button:hover, .btn:hover { filter: brightness(1.08); }
button.second, .btn.second { background: #fff; color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { background: #fff; color: var(--ink); font-weight: 600; font-size: 15px; padding: 8px 13px; border-radius: 999px; border: 2px solid var(--line); }
.chip.on { background: var(--soft); border-color: var(--accent); color: #0a4f4f; }

/* the tool: controls on the left, the sheet on the right; stacked on a phone */
.maker { display: grid; grid-template-columns: minmax(260px, 360px) minmax(0, 1fr); gap: 24px; align-items: start; background: var(--card); border: 2px solid var(--line); border-radius: 18px; padding: 20px; margin-top: 22px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 700; margin-bottom: 6px; }
.field input { width: 100%; font: inherit; padding: 12px 13px; border: 2px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); }
.field input:focus { outline: 3px solid var(--soft); border-color: var(--accent); }
.field .fine { margin: 6px 0 0; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0 10px; }
.sheet { display: grid; gap: 16px; justify-items: center; }
.sheet-page { width: 100%; max-width: 560px; height: auto; border: 1px solid #cfc8ba; box-shadow: 0 6px 22px rgba(60, 50, 30, .16); background: #fff; }
.sheet-page.land { max-width: 680px; }
@media (max-width: 760px) {
  .maker { grid-template-columns: minmax(0, 1fr); padding: 16px; }
}

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; margin: 14px 0; }
.card { background: var(--card); border: 2px solid var(--line); border-radius: 16px; padding: 12px; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; gap: 4px; }
.card:hover { border-color: var(--accent); }
.card img { width: 100%; height: 190px; object-fit: contain; margin: 0 auto 6px; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.card-t { font-weight: 800; line-height: 1.25; }
.card-d { font-size: 14px; color: var(--muted); line-height: 1.35; }
.steps { padding-left: 22px; }
.steps li { margin: 6px 0; }
.letter-text { white-space: pre-wrap; font: inherit; background: var(--card); border: 2px solid var(--line); border-radius: 14px; padding: 16px 18px; margin: 0; max-width: 46em; }
.notes-list { padding-left: 24px; max-width: 46em; }
.notes-list li { margin: 4px 0; }
.versions { padding-left: 20px; max-width: 50em; }
.versions li { margin: 8px 0; }
details { background: var(--card); border: 2px solid var(--line); border-radius: 12px; padding: 12px 16px; margin: 8px 0; }
summary { font-weight: 700; cursor: pointer; }
footer { max-width: 1040px; margin: 0 auto; padding: 24px 16px 48px; border-top: 2px solid var(--line); }

/* Printing: maker.js puts the sheets into .print-root and marks the body; everything else is switched off. */
.print-root { display: none; }
@media print {
  html, body { margin: 0; padding: 0; background: #fff; }
  body.print-mode > *:not(.print-root) { display: none !important; }
  .print-root { display: block; }
  .print-page { width: 100vw; height: 99vh; display: flex; align-items: center; justify-content: center; break-after: page; page-break-after: always; overflow: hidden; }
  .print-page:last-child { break-after: auto; page-break-after: auto; }
  .print-page img { width: 100%; height: 100%; object-fit: contain; }
}

/* tools/pcc_previews.py photographs the sheets through this */
body.shot { background: #fff; }
body.shot header, body.shot footer, body.shot main > *:not(.maker), body.shot .controls { display: none; }
body.shot main { max-width: none; padding: 0; }
body.shot .maker { display: block; border: 0; padding: 0; margin: 0; border-radius: 0; }
body.shot .sheet { gap: 0; justify-items: start; }
body.shot .sheet-page { max-width: none; width: 1275px; border: 0; box-shadow: none; }
body.shot .sheet-page.land { width: 1650px; }
