:root {
  --paper: #fbf8f1; --ink: #23262c; --muted: #5d6470; --accent: #27466e; --accent-2: #b04a32;
  --rule: #e3dac6; --panel: #f3ede0; --input: #fff;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --paper: #18191c; --ink: #ebe6db; --muted: #a8a99f; --accent: #9db8e0; --accent-2: #e08a72; --rule: #34332e; --panel: #24252a; --input: #202125; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 17px/1.55 var(--sans); }
a { color: var(--accent); text-underline-offset: 2px; }
h1, h2, h3 { font-family: var(--serif); line-height: 1.2; font-weight: 600; }
h1 { font-size: clamp(1.8rem, 4vw, 2.5rem); margin: .4em 0 .3em; }
h2 { font-size: 1.45rem; margin: 1.8em 0 .5em; padding-top: .4em; border-top: 1px solid var(--rule); }
h3 { font-size: 1.1rem; margin: 1.3em 0 .3em; }
main, .top, .foot { max-width: 980px; margin: 0 auto; padding: 0 16px; }
.top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; padding-top: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--rule); }
.brand { display: flex; align-items: center; gap: 10px; font: 600 1.25rem var(--serif); color: var(--ink); text-decoration: none; }
.brand svg { border-radius: 3px; }
nav.main { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: .95rem; }
nav.main a { color: var(--muted); text-decoration: none; }
nav.main a[aria-current="page"], nav.main a:hover { color: var(--ink); text-decoration: underline; }
.crumbs { list-style: none; padding: 0; margin: 14px 0 0; font-size: .85rem; color: var(--muted); display: flex; flex-wrap: wrap; }
.crumbs li + li::before { content: "›"; margin: 0 .5em; }
.lead { font-size: 1.12rem; color: var(--ink); max-width: 46em; }
.note { font-size: .9rem; color: var(--muted); }
.hero { display: grid; grid-template-columns: minmax(0, 320px) 1fr; gap: 24px; align-items: start; }
@media (max-width: 680px) { .hero { grid-template-columns: 1fr; } }
figure { margin: 0; }
figcaption { font-size: .85rem; color: var(--muted); margin-top: 6px; }
svg.blk { display: block; max-width: 100%; height: auto; background: #f3ede0; border-radius: 4px; }
.diagram svg.blk { box-shadow: 0 1px 0 var(--rule), 0 6px 18px rgba(0,0,0,.08); }
.legend { list-style: none; padding: 0; margin: 12px 0; }
.legend li { margin: 4px 0; }
.sw { display: inline-block; width: .95em; height: .95em; border: 1px solid rgba(0,0,0,.35); border-radius: 2px; vertical-align: -2px; margin-right: 6px; }
form.calc { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: end; background: var(--panel); border: 1px solid var(--rule); border-radius: 6px; padding: 12px 14px; margin: 12px 0; }
form.calc label { display: flex; flex-direction: column; gap: 3px; font-size: .85rem; color: var(--muted); }
form.calc label:has(input[type="checkbox"]) { flex-direction: row; align-items: center; gap: 6px; color: var(--ink); }
input, select, button { font: inherit; font-size: 1rem; color: var(--ink); background: var(--input); border: 1px solid #b9b2a2; border-radius: 4px; padding: 6px 8px; }
input[inputmode="decimal"] { width: 6.5em; }
input[type="number"] { width: 5.5em; }
input:disabled, select:disabled, button:disabled { opacity: .55; }
button { background: var(--accent); color: #fff; border-color: var(--accent); cursor: pointer; }
table { border-collapse: collapse; width: 100%; margin: 10px 0; font-size: .95rem; }
th, td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--rule); vertical-align: top; }
thead th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); border-bottom: 2px solid var(--rule); }
tbody th { font-weight: 600; }
th small { display: block; font-weight: 400; color: var(--muted); font-size: .8rem; }
td.n { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 600; }
.flag { font-size: .75rem; color: var(--accent-2); border: 1px solid currentColor; border-radius: 3px; padding: 0 4px; margin-left: 4px; white-space: nowrap; }
@media (max-width: 640px) { table { display: block; overflow-x: auto; white-space: nowrap; } td, th { white-space: normal; min-width: 7em; } }
.quilt-size, .answer { font-size: 1.05rem; }
.asm { display: grid; grid-template-columns: minmax(0, 320px) 1fr; gap: 24px; align-items: start; }
@media (max-width: 680px) { .asm { grid-template-columns: 1fr; } }
ol li, ul.tips li { margin: 6px 0; }
ul.grid { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 16px; }
ul.grid a { display: flex; flex-direction: column; align-items: center; gap: 6px; text-decoration: none; color: var(--ink); font-size: .9rem; text-align: center; }
ul.grid a:hover span { text-decoration: underline; }
ul.tools { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
ul.tools a { display: block; padding: 12px 14px; border: 1px solid var(--rule); border-radius: 6px; text-decoration: none; color: var(--ink); background: var(--panel); }
ul.tools b { display: block; color: var(--accent); }
ul.tools span { font-size: .9rem; color: var(--muted); }
ul.clean li { margin: 6px 0; }
.center { text-align: center; }
svg.fig { max-width: 100%; height: auto; color: var(--ink); }
.foot { margin-top: 48px; padding-top: 16px; padding-bottom: 32px; border-top: 1px solid var(--rule); font-size: .85rem; color: var(--muted); }
.tpl-sheet { display: none; }
@media print {
  body.printing-tpl > *:not(main), body.printing-tpl main > *, body.printing-tpl article > *:not(section), body.printing-tpl section > *:not(.tpl-sheet) { display: none !important; }
  body.printing-tpl article, body.printing-tpl section:has(.tpl-sheet) { display: block !important; }
  body.printing-tpl .tpl-sheet { display: block !important; }
  body.printing-tpl { background: #fff; color: #000; }
  .tpl-head { font: 10pt var(--sans); margin: 0 0 8pt; }
  .tpl-item { display: inline-block; margin: 0 8pt 8pt 0; break-inside: avoid; vertical-align: top; }
  @page { margin: 0.4in; }
}
ul.cutlist { list-style: none; margin: 0; padding: 0; }
ul.cutlist li { margin: 0 0 6px; }
ul.cutlist small { display: block; color: var(--muted); font-size: .82rem; }
table.cuts { display: table; white-space: normal; }
table.cuts th[scope="row"] { width: 34%; }
form.calc .u { display: flex; align-items: center; gap: 6px; color: var(--ink); }
