:root {
  /* Kelly Green, the starting theme. Each person's own theme (src/Core/Look.php) replaces these. */
  --bg: #f1f6f0; --surface: #ffffff; --ink: #18261c; --muted: #5c6b60; --line: #dbe5d9; --brand: #1d7a3a; --brand-ink: #ffffff; --brand-text: #1d7a3a; --accent: #f4b23e; --accent-ink: #2a1a00; --danger: #b03a26;
  --radius: 18px; --shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.05);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  color: var(--ink); background: var(--bg);
  -webkit-text-size-adjust: 100%;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0f1611; --surface: #18211b; --ink: #eef4ef; --muted: #a2b1a6; --line: #29352c; --brand: #5fcf7f; --brand-ink: #08180d; --brand-text: #5fcf7f; --accent: #f4b23e; --accent-ink: #2a1a00; --danger: #ff8a73; --shadow: none; }
}
* { box-sizing: border-box; }
/* No min-height on body: the page is only as tall as what's on it, so short tabs don't scroll.
   :root paints the background behind everything; overscroll-behavior stops the rubber-band bounce. */
html { overscroll-behavior-y: none; }
body { margin: 0; padding: env(safe-area-inset-top) 0 calc(76px + env(safe-area-inset-bottom)); }
main { max-width: 560px; margin: 0 auto; padding: 20px 16px; }
/* Page header, the same on every page: breadcrumb back to the parent page, then the page name.
   Grown-ups' pages leave room for the Settings gear in the top corner. */
.page-head { margin: 0 0 6px; }
body:not(.kid) .page-head, body:not(.kid) main > .crumbs:first-child { padding-right: 52px; }
.page-head h1 { margin-top: 4px; }
.page-head .sub { margin-bottom: 18px; }
.crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 6px; min-height: 44px; font-size: 16px; font-weight: 600; }
.crumbs a { color: var(--brand-text); text-decoration: none; padding: 10px 0; }
.crumbs .chev { font-size: 26px; line-height: 1; padding: 6px 6px 8px 0; font-weight: 500; }
.crumbs .sep { color: var(--muted); }
.page-head:not(:has(.crumbs)) h1 { margin-top: 10px; }
h1 { font-size: 28px; margin: 8px 0 2px; letter-spacing: -.02em; }
h2 { font-size: 15px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 28px 0 10px; }
p { line-height: 1.45; }
.sub { color: var(--muted); margin: 0 0 18px; }
.loading { color: var(--muted); text-align: center; margin-top: 30vh; }

.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin: 0 0 14px; border: 1px solid var(--line); }
.card h3 { margin: 0 0 4px; font-size: 20px; }
.card p { margin: 4px 0; }
.card .meta { color: var(--muted); font-size: 15px; }
/* One card style everywhere: same surface, outline and shadow. A card that needs you now says so with a
   colored label at its top (.tag), never with a different fill or border. */
.card.calm { text-align: center; color: var(--muted); padding: 28px 18px; }
.tag { display: inline-block; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; padding: 4px 10px;
  border-radius: 999px; background: var(--accent); color: var(--accent-ink); margin: 0 0 10px; }
.tag.brand { background: var(--brand); color: var(--brand-ink); }

.progress { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; margin: 14px 0 10px; }
.progress > div { height: 100%; background: var(--brand); border-radius: 4px; transition: width .6s ease; }

button, .btn { font: inherit; border: 0; border-radius: 14px; padding: 14px 18px; font-weight: 600; cursor: pointer;
  background: var(--brand); color: var(--brand-ink); -webkit-tap-highlight-color: transparent; }
button:active { transform: scale(.98); }
button[disabled] { opacity: .5; }
button.big { width: 100%; font-size: 19px; padding: 18px; margin-top: 14px; background: var(--brand); color: var(--brand-ink); }
button.secondary, .btn.secondary { background: transparent; color: var(--brand-text); border: 1px solid var(--line); }
button.small, .btn.small { padding: 8px 12px; font-size: 14px; border-radius: 10px; }
button.link { background: none; color: var(--muted); padding: 6px 0; font-weight: 500; text-decoration: underline; }
button.danger { color: var(--danger); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }

.field { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.field:last-of-type { border-bottom: 0; }
input, select { font: inherit; color: inherit; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
input[type=number] { width: 88px; text-align: right; }
input[type=text], input[type=password] { width: 100%; }
input[type=checkbox] { width: 24px; height: 24px; accent-color: var(--brand); }

.member { padding: 12px 0; border-bottom: 1px solid var(--line); }
.member:last-child { border-bottom: 0; }
.member .name { font-weight: 600; }
.pill { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--line); color: var(--muted); margin-left: 6px; }
.muted { color: var(--muted); font-size: 14px; }

/* Grown-ups' bottom bar: Today + the four verbs. */
#nav { position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; gap: 2px; z-index: 5;
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--bg) 96%, transparent);
  border-top: 1px solid var(--line); } /* no backdrop-filter: it would pin the gear to the bar */
#nav a { flex: 1; max-width: 110px; text-align: center; padding: 6px 2px; border-radius: 12px; color: var(--muted); text-decoration: none;
  font-weight: 600; font-size: 11px; line-height: 1.15; display: flex; flex-direction: column; align-items: center; gap: 2px; }
#nav a .i { font-size: 21px; line-height: 1.2; filter: grayscale(1); opacity: .7; }
#nav a.on { background: var(--surface); color: var(--brand-text); box-shadow: var(--shadow); }
#nav a.on .i { filter: none; opacity: 1; }
/* Settings gear: top corner, not a tab. */
#nav #gear { position: fixed; top: calc(10px + env(safe-area-inset-top)); right: max(12px, calc(50% - 268px)); width: 44px; height: 44px; max-width: none;
  padding: 0; justify-content: center; font-size: 24px; color: var(--muted); border-radius: 50%; background: var(--surface); border: 1px solid var(--line); }
#nav #gear.on { color: var(--brand-text); }
#nav #gear[hidden] { display: none; }
/* Kids: no tab bar (big buttons on their one screen instead). */
body.kid #nav { display: none; }
body.kid { padding-bottom: env(safe-area-inset-bottom); }
#viewing { position: sticky; top: 0; z-index: 6; background: var(--accent); color: var(--accent-ink); text-align: center; padding: 10px 14px; font-weight: 700; }
#viewing button.link { color: var(--accent-ink); font-size: inherit; padding: 0; }
#update-bar { position: fixed; left: 50%; transform: translateX(-50%); top: calc(8px + env(safe-area-inset-top)); z-index: 11;
  background: var(--brand); color: var(--brand-ink); border-radius: 999px; padding: 10px 18px; font-weight: 700; box-shadow: 0 4px 16px rgba(0,0,0,.2); max-width: 92vw; }
#update-bar[hidden] { display: none; }

#toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(86px + env(safe-area-inset-bottom));
  background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 14px; font-weight: 600; max-width: 90vw; z-index: 10; }

/* Calendar & Time */
.card h4 { margin: 14px 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.link-sm { color: var(--brand-text); text-decoration: none; font-weight: 600; font-size: 15px; }
ul.events, ul.lines, ul.checklist { list-style: none; margin: 8px 0 0; padding: 0; }
.card > ul.lines:first-child { margin-top: -8px; margin-bottom: -8px; }
ul.events li { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
ul.events li:last-child { border-bottom: 0; }
ul.events .when { flex: 0 0 82px; color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
ul.events .what { flex: 1; }
ul.events li.step { align-items: center; }
ul.events li.step .what { font-size: 15px; }
a.place { color: var(--muted); font-size: 14px; text-decoration: none; white-space: nowrap; display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
ul.lines li { padding: 8px 0; border-bottom: 1px solid var(--line); line-height: 1.4; }
ul.lines li:last-child { border-bottom: 0; }
ul.checklist li label { display: flex; gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
ul.checklist li:last-child label { border-bottom: 0; }
ul.checklist input { flex-shrink: 0; }
ul.checklist input:checked + span { text-decoration: line-through; color: var(--muted); }
a.link-card { display: block; color: inherit; text-decoration: none; }
button.choice { background: var(--bg); color: var(--ink); border: 1px solid var(--line); }
button.choice.on { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
details.card summary { cursor: pointer; color: var(--muted); }
details.card[open] summary { margin-bottom: 10px; }
label.field.stack, div.field.stack { flex-direction: column; align-items: stretch; }
textarea { font: 14px/1.5 ui-monospace, Menlo, monospace; color: inherit; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px; width: 100%; }
label.inline { display: inline-flex; gap: 6px; align-items: center; font-size: 14px; }
label.inline[hidden] { display: none; }
label.inline input[type=checkbox] { width: 20px; height: 20px; }
.warn { color: var(--danger) !important; }
code { font-size: 13px; background: var(--bg); padding: 1px 4px; border-radius: 4px; }

/* Kids: big tap-friendly picture tiles, no text walls */
.card.kid h3 { font-size: 24px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin-top: 12px; }
/* A lone tile on the kids' Today card (like "Free day!") fills the row instead of sitting half-width. */
#today .tiles > .tile:only-child { grid-column: 1 / -1; }
.tile { background: var(--bg); border-radius: 18px; padding: 16px 10px; text-align: center; border: 1px solid var(--line); }
.tile .emoji { font-size: 52px; line-height: 1.1; }
.tile .t { font-weight: 700; font-size: 18px; margin-top: 6px; }
.tile .when { color: var(--muted); font-size: 16px; margin-top: 2px; }
.tiles.small .emoji { font-size: 34px; }
.tiles.small .t { font-size: 15px; }

/* Habits & reading */
.card.habits { display: flex; flex-direction: column; gap: 12px; }
.card.habits h4 { margin: 0 0 6px; }
.kid-btn { display: block; width: 100%; text-align: center; font-size: 22px; font-weight: 700; padding: 20px 14px; border-radius: 20px;
  background: var(--brand); color: var(--brand-ink); text-decoration: none; border: 0; margin: 0; }
.kid-btn.focus { font-size: 26px; padding: 26px 14px; }
.kid-btn.alt { background: var(--bg); color: var(--ink); border: 1px solid var(--line); font-size: 17px; padding: 14px 8px; }
.kid-btn.parked { background: var(--accent); color: var(--accent-ink); }
.card.pic .kid-btn { font-size: 26px; padding: 22px 10px; }
/* Kids' buttons: a big picture with a short word under it (a grown-up can read it out; Emma goes by the picture). */
.card .kid-btn.stack { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; font-size: 15px; line-height: 1.2; padding: 14px 6px; }
.card .kid-btn.stack .e { font-size: 34px; line-height: 1; }
.goal-word { text-align: center; color: var(--muted); font-size: 15px; font-weight: 600; margin: 4px 0 0; }
.kid-colors-wrap { display: flex; flex-direction: column; align-items: center; gap: 3px; text-decoration: none; color: var(--muted); font-size: 12px; font-weight: 700; }
button.kid-btn.big { margin-top: 0; } /* the card's gap does the spacing */
.kid-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.timer-panel { text-align: center; background: var(--bg); border-radius: 20px; padding: 18px; border: 1px solid var(--line); }
.big-emoji { font-size: 72px; line-height: 1.1; }
.pulse { animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.08); } }
.timer-panel .clock { font-size: 44px; font-weight: 800; font-variant-numeric: tabular-nums; margin: 6px 0 10px; }
.clock-sm { font-variant-numeric: tabular-nums; font-weight: 700; }
.goal-pic { display: flex; align-items: center; gap: 10px; }
.goal-pic .progress { flex: 1; height: 22px; border-radius: 11px; margin: 0; }
.goal-pic .goal-end { font-size: 34px; }
.goal-row span { font-weight: 600; }
.goal-row .progress { height: 12px; border-radius: 6px; margin: 8px 0 0; }
.progress.met > div { background: var(--accent); }
.progress.slim { height: 6px; margin: 6px 0 0; }
.streaks { margin: 0; font-weight: 600; }
.streaks.big { font-size: 30px; text-align: center; letter-spacing: 2px; }
.challenge { background: var(--bg); border-radius: 16px; padding: 12px 14px; border: 1px solid var(--line); }
.challenge .progress { height: 14px; border-radius: 7px; margin: 8px 0 4px; }
.card.pic .challenge strong { font-size: 18px; }
.card.pic .challenge span { font-size: 30px; }
.story { display: flex; gap: 14px; align-items: center; background: var(--accent); color: var(--accent-ink); border-radius: 18px; padding: 14px; font-size: 18px; }
.story img { width: 56px; border-radius: 6px; }
.quest { border: 2px dashed var(--brand); border-radius: 18px; padding: 12px; }
.quest.done { border-style: solid; background: color-mix(in srgb, var(--brand) 10%, transparent); }
.quest .tiles { margin-top: 6px; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tile { font: inherit; color: inherit; cursor: pointer; }
button.tile { background: var(--bg); border: 1px solid var(--line); border-radius: 18px; padding: 14px 8px; }
.quest-item .t { font-size: 14px !important; font-weight: 600 !important; }
.quest-item .emoji { font-size: 40px !important; }
.quest-item.found { background: color-mix(in srgb, var(--brand) 18%, var(--bg)); border-color: var(--brand); }
.tile img { width: 100%; max-height: 120px; object-fit: cover; border-radius: 12px; }
.tiles.menu .tile.lit { outline: 4px solid var(--accent); transform: scale(1.05); }
.tiles.menu .tile .emoji { font-size: 56px; }
.swatches { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin-top: 18px; }
.swatch { width: 64px; height: 64px; border-radius: 50%; padding: 0; border: 3px solid var(--surface); box-shadow: var(--shadow); }
.bookshelf { background: #8a5a35; border-radius: 12px; padding: 10px 10px 0; margin: 8px 0 16px; }
.shelf-row { display: flex; align-items: flex-end; gap: 4px; min-height: 120px; padding: 0 6px; border-bottom: 12px solid #5e3b20; margin-bottom: 10px; }
.spine { width: 34px; height: 104px; border-radius: 4px 4px 0 0; overflow: hidden; box-shadow: inset -4px 0 0 rgba(0,0,0,.15); flex-shrink: 0; }
.spine:nth-child(3n) { height: 92px; } .spine:nth-child(4n) { height: 112px; width: 40px; }
.spine img { width: 100%; height: 100%; object-fit: cover; }
.spine.sm { width: 22px; height: 64px; display: inline-block; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 14px; }
.frame { border: 8px solid #c79a5b; border-radius: 6px; background: var(--surface); aspect-ratio: 1; display: grid; place-items: center; overflow: hidden; box-shadow: var(--shadow); }
.frame img { width: 100%; height: 100%; object-fit: cover; }
.frame .emoji { font-size: 48px; }
.chips { gap: 6px; margin: 6px 0; }
.chip { font: inherit; font-size: 15px; padding: 8px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; font-weight: 600; }
.chip.on { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
img.cover { width: 64px; border-radius: 6px; margin-right: 12px; }
.cover.sm { width: 48px; min-width: 48px; height: 72px; object-fit: cover; border-radius: 4px; margin-right: 10px; }
.cover.ph { display: grid; place-items: center; background: var(--bg); font-size: 26px; }
.book-head { flex-wrap: nowrap; }
.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin: 4px 0; }
label.field-check { display: flex; padding: 6px 0; }
ul.people li .what { display: block; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; text-align: center; }
.stat .n { font-size: 24px; font-weight: 800; }
.stat .l { color: var(--muted); font-size: 13px; }
.covers { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; align-items: flex-end; }
.covers img { height: 72px; border-radius: 4px; }
table.trend { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
table.trend th, table.trend td { text-align: left; padding: 6px 4px; border-bottom: 1px solid var(--line); }
table.trend th { color: var(--muted); font-size: 13px; font-weight: 600; }
.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 20; }
.confetti span { position: absolute; top: -40px; font-size: 26px; width: 10px; height: 16px; border-radius: 2px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(540deg); } }
@media (prefers-reduced-motion: reduce) { .confetti, .pulse { animation: none; display: none; } .pulse { display: block; } }
@media print { #nav, .no-print, #toast { display: none !important; } body { background: #fff; } .card { box-shadow: none; break-inside: avoid; } }
a.btn { text-decoration: none; display: inline-block; }
.act-row select { width: 108px; flex: 0 0 auto; } .act-row input[data-f=name] { min-width: 0; }

/* ---- Routines (assets/routines.js). Colors come from the theme variables only. ---- */
.rt-card { display: flex; gap: 14px; align-items: center; text-decoration: none; color: inherit; }
.rt-card-text { flex: 1; min-width: 0; }
.rt-card-text .muted { margin-left: 6px; }
.rt-card-text .rt-bar { margin: 8px 0 0; }
.rt-card-text .rt-bar-label { display: none; }
.rt-go { font-size: 26px; color: var(--brand-text); }
.rt-screen { text-align: center; }
.rt-head { font-size: 30px; margin: 10px 0 6px; }
.rt-today { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 4px 0 12px; }
.rt-today span { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font-size: 15px; }
.rt-bar { height: 16px; border-radius: 8px; background: var(--line); overflow: hidden; margin: 12px 0 4px; }
.rt-bar > div { height: 100%; border-radius: 8px; transition: width 1s linear, background .4s; background: var(--brand); }
.rt-bar.rt-yellow > div { background: var(--accent); }
.rt-bar.rt-red > div { background: var(--danger); }
.rt-bar-label { color: var(--muted); font-size: 14px; margin: 0 0 8px; }
.rt-dots { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 10px 0 4px; }
.rt-dot { width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface); border: 1px solid var(--line); font-size: 18px; opacity: .55; }
.rt-dot.done { opacity: 1; background: var(--brand); color: var(--brand-ink); border-color: transparent; font-weight: 700; }
.rt-dot.now { opacity: 1; border: 2px solid var(--brand); transform: scale(1.15); }
.rt-step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px 18px; margin-top: 14px; }
.rt-step.wait { opacity: .85; }
.rt-emoji { font-size: 120px; line-height: 1.1; }
.rt-emoji.small { font-size: 42px; }
.rt-photo { width: 100%; max-height: 46vh; object-fit: cover; border-radius: 14px; }
.rt-photo.small { width: 56px; height: 56px; border-radius: 12px; }
.rt-big { font-size: 28px; font-weight: 700; margin: 10px 0; }
.rt-timer { font-size: 22px; color: var(--muted); font-variant-numeric: tabular-nums; margin: 0 0 6px; }
.rt-done-btn { font-size: 30px; }
.rt-streak { font-weight: 700; color: var(--accent); }
.rt-streak.big { font-size: 24px; margin: 6px 0; }
.rt-undo { margin-top: 10px; }
.rt-fast { animation: rt-pop .5s ease; }
@keyframes rt-pop { 0% { transform: scale(.94); } 60% { transform: scale(1.03); } 100% { transform: scale(1); } }
.rt-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.rt-row.col { display: block; }
.rt-row .progress { margin: 8px 0; }
.rt-routine { border-top: 1px solid var(--line); padding: 10px 0; }
.rt-routine summary { cursor: pointer; }
.rt-srow { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 6px 0; border-bottom: 1px dashed var(--line); }
#app input.rt-in-emoji { width: 52px; flex: 0 0 52px; text-align: center; padding-left: 4px; padding-right: 4px; }
#app input.rt-in-text { width: auto; flex: 1 1 140px; min-width: 0; }
#app input.rt-in-num { width: 60px; flex: 0 0 60px; }
.rt-srow label.inline { white-space: nowrap; }
.rt-more { width: 100%; }
.rt-more > *:not(summary) { margin: 6px 8px 0 0; }
.rt-thumb { width: 40px; height: 40px; object-fit: cover; border-radius: 8px; }

/* ---- Look & feel: themes, menus, kids' layout ---- */
.center { text-align: center; }
.all-clear { text-align: center; color: var(--muted); font-size: 15px; margin: 18px 0; line-height: 1.8; }
.all-clear a { color: var(--brand-text); text-decoration: none; font-weight: 600; margin: 0 6px; white-space: nowrap; }
.card.menu { padding: 4px 16px; }
.menu-row { display: flex; justify-content: space-between; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line);
  color: var(--ink); text-decoration: none; font-weight: 600; font-size: 17px; }
.menu-row:last-child { border-bottom: 0; }
.menu-row .dot { display: inline-block; width: 14px; height: 14px; border-radius: 50%; margin-right: 10px; vertical-align: -1px; }
details.more { margin-top: 12px; }
details.more summary { color: var(--muted); cursor: pointer; font-weight: 600; }
.seg { display: flex; gap: 6px; } .seg .choice { flex: 1; }
.swatch { display: grid; place-items: center; cursor: pointer; }
.swatch span { color: #fff; font-size: 30px; font-weight: 800; text-shadow: 0 1px 3px rgba(0,0,0,.5); }
.swatch.on { outline: 4px solid var(--ink); outline-offset: 3px; }
.pics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 18px; }
.pics .pic { font-size: 40px; padding: 10px 0; border-radius: 18px; background: var(--surface); border: 2px solid var(--line); }
.pics .pic.on { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 18%, var(--surface)); }
.kid-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.kid-head > div { display: flex; align-items: center; gap: 10px; min-width: 0; }
.kid-head h1 { margin: 0; }
.kid-pic { font-size: 44px; line-height: 1; }
.kid-colors { font-size: 30px; width: 56px; height: 56px; display: grid; place-items: center; border-radius: 50%; background: var(--surface);
  border: 2px solid var(--brand); text-decoration: none; flex-shrink: 0; }
body.kid main { padding-top: 14px; }
body.kid .card { border-width: 2px; }
.big-see { width: 100%; font-size: 19px; padding: 16px; background: var(--accent); color: var(--accent-ink); margin: 6px 0 4px; }

/* Home Screen app: a solid strip in the theme's background behind the clock and battery,
   so pages scroll cleanly under it instead of iOS blurring them. Zero height in Safari. */
body::before { content: ""; position: fixed; top: 0; left: 0; right: 0; height: env(safe-area-inset-top); background: var(--bg); z-index: 9; }
#viewing { top: env(safe-area-inset-top); }
/* Tucked-away groups on Settings pages */
details.fold { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 12px; }
details.fold > summary { cursor: pointer; font-weight: 600; color: var(--ink); list-style: none; display: flex; justify-content: space-between; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::after { content: '›'; color: var(--muted); transition: transform .15s; }
details.fold[open] > summary::after { transform: rotate(90deg); }
.fold-body { margin-top: 8px; }
details.rt-cd > summary { cursor: pointer; padding: 4px 0; }
.card > details.fold:first-child { border-top: 0; margin-top: 0; padding-top: 0; }

/* 12-hour time picker (hour · minutes · AM/PM) */
.time12 { width: auto; min-width: 7.5em; }

/* Activities tab: a small look at the kids' "What can I do?" menu */
.tiles.menu-peek { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.tiles.menu-peek .tile { padding: 10px 6px; }
.tiles.menu-peek .emoji { font-size: 30px; }
.tiles.menu-peek .t { font-size: 13px; }
.tiles.menu-peek img { max-height: 60px; }
ul.lines.how li { font-size: 15px; }

/* To-dos and grown-ups' habits: one round button moves a to-do along (○ not started → ◐ in progress → ✓ done). */
ul.tds { list-style: none; margin: 8px 0 0; padding: 0; }
ul.tds li.td { display: flex; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
ul.tds li.td:last-child { border-bottom: 0; }
.tick { flex: 0 0 34px; width: 34px; height: 34px; padding: 0; margin: 0; border-radius: 50%; border: 2px solid var(--brand);
  background: var(--surface); color: var(--brand-text); font-size: 18px; font-weight: 800; line-height: 1; display: grid; place-items: center; }
.tick.doing { background: color-mix(in srgb, var(--brand) 22%, var(--surface)); font-size: 22px; }
.tick.done { background: var(--brand); color: var(--brand-ink); }
.td-what { flex: 1; min-width: 0; display: flex; flex-direction: column; text-decoration: none; color: var(--ink); }
.td-what .t { font-weight: 600; overflow-wrap: anywhere; }
.td-what .s { color: var(--muted); font-size: 14px; }
li.td.done .td-what .t { text-decoration: line-through; color: var(--muted); }
li.td.want .td-what .t { font-weight: 500; }
/* Ideas Pete and Kelsey haven't added yet: shown light gray until tapped. */
li.td.idea { opacity: .5; }
li.td.idea .tick { border-style: dashed; border-color: var(--muted); color: var(--muted); }
.chip.idea { color: var(--muted); border-style: dashed; }
.faded { opacity: .4; }
.job-done { text-decoration: line-through; color: var(--muted); }
.td-add { display: flex; gap: 8px; margin-top: 12px; align-items: center; }
.td-add input[type=text] { flex: 1; min-width: 0; }
.td-step { flex-wrap: nowrap; margin-top: 6px; }
.td-step input { flex: 1; min-width: 0; }
.mh-row { padding: 10px 0; border-bottom: 1px solid var(--line); }
/* Kids' jobs: one big button each. */
.card.jobs .job-list { display: grid; gap: 10px; }
.card.jobs .kid-btn { text-align: left; font-size: 20px; padding: 16px 16px; }
.card.jobs .kid-btn.done { text-decoration: line-through; opacity: .7; }
.card.jobs h4 { margin-top: 0; }

/* Chores */
ul.events a.what { color: var(--ink); text-decoration: none; }
#ch-edit .seg { flex-wrap: wrap; }
#ch-edit .seg .choice { flex: 1 1 40%; padding: 10px 8px; }
#ch-custom { padding: 12px 0; border-bottom: 1px solid var(--line); gap: 8px; align-items: center; }
#ch-help { margin: 8px 0 0; }

/* ---- School lunch ---------------------------------------------------------------------- */
.lunch-card { display: flex; flex-direction: column; gap: 2px; text-decoration: none; color: var(--ink); }
.lunch-card.done { flex-direction: row; align-items: center; gap: 12px; }
.lunch-big { font-size: 48px; line-height: 1; }
.lunch-big.small { font-size: 32px; }
.lunch-card strong { font-size: 20px; }
.lunch-list { padding-top: 6px; }
.lunch-week { margin: 14px 0 4px; }
.lunch-day { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.lunch-day:last-child { border-bottom: 0; }
.lunch-day.locked { opacity: .65; }
.lunch-what { flex: 1; min-width: 0; }
.lunch-when { color: var(--muted); font-size: 14px; font-weight: 700; }
.lunch-food { display: flex; gap: 8px; align-items: center; font-size: 17px; overflow-wrap: anywhere; }
.lunch-food .e { font-size: 30px; line-height: 1; }
.lunch-pick { display: flex; gap: 6px; flex-shrink: 0; }
.lunch-btn { font: inherit; display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 62px; padding: 8px 6px; border-radius: 16px;
  border: 2px solid var(--line); background: var(--bg); color: var(--ink); font-size: 13px; font-weight: 700; cursor: pointer; }
.lunch-btn .e { font-size: 28px; line-height: 1; }
.lunch-btn.on { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.lunch-btn.on.guess { background: var(--surface); color: var(--ink); border-color: var(--brand); }
.lunch-btn:disabled { cursor: default; }
.lunch-notes { display: flex; flex-wrap: wrap; gap: 6px 10px; }
.lunch-notes input { width: 96px; }
.row[hidden] { display: none; }

/* Routines tab: the list of every routine */
.rt-group + .rt-group { margin-top: 12px; }
.rt-who { margin: 0 0 4px; font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.rt-line { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.rt-line.off { opacity: .6; }
.rt-name { display: flex; flex-direction: column; }
.rt-when { font-size: .8rem; }
.lunch-fold > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; color: var(--ink); }
.lunch-fold > summary::-webkit-details-marker { display: none; }
.lunch-fold > summary::after { content: '›'; color: var(--muted); transition: transform .15s; }
.lunch-fold[open] > summary::after { transform: rotate(90deg); }
.lunch-add { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.btn-file { display: inline-flex; align-items: center; background: var(--brand); color: var(--brand-ink); }
.btn-file input { display: none; }

/* ---- Today: Now + "I want to..." ---- */
.events-line { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; padding: 12px 14px; border-radius: 14px; background: var(--surface);
  border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-size: 15px; line-height: 1.35; }
.events-line > span:nth-child(2) { flex: 1; min-width: 0; }
h2.now, h2.want { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 18px 0 8px; }
.verbs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.verb { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 16px 14px; min-height: 112px; border-radius: 18px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); color: var(--ink); text-decoration: none; }
.verb .e { font-size: 30px; line-height: 1.1; }
.verb .t { font-weight: 700; font-size: 17px; color: var(--brand-text); line-height: 1.2; }
.verb .h { font-size: 13px; color: var(--muted); line-height: 1.3; }
.verb:active { transform: scale(.98); }

/* ---- Kids: Now + "I want to..." picture buttons (a word under every one) ---- */
.verbs.kid-verbs .verb { align-items: center; justify-content: center; text-align: center; min-height: 128px; font: inherit; cursor: pointer; position: relative; }
.verbs.kid-verbs .verb .e { font-size: 46px; }
.verbs.kid-verbs .verb .t { font-size: 19px; color: var(--ink); }
.verbs.kid-verbs .verb .tag { position: absolute; top: 10px; right: 10px; margin: 0; }
.verbs.kid-verbs { margin-bottom: 16px; }

/* Grown-ups' "Do something together" */
.fam-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.card .kid-btn.fam-item { position: relative; }
.kid-btn.fam-item.picked { outline: 3px solid var(--brand); outline-offset: 2px; }
.fam-done { font-size: 12px; color: var(--muted); font-weight: 600; }

/* Settings › Pushes: one row per kind, switch on the right. */
.push-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); cursor: pointer; }
.push-row:first-child { border-top: 0; }
.push-row > span { display: flex; flex-direction: column; gap: 2px; }
.push-name { font-weight: 600; }
.push-meta { font-size: 13px; }
input.toggle { appearance: none; -webkit-appearance: none; flex: none; width: 46px; height: 28px; border-radius: 14px; background: var(--line); position: relative; cursor: pointer; transition: background .15s; margin: 0; }
input.toggle::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 2px rgba(0,0,0,.3); transition: left .15s; }
input.toggle:checked { background: var(--brand); }
input.toggle:checked::after { left: 21px; }

.events .what { min-width: 0; }

/* A "?" at the bottom of a card: the how-it-works text, closed until tapped. */
details.help { margin-top: 14px; }
details.help summary { list-style: none; cursor: pointer; color: var(--muted); font-size: 14px; display: inline-flex; align-items: center; gap: 8px; }
details.help summary::-webkit-details-marker { display: none; }
details.help .q { width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--line); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; color: var(--brand-text); }
.lunch-card .tag { align-self: flex-start; }
