/* Nestlog — "night light" theme. Dark by default because most logging
   happens in a dim room; warm amber for actions, low glare everywhere. */

@font-face {
  font-family: "Bricolage";
  src: url("/fonts/bricolage.woff2") format("woff2");
  font-weight: 200 800;
  font-stretch: 75% 100%;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #171a33;
  --surface: #1f2342;
  --surface-2: #282d52;
  --surface-3: #323866;
  --line: #363c6b;
  --text: #eeebf7;
  --muted: #a3a5c8;
  --faint: #6f7299;
  --accent: #f4b860;
  --accent-ink: #2a1d05;
  --danger: #ff8a8a;
  --focus: #f4b860;
  /* activity colors (validated as chart series on --surface) */
  --c-feed: #c98500;
  --c-diaper: #199e70;
  --c-sleep: #9085e9;
  --c-pump: #3987e5;
  --c-growth: #d95926;
  --c-health: #d55181;
  --c-milestone: #e66767;
  --grid: #2c3159;
  --shadow: 0 18px 50px rgba(5, 6, 20, 0.55);
  --display: "Bricolage", ui-rounded, "SF Pro Rounded", system-ui, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --r-lg: 22px;
  --r-md: 14px;
  --r-sm: 10px;
  --tabs-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #eceef7;
  --surface: #ffffff;
  --surface-2: #f3f4fa;
  --surface-3: #e5e7f3;
  --line: #d9dcec;
  --text: #1b1e3a;
  --muted: #565b7e;
  --faint: #8a8eab;
  --accent: #353c8c;
  --accent-ink: #ffffff;
  --danger: #c22f2f;
  --focus: #353c8c;
  --c-feed: #b37600;
  --c-diaper: #138a60;
  --c-sleep: #6250d6;
  --c-pump: #2a78d6;
  --c-growth: #d25722;
  --c-health: #c9467a;
  --c-milestone: #d33c3b;
  --grid: #e4e6f1;
  --shadow: 0 18px 50px rgba(30, 34, 70, 0.18);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]):not([data-theme="light"]) {
    color-scheme: light;
    --bg: #eceef7;
    --surface: #ffffff;
    --surface-2: #f3f4fa;
    --surface-3: #e5e7f3;
    --line: #d9dcec;
    --text: #1b1e3a;
    --muted: #565b7e;
    --faint: #8a8eab;
    --accent: #353c8c;
    --accent-ink: #ffffff;
    --danger: #c22f2f;
    --focus: #353c8c;
    --c-feed: #b37600;
    --c-diaper: #138a60;
    --c-sleep: #6250d6;
    --c-pump: #2a78d6;
    --c-growth: #d25722;
    --c-health: #c9467a;
    --c-milestone: #d33c3b;
    --grid: #e4e6f1;
    --shadow: 0 18px 50px rgba(30, 34, 70, 0.18);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 var(--body);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg.i { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

#app { max-width: 640px; margin: 0 auto; padding: calc(var(--safe-t) + 12px) 16px calc(var(--tabs-h) + var(--safe-b) + 28px); }
.boot { padding: 30vh 0; text-align: center; color: var(--muted); }

/* ---------- tabs */
#tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; justify-content: center;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  padding-bottom: var(--safe-b);
}
#tabs .tabs-in { display: flex; width: 100%; max-width: 640px; }
#tabs a {
  flex: 1; height: var(--tabs-h); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  text-decoration: none; color: var(--faint); font-size: 12px; font-weight: 600;
}
#tabs a[aria-current="page"] { color: var(--text); }
#tabs a[aria-current="page"] svg { color: var(--accent); }

/* ---------- header */
.top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin: 6px 0 18px; }
.who { display: flex; align-items: center; gap: 14px; min-width: 0; background: none; border: 0; padding: 0; text-align: left; }
.avatar {
  width: 54px; height: 54px; border-radius: 50%; flex: none; overflow: hidden;
  display: grid; place-items: center; background: var(--surface-2); color: var(--muted);
  font: 700 22px var(--display); border: 2px solid var(--surface-3);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.who h1 { margin: 0; font: 700 34px/1 var(--display); letter-spacing: -0.02em; font-stretch: 92%; }
.who .age { color: var(--muted); font-size: 14px; margin-top: 4px; }
.who .swap { display: inline-flex; align-items: center; color: var(--faint); vertical-align: middle; }
.who .swap svg { width: 20px; height: 20px; }
.today-date { color: var(--muted); font-size: 14px; text-align: right; padding-top: 6px; white-space: nowrap; }

.tally { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--muted); font-size: 14px; margin: -4px 0 18px; }
.tally b { color: var(--text); font-weight: 650; font-variant-numeric: tabular-nums; }

/* ---------- live timer band (the one moving thing on the page) */
.live {
  position: relative; display: flex; align-items: center; gap: 14px;
  padding: 16px 16px 16px 18px; margin-bottom: 12px; border-radius: var(--r-lg);
  background: color-mix(in srgb, var(--lamp) 22%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--lamp) 55%, transparent);
  overflow: hidden;
}
.live::before {
  content: ""; position: absolute; inset: -40% auto -40% -20%; width: 55%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--lamp) 45%, transparent), transparent);
  animation: glow 4.5s ease-in-out infinite; pointer-events: none;
}
@keyframes glow { 0%, 100% { opacity: .35; } 50% { opacity: .9; } }
@media (prefers-reduced-motion: reduce) { .live::before { animation: none; opacity: .5; } }
.live .what { flex: 1; min-width: 0; position: relative; }
.live .what small { display: block; color: var(--muted); font-size: 13px; }
.live .clock { font: 700 30px/1.05 var(--display); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.live .btn { position: relative; }

/* ---------- glance rows */
.glance { display: grid; gap: 10px; }
.g {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 12px;
  padding: 16px 12px 16px 18px; background: var(--surface); border-radius: var(--r-lg);
  border-left: 4px solid var(--lamp);
}
.g-main { min-width: 0; background: none; border: 0; padding: 0; text-align: left; display: block; width: 100%; }
.g .label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; font-weight: 600; }
.g .label svg { color: var(--lamp); width: 19px; height: 19px; }
.g .big { font: 650 28px/1.1 var(--display); letter-spacing: -0.015em; margin: 6px 0 2px; font-variant-numeric: tabular-nums; }
.g .big .unit { font-weight: 500; color: var(--muted); font-size: 18px; letter-spacing: 0; }
.g .sub { color: var(--muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; }
.g.compact .big { font-size: 19px; margin-top: 6px; }
.g .measures { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 8px; }
.g .measures div { font: 600 18px/1.2 var(--display); }
.g .measures small { display: block; font: 500 13px var(--body); color: var(--muted); }
.add {
  width: 52px; height: 52px; border-radius: 50%; border: 0; display: grid; place-items: center;
  background: var(--surface-2); color: var(--text);
}
.add:active { transform: scale(.96); }
.add svg { width: 24px; height: 24px; color: var(--lamp); stroke-width: 2.2; }
.empty-g { color: var(--faint); }

.lamp-feed { --lamp: var(--c-feed); }
.lamp-diaper { --lamp: var(--c-diaper); }
.lamp-sleep { --lamp: var(--c-sleep); }
.lamp-pump { --lamp: var(--c-pump); }
.lamp-growth { --lamp: var(--c-growth); }
.lamp-health { --lamp: var(--c-health); }
.lamp-milestone { --lamp: var(--c-milestone); }

/* ---------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--text); font-weight: 650; font-size: 15px; white-space: nowrap;
  text-decoration: none;
}
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn.danger { color: var(--danger); background: transparent; }
.btn.block { width: 100%; }
.btn.small { min-height: 34px; padding: 0 12px; font-size: 14px; }
.btn:disabled { opacity: .5; }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: transparent; border: 0; color: var(--text); }
.linkish { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 650; }
.row-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }

/* ---------- section headings */
h2.sec { font: 700 22px/1.2 var(--display); letter-spacing: -0.01em; margin: 26px 0 10px; }
h2.sec:first-child { margin-top: 6px; }
.page-title { font: 700 30px/1.1 var(--display); letter-spacing: -0.02em; margin: 8px 0 16px; }
.hint { color: var(--muted); font-size: 14px; }
.fine { color: var(--faint); font-size: 13px; }

/* ---------- segmented + chips */
.seg { display: inline-flex; background: var(--surface); border-radius: 999px; padding: 4px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 8px 14px; border-radius: 999px; color: var(--muted); font-weight: 650; font-size: 14px; }
.seg button[aria-pressed="true"] { background: var(--surface-3); color: var(--text); }
.seg.full { display: flex; }
.seg.full button { flex: 1; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1.5px solid var(--line); background: transparent; color: var(--text);
  border-radius: 999px; padding: 9px 15px; font-weight: 600; font-size: 15px; min-height: 42px;
  display: inline-flex; align-items: center; gap: 6px;
}
.chip[aria-pressed="true"] { background: color-mix(in srgb, var(--lamp, var(--accent)) 28%, var(--surface-2)); border-color: var(--lamp, var(--accent)); }
.chip .x { color: var(--muted); margin-left: 2px; }
.big-choice { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 10px; }
.big-choice .chip { justify-content: center; min-height: 64px; border-radius: var(--r-md); font-size: 17px; flex-direction: column; gap: 2px; }
.big-choice .chip small { font-size: 12px; color: var(--muted); font-weight: 500; }

/* ---------- lists */
.list { background: var(--surface); border-radius: var(--r-lg); overflow: hidden; }
.list + .list { margin-top: 10px; }
.day-h { color: var(--muted); font-size: 14px; font-weight: 650; margin: 20px 4px 8px; }
.day-h:first-child { margin-top: 4px; }
.item {
  display: flex; align-items: center; gap: 14px; width: 100%; padding: 13px 14px 13px 16px;
  background: transparent; border: 0; text-align: left; color: var(--text); text-decoration: none;
}
.item + .item { border-top: 1px solid var(--line); }
.item .ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--lamp) 22%, transparent); color: var(--lamp); flex: none; }
.item .ic svg { width: 20px; height: 20px; }
.item .tx { flex: 1; min-width: 0; }
.item .t1 { font-weight: 650; }
.item .t2 { color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.item .when { color: var(--muted); font-size: 14px; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.item .chev { color: var(--faint); width: 18px; height: 18px; }
.item .thumbs { display: flex; gap: 4px; margin-top: 6px; }
.item .thumbs img { width: 34px; height: 34px; border-radius: 8px; object-fit: cover; }
.more { display: block; margin: 14px auto 0; }
.empty { text-align: center; padding: 40px 18px; color: var(--muted); }
.empty .btn { margin-top: 14px; }

/* ---------- week strip */
.weekbar { display: grid; grid-template-columns: 36px repeat(7, 1fr) 36px; align-items: center; background: var(--surface); border-radius: var(--r-lg); padding: 8px 4px; }
.weekbar .d { border: 0; background: transparent; border-radius: 12px; padding: 6px 0; display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--muted); font-size: 12px; font-weight: 650; }
.weekbar .d b { font: 650 18px var(--display); color: var(--text); }
.weekbar .d[aria-pressed="true"] { background: var(--surface-3); }
.weekbar .d.is-today b { color: var(--accent); }
.weekbar .d:disabled { opacity: .35; }
.hist-tools { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 12px 0 4px; flex-wrap: wrap; }
.month { font: 650 20px var(--display); }
.daysum { display: grid; gap: 8px; margin-top: 12px; }
.daysum .s { display: flex; align-items: center; gap: 12px; background: var(--surface); border-radius: var(--r-md); padding: 12px 14px; border-left: 4px solid var(--lamp); }
.daysum .s svg { color: var(--lamp); }
.daysum .s .n { font: 650 18px var(--display); }
.daysum .s .m { color: var(--muted); font-size: 14px; }

/* ---------- week grid */
.wgrid-wrap { background: var(--surface); border-radius: var(--r-lg); padding: 10px 10px 12px 4px; margin-top: 12px; }
.wlegend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--muted); padding: 2px 8px 10px 44px; }
.wlegend span { display: inline-flex; align-items: center; gap: 6px; }
.wlegend i { display: inline-block; }
.wlegend .k-sleep { width: 10px; height: 14px; border-radius: 3px; background: var(--c-sleep); }
.wlegend .k-feed { width: 14px; height: 4px; border-radius: 2px; background: var(--c-feed); }
.wlegend .k-diaper { width: 9px; height: 9px; border-radius: 50%; background: var(--c-diaper); }
.wgrid { display: grid; grid-template-columns: 40px repeat(7, 1fr); }
.wgrid .hours { position: relative; height: 576px; }
.wgrid .hours span { position: absolute; right: 6px; transform: translateY(-50%); font-size: 11px; color: var(--faint); font-variant-numeric: tabular-nums; }
.wcol { position: relative; height: 576px; border-left: 1px solid var(--grid); background: repeating-linear-gradient(to bottom, transparent 0, transparent 143px, var(--grid) 143px, var(--grid) 144px); }
.wcol.sel { background-color: color-mix(in srgb, var(--accent) 7%, transparent); }
.wcol .blk { position: absolute; left: 18%; right: 18%; background: var(--c-sleep); border-radius: 4px; border: 0; padding: 0; min-height: 3px; }
.wcol .tick { position: absolute; left: 10%; right: 52%; height: 4px; border-radius: 2px; background: var(--c-feed); border: 0; padding: 0; transform: translateY(-2px); }
.wcol .dot { position: absolute; right: 12%; width: 9px; height: 9px; border-radius: 50%; background: var(--c-diaper); border: 2px solid var(--surface); padding: 0; transform: translateY(-50%); box-sizing: content-box; }
.wcol .hit { position: absolute; inset: 0; background: transparent; border: 0; padding: 0; }
.whead { display: grid; grid-template-columns: 40px repeat(7, 1fr); text-align: center; font-size: 12px; color: var(--muted); font-weight: 650; padding-bottom: 6px; }

/* ---------- charts */
.chart-card { background: var(--surface); border-radius: var(--r-lg); padding: 16px 14px 10px; margin-top: 12px; position: relative; }
.chart-card h3 { margin: 0; font: 650 17px var(--display); display: flex; align-items: center; gap: 8px; }
.chart-card h3 svg { color: var(--lamp); width: 19px; height: 19px; }
.chart-card .avg { color: var(--muted); font-size: 14px; margin: 2px 0 6px; }
.chart-card .avg b { color: var(--text); }
svg.chart { width: 100%; height: auto; display: block; overflow: visible; }
svg.chart text { fill: var(--faint); font: 11px var(--body); font-variant-numeric: tabular-nums; }
svg.chart .gridline { stroke: var(--grid); stroke-width: 1; }
svg.chart .axis { stroke: var(--line); stroke-width: 1; }
svg.chart .bar { fill: var(--lamp); }
svg.chart .bar.on { fill: color-mix(in srgb, var(--lamp) 75%, var(--text)); }
svg.chart .hit { fill: transparent; cursor: pointer; }
svg.chart .curve { fill: none; stroke: var(--muted); stroke-width: 1.2; opacity: .55; }
svg.chart .curve.mid { stroke-width: 2; opacity: .85; }
svg.chart .plabel { fill: var(--muted); font-size: 10.5px; }
svg.chart .kid-line { fill: none; stroke: var(--c-growth); stroke-width: 2; }
svg.chart .kid-pt { fill: var(--c-growth); stroke: var(--surface); stroke-width: 2; }
svg.chart .kid-pt.on { stroke: var(--text); stroke-width: 2.5; }
svg.chart .split { stroke: var(--faint); stroke-dasharray: 3 4; }
.tip {
  position: absolute; z-index: 3; pointer-events: none; background: var(--surface-3); color: var(--text);
  border-radius: 10px; padding: 7px 10px; font-size: 13px; box-shadow: var(--shadow); white-space: nowrap; transform: translate(-50%, calc(-100% - 10px));
}
.tip b { display: block; font-size: 14px; }
.pt-card { background: var(--surface-2); border-radius: var(--r-md); padding: 12px 14px; margin-top: 10px; display: flex; align-items: center; gap: 12px; }
.pt-card .tx { flex: 1; }
.pt-card .t1 { font: 650 18px var(--display); }
.pt-card .t2 { color: var(--muted); font-size: 14px; }

/* ---------- sheets */
.sheet-wrap { position: fixed; inset: 0; z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(5, 6, 20, .55); animation: fade .18s ease-out; }
.sheet {
  position: relative; width: 100%; max-width: 640px; max-height: calc(100dvh - var(--safe-t) - 24px);
  background: var(--bg); border-radius: 26px 26px 0 0; box-shadow: var(--shadow);
  display: flex; flex-direction: column; animation: rise .22s cubic-bezier(.2, .8, .3, 1);
}
@keyframes rise { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .sheet, .sheet-backdrop { animation: none; } }
.sheet-head {
  display: grid; grid-template-columns: 64px 1fr 64px; align-items: center; padding: 10px 8px;
  border-bottom: 1px solid var(--line); border-radius: 26px 26px 0 0;
  background: color-mix(in srgb, var(--lamp, var(--accent)) 16%, var(--bg));
}
.sheet-head h2 { margin: 0; text-align: center; font: 700 21px var(--display); letter-spacing: -0.01em; }
.sheet-head .save { justify-self: end; background: none; border: 0; color: var(--accent); font-weight: 750; font-size: 17px; padding: 10px 12px; }
.sheet-head .save:disabled { opacity: .4; }
.sheet-body { overflow-y: auto; padding: 16px 16px calc(var(--safe-b) + 24px); -webkit-overflow-scrolling: touch; }
.fields { background: var(--surface); border-radius: var(--r-lg); overflow: hidden; }
.fields + .fields, .fields + .block, .block + .fields, .block + .block { margin-top: 14px; }
.field { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; min-height: 56px; }
.field + .field { border-top: 1px solid var(--line); }
.field > span { font-weight: 600; }
.field.stack { flex-direction: column; align-items: stretch; }
.field input[type="datetime-local"], .field input[type="date"], .field select {
  background: var(--surface-2); border: 0; border-radius: var(--r-sm); padding: 9px 10px; min-height: 40px; color: var(--text); max-width: 62%;
}
.field input.num, .numbox input {
  width: 92px; text-align: right; background: var(--surface-2); border: 0; border-radius: var(--r-sm);
  padding: 9px 10px; min-height: 40px; font-variant-numeric: tabular-nums; font-size: 17px;
}
.numbox { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.numbox input { width: 74px; color: var(--text); }
.field .unit-note { color: var(--muted); font-size: 14px; }
.field .pct { color: var(--muted); font-size: 13px; text-align: right; }
.field textarea, .field input[type="text"], .field input[type="password"], .field input[type="search"], .field input[type="email"] {
  width: 100%; background: var(--surface-2); border: 0; border-radius: var(--r-sm); padding: 11px 12px; color: var(--text); font-size: 16px;
}
.field textarea { min-height: 84px; resize: vertical; }
.block { background: var(--surface); border-radius: var(--r-lg); padding: 14px 16px; }
.block > .lbl { font-weight: 600; margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; }
.switch { position: relative; width: 52px; height: 32px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.switch i { position: absolute; inset: 0; border-radius: 99px; background: var(--surface-3); transition: background .15s; pointer-events: none; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked + i { background: var(--accent); }
.switch input:checked + i::after { transform: translateX(20px); }
.switch input:focus-visible + i { outline: 2px solid var(--focus); outline-offset: 2px; }
.stepper { display: flex; align-items: center; gap: 10px; }
.stepper button { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface-2); font-size: 22px; line-height: 1; }
.stepper input { width: 96px; text-align: center; font: 650 24px var(--display); background: transparent; border: 0; border-bottom: 2px solid var(--line); padding: 4px; }
.amount { display: flex; justify-content: center; align-items: baseline; gap: 6px; }
.photos { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.photos .ph { position: relative; width: 74px; height: 74px; border-radius: 14px; overflow: hidden; background: var(--surface-2); }
.photos .ph img { width: 100%; height: 100%; object-fit: cover; }
.photos .ph button.rm { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .6); color: #fff; display: grid; place-items: center; padding: 0; }
.photos .ph button.rm svg { width: 14px; height: 14px; }
.photos .ph.busy::after { content: ""; position: absolute; inset: 0; background: rgba(0, 0, 0, .45); }
.photos label.btn input { display: none; }
.meta-line { color: var(--faint); font-size: 13px; text-align: center; margin-top: 16px; }
.err { color: var(--danger); font-size: 14px; margin: 10px 2px 0; min-height: 1em; }

/* timers inside sheets */
.timer-face { text-align: center; padding: 12px 0 4px; }
.timer-face .clock { font: 700 54px/1 var(--display); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.timer-face .clock small { font-size: 22px; color: var(--muted); font-weight: 500; margin: 0 6px 0 2px; }
.timer-face .btn { margin-top: 14px; min-width: 180px; }
.sides { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.side {
  border: 2px solid var(--line); background: var(--surface); border-radius: 24px; padding: 18px 10px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.side .nm { font-weight: 650; color: var(--muted); }
.side .t { font: 700 32px var(--display); font-variant-numeric: tabular-nums; }
.side .st { font-size: 13px; color: var(--muted); }
.side[aria-pressed="true"] { border-color: var(--c-feed); background: color-mix(in srgb, var(--c-feed) 20%, var(--surface)); }
.side.last .nm::after { content: " (last)"; font-weight: 500; }

/* picker */
.pick-search { position: sticky; top: -16px; z-index: 2; background: var(--bg); padding: 0 0 10px; }
.pick-search input { width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 12px 16px; font-size: 16px; }
.pick-cat { color: var(--muted); font-size: 13px; font-weight: 650; margin: 14px 4px 6px; }
.pick .item .em { width: 38px; height: 38px; display: grid; place-items: center; font-size: 24px; flex: none; }
.pick .item[aria-pressed="true"] { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.pick .item .ck { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; flex: none; }
.pick .item[aria-pressed="true"] .ck { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.pick .item .ck svg { width: 16px; height: 16px; stroke-width: 3; }

/* auth pages */
.auth { max-width: 420px; margin: 8vh auto 0; }
.auth .brand { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.auth .brand img { width: 52px; height: 52px; border-radius: 14px; }
.auth h1 { font: 700 36px/1.05 var(--display); letter-spacing: -0.02em; margin: 0; }
.auth p { color: var(--muted); }
.auth .btn.primary { margin-top: 16px; }

/* settings */
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 16px; min-height: 56px; }
.set-row + .set-row { border-top: 1px solid var(--line); }
.set-row .tx { flex: 1; min-width: 0; }
.set-row .t2 { color: var(--muted); font-size: 14px; }

/* photo viewer */
.viewer { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .92); display: grid; place-items: center; }
.viewer img { max-width: 100vw; max-height: 100dvh; object-fit: contain; }
.viewer button { position: absolute; top: calc(var(--safe-t) + 10px); right: 10px; color: #fff; }

#toast {
  position: fixed; left: 50%; bottom: calc(var(--tabs-h) + var(--safe-b) + 16px); transform: translate(-50%, 20px);
  background: var(--surface-3); color: var(--text); padding: 12px 18px; border-radius: 999px; box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 80; font-weight: 600; max-width: calc(100vw - 32px);
}
#toast.on { opacity: 1; transform: translate(-50%, 0); }
#toast.bad { color: var(--danger); }
.offline { background: color-mix(in srgb, var(--danger) 20%, var(--surface)); color: var(--text); border-radius: var(--r-md); padding: 10px 14px; margin-bottom: 12px; font-size: 14px; }

@media (min-width: 700px) {
  #app { padding-top: 28px; }
  .sheet { border-radius: 26px; margin-bottom: 4vh; max-height: 88vh; }
  .sheet-wrap { align-items: center; }
}
.who-btn { background: none; border: 0; padding: 0; font: inherit; color: inherit; letter-spacing: inherit; display: inline-flex; align-items: center; gap: 4px; }
.item .t1, .item .t2 { display: block; }
.item .thumbs { display: flex; }
.field input[type="datetime-local"] { max-width: 68%; min-width: 0; font-size: 15px; }
.field .vals { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.field .vals .pct { min-height: 0; }

/* child switcher, shown when a family has more than one child */
.kids { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px 14px; padding: 2px 16px 4px; scrollbar-width: none; }
.kids::-webkit-scrollbar { display: none; }
.kid {
  display: inline-flex; align-items: center; gap: 8px; flex: none; min-height: 44px;
  padding: 4px 16px 4px 4px; border-radius: 999px; border: 1.5px solid var(--line);
  background: var(--surface); color: var(--muted); font-weight: 650; font-size: 15px;
}
.kid .avatar { width: 34px; height: 34px; font-size: 15px; border-width: 0; }
.kid[aria-pressed="true"] { color: var(--text); border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--surface)); }
