@font-face { font-family: "Porch Readable"; src: url("fonts/PorchReadable-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Porch Readable"; src: url("fonts/PorchReadable-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }
/* Digits only: headings use Georgia, whose old-style zero reads as a letter o. */
@font-face { font-family: "Porch Digits"; src: url("fonts/PorchReadable-Bold.ttf") format("truetype"); font-weight: 700; unicode-range: U+0030-0039; font-display: swap; }
@font-face { font-family: "Porch Digits"; src: url("fonts/PorchReadable-Regular.ttf") format("truetype"); font-weight: 400; unicode-range: U+0030-0039; font-display: swap; }

:root {
  --ink: #2a2622; --muted: #5e554c; --paper: #fbf8f1; --card: #ffffff; --line: #ddd4c6;
  --green: #1f3a2e; --gold: #8a6a2c; --warn: #9a3b2b; --ok: #2f5e3e; --tint: #eef2ea;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 19px/1.55 "Porch Readable", "Atkinson Hyperlegible", system-ui, sans-serif;
}
main { max-width: 640px; margin: 0 auto; padding: 20px 16px 64px; }
main.wide { max-width: 860px; }
h1, h2, h3 { font-family: "Porch Digits", Georgia, "Times New Roman", serif; color: var(--green); line-height: 1.2; font-weight: 700; }
h1 { font-size: 1.8rem; margin: .6em 0 .3em; }
h2 { font-size: 1.35rem; margin: 1.6em 0 .5em; }
h3 { font-size: 1.1rem; margin: 1em 0 .3em; }
p { margin: .5em 0 1em; }
a { color: var(--green); }
.lede { font-size: 1.1rem; color: var(--muted); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 18px 16px; margin: 16px 0; }
.note { background: var(--tint); border-left: 4px solid var(--green); padding: 12px 14px; border-radius: 6px; }
.warn { background: #fbeee9; border-left: 4px solid var(--warn); padding: 12px 14px; border-radius: 6px; }
.errors { background: #fbeee9; border: 1px solid #e3b8ad; border-radius: 8px; padding: 10px 16px; }
.errors li { margin: .3em 0; }
label { display: block; font-weight: 700; margin: 18px 0 6px; }
.hint { display: block; font-weight: 400; color: var(--muted); font-size: .9rem; }
input[type=text], input[type=date], input[type=number], textarea, select {
  width: 100%; font: inherit; font-size: 1.05rem; padding: 12px; border: 1px solid #bdb2a2; border-radius: 8px;
  background: #fff; color: var(--ink);
}
textarea { min-height: 220px; resize: vertical; }
input[type=file] { font-size: 1rem; width: 100%; }
input:focus, textarea:focus, select:focus { outline: 3px solid #c9a45c; outline-offset: 1px; }
.btn {
  display: inline-block; font: inherit; font-weight: 700; font-size: 1.05rem; padding: 14px 22px; border-radius: 10px;
  border: 0; background: var(--green); color: #fff; text-decoration: none; cursor: pointer; text-align: center;
}
.btn.big { width: 100%; margin-top: 22px; }
.btn.light { background: #fff; color: var(--green); border: 2px solid var(--green); }
.btn.small { font-size: .9rem; padding: 8px 12px; border-radius: 8px; }
.btn.danger { background: var(--warn); }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row form { margin: 0; }
.linkbox { font-family: ui-monospace, Consolas, monospace; font-size: .85rem; word-break: break-all; background: #fff;
  border: 1px dashed #b9ab94; padding: 10px; border-radius: 8px; user-select: all; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.money { width: 100%; border-collapse: collapse; }
.money td { padding: 6px 0; border-bottom: 1px solid var(--line); }
.money td:last-child { text-align: right; font-weight: 700; }
.money tr.total td { border-bottom: 0; font-size: 1.1rem; }
.entry { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px; margin: 12px 0; }
.entry .who { font-weight: 700; }
.entry .rel { color: var(--muted); }
.entry .msg { white-space: pre-wrap; margin: 8px 0; }
.entry img { max-width: 100%; max-height: 260px; border-radius: 6px; display: block; margin: 8px 0; }
.cover { width: 100%; max-height: 420px; object-fit: cover; object-position: 50% 35%; border-radius: 10px; margin: 8px 0; }
/* keep the face in view: crop around the cover's saved focal point (CSP forbids inline styles) */
.cover.fy-0 { object-position: 50% 0%; } .cover.fy-1 { object-position: 50% 5%; } .cover.fy-2 { object-position: 50% 12%; }
.cover.fy-3 { object-position: 50% 22%; } .cover.fy-4 { object-position: 50% 35%; } .cover.fy-5 { object-position: 50% 50%; }
.cover.fy-6 { object-position: 50% 62%; } .cover.fy-7 { object-position: 50% 75%; } .cover.fy-8 { object-position: 50% 88%; }
.cover.fy-9 { object-position: 50% 95%; } .cover.fy-10 { object-position: 50% 100%; }
.count { color: var(--muted); }
.hp { position: absolute; left: -5000px; width: 1px; height: 1px; overflow: hidden; }
footer { color: var(--muted); font-size: .85rem; text-align: center; margin-top: 48px; }
details summary { cursor: pointer; font-weight: 700; }
.num { font-variant-numeric: tabular-nums; }
textarea.short { min-height: 130px; }

/* emblem picker: big tap targets, two groups, a plain "None" first */
fieldset.emblems { border: 0; padding: 0; margin: 18px 0 0; }
fieldset.emblems legend { font-weight: 700; padding: 0; }
.egroup { font-size: .95rem; color: var(--muted); margin: 14px 0 6px; font-weight: 700; }
.egrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.egrid input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.egrid label { margin: 0; font-weight: 400; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; min-height: 96px; padding: 8px 4px; background: #fff; border: 2px solid var(--line); border-radius: 10px;
  color: var(--green); font-size: .8rem; text-align: center; line-height: 1.2; cursor: pointer; }
.egrid input:checked + label { border-color: var(--green); background: var(--tint); box-shadow: 0 0 0 2px var(--green) inset; }
.egrid input:focus-visible + label { outline: 3px solid #c9a45c; outline-offset: 2px; }
.egrid label .ename { color: var(--ink); }
.egrid label .none { font-size: 1.1rem; color: var(--muted); }
.occasions { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 10px 0 4px; }
.occasions a { display: block; padding: 12px 10px; background: #fff; border: 2px solid var(--line); border-radius: 10px;
  text-decoration: none; color: var(--green); font-weight: 700; font-size: .95rem; text-align: center; }
.occasions a.on { border-color: var(--green); background: var(--tint); }
.starters { margin: 6px 0 0; padding-left: 1.2em; color: var(--muted); }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.check input { width: 22px; height: 22px; margin-top: 3px; flex: none; }
input[type=email] { width: 100%; font: inherit; font-size: 1.05rem; padding: 12px; border: 1px solid #bdb2a2; border-radius: 8px; background: #fff; color: var(--ink); }
.split { font-family: "Porch Digits", Georgia, serif; font-size: 1.6rem; color: var(--green); font-weight: 700; margin: .2em 0 .1em; }
fieldset.tiers { border: 0; padding: 0; margin: 10px 0; }
fieldset.tiers legend { font-weight: 700; padding: 0; }
label.tier { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; font-weight: 400; background: #fff; border: 2px solid var(--line);
  border-radius: 10px; padding: 12px; margin: 8px 0; cursor: pointer; }
label.tier input { grid-row: span 3; width: 22px; height: 22px; margin-top: 3px; }
label.tier .tname { font-weight: 700; color: var(--green); }
label.tier .tprice { font-weight: 700; }
label.tier.on { border-color: var(--green); background: var(--tint); }
.badge { display: inline-block; font-size: .75rem; background: var(--gold); color: #fff; border-radius: 6px; padding: 1px 7px; margin-left: 4px; vertical-align: middle; }
.warn-text { color: var(--warn); }
/* cover picker */
.focal { position: relative; display: inline-block; max-width: 100%; cursor: crosshair; touch-action: none; border-radius: 8px; overflow: hidden; line-height: 0; }
.focal img { max-width: 100%; max-height: 360px; display: block; user-select: none; -webkit-user-drag: none; }
.focal:focus { outline: 3px solid #c9a45c; outline-offset: 2px; }
.focal .dot { position: absolute; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 2px rgba(0,0,0,.55), inset 0 0 0 2px rgba(0,0,0,.35); pointer-events: none; left: 50%; top: 42%; }
fieldset.layouts { border: 0; padding: 0; margin: 18px 0 0; }
fieldset.layouts legend { font-weight: 700; margin-bottom: 8px; }
.lgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.lgrid input[type=radio] { position: absolute; opacity: 0; width: 1px; height: 1px; }
.lgrid label.layout { margin: 0; font-weight: 400; border: 2px solid var(--line); border-radius: 10px; padding: 8px; background: #fff; cursor: pointer; display: flex; flex-direction: column; gap: 6px; }
.lgrid input[type=radio]:checked + label.layout { border-color: var(--green); box-shadow: 0 0 0 2px var(--green); }
.lgrid input[type=radio]:focus-visible + label.layout { outline: 3px solid #c9a45c; }
.lgrid input[type=radio]:disabled + label.layout { cursor: not-allowed; opacity: .75; }
.lgrid .thumb { width: 100%; height: auto; aspect-ratio: 8.5 / 11; border-radius: 3px; background: #eee8dc; display: block; }
.lgrid .thumb.empty { display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: .85rem; text-align: center; padding: 8px; }
.lgrid .lname { font-size: .95rem; line-height: 1.3; }
.lgrid .lwarn { font-size: .82rem; color: #7a5a12; line-height: 1.3; }
.lgrid .lblock { font-size: .82rem; color: var(--warn); line-height: 1.3; }

/* launch: brand bar, footer, "coming soon" tiers, referral code */
.brandbar { background: var(--green); padding: 10px 16px; }
.brandbar a { color: #fff; text-decoration: none; font-family: "Porch Digits", Georgia, serif; font-weight: 700; font-size: 1.05rem; }
.brandbar a span { font-weight: 400; opacity: .85; }
.sitefoot { max-width: 860px; margin: 0 auto; padding: 0 16px 40px; color: var(--muted); font-size: .9rem; }
div.tiers { margin: 10px 0; }
div.tier { display: grid; gap: 2px; background: #fff; border: 2px solid var(--line); border-radius: 8px; padding: 10px 12px; margin: 8px 0; }
div.tier .tname { font-weight: 700; color: var(--green); }
div.tier .tprice { font-weight: 700; }
div.tier.on { border-color: var(--green); background: var(--tint); }
div.tier.soon { color: var(--muted); border-style: dashed; }
div.tier.soon .tname { color: var(--muted); }
.code { font-family: "Porch Readable", ui-monospace, Consolas, monospace; font-size: 1.4rem; font-weight: 700; letter-spacing: .12em; color: var(--green); }
.inline-form { margin: 12px 0; }
/* family photos ("Through the years") */
.jump { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 8px 0 4px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.photo-add label.pick { display: block; text-align: center; cursor: pointer; margin: 10px 0 8px; font-size: 1.15rem; }
.photo-add input[type=file] { display: block; width: 100%; margin: 6px 0; }
.photo-add.js input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.photo-add.js #family-send { display: none; }
.photo-add.js label.pick:focus-within { outline: 3px solid #c9a45c; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin: 12px 0 8px; }
.photo-tile { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.photo-tile img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 6px; display: block; background: #eee8dc; }
.photo-tile .num { position: absolute; top: 12px; left: 12px; background: rgba(255,255,255,.92); border-radius: 6px; padding: 0 7px; font-family: "Porch Digits", Georgia, serif; font-weight: 700; }
.photo-tile .cap { display: flex; gap: 6px; margin: 0; }
.photo-tile .cap input { flex: 1; min-width: 0; margin: 0; font-size: .95rem; padding: 6px 8px; }
.photo-tile .row .btn.small { padding: 6px 9px; font-size: .85rem; }

/* /ops/stats */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.stat-grid div { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.stat-grid strong { display: block; font-size: 1.5em; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.stats { border-collapse: collapse; width: 100%; font-size: .9em; }
.stats th, .stats td { border-bottom: 1px solid var(--line); padding: 6px 8px; text-align: left; white-space: nowrap; }
.stats td.num, .stats th.num { text-align: right; }

/* Their Story (2026-11-28) */
textarea.short { min-height: 120px; }
img.cardpreview { width: 100%; height: auto; border: 1px solid var(--line); border-radius: 6px; display: block; }
[aria-invalid=true] { border-color: var(--warn) !important; outline: 2px solid #e3b8ad; }
.errors a { color: var(--warn); }
.ts-photos { display: flex; flex-wrap: wrap; gap: 10px; margin: 10px 0; }
.ts-photos figure { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.ts-photos img, img.ts-thumb { width: 160px; height: auto; border-radius: 6px; border: 1px solid var(--line); }

.ts-pronoun { border: 0; padding: 0; margin: 18px 0 0; }
.ts-pronoun legend { font-weight: 700; margin-bottom: 6px; }
label.inline { display: flex; gap: 10px; align-items: center; font-weight: 400; margin: 8px 0; }
label.inline input { width: 22px; height: 22px; }
.ts-voice { background: var(--tint); border-radius: 10px; padding: 12px 14px; margin: 16px 0 4px; }
.ts-vhead { font-weight: 700; margin: 0 0 6px; }
.ts-voice .btn.big { margin-top: 8px; font-size: 1.15rem; padding: 18px 22px; }
.ts-vstatus { font-weight: 700; color: var(--green); min-height: 1.2em; }
.ts-vclip { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 6px 0; }
.ts-vclip audio, .entry audio { width: 100%; max-width: 360px; }
.ts-vfallback label { margin-top: 10px; }

[hidden] { display: none !important; }

.ts-vlabel { margin: 0; font-weight: 700; color: var(--ok); }
.ts-vclip { flex-direction: column; align-items: flex-start; }

#cover .lgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* ---- Family Newspaper (2026-11-28) ---- */
input[type=email] { width: 100%; font: inherit; font-size: 1.05rem; padding: 12px; border: 1px solid #bdb2a2; border-radius: 8px; background: #fff; color: var(--ink); }
.fp-h1 { overflow-wrap: anywhere; }
.fp-status .fp-big { font-size: 1.2rem; margin-bottom: .3em; }
.fp-paste { background: var(--tint); padding: 10px 12px; border-radius: 6px; overflow-wrap: anywhere; }
.fp-pages { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 12px 0; }
.fp-page { display: block; text-decoration: none; color: var(--muted); font-size: .9rem; text-align: center; }
.fp-page img { width: 100%; height: auto; display: block; border: 1px solid var(--line); box-shadow: 0 2px 6px rgba(0,0,0,.12); background: #fff; }
@media (max-width: 640px) { .fp-pages { grid-template-columns: 1fr; gap: 18px; } .fp-page { font-size: 1rem; } }  /* phones: one big page at a time */
.fp-item { overflow-wrap: anywhere; }
.fp-item.fp-out, .fp-item.fp-next { opacity: .8; background: #f6f3ec; }
.fp-meta span.ok { color: var(--ok); font-weight: 700; }
.fp-meta span.warn { background: none; border: 0; padding: 0; color: var(--warn); font-weight: 700; }
.fp-meta span.muted { color: var(--muted); }
.fp-btns { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.fp-btns .btn { margin: 0; }
.fp-photo { margin: 14px 0; }
.fp-photo .focal img { max-height: 420px; }
.warnbox { background: #fff6df; border-left: 4px solid var(--gold); padding: 10px 14px; border-radius: 6px; }
.fp-front { max-width: 100%; max-height: 320px; border-radius: 8px; display: block; margin: 8px 0; }
.fp-kinds { border: 0; padding: 0; margin: 18px 0 0; }
.fp-kinds legend { font-weight: 700; margin-bottom: 6px; }
.fp-kind { display: inline-flex; align-items: center; gap: 8px; font-weight: 400; margin: 6px 14px 6px 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.fp-kind input { width: 22px; height: 22px; }
.fp-bday { margin: 18px 0; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: #fff; }
.fp-bday summary, details.card > summary { cursor: pointer; font-weight: 700; }
details.card > summary h2.inline { display: inline; margin: 0; }
.fp-row2, .fp-row3 { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fp-row3 { grid-template-columns: 1.4fr 1fr 1fr; }
.fp-row2 label, .fp-row3 label { margin-top: 12px; }
.fp-member { border: 1px solid var(--line); border-radius: 8px; margin: 12px 0; padding: 4px 12px 12px; }
.fp-slot { border-top: 1px dashed var(--line); padding-top: 4px; }
label.small { font-size: .95rem; margin-top: 10px; }
.fp-body { white-space: pre-wrap; }
form.inline { display: inline-block; margin: 6px 6px 0 0; }
table.ops { width: 100%; border-collapse: collapse; font-size: .85rem; }
table.ops th, table.ops td { border-bottom: 1px solid var(--line); padding: 6px 4px; text-align: left; vertical-align: top; }
.fp-draft { white-space: pre-wrap; font-size: .85rem; background: #f6f3ec; padding: 8px; }
@media (max-width: 420px) { .fp-row3 { grid-template-columns: 1fr 1fr; } .fp-row3 > div:last-child { grid-column: span 2; } }
details.card > summary.fp-sum { list-style-position: inside; }
details.card > summary.fp-sum h2 { display: inline; margin: 0; }

/* Family Newspaper round 3: friendlier photo pickers, album grid */
.fp-form input[type=file], .fp-file input[type=file], #front input[type=file] { padding: 10px; border: 2px dashed #bdb2a2; border-radius: 10px; background: #fff; color: var(--muted); }
.fp-form input[type=file]::file-selector-button, .fp-file input[type=file]::file-selector-button,
#front input[type=file]::file-selector-button { font: inherit; font-weight: 700; font-size: 1rem; padding: 10px 16px; margin-right: 12px;
  border: 0; border-radius: 8px; background: var(--green); color: #fff; cursor: pointer; }
.fp-file input[type=file] { margin-top: 6px; display: block; }
.fp-album { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.fp-album-item img { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 8px; display: block; }
