:root {
  color-scheme: light;
  --canvas: #f6f5f1;
  --outer: #e9e8e3;
  --ink: #25302a;
  --muted: #77817b;
  --green: #358b5b;
  --green-strong: #2c704c;
  --green-soft: #e5f5eb;
  --green-pale: #f3faf6;
  --line: #e8e7e2;
  --danger: #a12727;
  --shadow: 0 8px 28px rgba(37, 48, 42, .08);
}

[x-cloak] { display: none !important; }
* { box-sizing: border-box; }
html { background: var(--outer); }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--outer);
  color: var(--ink);
  font: 16px/1.55 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overscroll-behavior: none;
}
a { color: var(--green); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 3px solid var(--green);
  outline-offset: 3px;
}

.app-frame, .content, .site-header, .app-header {
  width: min(100%, 430px);
  margin-inline: auto;
}
.app-frame {
  position: relative;
  min-height: 100dvh;
  overflow-x: hidden;
  background: var(--canvas);
  box-shadow: var(--shadow);
}
.content {
  min-height: calc(100dvh - 76px);
  padding: 24px 16px max(44px, env(safe-area-inset-bottom));
  background: var(--canvas);
}
.app-main {
  padding: 16px 16px max(96px, calc(80px + env(safe-area-inset-bottom)));
}
.today-panel .page-heading { align-items: baseline; }
.today-panel .page-heading .eyebrow { margin: 0; text-align: right; white-space: nowrap; }
.today-panel .page-heading { margin-bottom: 8px; }
.today-panel .care-totals { margin: 8px 0; }
.today-panel .stat-card { padding: 10px 11px; border-radius: 15px; }
.today-panel .latest-grid { gap: 8px; }
.today-panel .latest-record { margin: 0; }
.today-panel .record-tile { padding: 11px 12px; gap: 10px; border-radius: 15px; }
.today-panel .tile-icon { width: 36px; height: 36px; border-radius: 12px; }
.today-panel .tile-icon [data-lucide], .today-panel .tile-icon svg { width: 18px; height: 18px; }
.today-panel .category-latest .section-heading { gap: 6px; }
.today-panel .category-latest .compact { min-height: 34px; padding: 6px 10px; }

.site-header, .app-header {
  min-height: 76px;
  padding: 12px 16px;
  border-bottom: 1px solid color-mix(in srgb, var(--line), transparent 15%);
  background: color-mix(in srgb, var(--canvas), transparent 5%);
}
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.app-header {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  top: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  backdrop-filter: blur(12px);
}
.brand {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: var(--ink);
  font-size: 29px;
  font-weight: 900;
  letter-spacing: -1.7px;
  line-height: 1;
  text-decoration: none;
}
.brand span { color: #43a66e; }

nav { display: flex; flex-wrap: wrap; gap: 12px; }
nav a { display: inline-flex; align-items: center; min-height: 44px; }
h1 {
  margin: 0 0 16px;
  font-size: clamp(26px, 7vw, 34px);
  line-height: 1.12;
  letter-spacing: -.7px;
  font-weight: 900;
}
h2 { margin: 20px 0 10px; font-size: 19px; line-height: 1.3; }
h3 { margin: 0; font-size: 15px; line-height: 1.35; }
p { color: var(--muted); }
.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}
.hero { padding: 36px 0; }
.intro { margin: 24px 0; }

button, .button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 14px;
  padding: 12px 18px;
  background: var(--ink);
  color: white;
  font: inherit;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
}
button:disabled { cursor: not-allowed; opacity: .55; }
.secondary {
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
}
.compact { min-height: 38px; padding: 8px 12px; font-size: 13px; }
.full-width { width: 100%; }
.text-button, .text-action {
  min-height: 40px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
}

form { margin: 20px 0; }
label { display: block; margin-top: 12px; font-weight: 700; }
input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), select, textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 11px 12px;
  background: white;
  color: var(--ink);
  font: inherit;
}
input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--green); }
form button { margin-top: 16px; }
.helptext, .muted { color: var(--muted); font-size: 13px; }
.errorlist, .error-message { color: var(--danger); }
/* Shared feedback floats above navigation and modal sheets. */
.toast-stack {
  position: fixed;
  inset: auto 12px calc(110px + env(safe-area-inset-bottom));
  width: auto;
  max-width: 480px;
  margin: 0 auto;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
  z-index: 1000;
  pointer-events: none;
}
.toast-stack:empty { display: none; }
.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  padding: 10px 12px 10px 16px;
  border-radius: 16px;
  background: var(--ink);
  color: white;
  box-shadow: 0 6px 24px #0003;
  font-size: 14px;
  pointer-events: auto;
}
.toast > span { flex: 1; overflow-wrap: anywhere; }
.toast-error { background: var(--danger); }
.toast .toast-close {
  flex: 0 0 44px;
  width: 44px;
  min-height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 24px;
}
.skip-link {
  position: absolute;
  top: -100px;
  left: 12px;
  z-index: 60;
  padding: 10px;
  background: white;
}
.skip-link:focus { top: 8px; }

.surface {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  background: white;
}
.state-card { margin-top: 16px; }
.notice {
  margin: 12px 0;
  border-left: 3px solid #b6cdbd;
  padding-left: 12px;
  color: var(--muted);
  font-size: 14px;
}

.plan-status {
  justify-self: center;
  max-width: 100%;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  border: 1px solid #cce9d7;
  border-radius: 999px;
  padding: 6px 10px;
  background: var(--green-soft);
  color: var(--green-strong);
  font-size: 11px;
  font-weight: 850;
  text-decoration: none;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.plan-status::before {
  content: "";
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #43a66e;
}
.child-switcher { min-width: 0; position: relative; }
.child-switcher summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 5px 8px;
  background: white;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
  list-style: none;
}
.child-switcher summary::-webkit-details-marker { display: none; }
.selected-name {
  max-width: 86px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.icon, [data-lucide], button svg, .bottom-nav svg, .icon-button svg {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.avatar {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green-strong);
  font-size: 15px;
  font-weight: 850;
}
.avatar.small { width: 29px; height: 29px; font-size: 10px; }
.avatar.large { width: 58px; height: 58px; font-size: 21px; }
.switcher-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(390px, calc(100vw - 24px));
  max-height: calc(100dvh - 100px);
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  background: white;
  box-shadow: 0 14px 32px rgba(37, 48, 42, .12);
}
.switcher-panel h2 { margin-top: 0; }
.switcher-panel form { margin: 0; }
.switcher-option {
  width: 100%;
  justify-content: flex-start;
  gap: 10px;
  margin: 0;
  border-radius: 12px;
  padding: 12px 8px;
  background: white;
  color: var(--ink);
  text-align: left;
}
.switcher-option:hover, .switcher-option[aria-current] { background: var(--green-pale); }
.child-label { min-width: 0; flex: 1; overflow-wrap: anywhere; }
.child-label strong, .child-label span { display: block; }
.child-label span, .child-label p { color: var(--muted); font-size: 12px; font-weight: 400; }
.child-label h2, .child-label p { margin: 0; }
.switcher-actions {
  display: grid;
  gap: 0;
  margin-top: 8px;
  border-top: 1px solid var(--line);
}
.switcher-actions a { padding: 8px 4px; }

.sync-strip {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  margin: -2px 0 14px;
  border: 1px solid #cce9d7;
  border-radius: 999px;
  padding: 6px 8px 6px 10px;
  background: var(--green-soft);
  color: var(--green-strong);
  font-size: 11px;
  font-weight: 800;
}
.sync-strip .text-button {
  margin-left: auto;
  min-height: 24px;
  color: var(--green-strong);
  font-size: 11px;
}
.status-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #43a66e;
}
.status-dot.is-syncing { background: #d88c25; }
.status-dot.is-blocked { background: var(--danger); }
.page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  min-width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  color: var(--ink);
}
.care-totals {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0;
}
.stat-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 11px;
  background: white;
}
.stat-card strong { display: block; margin-top: 7px; font-size: 23px; line-height: 1; font-weight: 900; }
.stat-card span:last-child { color: var(--muted); font-size: 11px; }
.stat-icon, .tile-icon {
  display: inline-grid;
  place-items: center;
  border-radius: 13px;
  background: var(--green-soft);
  color: var(--green-strong);
}
.stat-icon { width: 32px; height: 32px; }
.tile-icon { width: 42px; height: 42px; flex: 0 0 auto; }
.stat-icon [data-lucide], .stat-icon svg { width: 17px; height: 17px; }
.tile-icon [data-lucide], .tile-icon svg { width: 21px; height: 21px; }
.diaper-icon { background: #ecfdf5; color: #059669; }
.wet-icon { background: #eff6ff; color: #2563eb; }
.dirty-icon { background: #fff7ed; color: #ea580c; }
.feed-icon { background: #fff7ed; color: #ea580c; }
.sleep-icon { background: #f5f3ff; color: #7c3aed; }
.primary-action {
  width: 100%;
  min-height: 52px;
  margin: 4px 0 18px;
  border-radius: 16px;
  font-weight: 850;
}
.primary-action span, .nav-add span:first-child {
  display: inline-grid;
  place-items: center;
  font-size: 24px;
  line-height: 1;
}
.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.section-heading h2 { margin: 0; }
.record-tile {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 13px;
  background: white;
}
.record-tile p { margin: 3px 0 0; font-size: 12px; }
.latest-record { margin: 8px 0 20px; }
.care-records { display: grid; gap: 8px; margin-top: 10px; }
.care-record h3 { margin: 0; }
.tile-time {
  width: 48px;
  padding-top: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.record-body { min-width: 0; flex: 1; }
.record-state {
  color: var(--green);
  font-size: 11px;
  font-weight: 750;
}
.record-notes { white-space: pre-wrap; overflow-wrap: anywhere; }
.latest-grid { display: grid; gap: 10px; }
.category-latest .section-heading { margin-bottom: 4px; }
.category-latest h3 { margin: 0; font-size: 13px; color: var(--muted); }
.category-latest strong { display: block; }
.category-latest[role="link"] { cursor: pointer; }
.category-latest[role="link"]:focus-visible { outline: 3px solid var(--green); outline-offset: 3px; }
.feed-breakdown { margin: 6px 0 0; color: var(--muted); font-size: 12px; font-weight: 750; font-variant-numeric: tabular-nums; }
.record-actions { display: flex; gap: 8px; margin-top: 10px; }
.date-navigation {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  align-items: center;
  gap: 8px;
  margin: 12px 0;
}
.date-navigation input { min-width: 0; padding: 9px 10px !important; }
.history-panel .page-heading { margin-bottom: 14px; }
.history-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  margin: 4px 0 16px;
  border-radius: 17px;
  padding: 5px;
  background: #ecebe7;
}
.history-tabs button {
  min-height: 48px;
  border-radius: 14px;
  background: transparent;
  color: var(--muted);
  font-weight: 850;
}
.history-tabs button[aria-selected="true"] {
  background: white;
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(37, 48, 42, .08);
}
.history-filters { margin: 0 0 16px; }
.history-filters button { min-height: 42px; padding: 9px 18px; font-size: 13px; }
.history-date-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 48px;
  align-items: center;
  gap: 10px;
  margin: 4px 0 14px;
}
.history-date-picker { position: relative; min-width: 0; }
.history-date-button {
  width: 100%;
  min-height: 44px;
  padding: 8px 10px;
  border-radius: 14px;
  background: transparent;
  color: var(--ink);
  font-size: 18px;
  font-weight: 850;
}
.history-date-button [data-lucide] { width: 17px; height: 17px; color: var(--muted); }
.history-date-picker .history-date-input {
  position: fixed !important;
  top: 0;
  left: 0;
  width: 1px !important;
  min-width: 1px !important;
  height: 1px !important;
  min-height: 1px !important;
  padding: 0 !important;
  border: 0 !important;
  opacity: 0;
  pointer-events: none;
}
.history-date-row .icon-button { border-radius: 14px; }
.history-empty { margin: 12px 0; text-align: center; }
.history-records { gap: 10px; margin-top: 0; }
.history-record {
  align-items: center;
  gap: 12px;
  min-height: 86px;
  padding: 14px 16px;
  border-radius: 17px;
}
.history-record.is-editable { cursor: pointer; }
.history-record .record-icon-time { display: flex; flex-direction: column; align-items: center; gap: 5px; flex: 0 0 58px; }
.history-record .tile-time { width: auto; padding-top: 0; font-size: 10px; line-height: 1.2; white-space: nowrap; text-align: center; }
.history-record .tile-icon { width: 40px; height: 40px; border-radius: 13px; }
.history-record h3 { font-size: 17px; line-height: 1.25; }
.history-record p { font-size: 13px; }
.range-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  margin: -4px 0 14px;
  border-radius: 16px;
  padding: 5px;
  background: #ecebe7;
}
.range-tabs button { min-height: 34px; border-radius: 12px; background: transparent; color: var(--muted); font-size: 12px; }
.range-tabs button[aria-pressed="true"] { background: white; color: var(--ink); box-shadow: 0 1px 3px rgba(37, 48, 42, .08); }
.insights-panel { display: grid; gap: 12px; }
.insight-card, .insight-row { border: 1px solid var(--line); border-radius: 17px; padding: 14px; background: white; }
.insight-card h2 { margin: 0; font-size: 17px; }
.insight-card p { margin: 2px 0 0; font-size: 12px; }
.metric-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.metric-grid div { border-radius: 13px; padding: 12px; background: var(--canvas); }
.metric-grid strong { display: block; font-size: 19px; }
.metric-grid span { color: var(--muted); font-size: 11px; }
.insight-row { display: flex; align-items: center; gap: 12px; }
.insight-row div { min-width: 0; flex: 1; }
.insight-row strong, .insight-row small { display: block; }
.insight-row small { color: var(--muted); font-size: 12px; }
.insight-row b { font-size: 16px; }
.activity-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.activity-heading h2 { margin: 0; font-size: 18px; }
.activity-range { flex-shrink: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 13px; background: #f7f6f2; font-size: 12px; }
.activity-filters { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; }
.activity-filters button { color: var(--ink); padding: 7px 12px; min-height: 36px; border: 1px solid var(--line); border-radius: 999px; background: white; font-size: 12px; }
.activity-filters button[aria-pressed="true"] { background: #24312a; border-color: #24312a; color: white; }
.pattern-grid { display: grid; grid-template-columns: 29px repeat(7, minmax(0, 1fr)); column-gap: 0; align-items: center; }
.pattern-day, .pattern-time { color: var(--muted); font-size: 10px; font-weight: 400; }
.pattern-day { text-align: center; padding-bottom: 6px; }
.pattern-row { display: contents; }
.pattern-time { text-align: left; }
.pattern-cell { height: 16px; display: flex; gap: 2px; align-items: center; justify-content: center; padding: 0 4px; border-top: 1px solid transparent; }
.pattern-cell.is-major { border-top: 1px dashed #e8e9e5; }
.pattern-cell i { display: block; flex: 1; min-width: 0; max-width: 44px; height: 10px; border-radius: 2px; }
.pattern-empty { margin-top: 12px !important; color: var(--muted); text-align: center; }
.pattern-legend i { width: 9px; height: 9px; border-radius: 2px; }
.activity-feed { background: #fb923c; }
.activity-sleep { background: #a78bfa; }
.activity-diaper { background: #34c99a; }
.pattern-legend { display: flex; gap: 14px; margin-top: 10px; color: var(--muted); font-size: 11px; }
.pattern-legend span { display: inline-flex; align-items: center; gap: 5px; }
.active-sessions { display: grid; gap: 8px; margin-bottom: 12px; }
.active-session {
  width: 100%;
  justify-content: flex-start;
  border: 1px solid #cce9d7;
  border-radius: 16px;
  padding: 12px;
  background: var(--green-soft);
  color: var(--green-strong);
  text-align: left;
}
.active-session span { min-width: 0; flex: 1; }
.active-session strong, .active-session small { display: block; }
.active-session small { color: var(--muted); font-size: 12px; }
.filter-pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: 4px 0 14px;
  scrollbar-width: none;
}
.filter-pills::-webkit-scrollbar { display: none; }
.filter-pills button {
  min-height: 36px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  background: white;
  color: var(--ink);
  font-size: 12px;
}
.filter-pills button[aria-pressed="true"] {
  border-color: var(--ink);
  background: var(--ink);
  color: white;
}
.list-panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
}
.list-row {
  width: 100%;
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 14px;
  color: var(--ink);
  text-align: left;
  text-decoration: none;
}
.list-row:last-child { border-bottom: 0; }
.list-row span { min-width: 0; flex: 1; }
.list-row strong, .list-row small { display: block; }
.list-row small { color: var(--muted); font-size: 12px; }
.pending-panel { margin-top: 24px; }
.pending-panel .surface { margin: 8px 0; padding: 14px; }

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 40;
  width: min(100%, 430px);
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: end;
  gap: 0;
  transform: translateX(-50%);
  border-top: 1px solid var(--line);
  padding: 7px 8px max(8px, env(safe-area-inset-bottom));
  background: color-mix(in srgb, white, transparent 5%);
  backdrop-filter: blur(12px);
}
.bottom-nav .nav-btn, .bottom-nav .nav-add {
  min-width: 0;
  min-height: 56px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  border: 0;
  border-radius: 14px;
  padding: 6px 2px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  text-decoration: none;
}
.bottom-nav .nav-btn[aria-current="page"] { color: var(--green); }
.bottom-nav .nav-add {
  margin-top: -28px;
  transform: none;
  color: var(--ink);
}
.bottom-nav .nav-add span:first-child {
  width: 54px;
  height: 54px;
  border-radius: 17px;
  background: var(--ink);
  color: white;
  box-shadow: 0 10px 18px rgba(37, 48, 42, .18);
}
.bottom-nav .nav-add span:first-child [data-lucide], .bottom-nav .nav-add span:first-child svg {
  width: 28px;
  height: 28px;
}

.account-links { margin-top: 24px; }
.allocation-summary { margin: 20px 0; padding: 18px; }
.allocation-summary p { margin-bottom: 0; font-size: 14px; }
.allocation-meter { display: flex; gap: 8px; margin: 14px 0; }
.allocation-meter span { height: 8px; flex: 1; background: var(--line); border-radius: 8px; }
.allocation-meter .used { background: var(--green); }
.child-list { display: grid; gap: 12px; }
.child-card { padding: 16px; }
.child-row { display: flex; gap: 12px; align-items: center; }
.child-card form { margin: 8px 0 0; }
.child-card button { margin-top: 0; }
.profile-form { margin-top: 16px; }
.profile-form label { margin-bottom: 6px; }
.profile-form input { margin-bottom: 8px; min-width: 0; max-width: 100%; }
.profile-facts { margin: 24px 0; }
.profile-facts dt { color: var(--muted); font-size: 13px; }
.profile-facts dd { margin: 4px 0; font-weight: 700; }
#plan { scroll-margin-top: 90px; }

.care-dialog {
  width: min(430px, calc(100vw - 24px));
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 20px;
  background: var(--canvas);
  color: var(--ink);
}
.sheet-dialog {
  margin: auto auto 0;
  width: min(430px, 100vw);
  max-height: 91dvh;
  border-radius: 28px 28px 0 0;
  padding: 14px 16px max(24px, env(safe-area-inset-bottom));
  transition: transform .18s ease;
}
.sheet-dialog.is-dragging { transition: none; }
.sheet-handle {
  display: block;
  width: 64px;
  height: 22px;
  margin: -4px auto 8px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  touch-action: none;
  cursor: grab;
}
.sheet-handle::before {
  content: "";
  display: block;
  width: 40px;
  height: 6px;
  margin: 8px auto;
  border-radius: 999px;
  background: #d5d4cf;
}
.sheet-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.sheet-heading .eyebrow { margin-top: 0; }
.sheet-heading h2 { margin: 0; }
.record-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.record-grid button {
  min-height: 112px;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  background: white;
  color: var(--ink);
  text-align: left;
}
.record-grid [data-lucide] { width: 25px; height: 25px; color: var(--green); }
.record-grid strong, .record-grid small { display: block; }
.record-grid small { color: var(--muted); font-size: 12px; }
.timer-card {
  margin: 10px 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  background: white;
  text-align: center;
}
.timer-card strong { display: block; font-size: 36px; line-height: 1; font-weight: 900; font-variant-numeric: tabular-nums; }
.timer-card span { color: var(--green); font-size: 12px; font-weight: 800; }
.timer-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 8px 0;
}
.side-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.side-toggle [data-lucide] { width: 18px; height: 18px; }
.manual-duration-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0 4px;
}
.field-help { margin: 0 0 10px; color: var(--muted); font-size: 12px; }
.care-dialog::backdrop { background: rgba(37, 48, 42, .4); }
.care-dialog form { margin: 0; }
.care-dialog h2 { margin-top: 0; }
.care-dialog fieldset { border: 0; padding: 0; margin: 16px 0; }
.care-dialog legend { font-weight: 750; margin-bottom: 8px; }
.diaper-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.diaper-options button {
  margin: 0;
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
}
.diaper-options button[aria-pressed="true"] {
  border-color: var(--green);
  background: var(--green-soft);
  color: var(--green-strong);
}
.diaper-type-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.diaper-type-button {
  aspect-ratio: 1;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: white;
  color: var(--muted);
  font-weight: 850;
  padding: 0;
}
.diaper-type-button[aria-pressed="true"] {
  border-color: var(--green);
  background: var(--green-soft);
  color: var(--green-strong);
}
.diaper-details {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin: 18px -16px;
  padding: 14px 16px;
}
.diaper-details summary { cursor: pointer; font-weight: 850; }
.texture-grid, .color-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.color-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.texture-button, .color-button {
  display: grid;
  justify-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 4px 0;
  font-size: 11px;
}
.texture-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 18px;
  background: var(--green-soft);
  color: var(--green-strong);
  font-size: 30px;
  font-weight: 900;
  line-height: 1;
}
.texture-pebbles { font-size: 17px; letter-spacing: 1px; }
.texture-button[aria-pressed="true"], .color-button[aria-pressed="true"] { color: var(--green-strong); font-weight: 850; }
.texture-button[aria-pressed="true"] .texture-mark { outline: 3px solid var(--green); outline-offset: 3px; }
.color-dot {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.35);
}
.color-dot [data-lucide] { display: none; width: 20px; height: 20px; color: white; filter: drop-shadow(0 1px 1px rgba(0,0,0,.55)); }
.color-button[aria-pressed="true"] .color-dot {
  outline: 3px solid var(--green);
  outline-offset: 4px;
  box-shadow: 0 0 0 2px white, inset 0 0 0 1px rgba(255,255,255,.45);
}
.color-button[aria-pressed="true"] .color-dot [data-lucide] { display: block; }
.toggle-list {
  border-top: 1px solid var(--line);
  margin: 8px -16px 0;
}
.toggle-list label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  font-weight: 800;
}
.toggle-list input[role="switch"] { width: 44px; min-width: 44px; height: 26px; accent-color: var(--green); }
.version-comparison { padding: 12px 0; border-bottom: 1px solid var(--line); }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width: 380px) {
  .app-header { gap: 6px; padding-inline: 12px; }
  .plan-status { padding-inline: 8px; font-size: 10px; }
  .selected-name { max-width: 64px; }
  .stat-card { padding: 10px; }
}

.activity-calendar-nav { display: flex; justify-content: space-between; gap: 6px; margin-bottom: 8px; }
.activity-calendar-nav button { font-size: 11px; }
.activity-calendar { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scrollbar-width: none; }
.activity-calendar::-webkit-scrollbar { display: none; }
.activity-week { flex: 0 0 100%; min-width: 0; scroll-snap-align: start; scroll-snap-stop: always; }
.pattern-day span, .pattern-day strong { display: block; }
.pattern-day strong { color: var(--ink); font-size: 12px; margin-top: 3px; }

.optional-notes { margin-top: 12px; }
.optional-notes summary { cursor: pointer; color: var(--green-strong); padding: 10px 0; font-weight: 600; }

.metric-grid .breast-ratio { font-size: 16px; }
.feeding-heading { display: flex; align-items: center; gap: 12px; }
.metric-grid .breast-duration { display: block; color: var(--muted); margin-top: 6px; font-size: 11px; }

.trend-heading h2 { margin: 4px 0 0; font-size: 18px; }
.trend-heading p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }

.formula-choices button { max-width: 100%; overflow-wrap: anywhere; text-align: left; }

.caregiver-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-top: 0; }
.caregiver-heading h1 { margin: 0; }
.caregiver-child { margin: 4px 0 8px; color: var(--muted); font-size: 12px; font-weight: 400; }
.caregiver-heading .eyebrow { font-weight: 400; margin-bottom: 5px; }
.caregiver-invite { color: var(--green-strong); font-weight: 700; text-decoration: none; white-space: nowrap; padding: 0 0 0 12px; }
.caregiver-intro { margin: 0 0 22px; font-size: 14px; line-height: 1.6; }
.caregiver-list { background: white; border: 1px solid var(--line); border-radius: 24px; padding: 10px 16px; margin: 20px 0; }
.caregiver-row { display: flex; align-items: center; gap: 12px; padding: 18px 0; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); }
.caregiver-row:last-child { border-bottom: 0; }
.caregiver-row .avatar { flex: 0 0 38px; width: 38px; height: 38px; }
.caregiver-row:nth-child(2n) .avatar { background: #fff1eb; }
.caregiver-row:nth-child(3n) .avatar { background: #eef6ff; }
.caregiver-row div { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.caregiver-row strong, .caregiver-row small { display: block; }
.caregiver-row small { color: var(--muted); font-size: 12px; margin-top: 2px; }
.caregiver-row svg { width: 16px; height: 16px; flex-shrink: 0; }

button.caregiver-invite { background: transparent; border: 0; border-radius: 0; color: var(--green-strong); min-height: 44px; }

.invite-share-actions { display: grid; gap: 10px; margin-top: 12px; }

.caregiver-pending { margin-top: 28px; }
.caregiver-pending h2 { font-size: 15px; color: var(--muted); }
.caregiver-pending .caregiver-list { margin-top: 10px; }
.caregiver-pending .caregiver-row { gap: 8px; }

.pending-invite-actions { display: flex; gap: 6px; flex-shrink: 0; }
.pending-invite-actions .icon-button { width: 44px; height: 44px; }
.pending-invite-actions .revoke-invite { color: var(--danger); }

.profile-edit { margin-left: auto; flex-shrink: 0; text-decoration: none; }

.app-frame, .has-app-chrome { padding-top: 76px; }
.has-app-chrome .content { padding-bottom: max(100px, calc(84px + env(safe-area-inset-bottom))); }
.bottom-nav a.nav-btn, .bottom-nav a.nav-add { align-items: center; justify-content: center; }
.profile-edit svg { display: block; width: 20px; height: 20px; }

.profile-facts-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px 12px; }
.child-profile-sections { display: grid; gap: 24px; }
.child-profile-card .profile-facts { margin: 20px 0 0; padding-top: 20px; border-top: 1px solid var(--line); }
.child-archive-card { background: #fcfaf7; }
.child-archive-card h2 { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 16px; }
.child-archive-card h2 svg { width: 20px; height: 20px; flex-shrink: 0; color: var(--muted); }
.child-archive-card p { margin: 10px 0 16px; color: var(--muted); font-size: 14px; }
.child-archive-card .button { width: 100%; color: var(--danger); white-space: normal; overflow-wrap: anywhere; text-align: center; }

button.referral-menu { width: 100%; text-align: left; border-radius: 0; font-weight: inherit; background: white; color: var(--ink); }
.referral-code { padding: 12px; background: var(--canvas); border-radius: 12px; font-size: 13px; }
.referral-code strong { display: block; color: var(--ink); letter-spacing: 1px; margin-top: 3px; }

.support-options { margin-bottom: 0; }
.support-icon { background: var(--green-soft); color: var(--green-strong); border-radius: 12px; }

/* Subscription sheet: status and children first, purchasing revealed by state. */
.nozo-plan-sheet { scroll-padding-top: 100px; overscroll-behavior-y: contain; }
.plan-sheet-header { position: sticky; top: -14px; z-index: 2; background: var(--canvas); padding-top: 4px; }
.plan-sheet-header .sheet-heading { align-items: center; padding-bottom: 12px; margin-bottom: 0; }
.plan-sheet-header h2 { font-size: 22px; }
.plan-sheet-content { display: grid; gap: 20px; padding-top: 8px; }
.plan-sheet-content h3 { font-size: 16px; margin: 0; }
.plan-sheet-content p { margin: 6px 0 0; }
.plan-status-panel { display: flex; align-items: flex-start; gap: 12px; padding: 16px; border: 1px solid #cde4d5; border-radius: 18px; background: var(--green-soft); }
.plan-status-panel > div { min-width: 0; }
.plan-status-panel h3 { font-size: 18px; color: var(--green-strong); }
.plan-status-panel p { font-size: 13px; line-height: 1.5; }
.plan-status-icon { color: var(--green-strong); flex: 0 0 22px; }
.plan-status-icon svg { width: 22px; height: 22px; }
.plan-status-panel.is-expired { background: white; border-color: var(--line); }
.plan-status-panel.is-expired h3, .plan-status-panel.is-expired .plan-status-icon { color: var(--danger); }
.plan-children { padding: 16px; border: 1px solid var(--line); border-radius: 18px; background: white; }
.plan-children .section-heading { margin-bottom: 4px; align-items: baseline; gap: 8px; }
.plan-children .section-heading small { flex-shrink: 0; color: var(--muted); font-size: 12px; }
.plan-children .caregiver-row { padding: 12px 0; }
.plan-children .caregiver-row strong { font-size: 15px; }
.plan-add-child { display: flex; align-items: center; gap: 10px; text-decoration: none; min-height: 48px; }
.plan-add-child > div { flex: 1; min-width: 0; }
.plan-add-child svg { width: 20px; height: 20px; flex-shrink: 0; }
.plan-add-child.button { margin-top: 12px; justify-content: center; }
.plan-add-child.button > div { flex: 0 1 auto; }
.plan-add-child.button > svg:last-child { display: none; }
.plan-offers { display: grid; gap: 18px; }
.plan-offers > section:focus { outline: none; }
.nozo-plan-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.nozo-plan-options button { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; color: var(--ink); background: white; border: 1px solid var(--line); border-radius: 16px; padding: 14px 12px; text-align: left; min-width: 0; overflow-wrap: anywhere; }
.nozo-plan-options button[aria-pressed="true"] { border-color: var(--green); background: var(--green-pale); box-shadow: inset 0 0 0 1px var(--green); }
.nozo-plan-options strong { font-size: clamp(20px, 6vw, 26px); line-height: 1.25; }
.nozo-plan-options small { font-size: 11px; color: var(--muted); font-weight: 400; }
.nozo-plan-options .plan-selected { margin-top: auto; padding-top: 8px; font-size: 11px; color: var(--muted); }
.nozo-plan-options button[aria-pressed="true"] .plan-selected { color: var(--green-strong); font-weight: 700; }
.plan-saving { color: var(--green-strong); font-size: 11px; background: var(--green-soft); border-radius: 6px; padding: 2px 5px; }
.plan-additional { padding: 12px 0; border-block: 1px solid var(--line); }
.plan-additional p { display: flex; flex-wrap: wrap; gap: 4px; }
.plan-additional small { font-size: 12px; color: var(--muted); }
.plan-voucher-toggle { display: flex; align-items: center; gap: 10px; min-height: 44px; margin: 0; cursor: pointer; font-size: 14px; }
.plan-voucher-toggle input { appearance: auto; width: 18px; height: 18px; margin: 0; padding: 0; accent-color: var(--green); flex-shrink: 0; }
.plan-code-form { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.plan-code-form input { min-width: 0; flex: 1; font-size: 16px; }
.plan-code-form button { margin: 0; min-height: 44px; padding-inline: 14px; }
.plan-code-fields { padding-bottom: 12px; }
.plan-code-result { background: var(--green-pale); border: 1px solid #cde4d5; border-radius: 12px; padding: 12px; margin-top: 12px; overflow-wrap: anywhere; font-size: 14px; }
.plan-code-result .full-width { margin-top: 12px; }
.plan-referral-toggle { min-height: 44px; font-size: 13px; }
.plan-checkout-action { padding-top: 4px; text-align: center; }
.plan-checkout-action button:disabled { opacity: .65; }
.referral-progress { border-top: 1px solid var(--line); margin-top: 20px; padding-top: 16px; }
.referral-progress h3 { margin: 0 0 10px; font-size: 16px; }
.referral-progress .section-heading { flex-wrap: wrap; gap: 6px; font-size: 14px; }
.referral-progress label { font-size: 12px; color: var(--muted); }
.referral-progress progress { width: 100%; height: 8px; accent-color: var(--green); }
@media (prefers-reduced-motion: reduce) { .nozo-plan-sheet { scroll-behavior: auto; transition: none; } }

.brand img { display: block; width: 110px; height: 33px; object-fit: contain; }
.app-header .brand { min-width: 44px; justify-content: center; }
.app-header .brand img { width: 40px; height: 40px; }
.notification-settings h2 { margin-top: 0; }
.notification-settings form + form { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.notification-device-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.notification-device-actions [hidden] { display: none !important; }
[data-pwa-install] [data-pwa-install-help] { padding: 0 16px 16px; }

[data-pwa-standalone] [data-pwa-install] { display: none; }
