/*
 * base.css — the "Almanac" direction. DESIGN.md Sec 12.7.
 *
 * A well-made farmer's almanac, or the flyleaf of a family bible. Printed,
 * ruled, hand-filled, slightly imperfect, meant to be kept. The mortality
 * content lands harder because the surface is kind — the contrast between
 * "ur gonna die" and warm paper IS the brand.
 *
 * Explicitly NOT "Terminal": no ink-black ground, no acid green, no glowing
 * dot matrix, no blinking cursor. That look says side project, produces dread
 * rather than action, fails contrast for older eyes, and cannot be printed.
 * One borrowed element only: monospace tabular figures for ledger rows.
 */

@import url('./fonts/fonts.css');

:root {
  /* LIGHT ("paper") */
  --paper:    #F4EFE4;
  --paper-2:  #EAE3D5;
  --ink:      #1C1A17;
  --pencil:   #6E6A62;
  --rule:     #CFC7B6;
  --ember:    #9B2C22;   /* the one accent: current week, crisis link, stamps */
  --gilt:     #8A6A2F;   /* milestones and memorial pages only. Never a UI state. */
  /* An unspent week. A real token, not --rule at 40% opacity: opacity
   * composites against whatever is behind it, and in the print block it
   * resolved to #D6D6D6 on white — 1.45:1, which made the unspent half of a
   * paid poster effectively invisible. */
  --cell-empty: #DCD5C6;

  --grain-opacity: 0.02;

  /* The scale. Nine sizes, no others. */
  --t-11: 11px; --t-12: 12px; --t-14: 14px; --t-15: 15px; --t-17: 17px;
  --t-21: 21px; --t-28: 28px; --t-44: 44px; --t-180: 180px;

  --serif: 'Newsreader', 'Iowan Old Style', Palatino, 'Palatino Linotype', Georgia, serif;
  --sans:  'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono:  ui-monospace, 'SF Mono', 'Cascadia Mono', Menlo, Consolas, monospace;

  --measure: 34rem;      /* reading width */
  --gutter: 16px;        /* phone side gutter, never less */
}

/* DARK ("oil lamp" — not a terminal). Warm dark keeps the printed-object
 * claim intact at 11pm, and avoids the halation of #FFF on #000 for exactly
 * the older and visually impaired users this product attracts. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --paper: #141210; --paper-2: #1C1917; --ink: #E6DFD0; --pencil: #9A9183;
    --rule: #35302A; --ember: #C2553F; --gilt: #B98E46;
    --cell-empty: #2E2922;
    --grain-opacity: 0.03;
  }
}
:root[data-theme='dark'] {
  --paper: #141210; --paper-2: #1C1917; --ink: #E6DFD0; --pencil: #9A9183;
  --rule: #35302A; --ember: #C2553F; --gilt: #B98E46;
  --cell-empty: #2E2922;
  --grain-opacity: 0.03;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 var(--t-17)/1.6 var(--serif);
  font-optical-sizing: auto;
  padding: 0 var(--gutter);
  overflow-x: hidden;
}

/* One tiled grain, multiplied. No second texture, ever.
 *
 * Sec 12.7 specifies a 256x256 PNG under 8KB. This is procedural instead —
 * an inline feTurbulence tile, ~300 bytes, no binary asset to lose, and
 * stitchTiles keeps the repeat seamless. Same intent, one fewer file to
 * carry for forty years. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='256' height='256'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='256' height='256' filter='url(%23g)'/%3E%3C/svg%3E");
  background-size: 256px 256px;
  mix-blend-mode: multiply;
  opacity: var(--grain-opacity);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) body::before { mix-blend-mode: screen; }
}

main { position: relative; z-index: 2; max-width: var(--measure); margin: 0 auto; padding: 7vh 0 4rem; }
/* On a phone, vh is measured against the viewport WITH the browser chrome
 * showing, and it changes as the address bar hides on scroll — so a padding
 * in vh quietly re-lays-out the page under the reader's thumb. A fixed value
 * below the tablet breakpoint; the airy top margin is a desktop luxury. */
@media (max-width: 36rem) { main { padding-top: 2rem; } }

/* --- type ---------------------------------------------------------------- */

h1 { font: 400 var(--t-28)/1.25 var(--serif); margin: 0 0 1.25rem; letter-spacing: -0.01em; }
h2 { font: 500 var(--t-21)/1.3 var(--serif); margin: 2.5rem 0 0.75rem; }
h3 { font: 600 var(--t-15)/1.3 var(--sans); margin: 2rem 0 0.5rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--pencil); }
p { margin: 0 0 1.1rem; }
a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--ember); }
strong { font-weight: 600; }

.label {
  font: 500 var(--t-12)/1.2 var(--sans);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--pencil);
  display: block;
  margin-bottom: 0.5rem;
}
.meta { font: 400 var(--t-14)/1.5 var(--sans); color: var(--pencil); }
.small { font: 400 var(--t-14)/1.55 var(--sans); color: var(--pencil); }
.fineprint { font: 400 var(--t-12)/1.5 var(--sans); color: var(--pencil); }

/* --- the hero number ----------------------------------------------------- */
/* Stated, not shouted: weight 400, tight leading, tabular so it cannot jitter.
 * No ticking seconds counter anywhere — see Sec 5.8. */

/* Line-height 1, not 0.9: at this size a sub-1 leading pulls the glyph box
 * above the text box and the number collides with the label sitting over it. */
.hero {
  font: 400 clamp(var(--t-44), 13vw, 132px)/1 var(--serif);
  font-variant-numeric: tabular-nums lining-nums;
  letter-spacing: -0.02em;
  margin: 0 0 0.35rem;
  display: block;
}
.hero-unit {
  font: 400 var(--t-21)/1.35 var(--serif);
  color: var(--pencil);
  display: block;
  margin-bottom: 2.5rem;
  max-width: 24rem;
}

/* --- forms --------------------------------------------------------------- */

form { margin: 2rem 0; }
.field { margin: 0 0 1.5rem; }

input[type='number'], input[type='text'], input[type='email'], select {
  font: 400 var(--t-21)/1.3 var(--serif);
  color: var(--ink);
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 0.6rem 0.7rem;
  width: 100%;
  max-width: 16rem;
  font-variant-numeric: tabular-nums;
}
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--ember);
  outline-offset: 2px;
}

/* Date of birth: three boxes, in the order the label reads. */
.dob { border: 0; padding: 0; margin: 0 0 1.5rem; }
.dob-fields { display: flex; gap: 0.6rem; align-items: flex-end; }
.dob-fields span { display: flex; flex-direction: column; }
.dob-fields label {
  font: 400 var(--t-12)/1.2 var(--sans);
  color: var(--pencil);
  margin-bottom: 0.3rem;
}
.dob-fields input { width: 3.75rem; text-align: center; }
.dob-fields .year input { width: 5.5rem; }

/* Chips: the cadence question. Five seconds, and it is the number the user
 * will argue with, which is the point. */
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip {
  font: 500 var(--t-15)/1 var(--sans);
  background: var(--paper-2);
  border: 1px solid var(--rule);
  color: var(--ink);
  border-radius: 2px;
  padding: 0.65rem 0.9rem;
  cursor: pointer;
  min-height: 44px;       /* WCAG 2.5.8 target size */
  min-width: 44px;
}
.chip[aria-pressed='true'] { border-color: var(--ink); background: var(--ink); color: var(--paper); }

button, .button {
  font: 500 var(--t-15)/1 var(--sans);
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--ink);
  border-radius: 2px;
  padding: 0.85rem 1.1rem;
  min-height: 44px;
  cursor: pointer;
  display: inline-block;
  text-decoration: none;
}
button.secondary, .button.secondary { background: transparent; color: var(--ink); border-color: var(--rule); }
button[disabled] { opacity: 0.45; cursor: not-allowed; }

/* The one action that matters on /parents. Ember, because this is the only
 * place in the product where urgency is real and earned. */
.button.act { background: var(--ember); border-color: var(--ember); color: #FFF8EC; font-size: var(--t-17); }

/* --- panels, rules, stamps ---------------------------------------------- */

.panel { background: var(--paper-2); border: 1px solid var(--rule); border-radius: 2px; padding: 1.25rem; margin: 1.5rem 0; }
hr { border: 0; border-top: 1px solid var(--rule); margin: 2.5rem 0; }

/* The reading sits in its own typographic zone — set apart, attributed,
 * unparaphrased. Never with a lesson attached. */
.reading { font: 400 italic var(--t-17)/1.65 var(--serif); border-left: 2px solid var(--rule); padding-left: 1rem; margin: 1.5rem 0; }
.reading cite { display: block; font: 400 var(--t-12)/1.5 var(--sans); font-style: normal; color: var(--pencil); margin-top: 0.5rem; letter-spacing: 0.02em; }

/* The permanent hedge under any displayed figure. */
.hedge { font: 400 var(--t-14)/1.55 var(--sans); color: var(--pencil); max-width: 30rem; }

/* A development-only banner. Visible, ugly on purpose, impossible to ship by
 * accident without someone noticing. */
.unverified {
  position: relative; z-index: 3;
  background: var(--ember); color: #FFF8EC;
  font: 500 var(--t-14)/1.4 var(--sans);
  padding: 0.75rem var(--gutter);
  margin: 0 calc(-1 * var(--gutter)) 1.5rem;
}
.unverified code { font-family: var(--mono); font-size: var(--t-12); }

/* --- the weeks grid ------------------------------------------------------ */
/*
 * Lived weeks filled, remaining weeks a faint tint. Grouped in decades,
 * because 4,680 undifferentiated cells is a dither pattern and ten rows with a
 * number beside them is a chart you can find yourself in.
 *
 * Cells carry NO border. A 1px outline on an 8px cell puts as much ink in the
 * border as the fill, which is what turned the first version into noise.
 */

.life { margin: 2rem 0 2.5rem; max-width: 34rem; }
/* Past the reading measure the grid is allowed to be wider than the prose. It
 * is the only thing on the page that benefits from the room, and at 34rem the
 * cells crowd into a solid mass.
 *
 * It has to BREAK OUT of main, not just raise its own max-width: main is
 * capped at --measure (34rem), and a 42rem child of a 34rem parent renders at
 * 34rem. The negative margin is what actually buys the width. */
@media (min-width: 900px) {
  .life { width: 42rem; max-width: none; margin-left: -4rem; }
}

.decade {
  display: grid;
  grid-template-columns: 1.5rem 1fr;
  gap: 0 0.6rem;
  align-items: start;
  margin-bottom: 0.45rem;
}
.decade-label {
  font: 500 var(--t-11)/1 var(--sans);
  color: var(--pencil);
  text-align: right;
  padding-top: 1px;
  font-variant-numeric: tabular-nums;
}
.decade-cells { display: grid; grid-template-columns: repeat(26, 1fr); gap: 2px; }
/* The 26 -> 52 column switch happens at 900px, the same breakpoint where the
 * grid breaks out of the measure. Switching at 560px halved the cell inside a
 * container that could not grow: 17.05px at a 559px viewport, 6.57px at 560px,
 * a 61% collapse across one pixel of width. */
@media (min-width: 900px) { .decade-cells { grid-template-columns: repeat(52, 1fr); gap: 3px; } }

.cell { aspect-ratio: 1; border-radius: 1px; background: var(--cell-empty); cursor: pointer; }
/* Rings are drawn in the paper colour first so they read against both a solid
 * block of spent weeks and the faint field of unspent ones. Hover is the
 * lighter of the two; the pinned square wins. */
/* Gated: on a touchscreen :hover latches after a tap, so the last square you
 * touched keeps its ring until you touch another one — the page ends up
 * showing a highlight that means nothing. weeks.js switches the hover
 * behaviour off on the same query. */
@media (hover: hover) and (pointer: fine) {
  .cell:hover { box-shadow: 0 0 0 2px var(--paper), 0 0 0 3px var(--pencil); position: relative; z-index: 1; }
}
.cell.picked { box-shadow: 0 0 0 2px var(--paper), 0 0 0 3px var(--ink); position: relative; z-index: 2; }

/* The detail panel rides along at the top of the viewport while the grid
 * scrolls under it. A fixed min-height stops the page jumping as the text
 * changes length from one square to the next. */
.sticky-detail {
  position: sticky;
  top: 0.5rem;
  z-index: 4;
  /* Tall enough for the WORST case — heading, two wrapped body lines, a
   * placed memory, a landmark and two almanac lines — so that sweeping the
   * grid never changes this box's height. The panel sits above the squares,
   * so any resize here moves the whole grid under the cursor, which is what
   * made reading across it feel like it was snagging. Dead space at the
   * bottom of a short square is the cost, and it is the right one. */
  /* A starting floor only. weeks.js ratchets this up to the tallest panel it
   * actually renders at this viewport, because the true worst case depends on
   * copy and wrapping and cannot be known here. */
  min-height: 9.5rem;
  background: var(--paper-2);
  /* The contents are swapped wholesale many times a second; never let a
   * half-painted panel show through to the squares behind it. */
  contain: layout paint;
}
@media (max-width: 560px) {
  /* Body text wraps to more lines in a narrow column, so the floor is higher. */
  .sticky-detail { min-height: 12rem; }
}

.place { margin: 1.25rem 0 0; }
.place input { max-width: 22rem; font-size: var(--t-17); }
.place-row { display: flex; gap: 0.5rem; align-items: center; margin-top: 0.6rem; flex-wrap: wrap; }
.place-row label { white-space: nowrap; }
.place-row input { max-width: 12rem; }

/* A week carrying something the user placed. A hairline underline, identical
 * whether there is one of them or forty — nothing here counts what is empty. */
.cell.marked { box-shadow: inset 0 -2px 0 0 var(--gilt); }

.lookup { margin: 1.25rem 0 0; }
.lookup-row { display: flex; gap: 0.5rem; align-items: center; }
.lookup-row input { width: 6rem; font-size: var(--t-17); }
.cell.lived { background: var(--ink); }
/* The one square that is today. It needs to be findable in four thousand. */
.cell.now {
  background: var(--ember);
  box-shadow: 0 0 0 2px var(--paper), 0 0 0 3px var(--ember);
}

/* --- the front page ------------------------------------------------------ */

.wordmark {
  font: 400 clamp(var(--t-28), 7vw, 52px)/1 var(--serif);
  letter-spacing: -0.02em;
  margin: 0 0 1.5rem;
}

/* A ledger rule built from the product's own unit: one year of weeks, most of
 * them spent. Decoration, but decoration that says what the thing is. */
.letterhead {
  display: grid;
  grid-template-columns: repeat(52, 1fr);
  gap: 2px;
  max-width: 26rem;
  margin: 0 0 2.25rem;
}
.letterhead i { aspect-ratio: 1; border-radius: 1px; background: var(--cell-empty); }
.letterhead i.on { background: var(--ink); }
.letterhead i.now { background: var(--ember); }

.lede {
  font: 400 clamp(var(--t-21), 3.2vw, var(--t-28))/1.4 var(--serif);
  margin: 0 0 1.25rem;
  max-width: 28rem;
}

.actions { display: grid; gap: 0.6rem; margin: 2.5rem 0 2rem; }
.action {
  display: block;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-left: 2px solid var(--rule);
  border-radius: 2px;
  padding: 1.15rem 1.3rem;
  text-decoration: none;
  color: var(--ink);
}
.action:hover, .action:focus-visible { border-left-color: var(--ember); color: var(--ink); }
.action .q { font: 400 var(--t-21)/1.3 var(--serif); display: block; margin-bottom: 0.3rem; }
.action .d { font: 400 var(--t-14)/1.5 var(--sans); color: var(--pencil); display: block; }

/* --- footer -------------------------------------------------------------- */

footer {
  position: relative; z-index: 2;
  max-width: var(--measure); margin: 0 auto; padding: 2rem 0 3rem;
  border-top: 1px solid var(--rule);
  font: 400 var(--t-14)/1.7 var(--sans);
  color: var(--pencil);
}
footer a { color: var(--pencil); }
/* The crisis link is always in the same place, plain text, never a red button.
 * 14px, not 12px — it is not fine print. */
footer a.crisis { color: var(--ember); }
footer nav { display: flex; flex-wrap: wrap; gap: 0.35rem 1rem; }

/* --- accessibility ------------------------------------------------------- */

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: -9999px;
  background: var(--paper); color: var(--ink); padding: 0.75rem 1rem; z-index: 10;
}
.skip:focus { left: var(--gutter); top: 0.5rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* The grid and the number are the two things worth printing. */
@media print {
  /* An unspent week has to survive a home printer. The old value composited
   * to 1.45:1 against white. */
  :root { --paper: #FFF; --ink: #000; --rule: #999; --cell-empty: #C4C4C4; }
  body::before, footer nav, form, .button, button { display: none; }
  body { padding: 0; }
}

/* --- touch targets -------------------------------------------------------
 *
 * Measured at 390px: footer navigation links were 24px tall and the "Just me
 * today" checkbox was 16x16. A fingertip is nearer 44px, and this site keeps
 * its crisis links in those footers — "If today feels unbearable" was a 24px
 * target on the page most likely to be opened at three in the morning.
 *
 * THE FIRST ATTEMPT AT THIS WAS WORSE THAN THE PROBLEM. Padding the links and
 * cancelling it with a negative margin grows the hit area without moving the
 * text, which is the usual trick — and on a wrapped footer it made the hit
 * areas OVERLAP by 6px. Measured: "If today feels unbearable" overlapped
 * "The method", so a thumb aimed at the crisis link could land on an essay
 * about life tables. A target that is big and wrong is worse than one that is
 * small and right.
 *
 * So the links are given real room instead of borrowed room. The footer
 * becomes a column of rows on a touchscreen, each its own line, and nothing
 * overlaps anything. Inline links inside sentences are left exactly as they
 * are: WCAG 2.5.8 sets 24x24 and explicitly exempts links in a line of text,
 * and inflating them is what caused the overlap in the first place.
 *
 * Gated on (pointer: coarse), so a mouse keeps the tighter spacing.
 */
@media (pointer: coarse) {
  /* One link per row, each a full-width target that cannot collide with its
     neighbour. The crisis links are the reason this is worth the vertical
     space. */
  footer nav {
    flex-direction: column;
    gap: 0;
    align-items: flex-start;
  }
  footer nav a {
    display: block;
    width: 100%;
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--rule);
  }
  footer nav a:last-child { border-bottom: 0; }

  /* The two page-to-page links at the foot of /today are navigation, not
     prose, so they get the same treatment. */
  #main > p.small > a {
    display: inline-block;
    padding: 0.6rem 0;
  }

  /* A 16px checkbox is the smallest target on the site. The label already
     toggles it, so the label becomes the target. */
  #controls label {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }
  #controls input[type='checkbox'] { width: 1.25rem; height: 1.25rem; margin-right: 0.5rem; }

  .chip, .button { min-height: 44px; }

  /* The grid's squares cannot grow: 52 columns of a ninety-year life across a
     phone is 7px a square, and that is the drawing rather than a layout bug.
     The lookup form beneath it is the precise way in, and it exists for
     exactly this reason. */
}

/* --- /today: the offer --------------------------------------------------- */

/* THE CARD RESERVES ITS TALLEST SHAPE AND KEEPS IT.
 *
 * Headlines run from 39 to 81 characters and reasons from 36 to 96, so a
 * two-line offer followed by a four-line one shoved the buttons, the chips and
 * the whole record down the page in the middle of a sweep. The fix is to
 * reserve the room up front instead of growing into it.
 *
 * The reservation is the sum of the card's own parts, so it tracks the type
 * scale rather than a magic pixel number, and it is taken on the CARD rather
 * than on the lines inside it: any slack then collects at the bottom, where it
 * reads as margin, instead of opening a hole between an instruction and its
 * reason. It holds from the first paint and identically on the next reload —
 * unlike a ratchet, which has to see a tall card before it can reserve for one.
 *
 * Verified against all 117 items at every width from 320px up: exactly one
 * card height per width. The ratchet in today.js is the backstop for what CSS
 * cannot know — text the reader has scaled up, or a font that did not load. */
.offer-card {
  /* The reserved slack is split above and below rather than all left at the
     bottom, so a short offer sits in the card instead of hanging from its lid. */
  display: flex;
  flex-direction: column;
  justify-content: center;
  --offer-size: clamp(var(--t-21), 4.2vw, 34px);
  --offer-lines: 3;
  --label-lines: 1;
  --why-lines: 2;
  padding: 1.75rem 1.5rem;
  margin: 1.5rem 0 1.25rem;
  min-height: calc(
      3.5rem                                              /* padding */
    + var(--label-lines) * 1.2 * var(--t-12) + 0.5rem     /* the minutes line */
    + 0.6rem + var(--offer-lines) * 1.3 * var(--offer-size) + 0.9rem
    + var(--why-lines) * 1.6 * var(--t-17));
}
/* Narrower than the measure the longest of each runs on by a line, and the
 * minutes line itself wraps once the filters are on it. */
@media (max-width: 36rem) {
  .offer-card { --offer-lines: 4; --why-lines: 3; --label-lines: 2; }
}
/* The offer is the largest thing on its page, set in the serif at reading
 * size rather than at hero size. A 132px number is the right scale for a
 * quantity; an instruction you are about to follow wants to look like a
 * sentence somebody wrote you, not like a scoreboard. */
.offer {
  font: 400 var(--offer-size)/1.3 var(--serif);
  margin: 0.6rem 0 0.9rem;
  text-wrap: balance;
}
/* The reason, not an accusation. It is set quieter than the instruction
 * deliberately: the thing to do is the point, and the why is there for the
 * people who want one. */
.why {
  font: 400 italic var(--t-17)/1.6 var(--serif);
  color: var(--pencil);
  margin: 0;
  max-width: 30rem;
}

.act-row { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; margin: 0 0 0.5rem; }

/* The acknowledgement holds its own line at all times, empty or not. It is a
 * message that arrives and then leaves, and anything that arrives by taking up
 * room makes the page jump twice: once when it appears and once when it goes.
 * The room is paid for up front instead, and only the words come and go. */
.ack { min-height: 1.5em; margin: 0; opacity: 0; transition: opacity 160ms ease-out; }
.ack.is-on { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .ack { transition: none; } }

/* --- /today: the passage -------------------------------------------------
 *
 * Set as a quotation, not as a card: the offer above is a thing to do and
 * wants the weight, and this is somebody else's sentence sitting quietly
 * beside it. The attribution is not decoration and is never hidden at small
 * sizes — an unattributed line of Marcus Aurelius reads as the site making
 * the claim, which is the one thing the readings wells refuse in writing.
 */
#reading-section { margin-top: 2.5rem; }
#reading blockquote.reading { margin: 1rem 0 0.5rem; }
.reading-ref {
  font: 400 var(--t-12)/1.5 var(--sans);
  color: var(--pencil);
  margin: 0 0 1rem;
  padding-left: 1rem;
}
/* THIS BOX IS RESERVED LIKE THE OFFER CARD, BUT NOT TO THE SAME RULE.
 *
 * The offer card could be reserved to its tallest shape because every one of
 * the 117 suggestions lands within a few pixels of the others. The passages
 * do not: measured across all 389, a phone-width box runs from 84px for a
 * line of Lao Tzu to 390px for a stanza of Teasdale, with the median at 166.
 * Reserving the maximum would park 224px of blank paper under most passages
 * on the smallest screen, and capping the corpus to make them uniform would
 * cost 67 passages, 38 of them from the stoic well.
 *
 * So the reservation is the 95th percentile instead: nineteen draws in
 * twenty move nothing at all, and the twentieth grows the box once, through
 * the ratchet in today.js, which never gives the height back.
 */
#reading {
  min-height: 194px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
@media (max-width: 36rem) { #reading { min-height: 250px; } }

/* The record. A day heading, then the things under it. No bullets, no
 * checkmarks, no tally against a target — the list is the reward. */
.record-day {
  font: 500 var(--t-11)/1.4 var(--sans);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pencil);
  margin: 1.5rem 0 0.4rem;
}
.record-day:first-child { margin-top: 0.5rem; }
.record-item {
  font: 400 var(--t-17)/1.5 var(--serif);
  margin: 0 0 0.3rem;
  padding-left: 1rem;
  border-left: 2px solid var(--rule);
}

.record-tally { font: 400 var(--t-21)/1.4 var(--serif); color: var(--pencil); margin: 0.25rem 0 0; }
.record-tally output { font-variant-numeric: tabular-nums lining-nums; color: var(--ink); }
.record-actions { margin-top: 2rem; }

#controls { margin-top: 2rem; }
#controls label { cursor: pointer; }
#controls input[type='checkbox'] { width: 1rem; height: 1rem; accent-color: var(--ember); margin-right: 0.3rem; vertical-align: -2px; }

/* The horizon override on /parents. Folded away by default: it is the right
 * control for a small number of people and the wrong question for everybody
 * else, so it must be findable without being asked. */
.override { border: 1px solid var(--rule); border-radius: 2px; padding: 0.75rem 1rem; }
.override > summary { cursor: pointer; color: var(--pencil); }
.override[open] > summary { margin-bottom: 0.5rem; }
.override input { max-width: 10rem; }
