:root {
  color-scheme: light dark;
  --ink: #24302c;
  --ink-soft: #4d5b56;
  --muted: #68746f;
  --primary: #476f5f;
  --primary-dark: #315446;
  --primary-soft: #e4ede8;
  --on-primary: #ffffff;
  --sage: #91ad9f;
  --sage-soft: #edf2ee;
  --clay: #bd7458;
  --clay-soft: #f5e8e1;
  --ochre: #c9953f;
  --ochre-soft: #f6edda;
  --diaper-poop: #8a642a;
  --diaper-poop-soft: var(--ochre-soft);
  --blue: #78989d;
  --blue-soft: #e7eff0;
  --feed-breast: #4f806c;
  --feed-breast-soft: #e2eee8;
  --feed-formula: #ae7529;
  --feed-formula-soft: #f6ead6;
  --avatar-fill: #9bb6a7;
  --avatar-line: #365648;
  --avatar-bg: #edf1ed;
  --danger: #a94747;
  --danger-soft: #f8e8e6;
  --danger-action: #9f3f3f;
  --on-danger: #ffffff;
  --success: #287348;
  --success-soft: #e4f3e9;
  --success-line: #9bc9ac;
  --paper: #fbfaf7;
  --surface: #ffffff;
  --surface-soft: #f2f4f1;
  --canvas: #f2f0ea;
  --line: #d9ded8;
  --line-strong: #c7cfc8;
  --shadow-sm: 0 1px 2px rgba(37, 49, 44, .05), 0 8px 24px rgba(37, 49, 44, .06);
  --shadow-md: 0 2px 5px rgba(37, 49, 44, .05), 0 22px 56px rgba(37, 49, 44, .08);
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --motion-fast: 120ms;
  --motion-base: 220ms;
  --motion-slow: 380ms;
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-spring: cubic-bezier(.34, 1.4, .64, 1);
  font-family: "Avenir Next", Inter, "SF Pro Text", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 8% 0, rgba(145, 173, 159, .13), transparent 28rem),
    var(--canvas);
  color: var(--ink);
}
button, input, select { font: inherit; }
button { touch-action: manipulation; -webkit-tap-highlight-color: transparent; cursor: pointer; }
button {
  transition: transform var(--motion-fast) ease, background-color var(--motion-base) ease, border-color var(--motion-base) ease, color var(--motion-base) ease, opacity var(--motion-base) ease;
}
button:active { transform: scale(.975); }
button:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; }
button:disabled { cursor: not-allowed; opacity: .42; transform: none; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3, strong { text-wrap: balance; }
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 1.25em; height: 1.25em; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

/* Authentication */
.auth-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: max(24px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
  background:
    radial-gradient(circle at 50% 18%, rgba(145, 173, 159, .18), transparent 12rem),
    var(--canvas);
}
.auth-card {
  width: min(100%, 420px);
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}
.auth-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 34px; }
.logo {
  width: 56px;
  height: 56px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.8);
  border-radius: 17px;
  background: var(--primary-dark);
  box-shadow: var(--shadow-sm);
}
.logo img { display: block; width: 100%; height: 100%; }
.language-toggle {
  min-width: 48px;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
}
.language-toggle:hover { border-color: var(--line-strong); background: var(--surface-soft); }
.auth-card h1 { margin-bottom: 10px; font-size: clamp(27px, 8vw, 35px); font-weight: 650; letter-spacing: -.035em; }
label { display: block; margin-top: 22px; color: var(--ink-soft); font-size: 13px; font-weight: 650; }
input {
  width: 100%;
  min-height: 48px;
  margin-top: 8px;
  padding: 13px 14px;
  border: 2px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  outline: none;
}
input:focus { border-color: var(--primary); box-shadow: none; }
input:focus-visible { outline: 2px solid var(--primary); outline-offset: 0; }
input[aria-invalid="true"] { border-color: var(--danger); }
.error { min-height: 22px; margin: 12px 0 0; color: var(--danger); font-size: 13px; font-weight: 650; }
.primary {
  border: 0;
  border-radius: 14px;
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 700;
}
.primary:hover { background: var(--primary-dark); }
.primary:active { background: color-mix(in srgb, var(--primary-dark) 88%, black); }
.full { width: 100%; min-height: 52px; padding: 14px 18px; }
.async-button { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 9px; }
.button-spinner {
  display: none;
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  border: 2px solid rgba(255,255,255,.38);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: button-spin 720ms linear infinite;
}
.async-button.is-loading .button-spinner { display: inline-block; }
.async-button.is-loading:disabled, .async-button.is-success:disabled { cursor: wait; opacity: 1; }
.async-button.is-success { background: var(--primary-dark); }

/* App shell */
.app-shell {
  position: relative;
  isolation: isolate;
  width: min(100%, 1120px);
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 14px calc(46px + env(safe-area-inset-bottom));
}
.world-decor { display: none; }
.app-shell:not([hidden]) > :not(.world-decor) { animation: content-rise var(--motion-slow) var(--ease-out) both; }
.app-shell:not([hidden]) > :nth-child(3) { animation-delay: 40ms; }
.app-shell:not([hidden]) > :nth-child(4) { animation-delay: 80ms; }
.app-shell:not([hidden]) > :nth-child(5) { animation-delay: 120ms; }
/* Overview */
.hero-stage {
  position: relative;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.hero-stage::after, .stage-cloud { display: none; }
.today-insights { margin-top: 14px; }
.day-card {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
  color: var(--ink);
}
.day-arrow, .date-button { border: 0; background: transparent; color: inherit; }
.day-arrow { min-height: 50px; color: var(--muted); font-size: 25px; }
.day-arrow:hover { color: var(--primary-dark); }
.date-button { min-height: 50px; padding: 6px; }
.date-button strong, .date-button span { display: block; }
.date-button strong { font-size: 15px; font-weight: 700; }
.date-button span { margin-top: 2px; color: var(--muted); font-size: 11px; }
.day-arrow:disabled { opacity: .28; }
.day-card.is-loading { border-color: color-mix(in srgb, var(--primary) 28%, var(--line)); }
.day-card[aria-busy="true"] .date-button:disabled { cursor: wait; opacity: 1; }
.date-button .date-loading-status { min-height: 16px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; color: var(--primary-dark); font-size: 11px; font-weight: 700; }
.date-button .date-loading-status > span { display: inline; margin: 0; color: inherit; font: inherit; }
.date-loading-status > i { width: 11px; height: 11px; flex: 0 0 auto; border: 1.5px solid color-mix(in srgb, var(--primary) 28%, transparent); border-top-color: var(--primary); border-radius: 50%; animation: button-spin 720ms linear infinite; }
#date-input { position: absolute; left: 50%; bottom: 0; width: 1px; height: 1px; min-height: 1px; margin: 0; padding: 0; opacity: 0; pointer-events: none; }
.hero-row { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(110px, 2fr) minmax(0, 3fr); align-items: stretch; gap: 10px; min-height: 160px; }
.recommendation-visual { min-width: 0; display: flex; align-self: stretch; }
.recommendation-visual.is-celebrating .milk-capacity-compact { animation: capacity-cue 560ms var(--ease-spring); }
.recommendation-card {
  min-width: 0;
  overflow-wrap: anywhere;
  position: relative;
  padding: 17px;
  border: 1px solid #e6ddcf;
  border-radius: 16px;
  background: #f8f3ea;
  color: var(--ink);
}
.recommendation-card::before { display: none; }
.recommendation-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--ink-soft); font-size: 11px; font-weight: 700; }
.recommendation-values { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; margin: 10px 0 6px; }
.recommendation-values strong { white-space: nowrap; font-size: clamp(21px, 6vw, 28px); font-weight: 650; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
#recommendation-basis { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.55; white-space: pre-line; }

/* Summary and growth */
.summary-grid { position: relative; z-index: 2; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; margin-top: 8px; }
.summary-grid article {
  min-width: 0;
  padding: 11px 5px 10px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--paper);
  color: var(--ink);
  text-align: center;
}
.summary-grid .icon { display: block; width: 19px; height: 19px; margin: 0 auto 5px; }
.stat-weight .icon { color: var(--clay); }
.stat-feed .icon { color: var(--ochre); }
.stat-pee .icon { color: var(--blue); }
.stat-poop .icon { color: var(--diaper-poop); }
.summary-grid span { display: block; margin-bottom: 2px; color: var(--muted); font-size: 10px; font-weight: 650; white-space: nowrap; }
.summary-grid strong { display: block; overflow: hidden; font-size: clamp(16px, 5vw, 21px); font-weight: 650; font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }
.summary-grid small { color: var(--muted); font-size: 9px; font-weight: 550; }
.profile-card { position: relative; z-index: 2; margin-top: 8px; padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: var(--sage-soft); }
.baby-profile-card { overflow: hidden; background: linear-gradient(145deg, color-mix(in srgb, var(--sage-soft) 88%, var(--surface)), var(--surface)); }
.baby-profile-card::before { content: ""; position: absolute; z-index: -1; top: -96px; right: -82px; width: 210px; height: 210px; border-radius: 50%; background: color-mix(in srgb, var(--ochre-soft) 58%, transparent); pointer-events: none; }
.baby-profile-spotlight { min-width: 0; display: grid; grid-template-columns: 88px minmax(0, 1fr); align-items: center; gap: 18px; padding: 4px 2px 18px; }
.baby-profile-avatar { position: relative; width: 88px; height: 88px; display: grid; place-items: center; padding: 0; border: 2px solid color-mix(in srgb, var(--surface) 86%, var(--line)); border-radius: 50%; background: var(--avatar-bg); color: var(--avatar-line); box-shadow: var(--shadow-sm); }
.baby-profile-avatar:hover { border-color: color-mix(in srgb, var(--primary) 48%, var(--surface)); background: color-mix(in srgb, var(--avatar-bg) 90%, var(--primary-soft)); }
.baby-profile-avatar[aria-expanded="true"] { border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary-soft) 84%, transparent); }
.baby-avatar-icon { position: relative; z-index: 1; width: 68px; height: 68px; stroke-width: 1.7; }
.avatar-shape { fill: var(--avatar-fill); stroke: var(--avatar-line); }
.avatar-secondary { fill: var(--avatar-bg); stroke: var(--avatar-line); }
.avatar-detail-fill { fill: var(--avatar-line); stroke: none; }
.avatar-detail-line { fill: none; stroke: var(--avatar-line); stroke-width: 1.8; }
.avatar-edit-indicator { position: absolute; z-index: 2; right: -1px; bottom: 2px; width: 25px; height: 25px; display: grid; place-items: center; border: 2px solid var(--avatar-bg); border-radius: 50%; background: var(--primary); color: var(--on-primary); box-shadow: var(--shadow-sm); }
.avatar-edit-indicator .icon { width: 12px; height: 12px; stroke-width: 2; }
.avatar-picker { margin: -4px 0 16px; padding: 12px; border: 1px solid color-mix(in srgb, var(--line) 76%, transparent); border-radius: 16px; background: color-mix(in srgb, var(--surface) 88%, transparent); box-shadow: var(--shadow-sm); }
.avatar-picker-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.avatar-picker-heading strong { color: var(--ink-soft); font-size: 12px; font-weight: 750; }
.avatar-picker-close { min-width: 48px; min-height: 44px; padding: 0 10px; border: 0; border-radius: 10px; background: transparent; color: var(--primary-dark); font-size: 12px; font-weight: 750; }
.avatar-picker-close:hover { background: var(--primary-soft); }
.avatar-options { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 7px; }
.avatar-option { position: relative; min-width: 0; min-height: 68px; display: grid; grid-template-rows: 43px auto; place-items: center; gap: 2px; padding: 5px 2px 4px; border: 1px solid transparent; border-radius: 13px; background: transparent; color: var(--avatar-line); }
.avatar-option:hover { background: var(--avatar-bg); }
.avatar-option[aria-pressed="true"] { border-color: var(--primary); background: var(--avatar-bg); box-shadow: inset 0 0 0 1px var(--primary); }
.avatar-option[aria-pressed="true"]::after { content: ""; position: absolute; top: 5px; right: 5px; width: 7px; height: 7px; border: 2px solid var(--surface); border-radius: 50%; background: var(--primary); }
.avatar-option .icon { width: 43px; height: 43px; stroke-width: 1.7; }
.avatar-option span { max-width: 100%; overflow: hidden; color: var(--muted); font-size: 9px; font-weight: 700; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.avatar-option[aria-pressed="true"] span { color: var(--primary-dark); }
.baby-profile-intro { min-width: 0; }
.baby-profile-intro h1 { max-width: 13ch; margin: 0; overflow-wrap: anywhere; color: var(--ink); font-size: clamp(34px, 11vw, 52px); font-weight: 750; letter-spacing: -.055em; line-height: 1.02; text-wrap: balance; }
.baby-profile-intro h1:focus { outline: none; }
.baby-name-display { display: flex; align-items: center; gap: 4px; min-width: 0; }
.inline-edit-button { width: 44px; height: 44px; flex: 0 0 44px; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--muted); opacity: .62; }
.inline-edit-button .icon { width: 17px; height: 17px; }
.inline-edit-button:hover { background: var(--primary-soft); color: var(--primary-dark); opacity: 1; }
.inline-edit-button:focus-visible { outline: 3px solid var(--primary); outline-offset: 1px; opacity: 1; }
.inline-edit-button:disabled { opacity: .3; }
.baby-primary-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.baby-primary-fact { min-width: 0; min-height: 94px; display: flex; flex-direction: column; justify-content: space-between; gap: 12px; padding: 14px; border: 1px solid color-mix(in srgb, var(--line) 76%, transparent); border-radius: 15px; background: color-mix(in srgb, var(--surface) 86%, transparent); box-shadow: var(--shadow-sm); }
.baby-primary-fact > span { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11px; font-weight: 700; }
.baby-primary-fact > span .icon { width: 16px; height: 16px; color: var(--primary); }
.baby-primary-fact strong { overflow-wrap: anywhere; color: var(--ink); font-size: clamp(17px, 5vw, 22px); font-weight: 750; line-height: 1.22; font-variant-numeric: tabular-nums; }
.fact-value-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.fact-value-row strong { min-width: 0; }
.baby-birthday-fact { grid-column: 1 / -1; min-height: 82px; }
.baby-age-fact { background: color-mix(in srgb, var(--ochre-soft) 46%, var(--surface)); }
.baby-age-fact strong { color: var(--primary-dark); }
.inline-edit-form { min-width: 0; }
.baby-name-form { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 7px; }
.baby-name-form input,
.birth-date-form > input { min-width: 0; min-height: 46px; margin: 0; padding: 8px 11px; border: 2px solid var(--line); border-radius: 11px; background: var(--surface); color: var(--ink); font-size: 16px; font-weight: 650; }
.baby-name-form input:focus,
.birth-date-form > input:focus { border-color: var(--primary); }
.birth-date-form { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 7px; }
.profile-cancel { min-width: 52px; min-height: 44px; padding: 0 11px; border-radius: 10px; font-size: 12px; font-weight: 700; }
.profile-cancel { border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft); }
.profile-cancel:hover { border-color: var(--line-strong); background: var(--surface-soft); }
.profile-save { min-width: 52px; min-height: 44px; padding: 0 12px; border: 1px solid var(--primary); border-radius: 11px; background: var(--primary); color: var(--on-primary); font-size: 12px; font-weight: 700; white-space: nowrap; }
.profile-save:hover { background: var(--primary-dark); }
.health-error { min-height: 0; margin: 7px 0 0; color: var(--danger); font-size: 11px; font-weight: 650; }
.baby-primary-fact > .health-error:empty { display: none; }
.baby-birth-context-fact.is-editing { grid-column: 1 / -1; }
.baby-sex-fact { background: color-mix(in srgb, var(--sage-soft) 38%, var(--surface)); }
.birth-context-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.birth-context-form > label { display: grid; gap: 5px; color: var(--muted); font-size: 11px; font-weight: 700; }
#gestational-age-days { min-width: 0; min-height: 44px; margin: 0; padding: 8px 10px; border: 2px solid var(--line); border-radius: 11px; background: var(--surface); color: var(--ink); font: inherit; font-size: 16px; }
#gestational-age-days:focus { border-color: var(--primary); outline: none; }
.birth-context-sex-field { min-width: 0; margin: 0; padding: 0; border: 0; }
.birth-context-sex-field legend { margin: 0 0 5px; padding: 0; color: var(--muted); font-size: 11px; font-weight: 700; }
.birth-sex-options { width: 100%; }
.birth-sex-option { min-width: 0; position: relative; cursor: pointer; }
.birth-sex-option input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
.birth-sex-option span { min-height: 44px; display: grid; place-items: center; border: 1px solid transparent; border-radius: 10px; color: var(--muted); font-size: 13px; font-weight: 700; }
.birth-sex-option input:checked + span { border-color: var(--line); background: var(--surface); color: var(--primary-dark); box-shadow: var(--shadow-sm); }
.birth-sex-option input:focus-visible + span { outline: 3px solid var(--primary); outline-offset: 1px; }
.birth-sex-option input:disabled + span { cursor: wait; opacity: .5; }
#gestational-age-days[aria-invalid="true"], #baby-sex[aria-invalid="true"] { border-color: var(--danger); }
.birth-context-actions { display: flex; justify-content: flex-end; gap: 7px; }
.birth-context-actions,
.birth-context-form .field-help { grid-column: 1 / -1; }
.field-help { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.health-error:not(:empty) { min-height: 16px; }
/* Settings */
.settings-panel { overflow: hidden; }
.settings-brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.settings-logo { width: 72px; height: 72px; flex: 0 0 auto; overflow: hidden; border: 1px solid rgba(255,255,255,.82); border-radius: 21px; background: var(--primary-dark); box-shadow: var(--shadow-sm); }
.settings-logo img { display: block; width: 100%; height: 100%; }
.settings-copy { min-width: 0; }
.settings-copy > span { display: block; margin-bottom: 3px; color: var(--primary); font-size: 10px; font-weight: 800; letter-spacing: .1em; }
.settings-title-row { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.settings-copy h1 { margin: 0; color: var(--ink); font-size: clamp(24px, 7vw, 30px); font-weight: 700; letter-spacing: -.04em; }
.settings-copy h1:focus { outline: none; }
.app-version { color: var(--muted); font-size: 10px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: .02em; white-space: nowrap; }
.assessment-reference { margin-top: 12px; overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: var(--surface-soft); }
.assessment-reference > summary { min-height: 58px; display: grid; grid-template-columns: 38px minmax(0, 1fr) 12px; align-items: center; gap: 10px; padding: 10px 12px; color: var(--ink); cursor: pointer; list-style: none; }
.assessment-reference > summary::-webkit-details-marker { display: none; }
.assessment-reference > summary::after { content: ""; width: 7px; height: 7px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform var(--motion-fast) ease; }
.assessment-reference[open] > summary::after { transform: rotate(225deg); }
.assessment-reference > summary:focus-visible,
.assessment-reference-section > summary:focus-visible { outline: 3px solid var(--primary); outline-offset: -3px; border-radius: 9px; }
.assessment-reference-icon { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 12px; background: var(--blue-soft); color: var(--blue); }
.assessment-reference-icon .icon { width: 19px; height: 19px; }
.assessment-reference-heading { min-width: 0; }
.assessment-reference-heading strong, .assessment-reference-heading small { display: block; }
.assessment-reference-heading strong { font-size: 13px; }
.assessment-reference-heading small { margin-top: 2px; color: var(--muted); font-size: 10px; line-height: 1.35; }
.assessment-reference-content { display: grid; gap: 7px; padding: 10px; border-top: 1px solid var(--line); }
.assessment-reference-section { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.assessment-reference-section > summary { min-height: 42px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 11px; color: var(--ink); cursor: pointer; list-style: none; }
.assessment-reference-section > summary::-webkit-details-marker { display: none; }
.assessment-reference-section > summary::after { content: ""; flex: none; width: 6px; height: 6px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(45deg); transition: transform var(--motion-fast) ease; }
.assessment-reference-section[open] > summary::after { transform: rotate(225deg); }
.assessment-reference-section > summary h2 { margin: 0; font-size: 11px; font-weight: 750; }
.assessment-reference-section-content { display: grid; gap: 7px; padding: 0 11px 11px; }
.assessment-reference-section-content p { margin: 0; }
.assessment-reference-section-content > p:not(.assessment-reference-links) { color: var(--muted); font-size: 10px; line-height: 1.55; }
.assessment-reference-links { display: flex; flex-wrap: wrap; gap: 6px; }
.assessment-reference-links a { min-height: 28px; display: inline-flex; align-items: center; padding: 4px 8px; border: 1px solid var(--line); border-radius: 999px; color: var(--primary-dark); font-size: 10px; font-weight: 750; text-decoration: none; }
.assessment-reference-links a:active { background: var(--blue-soft); }
.assessment-reference-links a:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 24%, transparent); outline-offset: 2px; }
.assessment-reference-disclaimer { margin: 3px 1px 0; padding-top: 8px; border-top: 1px solid var(--line); color: var(--muted); font-size: 9px; line-height: 1.5; }
.reminder-setting { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 11px; margin-top: 18px; padding: 13px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface-soft); }
.reminder-setting-icon { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 13px; background: var(--ochre-soft); color: #785624; }
.reminder-setting-copy { min-width: 0; }
.reminder-setting-copy strong, .reminder-setting-copy span { display: block; }
.reminder-setting-copy strong { color: var(--ink); font-size: 14px; }
.reminder-setting-copy span { margin-top: 2px; color: var(--muted); font-size: 11px; line-height: 1.35; }
.setting-switch { position: relative; width: 52px; min-width: 52px; height: 44px; padding: 0; border: 0; border-radius: 999px; background: transparent; }
.setting-switch::before { content: ""; position: absolute; inset: 6px 0; border-radius: 999px; background: var(--line-strong); transition: background-color var(--motion-base) ease; }
.setting-switch > span { position: absolute; top: 10px; left: 4px; width: 24px; height: 24px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 4px rgba(37,49,44,.22); transition: transform var(--motion-base) var(--ease-out); }
.setting-switch[aria-checked="true"]::before { background: var(--success); }
.setting-switch[aria-checked="true"] > span { transform: translateX(20px); }
.setting-switch:disabled { opacity: .58; }
.preterm-feeding-settings { display: grid; gap: 11px; margin-top: 12px; padding: 13px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface-soft); }
.preterm-feeding-settings-heading { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 11px; }
.preterm-feeding-settings-heading > span:nth-child(2) { min-width: 0; }
.preterm-feeding-settings-heading strong,
.preterm-feeding-settings-heading small { display: block; }
.preterm-feeding-settings-heading strong { color: var(--ink); font-size: 14px; }
.preterm-feeding-settings-heading small { margin-top: 2px; color: var(--muted); font-size: 11px; line-height: 1.35; }
.preterm-feeding-settings-icon { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 13px; background: var(--blue-soft); color: var(--blue); }
.preterm-feeding-settings-icon .icon { width: 21px; height: 21px; }
.preterm-feeding-settings-edit { min-width: 62px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); color: var(--primary-dark); font-size: 11px; font-weight: 750; }
.preterm-feeding-settings-edit .icon { width: 15px; height: 15px; }
.preterm-feeding-settings-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; }
.preterm-feeding-settings-summary > div { min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.preterm-feeding-settings-summary dt { color: var(--muted); font-size: 10px; font-weight: 700; }
.preterm-feeding-settings-summary dd { margin: 6px 0 0; color: var(--ink); font-size: 17px; font-weight: 750; font-variant-numeric: tabular-nums; }
.preterm-feeding-settings-summary dd small { color: var(--muted); font-size: 9px; font-weight: 650; }
.preterm-feeding-settings-summary .is-digestion-rate { grid-column: 1 / -1; }
.preterm-feeding-settings-summary dd em { display: inline-flex; margin-left: 6px; padding: 3px 7px; border-radius: 999px; background: var(--primary-soft); color: var(--primary-dark); font-size: 9px; font-style: normal; font-weight: 750; vertical-align: middle; }
.preterm-feeding-settings-form { display: grid; gap: 11px; padding-top: 11px; border-top: 1px solid var(--line); }
.preterm-feeding-settings-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.preterm-feeding-settings-fields label { min-width: 0; display: grid; gap: 5px; color: var(--muted); font-size: 10px; font-weight: 700; }
.feed-count-setting { min-width: 0; display: grid; align-content: start; gap: 5px; }
.feed-count-input-row { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; }
.feed-count-input-row > button { min-height: 44px; padding: 0 9px; border: 1px solid var(--line-strong); border-radius: 11px; background: var(--surface); color: var(--primary-dark); font-size: 10px; font-weight: 750; white-space: nowrap; }
.feed-count-input-row > button:disabled { opacity: .55; }
.feed-count-assessment { display: block; color: var(--muted); font-size: 10px; line-height: 1.4; }
.preterm-digestion-rate-field { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 8px; }
.preterm-digestion-rate-field label { min-width: 0; }
.reset-digestion-rate { min-height: 44px; margin: 0; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: 11px; background: var(--surface); color: var(--primary-dark); font-size: 11px; font-weight: 750; }
.reset-digestion-rate:disabled { color: var(--muted); opacity: .55; }
.preterm-feeding-setting-control { min-height: 44px; display: grid; grid-template-columns: minmax(44px, 1fr) auto; align-items: center; gap: 5px; padding: 0 9px; border: 1px solid var(--line-strong); border-radius: 11px; background: var(--surface); transition: border-color var(--motion-fast) ease, box-shadow var(--motion-fast) ease; }
.preterm-feeding-setting-control:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
.preterm-feeding-setting-control input { width: 100%; min-width: 0; min-height: 44px; margin: 0; padding: 4px 0; border: 0; appearance: textfield; background: transparent; color: var(--ink); font-size: 16px; font-weight: 750; font-variant-numeric: tabular-nums; text-align: right; box-shadow: none; }
.preterm-feeding-setting-control input::-webkit-inner-spin-button,
.preterm-feeding-setting-control input::-webkit-outer-spin-button { margin: 0; appearance: none; }
.preterm-feeding-setting-control input:focus,
.preterm-feeding-setting-control input:focus-visible { border: 0; outline: 0; box-shadow: none; }
.preterm-feeding-setting-control small { color: var(--muted); font-size: 9px; white-space: nowrap; }
.preterm-feeding-settings-actions { display: grid; grid-template-columns: minmax(0, .7fr) minmax(0, 1.3fr); gap: 8px; }
.preterm-feeding-settings-cancel,
.preterm-feeding-settings-save { min-height: 44px; margin: 0; border-radius: 11px; font-size: 12px; font-weight: 750; }
.preterm-feeding-settings-cancel { border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft); }
.preterm-feeding-settings-save { width: 100%; border: 0; background: var(--primary); color: var(--on-primary); }
.preterm-feeding-settings-save:active { transform: scale(.985); }
.profile-utilities { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.profile-utility,
.profile-utility.language-toggle {
  min-width: 0;
  min-height: 72px;
  display: grid;
  grid-template-rows: 22px auto;
  place-items: center;
  align-content: center;
  gap: 6px;
  padding: 9px 7px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-soft);
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
}
.profile-utility .icon { width: 20px; height: 20px; }
button.profile-utility:hover { border-color: var(--line-strong); background: var(--surface); }
.sync-status { transition: background-color var(--motion-base) ease, border-color var(--motion-base) ease, color var(--motion-base) ease, box-shadow var(--motion-base) ease; }
.sync-icon { position: relative; width: 24px; height: 22px; display: grid; place-items: center; }
.sync-icon::after { position: absolute; right: -5px; bottom: -4px; width: 15px; height: 15px; display: grid; place-items: center; border: 2px solid var(--surface); border-radius: 50%; color: white; font-size: 9px; font-weight: 900; line-height: 1; }
.sync-status.is-connecting { border-color: color-mix(in srgb, var(--blue) 48%, var(--line)); background: var(--blue-soft); color: var(--blue); }
.sync-status.is-connected { border-color: var(--success-line); background: var(--success-soft); color: var(--success); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--success-line) 42%, transparent); }
.sync-status.is-connected .sync-icon::after { content: "✓"; background: var(--success); }
.sync-status.is-unavailable { border-color: color-mix(in srgb, var(--danger) 44%, var(--line)); background: var(--danger-soft); color: var(--danger); }
.sync-status.is-unavailable .sync-icon::after { content: "!"; background: var(--danger); }
.profile-logout { border-color: color-mix(in srgb, var(--danger) 22%, var(--line)); background: var(--danger-soft); color: var(--danger); }
button.profile-logout:hover { border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); background: color-mix(in srgb, var(--danger-soft) 78%, var(--surface)); }

/* Care actions */
.panel { margin-top: 14px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-sm); }
.feed-panel, .diaper-panel { border-color: var(--line); }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 17px; }
.heading-title { display: flex; align-items: center; min-width: 0; gap: 10px; }
.heading-title h2 { margin: 0; font-size: 20px; font-weight: 650; letter-spacing: -.025em; }
.panel-icon { flex: 0 0 auto; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; }
.panel-icon .icon { width: 21px; height: 21px; }
.bottle-icon { background: var(--clay-soft); color: var(--clay); }
.diaper-icon { background: var(--sage-soft); color: var(--primary); }
.time-field { display: flex; align-items: center; gap: 7px; margin: 0; color: var(--muted); font-size: 11px; font-weight: 600; white-space: nowrap; }
.time-field input { width: auto; min-width: 112px; min-height: 44px; margin: 0; padding: 7px 9px; border-radius: 11px; color: var(--ink); font-size: 16px; font-weight: 650; }
.segmented { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-soft); }
.segmented button { min-height: 44px; border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 650; }
.segmented button.active { border-color: var(--line); background: var(--surface); color: var(--primary-dark); }
.feed-method-option { display: flex; align-items: center; justify-content: center; gap: 7px; }
.feed-method-option .icon { width: 18px; height: 18px; stroke-width: 1.9; }
.feed-method-option.is-breast-milk.active { border-color: color-mix(in srgb, var(--feed-breast) 32%, var(--line)); background: var(--feed-breast-soft); color: var(--feed-breast); }
.feed-method-option.is-formula.active { border-color: color-mix(in srgb, var(--feed-formula) 32%, var(--line)); background: var(--feed-formula-soft); color: var(--feed-formula); }
.amount-control { display: grid; grid-template-columns: 58px 1fr 58px; align-items: center; margin: 20px 0 14px; text-align: center; }
.amount-control button { width: 48px; height: 48px; margin: auto; border: 1px solid var(--line-strong); border-radius: 14px; background: var(--surface); color: var(--primary-dark); font-size: 25px; font-weight: 500; }
.amount-control button:hover { border-color: var(--primary); background: var(--primary-soft); }
.amount-orb { position: relative; display: inline-flex; align-items: baseline; justify-content: center; min-height: 66px; }
.amount-orb::before { content: ""; position: absolute; z-index: 0; top: 50%; left: 50%; width: 104px; height: 58px; border-radius: 18px; background: var(--sage-soft); transform: translate(-50%, -50%); }
.amount-orb strong, .amount-orb span { position: relative; z-index: 1; }
.amount-control strong { font-size: clamp(42px, 13vw, 53px); font-weight: 600; letter-spacing: -.06em; font-variant-numeric: tabular-nums; }
.amount-control span { margin-left: 5px; color: var(--muted); font-size: 13px; font-weight: 650; }
.amount-orb.is-updating { animation: amount-pop 240ms var(--ease-spring); }
.presets { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 7px; }
.presets button { min-width: 0; min-height: 44px; padding: 8px 2px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); color: var(--muted); font-size: 12px; font-weight: 650; }
.presets button:hover { border-color: var(--line-strong); background: var(--surface-soft); }
.presets button.active { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-dark); }
.save-button { position: relative; margin-top: 16px; min-height: 54px; overflow: hidden; font-size: 15px; letter-spacing: .01em; }
.save-button::after { display: none; }
.diaper-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.diaper-actions button { min-width: 0; min-height: 82px; display: grid; place-items: center; align-content: center; gap: 7px; padding: 9px 4px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); color: var(--ink); }
.diaper-actions button:nth-child(1) .action-icon { background: var(--blue-soft); color: var(--blue); }
.diaper-actions button:nth-child(2) .action-icon { background: var(--diaper-poop-soft); color: var(--diaper-poop); }
.diaper-actions button:hover { border-color: var(--line-strong); background: var(--surface-soft); }
.action-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; }
.action-icon .icon { width: 20px; height: 20px; }
.diaper-actions strong { max-width: 100%; overflow: hidden; font-size: 13px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.today-diaper-panel { padding: 14px 16px; }
.diaper-compact-heading { margin-bottom: 10px; }
.diaper-actions-compact { gap: 7px; }
.diaper-actions-compact button { min-height: 52px; grid-template-columns: 28px auto; place-content: center; align-items: center; gap: 7px; padding: 7px 9px; border-radius: 12px; }
.diaper-actions-compact .action-icon { width: 28px; height: 28px; border-radius: 9px; }
.diaper-actions-compact .action-icon .icon { width: 17px; height: 17px; }
.supplement-panel { padding: 14px 16px 16px; }
.supplement-heading { align-items: flex-start; margin-bottom: 12px; }
.supplement-heading .heading-title { align-items: flex-start; }
.supplement-heading h2 { margin: 0; }
.supplement-heading p { margin: 2px 0 0; color: var(--muted); font-size: 11px; font-weight: 650; line-height: 1.45; }
.supplement-icon { background: var(--success-soft); color: var(--success); }
.supplement-progress { flex: 0 0 auto; margin-top: 2px; padding: 5px 9px; border: 1px solid var(--success-line); border-radius: 999px; background: var(--success-soft); color: var(--success); font-size: 10px; font-weight: 800; font-variant-numeric: tabular-nums; }
.supplement-actions { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.supplement-action { min-width: 0; min-height: 58px; display: grid; grid-template-columns: 36px minmax(0, 1fr) 26px; align-items: center; gap: 10px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); text-align: left; transition: transform var(--motion-fast) ease, border-color var(--motion-fast) ease, background-color var(--motion-fast) ease; }
.supplement-action:hover:not(:disabled) { border-color: color-mix(in srgb, var(--success) 42%, var(--line)); background: color-mix(in srgb, var(--success-soft) 32%, var(--surface)); }
.supplement-action:active:not(:disabled) { transform: scale(.985); }
.supplement-action.is-complete { border-color: var(--success-line); background: var(--success-soft); color: var(--success); opacity: 1; }
.supplement-action.is-complete:disabled { cursor: default; }
.supplement-action-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; background: var(--primary-soft); color: var(--primary-dark); }
.supplement-action.is-complete .supplement-action-icon { background: color-mix(in srgb, var(--success) 13%, var(--surface)); color: var(--success); }
.supplement-action-icon .icon { width: 18px; height: 18px; stroke-width: 2.2; }
.supplement-action-copy { min-width: 0; display: grid; gap: 2px; }
.supplement-action-copy strong, .supplement-action-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.supplement-action-copy strong { font-size: 14px; font-weight: 760; }
.supplement-action-copy small { color: var(--muted); font-size: 11px; font-weight: 680; }
.supplement-action.is-complete .supplement-action-copy small { color: var(--success); }
.supplement-action-check { width: 26px; height: 26px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 50%; background: var(--paper); color: transparent; }
.supplement-action-check .icon { width: 15px; height: 15px; stroke-width: 2.8; }
.supplement-action.is-complete .supplement-action-check { border-color: var(--success); background: var(--success); color: var(--on-primary); }
.supplement-action.is-loading .supplement-action-check { border-color: var(--success-line); background: var(--surface); color: transparent; }
.supplement-action.is-loading .supplement-action-check::after { content: ""; width: 13px; height: 13px; border: 2px solid var(--success-line); border-top-color: var(--success); border-radius: 50%; animation: button-spin 720ms linear infinite; }
.supplement-empty { margin: 0; padding: 13px 14px; border: 1px dashed var(--line-strong); border-radius: 13px; background: var(--surface-soft); color: var(--muted); font-size: 12px; font-weight: 650; line-height: 1.5; text-align: center; }
@media (min-width: 560px) { .supplement-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.supplement-settings { margin-top: 14px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-soft); }
.supplement-settings-heading { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 10px; margin-bottom: 13px; }
.supplement-settings-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: var(--success-soft); color: var(--success); }
.supplement-settings-icon .icon { width: 19px; height: 19px; }
.supplement-settings-heading strong, .supplement-settings-heading small { display: block; }
.supplement-settings-heading strong { color: var(--ink); font-size: 14px; font-weight: 760; }
.supplement-settings-heading small { margin-top: 2px; color: var(--muted); font-size: 11px; font-weight: 650; line-height: 1.4; }
.supplement-settings-edit { min-width: 62px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); color: var(--primary-dark); font-size: 11px; font-weight: 750; }
.supplement-settings-edit .icon { width: 15px; height: 15px; }
.supplement-types-summary { min-height: 32px; padding-bottom: 0; }
.supplement-types-summary .supplement-type-chip { min-height: 32px; padding: 6px 10px; background: var(--surface); }
.supplement-settings-editor { display: grid; gap: 10px; padding-top: 11px; border-top: 1px solid var(--line); }
.supplement-settings-editor .supplement-types { padding-bottom: 0; }
.supplement-settings-cancel { min-height: 44px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); color: var(--ink-soft); font-size: 12px; font-weight: 750; }
.supplement-types { display: flex; flex-wrap: wrap; gap: 7px; padding: 0 0 10px; }
.supplement-type-chip { min-height: 48px; display: inline-flex; align-items: center; gap: 2px; max-width: 100%; padding: 2px 2px 2px 11px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-soft); color: var(--ink-soft); font-size: 12px; font-weight: 700; }
.supplement-type-chip > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.supplement-type-chip button { width: 44px; min-width: 44px; height: 44px; min-height: 44px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--muted); }
.supplement-type-chip button:hover:not(:disabled) { background: var(--danger-soft); color: var(--danger); }
.supplement-type-chip .icon { width: 14px; height: 14px; stroke-width: 2.4; }
.supplement-type-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.supplement-type-form input { min-height: 44px; margin: 0; padding: 10px 12px; font-size: 13px; }
.supplement-add-button { min-height: 44px; display: inline-flex; align-items: center; gap: 5px; padding: 10px 13px; border: 1px solid var(--primary); border-radius: 12px; background: var(--primary); color: var(--on-primary); font-size: 12px; font-weight: 750; }
.supplement-add-button:hover { background: var(--primary-dark); }
.supplement-add-button .icon { width: 15px; height: 15px; stroke-width: 2.25; }

.weight-data-details > summary::after { content: ""; width: 24px; height: 24px; display: block; flex: 0 0 auto; border-radius: 50%; background-color: var(--surface-soft); background-image: linear-gradient(45deg, transparent 48%, var(--primary-dark) 49% 58%, transparent 59%), linear-gradient(135deg, transparent 48%, var(--primary-dark) 49% 58%, transparent 59%); background-position: calc(50% - 3px) calc(50% - 1px), calc(50% + 3px) calc(50% - 1px); background-size: 7px 7px; background-repeat: no-repeat; transition: transform var(--motion-fast) ease, background-color var(--motion-fast) ease; }
.weight-data-details[open] > summary::after { transform: rotate(180deg); background-color: var(--sage-soft); }

/* Weight tracking */
.baby-weight-grid { display: grid; gap: 14px; margin-top: 14px; }
.baby-weight-grid > .panel { margin-top: 0; }
.weight-icon { background: var(--ochre-soft); color: var(--ochre); }
.weight-trend-panel { --weight-control-height: 52px; }
.weight-entry-details { margin: 12px 0 2px; border: 1px solid var(--line); border-radius: 13px; background: var(--paper); }
.weight-entry-details > summary { min-height: 48px; display: flex; align-items: center; gap: 9px; padding: 8px 12px; color: var(--primary-dark); font-size: 12px; font-weight: 750; cursor: pointer; list-style: none; }
.weight-entry-details > summary::-webkit-details-marker { display: none; }
.weight-entry-details > summary:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; border-radius: 11px; }
.weight-entry-summary-icon { width: 28px; height: 28px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; background: var(--sage-soft); color: var(--primary-dark); transition: transform var(--motion-fast) ease, background-color var(--motion-fast) ease; }
.weight-entry-summary-icon .icon { width: 15px; height: 15px; stroke-width: 2.25; }
.weight-entry-details[open] .weight-entry-summary-icon { transform: rotate(45deg); background: var(--primary-soft); }
.weight-entry-form { display: grid; grid-template-columns: repeat(2, minmax(142px, 1fr)) minmax(96px, auto); align-items: end; gap: 10px; padding: 0 12px 12px; border-top: 1px solid var(--line); }
.weight-date-field { min-width: 0; display: grid; gap: 4px; margin: 0; }
.weight-entry-form .weight-date-field,
.weight-entry-form .weight-entry-field { padding-top: 11px; }
.weight-date-field > span,
.weight-entry-field > span:first-child { display: block; padding-left: 2px; color: var(--muted); font-size: 10px; font-weight: 700; }
.weight-date-field input { width: 100%; min-width: 0; height: var(--weight-control-height); min-height: var(--weight-control-height); margin: 0; padding: 7px 9px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); color: var(--ink); font-size: 16px; font-weight: 650; }
.weight-entry-field { min-width: 0; margin: 0; }
.weight-entry-field > span:first-child { margin-bottom: 4px; }
.weight-entry-input { width: 100%; min-width: 0; height: var(--weight-control-height); display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 0 9px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); transition: border-color var(--motion-fast) ease, box-shadow var(--motion-fast) ease, background-color var(--motion-fast) ease; }
.weight-entry-input:focus-within { border-color: var(--primary); background: var(--surface); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
.weight-entry-input input { width: 100%; min-width: 0; height: 100%; min-height: 0; margin: 0; padding: 0; border: 0; appearance: textfield; background: transparent; color: var(--ink); font-size: 16px; font-weight: 650; text-align: left; box-shadow: none; }
.weight-entry-input input::-webkit-inner-spin-button,
.weight-entry-input input::-webkit-outer-spin-button { margin: 0; appearance: none; }
.weight-entry-input input:focus,
.weight-entry-input input:focus-visible { border: 0; outline: 0; box-shadow: none; }
.weight-entry-input input[aria-invalid="true"] { color: var(--danger); }
.weight-entry-input strong { min-width: 42px; min-height: 34px; display: grid; place-items: center; padding: 0 8px; border-radius: 9px; background: var(--sage-soft); color: var(--primary-dark); font-size: 12px; font-weight: 750; }
.weight-entry-error { grid-column: 1 / -1; min-height: 0; margin: 0; color: var(--danger); font-size: 11px; font-weight: 650; }
.weight-entry-error:not(:empty) { min-height: 16px; }
.weight-entry-form .weight-save-button { width: 100%; height: var(--weight-control-height); min-height: var(--weight-control-height); margin: 0; border-radius: 13px; font-size: 13px; }
.weight-trend-heading { align-items: flex-end; margin-bottom: 13px; }
.weight-trend-lookback { flex: 0 0 auto; display: grid; gap: 3px; color: var(--muted); font-size: 10px; font-weight: 700; }
.weight-trend-lookback > span:first-child { padding-left: 2px; }
.weight-trend-lookback-control { min-height: 44px; display: grid; grid-template-columns: 44px minmax(26px, auto) auto 44px; align-items: center; gap: 8px; padding: 3px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); transition: border-color var(--motion-fast) ease, box-shadow var(--motion-fast) ease; }
.weight-trend-lookback-control:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
.weight-trend-lookback-control button { width: 44px; min-width: 44px; height: 44px; min-height: 44px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 9px; background: var(--paper); color: var(--primary-dark); box-shadow: none; transition: background-color var(--motion-fast) ease, color var(--motion-fast) ease, opacity var(--motion-fast) ease; }
.weight-trend-lookback-control button:hover:not(:disabled) { background: var(--sage-soft); color: var(--primary); }
.weight-trend-lookback-control button:active:not(:disabled) { background: var(--primary-soft); }
.weight-trend-lookback-control button:disabled { cursor: not-allowed; opacity: .35; }
.weight-trend-lookback-control button .icon { width: 16px; height: 16px; stroke-width: 2.25; }
.weight-trend-lookback-control output { min-width: 26px; color: var(--ink); font-size: 16px; font-weight: 750; font-variant-numeric: tabular-nums; text-align: right; }
.weight-trend-lookback-control small { color: var(--muted); font-size: 10px; white-space: nowrap; }
.weight-trend-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.weight-trend-metrics p { min-width: 0; margin: 0; padding: 12px 13px; border: 1px solid var(--line); border-radius: 13px; background: var(--paper); }
.weight-trend-metrics span,
.weight-trend-metrics strong { display: block; }
.weight-trend-metrics span { color: var(--muted); font-size: 11px; font-weight: 700; }
.weight-trend-metrics strong { margin-top: 4px; color: var(--primary-dark); font-size: 21px; font-weight: 750; font-variant-numeric: tabular-nums; }
.weight-trend-empty { min-height: 164px; display: grid; place-items: center; align-content: center; gap: 10px; color: var(--muted); text-align: center; }
.weight-trend-empty .icon { width: 38px; height: 38px; color: var(--ochre); }
.weight-trend-empty p { max-width: 28em; margin: 0; font-size: 13px; font-weight: 650; line-height: 1.5; }
.weight-chart-figure { display: grid; grid-template-columns: 54px minmax(0, 1fr); margin-top: 15px; }
.weight-chart-y-axis { height: 184px; display: flex; flex-direction: column; justify-content: space-between; padding: 16px 7px 24px 0; color: var(--muted); font-size: 10px; font-weight: 650; font-variant-numeric: tabular-nums; text-align: right; }
.weight-chart-plot { position: relative; min-width: 0; }
.weight-chart-plot svg { width: 100%; height: auto; display: block; aspect-ratio: 15 / 8; overflow: visible; }
.weight-chart-grid { stroke: color-mix(in srgb, var(--line) 72%, transparent); stroke-width: 1; pointer-events: none; vector-effect: non-scaling-stroke; }
.weight-chart-area { fill: color-mix(in srgb, var(--primary) 12%, transparent); pointer-events: none; }
.weight-chart-line { fill: none; stroke: var(--primary); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; vector-effect: non-scaling-stroke; }
.weight-chart-point-button { cursor: pointer; outline: none; }
.weight-chart-point-target { fill: transparent; stroke: transparent; stroke-width: var(--point-hit-stroke, 10); pointer-events: all; vector-effect: non-scaling-stroke; }
.weight-chart-point { fill: var(--surface); stroke: var(--primary); stroke-width: 2; pointer-events: none; vector-effect: non-scaling-stroke; }
.weight-chart-future-area { fill: color-mix(in srgb, var(--muted) 7%, transparent); pointer-events: none; }
.weight-chart-future-divider { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; pointer-events: none; vector-effect: non-scaling-stroke; }
.weight-chart-reference-band { fill: color-mix(in srgb, var(--blue-soft) 45%, transparent); pointer-events: none; }
.weight-chart-reference-line { fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-dasharray: 5 4; pointer-events: none; vector-effect: non-scaling-stroke; }
.weight-chart-p5 { stroke: var(--blue); }
.weight-chart-p50 { stroke: var(--ink-soft); stroke-width: 2; stroke-dasharray: 2 4; }
.weight-chart-p95 { stroke: var(--ochre); }
.weight-chart-reference-legend { min-height: 30px; display: flex; align-items: center; flex-wrap: wrap; gap: 7px 12px; padding-top: 6px; color: var(--muted); font-size: 10px; font-weight: 700; }
.weight-chart-reference-legend[hidden] { display: none; }
.weight-chart-reference-legend span { display: inline-flex; align-items: center; gap: 5px; }
.weight-chart-reference-legend span[hidden] { display: none; }
.weight-chart-reference-legend i { width: 16px; height: 0; border-top: 2px dashed currentColor; }
.weight-chart-reference-legend .p5-key { color: var(--blue); }
.weight-chart-reference-legend .p50-key { color: var(--ink-soft); border-top-style: dotted; }
.weight-chart-reference-legend .p95-key { color: var(--ochre); }
.weight-chart-reference-legend [id$="reference-unavailable"] { color: var(--muted); font-weight: 500; }
.weight-chart-tooltip span { color: var(--ink-soft); font-size: 10px; }
.weight-chart-point-button:hover .weight-chart-point,
.weight-chart-point-button:focus-visible .weight-chart-point,
.weight-chart-point-button[aria-expanded="true"] .weight-chart-point { fill: var(--ochre-soft); stroke: var(--ochre); stroke-width: 3; }
.weight-chart-point-button:focus-visible .weight-chart-point-target { stroke: color-mix(in srgb, var(--primary) 24%, transparent); }
.weight-chart-tooltip { position: absolute; z-index: 2; left: clamp(62px, var(--point-x), calc(100% - 62px)); top: var(--point-y); min-width: 112px; display: grid; gap: 2px; padding: 8px 10px; border: 1px solid color-mix(in srgb, var(--primary) 28%, var(--line)); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow-sm); color: var(--muted); font-size: 10px; font-weight: 650; line-height: 1.35; text-align: center; transform: translate(-50%, calc(-100% - 8px)); pointer-events: none; }
.weight-chart-tooltip[hidden] { display: none; }
.weight-chart-tooltip strong { color: var(--primary-dark); font-size: 13px; font-variant-numeric: tabular-nums; }
.weight-chart-x-axis { display: flex; justify-content: space-between; margin-top: -2px; color: var(--muted); font-size: 10px; font-weight: 650; font-variant-numeric: tabular-nums; }
.weight-data-details { margin-top: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.weight-data-details summary { min-height: 44px; display: flex; align-items: center; gap: 12px; padding: 9px 12px; color: var(--primary-dark); font-size: 11px; font-weight: 750; cursor: pointer; list-style: none; }
.weight-data-details summary::-webkit-details-marker { display: none; }
.weight-data-details summary::after { margin-left: auto; }
.weight-data-details summary:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; border-radius: 10px; }
.weight-trend-data { display: grid; gap: 0; margin: 0; padding: 0 12px 10px; list-style: none; }
.weight-trend-data li { min-height: 52px; display: grid; grid-template-columns: minmax(0, 1fr) auto 44px; align-items: center; gap: 8px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.weight-trend-data strong { color: var(--ink); font-size: 12px; font-variant-numeric: tabular-nums; }
.weight-trend-delete-button { justify-self: end; color: color-mix(in srgb, var(--danger) 62%, var(--muted)); }
.weight-trend-delete-button:hover,
.weight-trend-delete-button:focus-visible { color: var(--danger); }
.length-icon { background: var(--blue-soft); color: var(--blue); }

/* Feed statistics */
.feed-record-panel { margin-top: 14px; }
.feed-record-heading { margin-bottom: 14px; }
.feed-stat-icon { background: var(--blue-soft); color: var(--blue); }
.feed-chart-empty { min-height: 132px; display: grid; place-items: center; align-content: center; gap: 10px; color: var(--muted); text-align: center; }
.feed-chart-empty .icon { width: 36px; height: 36px; color: var(--blue); }
.feed-chart-empty p { max-width: 25em; margin: 0; font-size: 13px; font-weight: 650; line-height: 1.5; }
.milk-capacity { min-height: 122px; display: grid; grid-template-columns: 82px minmax(0, 1fr); align-items: center; gap: 14px; padding: 12px 15px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-soft); }
.milk-capacity-visual { width: 72px; height: 98px; display: grid; place-items: center; }
.milk-capacity-visual svg { width: 64px; height: 96px; display: block; overflow: visible; }
.milk-capacity-liquid { pointer-events: none; }
.milk-capacity-liquid-back { fill: color-mix(in srgb, var(--primary) 48%, var(--surface)); opacity: .8; }
.milk-capacity-liquid-front { fill: url(#milk-capacity-liquid-gradient); }
.milk-capacity-liquid-highlight { stop-color: color-mix(in srgb, var(--primary) 63%, var(--surface)); }
.milk-capacity-liquid-depth { stop-color: color-mix(in srgb, var(--primary) 78%, var(--sage)); }
.milk-capacity-shell { fill: color-mix(in srgb, var(--surface) 88%, var(--primary-soft)); }
.milk-capacity-nipple, .milk-capacity-outline, .milk-capacity-levels { stroke: var(--primary-dark); stroke-linecap: round; stroke-linejoin: round; }
.milk-capacity-nipple { fill: var(--surface); stroke-width: 2.2; }
.milk-capacity-collar { fill: var(--surface); stroke: var(--primary-dark); stroke-width: 2.2; }
.milk-capacity-outline { fill: none; stroke-width: 2.4; }
.milk-capacity-levels { stroke: color-mix(in srgb, var(--primary-dark) 58%, transparent); stroke-width: 1.6; }
.milk-capacity-copy { min-width: 0; }
.milk-capacity-values { min-width: 0; display: flex; align-items: baseline; gap: clamp(3px, 1.4vw, 7px); margin: 5px 0 0; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.milk-capacity-values strong { color: var(--ink); font-size: clamp(22px, 7.5vw, 31px); font-weight: 740; letter-spacing: -.035em; }
.milk-capacity-values strong:first-child { color: var(--primary-dark); }
.milk-capacity-values > span { font-size: 18px; font-weight: 600; }
.milk-capacity-values small { font-size: 11px; font-weight: 700; }
.milk-capacity.is-unavailable .milk-capacity-outline { stroke-dasharray: 4 4; }
.milk-capacity.is-unavailable .milk-capacity-liquid { opacity: 0; }
.milk-capacity.is-complete .milk-capacity-liquid-back { fill: color-mix(in srgb, var(--success) 62%, var(--surface)); }
.milk-capacity.is-complete .milk-capacity-liquid-highlight { stop-color: color-mix(in srgb, var(--success) 72%, var(--surface)); }
.milk-capacity.is-complete .milk-capacity-liquid-depth { stop-color: var(--success); }
.milk-capacity-compact { width: 100%; height: 100%; min-height: 0; grid-template-columns: minmax(0, 1fr); grid-template-rows: 84px auto; justify-items: center; align-content: center; gap: 2px; padding: 7px 8px 10px; text-align: center; }
.milk-capacity-compact .milk-capacity-visual { width: 62px; height: 84px; }
.milk-capacity-compact .milk-capacity-visual svg { width: 59px; height: 84px; }
.milk-capacity-compact .milk-capacity-copy { width: 100%; display: grid; justify-items: center; align-content: center; }
.milk-capacity-compact .milk-capacity-values { justify-content: center; gap: 2px; margin: 0; }
.milk-capacity-compact .milk-capacity-values strong { font-size: clamp(16px, 4.6vw, 20px); letter-spacing: -.035em; }
.milk-capacity-compact .milk-capacity-values > span { font-size: 14px; }
.milk-capacity-compact .milk-capacity-values small { font-size: 9px; }
.milk-capacity-compact .feed-target-status { width: 100%; margin-top: 4px; overflow: hidden; font-size: 10px; line-height: 1.3; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.feed-chart-figure { margin-top: 2px; }
.feed-chart-plot { min-width: 0; }
.feed-stream { position: relative; display: grid; gap: 4px; padding-block: 2px; }
.feed-stream::before { content: ""; position: absolute; z-index: 0; top: 19px; bottom: 19px; left: 55px; width: 2px; border-radius: 999px; background: var(--line-strong); }
.feed-stream-event { position: relative; z-index: 1; min-width: 0; min-height: 44px; display: grid; grid-template-columns: 41px 24px minmax(0, 1fr) 44px; align-items: center; column-gap: 7px; }
.feed-stream-event time { color: var(--muted); font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.feed-stream-node { width: 24px; height: 24px; display: grid; place-items: center; border: 2px solid var(--surface); border-radius: 50%; background: var(--clay-soft); color: var(--clay); box-shadow: 0 0 0 1px var(--line-strong); }
.feed-stream-node .icon { width: 13px; height: 13px; stroke-width: 2; }
.feed-stream-measure { min-width: 0; display: grid; grid-template-columns: minmax(34px, 1fr) auto; align-items: center; gap: 8px; }
.feed-stream-track { height: 12px; overflow: hidden; border-radius: 999px; background: color-mix(in srgb, var(--feed-color-soft) 60%, var(--surface)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--feed-color) 22%, var(--line)); }
.feed-stream-track > i { width: calc(var(--amount-percent) * 1%); height: 100%; display: block; border-radius: inherit; background: var(--feed-color); }
.feed-stream-event.is-breast-milk { --feed-color: var(--feed-breast); --feed-color-soft: var(--feed-breast-soft); }
.feed-stream-event.is-formula { --feed-color: var(--feed-formula); --feed-color-soft: var(--feed-formula-soft); }
.feed-stream-event.is-feed .feed-stream-node { background: var(--feed-color-soft); color: var(--feed-color); }
.feed-stream-value { min-width: 48px; display: grid; justify-items: end; line-height: 1.05; }
.feed-stream-value strong { color: var(--ink); font-size: 14px; font-weight: 760; font-variant-numeric: tabular-nums; white-space: nowrap; }
.feed-stream-value strong small { color: var(--muted); font-size: 9px; font-weight: 650; }
.feed-stream-value > small { margin-top: 3px; color: var(--feed-color); font-size: 9px; font-weight: 750; white-space: nowrap; }
.feed-stream-event.is-diaper .feed-stream-node { background: var(--blue-soft); color: var(--blue); }
.feed-stream-event.is-poop .feed-stream-node { background: var(--diaper-poop-soft); color: var(--diaper-poop); }
.feed-stream-event.is-both .feed-stream-node { background: var(--sage-soft); color: var(--primary); }
.feed-stream-diaper-label { min-width: 0; color: var(--ink-soft); font-size: 12px; font-weight: 700; }
.feed-stream-event.is-supplement .feed-stream-node { background: var(--success-soft); color: var(--success); }
.feed-stream-supplement-label { min-width: 0; color: var(--success); font-size: 12px; font-weight: 750; }
.timeline-delete-button { justify-self: end; color: color-mix(in srgb, var(--danger) 58%, var(--muted)); }
.timeline-delete-button:hover,
.timeline-delete-button:focus-visible { color: var(--danger); }
.feed-target-status { margin: 5px 0 0; color: var(--muted); font-size: 12px; font-weight: 650; line-height: 1.4; }
.milk-capacity.is-complete .feed-target-status { color: var(--success); }


.record-delete-button { width: 44px; min-width: 44px; height: 44px; min-height: 44px; padding: 0; border: 0; border-radius: 12px; background: transparent; color: color-mix(in srgb, var(--danger) 78%, var(--muted)); }
.record-delete-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; transition: background-color var(--motion-fast) ease, color var(--motion-fast) ease; }
.record-delete-icon .icon { width: 17px; height: 17px; }
.record-delete-button:hover .record-delete-icon { background: var(--danger-soft); color: var(--danger); }
.record-delete-button:active .record-delete-icon { background: color-mix(in srgb, var(--danger-soft) 78%, var(--surface)); }
.record-delete-button .button-spinner { width: 16px; height: 16px; border-color: color-mix(in srgb, var(--danger) 28%, transparent); border-top-color: currentColor; }
.record-delete-button.is-loading .record-delete-icon { display: none; }
.record-delete-button:disabled { cursor: wait; opacity: .58; }

/* Destructive confirmation */
body.dialog-open { overflow: hidden; }
.confirm-dialog {
  position: fixed;
  inset: 0;
  width: min(calc(100% - 32px), 380px);
  max-width: none;
  height: max-content;
  max-height: calc(100dvh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  margin: auto;
  padding: 0;
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 28px 80px rgba(29, 39, 35, .24);
}
.confirm-dialog[open] { animation: confirm-dialog-enter var(--motion-base) var(--ease-out) both; }
.confirm-dialog::backdrop { background: rgba(24, 32, 29, .48); backdrop-filter: blur(5px); animation: confirm-backdrop-enter var(--motion-base) ease both; }
.confirm-dialog-panel { padding: 22px; text-align: center; }
.confirm-dialog-icon { width: 48px; height: 48px; display: grid; place-items: center; margin: 0 auto 14px; border-radius: 15px; background: var(--danger-soft); color: var(--danger); }
.confirm-dialog-icon .icon { width: 22px; height: 22px; stroke-width: 1.9; }
.confirm-dialog h2 { margin: 0; font-size: 21px; font-weight: 750; letter-spacing: -.025em; }
.confirm-dialog-detail { min-height: 21px; margin: 8px 0 20px; color: var(--muted); font-size: 13px; font-weight: 650; line-height: 1.6; overflow-wrap: anywhere; }
.confirm-dialog-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.confirm-dialog-actions button { min-height: 48px; padding: 12px 16px; border-radius: 13px; font-size: 14px; font-weight: 750; }
.confirm-dialog-cancel { border: 1px solid var(--line); background: var(--surface-soft); color: var(--ink-soft); }
.confirm-dialog-cancel:hover { border-color: var(--line-strong); background: var(--paper); color: var(--ink); }
.confirm-dialog-delete { border: 1px solid transparent; background: var(--danger-action); color: var(--on-danger); }
.confirm-dialog-delete:hover { background: color-mix(in srgb, var(--danger-action) 88%, #6d2626); }
.confirm-dialog-delete .button-spinner { border-color: rgba(255,255,255,.38); border-top-color: currentColor; }

/* Feedback */
.toast { position: fixed; z-index: 100; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); width: max-content; max-width: calc(100% - 28px); display: flex; align-items: center; gap: 9px; padding: 10px 11px 10px 14px; border: 1px solid rgba(255,255,255,.12); border-radius: 14px; background: #294238; color: white; box-shadow: 0 14px 34px rgba(31,49,42,.2); opacity: 0; pointer-events: none; transform: translate(-50%, 18px); transition: opacity var(--motion-base) ease, transform var(--motion-base) var(--ease-out); }
.toast.show { opacity: 1; pointer-events: auto; transform: translate(-50%, 0); }
.toast .icon { flex: 0 0 auto; color: #dfbd77; }
.toast span { min-width: 0; overflow-wrap: anywhere; font-size: 13px; font-weight: 650; }
.toast button { min-width: 44px; min-height: 44px; padding: 0 10px; border: 0; border-radius: 10px; background: rgba(255,255,255,.1); color: #f1d59a; font-size: 12px; font-weight: 700; }
.fx-layer { position: fixed; z-index: 200; inset: 0; overflow: hidden; pointer-events: none; }
.fx-particle { position: absolute; width: 7px; height: 7px; border-radius: 50%; background: var(--particle-color, var(--ochre)); opacity: 0; animation: particle-burst 620ms var(--ease-out) forwards; }

/* Milk digestion */
.milk-page { width: min(100%, 900px); margin-inline: auto; padding: clamp(18px, 4vw, 28px); overflow: hidden; }
.milk-page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 20px; }
.milk-page-header > div { min-width: 0; }
.milk-page-summary { display: grid; justify-items: start; }
.milk-page-header h1.milk-page-eyebrow { margin: 0 0 10px; }
.milk-page-status { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-soft); font-size: 13px; font-weight: 750; }
.milk-page-value { display: flex; align-items: baseline; gap: 9px; margin: 5px 0 2px; color: var(--ink); font-variant-numeric: tabular-nums; }
.milk-page-value strong { font-size: clamp(36px, 8vw, 52px); line-height: 1; letter-spacing: -.045em; }
.milk-page-value span { color: var(--muted); font-size: 15px; font-weight: 800; }
.milk-page-header p { max-width: 38rem; margin: 4px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.milk-page-header > .icon { flex: 0 0 auto; width: 46px; height: 46px; padding: 10px; border-radius: 15px; background: var(--primary-soft); color: var(--primary); }
.milk-page-eyebrow { color: var(--primary); font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.milk-digestion-card { padding: clamp(16px, 3vw, 24px); border: 1px solid var(--line); border-radius: 24px; background: var(--surface-soft); }
.milk-digestion-main { display: block; }
.digestion-history {
  --digestion-remaining: color-mix(in srgb, var(--sage) 54%, var(--surface));
  --digestion-remaining-edge: color-mix(in srgb, var(--sage) 72%, var(--line-strong));
  --digestion-negative: color-mix(in srgb, var(--danger) 88%, var(--surface));
  min-width: 0;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
}
.digestion-history-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 9px; }
.digestion-history-heading strong { color: var(--ink-soft); font-size: 13px; }
.digestion-history-lookback { min-height: 44px; display: grid; grid-template-columns: 44px minmax(24px, auto) auto 44px; align-items: center; gap: 6px; padding: 2px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-soft); }
.digestion-history-lookback button { width: 44px; min-width: 44px; height: 44px; min-height: 44px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 10px; background: var(--surface); color: var(--primary-dark); box-shadow: none; }
.digestion-history-lookback button:hover:not(:disabled) { background: var(--sage-soft); color: var(--primary); }
.digestion-history-lookback button:disabled { cursor: not-allowed; opacity: .35; }
.digestion-history-lookback button .icon { width: 15px; height: 15px; stroke-width: 2.25; }
.digestion-history-lookback output { color: var(--ink); font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; text-align: right; }
.digestion-history-lookback small { color: var(--muted); font-size: 10px; font-weight: 650; white-space: nowrap; }
.digestion-chart-frame { position: relative; min-width: 0; padding-right: 48px; }
#digestion-history-svg { display: block; width: 100%; height: clamp(150px, 24vw, 190px); overflow: visible; outline: none; touch-action: manipulation; }
#digestion-history-svg[tabindex] { cursor: pointer; }
#digestion-history-svg:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 28%, transparent); outline-offset: 3px; border-radius: 8px; }
.digestion-chart-grid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 5; vector-effect: non-scaling-stroke; }
.digestion-chart-zero { stroke: var(--ink-soft); stroke-width: 1.25; vector-effect: non-scaling-stroke; }
.digestion-history-bar { vector-effect: non-scaling-stroke; }
.digestion-history-bar.is-positive { fill: var(--digestion-remaining); opacity: .88; stroke: var(--digestion-remaining-edge); stroke-width: .5; }
.digestion-history-bar.is-negative { fill: var(--digestion-negative); opacity: .9; }
.digestion-history-bar.is-current { opacity: .95; stroke: var(--primary-dark); stroke-width: 1.25; }
.digestion-history-feed-increment { opacity: .97; pointer-events: none; stroke-width: .45; vector-effect: non-scaling-stroke; }
.digestion-history-feed-increment.is-breast-milk { fill: var(--feed-breast); stroke: color-mix(in srgb, var(--feed-breast) 72%, var(--surface)); }
.digestion-history-feed-increment.is-formula { fill: var(--feed-formula); stroke: color-mix(in srgb, var(--feed-formula) 72%, var(--surface)); }
.digestion-history-feed-marker { stroke: var(--surface); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.digestion-history-feed-marker.is-breast-milk { fill: var(--feed-breast); }
.digestion-history-feed-marker.is-formula { fill: var(--feed-formula); }
.digestion-history-diaper-marker { fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }
.digestion-history-diaper-event { cursor: pointer; outline: none; }
.digestion-history-diaper-event:focus-visible .digestion-history-diaper-hit { fill: color-mix(in srgb, var(--primary) 14%, transparent); stroke: color-mix(in srgb, var(--primary) 62%, transparent); stroke-width: 1.5; }
.digestion-history-diaper-hit { fill: transparent; pointer-events: all; }
.digestion-history-diaper-event .digestion-history-diaper-marker { pointer-events: none; transition: opacity 140ms ease, filter 140ms ease; }
.digestion-history-diaper-event:hover .digestion-history-diaper-marker,
.digestion-history-diaper-event.is-selected .digestion-history-diaper-marker { opacity: 1; filter: drop-shadow(0 0 3px color-mix(in srgb, currentColor 48%, transparent)); }
.digestion-history-diaper-marker.is-pee { color: var(--blue); opacity: .64; stroke-width: 1.7; }
.digestion-history-diaper-marker.is-poop { color: var(--diaper-poop); opacity: .98; stroke-width: 2.15; filter: drop-shadow(0 1px 1px color-mix(in srgb, var(--diaper-poop) 24%, transparent)); }
.digestion-history-diaper-marker.is-pee.is-both { opacity: .88; stroke-width: 2; }
.digestion-history-selection { fill: none; stroke: color-mix(in srgb, var(--primary) 76%, var(--ink)); stroke-width: 2.25; pointer-events: none; vector-effect: non-scaling-stroke; }
.digestion-history-tooltip { position: absolute; z-index: 3; left: clamp(72px, var(--bar-x), calc(100% - 82px)); top: clamp(92px, var(--bar-y), calc(100% - 8px)); min-width: 132px; max-width: 190px; display: grid; grid-template-columns: auto auto; align-items: baseline; gap: 3px 10px; padding: 9px 11px; border: 1px solid color-mix(in srgb, var(--primary) 28%, var(--line)); border-radius: 11px; background: var(--surface); box-shadow: var(--shadow-sm); color: var(--muted); font-size: 10px; font-weight: 650; line-height: 1.4; transform: translate(-50%, calc(-100% - 8px)); pointer-events: none; }
.digestion-history-tooltip[hidden] { display: none; }
.digestion-history-tooltip time { grid-column: 1 / -1; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.digestion-history-tooltip strong { color: var(--primary-dark); font-size: 14px; font-variant-numeric: tabular-nums; text-align: right; }
#digestion-history-tooltip-feed,
#digestion-history-tooltip-diaper { grid-column: 1 / -1; margin-top: 3px; padding-top: 5px; border-top: 1px solid var(--line); color: var(--ink-soft); }
#digestion-history-tooltip-feed { white-space: pre-line; }
#digestion-history-tooltip-diaper { color: color-mix(in srgb, var(--diaper-poop) 72%, var(--ink-soft)); }
.digestion-chart-y-axis { position: absolute; inset: 0 0 0 auto; width: 42px; color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; pointer-events: none; }
.digestion-chart-y-axis span { position: absolute; right: 0; transform: translateY(-50%); white-space: nowrap; }
#digestion-history-max { top: 5.45%; }
#digestion-history-min { top: 83.64%; }
.digestion-chart-x-axis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; margin: 4px 48px 0 0; color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.digestion-chart-x-axis span { text-align: center; }
.digestion-chart-x-axis span:first-child { text-align: left; }
.digestion-chart-x-axis span:last-child { text-align: right; }
.digestion-chart-legend { display: flex; flex-wrap: wrap; gap: 7px 14px; margin-top: 11px; color: var(--muted); font-size: 10px; }
.digestion-chart-legend > span { display: inline-flex; align-items: center; gap: 5px; }
.digestion-chart-legend i { display: inline-block; width: 5px; height: 12px; border: 1px solid var(--digestion-remaining-edge); border-radius: 2px; background: var(--digestion-remaining); }
.digestion-chart-legend i.is-breast-milk,
.digestion-chart-legend i.is-formula { width: 7px; height: 7px; border: 0; border-radius: 50%; }
.digestion-chart-legend i.is-breast-milk { background: var(--feed-breast); }
.digestion-chart-legend i.is-formula { background: var(--feed-formula); }
.digestion-chart-legend .icon { width: 10px; height: 10px; }
.digestion-chart-legend .icon.is-pee { color: var(--blue); opacity: .64; }
.digestion-chart-legend .icon.is-poop { width: 12px; height: 12px; color: var(--diaper-poop); stroke-width: 2; }
.digestion-status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px var(--success-soft); }
.digestion-metrics { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; margin: 22px 0 0; }
.digestion-metrics > div { min-width: 0; padding: 13px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); }
.digestion-metrics dt { color: var(--muted); font-size: 11px; font-weight: 650; }
.digestion-metrics dd { margin: 6px 0 0; color: var(--ink); font-size: 14px; font-weight: 750; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.digestion-latest-feed { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; }
#digestion-latest-feed-details { min-width: 0; }
#digestion-latest-feed-relative { justify-self: end; padding: 5px 8px; border-radius: 999px; background: var(--sage-soft); color: var(--primary-dark); font-size: 11px; font-weight: 700; line-height: 1.35; white-space: nowrap; }
.milk-page.is-negative .digestion-status-dot { background: var(--danger); box-shadow: 0 0 0 4px var(--danger-soft); }
.milk-page.is-unavailable .digestion-status-dot { background: var(--muted); box-shadow: 0 0 0 4px var(--surface); }
@media (max-width: 620px) {
  .digestion-history { width: 100%; }
}
@media (max-width: 759px) {
  .milk-digestion-card { padding: 0; border: 0; border-radius: 0; background: transparent; }
  .digestion-metrics { margin-top: 12px; }
}
@media (min-width: 760px) {
  .milk-page { min-height: min(700px, calc(100vh - 130px)); display: grid; align-content: center; }
}
/* Primary navigation and route visibility */
.app-shell[data-active-page="baby"] [data-route-page]:not([data-route-page="baby"]),
.app-shell[data-active-page="today"] [data-route-page]:not([data-route-page="today"]),
.app-shell[data-active-page="settings"] [data-route-page]:not([data-route-page="settings"]),
.app-shell[data-active-page="milk"] [data-route-page]:not([data-route-page="milk"]) { display: none; }
.app-shell:is([data-active-page="settings"], [data-active-page="milk"]) #baby-overview { display: none; }
.app-shell [data-route-page] { animation: route-page-enter var(--motion-base) var(--ease-out) both; }
.app-shell[data-active-page="baby"] .profile-card { margin-top: 0; }
.bottom-nav {
  position: relative;
  z-index: 20;
  width: min(100%, 420px);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
  margin: 0 auto 14px;
  padding: 6px;
  border: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  border-radius: 22px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: 0 12px 32px rgba(30, 48, 40, .12);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
}
.bottom-nav-item {
  min-width: 0;
  min-height: 54px;
  display: grid;
  grid-template-columns: auto auto;
  place-content: center;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.15;
}
.bottom-nav-item:hover { background: var(--surface-soft); color: var(--ink-soft); }
.bottom-nav-item.active { background: var(--primary); color: var(--on-primary); box-shadow: 0 6px 16px rgba(49, 84, 70, .18); }
.bottom-nav-item:active { transform: scale(.97); }
.bottom-nav-icon { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 9px; }
.bottom-nav-icon .icon { width: 21px; height: 21px; stroke-width: 1.9; }
.bottom-nav-item.active .bottom-nav-icon { background: rgba(255,255,255,.12); }

@media (max-width: 759px), (max-height: 500px) and (orientation: landscape) and (max-width: 932px) {
  html { scroll-snap-type: none; }
  body { overscroll-behavior-y: none; }
  .app-shell:not([hidden]) {
    height: 100vh;
    height: 100dvh;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: auto;
    scroll-behavior: auto;
    scroll-padding-block: max(12px, env(safe-area-inset-top)) calc(112px + env(safe-area-inset-bottom));
    scroll-snap-type: none;
    -webkit-overflow-scrolling: touch;
  }
  .app-shell { padding-bottom: calc(112px + env(safe-area-inset-bottom)); }
  .bottom-nav {
    position: fixed;
    z-index: 90;
    left: max(12px, env(safe-area-inset-left));
    right: max(12px, env(safe-area-inset-right));
    bottom: max(10px, env(safe-area-inset-bottom));
    width: auto;
    max-width: 420px;
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    box-shadow: 0 16px 42px rgba(30, 48, 40, .18);
    margin-inline: auto;
  }
  .bottom-nav-item {
    min-height: 60px;
    grid-template-rows: 28px auto;
    grid-template-columns: none;
    place-items: center;
    gap: 2px;
    padding: 7px 4px 6px;
    font-size: 11px;
  }
  .bottom-nav-item:active { transform: scale(.96); }
  .toast { bottom: calc(90px + env(safe-area-inset-bottom)); }
}

@keyframes content-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes button-spin { to { transform: rotate(360deg); } }
@keyframes capacity-cue { 0%,100% { transform: scale(1); } 45% { transform: scale(1.035); } }
@keyframes confirm-dialog-enter { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes confirm-backdrop-enter { from { opacity: 0; } to { opacity: 1; } }
@keyframes amount-pop { 0%,100% { transform: scale(1); } 50% { transform: scale(1.035); } }
@keyframes particle-burst { 0% { opacity: 0; transform: translate(0, 0) scale(.3); } 18% { opacity: .85; } 100% { opacity: 0; transform: translate(var(--particle-x), var(--particle-y)) scale(.8); } }
@keyframes route-page-enter { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

@media (min-width: 760px) {
  .app-shell { padding-inline: 24px; }
  .hero-stage { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 18px; }
  .day-card, .hero-row, .summary-grid, .profile-card { grid-column: 1 / -1; }
  .hero-row { min-height: 158px; }
  .summary-grid { gap: 10px; margin-top: 0; }
  .summary-grid article { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; padding: 12px 14px; text-align: left; }
  .summary-grid .icon { grid-row: 1 / 3; width: 25px; height: 25px; margin: 0; }
  .summary-grid span { margin: 0; font-size: 11px; }
  .summary-grid strong { font-size: 20px; }
  .baby-weight-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; }
  .settings-panel { display: grid; grid-template-columns: minmax(200px, .7fr) minmax(260px, 1fr); align-items: center; column-gap: 24px; }
  .settings-brand { grid-column: 1; grid-row: 1; align-self: end; }
  .assessment-reference { grid-column: 1; grid-row: 2 / 4; align-self: start; }
  .reminder-setting, .preterm-feeding-settings, .profile-utilities { grid-column: 2; }
  .reminder-setting { grid-row: 1; margin-top: 0; }
  .preterm-feeding-settings { grid-row: 2; }
  .profile-utilities { grid-row: 3; }
  .profile-utilities { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
}

@media (min-width: 1024px) {
  .hero-stage { padding: 20px; }
  .recommendation-card { padding: 20px; }
  .panel { padding: 22px; }
}

@media (max-width: 520px) {
  .milk-page { padding-inline: 12px; }
  .digestion-history { padding: 12px 0 0; border: 0; border-radius: 0; background: transparent; }
  .digestion-chart-frame { padding-right: 34px; }
  .digestion-chart-y-axis { width: 30px; font-size: 9px; }
  .digestion-chart-x-axis { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-right: 34px; }
  #digestion-history-quarter,
  #digestion-history-three-quarter { display: none; }
  .digestion-chart-legend { gap-inline: 12px; }
  .baby-profile-intro h1 { max-width: 11ch; }
  .baby-name-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .baby-name-form > input { grid-column: 1 / -1; }
  .baby-name-form .profile-save,
  .baby-name-form .profile-cancel { width: 100%; }
  .birth-date-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .birth-date-form > input { grid-column: 1 / -1; }
  .birth-context-form { grid-template-columns: minmax(0, 1fr); }
  html[lang="en"] .hero-row { gap: 8px; }
  html[lang="en"] .recommendation-card { padding: 14px; }
  html[lang="en"] .recommendation-heading { gap: 6px; }
  html[lang="en"] .recommendation-values { gap: 6px; margin-top: 8px; }
  html[lang="en"] .recommendation-values strong { font-size: clamp(21px, 6vw, 25px); }
  html[lang="en"] #recommendation-basis { font-size: 10.5px; line-height: 1.45; }
  .weight-entry-form { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .weight-entry-form .weight-save-button,
  .weight-entry-error { grid-column: 1 / -1; }
}

@media (max-width: 480px) {
  .preterm-feeding-settings-fields { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 374px) {
  .app-shell { padding-inline: 10px; }
  .hero-stage { padding: 10px; border-radius: 20px; }
  .hero-row, html[lang="en"] .hero-row { gap: 7px; }
  .milk-capacity-compact { grid-template-columns: minmax(0, 1fr); grid-template-rows: 76px auto; gap: 2px; padding-inline: 5px; }
  .milk-capacity-compact .milk-capacity-visual { width: 56px; height: 76px; }
  .milk-capacity-compact .milk-capacity-visual svg { width: 54px; height: 76px; }
  .milk-capacity-compact .milk-capacity-values strong { font-size: 14.5px; }
  .milk-capacity-compact .milk-capacity-values > span { font-size: 12px; }
  .milk-capacity-compact .feed-target-status { font-size: 9.5px; }
  .recommendation-card { padding: 13px; }
  .summary-grid { gap: 5px; }
  .panel { padding: 15px; }
  .milk-page { padding-inline: 10px; }
  .section-heading { align-items: flex-start; }
  .time-field { display: block; text-align: right; }
  .time-field input { display: block; margin-top: 4px; }
  .presets { gap: 4px; }
  .baby-profile-spotlight { grid-template-columns: 72px minmax(0, 1fr); gap: 13px; }
  .baby-profile-avatar { width: 72px; height: 72px; }
  .baby-avatar-icon { width: 56px; height: 56px; }
  .baby-profile-intro h1 { font-size: clamp(31px, 11vw, 40px); }
  .baby-primary-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .baby-birthday-fact { grid-column: 1 / -1; }
}

@media (max-height: 500px) and (orientation: landscape) {
  .app-shell { padding-top: 8px; }
  .hero-row { min-height: 140px; }
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f0f2ee;
    --ink-soft: #c8d0cb;
    --muted: #a4aea9;
    --primary: #9fc5b3;
    --primary-dark: #d2e7dc;
    --primary-soft: #2b4137;
    --on-primary: #183128;
    --sage: #76998a;
    --sage-soft: #26332d;
    --clay: #d8997f;
    --clay-soft: #442f28;
    --ochre: #dfb86f;
    --ochre-soft: #403621;
    --diaper-poop: #dfb86f;
    --blue: #9bb9bd;
    --blue-soft: #26383b;
    --feed-breast: #9bcbb5;
    --feed-breast-soft: #263c33;
    --feed-formula: #e6bc72;
    --feed-formula-soft: #41351f;
    --avatar-fill: #9bb6a7;
    --avatar-line: #29483b;
    --avatar-bg: #e4ebe6;
    --danger: #ef9b96;
    --danger-soft: #442827;
    --danger-action: #e18b86;
    --on-danger: #241817;
    --success: #8fd3a8;
    --success-soft: #20392a;
    --success-line: #467455;
    --paper: #1e2622;
    --surface: #222b27;
    --surface-soft: #2a342f;
    --canvas: #171d1a;
    --line: #3a4640;
    --line-strong: #4b5a52;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.12), 0 10px 28px rgba(0,0,0,.14);
    --shadow-md: 0 2px 5px rgba(0,0,0,.18), 0 24px 64px rgba(0,0,0,.2);
  }
  html { background: var(--canvas); }
  body { background: radial-gradient(circle at 8% 0, rgba(112,153,135,.12), transparent 28rem), var(--canvas); }
  input, select { color-scheme: dark; }
  .auth-card { background: var(--surface); }
  .recommendation-card { border-color: #4a4336; background: #302d26; }
  .profile-card { background: var(--sage-soft); }
  .baby-profile-card { background: linear-gradient(145deg, var(--sage-soft), var(--surface)); }
  .baby-primary-fact { background: color-mix(in srgb, var(--surface) 92%, transparent); }
  .baby-age-fact { background: color-mix(in srgb, var(--ochre-soft) 46%, var(--surface)); }
  .birth-date-form > input, .baby-name-form input { background: var(--surface); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

.weight-chart-tooltip { width: min(240px, 100%); max-width: 100%; left: clamp(min(120px, 50%), var(--point-x), max(50%, calc(100% - 120px))); overflow-wrap: anywhere; }

/* Shared record editing */
.record-actions { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
.record-edit-button { width: 44px; min-width: 44px; height: 44px; padding: 0; display: grid; place-items: center; border: 0; border-radius: 12px; background: transparent; color: var(--primary-dark); }
.record-edit-button:hover { background: var(--primary-soft); }
.record-edit-button .icon { width: 18px; height: 18px; }
.feed-stream-event { grid-template-columns: 41px 24px minmax(0, 1fr) 92px; }
.weight-trend-data li { grid-template-columns: minmax(0, 1fr) auto 92px; }
.record-edit-dialog { width: min(460px, calc(100% - 24px)); max-height: calc(100dvh - 32px); overflow-y: auto; }
.record-edit-dialog .confirm-dialog-panel { text-align: left; }
.record-edit-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; }
.record-edit-fields label { min-width: 0; display: grid; gap: 6px; color: var(--ink-soft); font-size: 14px; }
.record-edit-fields input, .record-edit-fields select { min-width: 0; width: 100%; min-height: 48px; margin: 0; padding: 10px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); color: var(--ink); font-size: 16px; }
.record-edit-fields input:focus, .record-edit-fields select:focus { outline: 2px solid var(--primary); outline-offset: 2px; }
.record-edit-fields [aria-invalid="true"] { border-color: var(--danger); }
.record-edit-error { margin: 12px 0; color: var(--danger); font-size: 14px; line-height: 1.5; }
.record-edit-error:empty { display: none; }
.record-edit-dialog .confirm-dialog-actions { margin-top: 20px; }
@media (max-width: 374px) {
  .feed-stream-measure { display: block; }
  .feed-stream-track { display: none; }
  .record-edit-fields { grid-template-columns: minmax(0, 1fr); }
}

/* Direct nursing on the left; measured bottle actions share the amount on the right. */
.feeding-entry-grid { display: grid; grid-template-columns: minmax(80px, .8fr) minmax(0, 2fr); gap: 18px; }
.feeding-direct { display: flex; flex-direction: column; min-width: 0; gap: 10px; }
.feeding-bottles { display: grid; grid-template-rows: 74px auto; gap: 12px; min-width: 0; padding-left: 18px; border-left: 1px solid var(--line); }
.feeding-bottle-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.feeding-record-action { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; min-width: 0; min-height: 78px; padding: 10px 4px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-soft); color: var(--ink); font-size: 12px; font-weight: 650; cursor: pointer; transition: background-color var(--motion-fast) ease, border-color var(--motion-fast) ease; }
.feeding-record-action .icon { width: 30px; height: 30px; stroke-width: 1.9; }
.feeding-record-action.is-nursing { flex: 1; min-height: 112px; background: var(--primary-soft); color: var(--primary); }
.feeding-record-action.is-nursing .icon { width: 44px; height: 44px; }
.feeding-record-action.is-breast-milk { background: var(--feed-breast-soft); color: var(--feed-breast); }
.feeding-record-action.is-formula { background: var(--feed-formula-soft); color: var(--feed-formula); }
.feeding-record-action:hover { border-color: currentColor; }
.feeding-record-action:active { filter: brightness(.96); }
.feeding-record-action:disabled { opacity: .55; cursor: wait; }
.feeding-record-action:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.feeding-bottles .amount-control { grid-template-columns: 44px minmax(0, 1fr) 44px; gap: 4px; margin: 0; min-height: 74px; }
.feeding-bottles .amount-control button { width: 44px; height: 44px; }
.feeding-bottles .amount-orb { min-width: 0; align-items: center; }
.feeding-bottles .amount-orb::before { width: 100%; max-width: 104px; }
.feeding-bottles .amount-control strong { font-size: clamp(30px, 7vw, 44px); letter-spacing: -.05em; }
.feeding-bottles .amount-control span { font-size: 11px; margin-left: 3px; }
.is-nursing .feed-stream-node { color: var(--primary); background: var(--primary-soft); }
.nursing-status { display: grid; justify-items: center; gap: 4px; font-variant-numeric: tabular-nums; }
.nursing-status > strong { color: var(--muted); font-size: 11px; font-weight: 600; text-align: center; }
.nursing-last-time { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 11px; }
.nursing-last-time .icon { width: 13px; height: 13px; }
@media (max-width: 380px) { .feeding-entry-grid { gap: 10px; } .feeding-bottles { padding-left: 10px; } .feeding-bottles .amount-control { gap: 0; } .feeding-bottles .amount-control strong { font-size: 28px; } }

.nursing-estimate-badge { display: inline-flex; margin-top: 5px; color: var(--muted); font-size: 11px; font-weight: 600; }
.nursing-estimate-card { position: relative; margin: 18px 0; padding: 13px 14px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); }
.nursing-estimate-heading { display: flex; align-items: center; gap: 10px; }
.nursing-estimate-icon { display: grid; place-items: center; flex: 0 0 36px; height: 36px; border-radius: 11px; background: var(--primary-soft); color: var(--primary); }
.nursing-estimate-icon .icon { width: 21px; height: 21px; }
.nursing-estimate-caption { min-width: 0; display: grid; gap: 4px; color: var(--muted); font-size: 11px; }
.nursing-estimate-caption time { font-variant-numeric: tabular-nums; }
.nursing-estimate-amount { margin-left: auto; color: var(--ink); font-size: 23px; line-height: 1.25; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nursing-intake-bar { display: flex; gap: 2px; height: 4px; margin-top: 14px; overflow: hidden; border-radius: 4px; background: var(--surface-soft); }
.nursing-intake-bar i { min-width: 0; flex-basis: 0; }
#nursing-total-measured-bar { background: var(--primary); }
#nursing-total-estimated-bar { background: repeating-linear-gradient(125deg, var(--primary) 0 2px, var(--primary-soft) 2px 5px); }
.nursing-intake-totals { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 10px; padding-right: 30px; }
.nursing-intake-totals > div { display: inline-flex; align-items: center; gap: 5px; }
.nursing-intake-totals .icon { width: 14px; height: 14px; color: var(--primary); }
.nursing-intake-totals span { font-size: 10px; color: var(--muted); }
.nursing-intake-totals strong { color: var(--ink); font-size: 12px; font-weight: 650; white-space: nowrap; }
.nursing-estimate-details > summary { position: absolute; bottom: 1px; right: 1px; width: 44px; height: 44px; display: grid; place-items: center; list-style: none; cursor: pointer; color: var(--muted); border-radius: 12px; }
.nursing-estimate-details > summary::-webkit-details-marker { display: none; }
.nursing-estimate-details > summary .icon { width: 16px; height: 16px; }
.nursing-estimate-details > summary:hover { background: var(--surface-soft); color: var(--primary); }
.nursing-estimate-details > summary:focus-visible { outline: 2px solid var(--primary); outline-offset: -3px; }
.nursing-estimate-details[open] { padding-bottom: 28px; }
.nursing-estimate-explanation { margin-top: 12px; padding-top: 8px; border-top: 1px solid var(--line); }
.nursing-estimate-basis, .nursing-estimate-note { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.digestion-history-feed-increment.is-nursing { fill: var(--primary-soft); stroke: var(--primary); stroke-width: 1; stroke-dasharray: 2 2; }
.digestion-history-feed-marker.is-nursing { fill: var(--surface); stroke: var(--primary); stroke-width: 1.5; }
.digestion-chart-legend i.is-nursing { background: var(--primary-soft); border: 1px dashed var(--primary); }
