/* Habit tracker, the sheet. Landscape Letter by default, A4 under html.a4
   (the runtime swaps the @page rule). Up to twelve habits down the side,
   thirty-one days across, a box per day; the rows share the height so four
   habits get tall rows and twelve get shorter ones. Colors only through
   --t-* so a theme is a set of variables. 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 landscape; 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: 11in; height: 8.5in; padding: 0.5in 0.5in 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.16in;
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
  --line: color-mix(in srgb, var(--t-muted) 45%, transparent);
}
html.a4 .sheet { width: 297mm; height: 210mm; }

/* Header: the title at the left, the month and its length 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.1in; min-height: 0.66in; }
.titles { min-width: 0; flex: 1; }
.titles h1 { margin: 0; font: 500 26pt/1.2 "Fraunces", Georgia, serif; letter-spacing: -0.005em; color: var(--t-ink); white-space: nowrap; overflow: hidden; height: 1.2em; }
.when { flex: none; text-align: right; }
.when-month { display: block; font: 500 13pt/1.2 "Fraunces", Georgia, serif; color: var(--t-accent); white-space: nowrap; }
.when-count { display: block; font: 500 8pt/1.4 "Inter Tight", system-ui, sans-serif; letter-spacing: 0.12em; text-transform: uppercase; color: var(--t-muted); }

/* The grid: a header row of days, then a row per habit. Every row is the
   same flex shape, so the day boxes line up under the day numbers. */
.grid { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.row { display: flex; align-items: stretch; border-bottom: 0.5pt solid var(--line); }
.row.days { flex: none; height: 0.36in; border-bottom: 1pt solid var(--t-accent); }
.rows { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.rows .row { flex: 1 1 0; min-height: 0.3in; max-height: 0.62in; }
.hname { flex: none; width: 2.1in; display: flex; align-items: center; padding-right: 0.12in; font: 400 9.5pt/1.3 "Inter Tight", system-ui, sans-serif; color: var(--t-ink); white-space: nowrap; overflow: hidden; }
.label { font: 500 7.5pt/1 "Inter Tight", system-ui, sans-serif; letter-spacing: 0.12em; text-transform: uppercase; color: var(--t-muted); }
.hname.label { align-items: flex-end; padding-bottom: 4pt; }
.cells { flex: 1; min-width: 0; display: flex; }
.cells .c { flex: 1 1 0; min-width: 0; border-left: 0.5pt solid var(--line); display: flex; flex-direction: column; align-items: center; justify-content: flex-end; font-style: normal; }
.days .c { padding-bottom: 3pt; }
.days .n { font: 500 8pt/1 "Fraunces", Georgia, serif; color: var(--t-ink); }
.days .w { font: 500 5.5pt/1.3 "Inter Tight", system-ui, sans-serif; letter-spacing: 0.04em; color: var(--t-muted); margin-top: 1pt; }
.days .w.we { color: var(--t-accent); }
.tot { flex: none; width: 0.55in; border-left: 1pt solid var(--t-accent); display: flex; align-items: center; justify-content: center; }
.tot.label { align-items: flex-end; padding-bottom: 4pt; }

/* Notes: a short ruled strip under the grid. */
.notes { flex: none; height: 1.0in; display: flex; flex-direction: column; }
.notes .label { flex: none; padding-bottom: 4pt; border-bottom: 1pt solid var(--t-accent); }
.notes .rules { flex: 1; display: flex; flex-direction: column; }
.notes .rules i { display: block; flex: 1; 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.5in; right: 0.5in; 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; }
