:root {
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  font-family: ui-rounded,"SF Pro Rounded",-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  color: #a44c20;
  background: #fff3e3;
  font-synthesis: none;
  --bg: #fff3e3;
  --surface: #fffdf9;
  --text: #9d481f;
  --muted: #b47f61;
  --border: #efd8bf;
  --accent: #ec6b21;
  --soft: #fbe5cc;
  --shadow: 0 10px 35px #ae65220b;
  --peach: var(--soft);
  --sage: var(--soft);
  --lavender: var(--soft);
  --blue: var(--soft);
  --rose: var(--soft);
  --sand: var(--soft);
}
:root[data-theme=dark] {
  color: #f5c6a5;
  background: #221b19;
  --bg: #221b19;
  --surface: #342923;
  --text: #f5c6a5;
  --muted: #bb977e;
  --border: #57402e;
  --accent: #ff9650;
  --soft: #422d23;
  --shadow: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
  border: 0;
  background: none;
  touch-action: manipulation;
}
button:disabled {
  cursor: default;
  opacity: .5;
}
a {
  color: inherit;
  text-decoration: none;
}
button,
a {
  /* Theme colors change together; fading only the background flashes low-contrast controls. */
  transition: opacity .18s,transform .18s;
}
button:active:not(:disabled) {
  transform: scale(.96);
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1,
h2,
h3 {
  font-weight: 550;
  letter-spacing: -.04em;
}
h1 {
  font-size: 32px;
}
h2 {
  font-size: 22px;
}
h3 {
  font-size: 19px;
}
p {
  line-height: 1.6;
  color: var(--muted);
}
strong {
  font-weight: 550;
}
small {
  font-size: 16px;
}
svg {
  vertical-align: middle;
  flex-shrink: 0;
}
img {
  max-width: 100%;
}
[hidden],
.hidden {
  display: none!important;
}
.muted {
  color: var(--muted);
}
.block {
  display: block;
  margin-top: 12px;
}
.wide {
  width: 100%;
}
.danger {
  color: #bc4333;
}
.eyebrow:empty,
p:empty {
  display: none;
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: .13em;
  font-size: 16px;
}
.boot {
  min-height: 100dvh;
  display: grid;
  place-content: center;
  text-align: center;
  font-size: 50px;
}
.boot span {
  font-size: 16px;
  margin-top: 15px;
}
.round,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  background: var(--surface);
  color: var(--accent);
}
.round.small {
  width: 44px;
  height: 44px;
}
.back-icon {
  display: inline-block;
  transform: rotate(180deg);
}
.journal-app {
  max-width: 980px;
  margin: auto;
  min-height: 100dvh;
}
.journal-header {
  height: 82px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 32px;
}
.wordmark {
  font-size: 25px;
  font-weight: 650;
  letter-spacing: -1.5px;
  color: var(--accent);
}
.wordmark span {
  font-size: 19px;
  display: inline-block;
  transform: rotate(-15deg);
  margin-left: 4px;
}
.connection {
  margin-left: auto;
  font-size: 16px;
}
.sync-status {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
}
.sync-status i,
.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
  display: inline-block;
}
.sync-status.live i,
.live-dot {
  background: var(--accent);
}
.demo-pill {
  font-size: 16px;
  color: var(--muted);
  padding: 8px 0;
}
.journal-main {
  padding: 0 28px 100px;
}
.journal {
  max-width: 540px;
  margin: auto;
}
.baby-heading {
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 6px;
}
.baby-face {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: #ffd9a9;
  font-size: 27px;
  position: relative;
  line-height: 1;
  color: #a85328;
}
.baby-face span {
  display: block;
  font-size: 22px;
  line-height: .8;
}
.baby-heading select {
  border: 0;
  background: transparent;
  font-size: 17px;
  font-weight: 550;
  max-width: 220px;
  text-align: center;
  padding: 3px;
}
.baby-heading > span {
  font-size: 16px;
  color: var(--muted);
}
.quick-orbit {
  display: flex;
  justify-content: space-between;
  max-width: 380px;
  margin: 24px auto 0;
}
.quick-circle {
  width: 106px;
  height: 106px;
  background: var(--surface);
  border-radius: 50%;
  box-shadow: none;
  color: var(--accent);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.quick-circle > span {
  font-size: 16px;
}
.journal-spine {
  position: relative;
  padding-top: 16px;
}
.journal-spine:before {
  content: "";
  position: absolute;
  top: 45px;
  bottom: 24px;
  width: 3px;
  left: calc(50% - 1.5px);
  background: var(--soft);
  z-index: -1;
}
.add-moment {
  display: flex;
  margin: 0 auto 22px;
  width: 58px;
  height: 58px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--surface);
  color: var(--accent);
  box-shadow: 0 0 0 6px var(--soft);
}
.journal-day {
  padding-bottom: 12px;
}
.day-summary {
  background: var(--soft);
  border-radius: 20px;
  max-width: 290px;
  margin: 0 auto 14px;
  text-align: center;
  padding: 13px 18px;
}
.day-summary > button {
  font-size: 16px;
  color: var(--accent);
  padding: 3px 10px;
}
.day-summary > div {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-top: 8px;
  font-size: 16px;
}
.day-summary span {
  display: flex;
  align-items: center;
  gap: 5px;
}
.timeline {
  width: 100%;
}
.moment-row {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1.5fr 1fr;
  align-items: center;
  gap: 10px;
  min-height: 76px;
  padding: 9px 0;
}
.moment-row > time {
  font-size: 16px;
  text-align: left;
  font-variant-numeric: tabular-nums;
}
.moment-row > time small {
  display: block;
  opacity: .55;
  font-size: 16px;
  margin-top: 4px;
}
.moment-capsule {
  justify-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 49px;
  padding: 10px 18px;
  border-radius: 50px;
  background: var(--surface);
  white-space: nowrap;
  font-size: 17px;
  touch-action: pan-y;
  max-width: 100%;
}
.moment-capsule.kind-feed {
  background: var(--accent);
  color: var(--surface);
}
.moment-capsule.kind-sleep {
  color: #ba682c;
}
.moment-capsule.is-running {
  box-shadow: 0 0 0 4px var(--soft);
}
.moment-context {
  font-size: 16px;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  overflow-wrap: anywhere;
}
.moment-note {
  grid-column: 2;
  text-align: center;
  font-size: 16px;
  margin: 0;
  overflow-wrap: anywhere;
}
.running-moments {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.running-pill {
  border-radius: 28px;
  background: var(--surface);
  padding: 10px 15px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
}
.running-pill > span {
  font-size: 16px;
  color: var(--accent);
}
.running-pill > i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}
.journal-empty {
  text-align: center;
  padding: 40px 20px;
  background: var(--bg);
}
.journal-empty h2 {
  margin: 18px 0 7px;
}
.journal-empty p {
  font-size: 16px;
}
[data-entry-stream] .moment-row {
  content-visibility: auto;
  contain-intrinsic-block-size: auto 64px;
}
.older-moments {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 24px auto;
  padding: 14px 20px;
  border-radius: 25px;
  background: var(--soft);
  font-size: 16px;
}
.pending-banner {
  width: 100%;
  border-radius: 16px;
  background: var(--soft);
  padding: 12px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 16px;
  margin: 8px 0 20px;
}
.pending-dot {
  width: 5px;
  height: 5px;
  background: currentColor;
  border-radius: 50%;
  display: inline-block;
}
/* Pin the page on iOS too, while native dialog contents remain scrollable. */
html.modal-open {
  overflow: hidden;
  overscroll-behavior: none;
}
html.modal-open body {
  position: fixed;
  top: var(--modal-scroll-y);
  left: var(--modal-scroll-x);
  width: 100%;
  overflow: hidden;
}
/* One focused canvas for each activity. */
.sheet {
  border: 0;
  padding: 0;
  color: var(--text);
  background: var(--bg);
  width: min(540px,calc(100% - 24px));
  max-height: 90dvh;
  border-radius: 30px;
  box-shadow: 0 30px 100px #44260e20;
  overscroll-behavior: contain;
  animation: arrive .26s cubic-bezier(.2,.8,.2,1);
}
.sheet.sheet-replacement {
  animation: none;
}
.sheet::backdrop {
  background: #5b331a35;
  backdrop-filter: blur(5px);
}
.sheet-inner {
  padding: 28px;
}
.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}
.sheet-header h2 {
  margin: 0;
}
.sheet-header .eyebrow {
  margin: 0 0 6px;
}
.focus-dialog {
  height: min(860px,94dvh);
  max-height: 94dvh;
  width: min(480px,100%);
  overflow: hidden;
}
.focus-dialog .sheet-inner {
  padding: 0;
  height: 100%;
}
.focus-entry {
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  --fill: 33.333%;
}
.focus-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 25px 9px;
  flex-shrink: 0;
}
.focus-header > span {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 16px;
}
.feeding-modes {
  position: relative;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(120px, 1fr);
  flex-shrink: 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-padding-inline: var(--card-padding);
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.feeding-modes button {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  min-width: 0;
  min-height: 116px;
  padding: 14px 8px 12px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  color: var(--text);
  font-size: 16px;
  line-height: 1.25;
  transition: none;
}
.feeding-mode-icon {
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  width: 44px;
  border-radius: 50%;
  background: var(--soft);
  color: var(--accent);
}
.feeding-mode-label { margin-block: auto; overflow-wrap: anywhere; }
.feeding-mode-check {
  position: absolute;
  top: 7px;
  right: 7px;
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  visibility: hidden;
  background: var(--on-accent);
  color: var(--accent);
}
.feeding-modes button.selected {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--on-accent);
}
.feeding-modes button.selected .feeding-mode-icon {
  background: color-mix(in srgb, var(--on-accent) 14%, transparent);
  color: inherit;
}
.feeding-modes button.selected .feeding-mode-check { visibility: visible; }
.feeding-modes button:focus-visible { outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) {
  .feeding-modes button:not(.selected):hover { background: var(--soft); }
}
.focus-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.volume-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 230px;
}
.measurement {
  display: block;
  align-self: center;
  text-align: center;
  border-radius: 50px;
  background: #bc783e;
  color: #fffaf3;
  font-size: 29px;
  padding: 16px 26px;
  min-width: 140px;
  margin: 19px auto 12px;
  font-variant-numeric: tabular-nums;
  z-index: 1;
  flex-shrink: 0;
}
.diaper-stage {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 55px;
}
.diaper-result {
  background: var(--surface);
  min-width: 190px;
  min-height: 95px;
  border-radius: 60px;
  display: flex;
  gap: 15px;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 24px;
}
.diaper-toggles {
  display: flex;
  gap: 45px;
}
.diaper-choice {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  font-size: 16px;
  color: var(--muted);
  min-width: 80px;
}
.diaper-choice > span {
  display: grid;
  place-items: center;
  border-radius: 50%;
  width: 72px;
  height: 72px;
  background: var(--surface);
  font-size: 39px;
  color: var(--border);
}
.diaper-choice.selected {
  color: var(--accent);
}
.diaper-choice.selected > span {
  color: var(--accent);
  box-shadow: 0 0 0 4px var(--soft);
}
.drop-icon {
  font-weight: 900;
}
.weight-stage {
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  flex: 1;
  overflow: hidden;
}
.weight-previous {
  display: block;
  text-align: center;
  font-size: 16px;
  color: var(--muted);
}
.weight-dial {
  height: 190px;
  position: relative;
  margin-top: 35px;
  overflow: hidden;
}
.dial-ticks {
  position: absolute;
  width: 600px;
  height: 600px;
  left: 50%;
  top: 12px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: repeating-conic-gradient(from -90deg,var(--muted) 0
    .2deg,transparent .2deg 3deg);
  mask: radial-gradient(transparent 64%,#000 64%,#000 70%,transparent 70%);
}
.weight-dial > i {
  position: absolute;
  top: 0;
  left: 50%;
  width: 2px;
  height: 100px;
  background: var(--accent);
}
.dial-labels {
  position: absolute;
  left: 7%;
  right: 7%;
  top: 90px;
  display: flex;
  justify-content: space-between;
  font-size: 16px;
}
.weight-dial input {
  position: absolute;
  bottom: 8px;
  left: 8%;
  width: 84%;
  height: 44px;
  accent-color: var(--accent);
}
.timer-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  flex: 1;
  padding: 18px;
}
.timer-face {
  width: 205px;
  height: 205px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: var(--surface);
  border-radius: 50%;
  color: var(--accent);
}
.timer-face strong {
  font-size: 33px;
  font-variant-numeric: tabular-nums;
}
.timer-face > span {
  font-size: 16px;
  color: var(--muted);
}
.timer-toggle {
  background: var(--accent);
  color: var(--bg);
  height: 58px;
  min-width: 130px;
  padding: 12px 28px;
  border-radius: 40px;
  font-size: 18px;
}
.side-toggle {
  display: flex;
  gap: 12px;
}
.side-toggle button {
  width: 62px;
  height: 52px;
  background: var(--surface);
  border-radius: 35px;
  font-size: 16px;
}
.side-toggle button.selected {
  background: var(--soft);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.has-volume .timer-stage {
  flex: 0;
  padding: 6px 15px;
  gap: 8px;
  flex-direction: row;
}
.has-volume .timer-face {
  width: auto;
  height: auto;
  background: transparent;
  flex-direction: row;
  font-size: 16px;
  gap: 7px;
}
.has-volume .timer-face svg,
.has-volume .timer-face > span {
  display: none;
}
.has-volume .timer-face strong {
  font-size: 16px;
}
.has-volume .timer-toggle {
  height: 36px;
  min-width: 65px;
  font-size: 16px;
  padding: 7px 13px;
}
.has-volume .side-toggle {
  gap: 4px;
}
.has-volume .side-toggle button {
  width: 42px;
  height: 32px;
  font-size: 16px;
}
.bath-stage {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 35px;
}
.bath-bubble {
  width: 190px;
  height: 190px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 55px -45px 0 -58px var(--soft),-65px 55px 0 -63px var(--surface);
  color: var(--accent);
}
.bath-stage h2 {
  font-size: 20px;
  font-weight: 400;
}
.entry-details {
  flex-shrink: 0;
  z-index: 5;
  background: var(--bg);
}
.entry-details > summary {
  display: none;
}
.entry-details[open] {
  position: absolute;
  bottom: 90px;
  left: 18px;
  right: 18px;
  background: var(--surface);
  border-radius: 24px;
  padding: 22px;
  box-shadow: 0 -10px 65px #6a3a2420;
  max-height: 65%;
  overflow: auto;
  animation: arrive .22s ease-out;
}
.precise-fields {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.focus-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 26px max(24px,env(safe-area-inset-bottom));
  flex-shrink: 0;
}
.focus-footer > button {
  height: 49px;
  min-width: 80px;
  border-radius: 17px;
  background: var(--soft);
  color: var(--accent);
  display: grid;
  place-items: center;
}
.focus-footer > button[type=submit] {
  background: var(--accent);
  color: #fff;
}
.focus-footer .time-button {
  font-size: 17px;
  font-variant-numeric: tabular-nums;
  min-width: 92px;
}
.focus-privacy {
  text-align: center;
  font-size: 16px;
  color: var(--muted);
}
.focus-privacy svg {
  margin-right: 5px;
}
.focus-entry > .form-error {
  margin: 0;
  text-align: center;
  font-size: 16px;
  max-height: 50px;
  overflow: auto;
}
.activity-picker {
  display: grid;
  grid-template-columns: repeat(2,1fr);
  gap: 22px 15px;
  padding: 18px 10px 30px;
}
.pick-activity {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}
.pick-activity > svg:first-child {
  box-sizing: content-box;
  background: var(--surface);
  padding: 23px;
  border-radius: 50%;
  color: var(--accent);
}
.pick-activity > svg:last-child {
  display: none;
}
/* Patterns, daily totals and a continuous 24-hour view. */
.charts-page {
  max-width: 760px;
  margin: auto;
}
.chart-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: 20px 0 25px;
}
.current-age {
  margin: 6px 0 0;
  font-size: 16px;
  color: var(--muted);
}
.chart-heading h1 {
  font-size: 27px;
  margin: 0;
}
.range-pills {
  display: flex;
  background: var(--soft);
  border-radius: 25px;
  padding: 4px;
  flex-shrink: 0;
}
.range-pills button {
  font-size: 16px;
  padding: 8px 10px;
  border-radius: 20px;
}
.range-pills button.selected {
  background: var(--surface);
  color: var(--accent);
}
.chart-category {
  display: flex;
  gap: 3px;
  justify-content: center;
  overflow-x: auto;
}
.chart-category button {
  min-width: 57px;
  min-height: 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 20px;
  color: var(--muted);
}
.chart-category button span {
  font-size: 16px;
}
.chart-category button.selected {
  color: var(--accent);
  background: var(--surface);
}
.chart-value {
  display: flex;
  align-items: center;
  flex-direction: column;
  margin: 30px 0 25px;
  gap: 10px;
}
.chart-value > span {
  font-size: 16px;
  color: var(--muted);
}
.chart-value > strong {
  background: var(--accent);
  color: #fffaf3;
  border-radius: 50px;
  font-size: 30px;
  min-width: 140px;
  text-align: center;
  padding: 15px 24px;
  font-variant-numeric: tabular-nums;
}
.chart-value > small {
  font-size: 16px;
}
.day-bars {
  display: flex;
  gap: 5px;
  height: 200px;
  border-bottom: 1px solid var(--border);
  padding: 0 8px;
}
.day-bars > button {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: end;
  padding: 0;
  gap: 12px;
}
.bar-space {
  display: flex;
  align-items: end;
  width: min(65%,32px);
  height: 165px;
}
.bar-space i {
  display: block;
  background: #ebbd92;
  border-radius: 14px 14px 2px 2px;
  width: 100%;
  min-height: 1px;
  transition: height .3s ease-out;
}
.day-bars > .selected .bar-space i {
  background: var(--accent);
}
.day-bars time {
  font-size: 16px;
  height: 22px;
}
.day-bars > .selected time {
  color: var(--accent);
  font-weight: 700;
}
.chart-facts {
  display: flex;
  justify-content: center;
  gap: 25px;
  flex-wrap: wrap;
  padding: 26px 0 34px;
}
.chart-facts > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
}
.chart-facts strong {
  font-size: 21px;
}
.chart-facts span {
  font-size: 16px;
  color: var(--muted);
}
.routine-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.routine-heading h2 {
  font-size: 20px;
  margin: 0;
}
.routine-heading > span {
  font-size: 16px;
  color: var(--muted);
}
.routine-legend {
  display: flex;
  gap: 18px;
  margin: 16px 0 24px;
  font-size: 16px;
  color: var(--muted);
}
.routine-legend span {
  display: flex;
  align-items: center;
  gap: 5px;
}
.routine-legend span:before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #cfaf90;
}
.routine-legend .feed-key:before {
  background: var(--accent);
}
.routine-legend .diaper-key:before {
  background: #c49257;
}
.routine-wrap {
  position: relative;
  padding-left: 42px;
}
.routine-hours {
  position: absolute;
  top: 48px;
  bottom: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-size: 16px;
  color: var(--muted);
  transform: translateY(-4px);
}
.routine-scroll {
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.routine-columns {
  display: flex;
  gap: 10px;
  min-width: 100%;
  padding-right: 12px;
}
.routine-column {
  flex: 1;
  min-width: 42px;
}
.routine-column > button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 16px;
  height: 48px;
  width: 100%;
}
.routine-column > button strong {
  font-size: 16px;
}
.routine-column > button.selected {
  color: var(--accent);
}
.routine-track {
  height: 410px;
  position: relative;
  background: repeating-linear-gradient(to bottom,var(--border) 0,var(--border)
    1px,transparent 1px,transparent calc(100% / 6));
  border-left: 1px solid var(--soft);
}
.routine-event {
  position: absolute;
  left: 7%;
  width: 86%;
  border-radius: 15px;
  min-height: 4px;
  padding: 0;
  background: #dfc7ad;
  z-index: 1;
}
.routine-event.feed {
  background: var(--accent);
  left: 0;
  width: 43%;
  z-index: 2;
}
.routine-event.diaper {
  background: #b18750;
  left: 64%;
  width: 32%;
  z-index: 3;
}
.routine-event:focus-visible {
  z-index: 4;
}
.chart-footnote {
  text-align: center;
  font-size: 16px;
  margin-top: 25px;
}
.chart-export {
  margin: auto;
  display: flex!important;
  align-items: center;
  gap: 8px;
}
/* Shared controls and account screens. */
label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 16px;
  color: var(--text);
}
input,
select,
textarea {
  min-width: 0;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 14px;
  padding: 12px;
  font-size: 16px;
  width: 100%;
  max-width: 100%;
  color: var(--text);
}
input[type=checkbox] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}
input::placeholder,
textarea::placeholder {
  color: var(--muted);
  opacity: 1;
}
textarea {
  min-height: 70px;
  resize: vertical;
}
form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.focus-entry {
  gap: 0;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 19px;
  border-radius: 24px;
  font-size: 16px;
  min-height: 45px;
}
.primary {
  background: var(--accent);
  color: #fffaf3;
}
.secondary {
  background: var(--soft);
  color: var(--text);
}
.text-button {
  font-size: 16px;
  color: var(--accent);
  padding: 11px 8px;
}
.form-error {
  font-size: 16px;
  color: #bd4130;
}
.form-error:empty {
  display: none;
}
.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin: 28px 0;
}
.page-heading h1 {
  margin: 0;
  font-size: 28px;
}
.settings-grid,
.family-grid {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-width: 640px;
  margin: auto;
  overflow: hidden;
  border-radius: 26px;
}
.panel {
  background: var(--surface);
  padding: 24px;
  margin: 0;
  border-radius: 20px;
}
.settings-grid .panel,
.family-grid .panel {
  border-radius: 0;
}
.panel h2 {
  font-size: 17px;
  margin-bottom: 12px;
}
.panel p {
  font-size: 16px;
}
.panel small {
  font-size: 16px;
}
.theme-options,
.settings-links {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
}
.theme-option {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg);
  border-radius: 25px;
  font-size: 16px;
  padding: 12px;
}
.theme-option.active {
  color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.settings-links {
  margin-top: 8px;
}
.language-picker select {
  max-width: 260px;
}
.history-toolbar {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-bottom: 25px;
}
.history-dates {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  max-width: 440px;
}
.history-days [data-entry-day] + [data-entry-day] {
  margin-top: 24px;
}
.history-days h3 {
  margin: 0 0 12px;
}
.filter-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 4px 0;
}
.filter-tabs button {
  white-space: nowrap;
  font-size: 16px;
  padding: 10px 12px;
  border-radius: 20px;
  background: var(--surface);
}
.filter-tabs button.active {
  background: var(--accent);
  color: #fff;
}
.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.section-heading h2 {
  margin: 0;
}
.section-heading > span {
  font-size: 16px;
  color: var(--muted);
}
.empty-state {
  text-align: center;
  padding: 35px 15px;
}
.empty-state h3 {
  margin: 15px 0 8px;
}
.empty-state p {
  font-size: 16px;
}
.avatar,
.baby-avatar {
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--soft);
  color: var(--accent);
}
.member-row,
.link-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.member-row > div,
.link-row > div {
  flex: 1;
  min-width: 0;
}
.member-row small,
.link-row small {
  display: block;
  margin-top: 5px;
  font-size: 16px;
  color: var(--muted);
}
.member-role {
  margin-left: auto;
  font-size: 16px;
  color: var(--muted);
}
.role-badge {
  font-size: 16px;
}
.family-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.share-intro {
  font-size: 16px;
}
.qr-code {
  display: block;
  width: 210px;
  margin: 22px auto;
  border-radius: 16px;
}
.copy-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.copy-row input {
  font-size: 16px;
}
.confirm-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px;
}
.checkbox-label,
.check-label {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 9px;
  font-size: 16px;
}
.link-types {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.link-types label {
  flex-direction: row;
  align-items: center;
}
.link-types input {
  width: 16px;
}
.privacy-note {
  font-size: 16px;
}
.shared-shell {
  max-width: 640px;
  margin: auto;
  padding: 35px 20px;
}
.shared-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.shared-baby {
  text-align: center;
  padding: 30px;
}
.pending-item {
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}
.pending-item p {
  font-size: 16px;
}
.pending-item .button {
  margin: 4px;
}
.readonly-banner {
  font-size: 16px;
  padding: 12px;
  text-align: center;
  background: var(--soft);
  border-radius: 18px;
}
.welcome {
  max-width: 1040px;
  margin: auto;
  padding: 30px;
}
.welcome-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--accent);
  font-size: 26px;
  letter-spacing: -1px;
}
.brand img {
  width: 38px;
  height: 38px;
}
.welcome-top .language-picker {
  max-width: 160px;
}
.welcome-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 85px;
  align-items: center;
  min-height: 80dvh;
}
.welcome-story h1 {
  font-size: clamp(40px,5vw,60px);
  line-height: 1.1;
  font-weight: 500;
  max-width: 400px;
}
.welcome-description {
  font-size: 16px;
  max-width: 300px;
}
.welcome-art {
  position: relative;
  height: 220px;
  display: grid;
  place-items: center;
}
.art-orbit {
  width: 170px;
  height: 170px;
  border-radius: 50%;
  background: var(--surface);
  position: relative;
}
.art-orbit:after {
  content: "◡";
  display: grid;
  place-items: center;
  color: var(--accent);
  font-size: 100px;
  width: 100%;
  height: 100%;
  transform: rotate(-12deg);
}
.floating-chip {
  position: absolute;
  padding: 12px 17px;
  background: var(--soft);
  border-radius: 30px;
  font-size: 16px;
  display: flex;
  gap: 7px;
  align-items: center;
}
.chip-one {
  left: 0;
  top: 35px;
  transform: rotate(-8deg);
}
.chip-two {
  right: 0;
  bottom: 40px;
  transform: rotate(8deg);
}
.welcome-benefits {
  display: flex;
  gap: 20px;
  font-size: 16px;
}
.welcome-benefits > span {
  display: flex;
  gap: 6px;
  align-items: center;
}
.auth-card {
  padding: 30px;
  background: var(--surface);
  border-radius: 30px;
}
.auth-card h2 {
  font-size: 25px;
}
.auth-card > p {
  font-size: 16px;
}
.auth-switch,
.auth-divider {
  text-align: center;
  font-size: 16px;
  margin: 18px 0;
}
.auth-divider {
  color: var(--muted);
}
.google-button {
  border: 1px solid var(--border);
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 24px;
  padding: 14px;
}
.preview-button {
  margin: 14px auto 0;
  display: block;
  color: var(--accent);
  font-size: 16px;
}
.onboarding {
  max-width: 470px;
  margin: 80px auto;
  padding: 30px;
}
.onboarding h1 {
  font-size: 32px;
}
.onboarding > p {
  font-size: 16px;
}
#toast {
  position: fixed;
  inset: auto;
  top: calc((var(--header-height) - 46px) / 2 + var(--safe-top));
  left: calc(50% + (var(--safe-left) - var(--safe-right)) / 2);
  transform: translateX(-50%);
  margin: 0;
  border: 0;
  background: var(--text);
  color: var(--bg);
  padding: 13px 20px;
  border-radius: 24px;
  font-size: 16px;
  line-height: 20px;
  max-width: calc(100vw - 32px - var(--safe-left) - var(--safe-right));
  width: max-content;
  overflow-wrap: anywhere;
  box-shadow: var(--shadow);
  pointer-events: none;
}
@keyframes arrive {
  from {
    opacity: 0;
    transform: translateY(30px) scale(.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
@media (min-width:760px) {
  .journal-header {
    padding: 0 45px;
  }
  .journal-main {
    padding-left: 70px;
    padding-right: 70px;
  }
  .journal {
    max-width: 490px;
  }
  .quick-orbit {
    max-width: 385px;
  }
  .baby-heading {
    padding-top: 10px;
  }
  .quick-circle {
    width: 115px;
    height: 115px;
  }
  .moment-row {
    min-height: 84px;
  }
  .charts-page {
    padding-top: 12px;
  }
}
@media (max-width:600px) {
  .journal-header {
    height: 65px;
    padding: 0 21px;
  }
  .journal-main {
    padding: 0 21px 105px;
  }
  .baby-heading {
    padding-top: 10px;
  }
  .quick-orbit {
    max-width: 310px;
    margin-top: 20px;
  }
  .quick-circle {
    width: 94px;
    height: 94px;
  }
  .baby-face {
    width: 56px;
    height: 56px;
    font-size: 24px;
  }
  .baby-heading select {
    font-size: 16px;
  }
  .moment-row {
    grid-template-columns: 1fr 1.9fr 1fr;
    gap: 6px;
  }
  .moment-capsule {
    font-size: 16px;
    padding: 10px 15px;
    gap: 7px;
  }
  .moment-context {
    font-size: 16px;
  }
  .moment-row > time {
    font-size: 16px;
  }
  .sheet {
    margin: auto auto 0;
    width: 100%;
    max-height: 95dvh;
    border-radius: 28px 28px 0 0;
  }
  .sheet-inner {
    padding: 24px;
  }
  .focus-dialog {
    margin: 0;
    width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
  }
  .focus-header {
    padding-top: max(17px,env(safe-area-inset-top));
  }
  .chart-heading {
    flex-direction: column;
    gap: 14px;
    margin-top: 20px;
  }
  .chart-category {
    justify-content: space-between;
    gap: 0;
  }
  .chart-category button {
    min-width: 43px;
  }
  .chart-category button span {
    font-size: 16px;
  }
  .chart-facts {
    gap: 20px;
  }
  .routine-heading h2 {
    font-size: 18px;
  }
  .day-bars {
    height: 170px;
  }
  .bar-space {
    height: 138px;
  }
  .page-heading h1 {
    font-size: 25px;
  }
  .page-heading .button {
    font-size: 16px;
    padding: 10px 12px;
  }
  .panel {
    padding: 20px;
  }
  .welcome {
    padding: 22px;
  }
  .welcome-grid {
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-height: 0;
  }
  .welcome-story {
    padding: 38px 0 0;
  }
  .welcome-story h1 {
    font-size: 44px;
    max-width: 340px;
    margin-bottom: 15px;
  }
  .welcome-art,
  .welcome-benefits {
    display: none;
  }
  .welcome-description {
    font-size: 16px;
    margin-bottom: 0;
  }
  .auth-card {
    width: 100%;
    padding: 25px;
  }
  .welcome-top .language-picker {
    max-width: 135px;
  }
  .welcome-top .language-picker select {
    font-size: 16px;
  }
  .onboarding {
    margin: 30px auto;
    padding: 25px;
  }
  .field-row {
    grid-template-columns: 1fr;
  }
  .connection {
    font-size: 16px;
  }
  .focus-footer {
    gap: 10px;
    padding: 18px 24px max(22px,env(safe-area-inset-bottom));
  }
  .focus-footer > button {
    min-width: 75px;
  }
  .weight-dial {
    margin-top: 20px;
  }
  .measurement {
    font-size: 28px;
  }
  .focus-entry .precise-fields input {
    font-size: 16px;
  }
  .routine-columns {
    gap: 9px;
  }
  .day-summary {
    max-width: 250px;
  }
}
@media (max-height:700px) {
  .focus-header {
    padding-top: 10px;
  }
  .measurement {
    margin: 6px auto;
    font-size: 24px;
    padding: 12px 22px;
  }
  .timer-face {
    width: 155px;
    height: 155px;
  }
  .timer-stage {
    gap: 15px;
    padding: 10px;
  }
  .focus-footer {
    padding-top: 12px;
    padding-bottom: 15px;
  }
  .weight-dial {
    height: 160px;
    margin-top: 10px;
  }
  .diaper-stage {
    gap: 35px;
  }
}
@media (prefers-reduced-motion:reduce) {
  *,
  *:before,
  *:after {
    animation: none!important;
    transition: none!important;
    scroll-behavior: auto!important;
  }
  button:active:not(:disabled) {
    transform: none;
  }
}
.time-ruler {
  padding: 6px 0 22px;
  text-align: center;
}
.time-ruler > span {
  font-size: 16px;
  color: var(--muted);
}
.time-ruler input {
  display: block;
  width: 100%;
  height: 40px;
  accent-color: var(--accent);
  background: repeating-linear-gradient(90deg,var(--border) 0,var(--border)
    1px,transparent 1px,transparent 8px);
  border: 0;
  border-radius: 0;
  padding: 0;
}
.sharing-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 14px 0;
}
.summary-icon {
  margin-bottom: 15px;
  color: var(--accent);
}
.member-name {
  flex: 1;
  min-width: 0;
  font-size: 16px;
}
.member-name strong {
  display: block;
}
.qr-wrap {
  text-align: center;
  padding: 25px;
}
.qr-wrap img {
  width: 220px;
  border-radius: 15px;
}
.share-types {
  border: 1px solid var(--border);
  border-radius: 15px;
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.share-types .checkbox-label {
  min-height: 44px;
  line-height: 1.4;
  cursor: pointer;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}
.share-types .checkbox-label:has(input:checked) {
  background: var(--soft);
  border-color: var(--accent);
}
.share-types .checkbox-label:has(input:focus-visible) {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
.share-types input {
  margin: 0;
  flex-shrink: 0;
}
.share-types input:focus-visible {
  outline: none;
}
.share-types legend {
  font-size: 16px;
  padding: 0 7px;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.shared-page {
  max-width: 650px;
  margin: auto;
  padding: 35px 22px;
}
.shared-page > .brand {
  margin-bottom: 35px;
}
.shared-page h1 {
  font-size: 30px;
}
.shared-page > .panel {
  margin: 25px 0;
}
.center {
  text-align: center;
}
.auth-card form .button {
  margin-top: 5px;
}
@media (max-width:600px) {
  .sharing-grid {
    grid-template-columns: 1fr;
  }
  .page-family .page-heading {
    align-items: center;
  }
  .page-family .page-heading h1 {
    font-size: 24px;
  }
  .form-row {
    grid-template-columns: 1fr;
  }
}
.focus-dialog {
  max-width: 100vw;
}
.weight-dial {
  touch-action: none;
  cursor: ew-resize;
  user-select: none;
}
.weight-dial > * {
  pointer-events: none;
}

.google {
  border: 1px solid var(--border);
  width: 100%;
  margin: 10px 0;
}
.google-g {
  font-size: 18px;
}
.divider {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--muted);
  gap: 12px;
  margin: 16px 0;
}
.divider:before,
.divider:after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--border);
}
.moment-capsule:disabled {
  opacity: 1;
}
.onboard-card {
  margin-top: 30px;
}
.onboard-card .baby-avatar {
  margin-bottom: 25px;
}
.journal {
  overscroll-behavior-y: contain;
}

/* Readable, thumb-sized controls at every viewport. */
:root {
  font-size: 16px;
}
button,
input,
select,
textarea {
  font-size: inherit;
}
small {
  font-size: 16px;
}
.journal-header {
  height: auto;
  min-height: 85px;
  flex-wrap: wrap;
}
.connection {
  font-size: 16px;
}
.journal-main {
  padding-bottom: 130px;
}
.moment-row {
  grid-template-columns: 72px minmax(0,1fr);
  min-height: 100px;
  gap: 8px;
}
.moment-capsule {
  min-width: 140px;
  max-width: 100%;
  white-space: normal;
}
.moment-context {
  grid-column: 2;
  justify-content: center;
  flex-wrap: wrap;
}
.moment-note {
  grid-column: 2;
  line-height: 1.5;
}
.moment-row > time {
  align-self: center;
}
.day-summary {
  max-width: 100%;
  width: 340px;
}
.day-summary > div {
  flex-wrap: wrap;
  gap: 12px;
}
.day-summary span {
  font-size: 16px;
}
.baby-heading > span,
.baby-heading select {
  font-size: 16px;
}
.baby-heading select {
  width: auto;
  min-width: 150px;
}
.quick-circle {
  width: 110px;
  height: 110px;
}
.quick-circle > span {
  font-size: 16px;
}
.sheet {
  max-width: calc(100vw - 20px);
}
.sheet-header {
  align-items: flex-start;
}
.sheet-header h2 {
  overflow-wrap: anywhere;
}
.focus-dialog {
  max-width: 100vw;
}
.focus-stage {
  overflow-y: auto;
  min-height: 180px;
}
.focus-header {
  gap: 12px;
}
.focus-header > span {
  font-size: 18px;
}
.focus-footer {
  gap: 10px;
  padding: 16px 20px max(20px,env(safe-area-inset-bottom));
}
.focus-footer > button {
  min-width: 50px;
  flex: 1;
  min-height: 52px;
}
.focus-footer .time-button {
  min-width: 95px;
}
.measurement {
  font-size: 32px;
}
.weight-stage {
  justify-content: flex-start;
  gap: 12px;
  min-height: 0;
  overflow: visible;
  padding: 15px 24px;
}
.weight-previous {
  font-size: 16px;
  line-height: 1.5;
}
.diaper-stage {
  min-height: 330px;
  gap: 32px;
}
.diaper-choice {
  font-size: 18px;
}
.timer-stage {
  min-height: 300px;
}
.timer-face > span {
  font-size: 16px;
}
.bath-stage {
  min-height: 300px;
}
.entry-details[open] {
  bottom: 92px;
  max-height: calc(100% - 180px);
  left: 12px;
  right: 12px;
  padding: 20px;
}
.precise-fields input {
  font-size: 16px!important;
}
.focus-entry .form-error {
  padding: 0 20px;
  max-height: 90px;
  font-size: 16px;
}
.chart-category {
  justify-content: flex-start;
  padding-bottom: 12px;
}
.chart-category button {
  min-width: 90px;
  min-height: 78px;
  flex-shrink: 0;
}
.chart-category button span {
  font-size: 16px;
}
.day-bars {
  overflow-x: auto;
  overflow-y: hidden;
  height: 230px;
  padding-bottom: 10px;
}
.day-bars > button {
  min-width: 27px;
}
.day-bars time {
  font-size: 16px;
  height: 26px;
}
.bar-space {
  height: 170px;
  width: 22px;
}
.chart-value > small,
.chart-value > span {
  font-size: 16px;
  text-align: center;
}
.chart-facts {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 24px 16px;
}
.chart-facts span {
  font-size: 16px;
  text-align: center;
  line-height: 1.4;
}
.chart-facts strong {
  font-size: 25px;
}
.routine-heading {
  align-items: flex-start;
  gap: 12px;
}
.routine-heading > span {
  font-size: 16px;
  flex-shrink: 0;
}
.routine-legend {
  font-size: 16px;
  flex-wrap: wrap;
}
.routine-wrap {
  padding-left: 57px;
}
.routine-hours {
  font-size: 16px;
}
.routine-columns {
  gap: 14px;
}
.routine-column {
  min-width: 62px;
}
.routine-column > button {
  height: 64px;
  font-size: 16px;
}
.routine-column > button strong {
  font-size: 18px;
}
.routine-hours {
  top: 64px;
}
.routine-event {
  min-height: 10px;
}
.chart-footnote {
  font-size: 16px;
  text-align: left;
}
.panel p,
.panel small,
.member-row small,
.link-row small {
  font-size: 16px;
}
.member-row,
.link-row {
  flex-wrap: wrap;
}
.member-name {
  font-size: 16px;
  min-width: 170px;
}
.link-row .text-button {
  min-height: 48px;
}
.theme-options {
  display: grid;
  grid-template-columns: 1fr;
}
.theme-option {
  font-size: 16px;
  justify-content: flex-start;
  min-height: 48px;
}
.settings-links .text-button {
  font-size: 16px;
}
.page-heading {
  flex-wrap: wrap;
}
.page-heading .button {
  font-size: 16px;
}
.settings-grid .panel {
  padding: 22px;
}
.history-toolbar {
  min-width: 0;
}
.filter-tabs button {
  font-size: 16px;
  min-height: 48px;
}
.section-heading {
  flex-wrap: wrap;
  gap: 12px;
}
.section-heading > span {
  font-size: 16px;
}
.session-dialog {
  width: min(560px,100%);
  height: min(900px,96dvh);
  max-height: 96dvh;
  max-width: 100vw;
  overflow: auto;
}
.session-dialog .sheet-inner {
  padding: 0;
}
.session-editor {
  padding: 24px;
  gap: 22px;
}
.session-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.session-heading h2 {
  margin: 0;
  font-size: 25px;
}
.session-total {
  text-align: center;
}
.session-total > strong {
  display: block;
  font-size: 44px;
  font-variant-numeric: tabular-nums;
}
.session-total > span {
  display: block;
  margin-top: 8px;
}
.session-total > p {
  margin: 12px 0 0;
  font-size: 16px;
}
.session-sides {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.session-sides button {
  min-height: 155px;
  background: var(--surface);
  border: 2px solid transparent;
  border-radius: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px 8px;
}
.session-sides button strong {
  font-size: 28px;
  font-variant-numeric: tabular-nums;
}
.session-sides button span {
  font-size: 16px;
}
.session-sides button.selected {
  border-color: var(--accent);
  opacity: 1;
  background: var(--soft);
}
.session-controls {
  display: flex;
  gap: 12px;
}
.session-controls button {
  flex: 1;
  min-height: 54px;
  background: var(--surface);
  border-radius: 24px;
  font-size: 18px;
  padding: 12px;
}
.session-controls button.selected {
  box-shadow: inset 0 0 0 2px var(--accent);
}
.session-previous {
  font-size: 16px;
  margin: 0;
}
.pump-yield {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}
.pump-yield h3 {
  margin: 0;
}
.pump-yield output {
  font-size: 28px;
  text-align: center;
}
.pump-yield p {
  font-size: 16px;
  margin: 0;
}
.two-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.manual-session {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.session-notes summary {
  font-size: 16px;
  cursor: pointer;
  min-height: 48px;
  padding: 10px 0;
}
.session-footer {
  position: sticky;
  bottom: 0;
  background: var(--bg);
  padding: 16px 0 0;
  margin-top: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.session-footer .button {
  min-height: 56px;
  font-size: 18px;
  width: 100%;
}
.session-footer .text-button {
  font-size: 16px;
  min-height: 44px;
}
.session-editor label {
  font-size: 16px;
}
.session-notes textarea {
  margin-top: 8px;
}
.session-dialog::backdrop {
  background: #5b331a35;
}
.welcome-top {
  flex-wrap: wrap;
  gap: 16px;
}
.welcome-top .language-picker {
  max-width: 220px;
}
.welcome-top .language-picker select {
  font-size: 16px;
}
.welcome-description,
.welcome-benefits,
.auth-card > p,
.auth-switch,
.auth-divider,
.preview-button,
.divider,
.eyebrow,
.privacy-note {
  font-size: 16px;
}
.welcome-benefits {
  flex-wrap: wrap;
}
.floating-chip {
  font-size: 16px;
}
.auth-card {
  padding: 25px;
}
.auth-card .button,
.text-button,
.button {
  font-size: 16px;
  min-height: 48px;
}
.form-error {
  font-size: 16px;
}
.link-types label,
.share-types legend,
.member-role,
.role-badge,
.readonly-banner {
  font-size: 16px;
}
@media (max-width:600px) {
  .journal-header {
    display: grid;
    grid-template-columns: 1fr auto;
    padding: 14px 20px;
    gap: 10px;
  }
  .journal-header .wordmark {
    justify-self: start;
  }
  .journal-header > .round {
    grid-column: 2;
    grid-row: 1;
  }
  .journal-header .connection {
    grid-row: 2;
    grid-column: 1 / -1;
    margin: 0;
    text-align: center;
    justify-self: center;
  }
  .journal-main {
    padding-left: 16px;
    padding-right: 16px;
  }
  .baby-heading {
    padding-top: 6px;
  }
  .quick-orbit {
    max-width: 300px;
  }
  .chart-category button {
    min-width: 90px;
  }
  .chart-heading h1 {
    font-size: 28px;
  }
  .range-pills button {
    font-size: 16px;
    min-height: 44px;
  }
  .routine-heading h2 {
    font-size: 20px;
  }
  .session-dialog {
    margin: 0;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
  }
  .session-editor {
    padding: 20px 18px max(20px,env(safe-area-inset-bottom));
  }
  .session-sides button strong {
    font-size: 27px;
  }
  .two-fields {
    grid-template-columns: 1fr 1fr;
  }
  .focus-dialog {
    margin: 0;
    border-radius: 0;
  }
  .focus-stage {
    flex: 1;
    overflow: auto;
  }
  .focus-entry {
    overflow: auto;
  }
  .focus-footer {
    position: sticky;
    bottom: 0;
    background: var(--bg);
  }
  .volume-stage {
    min-height: 360px;
    height: 100%;
  }
  .focus-header {
    padding: 16px 20px 8px;
  }
  .timer-stage {
    min-height: 300px;
  }
  .sheet-inner {
    padding: 22px;
  }
  .page-heading h1 {
    font-size: 28px;
  }
  .page-family .page-heading h1 {
    font-size: 28px;
  }
  .page-heading .button {
    font-size: 16px;
  }
  .welcome-grid {
    gap: 24px;
  }
  .auth-card {
    padding: 22px;
  }
  .welcome-story {
    padding-top: 24px;
  }
  .onboarding {
    padding: 20px;
  }
  .chart-facts span {
    font-size: 16px;
  }
}
.solids-stage {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 30px 24px;
  min-height: 0;
}
.solids-stage h2 {
  margin: 0;
}
.solids-stage label,
.solids-stage p {
  font-size: 16px;
}
.focus-footer > button {
  height: auto;
  min-height: 68px;
  gap: 4px;
  padding: 8px;
}
.focus-footer > button span {
  font-size: 16px;
}
.session-editor .form-error {
  font-size: 16px;
}
.settings-grid .language-picker {
  font-size: 18px;
}
.session-previous {
  overflow-wrap: anywhere;
}
.feed-measures {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: 16px 0;
  padding-bottom: 8px;
}
.feed-measures button {
  font-size: 16px;
  min-height: 48px;
  flex-shrink: 0;
  padding: 10px 16px;
  background: var(--surface);
  border-radius: 25px;
}
.feed-measures button.selected {
  color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.app-update {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: max(12px, env(safe-area-inset-top)) 16px 12px;
  background: #f7ddad;
  color: #30271e;
  font-size: 16px;
  line-height: 1.4;
}
.app-update[hidden] { display: none; }
.app-update button {
  flex-shrink: 0;
  min-height: 48px;
  padding: 10px 18px;
  border: 0;
  border-radius: 24px;
  background: #30271e;
  color: #fff8ed;
  font-size: 16px;
  font-weight: 600;
}

/* Color palettes have independent day/night appearance. */
:root {
  color: var(--text);
  background: var(--bg);
  --bg: #f4f5ec;
  --surface: #fffef8;
  --text: #334b3d;
  --muted: #607161;
  --border: #dce3d3;
  --accent: #4e7045;
  --on-accent: #fffef8;
  --soft: #e5ebd9;
  --shadow: 0 8px 28px #263b2310;
  color-scheme: light;
}
:root[data-palette=peach] {
  --bg: #fff3e3; --surface: #fffdf9; --text: #874321;
  --muted: #906349; --border: #efd8bf; --accent: #9c4416; --soft: #fbe5cc;
}
:root[data-theme=dark] {
  --bg: #19221d; --surface: #243129; --text: #e2ecda;
  --muted: #afbfaa; --border: #3b4c3b; --accent: #b3d398; --soft: #30412f;
  --on-accent: #19221d; --shadow: none; color-scheme: dark;
  color: var(--text); background: var(--bg);
}
:root[data-theme=dark][data-palette=peach] {
  --bg: #221b19; --surface: #342923; --text: #f5d5bf;
  --muted: #c4a58e; --border: #57402e; --accent: #f4b382; --soft: #422d23;
  --on-accent: #221b19;
}
.wordmark { display: flex; align-items: center; gap: 8px; padding: 0; letter-spacing: -.04em; }
.wordmark img { width: 40px; height: 40px; border-radius: 14px; }
.baby-face { background: none; padding: 0; width: 70px; height: 70px; }
.baby-face img { width: 100%; height: 100%; border-radius: 23px; }
.journal-header { min-height: 72px; }
.connection, .demo-pill { font-size: 13px; }
.journal-main { padding-bottom: 108px; }
.journal-spine:before { display: none; }
.timeline { position: relative; isolation: isolate; }
.timeline:before { content: ""; position: absolute; width: 2px; background: var(--border); left: 76px; top: 0; bottom: 0; z-index: -1; }
.moment-row { grid-template-columns: 62px minmax(0,1fr); align-items: start; gap: 30px; padding: 9px 0; min-height: 0; }
.moment-row:before { content: ""; position: absolute; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); border: 3px solid var(--bg); box-sizing: content-box; top: 29px; left: 70px; }
.moment-row > time { padding-top: 17px; align-self: start; font-size: 14px; line-height: 1.3; white-space: nowrap; }
.moment-row > time small { font-size: 12px; opacity: 1; color: var(--muted); margin-top: 5px; }
.moment-capsule, .moment-capsule.kind-feed, .moment-capsule.kind-sleep { width: 100%; min-width: 0; max-width: 100%; border-radius: 22px; padding: 15px; gap: 12px; background: var(--surface); color: var(--text); align-items: flex-start; justify-content: flex-start; text-align: left; transition: opacity 160ms ease-out; }
/* Reveal a non-interactive delete cue behind the directly dragged card. */
.moment-swipe { position: relative; min-width: 0; }
.moment-swipe > .moment-capsule { position: relative; z-index: 1; }
.moment-delete { position: absolute; inset: 0 0 0 auto; width: 85px; border-radius: 24px; background: #bc4333; color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 12px; font-weight: 600; pointer-events: none; opacity: 0; transition: opacity 160ms var(--ease-out); }
.moment-swipe.is-swiping > .moment-delete { opacity: 1; transition: none; }
.moment-capsule.is-returning, .moment-capsule.kind-feed.is-returning, .moment-capsule.kind-sleep.is-returning { transition: opacity 160ms ease-out, transform 160ms var(--ease-out); }
.moment-capsule > svg { color: var(--accent); margin-top: 2px; }
.moment-capsule > svg:not(:first-child) { width: 14px; margin-left: auto; opacity: .6; }
.moment-capsule:active:not(:disabled) { background: var(--soft); transform: none; }
.moment-capsule.is-running { box-shadow: inset 0 0 0 1px var(--accent); }
.moment-content { display: flex; flex-direction: column; flex: 1; min-width: 0; gap: 5px; }
.moment-title { font-size: 16px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.moment-value { font-size: 20px; font-weight: 550; font-variant-numeric: tabular-nums; letter-spacing: -.02em; line-height: 1.25; }
.moment-note { font-size: 14px; line-height: 1.45; text-align: left; color: var(--muted); white-space: pre-wrap; }
.moment-context { justify-content: flex-start; align-items: center; gap: 6px 10px; margin-top: 3px; font-size: 12px; line-height: 1.4; }
.moment-context:empty { display: none; }
.moment-status { display: inline-flex; align-items: center; gap: 5px; }
.day-summary { width: 100%; max-width: 100%; border-radius: 20px; margin-top: 14px; margin-bottom: 6px; padding: 12px 16px; }
.day-summary > button { font-weight: 600; min-height: 44px; }
.day-summary > div { margin-top: 2px; gap: 20px; }
.day-summary span { font-size: 14px; }
.measurement { background: var(--accent); color: var(--on-accent); }
.button.primary, .primary { color: var(--on-accent); }
.palette-heading { margin: 24px 0 12px; font-size: 16px; letter-spacing: 0; }
.palette-options { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
.palette-option { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; min-height: 100px; padding: 12px 6px; border: 1px solid var(--border); border-radius: 18px; }
:root[data-palette=custom] .palette-custom, .palette-option[aria-pressed=true] { border-color: var(--accent); background: var(--soft); box-shadow: inset 0 0 0 1px var(--accent); }
.palette-swatch { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: #4e7045; color: #fff; }
.palette-option[data-palette=peach] .palette-swatch { background: #ad501b; }
:root:not([data-palette=custom]) .palette-custom svg, .palette-option[aria-pressed=false] svg { visibility: hidden; }
.appearance-note { margin: 16px 0 0; }
.theme-options { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.theme-option { justify-content: center; flex-direction: column; gap: 8px; padding: 12px 4px; font-size: 14px; min-height: 80px; }
.welcome { max-width: 600px; padding: 24px; min-height: 100dvh; }
.welcome-top { gap: 16px; flex-wrap: nowrap; }
.welcome-top .language-picker { width: 170px; }
.welcome-grid { display: block; min-height: 0; margin: 40px auto; max-width: 360px; }
.auth-card { background: transparent; padding: 0; border-radius: 0; }
.auth-mascot { display: block; width: 88px; height: 88px; margin: 0 auto 24px; border-radius: 29px; }
.auth-card h1 { text-align: center; font-size: 30px; line-height: 1.15; margin: 0 auto 28px; max-width: 310px; }
.auth-card form { gap: 16px; }
.auth-card input { background: var(--surface); min-height: 52px; border-radius: 16px; }
.auth-card .google { background: var(--surface); border-radius: 18px; min-height: 52px; margin: 0; }
.auth-card .divider { margin: 20px 0; font-size: 13px; }
.auth-card .button.primary { margin-top: 8px; border-radius: 18px; min-height: 52px; }
.auth-switch { line-height: 1.5; margin: 20px 0 8px; }
.auth-switch button { color: var(--accent); font-weight: 600; min-height: 44px; padding: 6px; }
.preview-link { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0 auto; min-height: 44px; color: var(--accent); }
.auth-card .auth-note { text-align: center; font-size: 13px; margin: 20px 0 0; }
@media (max-width:600px) {
  .journal-header { display: flex; flex-wrap: nowrap; padding: 12px 16px; gap: 10px; }
  .journal-header .connection { margin-left: auto; text-align: right; }
  .wordmark { font-size: 23px; gap: 5px; }
  .wordmark img { width: 32px; height: 32px; border-radius: 11px; }
  .journal-header .round.small { width: 44px; height: 44px; flex-shrink: 0; }
  .moment-row { grid-template-columns: 52px minmax(0,1fr); gap: 25px; }
  .timeline:before { left: 63px; }
  .moment-row:before { left: 57px; }
  .moment-capsule { padding: 14px 12px; gap: 9px; }
  .moment-capsule > svg:not(:first-child) { display: none; }
  .welcome { padding: 20px; }
  .welcome-grid { margin: 28px auto; }
  .auth-mascot { width: 76px; height: 76px; margin-bottom: 20px; }
}

@media (prefers-contrast:more) {
  .moment-capsule { border: 1px solid var(--text); }
}
.chart-value > strong, .focus-footer > button[type=submit], .filter-tabs button.active { color: var(--on-accent); }

/* Gentle category colors keep the connected journal easy to scan. */
.moment-capsule { --moment-color: #cf9360; }
.kind-feed { --moment-color: #e3a357; }
.kind-sleep { --moment-color: #a69ad6; }
.kind-diaper { --moment-color: #75b4ac; }
.kind-pump { --moment-color: #d7a1b5; }
.kind-walk { --moment-color: #99b877; }
.kind-height { --moment-color: #b6a0c9; }
.kind-weight { --moment-color: #86b2d0; }
.kind-bath { --moment-color: #84bfcc; }
.moment-capsule, .moment-capsule.kind-feed, .moment-capsule.kind-sleep {
  border-radius: 24px;
  background: color-mix(in srgb,var(--moment-color) 24%,var(--surface));
  align-items: center;
  padding: 13px 15px;
}
.moment-capsule > svg:first-child { width: 26px; height: 26px; margin: 0; flex-shrink: 0; }
.moment-content { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.moment-title { flex: 1 1 80px; font-weight: 500; }
.moment-value { font-size: 18px; font-weight: 650; white-space: nowrap; }
.moment-context { flex-basis: 100%; margin: 0; }
.moment-capsule.is-running { box-shadow: inset 0 0 0 1.5px color-mix(in srgb,var(--moment-color) 70%,var(--text)); }
/* Floating silhouettes stay behind content and take no layout space. */
.moment-capsule.kind-feed, .kind-feed .active-activity-heading { position: relative; isolation: isolate; }
.feeding-decoration { position: absolute; inset: 0; z-index: -1; overflow: hidden; border-radius: inherit; color: var(--text); opacity: .12; pointer-events: none; }
.feeding-decoration > svg { position: absolute; fill: currentColor; stroke: none; transform: rotate(var(--turn)); }
.feeding-decoration.is-visible > svg { animation: feeding-float var(--drift) ease-in-out infinite alternate; animation-delay: var(--phase); }
@keyframes feeding-float {
  from { transform: translate(0,0) rotate(var(--turn)); }
  45% { transform: translate(var(--mid-x),var(--mid-y)) rotate(var(--mid-turn)); }
  to { transform: translate(var(--end-x),var(--end-y)) rotate(var(--end-turn)); }
}
.page-hidden .feeding-decoration > svg { animation: none; }
.modal-open .feeding-decoration > svg { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) {
  .feeding-decoration.is-visible > svg { animation: none; }
}
.sleep-hint { max-width: 310px; text-align: center; color: var(--muted); line-height: 1.5; margin: 24px auto; }
summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
.focus-footer > button { min-width: 0; }
.focus-footer > button span { white-space: normal; overflow-wrap: anywhere; line-height: 1.25; }

/* One spacing scale across pages, cards, and logging sheets. */
:root { --page-gutter: 24px; --card-padding: 24px; --section-gap: 24px; --control-gap: 8px; }
.journal-header { padding: 16px var(--page-gutter); }
.journal-main { padding: 0 var(--page-gutter) 112px; }
.page-heading { margin: var(--section-gap) 0; gap: 16px; }
.settings-grid, .family-grid { gap: 16px; overflow: visible; border-radius: 0; }
.panel, .settings-grid .panel, .family-grid .panel { padding: var(--card-padding); border-radius: 24px; }
.panel > :first-child { margin-top: 0; }
.panel > :last-child { margin-bottom: 0; }
.panel h2 { margin: 0 0 16px; }
.panel p { margin: 0 0 16px; }
label { gap: var(--control-gap); }
.button { padding: 12px 20px; min-height: 48px; }
.sheet-inner { padding: var(--card-padding); }
.session-editor { padding: var(--card-padding); gap: var(--section-gap); }
.focus-header { padding: 16px var(--card-padding); }
.feeding-modes { margin: 0 0 12px; padding: 4px var(--card-padding) 8px; gap: 8px; }
.focus-footer { padding: 16px var(--card-padding) max(16px,env(safe-area-inset-bottom)); gap: var(--control-gap); }
.focus-footer { grid-template-columns: 48px 80px minmax(0,1fr); }
.focus-footer > button { min-height: 56px; }
.focus-footer .time-button { min-width: 0; }
.entry-details { margin: 0; padding: 0 var(--card-padding); }
.precise-fields, .two-fields { gap: 16px; }
.solids-stage { padding: var(--card-padding); gap: var(--section-gap); }
.manual-session, .pump-yield { gap: 16px; }
.pump-yield { padding-top: var(--section-gap); }
.day-summary { margin: 16px 0 8px; padding: 8px 16px; }
@media (max-width:600px) {
  :root { --page-gutter: 16px; --card-padding: 20px; }
  .journal-header { padding: 12px var(--page-gutter); }
}

.focus-footer { display: grid; }
.pick-activity, .chart-category button { background: color-mix(in srgb,var(--moment-color) 24%,var(--surface)); color: var(--text); }
.chart-category button.selected { box-shadow: inset 0 0 0 2px var(--accent); }
.day-bars .bar-space i { background: color-mix(in srgb,var(--moment-color) 70%,var(--text)); }
.quick-circle.sleep { color: #a69ad6; background: color-mix(in srgb,#a69ad6 24%,var(--surface)); }
.quick-circle.feed { color: #e3a357; background: color-mix(in srgb,#e3a357 24%,var(--surface)); }
.routine-event.sleep { background: #a69ad6; }
.routine-event.feed { background: #c67a27; }
.routine-event.diaper { background: #4f938b; }
.routine-legend .sleep-key:before { background: #a69ad6; }
.routine-legend .feed-key:before { background: #c67a27; }
.routine-legend .diaper-key:before { background: #4f938b; }
.routine-details { display: flex; margin: 24px auto 0; }

/* Keep every control within the viewport; browse long ranges by week. */
.chart-category { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; overflow: visible; }
.chart-category button { min-width: 0; padding: 12px 6px; overflow-wrap: anywhere; }
.filter-tabs, .feed-measures { flex-wrap: wrap; overflow: visible; gap: 8px; }
.filter-tabs button, .feed-measures button { white-space: normal; min-width: 0; max-width: 100%; }
.day-bars { overflow: visible; gap: 8px; padding: 0 0 8px; }
.day-bars > button { min-width: 0; }
.routine-scroll { overflow: visible; }
.routine-columns { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); gap: 4px; min-width: 0; padding: 0; }
.routine-column { min-width: 0; }
.routine-column > button { padding: 4px 0; font-size: 12px; }
.routine-wrap { padding-left: 48px; }
.routine-heading { flex-wrap: wrap; }
.routine-hours { font-size: 12px; }
.chart-window { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 0 0 16px; }
.chart-window > span { text-align: center; font-size: 16px; }
.chart-window > button:first-child svg { transform: rotate(180deg); }
.range-pills { max-width: 100%; }
.range-pills button { flex: 1; min-width: 0; }
.entry-details[open] { left: var(--card-padding); right: var(--card-padding); padding: 20px; }
.panel, .panel p, .member-row, .link-row { overflow-wrap: anywhere; min-width: 0; }
@media (max-width:600px) {
  .chart-category { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .chart-heading { flex-wrap: wrap; }
  .range-pills { width: 100%; }
}

/* Native date controls must shrink inside sheets, including Safari. */
label, fieldset, .form-row > *, .two-fields > *, .precise-fields > * { min-width: 0; max-width: 100%; }
input[type=date], input[type=datetime-local], input[type=time] {
  display: block; box-sizing: border-box; width: 100%; min-width: 0;
  max-width: 100%; min-inline-size: 0; min-height: 48px;
}
input::-webkit-date-and-time-value { min-width: 0; text-align: left; }
input::-webkit-datetime-edit { min-width: 0; padding: 0; }
input::-webkit-calendar-picker-indicator { flex-shrink: 0; margin: 0; }
@media (max-width:380px) {
  .two-fields, .form-row { grid-template-columns: minmax(0,1fr); }
  input[type=datetime-local] { padding-left: 8px; padding-right: 8px; }
}


/* Current sessions expose their next useful action directly in the journal. */
.compact-baby-heading { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 8px 16px; padding: 8px 0 0; }
.baby-switch { display: inline-flex; align-items: center; gap: 12px; padding: 12px 16px; min-height: 48px; max-width: 100%; border-radius: 16px; background: var(--surface); color: var(--text); }
.baby-switch strong { font-size: 20px; overflow-wrap: anywhere; min-width: 0; }
.baby-switch svg { flex-shrink: 0; transform: rotate(90deg); }
.baby-list { display: flex; flex-direction: column; gap: 8px; margin: 16px 0; }
.baby-choice { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 72px; border-radius: 16px; background: var(--surface); padding: 16px; text-align: left; }
.baby-choice > span { display: flex; flex-direction: column; gap: 4px; min-width: 0; overflow-wrap: anywhere; }
.baby-choice small { color: var(--muted); }
.baby-choice[aria-pressed=true] { box-shadow: inset 0 0 0 2px var(--accent); }
.active-activity { min-width: 0; width: 100%; border-radius: 24px; padding: 16px; background: color-mix(in srgb,var(--moment-color) 28%,var(--surface)); border: 1px solid color-mix(in srgb,var(--moment-color) 65%,var(--border)); }
.active-activity-heading { display: flex; width: 100%; align-items: center; gap: 12px; text-align: left; padding: 0; min-height: 48px; }
.active-activity-heading:disabled { opacity: 1; }
.active-activity-icon { flex-shrink: 0; }
.active-activity-title { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1; }
.active-activity-title strong { font-size: 16px; overflow-wrap: anywhere; }
.active-activity-title small { display: flex; gap: 6px; align-items: center; color: var(--text); font-size: 14px; line-height: 1.35; }
.active-activity-time { font-size: 22px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.active-activity-controls { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.active-activity-controls button { flex: 1 1 80px; min-width: 0; font-size: 16px; padding: 10px 12px; border-radius: 16px; }
.active-activity-controls .primary { flex-basis: 100%; }
.active-activity-controls .secondary { background: var(--surface); color: var(--text); }
.active-sync { display: block; font-size: 14px; margin-top: 12px; color: var(--text); }
@media(max-width:380px) {
  .active-activity { padding: 12px; }
  .active-activity-heading { flex-wrap: wrap; gap: 8px; }
  .active-activity-time { flex-basis: 100%; margin-left: 36px; }
}

.active-position { display: block; margin: 12px 0 0; font-size: 16px; }
.sleep-position-options { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin: 24px 0; }
.sleep-guidance { line-height: 1.5; font-size: 16px; }
.sleep-guidance a { text-decoration: underline; }
.sleep-starting-position { width: min(100%,300px); text-align: left; margin: 16px auto 0; padding: 0 20px; }
.focus-sleep .timer-stage { padding: 24px 0; gap: 16px; justify-content: flex-start; }
.focus-sleep .timer-face { width: 170px; height: 170px; flex-shrink: 0; }
.focus-sleep .sleep-hint { margin: 0 auto; padding: 0 20px; }
.sleep-observation { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sleep-observation > span { min-width: 0; overflow-wrap: anywhere; }
.sleep-position-history h3 { font-size: 16px; margin: 16px 0 8px; }

.sleep-safety-link { font-size: 16px; line-height: 1.4; text-decoration: underline; margin-top: 4px; }

/* Preserve the rounded picker; use neutral tiles with soft icon accents. */
.sheet:has(.activity-picker) { background: var(--bg); }
.activity-picker { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; padding: 16px 0 0; }
.pick-activity { display: flex; flex-direction: column; justify-content: center; gap: 12px; min-height: 116px; padding: 16px 8px; border-radius: 24px; background: var(--surface); color: var(--text); text-align: center; }
.pick-activity > svg:first-child { box-sizing: border-box; width: 64px; height: 64px; padding: 18px; border-radius: 50%; color: var(--text); background: color-mix(in srgb,var(--moment-color) 24%,var(--surface)); }
.pick-activity > svg:last-child { display: none; }
.pick-activity > span { font-size: 16px; font-weight: 500; overflow-wrap: anywhere; }
.pick-activity:active { background: var(--soft); }
@media(hover:hover) { .pick-activity:hover { background: var(--soft); } }

/* Outings have explicit live and historical entry modes. */
.walk-modes { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin: 16px 20px; }
.walk-modes button { min-height: 48px; border-radius: 16px; background: var(--surface); padding: 12px; font-size: 16px; }
.walk-modes button[aria-pressed=true] { background: var(--accent); color: var(--on-accent); }
.focus-walk .timer-stage { padding: 16px 0; }
.focus-walk .timer-face { width: 170px; height: 170px; }
.focus-walk.walk-history .focus-stage { flex: 1 0 120px; min-height: 120px; }
.focus-walk.walk-history .timer-face { width: auto; height: auto; background: transparent; box-shadow: none; gap: 8px; }
.focus-walk.walk-history .timer-face > svg { display: none; }

.focus-walk.walk-history .focus-stage { overflow: visible; }
/* Day breaks are a quiet single line, not another card. */
.day-summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; max-width: 100%; margin: 16px 0 4px; padding: 0; background: transparent; border-radius: 0; border-bottom: 1px solid var(--border); text-align: left; }
.day-summary > button { flex-shrink: 0; padding: 8px 0; font-size: 14px; min-height: 44px; color: var(--text); }
.day-summary > div { flex-wrap: nowrap; margin: 0; gap: 12px; min-width: 0; color: var(--muted); }
.day-summary span { gap: 4px; white-space: nowrap; font-size: 13px; }
.day-summary svg { flex-shrink: 0; }
@media(max-width:360px) { .day-summary > div { gap: 8px; } .day-summary span { font-size: 12px; gap: 3px; } }

.action-progress { font-size: 16px; color: var(--text); grid-column: 1 / -1; margin: 0; }
.is-loading::before, .action-progress::before { content: ""; display: inline-block; width: 12px; height: 12px; margin-right: 8px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: busy-spin .8s linear infinite; }
@keyframes busy-spin { to { transform: rotate(360deg); } }
@media(prefers-reduced-motion:reduce) { .is-loading::before,.action-progress::before { animation: none; } }

.calendar-control { display: block; box-sizing: border-box; width: 100%; min-width: 0; max-width: 100%; padding: 12px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }
.calendar-control:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
body .calendar-control input { box-sizing: border-box; display: block; width: 100%; min-width: 0; max-width: 100%; min-height: 24px; padding: 0 !important; margin: 0; border: 0; border-radius: 0; background: transparent; -webkit-appearance: none; appearance: none; box-shadow: none; outline: none; font-size: 16px; }
body .calendar-control input::-webkit-date-and-time-value { min-height: 24px; margin: 0; padding: 0; text-align: left; }
.sleep-modes { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin: 12px 20px; }
.sleep-modes button { min-height: 48px; border-radius: 16px; background: var(--surface); padding: 12px; font-size: 16px; }
.sleep-modes button[aria-pressed=true] { background: var(--accent); color: var(--on-accent); }
.focus-footer { position: sticky; bottom: 0; }
.focus-footer .action-progress { position: absolute; left: 20px; right: 20px; bottom: 100%; padding: 8px 12px; border-radius: 12px; background: var(--surface); }

.past-activity { width: 100%; margin-top: 16px; gap: 10px; }

/* Calendar: one aligned time grid, separate activity lanes and a readable day summary. */
.routine-card { margin-top: 28px; padding: 20px; border: 1px solid var(--border); border-radius: 24px; background: var(--surface); min-width: 0; }
.routine-card .routine-heading { padding: 0; border: 0; align-items: center; }
.routine-card .routine-heading h2 { font-size: 20px; line-height: 1.3; }
.routine-card .routine-heading > span { font-size: 12px; }
.routine-card .routine-legend { gap: 10px 16px; margin: 18px 0; font-size: 12px; }
.routine-card .routine-legend span:before { width: 10px; height: 10px; border-radius: 3px; }
.routine-card .settling-key:before { background: repeating-linear-gradient(135deg,#927bbd 0 2px,#e5ddf2 2px 4px); }
.routine-card .routine-wrap { padding-left: 26px; }
.routine-card .routine-hours { top: 64px; bottom: 0; font-size: 12px; transform: none; }
.routine-hours span { transform: translateY(-50%); }
.routine-card .routine-columns { gap: 0; }
.routine-card .routine-column { border-radius: 12px 12px 0 0; }
.routine-card .routine-column.is-selected { background: color-mix(in srgb,var(--accent) 8%,transparent); }
.routine-column > .routine-date { height: 64px; padding: 4px 0 12px; gap: 4px; border-radius: 12px; font-size: 12px; color: var(--muted); }
.routine-date span { max-width: 100%; overflow: hidden; }
.routine-column > .routine-date strong { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; font-size: 16px; color: var(--text); }
.routine-column.is-selected > .routine-date strong { background: var(--accent); color: var(--on-accent); }
.routine-column > .routine-track { display: block; width: 100%; height: 432px; padding: 0; border-radius: 0; border: 0; border-left: 1px solid var(--border); border-bottom: 1px solid var(--border); background: repeating-linear-gradient(to bottom,var(--border) 0,var(--border) 1px,transparent 1px,transparent calc(100% / 6)); overflow: hidden; position: relative; }
/* Lightly shade 22:00–06:00 behind the activity lanes and four-hour grid. */
.routine-column > .routine-track {
  --night-shade: color-mix(in srgb,var(--text) 7%,transparent);
  background-image:
    repeating-linear-gradient(to bottom,var(--border) 0,var(--border) 1px,transparent 1px,transparent calc(100% / 6)),
    linear-gradient(to bottom,var(--night-shade) 0 25%,transparent 25% calc(100% * 22 / 24),var(--night-shade) calc(100% * 22 / 24) 100%);
}
.routine-column:last-child > .routine-track { border-right: 1px solid var(--border); }
.routine-card .routine-event { border-radius: 3px; min-height: 3px; pointer-events: none; }
.routine-card .routine-event.sleep, .routine-card .routine-event.settling { left: 10%; width: 48%; background: #8975ba; }
.routine-card .routine-event.settling { background: repeating-linear-gradient(135deg,#927bbd 0 2px,#e5ddf2 2px 4px); }
.routine-card .routine-event.feed { left: 65%; width: 13%; background: #c67a27; }
.routine-card .routine-event.diaper { left: 83%; width: 13%; background: #4f938b; }
.routine-day-summary { padding-top: 20px; }
.routine-day-summary h3 { margin: 0 0 14px; font-size: 16px; font-weight: 600; }
.routine-day-summary dl { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; margin: 0; }
.routine-day-summary dt { font-size: 12px; color: var(--muted); margin-bottom: 6px; overflow-wrap: anywhere; }
.routine-day-summary dd { margin: 0; font-size: 16px; font-weight: 600; }
@media(max-width: 400px) {
  .routine-card { padding: 14px 10px; border-radius: 20px; }
  .routine-card .routine-heading h2 { font-size: 18px; }
  .routine-card .routine-legend { gap: 10px 12px; }
  .routine-day-summary dl { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
}

.routine-card .sleep-key:before { background: #8975ba; }

.caregiver-field { border: 0; padding: 0; margin: 0; min-width: 0; }
.caregiver-field legend { font-size: 16px; margin-bottom: 10px; }
.caregiver-options { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.caregiver-options label { display: flex; align-items: center; gap: 10px; min-height: 48px; margin: 0; padding: 10px; border: 1px solid var(--border); border-radius: 14px; overflow-wrap: anywhere; }
.caregiver-options label:has(input:checked) { background: var(--soft); border-color: var(--accent); }
.caregiver-options input { width: 20px; height: 20px; flex-shrink: 0; margin: 0; accent-color: var(--accent); }
.caregiver-field > button { min-height: 44px; }
.caregiver-field > small:empty { display: none; }

:root { --header-height: 82px; --safe-top: env(safe-area-inset-top,0px); --safe-bottom: env(safe-area-inset-bottom,0px); --safe-left: env(safe-area-inset-left,0px); --safe-right: env(safe-area-inset-right,0px); }
@media(max-width:600px) { :root { --header-height: 72px; } }
.journal-header { height: calc(var(--header-height) + var(--safe-top)); padding-top: calc(16px + var(--safe-top)); padding-left: calc(var(--page-gutter) + var(--safe-left)); padding-right: calc(var(--page-gutter) + var(--safe-right)); }
.journal-main { padding-left: calc(var(--page-gutter) + var(--safe-left)); padding-right: calc(var(--page-gutter) + var(--safe-right)); padding-bottom: calc(112px + var(--safe-bottom)); }
.welcome, .onboarding, .shared-page { padding-top: calc(24px + var(--safe-top)); padding-bottom: calc(24px + var(--safe-bottom)); padding-left: calc(24px + var(--safe-left)); padding-right: calc(24px + var(--safe-right)); }
.app-update { padding: calc(12px + var(--safe-top)) calc(16px + var(--safe-right)) 12px calc(16px + var(--safe-left)); }
.sheet { max-height: calc(100dvh - var(--safe-top)); }
.sheet-inner { padding-bottom: calc(var(--card-padding) + var(--safe-bottom)); padding-left: calc(var(--card-padding) + var(--safe-left)); padding-right: calc(var(--card-padding) + var(--safe-right)); }
.focus-dialog { max-height: 100dvh; }
.focus-dialog .sheet-inner { padding: 0; }
.focus-entry { padding-left: var(--safe-left); padding-right: var(--safe-right); }
.focus-header { padding-top: calc(16px + var(--safe-top)); }
.focus-footer { padding-bottom: calc(16px + var(--safe-bottom)); }
.entry-details[open] { bottom: calc(90px + var(--safe-bottom)); left: calc(var(--card-padding) + var(--safe-left)); right: calc(var(--card-padding) + var(--safe-right)); }
.session-dialog { max-height: calc(100dvh - var(--safe-top)); }
.session-dialog .sheet-inner { padding: 0; }
.session-editor { padding-left: calc(24px + var(--safe-left)); padding-right: calc(24px + var(--safe-right)); padding-bottom: calc(24px + var(--safe-bottom)); }
.session-footer { padding-bottom: var(--safe-bottom); }
@media(max-width:360px) { .caregiver-options { grid-template-columns: 1fr; } }

/* Past entries are ordinary forms; live entry screens retain their focused controls. */
.focus-dialog:has(.historical-entry) { width: min(560px,100%); height: auto; max-height: calc(100dvh - var(--safe-top)); margin: auto; border-radius: 24px; overflow: auto; background: var(--surface); }
.historical-entry { height: auto; min-height: 0; overflow: visible; gap: 20px; padding: 24px calc(24px + var(--safe-right)) calc(24px + var(--safe-bottom)) calc(24px + var(--safe-left)); background: var(--surface); }
.historical-entry .focus-header { padding: 0; min-height: 0; }
.historical-entry .focus-header > span { font-size: 20px; }
.historical-entry .focus-stage { display: block; flex: none; min-height: 0; overflow: visible; }
.historical-entry .volume-stage, .historical-entry .weight-stage, .historical-entry .diaper-stage, .historical-entry .timer-stage { height: auto; min-height: 0; padding: 0; gap: 16px; }
.historical-entry .measurement, .historical-entry .weight-previous, .historical-entry .diaper-result, .historical-entry .bath-stage, .historical-entry .timer-face, .historical-entry .sleep-hint, .historical-entry .time-ruler { display: none; }
.historical-entry .feeding-modes { margin: 0 calc(-1 * var(--card-padding)); }
.historical-entry .sleep-modes { margin: 0; }
.historical-entry .diaper-toggles { width: 100%; gap: 12px; }
.historical-entry .diaper-choice { min-height: 60px; flex: 1; padding: 12px; border-radius: 14px; flex-direction: row; gap: 10px; }
.historical-entry .diaper-choice svg { width: 22px; height: 22px; }
.historical-entry .solids-stage { padding: 0; gap: 16px; }
.historical-entry .solids-stage h2, .historical-entry .solids-stage p { display: none; }
.historical-entry .entry-details { display: flex; flex-direction: column; gap: 20px; padding: 0; margin: 0; background: transparent; }
.historical-entry .precise-fields { gap: 20px; }
.historical-entry .focus-footer { position: static; padding: 0; margin-top: 4px; background: transparent; justify-content: space-between; }
.historical-entry .focus-footer > button[type=submit] { min-width: 140px; }
.historical-entry .focus-footer > button[hidden] { display: none; }
.historical-entry .focus-header > button[hidden] { display: none; }
.historical-session .session-notes { display: flex; flex-direction: column; gap: 8px; }
.session-notes > label { margin: 16px 0; }
@media(max-width:600px) {
  .focus-dialog:has(.historical-entry) { margin: auto auto 0; border-radius: 24px 24px 0 0; }
  .historical-entry { padding-top: 24px; }
}
.focus-dialog:has(.historical-entry) .sheet-inner { height: auto; }
.historical-entry .focus-footer { display: grid; grid-template-columns: minmax(0,1fr); }
.caregiver-options label { flex-direction: row; }
.historical-session, .historical-session .session-footer { background: var(--surface); }
.historical-session .session-heading h2 { font-size: 20px; font-weight: 500; }
.historical-session .two-fields { align-items: end; }
.historical-session .pump-yield > output { display: none; }

/* Shared numeric cards keep exact entry alongside thumb-friendly adjustment. */
.number-card { min-width: 0; width: 100%; padding: 16px; border: 1px solid color-mix(in srgb,var(--moment-color,var(--accent)) 42%,var(--border)); border-radius: 24px; background: color-mix(in srgb,var(--moment-color,var(--accent)) 13%,var(--surface)); }
.number-card > label { display: flex; align-items: stretch; text-align: left; gap: 8px; margin: 0; color: var(--text); font-size: 16px; }
.number-card > label > input[type=number], .historical-entry .number-card > label > input[type=number] { width: 100%; min-width: 0; max-width: none; height: 56px; border: 1px solid var(--border); border-radius: 14px; padding: 8px 12px; background: var(--surface); color: var(--text); font-size: 28px; font-weight: 500; text-align: center; font-variant-numeric: tabular-nums; }
.number-adjust { display: grid; grid-template-columns: 48px minmax(0,1fr) 48px; align-items: center; gap: 8px; margin-top: 8px; }
.number-adjust > button { width: 48px; height: 48px; padding: 0; border: 1px solid var(--border); border-radius: 50%; background: var(--surface); color: var(--text); font-size: 24px; }
.number-adjust > input[type=range] { appearance: none; -webkit-appearance: none; width: 100%; min-width: 0; height: 48px; padding: 0; margin: 0; border: 0; border-radius: 0; background: transparent; cursor: pointer; touch-action: pan-y; }
.number-adjust input::-webkit-slider-runnable-track { height: 8px; border-radius: 8px; background: linear-gradient(to right,var(--accent) var(--number-fill),var(--border) var(--number-fill)); }
.number-adjust input::-moz-range-track { height: 8px; border-radius: 8px; background: var(--border); }
.number-adjust input::-moz-range-progress { height: 8px; border-radius: 8px; background: var(--accent); }
.number-adjust input::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 28px; height: 28px; margin-top: -10px; border: 3px solid var(--surface); border-radius: 50%; background: var(--accent); box-shadow: 0 1px 5px #0003; }
.number-adjust input::-moz-range-thumb { width: 24px; height: 24px; border: 3px solid var(--surface); border-radius: 50%; background: var(--accent); }
.number-adjust > :focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.number-adjust > button:active { transform: scale(.94); }
.historical-entry .focus-header > span, .session-heading h2 { display: flex; align-items: center; gap: 12px; }
.historical-entry .focus-header > span > svg, .session-heading h2 > svg { flex: 0 0 48px; width: 48px; height: 48px; padding: 12px; border-radius: 18px; background: color-mix(in srgb,var(--moment-color,var(--accent)) 24%,var(--surface)); }
.historical-entry .diaper-choice { min-height: 80px; border-radius: 20px; }
.historical-entry .diaper-choice svg { width: 32px; height: 32px; }
.historical-entry .entry-details, .historical-session .manual-session { padding-top: 20px; border-top: 1px solid var(--border); }
.historical-entry .precise-fields, .historical-session .manual-session { gap: 20px; }
.session-editor .two-fields:has(.number-card) { grid-template-columns: minmax(0,1fr); }
@media(min-width:520px) { .session-editor .two-fields:has(.number-card) { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media(prefers-reduced-motion:reduce) { .number-adjust > button:active { transform: none; } }

/* Compact session controls: amount sits with the breast it belongs to. */
.session-editor { gap: 10px; padding-top: 16px; }
.session-heading h2 { font-size: 20px; }
.session-heading h2 > svg { flex-basis: 36px; width: 36px; height: 36px; padding: 8px; border-radius: 12px; }
.session-total > strong { font-size: 32px; }
.session-total > span { margin-top: 0; }
.session-total > p { margin: 4px 0 0; }
.session-sides { gap: 10px; }
.session-sides button { min-height: 104px; width: 100%; gap: 4px; padding: 10px 6px; border-radius: 20px; }
.session-sides button strong { font-size: 26px; }
.breast-column { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.breast-column label { font-size: 16px; gap: 4px; }
.breast-column input { min-width: 0; width: 100%; height: 44px; padding: 8px; text-align: center; font-size: 18px; }
.session-controls { gap: 10px; }
.session-controls button { min-height: 44px; font-size: 16px; padding: 8px; }
.session-previous { font-size: 16px; line-height: 1.35; }

.live-pump .pump-yield { padding-top: 0; border-top: 0; gap: 6px; }
.live-pump .pump-yield h3, .live-pump .pump-yield output { display: none; }
.live-pump .pump-yield > label:first-of-type { display: grid; grid-template-columns: auto minmax(0,1fr); align-items: center; gap: 10px; }
.live-pump .pump-yield select { height: 44px; padding: 8px; }
.live-pump .pump-yield input { height: 44px; }
.session-notes summary { min-height: 44px; padding: 8px 0; }
.session-footer { padding-top: 0; gap: 0; }
.session-footer .button { min-height: 48px; font-size: 16px; }
.session-footer .text-button { min-height: 44px; padding: 8px; }
.session-editor .form-error:empty { display: none; }
.number-card { padding: 8px; border-radius: 16px; }
.number-card > label { gap: 4px; }
.number-card > label > input[type=number], .historical-entry .number-card > label > input[type=number] { height: 44px; font-size: 20px; padding: 6px 8px; }
.number-adjust { grid-template-columns: 44px minmax(0,1fr) 44px; gap: 4px; margin-top: 0; }
.number-adjust > button { width: 44px; height: 44px; font-size: 20px; }
.number-adjust > input[type=range] { height: 44px; }
.session-editor .two-fields:has(.number-card) { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.historical-session .number-adjust { grid-template-columns: 44px minmax(0,1fr) 44px; }
.historical-session .number-adjust input { min-width: 0; }
.historical-session .manual-session, .historical-entry .entry-details { padding-top: 10px; gap: 10px; }
.historical-session .pump-yield { gap: 8px; padding-top: 10px; }
.historical-session .session-notes textarea { min-height: 44px; height: 44px; }
@media(max-width:360px) { .session-editor { padding-left: calc(12px + var(--safe-left)); padding-right: calc(12px + var(--safe-right)); } }
@media(max-height:740px) {
  .session-editor:not(.historical-session) { gap: 6px; padding-top: 8px; padding-bottom: calc(8px + var(--safe-bottom)); }
  .session-editor:not(.historical-session) .session-total { display: grid; grid-template-columns: auto minmax(0,1fr); align-items: center; gap: 8px; text-align: left; }
  .session-editor:not(.historical-session) .session-total > span { display: none; }
  .session-editor:not(.historical-session) .session-total > p { margin: 0; text-align: right; }
  .session-editor:not(.historical-session) .session-sides button { min-height: 88px; }
  .session-editor:not(.historical-session) .session-heading .round { width: 44px; height: 44px; min-height: 44px; }
}
.historical-session .number-adjust { grid-template-columns: minmax(0,1fr); }
.historical-session .number-adjust > button { display: none; }
.growth-card {
  margin: 20px 0;
  padding: clamp(12px, 3vw, 24px);
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--surface);
}
.growth-card h2 { margin: 0; font-size: 20px; }
.growth-reading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.growth-reading strong { display: block; font-size: clamp(24px, 5vw, 36px); }
.growth-reading span, .growth-reading label, .growth-reading small { color: var(--muted); }
.growth-reading small { display: block; }
.growth-reading .growth-rank { color: var(--text); font-weight: 600; }
.growth-actions { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.growth-reading label { font-size: 14px; }
.growth-reading input { min-height: 44px; max-width: 100%; }
.growth-figure { margin: 16px 0 10px; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.growth-unit { display: block; margin-bottom: 10px; }
.growth-plot {
  position: relative;
  height: clamp(210px, 44vh, 390px);
  margin-inline: 38px 40px;
}
.growth-plot > svg { display: block; width: 100%; height: 100%; overflow: visible; }
.growth-plot polyline { fill: none; }
.growth-grid { stroke: var(--border); }
.growth-reference { stroke: var(--muted); stroke-width: 1; opacity: .65; }
.growth-reference.median { stroke-width: 1.8; }
.growth-leader { stroke: var(--muted); opacity: .65; stroke-dasharray: 2 3; }
.growth-recorded { stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; }
.growth-recorded.estimate { stroke-dasharray: 5 5; }
.growth-x-label, .growth-y-label, .growth-percentile { position: absolute; white-space: nowrap; pointer-events: none; }
.growth-x-label { top: calc(100% + 8px); transform: translateX(-50%); }
.growth-y-label { right: calc(100% + 6px); transform: translateY(-50%); }
.growth-percentile { left: calc(100% + 5px); transform: translateY(-50%); }
.growth-figure figcaption { margin-top: 32px; text-align: center; }
.growth-point {
  position: absolute;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
}
.growth-point::after {
  content: "";
  width: 10px;
  height: 10px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--accent);
}
.growth-point.estimate::after { background: var(--surface); border-color: var(--accent); }
.growth-point[aria-pressed="true"]::after { outline: 2px solid var(--accent); }
.growth-point:focus-visible { z-index: 1; }
.growth-key { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 16px; color: var(--muted); font-size: 14px; }
.growth-card summary { min-height: 44px; padding: 10px 0; cursor: pointer; color: var(--muted); }
.growth-card p { line-height: 1.5; }
.growth-card table { width: 100%; border-collapse: collapse; margin-top: 16px; }
.growth-card th, .growth-card td { padding: 8px 2px; text-align: left; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
.awake-video { position: fixed; bottom: 0; right: 0; width: 1px; height: 1px; opacity: .01; pointer-events: none; }
.wake-status { font-size: 14px; min-height: 44px; padding: 8px 0; }
.session-total .wake-status { grid-column: 1 / -1; }
/* A slow, faint sheen distinguishes running sessions without flashing. */
.active-activity { position: relative; isolation: isolate; overflow: hidden; }
.active-activity.is-running::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: linear-gradient(105deg,transparent 25%,rgba(255,255,255,.13) 50%,transparent 75%); transform: translateX(-100%); animation: activity-sheen 9s ease-in-out infinite; }
.active-activity.kind-feed::before, .active-activity.kind-pump::before { content: none; }
@keyframes activity-sheen { 0%,15% { transform: translateX(-100%); } 75%,100% { transform: translateX(100%); } }
@media(prefers-reduced-motion:reduce) { .active-activity.is-running::before { animation: none; content: none; } }
.moment-capsule > svg:first-child, .active-activity-icon { color: color-mix(in srgb,var(--moment-color) 55%,#000); }
:root[data-theme=dark] .moment-capsule > svg:first-child, :root[data-theme=dark] .active-activity-icon { color: color-mix(in srgb,var(--moment-color) 80%,#fff); }

.shared-report dl { margin: 18px 0; }
.shared-report dt { font-weight: 600; margin-top: 14px; }
.shared-report dd { margin: 4px 0 0; overflow-wrap: anywhere; }
.shared-report time { overflow-wrap: anywhere; }
.shared-report article { margin: 20px 0; }
.shared-report summary { cursor: pointer; font-weight: 600; }

.journal-header .baby-switch { margin-left: auto; }
.journal-header .connection { min-width: 0; margin-left: auto; }
.quick-circle { border: 0; box-shadow: none; }
.quick-circle > span { color: var(--text); }
.baby-settings { padding: 20px 0; border-top: 1px solid var(--border); }
.baby-settings h3 { margin: 0 0 16px; }

/* Activity forms keep their actions visible while only the body scrolls. */
.pick-activity > svg:first-child { color: var(--moment-color); }
.focus-dialog:has(.pinned-activity), .session-dialog:has(.pinned-activity) { height: fit-content; max-height: calc(100dvh - 32px); overflow: hidden; }
.focus-dialog:has(.pinned-activity) .sheet-inner, .session-dialog:has(.pinned-activity) .sheet-inner { display: flex; flex-direction: column; height: auto; max-height: inherit; padding: 0; overflow: hidden; }
.pinned-activity { display: flex; flex-direction: column; height: auto; max-height: inherit; min-height: 0; padding: 0; gap: 0; overflow: hidden; }
.pinned-activity > header { flex: none; padding: 16px 24px; }
.activity-scroll { flex: 0 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 16px; padding: 0 24px 16px; }
.focus-entry:not(.historical-entry) > .activity-scroll { padding: 0; }
.activity-scroll > * { flex-shrink: 0; }
.activity-scroll > .focus-stage { flex: none; min-height: 0; }
.activity-scroll .volume-stage, .activity-scroll .weight-stage, .activity-scroll .timer-stage { height: auto; }
.historical-entry .activity-scroll > .focus-stage { flex: none; min-height: 0; }
.pinned-activity > footer.focus-footer, .pinned-activity > footer.session-footer { position: static; flex: none; display: flex; flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; margin: 0; padding: 12px calc(16px + var(--safe-right)) calc(12px + var(--safe-bottom)) calc(16px + var(--safe-left)); background: var(--surface); }
.pinned-activity > footer > button { flex: 1; min-width: 0; }
.pinned-activity > footer > button[hidden] { display: none; }
.pinned-activity > footer > .back, .pinned-activity > footer > .time-button { flex: 0 0 auto; }

.session-editor.pinned-activity { padding: 0; gap: 0; }

/* Shared content-sized modal shell, bottom-anchored on mobile. */
.sheet { width: min(560px, calc(100% - 32px)); max-width: 100%; max-height: calc(100dvh - 32px); border-radius: 24px; background: var(--bg); }
.sheet::backdrop { background: #281b164d; backdrop-filter: blur(5px); }
.sheet .sheet-inner { padding: 20px 24px calc(20px + var(--safe-bottom)); }
.sheet .sheet-header { gap: 16px; margin: 0 0 20px; min-height: 44px; }
.sheet .sheet-header h2 { margin: 0; font-size: 20px; font-weight: 600; line-height: 1.3; }
.sheet form.pinned-activity { background: var(--bg); }
.sheet form.pinned-activity > header { padding: 16px calc(24px + var(--safe-right)) 16px calc(24px + var(--safe-left)); min-height: 76px; gap: 16px; background: var(--bg); }
.sheet form.pinned-activity > header > span, .sheet .session-heading h2 { font-size: 20px; font-weight: 600; line-height: 1.3; display: flex; align-items: center; gap: 12px; margin: 0; }
.sheet form.pinned-activity > header svg { flex-shrink: 0; }
.sheet form.pinned-activity > header > span > svg, .sheet .session-heading h2 > svg { width: 36px; height: 36px; flex-basis: 36px; padding: 8px; border-radius: 12px; color: var(--moment-color, var(--accent)); background: color-mix(in srgb,var(--moment-color,var(--accent)) 20%,var(--surface)); }
.sheet .sheet-header > button, .sheet form.pinned-activity > header > button { display: grid; place-items: center; flex: 0 0 44px; width: 44px; height: 44px; min-height: 44px; padding: 10px; border-radius: 14px; background: var(--surface); color: var(--text); }
.sheet form.pinned-activity > footer { background: var(--bg); }
.sheet .confirm-actions { display: flex; gap: 12px; }
.sheet .confirm-actions > button { flex: 0 0 auto; min-height: 52px; }
.sheet .confirm-actions > .primary { flex: 1; }
.sheet form > button[type=submit], .activity-picker-popup .button { min-height: 52px; }
@media (max-width: 600px) {
  dialog.sheet { width: 100%; max-width: 100%; max-height: 100dvh; margin: auto 0 0; border-radius: 24px 24px 0 0; }
  dialog.sheet.focus-dialog:has(.pinned-activity), dialog.sheet.session-dialog:has(.pinned-activity) { height: fit-content; max-height: 100dvh; margin: auto 0 0; border-radius: 24px 24px 0 0; }
  .sheet form.pinned-activity > header { padding-top: calc(16px + var(--safe-top)); }
}

.baby-settings { background: var(--bg); border: 0; border-radius: 18px; padding: 18px; margin: 16px 0; }
.palette-options { grid-template-columns: repeat(3,minmax(0,1fr)); }
.pinned-activity > footer > .attribution-button { flex: 0 0 48px; padding: 10px; border-radius: 14px; }
.activity-scroll > .caregiver-field { margin: 16px 24px; }
.activity-scroll > .caregiver-field[hidden] { display: none; }
.access-links:empty { display: none; }
.access-links .link-row { flex-wrap: wrap; }
:root[data-palette=graphite] { --bg:#f1f2f3; --surface:#fcfcfd; --text:#34373b; --muted:#64686e; --border:#d7d9dc; --accent:#505760; --soft:#e2e4e7; --on-accent:#fff; }
:root[data-palette=rose] { --bg:#fff0f1; --surface:#fffafb; --text:#723c4c; --muted:#865c68; --border:#edd0d8; --accent:#a13760; --soft:#f8dce5; --on-accent:#fff; }
:root[data-palette=aqua] { --bg:#e8f8f8; --surface:#f9ffff; --text:#225256; --muted:#4b7276; --border:#c4e3e5; --accent:#1f6e77; --soft:#d1edf0; --on-accent:#fff; }
:root[data-theme=dark][data-palette=graphite] { --bg:#1c1e21; --surface:#292c30; --text:#eceef1; --muted:#b8bdc5; --border:#454b53; --accent:#bcc5d1; --soft:#363c44; --on-accent:#1c1e21; }
:root[data-theme=dark][data-palette=rose] { --bg:#2d1b23; --surface:#402832; --text:#f9dce7; --muted:#d0adb9; --border:#65424f; --accent:#f0abc5; --soft:#54303f; --on-accent:#2d1b23; }
:root[data-theme=dark][data-palette=aqua] { --bg:#14282b; --surface:#203a3f; --text:#d8f3f5; --muted:#a3c8cd; --border:#34575e; --accent:#8ed5df; --soft:#294b52; --on-accent:#14282b; }
.palette-option[data-palette=graphite] .palette-swatch { background:#505760; }
.palette-option[data-palette=rose] .palette-swatch { background:#a13760; }
.palette-option[data-palette=aqua] .palette-swatch { background:#1f6e77; }

/* Footer roles are consistent across activity forms. */
.sheet .pinned-activity > footer { justify-content: flex-end; gap: 8px; flex-wrap: nowrap; }
.sheet .pinned-activity > footer > button { flex: 0 0 auto; width: auto; min-width: 48px; min-height: 52px; height: auto; border: 0; border-radius: 14px; padding: 12px; font-size: 16px; background: var(--soft); color: var(--text); }
.sheet .pinned-activity > footer > button[type=submit] { flex: 1 1 0; order: 3; background: var(--accent); color: var(--on-accent); }
.sheet .pinned-activity > footer > .save-secondary { order: 2; }
.sheet .pinned-activity > footer > .attribution-button { padding: 10px; width: 48px; }
.sheet .pinned-activity > footer > .time-button { min-width: 44px; padding: 10px 8px; }
.sheet .pinned-activity > .activity-scroll .manual-session, .sheet .pinned-activity > .activity-scroll .entry-details { border-top: 0; }
.activity-picker-popup { width: min(360px,calc(100vw - 32px)); height: fit-content; }
.activity-picker-popup .caregiver-field { margin: 0 0 20px; }
.activity-picker-popup .caregiver-field legend { font-size: 20px; font-weight: 600; margin-bottom: 16px; }
.activity-picker-popup .caregiver-options { grid-template-columns: 1fr; }
.activity-picker-popup .button { width: 100%; }
@media(min-width:601px) { dialog.activity-picker-popup { position: fixed; margin: 0; right: auto; bottom: auto; } }
@media(max-width:600px) { dialog.activity-picker-popup { top: auto; left: 0; bottom: 0; } }
.sheet .activity-picker-popup .sheet-inner { display: block; padding: 24px 24px calc(24px + var(--safe-bottom)); }
@media(max-width:400px) {
  .sheet .pinned-activity > footer { gap: 6px; flex-wrap: nowrap; padding-left: 12px; padding-right: 12px; }
  .sheet .pinned-activity > footer > button { padding: 10px 8px; }
  .sheet .pinned-activity > footer > button[type=submit] { min-width: 0; }
}

.sheet .sleep-starting-position { width: 100%; max-width: none; align-items: stretch; text-align: left; padding: 0 24px; box-sizing: border-box; }
.sheet .historical-entry .sleep-starting-position { padding: 0; }
.sheet .sleep-starting-position select { width: 100%; max-width: none; }
.activity-picker-popup .time-note-fields { margin-bottom: 20px; }
.activity-picker-popup h2 { font-size: 20px; margin: 0 0 20px; }
.activity-picker-popup .precise-fields { display: flex; flex-direction: column; gap: 16px; }
.activity-picker-popup textarea { width: 100%; }

/* Compact numeric controls: editable value and steppers above a sliding ruler. */
.sheet .number-card { width: 100%; min-width: 0; padding: 0; border: 0; background: transparent; }
.sheet .number-card > label { display: block; margin: 0 0 6px; padding: 0; font-size: 16px; text-align: left; color: var(--muted); }
.number-surface { padding: 8px; border-radius: 20px; background: var(--soft); }
.number-row { display: grid; grid-template-columns: 44px minmax(0,1fr) 44px; align-items: center; gap: 4px; }
.sheet .number-row > button { display: grid; place-items: center; line-height: 1; appearance: none; -webkit-appearance: none; width: 44px; height: 44px; min-height: 44px; padding: 0; border: 0; border-radius: 14px; background: var(--surface); color: var(--text); font-size: 22px; }
.number-value { display: flex; align-items: baseline; justify-content: center; min-width: 0; gap: 4px; }
.sheet .number-value > input { flex: 0 1 auto; min-width: 0; max-width: calc(100% - 26px); height: 44px; padding: 0; margin: 0; border: 0; border-radius: 6px; background: transparent; color: var(--text); font-size: 28px; font-weight: 500; line-height: 1; text-align: center; font-variant-numeric: tabular-nums; appearance: textfield; -moz-appearance: textfield; }
.number-value input::-webkit-inner-spin-button, .number-value input::-webkit-outer-spin-button { appearance: none; margin: 0; }
.number-value > span { font-size: 16px; color: var(--muted); }
/* Both 60px tiles share the centered pointer origin. Skip minor marks at
   major positions so antialiased edges never stack into darker strokes. */
.number-ruler { position: relative; height: 32px; margin-top: 4px; overflow: hidden; border-radius: 6px; cursor: ew-resize; touch-action: pan-y; }
.number-ruler-ticks { position: absolute; inset: 0; pointer-events: none; mask-image: linear-gradient(to right, #0003 0 calc(50% + var(--range-start)), #000 calc(50% + var(--range-start)) calc(50% + var(--range-end)), #0003 calc(50% + var(--range-end)) 100%); background-image: repeating-linear-gradient(to right,var(--text) 0 1px,transparent 1px 60px),linear-gradient(to right,transparent 0 12px,var(--muted) 12px 13px,transparent 13px 24px,var(--muted) 24px 25px,transparent 25px 36px,var(--muted) 36px 37px,transparent 37px 48px,var(--muted) 48px 49px,transparent 49px); background-size: 60px 16px,60px 9px; background-position: calc(50% + 29.5px + var(--tick-offset)) center; background-repeat: repeat-x; }
.number-ruler::after { content: ""; position: absolute; left: calc(50% - 1px); top: 5px; width: 2px; height: 23px; border-radius: 2px; background: var(--accent); pointer-events: none; }
.number-ruler::before { content: ""; position: absolute; left: calc(50% - 3px); top: 4px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); pointer-events: none; }
.sheet .number-ruler > input[type=range] { display: block; width: 100%; height: 32px; min-height: 0; margin: 0; padding: 0; opacity: 0; pointer-events: none; }
.number-ruler:focus-within, .number-value input:focus-visible, .number-row button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.number-row button:disabled { opacity: .4; }

.number-value input { touch-action: pan-y; }
@media(max-width:400px) {
  .session-editor .two-fields:has(.number-card), .session-sides:has(.number-card:not([hidden])) { grid-template-columns: minmax(0,1fr); }
}

.number-value { min-height: 44px; cursor: text; touch-action: pan-y; }

/* Pumping labels already name the unit; reserve the center for the value. */
.kind-pump .number-value > span { display: none; }
.sheet .kind-pump .number-value > input { max-width: 100%; }
/* Keep the original value-and-ruler layout without crowding the durations. */
.session-editor.kind-pump .two-fields:has(input[name$="Minutes"]) { grid-template-columns: repeat(2,minmax(0,1fr)); }
.kind-pump .number-card:has(input[name$="Minutes"]) .number-row { grid-template-columns: minmax(0,1fr); }
.kind-pump .number-card:has(input[name$="Minutes"]) .number-row > button { display: none; }
.sheet .kind-pump .number-card .number-value > input[data-duration] { font-size: 20px; }

:root[data-palette=cream] { --bg:#faf5e9; --surface:#fffdf6; --text:#51452f; --muted:#77684d; --border:#e4dac5; --accent:#75603c; --soft:#eee4ce; --on-accent:#fff; }
:root[data-theme=dark][data-palette=cream] { --bg:#242018; --surface:#332d22; --text:#f4e9d2; --muted:#c9bda5; --border:#544a37; --accent:#dfc58f; --soft:#443a29; --on-accent:#242018; }
.palette-option[data-palette=cream] .palette-swatch { background:#75603c; }

.palette-custom { position:relative; }
.palette-custom:has(input:focus-visible) { outline:3px solid var(--accent); outline-offset:4px; }
.rainbow-swatch { background:conic-gradient(#e55a5a, #e8bf46, #67b967, #4fbfc1, #637ee2, #b465c9, #e55a5a); }
.rainbow-swatch svg { filter:drop-shadow(0 1px 2px #000); }
/* Direct native hit target: proxy clicks do not reliably open the iOS picker. */
.palette-color-input { position:absolute; inset:0; width:100%; height:100%; min-height:0; margin:0; padding:0; border:0; opacity:0; cursor:pointer; touch-action:manipulation; }

/* Kodē mobile tab-bar proportions, using Baby's palette on every screen. */
.journal-nav {
  position: fixed;
  bottom: max(10px, var(--safe-bottom));
  left: max(16px, var(--safe-left));
  right: max(16px, var(--safe-right));
  width: auto;
  max-width: 430px;
  height: 68px;
  margin-inline: auto;
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 9999px;
  background: color-mix(in srgb, var(--surface) 84%, transparent);
  box-shadow: 0 4px 18px rgb(0 0 0 / 12%), 0 1px 3px rgb(0 0 0 / 8%);
  -webkit-backdrop-filter: blur(28px);
  backdrop-filter: blur(28px);
  isolation: isolate;
  z-index: 10;
}
.journal-nav button {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 8px 4px;
  border-radius: 29px;
  color: var(--muted);
}
.journal-nav .nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
}
.journal-nav .nav-label {
  color: var(--text);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 9px;
  font-weight: 500;
  line-height: 10px;
}
.journal-nav button.selected {
  background: var(--soft);
  color: var(--text);
}
@media (prefers-reduced-transparency: reduce) {
  .journal-nav {
    background: var(--surface);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}
@media (prefers-contrast: more) {
  .journal-nav { border-color: var(--text); }
}

/* Destructive activity actions live beside Close, outside the footer. */
.sheet .pinned-activity > header { position: relative; z-index: 2; }
.activity-more { position: relative; margin-left: auto; flex: 0 0 44px; }
.activity-more > summary { display: grid; place-items: center; list-style: none; width: 44px; height: 44px; border-radius: 14px; background: var(--surface); cursor: pointer; }
.activity-more > summary::-webkit-details-marker { display: none; }
.activity-more-dropdown { position: absolute; right: 0; top: calc(100% + 8px); min-width: 140px; padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 8px 24px #0002; }
.activity-more-dropdown > button { width: 100%; min-height: 48px; text-align: left; padding: 12px; border-radius: 10px; }
.sheet .pinned-activity > footer > button, .sheet .pinned-activity > footer > button span { white-space: nowrap; overflow-wrap: normal; }
@media(max-width:359px) {
  .sheet .pinned-activity > footer { flex-wrap: wrap; }
  .sheet .pinned-activity > footer > button[type=submit] { flex-basis: 100%; }
}

/* Milk uses the same compact number card as the other activity forms. */
.sheet .volume-stage { height: auto; min-height: 0; padding: 16px 24px; }
.sheet .historical-entry .volume-stage { padding: 0; }

/* Confetti stays inside its own journal card and never covers activity controls. */
.milestone-celebration {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--surface);
  max-width: 540px;
  margin: 0 auto 20px;
  padding: 18px min(20%, 108px);
  text-align: center;
  pointer-events: none;
}
.milestone-message {
  position: relative;
  display: grid;
  gap: 4px;
}
.milestone-message span { font-size: 16px; color: var(--muted); }
.milestone-message strong { font-size: 20px; color: var(--accent); }
.milestone-confetti { position: absolute; inset: 0; overflow: hidden; }
.milestone-confetti i {
  position: absolute;
  left: var(--x);
  top: -12px;
  width: 6px;
  height: 10px;
  border-radius: 2px;
  background: hsl(var(--hue) 65% 60%);
  animation: milestone-fall var(--duration) var(--delay) linear infinite;
}
.milestone-confetti i:nth-child(3n) { border-radius: 50%; width: 7px; height: 7px; }
@keyframes milestone-fall {
  from { transform: translateY(0) rotate(0); opacity: 0; }
  10%, 80% { opacity: .8; }
  to { transform: translateY(180px) rotate(var(--turn)); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .milestone-confetti i {
    animation: none;
    top: 25%;
    transform: rotate(var(--turn));
    opacity: .65;
  }
  .milestone-confetti i:nth-child(3n) { top: 65%; }
  .milestone-confetti i:nth-child(3n + 1) { top: 45%; }
}

.quick-circle.feed { position: relative; }
.feed-estimate-badge {
  position: absolute;
  top: calc(100% - 16px);
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 6px;
  color: var(--text);
  background: var(--surface);
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.feed-estimate-badge.is-elapsed {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
}

/* A flat mark and its expressive, layered counterpart share one silhouette. */
.baby-mascot {
  display: inline-block; flex: none; vertical-align: middle; overflow: visible;
  pointer-events: none; --mascot-peach: #e9a06c; --mascot-depth: #c77d51;
  --mascot-blush: #e9b298; --mascot-ink: #573e36; --mascot-cream: #fff2db;
  --mascot-hand: #bf805b; --mascot-sage: #9cbdaa; --mascot-sage-dark: #698f80; --mascot-rose: #d77787;
}
.mascot-peach { fill: var(--mascot-peach); }
.mascot-depth { fill: var(--mascot-depth); }
.mascot-blush { fill: var(--mascot-blush); }
.mascot-ink { fill: var(--mascot-ink); }
.mascot-cream { fill: var(--mascot-cream); }
.mascot-hand { fill: var(--mascot-hand); }
:root[data-theme=dark] .baby-mascot { --mascot-hand: #efbe95; }
.mascot-glint { fill: #fffaf2; }
.mascot-sage { fill: var(--mascot-sage); }
.mascot-sage-dark { fill: var(--mascot-sage-dark); }
.mascot-rose { fill: var(--mascot-rose); }
.mascot-shadow { fill: var(--mascot-ink); opacity: .09; }
.mascot-body, .mascot-face, .mascot-smile, .mascot-heart,
.mascot-pacifier, .mascot-eye, .mascot-wave, .mascot-spark {
  transform-box: fill-box; transform-origin: center;
}
.mascot-body { animation: baby-nod 6s cubic-bezier(.45,0,.25,1) infinite; }
.mascot-face { animation: baby-look 6s cubic-bezier(.45,0,.25,1) infinite; }
.mascot-eye { animation: baby-blink 5.7s linear infinite; }
.mascot-wave { transform-origin: 45% 90%; animation: baby-wave 6s cubic-bezier(.45,0,.25,1) infinite; }
.mascot-curious .mascot-body { animation-name: baby-curious; animation-duration: 8s; }
.mascot-curious .mascot-face { animation-duration: 8s; }
.mascot-sleepy .mascot-body { animation: baby-breathe 5s ease-in-out infinite; }
.mascot-sleepy .mascot-face { animation: none; }
.mascot-pacifier { animation: baby-suck 3.6s cubic-bezier(.45,0,.25,1) infinite; }
.mascot-dummy-ring { transform-box: fill-box; transform-origin: 50% 0; animation: baby-ring 3.6s cubic-bezier(.45,0,.25,1) infinite; }
.mascot-dummy-depth { fill: #286d65; }
.mascot-dummy-shield { fill: #419386; }
.mascot-dummy-cap { fill: #91cec1; }
.mascot-dummy-rim { fill: #69b7ac; }
.mascot-celebrate .mascot-body { animation: baby-cheer 3.8s cubic-bezier(.45,0,.25,1) infinite; }
.mascot-celebrate .mascot-smile { animation: baby-giggle 3.8s ease-in-out infinite; }
.mascot-spark { animation: baby-twinkle 3.8s ease-in-out infinite; }
.mascot-love .mascot-body { animation: baby-cuddle 7s ease-in-out infinite; }
.mascot-heart { animation: baby-offer 7s ease-in-out infinite; }
.baby-mascot * { animation-play-state: paused; }
.baby-mascot.mascot-visible * { animation-play-state: running; }
.mascot-paused .baby-mascot * { animation-play-state: paused; }
.mascot-flat * { animation: none; }
.mascot-flat .mascot-shadow, .mascot-flat .mascot-wave { display: none; }
.mascot-flat .mascot-depth { display: none; }
.brand.simple > .baby-mascot, .wordmark > .baby-mascot { width: 40px; height: 40px; }
.auth-card > .baby-mascot, .onboard-card > .baby-mascot { display: block; margin: 0 auto 20px; }
.boot > .baby-mascot { margin: 0 auto 12px; }
.journal-empty > .baby-mascot, .empty-state > .baby-mascot { margin-bottom: 8px; }
.milestone-celebration > .baby-mascot { position: relative; margin-bottom: 4px; }
.page-heading .mascot-heading, .chart-heading .mascot-heading { display: flex; align-items: center; gap: 12px; }
.active-activity-icon > .baby-mascot { width: 44px; height: 44px; }
@keyframes baby-look {
  0%, 12%, 100% { transform: translate(0,0); }
  28%, 40% { transform: translate(5px,1px) scaleX(.95); }
  62%, 76% { transform: translate(-4px,-1px) scaleX(.96); }
}
@keyframes baby-nod {
  0%, 12%, 100% { transform: rotate(0); }
  28%, 40% { transform: rotate(4deg) translateY(1px); }
  62%, 76% { transform: rotate(-3deg) translateY(-1px); }
}
@keyframes baby-curious {
  0%, 20%, 100% { transform: rotate(-2deg); }
  35%, 55% { transform: rotate(7deg) translateY(-2px); }
  70%, 85% { transform: rotate(-4deg); }
}
@keyframes baby-blink {
  0%, 69%, 73%, 100% { transform: scaleY(1); }
  71% { transform: scaleY(.08); }
}
@keyframes baby-wave {
  0%, 16%, 60%, 100% { transform: rotate(0); }
  25%, 43% { transform: rotate(18deg) translateY(-3px); }
  34%, 52% { transform: rotate(-12deg) translateY(-3px); }
}
@keyframes baby-breathe { 0%, 100% { transform: translateY(1px); } 50% { transform: translateY(-1px) scale(1.02); } }
/* Two small sucks, then a rest; the ring tips inward with the shield. */
@keyframes baby-suck {
  0%, 12%, 40%, 68%, 100% { transform: translateY(0) scale(1); }
  24%, 52% { transform: translateY(-1.2px) scale(.91,.86); }
  32%, 60% { transform: translateY(.3px) scale(1.02,1.01); }
}
@keyframes baby-ring {
  0%, 12%, 40%, 68%, 100% { transform: scaleY(1); }
  24%, 52% { transform: scaleY(.68); }
  32%, 60% { transform: scaleY(1.03); }
}
@keyframes baby-cheer {
  0%, 60%, 100% { transform: translateY(0) rotate(-3deg); }
  22% { transform: translateY(-5px) rotate(4deg); }
  35% { transform: translateY(0) scale(1.02,.98); }
  46% { transform: translateY(-3px) rotate(-3deg); }
}
@keyframes baby-giggle { 0%, 65%, 100% { transform: scaleY(1); } 22%, 46% { transform: scaleY(1.18); } }
@keyframes baby-twinkle { 0%, 100% { transform: scale(.9) rotate(-4deg); opacity: .55; } 40% { transform: scale(1.08) rotate(4deg); opacity: 1; } }
@keyframes baby-cuddle { 0%, 100% { transform: rotate(-5deg); } 40%, 60% { transform: translateY(-2px) rotate(4deg); } }
@keyframes baby-offer { 0%, 100% { transform: translateY(-2px) scale(.9); } 40%, 60% { transform: translateY(1px) scale(1.05); } }
@media(max-width:600px) {
  .brand.simple > .baby-mascot, .wordmark > .baby-mascot { width: 34px; height: 34px; }
  .chart-heading .mascot-heading { gap: 4px; }
  .chart-heading .mascot-heading > .baby-mascot { width: 44px; height: 44px; }
}
@media(prefers-reduced-motion:reduce) { .baby-mascot * { animation: none !important; } }

/* Flat activity characters share the fox's palette and expressive, restful gestures. */
.activity-icon { flex-shrink: 0; overflow: visible; }
.activity-icon :is(.activity-body,.activity-face,.activity-eyes,.activity-smile,.activity-hand,.activity-milk,.activity-tab,.activity-pump-handle,.activity-wheel,.activity-duck,.activity-bubbles,.activity-needle,.activity-spoon,.activity-cradle,.activity-love,.activity-dream-puff) {
  transform-box: fill-box; transform-origin: center;
  animation: activity-bounce 5.8s cubic-bezier(.45,0,.25,1) infinite;
  animation-play-state: paused;
}
.activity-icon .activity-body { transform-origin: 50% 90%; }
.activity-icon .activity-face { animation-name: activity-look; }
.activity-icon .activity-eyes { animation-name: activity-blink; animation-duration: 6.7s; }
.activity-icon .activity-smile { animation-name: activity-grin; }
.activity-icon .activity-hand { transform-origin: 0 90%; animation-name: activity-wave; }
.activity-icon .activity-milk { animation-name: activity-slosh; transform-origin: 50% 100%; }
.activity-icon .activity-tab { animation-name: activity-flap; transform-origin: 100% 50%; }
.activity-icon .activity-tab-right { transform-origin: 0 50%; animation-direction: reverse; }
.activity-icon .activity-pump-handle { transform-origin: 100% 100%; animation-name: activity-pump; animation-duration: 4.8s; }
.activity-icon .activity-wheel { animation-name: activity-wheel; animation-duration: 6s; }
.activity-icon .activity-duck { transform-origin: 50% 95%; animation-name: activity-duck; animation-duration: 6.4s; }
.activity-icon .activity-bubbles { animation-name: activity-bubbles; animation-duration: 6.4s; }
.activity-icon .activity-needle { transform-origin: 0 100%; animation-name: activity-weigh; }
.activity-icon .activity-spoon { transform-origin: 50% 100%; animation-name: activity-spoon; }
.activity-icon .activity-cradle { animation-name: activity-cradle; animation-duration: 7s; }
.activity-icon .activity-love { animation-name: activity-love; animation-duration: 7s; }
.activity-icon .activity-dream-puff { animation-name: activity-dream-puff; animation-duration: 7s; }
.activity-icon .activity-dream-puff-small { animation-delay: -1s; }
.activity-sleep .activity-body { animation-name: activity-dream; animation-duration: 7s; }
.activity-sleep .activity-face { animation: none; }
.activity-feed .activity-body, .activity-feeding-milk .activity-body { animation-name: activity-tip; }
.activity-diaper .activity-body { animation-name: activity-wiggle; }
.activity-pump .activity-body { animation-name: activity-squish; animation-duration: 4.8s; }
.activity-walk .activity-body { animation-name: activity-roll; animation-duration: 6s; }
.activity-bath .activity-body { animation-name: activity-rock; animation-duration: 6.4s; }
.activity-feeding-nursing .activity-body { animation-name: activity-rock; animation-duration: 7s; }
.activity-heart .activity-body { animation-name: activity-heartbeat; }
.activity-wet .activity-body { animation-duration: 5.2s; }
.activity-dirty .activity-body { animation-name: activity-wiggle; animation-duration: 6.8s; }
.activity-mixed .activity-body:last-child { animation-delay: -.5s; }
.activity-icon.activity-visible * { animation-play-state: running; }
.mascot-paused .activity-icon *, .modal-open #app .activity-icon * { animation-play-state: paused; }
.pick-activity > .activity-icon:first-child { padding: 5px; background: transparent; }
.sheet form.pinned-activity > header > span > .activity-icon,
.sheet .session-heading h2 > .activity-icon,
.historical-entry .focus-header > span > .activity-icon,
.session-heading h2 > .activity-icon { padding: 2px; background: transparent; }
@keyframes activity-bounce { 0%,15%,65%,100% { transform: none; } 25% { transform: scale(1.1,.88); } 35% { transform: translateY(-6px) scale(.94,1.05); } 45% { transform: scale(1.06,.94); } 55% { transform: translateY(-2px); } }
@keyframes activity-look { 0%,15%,70%,100% { transform: none; } 30%,40% { transform: translate(2px,-1px); } 50%,60% { transform: translate(-2px,0); } }
@keyframes activity-blink { 0%,42%,46%,72%,76%,100% { transform: scaleY(1); } 44%,74% { transform: scaleY(.1); } }
@keyframes activity-grin { 0%,20%,65%,100% { transform: none; } 35%,50% { transform: scale(1.08,1.2); } }
@keyframes activity-wave { 0%,15%,65%,100% { transform: none; } 25%,45% { transform: rotate(-24deg); } 35%,55% { transform: rotate(12deg); } }
@keyframes activity-slosh { 0%,15%,70%,100% { transform: none; } 30% { transform: skewY(-5deg) scaleY(.97); } 45% { transform: skewY(4deg); } 58% { transform: skewY(-2deg); } }
@keyframes activity-flap { 0%,15%,70%,100% { transform: none; } 28%,48% { transform: rotate(-16deg) scaleX(.85); } 38%,58% { transform: rotate(8deg); } }
@keyframes activity-pump { 0%,15%,45%,75%,100% { transform: none; } 28%,58% { transform: rotate(-16deg) scaleY(.8); } }
@keyframes activity-wheel { 0%,15% { transform: rotate(0); } 60%,100% { transform: rotate(180deg); } }
@keyframes activity-duck { 0%,15%,75%,100% { transform: none; } 30% { transform: translateY(-5px) rotate(-12deg); } 45% { transform: translateY(1px) rotate(8deg); } 60% { transform: translateY(-2px) rotate(-4deg); } }
@keyframes activity-bubbles { 0%,15% { transform: translateY(7px) scale(.7); opacity:0; } 30% { opacity:1; } 65%,100% { transform: translateY(-12px) scale(1.05); opacity:0; } }
@keyframes activity-weigh { 0%,15%,80%,100% { transform: rotate(-20deg); } 30% { transform: rotate(22deg); } 42% { transform: rotate(-10deg); } 54% { transform: rotate(9deg); } 66% { transform: rotate(0); } }
@keyframes activity-spoon { 0%,15%,80%,100% { transform: none; } 35%,45% { transform: translate(-7px,8px) rotate(-25deg); } 60% { transform: translate(0,-5px) rotate(8deg); } }
@keyframes activity-cradle { 0%,15%,80%,100% { transform: rotate(-3deg); } 38%,60% { transform: translateY(-2px) rotate(6deg); } }
@keyframes activity-love { 0%,15%,100% { transform: translateY(3px) scale(.85); opacity:.3; } 40%,65% { transform: translateY(-4px) scale(1.1); opacity:1; } }
@keyframes activity-dream-puff { 0%,15%,80%,100% { transform: scale(.8) rotate(-10deg); } 35% { transform: translateY(-3px) scale(1.15) rotate(15deg); } 55% { transform: scale(.95) rotate(-5deg); } }
@keyframes activity-dream { 0%,100% { transform: rotate(-4deg); } 45%,60% { transform: translateY(-3px) rotate(5deg) scale(1.02); } }
@keyframes activity-tip { 0%,15%,75%,100% { transform: none; } 30%,40% { transform: rotate(-9deg); } 52% { transform: rotate(5deg) translateY(-2px); } 65% { transform: rotate(-2deg); } }
@keyframes activity-wiggle { 0%,15%,70%,100% { transform: none; } 28% { transform: rotate(-8deg) scale(1.06,.95); } 40% { transform: rotate(8deg) translateY(-3px); } 52% { transform: rotate(-5deg); } 62% { transform: rotate(2deg); } }
@keyframes activity-squish { 0%,15%,45%,75%,100% { transform: none; } 28%,58% { transform: scale(1.05,.93); } }
@keyframes activity-roll { 0%,15%,80%,100% { transform: none; } 30% { transform: translateX(2px) rotate(-3deg); } 45% { transform: translate(3px,-2px) rotate(2deg); } 60% { transform: translateX(1px) rotate(-1deg); } }
@keyframes activity-rock { 0%,15%,80%,100% { transform: none; } 35% { transform: rotate(-4deg); } 60% { transform: rotate(4deg); } }
@keyframes activity-heartbeat { 0%,15%,70%,100% { transform: none; } 28%,48% { transform: scale(1.12,1.06) translateY(-2px); } 38%,58% { transform: scale(.97); } }
@media (prefers-reduced-motion: reduce) { .activity-icon * { animation: none !important; } }

/* Keep the original 26px layout footprint while drawing larger artwork. */
.moment-capsule > .activity-icon:first-child { width: 34px; height: 34px; margin: -4px; }
.feeding-mode-icon > .activity-icon { width: 42px; height: 42px; }
.diaper-choice .activity-icon { width: 48px; height: 48px; }

/* Small glyph slots need explicit illustration sizes; retain the journal's approved scale. */
.quick-circle > .activity-icon { width: 54px; height: 54px; }
.pick-activity > .activity-icon:first-child { width: 72px; height: 72px; padding: 0; }
.day-summary .activity-icon { width: 24px; height: 24px; }
.chart-category .activity-icon { width: 34px; height: 34px; }
.sheet form.pinned-activity > header > span > .activity-icon,
.sheet .session-heading h2 > .activity-icon,
.session-heading h2 > .activity-icon { width: 44px; height: 44px; flex-basis: 44px; padding: 0; }

/* Offscreen characters have no animation objects; background confetti only drifts. */
.activity-icon:not(.activity-visible) *,
.feeding-decoration .activity-icon * { animation: none; }

/* Tablet and desktop keep logging options beside the journal. */
.wide-activity-heading, .wide-activity, .wide-past-activity { display: none; }
@media (min-width: 768px) {
  .journal {
    max-width: 1040px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    align-items: start;
    gap: 32px;
  }
  .journal-spine { grid-column: 1; grid-row: 1; min-width: 0; }
  .journal-spine > .add-moment { display: none; }
  .quick-orbit {
    grid-column: 2;
    grid-row: 1;
    position: sticky;
    top: calc(24px + var(--safe-top));
    max-height: calc(100dvh - 136px - var(--safe-top) - var(--safe-bottom));
    overflow-y: auto;
    overscroll-behavior-y: contain;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-items: center;
    gap: 24px 16px;
    width: 100%;
    max-width: none;
    margin: 24px 0 0;
    padding: 20px 16px;
    border: 1px solid var(--border);
    border-radius: 28px;
    background: var(--surface);
  }
  .wide-activity-heading {
    display: block;
    grid-column: 1 / -1;
    margin: 0;
    font-size: 20px;
    font-weight: 600;
  }
  .wide-activity {
    display: flex;
    color: var(--moment-color);
    background: color-mix(in srgb, var(--moment-color) 24%, var(--surface));
  }
  .wide-past-activity { display: flex; grid-column: 1 / -1; gap: 8px; }
}

/* Native scrolling keeps the entire history reachable by touch, trackpad and keyboard. */
.charts-page, .growth-card { min-width: 0; }
.charts-page .day-bars { display: grid; grid-template-rows: 40px 208px; overflow-x: auto; overflow-y: hidden; gap: 8px 4px; padding: 4px 4px 12px; height: 272px; }
.charts-page .day-bars > button { grid-row: 2; min-width: 56px; }
.charts-page .day-bars time { font-size: 16px; white-space: nowrap; }
.history-heading { grid-row: 1; min-width: 0; border-left: 1px solid var(--border); color: var(--muted); text-align: left; }
.history-heading > span { position: sticky; left: 0; display: block; width: max-content; max-width: 100%; padding: 0 6px; font-size: 16px; line-height: 20px; }
.history-heading > span > span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.charts-page .bar-space i { transition: none; }
.charts-page .routine-scroll { overflow-x: auto; }
.charts-page .routine-columns { display: flex; width: max-content; min-width: 100%; }
.charts-page .routine-column { flex: 1 0 56px; }
.history-caption { text-align: center; color: var(--muted); font-size: 16px; margin: 12px 0; }

.wake-up-dialog { z-index: 10; }
.sheet .wake-up-dialog .sheet-inner { display: flex; flex-direction: column; gap: 16px; padding: 24px 24px calc(24px + var(--safe-bottom)); overflow-y: auto; }
.wake-up-dialog h2, .wake-up-dialog p { margin: 0; }
.wake-time { display: grid; grid-template-columns: minmax(0, 1fr); width: 100%; }
.wake-time input { appearance: none; -webkit-appearance: none; inline-size: 100%; min-inline-size: 0; max-inline-size: 100%; }
.wake-error:empty { display: none; }

.bottle-reference { margin-top: 12px; display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border-radius: 16px; background: var(--soft); font-size: 16px; line-height: 1.5; text-align: left; }
.bottle-reference-icon { display: flex; flex: none; }
.bottle-reference strong { font-weight: 600; }
.bottle-reference p { margin: 0; }

/* Notes use a subtle tonal footer, inset 3px from the card edges. */
.moment-capsule:has(> .moment-note) { flex-wrap: wrap; padding-bottom: 3px; }
.moment-capsule > .moment-note, .active-activity > .moment-note {
  min-width: 0;
  padding: 10px 12px;
  border-radius: 21px;
  background: rgb(0 0 0 / 7%);
  color: var(--text);
}
:root[data-theme=dark] .moment-capsule > .moment-note, :root[data-theme=dark] .active-activity > .moment-note { background: rgb(255 255 255 / 8%); }
.moment-capsule > .moment-note { flex-basis: calc(100% + 24px); margin: 0 -12px; }
.active-activity > .moment-note { margin: 12px -14px -14px; }
@media(max-width:380px) {
  .active-activity > .moment-note { margin: 12px -10px -10px; }
}

/* Feeding notes stay in the form, just like historical entry notes. */
.inline-note { display: flex; flex-direction: column; gap: 8px; }
.inline-note textarea { min-height: 44px; height: 44px; }
.focus-entry:not(.historical-entry) .feeding-note { margin: 0 var(--card-padding) 16px; }
