/* Baby Despot App — component styles.
   All color/type/spacing decisions live in tokens.css (two skins x light/dark).
   This sheet only consumes tokens; skin personality lives in the token values
   plus the small skin-specific block at the end. */

* { box-sizing: border-box; }

/* hidden always wins, even over display:flex/grid component rules */
[hidden] { display: none !important; }

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

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.65;
  background:
    radial-gradient(95% 65% at 50% -8%, color-mix(in srgb, var(--tender) 30%, transparent) 0%, transparent 60%),
    var(--bg);
  background-attachment: fixed;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
  padding-bottom: calc(var(--tabbar-h) + 10px + env(safe-area-inset-bottom));
}

/* ---------- Pages + bottom tab bar ---------- */
.page[hidden] { display: none; }
.page:not([data-page="home"]) > .wrap { padding-top: max(22px, calc(env(safe-area-inset-top) + 16px)); }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; justify-content: space-around; align-items: stretch;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
  transition: transform var(--dur-2) var(--ease);
}
.tabbar.kb-hidden { transform: translateY(110%); }
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: none; border: none; cursor: pointer; padding: 10px 4px 10px;
  color: var(--ink-soft); font-family: var(--font-body);
  position: relative;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
/* faint caret hints that a tab holds a jump menu (press & hold, or tap when active) */
.tab::after {
  content: ""; position: absolute; bottom: 3px; left: 50%; transform: translateX(-50%);
  width: 0; height: 0; border-left: 3px solid transparent; border-right: 3px solid transparent;
  border-top: 3px solid currentColor; opacity: 0.32;
}
.tab.is-active::after { opacity: 0.6; }
.tab-ico { line-height: 0; transition: transform var(--dur-1) var(--ease), color var(--dur-1) ease; }
.tab-ico .ico { width: 23px; height: 23px; }
.tab-lab { font-size: 0.62rem; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 600; }
.tab.is-active { color: var(--accent-deep); }
.tab.is-active::before {
  content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 34px; height: 3px; border-radius: 0 0 4px 4px; background: var(--accent);
}
.tab.is-active .tab-ico { transform: translateY(-1px); }
.tab:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; border-radius: var(--r-sm); }

#field {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  z-index: 0; pointer-events: none;
}

.wrap {
  position: relative; z-index: 1;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--sp-5) var(--sp-7);
  padding-left: max(var(--sp-5), env(safe-area-inset-left));
  padding-right: max(var(--sp-5), env(safe-area-inset-right));
  /* one rhythm system: the flex gap owns all spacing between top-level blocks,
     so hidden ([hidden]) cards leave NO phantom gap and the old per-block
     margins are neutralized by the reset below. */
  display: flex;
  flex-direction: column;
  gap: var(--rhythm);
}
/* higher specificity than any per-block rule (0,2,0 vs 0,1,0) so it wins wherever
   it sits — flex gap is the single source of vertical rhythm between page blocks.
   margin-block only (top+bottom); inline auto centering on cards is preserved. */
.page > .wrap > * { margin-block: 0; }

.eyebrow {
  font-family: var(--font-body);
  text-transform: uppercase;
  letter-spacing: 0.32em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-deep);
  margin: 0;
}

/* Section heads (Care / Journey pages) match the Album/Letters treatment */
.head { text-align: center; }
.head h2 { font-family: var(--font-display); font-weight: 560; font-size: clamp(2rem, 5vw, 3rem); margin: 14px 0 6px; color: var(--ink); text-wrap: balance; }
.head h2 .name { font-style: italic; color: var(--accent-deep); }
.head > p { color: var(--ink-soft); max-width: 46ch; margin: 0 auto; }

/* ---------- Shared icon + button recipes ---------- */
.ico { width: 20px; height: 20px; display: inline-block; vertical-align: -0.2em; }

.btn-primary,
button.send,
.gate-card button[type="submit"],
.ct-toggle {
  font-family: var(--font-body); font-weight: 700; letter-spacing: 0.03em;
  color: var(--on-accent);
  background: linear-gradient(var(--accent), var(--accent-deep));
  border: none; border-radius: var(--r-pill);
  cursor: pointer;
  transition: transform var(--dur-1) var(--ease), box-shadow var(--dur-2) ease, filter var(--dur-1) ease;
  box-shadow: 0 6px 18px rgb(var(--shadow-ch) / 0.22);
}
.btn-primary:hover, button.send:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgb(var(--shadow-ch) / 0.28); }
.btn-primary:active, button.send:active { transform: translateY(0); filter: brightness(0.96); }

/* ---------- Cards (shared surface recipe) ----------
   Forms are NOT carded implicitly — only .form-card carries the recipe.
   (The old bare `form` selector double-carded the gate and forced per-form hacks.) */
.pregweek, .laborcard, .meaning, .form-card, .quick-group, .gate-card, .readiness {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-2);
}

/* ---------- Teddy bear (interactive) ---------- */
.bear-stage {
  display: flex; justify-content: center;
  padding-top: max(56px, calc(env(safe-area-inset-top) + 28px));
  position: relative;
}
.bear-btn { background: none; border: none; padding: 0; cursor: pointer; border-radius: 50%; }
.bear-btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 8px; }
.bear {
  position: relative;
  width: 150px; height: 138px;
  filter: drop-shadow(0 10px 18px rgb(var(--shadow-ch) / 0.18));
  animation: bob 4.5s ease-in-out infinite;
  transform-origin: 50% 90%;
}
.bear.squish { animation: squish 0.45s ease; }
@keyframes bob { 0%,100%{ transform: translateY(0); } 50%{ transform: translateY(-7px); } }
@keyframes squish {
  0%{ transform: scale(1,1); } 30%{ transform: scale(1.08, 0.92); }
  60%{ transform: scale(0.96, 1.05); } 100%{ transform: scale(1,1); }
}
.bear svg { width: 100%; height: 100%; display: block; }
/* one token-driven star mascot; recolors per skin via --tender / --ink / --accent */

.tap-hint { text-align: center; margin: 12px 0 0; font-size: 0.7rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent-deep); opacity: 0.7; }
.float-heart { position: fixed; z-index: 5; pointer-events: none; font-size: 1.2rem; will-change: transform, opacity; animation: floatup 1.6s ease-out forwards; }
@keyframes floatup {
  0% { opacity: 0; transform: translateY(0) scale(0.6); }
  15% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-150px) scale(1.1); }
}

/* ---------- Hero / name ---------- */
.hero { text-align: center; padding: 18px 0 8px; }
.hero .eyebrow { margin-bottom: 14px; }
.hero .greet { font-family: var(--font-display); font-style: italic; font-size: clamp(1.1rem, 2.6vw, 1.45rem); color: var(--ink-soft); margin: 0 0 6px; }
.hero h1 { font-family: var(--font-display); font-weight: 560; font-size: clamp(3.4rem, 13vw, 7rem); line-height: 0.94; margin: 0; letter-spacing: 0.01em; color: var(--ink); text-wrap: balance; }
.hero h1 .first { display: block; color: var(--accent-deep); font-style: italic; }
.hero h1 .last { display: block; font-size: 0.42em; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink); margin-top: 10px; font-family: var(--font-body); font-weight: 600; }
.hero .tagline { font-family: var(--font-display); font-style: italic; font-size: clamp(1.2rem, 3vw, 1.65rem); color: var(--ink-soft); margin: 24px 0 0; }

/* Americana signature: a hand-stitched star seam */
.paw-rule { position: relative; display: flex; justify-content: center; align-items: center; gap: 22px; margin: 46px auto 8px; color: var(--accent); }
.paw-rule::before { content: ""; position: absolute; left: 10%; right: 10%; top: 50%; transform: translateY(-50%); border-top: 2px dashed color-mix(in srgb, var(--accent) 50%, transparent); }
.paw-rule span { position: relative; display: inline-flex; background: var(--bg); padding: 0 7px; }
.paw-rule .ico { width: 16px; height: 16px; }
.paw-rule span:nth-child(2) .ico { width: 21px; height: 21px; }

/* ---------- Countdown ---------- */
.count { text-align: center; margin-top: 36px; }
.count h2 { font-family: var(--font-display); font-weight: 560; font-size: clamp(1.7rem, 4.4vw, 2.5rem); margin: 14px 0 2px; text-wrap: balance; }
.count h2 .name { font-style: italic; color: var(--accent-deep); }
.count .target { color: var(--ink-soft); font-size: 1rem; font-family: var(--font-body); letter-spacing: 0.04em; }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; max-width: 620px; margin: 32px auto 0; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px 8px 16px; position: relative; box-shadow: var(--shadow-2); }
.tile::before { content: ""; position: absolute; top: 10px; left: 50%; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--accent); opacity: 0; }
.tile.pulse::before { animation: spark 0.9s ease-out; }
@keyframes spark { 0%{opacity:.9; transform:scale(1);} 100%{opacity:0; transform:scale(2.6);} }
.tile .num { font-family: var(--font-display); font-size: clamp(2rem, 6vw, 3rem); line-height: 1; font-variant-numeric: tabular-nums; color: var(--ink); }
.tile .lab { text-transform: uppercase; letter-spacing: 0.2em; font-size: 0.62rem; color: var(--accent-deep); margin-top: 10px; font-weight: 600; }
.count .arrived { font-family: var(--font-display); font-style: italic; font-size: 1.7rem; color: var(--accent-deep); }

/* ---------- Pregnancy week ---------- */
.pregweek { margin: 40px auto 0; max-width: 540px; text-align: center; padding: 26px 28px; }
.pregweek[hidden] { display: none; }
.pw-emoji { font-size: 2.8rem; line-height: 1; }
.pw-line { font-family: var(--font-display); font-size: 1.3rem; color: var(--ink); margin: 12px 0 6px; }
.pw-line strong { color: var(--accent-deep); font-style: italic; font-weight: 560; }
.pw-week { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.16em; color: var(--accent-deep); font-weight: 700; margin: 0; }

/* ---------- Readiness ("Baby Despot watch") ---------- */
.readiness { margin: 40px auto 0; max-width: 540px; padding: 26px 26px 22px; text-align: center; }
.readiness[hidden] { display: none; }
.readiness .rd-count { font-family: var(--font-display); font-size: 1.25rem; color: var(--ink); margin: 6px 0 18px; }
.rd-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 400px) { .rd-grid { grid-template-columns: 1fr; } }
.rd-tile { display: flex; align-items: center; gap: 12px; text-align: left; background: color-mix(in srgb, var(--accent) 5%, var(--surface)); border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px; box-shadow: var(--shadow-1); }
button.rd-tile { cursor: pointer; font: inherit; color: inherit; width: 100%; }
button.rd-tile:hover { border-color: var(--accent); }
.rd-ring { position: relative; width: 52px; height: 52px; flex: none; }
.rd-ring svg { width: 52px; height: 52px; display: block; }
.rd-ring-bg { stroke: color-mix(in srgb, var(--ink) 12%, transparent); }
.rd-ring-fg { stroke: var(--accent); transition: stroke-dashoffset 0.6s ease; }
.rd-bag-done .rd-ring-fg { stroke: var(--support); }
.rd-pct { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 0.74rem; font-weight: 700; color: var(--accent-deep); }
.rd-labor-ico { width: 52px; height: 52px; flex: none; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: color-mix(in srgb, var(--accent) 12%, var(--surface)); color: var(--accent-deep); }
.rd-labor-ico .ico { width: 22px; height: 22px; }
.rd-tile-body { min-width: 0; display: flex; flex-direction: column; }
.rd-tile-lab { display: block; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 700; color: var(--accent-deep); }
.rd-tile-sub { display: block; font-family: var(--font-display); font-size: 1rem; color: var(--ink); margin-top: 2px; }
.rd-labor.early .rd-labor-ico { background: color-mix(in srgb, var(--accent) 20%, var(--surface)); }
.rd-labor.go { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow-2); }
.rd-labor.go .rd-labor-ico { background: var(--accent); color: var(--on-accent); }
.rd-labor.go .rd-tile-sub { color: var(--accent-deep); font-style: italic; }
.rd-hint { font-size: 0.78rem; color: var(--ink-soft); line-height: 1.5; margin: 16px 0 0; }

/* ---------- Labor: contraction timer + Baby's coming ---------- */
.laborcard { margin: 40px auto 0; max-width: 540px; padding: 28px 26px; text-align: center; }
.lc-h { font-family: var(--font-display); font-weight: 560; font-size: 1.7rem; color: var(--ink); margin: 8px 0 4px; }
.lc-h .name { font-style: italic; color: var(--accent-deep); }
.ctimer { margin-top: 18px; }
.ct-toggle { width: 100%; font-size: 1.05rem; border-radius: var(--r-md); padding: 18px; }
.ct-toggle .ico { width: 17px; height: 17px; margin-right: 6px; }
.ct-toggle.on { background: linear-gradient(var(--danger), color-mix(in srgb, var(--danger) 78%, black)); }
.ct-toggle:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.ct-live { margin-top: 12px; font-family: var(--font-display); font-style: italic; color: var(--accent-deep); font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.ct-live[hidden] { display: none; }
.ct-stats { margin-top: 12px; color: var(--ink-soft); font-size: 0.92rem; }
.ct-stats strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.ct-list { margin-top: 14px; display: flex; flex-direction: column; gap: 6px; }
.ct-row { display: grid; grid-template-columns: 1fr auto auto 30px; align-items: center; gap: 10px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 12px; font-size: 0.85rem; }
.ct-time { color: var(--ink); font-variant-numeric: tabular-nums; text-align: left; }
.ct-dur { color: var(--accent-deep); font-weight: 700; font-variant-numeric: tabular-nums; }
.ct-gap { color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.ct-row .del { width: 26px; height: 26px; border: none; background: none; color: var(--ink-soft); opacity: 0.7; font-size: 1.1rem; line-height: 1; cursor: pointer; border-radius: 50%; }
.ct-row .del:hover { color: var(--accent-deep); opacity: 1; }
.ct-note { font-size: 0.74rem; color: var(--ink-soft); opacity: 0.8; margin: 14px 0 0; font-style: italic; }

.bc-wrap { margin-top: 24px; }
.bc-btn { position: relative; overflow: hidden; width: 100%; border: none; border-radius: var(--r-lg); padding: 20px; cursor: pointer; background: linear-gradient(color-mix(in srgb, var(--danger) 72%, var(--surface)), var(--danger)); color: var(--on-accent); touch-action: none; user-select: none; -webkit-user-select: none; box-shadow: 0 8px 22px rgb(var(--shadow-ch) / 0.26); }
.bc-btn.done { background: linear-gradient(var(--support), color-mix(in srgb, var(--support) 78%, black)); }
.bc-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: rgba(255, 255, 255, 0.28); }
.bc-label { position: relative; font-family: var(--font-body); font-weight: 800; font-size: 1.2rem; letter-spacing: 0.02em; }
.bc-btn:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.bc-hint { font-size: 0.78rem; color: var(--ink-soft); margin: 10px 0 0; }
.ct-status { display: flex; justify-content: center; margin-top: 18px; }

/* ---------- Name meaning ---------- */
.meaning { margin: 84px auto 0; max-width: 540px; padding: 32px 30px; text-align: center; }
.meaning .word { font-family: var(--font-display); font-size: 2.1rem; color: var(--accent-deep); font-style: italic; }
.meaning .def { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.24em; color: var(--ink); margin: 10px 0 14px; font-weight: 700; }
.meaning p { margin: 0; color: var(--ink-soft); font-size: 1.02rem; }

/* ---------- Kick counter ---------- */
.kicks { margin: 40px auto 0; max-width: 540px; padding: 28px 26px; text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--shadow-2); }
.kicks[hidden] { display: none; }
.kick-live { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 18px 0; }
.kick-ring { --kick-deg: 0deg; width: 84px; height: 84px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; background: conic-gradient(var(--support) 0 var(--kick-deg), var(--surface-2) var(--kick-deg) 360deg); transition: background var(--dur-2) ease; }
.kick-ring::before { content: ""; position: absolute; }
.kick-ring .kick-count { width: 64px; height: 64px; border-radius: 50%; background: var(--surface); display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 600; font-size: 1.6rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.kick-ring.live .kick-count { color: var(--accent-deep); }
.kick-meta { flex: 1; text-align: left; color: var(--ink-soft); font-size: 0.92rem; margin: 0; }
.kick-end { display: block; margin: 12px auto 0; background: none; border: none; color: var(--ink-soft); font-size: 0.78rem; text-decoration: underline; cursor: pointer; }
.kick-end[hidden] { display: none; }
.kick-end:hover { color: var(--accent-deep); }
.kick-history { margin-top: 16px; display: flex; flex-direction: column; gap: 6px; }
.kick-history .ct-row { grid-template-columns: 1fr auto auto 30px; }

/* ---------- Hospital bag ---------- */
.bag-sub { color: var(--ink-soft); font-size: 0.9rem; margin: -6px 0 14px; }
.bag-progress { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.bag-pill { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; color: var(--accent-deep); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 5px 13px; font-variant-numeric: tabular-nums; }
.bag-pill.done { color: var(--on-accent); background: var(--support); border-color: var(--support); }
.bag-group { margin-top: 16px; }
.bag-row { display: flex; align-items: center; gap: 11px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 13px; margin-bottom: 6px; cursor: pointer; }
.bag-row input[type="checkbox"] { width: 19px; height: 19px; accent-color: var(--support); flex: none; margin: 0; }
.bag-row .bag-label { flex: 1; font-size: 0.95rem; color: var(--ink); }
.bag-row.checked .bag-label { color: var(--ink-soft); text-decoration: line-through; text-decoration-color: var(--support); }
.bag-row .del { flex: none; width: 26px; height: 26px; border-radius: 50%; border: none; background: none; color: var(--ink-soft); opacity: 0.7; font-size: 1.15rem; line-height: 1; cursor: pointer; }
.bag-form { display: flex; gap: 10px; margin: 16px 0 0; }
.bag-form select { flex: none; width: auto; }
.bag-form input { flex: 1; }
.bag-form button.send { flex: none; padding: 12px 20px; }
select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }

/* ---------- Announcement ---------- */
.announce { margin: 26px auto 0; max-width: 540px; text-align: center; padding: 28px 26px; background: var(--surface); border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line)); border-radius: var(--r-xl); box-shadow: var(--shadow-2); }
.announce[hidden] { display: none; }
.announce-h { font-family: var(--font-display); font-weight: 560; font-size: clamp(1.6rem, 4.5vw, 2.2rem); margin: 12px 0 6px; color: var(--ink); text-wrap: balance; }
.announce-h .name { font-style: italic; color: var(--accent-deep); }
.announce-line { color: var(--ink-soft); margin: 0 0 16px; }
.announce-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; max-width: 340px; margin: 0 auto; }
.announce-num { font-size: 1.3rem !important; padding-top: 4px; }
.announce-age { font-family: var(--font-display); font-style: italic; color: var(--accent-deep); font-size: 1.1rem; margin: 16px 0 0; }

/* "The day you were born" keepsake snapshot */
.dayborn { text-align: center; padding: 28px 24px; background: var(--surface); border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line)); border-radius: var(--r-xl); box-shadow: var(--shadow-2); }
.dayborn[hidden] { display: none; }
.dayborn .head { margin-bottom: 4px; }
.db-date { font-family: var(--font-display); font-size: clamp(1.05rem, 3.6vw, 1.35rem); color: var(--accent-deep); font-style: italic; text-wrap: balance; margin: 10px 0 0; }
.db-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; max-width: 340px; margin: 20px auto 0; }
.db-stats[hidden] { display: none; }
.db-world { margin-top: 22px; }
.db-world-h { text-transform: uppercase; letter-spacing: 0.2em; font-size: 0.62rem; color: var(--accent-deep); font-weight: 600; margin: 0 0 12px; }
.db-facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; max-width: 420px; margin: 0 auto; }
.db-fact { border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 10px; }
.db-fact dt { text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.58rem; color: var(--accent-deep); font-weight: 600; }
.db-fact dd { margin: 5px 0 0; font-family: var(--font-display); font-size: 1.02rem; color: var(--ink); }
.db-note { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.db-note[hidden] { display: none; }
.db-note-h { text-transform: uppercase; letter-spacing: 0.2em; font-size: 0.62rem; color: var(--accent-deep); font-weight: 600; margin: 0 0 8px; }
.db-place { font-family: var(--font-display); font-style: italic; color: var(--ink); margin: 0 0 6px; }
.db-note-body { color: var(--ink-soft); margin: 0; white-space: pre-wrap; text-wrap: pretty; }
.db-edit { margin-top: 18px; text-align: left; }
.db-edit > summary { cursor: pointer; text-align: center; color: var(--accent-deep); font-size: 0.85rem; }
.db-edit[hidden] { display: none; }
.db-edit .form-card { margin-top: 14px; }

/* ---------- "He's here" admin ---------- */
.hehere { margin: 46px auto 0; max-width: 540px; }
.hehere[hidden] { display: none; }
.hehere summary { text-align: center; font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 700; color: var(--ink-soft); cursor: pointer; opacity: 0.8; }
.hehere summary:hover { color: var(--accent-deep); }
.hehere form { margin-top: 18px; }
.born-pair { display: flex; gap: 8px; }
.born-pair input { min-width: 0; }

/* ---------- Growth log ---------- */
.growth-toggle { display: flex; gap: 8px; margin-bottom: 14px; }
.growth-toggle button { flex: 1; border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft); border-radius: var(--r-pill); padding: 9px 0; font-family: var(--font-body); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; cursor: pointer; }
.growth-toggle button.on { border-color: var(--accent); color: var(--accent-deep); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
.growth-toggle button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.growth-chart { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px 6px 4px; box-shadow: var(--shadow-1); }
.growth-chart svg { width: 100%; height: auto; display: block; }
.gc-grid { stroke: var(--line); stroke-width: 1; }
.gc-ylab, .gc-xlab { fill: var(--ink-soft); font-family: var(--font-body); font-size: 10px; }
.gc-line { fill: none; stroke: var(--support); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.gc-dot { fill: var(--surface); stroke: var(--support); stroke-width: 2; cursor: pointer; }
.gc-dot:hover, .gc-dot:focus { fill: var(--support); outline: none; }
.growth-tip { font-size: 0.82rem; color: var(--ink-soft); text-align: center; margin: 10px 0 0; min-height: 1.2em; font-variant-numeric: tabular-nums; }
.growth-list { margin-top: 14px; display: flex; flex-direction: column; gap: 6px; }
#growthForm { margin-top: 18px; }

/* ---------- Firsts ---------- */
.firsts { margin-top: 90px; }
.firsts-chips { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 22px; }
.firsts-chips button { border: 1px solid var(--line); background: var(--surface); color: var(--accent-deep); border-radius: var(--r-pill); padding: 8px 16px; font-family: var(--font-body); font-size: 0.82rem; font-weight: 600; cursor: pointer; }
.firsts-chips button:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.firsts-list { margin-top: 26px; display: flex; flex-direction: column; gap: 10px; }
.first-card { display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 14px; box-shadow: var(--shadow-1); }
.first-photo { width: 56px; height: 56px; border-radius: var(--r-sm); object-fit: cover; flex: none; border: 1px solid var(--line); }
.first-body { flex: 1; min-width: 0; }
.first-card .del { flex: none; width: 30px; height: 30px; border-radius: 50%; border: none; background: none; color: var(--ink-soft); opacity: 0.7; font-size: 1.3rem; line-height: 1; cursor: pointer; }
.firsts-photo { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.firsts-photo .album-toggle { margin: 0; }
.firsts-photo-chip { font-size: 0.78rem; font-weight: 700; color: var(--support); }
.fi-picker-overlay { position: fixed; inset: 0; z-index: 70; background: color-mix(in srgb, var(--ink) 60%, transparent); display: flex; align-items: center; justify-content: center; padding: 24px; }
.fi-picker-overlay .gallery { background: var(--surface); border-radius: var(--r-lg); padding: 14px; max-height: 70vh; overflow-y: auto; max-width: 560px; margin: 0; }

/* ---------- Wishes wall ---------- */
.wishes[hidden] { display: none; }
.wish-feelings { display: flex; gap: 8px; flex-wrap: wrap; }
.wish-feelings button { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); font-size: 1.2rem; line-height: 1; cursor: pointer; transition: transform 0.12s ease, border-color 0.12s ease; }
.wish-feelings button:hover { border-color: var(--accent); }
.wish-feelings button.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--surface)); transform: scale(1.08); }
.wish-feelings button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
#wishForm.editing { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent), var(--shadow-1); }
.wish-list { margin-top: 26px; display: flex; flex-direction: column; gap: 12px; }
.wish-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px 16px; box-shadow: var(--shadow-1); }
.wish-card.mine { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.wish-top { display: flex; align-items: center; gap: 12px; }
.wish-feel { font-size: 1.5rem; line-height: 1; flex: none; }
.wish-who { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; min-width: 0; }
.wish-name { font-family: var(--font-display, var(--font-body)); font-weight: 700; color: var(--ink); }
.wish-circle { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--accent-deep); background: color-mix(in srgb, var(--accent) 12%, var(--surface)); border-radius: var(--r-pill); padding: 2px 9px; }
.wish-msg { margin: 8px 0 0; color: var(--ink-soft); white-space: pre-wrap; overflow-wrap: anywhere; }
.wish-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; }
.wish-when { font-size: 0.76rem; color: var(--support); }
.wish-when .pending { color: var(--accent-deep); font-style: italic; }
.wish-tools { display: flex; gap: 6px; flex: none; }
.wish-tools button { border: 1px solid var(--line); background: none; color: var(--accent-deep); font-family: var(--font-body); font-weight: 700; font-size: 0.76rem; border-radius: var(--r-pill); padding: 5px 12px; cursor: pointer; }
.wish-tools button:hover { background: var(--surface); border-color: var(--accent); }
.wish-tools .wish-del { color: var(--ink-soft); }

/* ---------- Baby Despot-o-meter (stats) ---------- */
.benno { max-width: 540px; margin-inline: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--shadow-2); padding: var(--sp-5); text-align: center; }
.benno-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-3); margin-top: var(--sp-4); }
.benno-grid .tile { box-shadow: none; background: color-mix(in srgb, var(--accent) 6%, var(--surface)); padding: var(--sp-4) var(--sp-2); }
.benno-grid .tile .num { font-size: clamp(1.5rem, 5vw, 2.1rem); }
@media (max-width: 540px) { .benno-grid { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Gift registry ---------- */
.reg-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.reg-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px; box-shadow: var(--shadow-1); }
.reg-card.checked { opacity: 0.7; }
.reg-open { display: block; text-decoration: none; color: inherit; }
.reg-open[href]:hover .reg-name { text-decoration: underline; text-decoration-color: var(--accent); }
.reg-thumb { width: 100%; height: 128px; border-radius: var(--r-sm); object-fit: contain; background: #fff; border: 1px solid var(--line); }
.reg-thumb-empty { background: color-mix(in srgb, var(--accent) 8%, var(--surface)); border-style: dashed; }
.reg-name { font-size: 0.85rem; line-height: 1.32; color: var(--ink); margin: 9px 0 10px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.reg-card.checked .reg-name { color: var(--ink-soft); text-decoration: line-through; text-decoration-color: var(--support); }
.reg-actions { margin-top: auto; display: flex; align-items: center; gap: 6px; }
.reg-tools { display: flex; align-items: center; gap: var(--sp-2); flex: none; }
.reg-claim { border: 1px solid var(--line); background: none; color: var(--accent-deep); font-family: var(--font-body); font-weight: 700; font-size: 0.76rem; border-radius: var(--r-pill); padding: 5px 12px; cursor: pointer; }
.reg-claim:hover { background: var(--surface); border-color: var(--accent); }
.reg-claim.taken { color: var(--ink-soft); opacity: 0.85; cursor: default; }
.reg-card .reg-claim { flex: 1; text-align: center; font-size: 0.72rem; padding: 7px 6px; white-space: normal; line-height: 1.2; }
.reg-card .del { margin-left: 0; }
.reg-url { margin-top: var(--sp-4); }
.reg-url .bag-form { margin-top: var(--sp-2); }
#registryLink { margin: var(--sp-2) 0 var(--sp-3); }

/* ---------- Updates (notes from Mom & Dad) ---------- */
.upd-list { display: flex; flex-direction: column; gap: var(--sp-3); }
.upd-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--sp-3) var(--sp-4); box-shadow: var(--shadow-1); }
.upd-card.latest { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.upd-top { display: flex; align-items: flex-start; gap: var(--sp-3); }
.upd-feel { font-size: 1.4rem; line-height: 1.3; flex: none; }
.upd-msg { margin: 0; color: var(--ink); font-family: var(--font-display); font-size: 1.05rem; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
#updCompose { margin-top: var(--sp-4); }

/* ---------- Birth pool ---------- */
.pool-banner { background: var(--surface); border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line)); border-radius: var(--r-md); padding: 14px 16px; text-align: center; color: var(--ink-soft); font-size: 0.92rem; margin-bottom: 14px; }
.pool-banner strong { color: var(--ink); }
.pool-banner[hidden] { display: none; }
.pool-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.pool-row { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 11px 14px; box-shadow: var(--shadow-1); }
.pool-row.winner { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow-2); }
.pool-body { flex: 1; min-width: 0; }
.pool-crown { color: var(--accent-deep); font-weight: 700; font-size: 0.82rem; }
.pool-tools { margin-top: 6px; display: flex; gap: 6px; }
.pool-tools button { border: 1px solid var(--line); background: none; color: var(--accent-deep); font-family: var(--font-body); font-weight: 700; font-size: 0.76rem; border-radius: var(--r-pill); padding: 5px 12px; cursor: pointer; }
.pool-tools button:hover { background: var(--surface); border-color: var(--accent); }
.pool-tools .pool-del { color: var(--ink-soft); }
#poolForm { margin-top: 4px; }
#poolForm[hidden] { display: none; }
#poolForm.editing { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent), var(--shadow-1); }

/* ---------- Predictions + Advice (Fun tab) ---------- */
#predForm[hidden] { display: none; }
.pred-q { margin: 12px 0; }
.pred-q .field-label { margin-bottom: 5px; }
.pred-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.pred-chips button { border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-family: var(--font-body); font-weight: 600; font-size: 0.82rem; border-radius: var(--r-pill); padding: 6px 13px; cursor: pointer; transition: border-color 0.12s ease, background 0.12s ease; }
.pred-chips button:hover { border-color: var(--accent); }
.pred-chips button.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, var(--surface)); color: var(--accent-deep); font-weight: 700; }
.pred-chips button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.pred-picks { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 5px; }
.pred-pick { font-size: 0.74rem; font-weight: 600; border-radius: var(--r-pill); padding: 2px 9px; background: color-mix(in srgb, var(--accent) 9%, var(--surface)); color: var(--ink-soft); border: 1px solid var(--line); }
.pred-pick.right { background: color-mix(in srgb, var(--accent) 22%, var(--surface)); color: var(--accent-deep); border-color: var(--accent); font-weight: 700; }
.pred-pick.wrong { opacity: 0.55; text-decoration: line-through; }
#predActuals { margin-top: 18px; }
.advice-filter { margin: 4px 0 14px; }
.advice-cat { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--accent-deep); background: color-mix(in srgb, var(--accent) 12%, var(--surface)); border-radius: var(--r-pill); padding: 2px 9px; }
.mute-row { display: flex; gap: 9px; align-items: flex-start; margin-top: 12px; font-size: 0.85rem; color: var(--ink-soft); cursor: pointer; line-height: 1.4; }
.mute-row[hidden] { display: none; }
.mute-row input { margin-top: 2px; flex: none; width: 18px; height: 18px; accent-color: var(--accent); }

/* ---------- Reactions (wishes + advice cards) ---------- */
.react-bar { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.react-chip { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-pill); padding: 3px 9px; font-size: 1rem; line-height: 1; cursor: pointer; transition: border-color 0.12s ease, background 0.12s ease, transform 0.1s ease; }
.react-chip:hover { border-color: var(--accent); }
.react-chip:active { transform: scale(0.92); }
.react-chip.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, var(--surface)); }
.react-chip .react-n { font-size: 0.74rem; font-weight: 700; color: var(--accent-deep); font-variant-numeric: tabular-nums; }
.react-chip:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---------- Appearance (skin + theme picker) ---------- */
.appearance { margin: 46px auto 0; max-width: 540px; text-align: center; }
.appearance .field-label { margin-bottom: 10px; }
.appearance-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.skin-btn, .theme-btn {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft);
  border-radius: var(--r-pill); padding: 9px 18px; font-family: var(--font-body);
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em; cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px;
  transition: all var(--dur-1) ease;
}
.skin-btn .swatch { width: 14px; height: 14px; border-radius: 50%; border: 1px solid var(--line); }
.skin-btn[data-skin="americana"] .swatch { background: linear-gradient(135deg, #FBF6EA 50%, #B23A34 50%); }
.skin-btn[data-skin="sports"] .swatch { background: linear-gradient(135deg, #1E5A3A 50%, #C58A4E 50%); }
.skin-btn[data-skin="broncos"] .swatch { background: linear-gradient(135deg, #0033A0 50%, #D64309 50%); }
.skin-btn.on, .theme-btn.on { border-color: var(--accent); color: var(--accent-deep); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
.skin-btn:focus-visible, .theme-btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.theme-btn .ico { width: 15px; height: 15px; }

/* ---------- Care log ---------- */
.care-who { display: flex; align-items: center; gap: 16px; justify-content: center; margin-top: 26px; flex-wrap: wrap; }
.care-who .field-label { margin: 0; }
.care-who .who-pick { width: 220px; }

.glance { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 24px; }
.g-tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 16px 8px; text-align: center; box-shadow: var(--shadow-1); }
.g-tile.active { border-color: var(--support); background: linear-gradient(var(--surface), color-mix(in srgb, var(--support) 12%, var(--surface))); }
.g-ico { line-height: 0; color: var(--accent-deep); }
.g-ico .ico { width: 22px; height: 22px; }
.g-lab { font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--accent-deep); margin-top: 8px; font-weight: 700; }
.g-val { font-family: var(--font-display); font-size: 1.05rem; color: var(--ink); margin-top: 4px; font-variant-numeric: tabular-nums; }

.quick { margin-top: 26px; display: grid; gap: 16px; }
.quick-group { padding: 16px 16px 18px; border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.quick-title { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.18em; color: var(--accent-deep); font-weight: 700; }
.quick-btns { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.qbtn { flex: 1; min-width: 92px; padding: 15px 10px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); font-family: var(--font-body); font-size: 0.95rem; font-weight: 600; cursor: pointer; transition: transform var(--dur-1) var(--ease), background var(--dur-1) ease; }
.qbtn .ico { width: 17px; height: 17px; margin-right: 5px; color: var(--accent-deep); }
.qbtn:hover { background: color-mix(in srgb, var(--accent) 8%, var(--surface-2)); }
.qbtn:active { transform: scale(0.97); }
.qbtn.wide { flex-basis: 100%; }
.qbtn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.qbtn.on { background: linear-gradient(var(--support), color-mix(in srgb, var(--support) 78%, black)); color: var(--on-accent); border-color: var(--support); }
.qbtn.on .ico { color: var(--on-accent); }

.care-status { display: flex; justify-content: center; margin-top: 20px; }

.timeline { margin-top: 18px; display: flex; flex-direction: column; gap: 10px; }
.tl-row { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 14px; box-shadow: var(--shadow-1); }
.tl-row.tl-open { border-color: var(--support); }
.tl-ico { flex: none; width: 30px; text-align: center; line-height: 0; color: var(--accent-deep); }
.tl-ico .ico { width: 21px; height: 21px; }
.tl-body { flex: 1; min-width: 0; }
.tl-label { font-family: var(--font-display); font-size: 1.05rem; color: var(--ink); }
.tl-meta { font-size: 0.74rem; color: var(--ink-soft); letter-spacing: 0.02em; margin-top: 2px; }
.tl-meta .pending { color: var(--accent-deep); font-style: italic; }
.tl-row .del { flex: none; width: 30px; height: 30px; border-radius: 50%; border: none; background: none; color: var(--ink-soft); opacity: 0.7; font-size: 1.3rem; line-height: 1; cursor: pointer; }
.tl-row .del:hover { color: var(--accent-deep); opacity: 1; background: var(--surface-2); }

/* ---------- Photo album ---------- */
.album { margin-top: 90px; }
.album .head { text-align: center; }
.album h2 { font-family: var(--font-display); font-weight: 560; font-size: clamp(2rem, 5vw, 3rem); margin: 14px 0 6px; text-wrap: balance; color: var(--ink); }
.album h2 .name { font-style: italic; color: var(--accent-deep); }
.album .head p { color: var(--ink-soft); max-width: 46ch; margin: 0 auto; }
.gallery { margin-top: 32px; display: grid; grid-template-columns: repeat(auto-fill, minmax(116px, 1fr)); gap: 10px; }
.gallery button { padding: 0; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; cursor: pointer; background: var(--surface-2); aspect-ratio: 1 / 1; box-shadow: var(--shadow-1); }
.gallery button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.gallery img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform var(--dur-3) var(--ease); }
.gallery button:hover img { transform: scale(1.05); }
.album-msg { text-align: center; color: var(--ink-soft); font-style: italic; font-family: var(--font-display); margin-top: 28px; }
.album-msg[hidden] { display: none; }
.count-chip { display: inline-block; font-family: var(--font-body); font-size: 0.8rem; font-weight: 700; color: var(--on-accent); background: var(--accent); border-radius: var(--r-pill); padding: 2px 11px; vertical-align: middle; margin-left: 6px; }
.count-chip[hidden] { display: none; }
.gallery-groups[hidden], .gallery[hidden] { display: none; }
.gallery-group { margin-top: 26px; }
.group-head { font-family: var(--font-body); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.18em; color: var(--accent-deep); font-weight: 700; margin: 0 0 12px; }
.gallery-group .gallery { margin-top: 0; }
.album-toggle { display: block; margin: 22px auto 0; background: none; border: 1px solid var(--line); color: var(--accent-deep); font-family: var(--font-body); font-weight: 700; font-size: 0.85rem; letter-spacing: 0.02em; border-radius: var(--r-pill); padding: 10px 22px; cursor: pointer; }
.album-toggle:hover { background: var(--surface); }
.album-toggle[hidden] { display: none; }
.album-toggle:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---------- Journey: appointments + milestones ---------- */
.sched-row { display: flex; gap: 14px; }
.sched-row .grow { flex: 1; }

.sched-block { margin-top: 36px; }
.sched-h { font-family: var(--font-display); font-weight: 560; font-size: 1.4rem; color: var(--ink); margin: 0 0 14px; }
.sched-item { display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 14px; margin-bottom: 10px; box-shadow: var(--shadow-1); }
.si-date { flex: none; width: 50px; text-align: center; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 0; }
.si-d { display: block; font-family: var(--font-display); font-size: 1.4rem; line-height: 1; color: var(--accent-deep); font-variant-numeric: tabular-nums; }
.si-m { display: block; font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink-soft); font-weight: 700; margin-top: 3px; }
.si-body { flex: 1; min-width: 0; }
.si-title { font-family: var(--font-display); font-size: 1.1rem; color: var(--ink); }
.si-note { font-size: 0.85rem; color: var(--ink-soft); margin-top: 2px; }
.si-meta { font-size: 0.72rem; color: var(--accent-deep); letter-spacing: 0.02em; margin-top: 3px; }
.si-meta .pending { color: var(--accent-deep); font-style: italic; }
.si-tools { flex: none; display: flex; align-items: center; gap: 2px; }
.sched-item .del { flex: none; width: 30px; height: 30px; border-radius: 50%; border: none; background: none; color: var(--ink-soft); opacity: 0.7; font-size: 1.3rem; line-height: 1; cursor: pointer; }
.sched-item .del:hover { color: var(--accent-deep); opacity: 1; background: var(--surface-2); }
.sched-item .edit { flex: none; border: none; background: none; color: var(--accent-deep); font-family: var(--font-body); font-weight: 700; font-size: 0.74rem; cursor: pointer; padding: 4px 6px; text-decoration: underline; }
.sched-item .edit:hover { opacity: 0.8; }
#schedForm.editing { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent), var(--shadow-1); }

.lightbox { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 14px; background: color-mix(in srgb, var(--ink) 92%, transparent); padding: max(20px, env(safe-area-inset-top)) 16px max(20px, env(safe-area-inset-bottom)); }
html[data-theme] .lightbox, .lightbox { /* ink-based scrim adapts per theme via token */ }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: 80vh; border-radius: var(--r-sm); box-shadow: 0 20px 50px rgba(0,0,0,0.5); object-fit: contain; }
.lb-close { position: absolute; top: max(14px, env(safe-area-inset-top)); right: 18px; width: 44px; height: 44px; border-radius: 50%; border: none; background: color-mix(in srgb, var(--bg) 15%, transparent); color: var(--bg); font-size: 1.8rem; line-height: 1; cursor: pointer; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; border-radius: 50%; border: none; background: color-mix(in srgb, var(--bg) 15%, transparent); color: var(--bg); font-size: 1.8rem; line-height: 1; cursor: pointer; }
.lb-prev { left: 12px; }
.lb-next { right: 12px; }
.lb-close:focus-visible, .lb-nav:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.lb-cap { color: var(--bg); font-family: var(--font-display); font-style: italic; text-align: center; max-width: 40ch; margin: 0; min-height: 1.2em; }

/* ---------- Letters ---------- */
.book { margin-top: 90px; }
.book .head { text-align: center; }
.book h2 { font-family: var(--font-display); font-weight: 560; font-size: clamp(2rem, 5vw, 3rem); margin: 14px 0 6px; text-wrap: balance; color: var(--ink); }
.book h2 .name { font-style: italic; color: var(--accent-deep); }
.book .head p { color: var(--ink-soft); max-width: 46ch; margin: 0 auto; }

form { display: grid; gap: 18px; }
.form-card { margin: 38px auto 0; max-width: 580px; padding: 26px; }

/* field grid: two columns that stack on narrow phones */
.field-row, .sched-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 419px) { .field-row, .sched-row { grid-template-columns: 1fr; } }

/* measurement trio: stays 3-up (unit-fields are compact) */
.measure-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }

/* unit-suffix input: the unit lives inside the field, not in the placeholder */
.unit-field { position: relative; }
.unit-field input { width: 100%; text-align: center; padding-right: 32px; }
.unit-field .unit { position: absolute; right: 11px; top: 50%; transform: translateY(-50%); font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 700; color: var(--ink-soft); pointer-events: none; }

/* selects: styled like the other controls, sprite chevron.
   MUST be display:block — as an inline span, Safari lets the abs-positioned
   chevron and the 100%-width select escape the grid column (the iOS overlap). */
.select-wrap { display: block; position: relative; min-width: 0; }
.select-wrap select { width: 100%; appearance: none; -webkit-appearance: none; padding-right: 38px; }
.select-wrap .ico { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--ink-soft); pointer-events: none; }

.who-pick { display: flex; gap: 10px; }
.who-pick label { flex: 1; margin: 0; text-align: center; cursor: pointer; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 11px 0; font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.16em; font-weight: 700; color: var(--ink-soft); background: var(--surface-2); transition: all var(--dur-1) ease; }
.who-pick input { position: absolute; opacity: 0; pointer-events: none; }
.who-pick input:checked + label { background: linear-gradient(var(--accent), var(--accent-deep)); color: var(--on-accent); border-color: var(--accent-deep); }
.who-pick input:focus-visible + label { outline: 3px solid var(--ink); outline-offset: 2px; }
.field-label { display: block; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.18em; color: var(--accent-deep); margin-bottom: 8px; font-weight: 700; }
textarea, input[type="text"], input[type="date"], input[type="password"], input[type="number"], select {
  width: 100%; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm);
  color: var(--ink); font-family: var(--font-display); font-size: 1.05rem; padding: 12px 14px; line-height: 1.5;
  color-scheme: inherit;
  min-height: 48px;
}
/* prose fields keep the display serif; data controls read better in the body sans */
input[type="date"], input[type="number"], select { font-family: var(--font-body); font-size: 0.95rem; height: 48px; }
/* iOS Safari zooms the page when a focused field is under 16px. On touch devices
   floor every control at 16px (still scales up with the large text-size setting). */
@media (pointer: coarse) {
  textarea, input[type="text"], input[type="date"], input[type="password"], input[type="number"], select {
    font-size: max(16px, 1rem);
  }
}
/* iOS: date inputs have an intrinsic min-width that overflows grid columns and a
   native height that ignores ours — appearance:none + min-width:0 tames both */
input[type="date"] { -webkit-appearance: none; appearance: none; min-width: 0; }
input[type="date"]::-webkit-date-and-time-value { text-align: left; }
input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { appearance: textfield; -moz-appearance: textfield; }
/* grid/flex children may never overflow their track */
.field-row > *, .sched-row > *, .measure-row > *, .seal-row > *, .set-row > *, .born-pair > * { min-width: 0; }
textarea { resize: vertical; min-height: 110px; }
@media (pointer: coarse) { textarea { resize: none; } }
textarea::placeholder, input::placeholder { color: var(--ink-soft); opacity: 0.7; font-style: italic; }
textarea:focus, input[type="text"]:focus, input[type="date"]:focus, input[type="password"]:focus, input[type="number"]:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent);
}
.actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
button.send { font-size: 0.95rem; padding: 13px 26px; }
button.send:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
button.send:disabled { opacity: 0.55; cursor: default; transform: none; box-shadow: none; }

/* sync status pill */
.sync { display: inline-flex; align-items: center; gap: 7px; font-size: 0.82rem; color: var(--ink-soft); }
.sync .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--support); flex: none; }
.sync[data-state="saving"] .dot { background: var(--accent); animation: blink 1s ease-in-out infinite; }
.sync[data-state="offline"] .dot { background: var(--tender); }
.sync[data-state="error"] .dot { background: var(--danger); }
@keyframes blink { 0%,100%{ opacity: 1; } 50%{ opacity: 0.3; } }

.letters { margin-top: 44px; columns: 2 280px; column-gap: 18px; }
.letter { break-inside: avoid; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 20px 16px; margin-bottom: 18px; box-shadow: var(--shadow-1); }
.letter .chip { display: inline-block; font-size: 0.64rem; text-transform: uppercase; letter-spacing: 0.16em; font-weight: 700; color: var(--on-accent); background: var(--accent); border-radius: var(--r-pill); padding: 4px 12px; }
.letter .chip.mom { background: var(--support); }
.letter .chip.guest { background: var(--tender); color: var(--ink); }

/* family sees Firsts read-only */
#firstsCard.read-only form, #firstsCard.read-only .firsts-chips, #firstsCard.read-only .del { display: none; }

/* guest write card */
.guest-write[hidden] { display: none; }
#guestStatus { min-height: 1.2em; }
.letter p { margin: 12px 0 10px; font-family: var(--font-display); font-size: 1.08rem; line-height: 1.55; color: var(--ink); white-space: pre-wrap; }
.letter .meta { font-size: 0.72rem; color: var(--ink-soft); letter-spacing: 0.04em; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.letter .meta .pending { color: var(--accent-deep); font-style: italic; }
.letter .meta > span:first-child { margin-right: auto; }
.letter .del, .letter .edit { background: none; border: none; color: var(--ink-soft); opacity: 0.75; cursor: pointer; font-size: 0.72rem; padding: 2px 4px; text-decoration: underline; }
.letter .del:hover, .letter .edit:hover { color: var(--accent-deep); opacity: 1; }
.letter .edit { color: var(--accent-deep); }
#letterForm.editing { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent), var(--shadow-1); }
.empty { text-align: center; color: var(--ink-soft); font-style: italic; font-family: var(--font-display); margin-top: 30px; }

/* time-capsule letters */
.seal-row { display: flex; gap: 10px; }
.seal-row select { flex: 1; }
.seal-row input[type="date"] { flex: none; width: auto; }
.seal-row input[hidden] { display: none; }
.seal-hint { font-size: 0.76rem; color: var(--ink-soft); font-style: italic; margin: 8px 0 0; }
.seal-hint[hidden] { display: none; }
.letter-sealed { text-align: center; background: color-mix(in srgb, var(--accent) 5%, var(--surface)); border-style: dashed; border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.seal-envelope { color: var(--accent-deep); margin: 14px auto 6px; }
.seal-envelope svg { width: 48px; height: 34px; }
.seal-line { font-family: var(--font-display); font-style: italic; color: var(--ink-soft); font-size: 1.05rem; margin: 6px 0 2px; }
.seal-sub { font-size: 0.76rem; letter-spacing: 0.02em; color: var(--ink-soft); opacity: 0.8; margin: 0 0 10px; font-variant-numeric: tabular-nums; }

footer { text-align: center; margin-top: 90px; color: var(--ink-soft); padding-bottom: env(safe-area-inset-bottom); }
footer .sig { font-family: var(--font-display); font-style: italic; font-size: 1.35rem; color: var(--ink); }
footer .small { font-size: 0.8rem; color: var(--ink-soft); opacity: 0.75; margin-top: 8px; }

/* ---------- Passcode gate ---------- */
.gate { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 28px; background: radial-gradient(95% 65% at 50% -8%, color-mix(in srgb, var(--tender) 26%, transparent), transparent 60%), var(--bg); }
.gate[hidden] { display: none; }
.gate-card { width: 100%; max-width: 380px; text-align: center; border-radius: var(--r-xl); padding: 38px 30px; box-shadow: var(--shadow-3); animation: gate-in var(--dur-3) var(--ease); }
@keyframes gate-in { from { opacity: 0; transform: translateY(14px) scale(0.98); } to { opacity: 1; transform: none; } }
.gate-card .mini-star { line-height: 0; }
.gate-card .mini-star svg { width: 74px; height: 66px; }
.gate-card h2 { font-family: var(--font-display); font-weight: 560; font-size: 1.7rem; margin: 12px 0 4px; color: var(--ink); }
.gate-card p { color: var(--ink-soft); font-size: 0.95rem; margin: 0 0 22px; }
.gate-card input { text-align: center; font-family: var(--font-body); font-size: 1.1rem; letter-spacing: 0.08em; margin-bottom: 14px; }
.gate-card button { width: 100%; font-size: 1rem; padding: 14px; }
.gate-err { color: var(--danger); font-size: 0.85rem; min-height: 1.2em; margin: 12px 0 0; }

/* ---------- Lullabies ---------- */
.lullaby { margin: 40px auto 0; max-width: 540px; padding: 28px 26px; text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--shadow-2); }
.sound-btns { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 16px; }
.sound-btns button { border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); border-radius: var(--r-md); padding: 13px 4px; font-family: var(--font-body); font-size: 0.82rem; font-weight: 600; cursor: pointer; }
.sound-btns button.on { background: linear-gradient(var(--accent), var(--accent-deep)); color: var(--on-accent); border-color: var(--accent-deep); }
.sound-btns button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.sound-ctl { margin-top: 14px; }
.sound-ctl input[type="range"] { width: 100%; accent-color: var(--accent); min-height: 0; padding: 0; background: none; border: none; }
.sound-timer { display: flex; gap: 8px; justify-content: center; margin-top: 10px; }
.sound-timer button { border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft); border-radius: var(--r-pill); padding: 6px 14px; font-family: var(--font-body); font-size: 0.76rem; font-weight: 700; cursor: pointer; }
.sound-timer button.on { border-color: var(--accent); color: var(--accent-deep); }
.sound-status { font-size: 0.76rem; color: var(--ink-soft); margin: 10px 0 0; min-height: 1.1em; }
.lullaby-embed { margin-top: 16px; border-radius: var(--r-md); overflow: hidden; }
.lullaby-embed iframe { width: 100%; height: 300px; border: 0; display: block; }

/* ---------- Feeding timer ---------- */
.feed-live { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; background: var(--surface-2); border: 1px solid var(--support); border-radius: var(--r-md); padding: 10px 14px; }
.feed-elapsed { font-family: var(--font-display); font-weight: 600; font-size: 1.25rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.feed-side { flex: 1; font-size: 0.82rem; color: var(--ink-soft); }
.feed-done { border-color: var(--support) !important; color: var(--support) !important; }

/* ---------- Rhythm (7-day mini charts) ---------- */
.rhythm { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.rhythm-chart { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px; box-shadow: var(--shadow-1); }
.rhythm-title { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--accent-deep); font-weight: 700; display: flex; justify-content: space-between; margin-bottom: 8px; }
.rhythm-title span { color: var(--ink-soft); letter-spacing: 0.02em; text-transform: none; font-variant-numeric: tabular-nums; }
.rhythm-chart svg { width: 100%; height: auto; display: block; }
.rhythm .rb { fill: var(--support); opacity: 0.55; }
.rhythm .rb.today { opacity: 1; }

/* ---------- Story river ---------- */
.story { margin-top: 8px; }
.story-list { margin-top: 24px; display: flex; flex-direction: column; gap: 10px; }
.story-row { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 11px 14px; box-shadow: var(--shadow-1); }
.story-ico { flex: none; width: 26px; text-align: center; line-height: 0; color: var(--accent-deep); }
.story-ico .ico { width: 19px; height: 19px; }
.story-thumb { width: 44px; height: 44px; border-radius: var(--r-sm); object-fit: cover; flex: none; border: 1px solid var(--line); }
.story-body { flex: 1; min-width: 0; font-size: 0.9rem; color: var(--ink); }
.story-body strong { font-family: var(--font-display); font-weight: 600; display: block; }
.story-body span { display: block; color: var(--ink-soft); font-size: 0.82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.story-body em { display: block; font-style: normal; font-size: 0.7rem; color: var(--ink-soft); opacity: 0.8; margin-top: 2px; }

/* ---------- Bump watch ---------- */
.bump { margin: 40px auto 0; max-width: 540px; padding: 24px 26px; text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--shadow-2); }
.bump-line { color: var(--ink-soft); font-size: 0.9rem; margin: 10px 0 0; }
.bump-strip { display: flex; gap: 8px; overflow-x: auto; padding: 14px 2px 6px; -webkit-overflow-scrolling: touch; }
.bump-cell { flex: none; width: 64px; text-align: center; }
.bump-cell img { width: 64px; height: 84px; object-fit: cover; border-radius: var(--r-sm); border: 1px solid var(--line); }
.bump-cell span { display: block; font-size: 0.64rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); margin-top: 4px; }
.bump-missing { display: flex; align-items: center; justify-content: center; width: 64px; height: 84px; border: 1px dashed var(--line); border-radius: var(--r-sm); color: var(--ink-soft); }

/* ---------- Text size (Settings) ---------- */
html[data-textsize="s"] { font-size: 15px; }
html[data-textsize="l"] { font-size: 18px; }

/* ---------- Settings sheet ---------- */
.gear-btn {
  position: absolute; top: max(14px, env(safe-area-inset-top)); right: 16px; z-index: 5;
  width: 42px; height: 42px; border-radius: 50%; cursor: pointer;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  color: var(--ink-soft);
  display: flex; align-items: center; justify-content: center;
}
.gear-btn .ico { width: 20px; height: 20px; }
.gear-btn:hover { color: var(--accent-deep); }
.gear-btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.sheet { position: fixed; inset: 0; z-index: 80; display: flex; align-items: flex-end; justify-content: center; background: color-mix(in srgb, var(--ink) 45%, transparent); }
.sheet-card {
  width: 100%; max-width: 560px; max-height: 86vh; overflow-y: auto;
  background: var(--bg); border: 1px solid var(--line); border-bottom: none;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: 20px 20px calc(24px + env(safe-area-inset-bottom));
  animation: sheet-up var(--dur-3) var(--ease);
}
@keyframes sheet-up { from { transform: translateY(24px); opacity: 0.6; } to { transform: none; opacity: 1; } }
@media (min-width: 640px) {
  .sheet { align-items: center; padding: 24px; }
  .sheet-card { border-radius: var(--r-xl); border-bottom: 1px solid var(--line); }
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.sheet-head h2 { font-family: var(--font-display); font-weight: 560; font-size: 1.5rem; color: var(--ink); margin: 0; }
.sheet-close { width: 38px; height: 38px; border-radius: 50%; border: none; background: var(--surface-2); color: var(--ink-soft); font-size: 1.3rem; line-height: 1; cursor: pointer; }
.sheet-close:hover { color: var(--accent-deep); }
.set-group { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; margin-top: 14px; }
.set-group .field-label { margin-bottom: 10px; }
.set-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.set-note { font-size: 0.78rem; color: var(--ink-soft); margin: 10px 0 0; }
.signout-btn { background: none; border: 1px solid var(--line); color: var(--danger); border-radius: var(--r-pill); padding: 10px 20px; font-family: var(--font-body); font-weight: 700; font-size: 0.85rem; cursor: pointer; }
.signout-btn:hover { border-color: var(--danger); }
.set-about { text-align: center; color: var(--ink-soft); font-size: 0.8rem; }
.set-about .quiet-btn, .quiet-btn { background: none; border: 1px solid var(--line); color: var(--accent-deep); border-radius: var(--r-pill); padding: 9px 18px; font-family: var(--font-body); font-weight: 700; font-size: 0.8rem; cursor: pointer; }
.quiet-btn:hover { border-color: var(--accent); }
/* the moved appearance/alerts sections drop their page-context margins inside the sheet */
.sheet .appearance { margin: 0; max-width: none; text-align: left; }
.sheet .appearance .appearance-row { justify-content: flex-start; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; z-index: 90;
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 16px);
  transform: translateX(-50%) translateY(8px);
  background: var(--ink); color: var(--bg);
  padding: 10px 20px; border-radius: var(--r-pill);
  font-size: 0.85rem; font-weight: 600;
  opacity: 0; pointer-events: none;
  transition: opacity var(--dur-2) ease, transform var(--dur-2) var(--ease);
}
.toast.show { opacity: 1; transform: translateX(-50%); }

/* ---------- Tab jump menu ---------- */
.tab-menu-scrim { position: fixed; inset: 0; z-index: 45; }
.tab-menu {
  position: fixed; z-index: 46;
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 10px);
  min-width: 200px; max-width: min(280px, calc(100vw - 16px));
  max-height: 60vh; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow-3);
  padding: var(--sp-2);
  animation: menu-pop var(--dur-2) var(--ease);
}
@keyframes menu-pop { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.tab-menu-head { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--accent-deep); font-weight: 700; padding: 6px 12px 8px; }
.tab-menu-item { display: block; width: 100%; text-align: left; background: none; border: none; border-radius: var(--r-sm); padding: 11px 12px; font-family: var(--font-body); font-size: 0.95rem; color: var(--ink); cursor: pointer; }
.tab-menu-item:hover, .tab-menu-item:focus-visible { background: var(--surface-2); outline: none; }
.tab-menu-item:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }

/* jump target highlight (outline doesn't shift layout) */
.jump-flash { animation: jump-flash 1.4s var(--ease); }
@keyframes jump-flash {
  0% { outline: 3px solid var(--accent); outline-offset: 4px; }
  70% { outline: 3px solid var(--accent); outline-offset: 4px; }
  100% { outline: 3px solid transparent; outline-offset: 4px; }
}
.page > .wrap > * { scroll-margin-top: var(--sp-4); }

/* ---------- Gate shake (wrong passcode) ---------- */
@keyframes gate-shake { 0%,100% { transform: translateX(0); } 20%,60% { transform: translateX(-7px); } 40%,80% { transform: translateX(7px); } }
.gate-card.shake { animation: gate-shake 0.4s ease; }

/* ---------- Char counter ---------- */
.char-count { display: block; text-align: right; font-size: 0.72rem; color: var(--ink-soft); margin-top: 4px; min-height: 1em; font-variant-numeric: tabular-nums; }

/* ---------- Pool "you" marker ---------- */
.pool-you { display: inline-block; font-size: 0.62rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--on-accent); background: var(--support); border-radius: var(--r-pill); padding: 2px 9px; margin-left: 7px; vertical-align: middle; }

/* ---------- Skin personality: Vintage Sports ---------- */
/* Crisper, felt-badge geometry + a varsity chain-stitch underline signature. */
html[data-skin="sports"] {
  --r-sm: 6px; --r-md: 8px; --r-lg: 10px; --r-xl: 12px;
}
/* Varsity signature: eyebrows read like felt-banner lettering on a stitched underline */
html[data-skin="sports"] .eyebrow { letter-spacing: 0.2em; text-transform: uppercase; font-weight: 700; }
html[data-skin="sports"] .hero .eyebrow { display: inline-block; padding-bottom: 6px; border-bottom: 3px double var(--accent); }
html[data-skin="sports"] .hero h1 .first { text-transform: uppercase; letter-spacing: 0.03em; }
/* Countdown tiles as a scoreboard row (scoped to the countdown only) */
html[data-skin="sports"] .count .tiles { gap: 8px; max-width: 560px; }
html[data-skin="sports"] .count .tile { background: var(--ink); border: none; border-radius: var(--r-sm); box-shadow: var(--shadow-2); }
html[data-skin="sports"] .count .tile .num { color: var(--surface); }
html[data-skin="sports"] .count .tile .lab { color: color-mix(in srgb, var(--surface) 66%, var(--ink)); }
/* Sports divider: stars ride a solid varsity rule instead of a stitched seam */
html[data-skin="sports"] .paw-rule::before { border-top: 3px solid var(--accent); }

/* ---------- Skin personality: Boise State Broncos ---------- */
/* Crisp geometry, orange varsity underline, and a blue-turf scoreboard. */
html[data-skin="broncos"] {
  --r-sm: 6px; --r-md: 8px; --r-lg: 10px; --r-xl: 12px;
}
html[data-skin="broncos"] .eyebrow { letter-spacing: 0.18em; text-transform: uppercase; font-weight: 700; }
html[data-skin="broncos"] .hero .eyebrow { display: inline-block; padding-bottom: 5px; border-bottom: 3px solid var(--accent); }
html[data-skin="broncos"] .hero h1 .first { text-transform: uppercase; letter-spacing: 0.02em; }
/* Countdown tiles as the blue field with white numerals */
html[data-skin="broncos"] .count .tiles { gap: 8px; max-width: 560px; }
html[data-skin="broncos"] .count .tile { background: var(--support); border: none; border-radius: var(--r-sm); box-shadow: var(--shadow-2); }
html[data-skin="broncos"] .count .tile .num { color: #fff; }
html[data-skin="broncos"] .count .tile .lab { color: rgba(255,255,255,0.72); }
/* Divider: stars on an orange rule */
html[data-skin="broncos"] .paw-rule::before { border-top: 3px solid var(--accent); }

/* ---------- Responsive ---------- */
@media (max-width: 540px) {
  .tiles { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .letters { columns: 1; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .bear { animation: none; }
  .bear.squish { animation: none; }
  .tile.pulse::before { animation: none; }
  .float-heart { animation: none; display: none; }
  .sync[data-state="saving"] .dot { animation: none; }
  button.send, .btn-primary { transition: none; }
  .gate-card { animation: none; }
  .tabbar { transition: none; }
  .tab-menu { animation: none; }
  .jump-flash { animation: none; }
}

/* ---------- Print (keepsake pages) ---------- */
@media print {
  body { background: none; padding-bottom: 0; }
  #field, .tabbar, .gate, form, .quick, .care-who, .care-status, .actions,
  .bc-wrap, .ctimer, .ct-list, .ct-note, .ct-status, .album-toggle,
  .del, .sync, .tap-hint, .appearance { display: none !important; }
  .letter, .sched-item, .meaning { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
  .letters { columns: 1; }
}

/* ---- Freezer stash (milk) ---- */
.milk-next { margin: 4px 0 10px; color: var(--accent-deep); font-family: var(--font-display); font-style: italic; font-size: 0.95rem; }
.milk-flag { font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--accent-deep); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 1px 7px; margin-left: 6px; vertical-align: middle; }

/* ---- Emergency / babysitter info ---- */
.emerg-view { display: flex; flex-direction: column; gap: 8px; margin: 8px 0; }
.emerg-view:empty { display: none; }
.emerg-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 13px; background: var(--surface); }
.emerg-lab { font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--accent-deep); font-weight: 600; flex: none; max-width: 55%; }
.emerg-val { color: var(--ink); text-align: right; }
.emerg-tel { color: var(--accent-deep); font-family: var(--font-display); font-size: 1.15rem; text-decoration: none; font-variant-numeric: tabular-nums; }
.emerg-tel:hover { text-decoration: underline; }

.sitter-scrim { position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,0.55); display: flex; align-items: flex-start; justify-content: center; padding: 18px; overflow-y: auto; -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
.sitter-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--shadow-2); max-width: 480px; width: 100%; margin: auto; padding: 20px 20px 16px; }
.sitter-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.sitter-title { font-family: var(--font-display); font-size: 1.15rem; color: var(--ink); }
.sitter-close { flex: none; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: none; color: var(--ink-soft); font-size: 1.4rem; line-height: 1; cursor: pointer; }
.sitter-body { display: flex; flex-direction: column; gap: 10px; }
.sitter-body .emerg-row { padding: 13px 15px; }
.sitter-body .emerg-tel { font-size: 1.3rem; }
.sitter-foot { margin: 14px 0 0; text-align: center; color: var(--ink-soft); font-size: 0.85rem; }

/* ---- Milestone badges ---- */
.badges { text-align: center; }
.badge-count { font-family: var(--font-body); font-size: 0.8rem; color: var(--accent-deep); font-weight: 600; }
.badge-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 18px; }
.badge { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 14px 6px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); opacity: 0.45; filter: grayscale(1); }
.badge.on { opacity: 1; filter: none; border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); box-shadow: var(--shadow-1); }
.badge-ico { font-size: 1.7rem; line-height: 1; }
.badge-name { font-size: 0.68rem; color: var(--ink); text-align: center; line-height: 1.25; }
@media (max-width: 400px) { .badge-grid { gap: 9px; } .badge-ico { font-size: 1.5rem; } }

/* ---- WHO percentile readout ---- */
.who-pct { margin: 6px 0 0; font-size: 0.85rem; color: var(--accent-deep); font-family: var(--font-display); font-style: italic; }
.who-pct[hidden] { display: none; }

/* ---- Seasonal touch (subtle glyph on the countdown eyebrow) ---- */
[data-season] .count > .eyebrow::after { margin-left: 7px; font-size: 0.9em; opacity: 0.85; }
[data-season="spring"] .count > .eyebrow::after { content: "\1F337"; }
[data-season="summer"] .count > .eyebrow::after { content: "\2600\FE0F"; }
[data-season="autumn"] .count > .eyebrow::after { content: "\1F342"; }
[data-season="winter"] .count > .eyebrow::after { content: "\2744\FE0F"; }
[data-season="holiday"] .count > .eyebrow::after { content: "\1F384"; }

/* ---- Sick-day log (health) ---- */
#healthCard .form-card { margin-bottom: 10px; }
.fever { display: inline-block; font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 700; color: #fff; background: #c0392b; border-radius: var(--r-pill); padding: 1px 7px; margin-left: 6px; vertical-align: middle; }

/* ---- Night mode (dim 3am logger) ---- */
.night-launch { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin-top: 14px; padding: 13px; background: none; border: 1px dashed var(--line); border-radius: var(--r-md); color: var(--accent-deep); font-family: var(--font-body); font-weight: 600; font-size: 0.9rem; cursor: pointer; }
.night-launch .ico { width: 17px; height: 17px; }
.night-launch:hover { border-color: var(--accent); }

.night-scrim { position: fixed; inset: 0; z-index: 300; background: #0a0705; color: #b8823f; display: flex; flex-direction: column; padding: 22px 16px calc(20px + env(safe-area-inset-bottom)); }
.night-top { display: flex; align-items: center; justify-content: space-between; }
.night-clock { font-size: 1.55rem; font-variant-numeric: tabular-nums; color: #a86f34; letter-spacing: 0.02em; }
.night-close { background: none; border: 1px solid #4a3418; color: #b8823f; border-radius: var(--r-pill); padding: 8px 20px; font-size: 1rem; cursor: pointer; }
.night-status { text-align: center; margin: 20px 0 6px; font-size: 1.05rem; color: #9c6a33; min-height: 1.3em; }
.night-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; flex: 1; align-content: center; max-width: 460px; width: 100%; margin: 0 auto; }
.night-grid button { background: #17100a; border: 1px solid #3a2913; color: #c98f4d; border-radius: var(--r-lg); padding: 24px 10px; font-size: 1.3rem; font-family: var(--font-display); cursor: pointer; min-height: 84px; }
.night-grid button:active { background: #241812; }
.night-toast { text-align: center; min-height: 1.4em; margin-top: 14px; font-size: 1rem; color: #7a5326; opacity: 0; transition: opacity 0.2s ease; }
.night-toast.show { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .night-toast { transition: none; } }

/* ---- Sleep insights ---- */
.sleep-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 4px; }
.sleep-grid .tile { margin: 0; }
.sleep-grid .tile .num { font-size: clamp(1.4rem, 5vw, 1.9rem); }
.sleep-trend { margin: 14px 0 0; text-align: center; color: var(--accent-deep); font-family: var(--font-display); font-style: italic; font-size: 0.95rem; }
.sleep-trend:empty { display: none; }

/* ---- "Who does he look like?" vote ---- */
.look-vote { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 4px 0 18px; }
.look-vote button { padding: 16px 6px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); color: var(--ink); font-family: var(--font-display); font-size: 1.05rem; cursor: pointer; }
.look-vote button.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, var(--surface)); color: var(--accent-deep); }
.look-row { margin-bottom: 12px; }
.look-row-top { display: flex; justify-content: space-between; font-size: 0.85rem; color: var(--ink); margin-bottom: 5px; }
.look-row-top span:last-child { color: var(--accent-deep); font-variant-numeric: tabular-nums; }
.look-bar { height: 9px; border-radius: var(--r-pill); background: var(--line); overflow: hidden; }
.look-bar span { display: block; height: 100%; background: var(--accent); border-radius: var(--r-pill); transition: width 0.4s ease; }
.look-names { font-size: 0.75rem; color: var(--ink-soft); margin-top: 4px; }
@media (prefers-reduced-motion: reduce) { .look-bar span { transition: none; } }
