/* Idea: a dark bedroom at 3 a.m. Elapsed time is the main visual,
   big buttons stay under the thumb, and no cold hue dazzles at night. */
:root {
  color-scheme: dark;
  --page: #0e0809;
  --bg: #170e11;
  --surface: #251820;
  --raised: #35242c;
  --line: #4a333b;
  --ink: #f6e2cb;
  --muted: #b89c8f;
  --accent: #ff9f5c;
  --on-accent: #1a0e0a;
  --feed: #ffbe6b;
  --diaper: #ef9f8f;
  --sleep: #cfa9c6;
  --a: #ff9f5c;
  --b: #cfa9c6;
  --frame: #2c1e24;
  /* Chart series (validated pair: lightness band, chroma, colour-blind separation). */
  --c1: #c97d33;
  --c2: #8f7ad6;
  --display: "Bricolage Grotesque", "Avenir Next Condensed", "Arial Narrow", sans-serif;
  --body: "Atkinson Hyperlegible", "Avenir Next", Verdana, sans-serif;
}
body[data-mode="day"] {
  color-scheme: light;
  --page: #d9e4e3;
  --bg: #edf3f1;
  --surface: #ffffff;
  --raised: #dfe9e7;
  --line: #c2d1cf;
  --ink: #17282e;
  --muted: #4f656b;
  --accent: #bf3d18;
  --on-accent: #ffffff;
  --feed: #b9570d;
  --diaper: #1f7a68;
  --sleep: #5a4fa6;
  --a: #bf3d18;
  --b: #5a4fa6;
  --frame: #17282e;
  --c1: #b9570d;
  --c2: #5a4fa6;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--page);
  color: var(--ink);
  font: 400 16px/1.4 var(--body);
  font-variant-numeric: tabular-nums;
  -webkit-text-size-adjust: 100%;
  transition: background-color .35s ease;
}
button, textarea, input { font: inherit; color: inherit; }
button:disabled { opacity: .35; cursor: default; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
h1, h2, h3, p { margin: 0; }
svg.i { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; display: block; }

.stage { height: 100%; display: grid; grid-template-columns: minmax(0, 1fr); }
.side { display: none; }
.phone { height: 100%; min-height: 0; display: flex; flex-direction: column; background: var(--bg); position: relative; overflow: hidden; transition: background-color .35s ease; }
.statusbar { display: none; justify-content: space-between; padding: 14px 28px 2px; font-weight: 700; font-size: 14px; }
#screen { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 16px 20px; display: flex; flex-direction: column; gap: 16px; }

/* Desktop: framed phone, table of contents on the left */
@media (min-width: 860px) {
  .stage { grid-template-columns: minmax(260px, 340px) 390px; justify-content: center; align-items: center; gap: 64px; padding: 16px; }
  .side { display: flex; flex-direction: column; gap: 22px; }
  .phone { height: min(844px, 100%); border: 10px solid var(--frame); border-radius: 46px; }
  .statusbar { display: flex; }
}
.side h1 { font: 700 44px/1 var(--display); letter-spacing: -.02em; }
.side > p { color: var(--muted); max-width: 34ch; }
.side-nav { display: flex; flex-direction: column; gap: 4px; }
.side-nav button { text-align: left; padding: 10px 12px; border-radius: 12px; display: grid; gap: 2px; }
.side-nav button strong { font-size: 16px; }
.side-nav button span { color: var(--muted); font-size: 14px; }
.side-nav button:hover { background: var(--raised); }
.side-nav button[aria-current="true"] { background: var(--surface); box-shadow: inset 3px 0 0 var(--accent); }
.side-mode { align-self: flex-start; }

/* Common elements */
.head { display: flex; align-items: center; gap: 12px; }
.head .who { flex: 1; min-width: 0; }
.head h1 { font: 700 30px/1.05 var(--display); letter-spacing: -.01em; }
.head p { color: var(--muted); font-size: 14px; }
.round { width: 44px; height: 44px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; flex: none; }
.tag { font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 99px; padding: 2px 8px; white-space: nowrap; }
.card { background: var(--surface); border-radius: 18px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.card h2, .section { font: 700 18px/1.2 var(--display); }
.section { margin-top: 4px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.btn { min-height: 52px; border-radius: 16px; padding: 12px 16px; font-weight: 700; background: var(--accent); color: var(--on-accent); text-align: center; }
.btn.alt { background: var(--raised); color: var(--ink); }
.btn.mini { min-height: 44px; padding: 8px 14px; border-radius: 12px; font-size: 15px; flex: none; }
.btn:active, .act:active, .chip:active { transform: scale(.97); }

/* Now */
.hero { padding: 6px 2px 2px; }
.hero .label { color: var(--muted); font-size: 16px; }
.big { font: 700 clamp(84px, 27vw, 108px)/.92 var(--display); font-stretch: 82%; letter-spacing: -.01em; color: var(--feed); display: flex; align-items: baseline; gap: .1em; font-variant-numeric: lining-nums; }
.big small { font-size: .38em; font-weight: 600; letter-spacing: 0; }
.big.nowtxt { font-size: clamp(52px, 16vw, 64px); line-height: 1.1; }
.big.clock { font-variant-numeric: tabular-nums lining-nums; }
.big.pop { animation: pop .45s cubic-bezier(.2,1.4,.4,1); }
@keyframes pop { from { transform: translateY(10px) scale(.96); opacity: .3; } }
.hero .detail { font-size: 17px; margin-top: 8px; }
.pill { display: inline-block; margin-top: 8px; padding: 5px 12px; border-radius: 99px; background: var(--raised); font-weight: 700; font-size: 15px; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { background: var(--surface); border-radius: 18px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tile .lab { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); }
.tile .val { font: 700 34px/1.1 var(--display); font-stretch: 85%; letter-spacing: -.02em; }
.tile .val small { font-size: .55em; font-weight: 600; letter-spacing: 0; }
.tile .sub { font-size: 14px; color: var(--muted); }
.tile.diaper .val { color: var(--diaper); }
.tile.sleep .val { color: var(--sleep); }
.breath { width: 8px; height: 8px; border-radius: 50%; background: var(--sleep); animation: breath 4s ease-in-out infinite; }
@keyframes breath { 50% { transform: scale(1.7); opacity: .45; } }
.vit { display: flex; align-items: center; gap: 12px; background: var(--surface); border-radius: 18px; padding: 10px 12px 10px 14px; }
.vit > div { flex: 1; min-width: 0; }
.vit strong { display: block; }
.vit.later { opacity: .7; }
.soins-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 4px; }
.soins-h .section { margin-top: 0; }
.seg.mini { padding: 3px; gap: 3px; }
.seg.mini button { min-height: 38px; padding: 0 12px; font-size: 14px; }
.moment { display: flex; flex-direction: column; gap: 6px; }
.moment-h { display: flex; align-items: baseline; gap: 10px; padding: 0 2px; }
.moment-h h3 { font: 700 24px/1.1 var(--display); font-stretch: 85%; letter-spacing: -.01em; }
.moment.current .moment-h h3 { color: var(--accent); }
.tag.now { border-color: var(--accent); color: var(--accent); font-weight: 700; }
.tag.late { border-color: var(--diaper); color: var(--diaper); font-weight: 700; }
.mrow { display: flex; align-items: center; gap: 12px; background: var(--surface); border-radius: 16px; padding: 8px 14px 8px 8px; min-height: 60px; }
.mrow > div { flex: 1; min-width: 0; }
.mrow strong { display: block; }
.moment.current .mrow:not(.done) { box-shadow: inset 3px 0 0 var(--accent); }
.mrow.done { background: none; border: 1px solid var(--line); }
.mrow.done strong { color: var(--muted); }
.tick { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--accent); display: grid; place-items: center; flex: none; color: var(--accent); }
.tick:hover { background: var(--raised); }
.tick.done { background: var(--raised); border-color: transparent; }
.tick.ghost { border: 2px dashed var(--line); color: var(--muted); }
.tick.ghost svg.i { width: 20px; height: 20px; }
.mrow.later { background: none; border: 1px dashed var(--line); width: 100%; text-align: left; opacity: .75; }
.mrow.later:hover { opacity: 1; }
.mrow .when { font-weight: 700; color: var(--muted); flex: none; }
.linkbtn { color: var(--accent); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.done-mark { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--raised); color: var(--accent); flex: none; }
.dock { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 10px 16px; border-top: 1px solid var(--line); }
.act { min-height: 74px; border-radius: 18px; background: var(--raised); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-weight: 700; font-size: 14px; transition: transform .1s; }
.act.feed svg { color: var(--feed); }
.act.bottle svg { color: var(--feed); }
.act.diaper svg { color: var(--diaper); }
.act.sleep svg { color: var(--sleep); }
.tabs { display: grid; grid-template-columns: repeat(4, 1fr); padding: 4px 8px 8px; border-top: 1px solid var(--line); }
.dock + .tabs { border-top: 0; }
.tabs button { min-height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; font-size: 13px; color: var(--muted); border-radius: 12px; }
.tabs button[aria-current="page"] { color: var(--accent); font-weight: 700; }
@media (min-width: 860px) { .tabs { padding-bottom: 14px; } }

/* Relais */
.relay-title { font: 700 clamp(40px, 12vw, 48px)/1 var(--display); font-stretch: 82%; letter-spacing: -.025em; text-wrap: balance; }
.relay-title em { font-style: normal; color: var(--accent); }
.band-wrap { display: flex; flex-direction: column; gap: 4px; }
.ticks { position: relative; height: 12px; }
.ticks i { position: absolute; bottom: 0; width: 3px; height: 10px; border-radius: 2px; transform: translateX(-50%); }
.band { display: flex; height: 26px; border-radius: 8px; overflow: hidden; gap: 2px; }
.band div { display: flex; align-items: center; padding: 0 8px; font-size: 13px; font-weight: 700; color: var(--on-accent); min-width: 0; overflow: hidden; white-space: nowrap; }
.band .Sveta { background: var(--a); }
.band .David { background: var(--b); color: var(--bg); }
.axis { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }
.rows { display: grid; gap: 10px; }
.row { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 8px; align-items: baseline; }
.row dt, .row > span:first-child { color: var(--muted); font-size: 14px; }
.row.todo b { color: var(--accent); }
textarea { width: 100%; min-height: 72px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); padding: 10px 12px; resize: vertical; line-height: 1.35; font-size: 16px; }
label.field { display: grid; gap: 4px; font-size: 14px; color: var(--muted); }
.quote { border-left: 3px solid var(--accent); padding-left: 10px; }
.person { display: flex; align-items: center; gap: 10px; }
.person > div:nth-child(2) { flex: 1; min-width: 0; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: var(--raised); flex: none; }
.avatar.Sveta { background: var(--a); color: var(--on-accent); }
.avatar.David { background: var(--b); color: var(--bg); }
.log { display: flex; flex-direction: column; }
.log li { display: grid; grid-template-columns: 50px 24px minmax(0, 1fr); gap: 8px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); }
.log li:first-child { border-top: 0; }
.log ul, ul.log { list-style: none; margin: 0; padding: 0; }
.log svg.i { width: 20px; height: 20px; }
.log .feed { color: var(--feed); }
.log .diaper { color: var(--diaper); }
.log .sleep { color: var(--sleep); }

/* Upcoming */
.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; font-size: 12px; color: var(--muted); }
.day { display: grid; gap: 4px; justify-items: center; }
.day b { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; background: var(--raised); color: var(--ink); }
.day b.Sveta { background: var(--a); color: var(--on-accent); }
.day b.David { background: var(--b); color: var(--bg); }
.day b.empty { background: none; border: 2px dashed var(--line); }
.agenda { display: flex; flex-direction: column; }
.ev { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.ev:first-child { border-top: 0; padding-top: 0; }
.ev:last-child { padding-bottom: 0; }
.ev .when { font: 700 22px/1 var(--display); font-stretch: 85%; }
.ev .when small { display: block; font: 400 13px/1.3 var(--body); color: var(--muted); margin-top: 3px; }
.ev.past { color: var(--muted); }
.ev .body { display: grid; gap: 8px; justify-items: start; }
.note { font-size: 14px; color: var(--muted); }

/* Guest link */
.urlbar { margin: 10px 12px 0; padding: 8px 12px; border-radius: 12px; background: var(--raised); font-size: 13px; color: var(--muted); text-align: center; }
.guest-actions { display: grid; gap: 8px; }
.guest-actions .btn { display: flex; align-items: center; justify-content: center; gap: 10px; }
.urg { font-weight: 700; }
.back { display: flex; align-items: center; justify-content: center; min-height: 44px; font-size: 14px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; width: 100%; }

/* Log */
.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--surface); border-radius: 14px; padding: 4px; gap: 4px; }
.seg button { min-height: 44px; border-radius: 10px; font-weight: 700; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--raised); color: var(--ink); }
.daypick { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.daypick button { min-height: 58px; border-radius: 12px; background: var(--surface); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 12px; color: var(--muted); }
.daypick button b { font: 700 18px/1 var(--display); color: var(--ink); }
.daypick button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.daypick button[aria-pressed="true"] b { color: var(--on-accent); }
.jlist { display: flex; flex-direction: column; }
.jlist button { display: grid; grid-template-columns: 50px 24px minmax(0, 1fr) 16px; gap: 8px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); text-align: left; min-height: 48px; width: 100%; border-radius: 0; }
.jlist button:first-child { border-top: 0; }
.jlist svg.i { width: 20px; height: 20px; }
.jlist .feed { color: var(--feed); } .jlist .diaper { color: var(--diaper); } .jlist .sleep { color: var(--sleep); }
.jlist .chev { color: var(--muted); font-size: 20px; text-align: right; }
.bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; height: 132px; }
.bar { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; min-width: 0; height: 100%; border-radius: 8px; }
.bar i { display: block; width: 100%; max-width: 30px; border-radius: 4px 4px 0 0; }
.bar.today i { opacity: .55; }
.bar .bv, .bar .bl { font-size: 12px; color: var(--muted); line-height: 1; white-space: nowrap; }
.bar .bl { padding-top: 4px; border-top: 1px solid var(--line); width: 100%; text-align: center; }
.bar.today .bl { color: var(--ink); font-weight: 700; }
.btn.del { color: var(--diaper); }
.log .med, .jlist .med { color: var(--accent); }
.pickrow { display: grid; grid-template-columns: 36px minmax(0, 1fr) 36px; gap: 6px; }
.arrow { background: var(--surface); border-radius: 12px; font-size: 24px; color: var(--muted); display: grid; place-items: center; }
.bars.month { gap: 2px; }
.bars.month .bar i { max-width: none; border-radius: 2px 2px 0 0; }
.bars.month .bar .bl { border-top: 0; padding-top: 2px; }

/* Care */
.slots { display: flex; gap: 8px; flex-wrap: wrap; }
.slot { min-width: 84px; min-height: 60px; border-radius: 14px; background: var(--raised); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-weight: 700; font-size: 22px; padding: 6px 10px; }
.slot small { font-size: 12px; font-weight: 400; color: var(--muted); }
.slot.done { background: var(--surface); border: 1px solid var(--line); color: var(--accent); }
.slot.done svg.i { width: 22px; height: 22px; }
.day b.ok { background: var(--accent); color: var(--on-accent); }
.day b.part { background: var(--raised); box-shadow: inset 0 0 0 2px var(--accent); }
.day b.off { background: none; }
.card.past { opacity: .6; }
input.txt { width: 100%; min-height: 48px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); padding: 8px 12px; font-size: 16px; color: var(--ink); }

/* Entry */
.scrim { position: absolute; inset: 0; background: rgba(0,0,0,.55); display: flex; align-items: flex-end; z-index: 5; }
.sheet { background: var(--surface); width: 100%; border-radius: 26px 26px 0 0; padding: 18px 16px max(18px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 14px; animation: rise .22s ease-out; max-height: 90%; overflow-y: auto; }
@keyframes rise { from { transform: translateY(40px); opacity: .4; } }
.sheet h2 { font: 700 30px/1.05 var(--display); letter-spacing: -.01em; }
.sheet .grp { display: grid; gap: 6px; }
.sheet .grp > span { color: var(--muted); font-size: 14px; }
.chips { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; }
.chip { min-height: 60px; border-radius: 14px; background: var(--raised); font-weight: 700; font-size: 17px; display: grid; place-items: center; padding: 4px; }
.chip[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.chip small { display: block; font-weight: 400; font-size: 12px; }
.chip.tall { min-height: 92px; gap: 2px; }
.stepper { display: grid; grid-template-columns: 64px 1fr 64px; align-items: center; gap: 8px; }
.stepper output, .stepper input.num { text-align: center; font: 700 52px/1 var(--display); font-stretch: 82%; }
/* Editable number: looks like the big figure, dashed underline hints that it can be typed. */
.stepper input.num { width: 100%; min-width: 0; background: none; border: 0; border-bottom: 2px dashed var(--line); border-radius: 0; color: var(--ink); padding: 4px 0; -moz-appearance: textfield; appearance: textfield; font-variant-numeric: lining-nums tabular-nums; }
.stepper input.num::-webkit-outer-spin-button, .stepper input.num::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper input.num:focus { outline: none; border-bottom-color: var(--accent); }
.stepper output small { font-size: .4em; font-weight: 600; }
.toast { position: absolute; left: 16px; right: 16px; bottom: 170px; background: var(--ink); color: var(--bg); border-radius: 14px; padding: 8px 8px 8px 14px; min-height: 52px; display: flex; align-items: center; gap: 10px; z-index: 6; font-weight: 700; font-size: 15px; animation: rise .2s ease-out; }
.toast span { flex: 1; min-width: 0; }
.toast button { min-height: 40px; padding: 0 12px; text-decoration: underline; text-underline-offset: 3px; }
.toast[hidden] { display: none; }
.toast.low { bottom: 24px; }

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

/* ===================== App additions (beyond the prototype) ===================== */
@font-face { font-family: "Atkinson Hyperlegible"; src: url(/static/fonts/atkinson-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url(/static/fonts/atkinson-700.woff2) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Bricolage Grotesque"; src: url(/static/fonts/bricolage-500-800.woff2) format("woff2"); font-weight: 500 800; font-stretch: 75% 100%; font-display: swap; }

/* A real app: centered column, no phone frame on desktop. */
.phone { max-width: 560px; margin: 0 auto; padding-top: env(safe-area-inset-top); }
@media (min-width: 860px) {
  .phone { height: 100%; border: 0; border-radius: 0; box-shadow: 0 0 0 1px var(--line); }
}
.tabs { grid-template-columns: repeat(3, 1fr); padding-bottom: max(8px, env(safe-area-inset-bottom)); }
.tabs a { min-height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; font-size: 13px; color: var(--muted); border-radius: 12px; text-decoration: none; }
.tabs a[aria-current="page"] { color: var(--accent); font-weight: 700; }
a { color: inherit; }
form.contents { display: contents; }
.ic-day { display: none; } body[data-mode="day"] .ic-night { display: none; } body[data-mode="day"] .ic-day { display: block; }
.head .avatar { text-decoration: none; }
.tile .lab svg.i { width: 16px; height: 16px; }

/* Chip choices: real radio buttons, styled as chips. */
label.chip { cursor: pointer; position: relative; text-align: center; }
label.chip input { position: absolute; opacity: 0; pointer-events: none; }
label.chip:has(input:checked) { background: var(--accent); color: var(--on-accent); }
label.chip:has(input:checked) small { color: inherit; opacity: .85; }
label.chip:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
button.chip[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.chips.wrap { grid-auto-flow: row; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
.sheet form { display: flex; flex-direction: column; gap: 14px; }
.sheet .chips > .chip { min-width: 0; }
.unit { text-align: center; margin-top: -6px; }
input.txt { color-scheme: inherit; }
input.txt[type="time"], input.txt[type="date"] { font-size: 20px; font-weight: 700; }
/* iOS Safari gives date/time inputs an intrinsic width that overflows narrow cards. */
label.field > * { min-width: 0; }
input.txt[type="date"], input.txt[type="time"] { -webkit-appearance: none; appearance: none; display: block; min-width: 0; max-width: 100%; text-align: left; }
input.txt::-webkit-date-and-time-value { text-align: left; }
label.field { color: var(--muted); }
label.check { display: flex; align-items: center; gap: 10px; min-height: 44px; color: var(--ink); }
label.check input { width: 22px; height: 22px; accent-color: var(--accent); }
fieldset.grp { border: 0; padding: 0; margin: 0; display: grid; gap: 4px; }
.who-list { display: grid; gap: 10px; }
.who-list .person { display: flex; align-items: center; gap: 12px; justify-content: flex-start; width: 100%; font-size: 18px; }

/* Log: days as links */
.daypick a, .daypick .dayoff { min-height: 58px; border-radius: 12px; background: var(--surface); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 12px; color: var(--muted); text-decoration: none; }
.daypick .dayoff { opacity: .35; }
.daypick a b, .daypick .dayoff b { font: 700 18px/1 var(--display); color: var(--ink); }
.daypick a[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.daypick a[aria-pressed="true"] b { color: var(--on-accent); }
.arrow { text-decoration: none; }
.arrow[aria-disabled="true"] { opacity: .3; pointer-events: none; }

/* HTMX states: immediate visual feedback on tap. */
.htmx-request button[type="submit"], button.htmx-request { opacity: .6; }
#sheet:empty { display: none; }
.toast[hidden] { display: none; }
.toast form { display: contents; }
.offline { font-size: 12px; color: var(--diaper); border: 1px solid var(--diaper); border-radius: 99px; padding: 2px 8px; }


/* ===================== People: colors, access ===================== */
/* One color per person and per child (key stored in baby_members.color). */
:root {
  --c-abricot: #ff9f5c; --c-lilas: #cfa9c6; --c-menthe: #8fd1b5; --c-ciel: #8fb8e8;
  --c-rose: #f28fa8; --c-citron: #e3d36b; --c-corail: #ff7b6b; --c-sable: #c9b08a;
  --on-c: #1a0e0a;
}
body[data-mode="day"] {
  --c-abricot: #c2410c; --c-lilas: #7e4fa6; --c-menthe: #0f7a5f; --c-ciel: #2563a8;
  --c-rose: #be2d5b; --c-citron: #7a6100; --c-corail: #c23b2b; --c-sable: #8a6a3f;
  --on-c: #ffffff;
}
.c-abricot { --c: var(--c-abricot); } .c-lilas { --c: var(--c-lilas); } .c-menthe { --c: var(--c-menthe); } .c-ciel { --c: var(--c-ciel); }
.c-rose { --c: var(--c-rose); } .c-citron { --c: var(--c-citron); } .c-corail { --c: var(--c-corail); } .c-sable { --c: var(--c-sable); }
.avatar[class*="c-"] { background: var(--c); color: var(--on-c); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--c); margin-right: 5px; vertical-align: 1px; }

.readonly { margin: 0; padding: 14px 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; text-align: center; }
button:disabled { cursor: default; }
.jlist button:disabled { opacity: 1; }
.jlist button:disabled .chev { visibility: hidden; }

/* Pages outside daily tracking */
main.page { gap: 16px; }
.backlink { color: var(--muted); text-decoration: none; font-size: 15px; min-height: 44px; display: inline-flex; align-items: center; align-self: flex-start; }
a.btn { display: flex; align-items: center; justify-content: center; text-decoration: none; }
.flash { padding: 10px 14px; border-radius: 12px; font-size: 15px; border: 1px solid var(--line); }
.flash.ok { border-color: var(--c-menthe); }
.flash.err { border-color: var(--diaper); color: var(--diaper); }
.card form { display: flex; flex-direction: column; gap: 10px; }
.member { display: flex; flex-direction: column; gap: 8px; padding: 10px 0; border-top: 1px solid var(--line); }
.member:first-of-type { border-top: 0; }
.person .tag { flex: none; }
.indent { margin: -4px 0 6px 46px; font-size: 14px; }
details.more summary { cursor: pointer; color: var(--accent); font-weight: 700; font-size: 14px; min-height: 36px; display: flex; align-items: center; }
details.more[open] { display: flex; flex-direction: column; gap: 14px; padding-bottom: 6px; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
label.swatch { width: 40px; height: 40px; border-radius: 50%; background: var(--c); position: relative; cursor: pointer; }
label.swatch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
label.swatch:has(input:checked) { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--ink); }
label.swatch:has(input:disabled) { opacity: .25; cursor: not-allowed; }
label.swatch:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 3px; }
.roles { display: grid; gap: 6px; }
label.rolechoice { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--raised); cursor: pointer; }
label.rolechoice input { accent-color: var(--accent); width: 20px; height: 20px; margin: 2px 0 0; flex: none; }
label.rolechoice:has(input:checked) { box-shadow: inset 0 0 0 2px var(--accent); }
.row-actions { display: flex; gap: 8px; justify-content: flex-end; }

main.page > form > .btn { width: 100%; }

/* Unfinished bottle: left-over stepper shown only when the box is ticked. */
.unfinished { display: flex; flex-direction: column; gap: 10px; }
.unfinished .left-box { display: none; flex-direction: column; gap: 10px; }
.unfinished:has(input[name="unfinished"]:checked) .left-box { display: flex; }
.warn { font-size: 14px; border-left: 3px solid var(--diaper); padding-left: 10px; color: var(--ink); }
/* Day + time side by side in add / correct sheets. */
.when { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.when input.txt[type="date"], .when input.txt[type="time"] { font-size: 18px; }
/* Asleep question: "Autre…" reveals a time field, then Valider beside it. */
#wake-at .wakeat { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; }
#wake-at .wakeat .chip { padding-inline: 22px; width: auto; }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 14px; margin: 6px 0; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
/* Feed timer: running card and its two buttons. */
.hero.running { background: var(--surface); border-radius: 18px; padding: 14px 16px; box-shadow: inset 0 0 0 1px var(--feed); }
.feedctl { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.feedctl .btn { width: 100%; }
.hero .totals { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin-top: 10px; font-size: 16px; color: var(--muted); font-variant-numeric: tabular-nums; }
.hero .totals strong { color: var(--ink); font-size: 20px; }
.cancelfeed { margin-top: 18px; text-align: center; }
.cancelfeed .linkbtn.del { color: var(--diaper); }
.cancelfeed .warn { text-align: left; }
.cancelfeed form { margin-top: 10px; }
.cancelfeed .btn { width: 100%; }

/* Forgotten sleep reminder */
.gapcard { background: var(--surface); border-radius: 18px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; box-shadow: inset 0 0 0 1px var(--sleep); }
.gapcard .lab { display: flex; align-items: center; gap: 6px; font-weight: 700; color: var(--sleep); }
.gapcard .lab svg.i { width: 18px; height: 18px; }
.gapacts { display: flex; flex-wrap: wrap; gap: 8px; }

/* Growth */
.seg.three { grid-template-columns: repeat(3, 1fr); }
.seg.three button { font-size: 15px; }
figure.growth { margin: 0; background: var(--surface); border-radius: 18px; padding: 10px 6px 10px 2px; }
figure.growth svg { display: block; width: 100%; height: auto; overflow: visible; }
figure.growth figcaption { padding: 4px 12px 0; min-height: 1.4em; }
.growth .grid { stroke: var(--line); stroke-width: 1; opacity: .6; }
.growth .grid.v { stroke-dasharray: 2 4; }
.growth .axis, .growth .pctlabel { fill: var(--muted); font-size: 10.5px; font-family: var(--body); }
.growth .band { stroke: none; fill: var(--b); }
.growth .band.outer { opacity: .14; }
.growth .band.inner { opacity: .22; }
.growth .pct { fill: none; stroke: var(--b); stroke-width: 1; opacity: .55; }
.growth .pct.median { stroke-width: 1.5; stroke-dasharray: 5 4; opacity: .9; }
.growth .child { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.growth .dotpt { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.growth .hit { fill: transparent; }
.growth .pt { cursor: pointer; outline: none; }
.growth .pt:focus-visible .dotpt, .growth .pt.on .dotpt { r: 6.5px; }
ul.measures { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
button.measure { width: 100%; text-align: left; background: var(--surface); border-radius: 14px; padding: 12px 14px; display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 10px; align-items: start; }
button.measure:disabled { opacity: 1; cursor: default; }
button.measure .when { display: flex; flex-direction: column; }
button.measure .vals { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
button.measure .vals b { font-size: 17px; }
.source { margin-top: 4px; }

/* Care duration */
form:has(input[name="dur_mode"][value="none"]:checked) .durfor { display: none; }
.durfor { display: flex; flex-direction: column; gap: 8px; margin-top: -4px; }
.durrow { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 8px; align-items: stretch; }
.durrow .durn { width: 100%; min-height: 60px; text-align: center; font-weight: 700; font-size: 18px; padding: 0 4px; }
.durrow .chips { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-flow: column; }
.durrow .chip { font-size: 15px; }

/* Follow-up charts (Repas, Couches) */
.seg.three.mini button { min-height: 38px; font-size: 14px; }
.statgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
.statgrid .val { font-size: 30px; }
figure.chart.daybars { margin: 0; background: var(--surface); border-radius: 18px; padding: 10px 8px 10px 2px; }
figure.chart.daybars svg { display: block; width: 100%; height: auto; overflow: visible; }
figure.chart.daybars figcaption { padding: 6px 12px 0; min-height: 1.4em; }
.chart .grid { stroke: var(--line); stroke-width: 1; opacity: .6; }
.chart .daylab { fill: var(--ink); font-size: 11px; font-weight: 700; font-family: var(--body); }
.chart .axis, .chart .reflabel { fill: var(--muted); font-size: 10.5px; font-family: var(--body); }
.chart .reflabel { fill: var(--ink); font-weight: 700; }
.chart .refline { stroke: var(--ink); stroke-width: 1.2; stroke-dasharray: 4 4; opacity: .7; }
.chart .refmark { stroke: var(--ink); stroke-width: 2; stroke-dasharray: 3 2; stroke-linecap: round; opacity: .8; }
.chart .hit { fill: transparent; }
.chart .bar { cursor: pointer; outline: none; }
.chart .bar.partial rect:not(.hit) { opacity: .55; }
.chart .bar.on rect:not(.hit), .chart .bar:focus-visible rect:not(.hit) { stroke: var(--ink); stroke-width: 1.5; }
.chart .s-breast { fill: var(--c1); }
.chart .s-formula { fill: var(--c2); }
.chart .s-meal { fill: var(--feed); }
.chart .s-gap { fill: var(--sleep); }
.chart .s-wet { fill: var(--diaper); }
.chart .s-dirty { fill: var(--b); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 6px 12px 0; font-size: 13px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.legend i.s-breast { background: var(--c1); }
.legend i.s-formula { background: var(--c2); }
.legend i.refkey { height: 0; border-top: 2px dashed var(--ink); border-radius: 0; width: 14px; }

/* Account deletion */
.linkbtn.danger { display: block; margin: 8px auto 0; color: var(--diaper); text-align: center; }
ul.fates { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 8px; }
.err-text { color: var(--diaper); }
.support { text-align: center; margin-top: 14px; }
.support a { color: inherit; text-decoration: underline; }
