/* Sheetwise printables. Colours live in the two :root blocks; the printed sheet is always black on white. */
:root { --bg:#f6f3ec; --card:#fffdf8; --ink:#1d2433; --mute:#5a6273; --line:#e2dccf; --field:#ffffff; --field-line:#9a9384;
  --accent:#b8431f; --accent-strong:#963316; --on-accent:#fff; --link:#a63c1b; --soft:#f6e3d8; --desk:#e7e1d4; --ring:rgba(184,67,31,.25);
  --r:14px; color-scheme: light dark; }
@media (prefers-color-scheme: dark) { :root { --bg:#14161c; --card:#1c1f27; --ink:#e9e6df; --mute:#a5a9b4; --line:#2e323d; --field:#14161c; --field-line:#6b7080;
  --accent:#f08a5d; --accent-strong:#f6a47f; --on-accent:#1b0f09; --link:#f39a72; --soft:#3a251c; --desk:#262a33; --ring:rgba(240,138,93,.3); } }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; background: var(--bg); color: var(--ink);
  min-height: 100vh; display: flex; flex-direction: column; }
main { width: 100%; max-width: 1100px; margin: 0 auto; padding: 18px 16px 40px; flex: 1; }
a { color: var(--link); text-underline-offset: 2px; }
a:hover { color: var(--accent-strong); }
h1 { font-size: clamp(1.6rem, 5vw, 2.3rem); line-height: 1.15; margin: 0 0 6px; letter-spacing: -.02em; }
h2 { font-size: 1.25rem; line-height: 1.3; margin: 28px 0 8px; }
h3 { font-size: 1.04rem; margin: 18px 0 4px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--card); padding: 8px 12px; z-index: 20; }
.skip:focus { left: 8px; }
.lead { color: var(--mute); font-size: 1.06rem; margin: 0 0 18px; max-width: 46em; }

/* header / footer */
.site-head { border-bottom: 1px solid var(--line); background: var(--card); }
.site-head .wrap, .site-foot .wrap { max-width: 1100px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 6px 14px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.1rem; color: var(--ink); text-decoration: none; letter-spacing: -.01em; }
.brand svg { width: 30px; height: 30px; }
.nav { display: flex; gap: 2px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.nav a { white-space: nowrap; padding: 6px 10px; border-radius: 8px; color: var(--mute); text-decoration: none; font-weight: 600; font-size: .93rem; }
.nav a:hover, .nav a[aria-current] { color: var(--ink); background: var(--soft); }
.nav a.lang { border: 1px solid var(--line); }
@media (max-width: 720px) { .nav { width: calc(100% + 32px); margin: 0 -16px; padding: 0 10px; } }
.site-foot { border-top: 1px solid var(--line); background: var(--card); color: var(--mute); font-size: .9rem; }
.site-foot .wrap { padding: 20px 16px 26px; justify-content: space-between; }
.site-foot a { color: var(--mute); }
.site-foot p { margin: 0; }

.crumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 2px 6px; padding: 0; margin: 0 0 12px; font-size: .88rem; color: var(--mute); }
.crumb li + li::before { content: "/"; margin-right: 6px; opacity: .6; }
.crumb a { color: var(--mute); }

/* generator: options + live preview */
.gen { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; align-items: start; }
@media (min-width: 900px) { .gen { grid-template-columns: 300px minmax(0, 1fr); } .controls { position: sticky; top: 12px; } }
.controls { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.controls fieldset { border: 0; padding: 0; margin: 0 0 12px; }
.controls legend { font-weight: 700; font-size: .9rem; padding: 0; margin-bottom: 4px; }
.controls label { display: block; font-weight: 600; font-size: .9rem; margin: 10px 0 4px; }
.controls .chk { display: flex; gap: 8px; align-items: center; font-weight: 500; margin: 8px 0; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.seg label { margin: 0; font-weight: 500; display: flex; gap: 6px; align-items: center; padding: 8px 10px; border: 1.5px solid var(--line); border-radius: 10px; cursor: pointer; min-height: 44px; }
.seg label:has(input:checked) { border-color: var(--accent); background: var(--soft); }
select, input[type=text], input[type=date], input[type=number] { width: 100%; min-height: 44px; padding: 8px 10px; font: inherit; color: var(--ink); background: var(--field);
  border: 1.5px solid var(--field-line); border-radius: 10px; }
select:focus, input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--ring); }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: 18px; height: 18px; margin: 0; }
.btn { display: flex; width: 100%; justify-content: center; align-items: center; gap: 8px; margin-top: 14px; min-height: 48px; padding: 10px 16px; font: inherit; font-weight: 700;
  color: var(--on-accent); background: var(--accent); border: 0; border-radius: 12px; cursor: pointer; }
.btn:hover { background: var(--accent-strong); }
.btn svg { width: 20px; height: 20px; }
.hint { color: var(--mute); font-size: .85rem; margin: 8px 0 0; }
.preview { background: var(--desk); border-radius: var(--r); padding: 0; overflow: hidden; position: relative; min-height: 200px; }
.preview::after { content: attr(data-label); position: absolute; right: 10px; bottom: 8px; font-size: .75rem; color: var(--mute); }

/* the printable sheet itself: real millimetres, scaled on screen by ui.js */
.sheet { background: #fff; color: #000; transform-origin: 0 0; box-shadow: 0 2px 14px rgba(0,0,0,.18); overflow: hidden; width: 210mm; height: 296.5mm;
  font-family: "Segoe UI", system-ui, Arial, sans-serif; display: flex; flex-direction: column; padding: 12mm; line-height: 1.2; }
.sheet:has(> svg) { padding: 0; }
.sheet > svg { display: block; flex: none; }
.sheet h2, .sheet h3, .sheet p { margin: 0; }
.cal-title { display: flex; justify-content: space-between; align-items: flex-end; border-bottom: .8mm solid #000; padding-bottom: 2mm; margin-bottom: 1mm; flex: none; }
.cal-title h2 { font-size: 28pt; font-weight: 800; letter-spacing: -.02em; line-height: 1; }
.cal-title h2 span { font-weight: 300; }
.cal-title p { font-size: 9pt; text-align: right; max-width: 55%; }
.mcal, .ycal, .hab, .todo { width: 100%; border-collapse: collapse; table-layout: fixed; }
.mcal th { font-size: 9pt; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; text-align: left; padding: 0 1.5mm; }
.mcal td { border: .25mm solid #000; vertical-align: top; padding: 1.2mm 1.5mm; overflow: hidden; }
.mcal td.x { border-color: #000; background: none; }
.mcal .n { font-size: 15pt; font-weight: 600; display: inline-block; line-height: 1; }
.mcal td.off .n { font-weight: 900; text-decoration: underline; text-underline-offset: .6mm; }
.mcal .l { float: right; font-size: 8pt; color: #333; }
.mcal .l1 { font-weight: 700; color: #000; }
.mcal .h { display: block; font-size: 6.5pt; line-height: 1.15; margin-top: .8mm; font-weight: 700; }
.mcal .h.obs { font-weight: 400; font-style: italic; }
.ygrid { display: grid; column-gap: 6mm; flex: none; margin-top: 3mm; }
.ycal caption { font-weight: 800; font-size: 11pt; text-align: left; height: 6mm; line-height: 6mm; }
.ycal th { font-size: 6pt; font-weight: 700; border-bottom: .3mm solid #000; }
.ycal td { text-align: center; font-size: 8pt; vertical-align: middle; padding: 0; line-height: 1.05; }
.ycal td .l { display: block; font-size: 4.6pt; color: #444; }
.ycal td.off .d { font-weight: 900; text-decoration: underline; }
.yhol { list-style: none; margin: 2mm 0 0; padding: 2mm 0 0; border-top: .3mm solid #000; font-size: 6.8pt; column-gap: 5mm; overflow: hidden; flex: none; }
.yhol li { break-inside: avoid; }
.pl-head { display: flex; justify-content: space-between; align-items: flex-end; border-bottom: .8mm solid #000; padding-bottom: 2mm; margin-bottom: 5mm; height: 18mm; flex: none; }
.pl-head h2 { font-size: 22pt; font-weight: 800; letter-spacing: -.01em; }
.pl-head p { font-size: 10pt; }
.pl-grid { flex: 1; display: grid; gap: 4mm; min-height: 0; }
.box { border: .3mm solid #000; border-radius: 2mm; padding: 2mm 3mm; display: flex; flex-direction: column; min-height: 0; }
.box h3 { font-size: 10pt; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; display: flex; justify-content: space-between; margin: 0 0 1mm; }
.box h3 span { font-weight: 400; }
.ln { display: block; flex: 1; border-bottom: .2mm solid #777; min-height: 5mm; }
.ln.ck { position: relative; padding-left: 6mm; }
.ln.ck::before { content: ""; position: absolute; left: 0; bottom: 1.2mm; width: 3.2mm; height: 3.2mm; border: .25mm solid #000; border-radius: .6mm; }
.pl-day { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 5mm; min-height: 0; }
.pl-day .col { display: flex; flex-direction: column; gap: 4mm; min-height: 0; }
.pl-day .col .box:first-child { flex: none; height: 32mm; }
.pl-day .grow { flex: 1; }
.sched .hr { flex: 1; display: flex; align-items: stretch; border-bottom: .2mm solid #777; }
.sched .hr b { width: 15mm; font-size: 8pt; font-weight: 600; padding-top: .6mm; border-right: .2mm solid #777; }
.sched .hr i { flex: 1; border-bottom: .15mm dotted #999; height: 50%; }
.hab th, .hab td { border: .2mm solid #000; text-align: center; padding: 0; }
.hab th { font-size: 6.5pt; font-weight: 700; height: 9mm; }
.hab th small { display: block; font-weight: 400; font-size: 5.5pt; }
.hab th:first-child { text-align: left; padding-left: 2mm; font-size: 9pt; }
.todo th { text-align: left; font-size: 9pt; text-transform: uppercase; letter-spacing: .05em; border-bottom: .5mm solid #000; padding: 0 2mm; vertical-align: bottom; }
.todo td { border-bottom: .2mm solid #777; padding: 0 2mm; }
.todo td + td { border-left: .2mm solid #ccc; }
.todo .c { width: 16mm; text-align: center; } .todo .p { width: 22mm; } .todo .due { width: 28mm; }
.box-ck { display: inline-block; width: 4mm; height: 4mm; border: .3mm solid #000; border-radius: .8mm; vertical-align: middle; }

/* content */
.ad-slot { margin: 22px auto; max-width: 728px; min-height: 90px; border: 1px dashed var(--line); border-radius: 10px; display: grid; place-items: center;
  color: var(--mute); font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; }
.info { max-width: 760px; }
.info ol, .info ul { padding-left: 1.3em; }
.info li { margin-bottom: 4px; }
.faq h3 { margin-top: 16px; }
.faq p { margin: 0 0 6px; }
.tbl { border-collapse: collapse; width: 100%; font-size: .95rem; margin: 8px 0 14px; }
.tbl th, .tbl td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); }
.tbl th { color: var(--mute); font-size: .85rem; }
.cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); padding: 0; margin: 0; list-style: none; }
.cards a { display: block; height: 100%; padding: 14px 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); color: var(--ink); text-decoration: none; }
.cards a:hover { border-color: var(--accent); }
.cards strong { display: block; }
.cards span { color: var(--mute); font-size: .9rem; }
.months { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 130px), 1fr)); list-style: none; padding: 0; }
.months a { display: block; padding: 9px 12px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; text-decoration: none; font-weight: 600; }
.pager { display: flex; justify-content: space-between; gap: 10px; margin: 12px 0; flex-wrap: wrap; }
.hero { padding: 22px 0 8px; }
.hero h1 { font-size: clamp(1.9rem, 6vw, 3rem); max-width: 16em; }
.src { font-size: .88rem; color: var(--mute); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* print: only the sheet, at true size, always black on white */
@media print {
  html, body { margin: 0 !important; padding: 0 !important; background: #fff !important; color: #000 !important; display: block !important; min-height: 0 !important; }
  body > *:not(main), main > *:not(.gen), .gen > *:not(.preview) { display: none !important; }
  main { padding: 0 !important; margin: 0 !important; max-width: none !important; }
  .gen { display: block !important; }
  .preview { height: auto !important; background: none !important; border-radius: 0 !important; overflow: visible !important; min-height: 0 !important; }
  .preview::after { content: none !important; }
  .sheet { transform: none !important; box-shadow: none !important; break-after: avoid; break-inside: avoid; }
  .ad-slot { display: none !important; }
}

/* layout fixes: grid items must be allowed to shrink below the sheet's true width; card lists have no bullet indent */
.gen > * { min-width: 0; }
.info .cards, .info .months { padding-left: 0; }
.home .info { max-width: none; }
