/* Monthly budget, the sheet. Portrait Letter by default, A4 under html.a4
   (the runtime swaps the @page rule). Income and expenses as two tables with
   the planned figure typed in and a blank box beside it for the actual, the
   summary in the corner where the eye lands, every total from the compute
   hook. Colors only through --t-*; static font instances only. */

@font-face { font-family: "Fraunces"; src: url("/assets/fonts/fraunces-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: block; }
@font-face { font-family: "Inter Tight"; src: url("/assets/fonts/intertight-400.woff2") format("woff2"); font-weight: 400; font-display: block; }
@font-face { font-family: "Inter Tight"; src: url("/assets/fonts/intertight-500.woff2") format("woff2"); font-weight: 500; font-display: block; }

@page { size: Letter; margin: 0; }

:root { --t-paper: #ffffff; --t-ink: #1a1a1a; --t-accent: #8f2d2d; --t-muted: #6b7078; }
html, body { margin: 0; padding: 0; background: #fff; }
[hidden] { display: none !important; }

.sheet {
  width: 8.5in; height: 11in; padding: 0.5in 0.55in 0.6in; box-sizing: border-box; position: relative; overflow: hidden;
  background: var(--t-paper); color: var(--t-ink);
  font: 400 10pt/1.4 "Inter Tight", system-ui, sans-serif;
  display: flex; flex-direction: column; gap: 0.2in;
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
  --line: color-mix(in srgb, var(--t-muted) 45%, transparent);
}
html.a4 .sheet { width: 210mm; height: 297mm; }
.num { font-variant-numeric: tabular-nums; }

/* Header: the title and the month at the left, the summary at the right. */
.head { flex: none; display: flex; justify-content: space-between; align-items: flex-end; gap: 0.3in; border-bottom: 1.5pt solid var(--t-accent); padding-bottom: 0.12in; }
.titles { min-width: 0; flex: 1; }
.titles h1 { margin: 0; font: 500 21pt/1.2 "Fraunces", Georgia, serif; letter-spacing: -0.005em; color: var(--t-ink); white-space: nowrap; overflow: hidden; height: 1.2em; }
.titles .month { margin: 4pt 0 0; font: 500 11pt/1.3 "Fraunces", Georgia, serif; color: var(--t-accent); white-space: nowrap; overflow: hidden; height: 1.3em; }
.summary { flex: none; width: 2.6in; }
.srow { display: flex; justify-content: space-between; align-items: baseline; gap: 0.2in; font-size: 9.5pt; padding: 2pt 0; border-bottom: 0.5pt solid var(--line); }
.srow span { color: var(--t-muted); }
.srow b { font-weight: 400; color: var(--t-ink); }
.srow.total { border-bottom: 0; border-top: 1pt solid var(--t-accent); margin-top: 2pt; padding-top: 5pt; }
.srow.total span { color: var(--t-ink); font-weight: 500; }
.srow.total b { font: 500 14pt/1.2 "Fraunces", Georgia, serif; color: var(--t-accent); }

/* The two tables: name, planned, a box for the actual, the share of income. */
.table { flex: none; display: flex; flex-direction: column; }
.trow { display: flex; align-items: center; gap: 0.12in; height: 0.27in; border-bottom: 0.5pt solid var(--t-muted); border-bottom-color: var(--line); }
.trow.th { height: 0.24in; border-bottom: 1pt solid var(--t-accent); font-size: 7.5pt; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--t-muted); }
.trow.th .name { font: inherit; color: inherit; }
.trow.tf { height: 0.3in; border-bottom: 0; border-top: 1pt solid var(--t-accent); font-weight: 500; }
.name { flex: 1; min-width: 0; font-size: 10pt; white-space: nowrap; overflow: hidden; }
.amt { flex: none; width: 1.15in; text-align: right; font-size: 10pt; white-space: nowrap; overflow: hidden; }
.amt.box { height: 0.2in; border: 0.5pt solid var(--line); box-sizing: border-box; }
.trow.th .amt.box, .trow.tf .amt.box { border: 0; }
.trow.tf .amt.box { border-bottom: 0.5pt solid var(--line); }
.pct { flex: none; width: 0.7in; text-align: right; font-size: 9pt; color: var(--t-muted); }

/* Notes: a short ruled strip; it takes what height is left. */
.notes { flex: 1; min-height: 0.7in; display: flex; flex-direction: column; }
.notes .label { flex: none; font: 500 7.5pt/1 "Inter Tight", system-ui, sans-serif; letter-spacing: 0.12em; text-transform: uppercase; color: var(--t-muted); padding-bottom: 4pt; border-bottom: 1pt solid var(--t-accent); }
/* Ten rules at a pen's pitch or looser; the ones past the strip's height are clipped, so the pitch never tightens. */
.notes .rules { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.notes .rules i { display: block; flex: 1; min-height: 0.3in; border-bottom: 0.5pt solid var(--line); }

/* The foot: the free version's credit line and the one-inch mark. */
.foot { position: absolute; left: 0.55in; right: 0.55in; bottom: 0.42in; font-size: 7.5pt; color: var(--t-muted); display: flex; justify-content: space-between; align-items: flex-end; }
.ruler { width: 1in; border-top: 0.5pt solid var(--t-muted); font-size: 6.5pt; color: var(--t-muted); text-align: center; line-height: 1.6; }
