:root {
  --paper: #f3f0e8;
  --surface: #fffdf8;
  --ink: #17313b;
  --muted: #5f6e69;
  --line: #dedacf;
  --feed: #d3a34e;
  --feed-soft: #f5e9cb;
  --diaper: #79a58a;
  --diaper-soft: #e1ede5;
  --sleep: #7e88b8;
  --sleep-soft: #e5e7f2;
  --health: #cc6854;
  --health-soft: #f4dfd9;
  --deep-paper: #e9e3d7;
  --radius-xl: 34px;
  --radius-lg: 26px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --touch-target: 48px;
  --shadow-soft: 0 24px 60px rgba(49, 58, 55, 0.08);
  --shadow-card: 0 12px 30px rgba(49, 58, 55, 0.055);
  --serif: 'Songti SC', 'STSong', 'Source Han Serif SC', 'Noto Serif CJK SC', Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Source Han Sans SC', system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--paper);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 56% 5%, rgba(255, 253, 248, 0.95) 0, rgba(255, 253, 248, 0) 29rem),
    linear-gradient(135deg, #f7f4ed 0%, var(--paper) 45%, #ebe8df 100%);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: '';
  pointer-events: none;
  opacity: 0.28;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 220 220' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.08'/%3E%3C/svg%3E");
}

button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  border: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

svg {
  display: block;
  width: 1.35em;
  height: 1.35em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

:focus-visible {
  outline: 3px solid rgba(23, 49, 59, 0.34);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 100;
  display: inline-flex;
  min-height: var(--touch-target);
  align-items: center;
  padding: 10px 14px;
  border-radius: 10px;
  color: var(--surface);
  background: var(--ink);
  transform: translateY(-160%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.ambient-shape {
  position: fixed;
  z-index: -1;
  border-radius: 999px;
  filter: blur(2px);
  pointer-events: none;
}

.ambient-shape--one {
  top: -18rem;
  right: 5%;
  width: 39rem;
  height: 39rem;
  border: 1px solid rgba(126, 136, 184, 0.2);
  box-shadow: inset 0 0 0 8rem rgba(126, 136, 184, 0.025);
}

.ambient-shape--two {
  bottom: -15rem;
  left: 17%;
  width: 30rem;
  height: 30rem;
  background: rgba(211, 163, 78, 0.035);
}

.app-shell {
  display: grid;
  grid-template-columns: 220px minmax(560px, 1fr) 308px;
  width: min(100%, 1660px);
  min-height: 100dvh;
  margin: 0 auto;
}

.sidebar,
.care-rail {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100dvh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  padding: 30px 18px 22px;
  border-right: 1px solid rgba(23, 49, 59, 0.09);
  background: rgba(244, 241, 233, 0.64);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 0 8px 26px;
}

.brand__mark {
  border-radius: 15px;
  box-shadow: 0 8px 20px rgba(23, 49, 59, 0.13);
}

.brand span {
  display: grid;
  gap: 1px;
}

.brand strong,
.mobile-brand span {
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.brand small {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.05em;
}

.baby-mini-card {
  display: grid;
  grid-template-columns: 40px 1fr 32px;
  gap: 10px;
  align-items: center;
  margin-bottom: 25px;
  padding: 12px;
  border: 1px solid rgba(23, 49, 59, 0.08);
  border-radius: 18px;
  background: rgba(255, 253, 248, 0.72);
}

.baby-avatar {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 50%;
  color: #fffdf8;
  background:
    radial-gradient(circle at 36% 28%, rgba(255,255,255,.35) 0 7%, transparent 8%),
    var(--health);
  font-family: var(--serif);
  font-size: 16px;
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.25);
}

.baby-mini-card div {
  display: grid;
}

.baby-mini-card strong {
  font-family: var(--serif);
  font-size: 15px;
}

.baby-mini-card div span {
  color: var(--muted);
  font-size: 11px;
}

.icon-button {
  display: inline-grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  transition: color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.icon-button:hover {
  color: var(--ink);
  background: rgba(23, 49, 59, 0.07);
  transform: rotate(4deg);
}

.side-nav {
  display: grid;
  gap: 5px;
}

.side-nav__item {
  position: relative;
  display: flex;
  gap: 12px;
  align-items: center;
  min-height: 48px;
  padding: 0 14px;
  border-radius: 14px;
  color: #63736f;
  font-size: 13px;
  font-weight: 500;
  transition: color 160ms ease, background 160ms ease, transform 160ms ease;
}

.side-nav__item svg {
  width: 20px;
  height: 20px;
}

.side-nav__item:hover {
  color: var(--ink);
  background: rgba(255, 253, 248, 0.62);
  transform: translateX(2px);
}

.side-nav__item.is-active {
  color: var(--surface);
  background: var(--ink);
  box-shadow: 0 10px 24px rgba(23, 49, 59, 0.14);
}

.side-nav__item.is-active::after {
  position: absolute;
  top: 50%;
  right: -12px;
  width: 5px;
  height: 18px;
  border-radius: 5px;
  background: var(--feed);
  content: '';
  transform: translateY(-50%);
}

.sidebar__spacer {
  flex: 1;
}

.memo-panel {
  margin-top: 24px;
  padding: clamp(22px, 3vw, 34px);
  border: 1px solid rgba(23, 49, 59, 0.08);
  border-radius: var(--radius-lg);
  background: rgba(255, 253, 248, 0.78);
  box-shadow: var(--shadow-card);
}

.memo-form { display: grid; grid-template-columns: 1fr auto; gap: 10px; margin-top: 18px; }
.memo-form input { min-width: 0; min-height: 48px; padding: 11px 15px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.memo-list { display: grid; gap: 9px; margin: 16px 0 0; padding: 0; list-style: none; }
.memo-item { display: grid; grid-template-columns: 28px 1fr 44px; gap: 10px; align-items: center; min-height: 52px; padding: 8px 8px 8px 12px; border-radius: 15px; background: var(--paper); }
.memo-item input { width: 20px; height: 20px; accent-color: var(--ink); }
.memo-item.is-complete span { color: var(--muted); text-decoration: line-through; }
.memo-item__delete { min-width: 44px; min-height: 44px; border-radius: 50%; color: var(--muted); background: transparent; cursor: pointer; }
#profile-form { padding: 28px; }

#main-content {
  min-width: 0;
  padding: 34px clamp(24px, 3.2vw, 52px) 64px;
}

.mobile-header,
.mobile-nav {
  display: none;
}

.page-heading {
  display: flex;
  gap: 30px;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 26px;
  animation: lift-in 520ms ease both;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.page-heading h1,
.section-heading h2,
.rail-heading h2,
.handoff-card h2,
.growth-teaser h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -0.035em;
}

.page-heading h1 {
  font-size: clamp(29px, 3vw, 43px);
  line-height: 1.18;
}

.page-heading h1 em {
  position: relative;
  font-style: normal;
}

.page-heading h1 em::after {
  position: absolute;
  right: 0;
  bottom: -6px;
  left: 0;
  height: 6px;
  border-radius: 50%;
  background: rgba(211, 163, 78, 0.38);
  content: '';
  transform: rotate(-1deg);
}

.page-heading__intro {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.heading-status {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
  padding: 8px 12px;
  border: 1px solid rgba(121, 165, 138, 0.28);
  border-radius: 99px;
  color: #50715e;
  background: rgba(225, 237, 229, 0.55);
  font-size: 10px;
  white-space: nowrap;
}

.sync-status-button {
  min-width: var(--touch-target);
  min-height: var(--touch-target);
  justify-content: center;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.sync-status-button:hover {
  transform: translateY(-1px);
}

.sync-status-button[data-sync-state='syncing'] .status-dot {
  background: var(--feed);
  box-shadow: 0 0 0 4px rgba(211, 163, 78, 0.16);
  animation: sync-pulse 1.2s ease-in-out infinite;
}

.sync-status-button[data-sync-state='pending'] {
  border-color: rgba(204, 104, 84, 0.28);
  color: #88493d;
  background: rgba(244, 223, 217, 0.62);
}

.sync-status-button[data-sync-state='pending'] .status-dot {
  background: var(--health);
  box-shadow: 0 0 0 4px rgba(204, 104, 84, 0.14);
}

.sync-status-button[data-sync-state='local'] {
  border-color: rgba(126, 136, 184, 0.24);
  color: #59648e;
  background: rgba(229, 231, 242, 0.58);
}

.sync-status-button[data-sync-state='pending'] .status-dot {
  background: var(--sleep);
  box-shadow: 0 0 0 4px rgba(126, 136, 184, 0.14);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--diaper);
  box-shadow: 0 0 0 4px rgba(121, 165, 138, 0.16);
}

.focus-card {
  position: relative;
  display: flex;
  min-height: 220px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  padding: clamp(28px, 3vw, 42px);
  overflow: hidden;
  border: 1px solid rgba(23, 49, 59, 0.11);
  border-radius: var(--radius-xl);
  color: var(--surface);
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.04), transparent 36%),
    var(--ink);
  box-shadow: var(--shadow-soft);
  animation: lift-in 560ms 70ms ease both;
}

.focus-card::before {
  position: absolute;
  top: -90px;
  right: -60px;
  width: 390px;
  height: 390px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  content: '';
}

.focus-card__copy {
  position: relative;
  z-index: 2;
}

.focus-card__label {
  display: flex;
  gap: 8px;
  align-items: center;
  color: rgba(255, 253, 248, 0.66);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.focus-card__label svg {
  color: var(--feed);
}

.focus-card__copy > strong {
  display: block;
  margin: 7px 0 6px;
  font-family: var(--serif);
  font-size: clamp(38px, 4.6vw, 63px);
  font-weight: 600;
  letter-spacing: -0.06em;
  line-height: 1.12;
  font-variant-numeric: tabular-nums;
}

.focus-card__copy > p {
  margin: 0 0 18px;
  color: rgba(255, 253, 248, 0.64);
  font-size: 12px;
}

.text-button {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 99px;
  color: var(--surface);
  background: rgba(255, 255, 255, 0.07);
  font-size: 11px;
  cursor: pointer;
  transition: background 160ms ease, transform 160ms ease;
}

.text-button:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-2px);
}

.text-button svg {
  width: 15px;
}

.focus-orbit {
  position: relative;
  width: 185px;
  height: 185px;
  flex: 0 0 auto;
  margin-right: 3%;
}

.focus-orbit__ring,
.focus-orbit__sun,
.focus-orbit__caption {
  position: absolute;
  border-radius: 50%;
}

.focus-orbit__ring {
  inset: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.focus-orbit__ring--outer::before,
.focus-orbit__ring--inner::before {
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--feed);
  box-shadow: 0 0 0 5px rgba(211, 163, 78, 0.12);
  content: '';
}

.focus-orbit__ring--outer::before {
  top: 32px;
  right: 13px;
}

.focus-orbit__ring--inner {
  inset: 23px;
  border-color: rgba(255, 255, 255, 0.07);
  transform: rotate(35deg);
}

.focus-orbit__ring--inner::before {
  bottom: 8px;
  left: 27px;
  width: 5px;
  height: 5px;
  background: var(--diaper);
}

.focus-orbit__sun {
  inset: 53px;
  display: grid;
  place-items: center;
  background: var(--feed);
  box-shadow: 0 0 0 12px rgba(211, 163, 78, 0.09), 0 12px 30px rgba(0,0,0,.18);
}

.focus-orbit__sun i {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(23, 49, 59, 0.7);
}

.focus-orbit__sun i:nth-child(1) { transform: translate(-10px, -3px); }
.focus-orbit__sun i:nth-child(2) { transform: translate(10px, -3px); }
.focus-orbit__sun i:nth-child(3) {
  width: 18px;
  height: 8px;
  border: 2px solid var(--ink);
  border-top: 0;
  border-right-color: transparent;
  border-left-color: transparent;
  border-radius: 0 0 14px 14px;
  background: transparent;
  transform: translateY(10px);
}

.focus-orbit__caption {
  right: 3px;
  bottom: 17px;
  display: grid;
  width: 51px;
  height: 51px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: rgba(255,255,255,.72);
  background: rgba(255,255,255,.05);
  font-size: 8px;
  letter-spacing: .14em;
}

.quick-section {
  margin-bottom: 24px;
  animation: lift-in 580ms 130ms ease both;
}

.section-heading {
  display: flex;
  gap: 18px;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 22px;
}

.section-heading--compact {
  margin-bottom: 14px;
}

.section-heading h2 {
  font-size: 22px;
}

.section-heading--compact > span {
  color: var(--muted);
  font-size: 10px;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.quick-action {
  position: relative;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 18px;
  gap: 10px;
  align-items: center;
  min-height: 76px;
  padding: 12px;
  overflow: hidden;
  border: 1px solid rgba(23, 49, 59, 0.09);
  border-radius: var(--radius-md);
  color: var(--ink);
  background: rgba(255, 253, 248, 0.7);
  box-shadow: var(--shadow-card);
  text-align: left;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.quick-action::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: currentColor;
  content: '';
  opacity: 0.72;
}

.quick-action:hover {
  background: var(--surface);
  box-shadow: 0 16px 32px rgba(49, 58, 55, 0.09);
  transform: translateY(-3px);
}

.quick-action--feed { color: #8f6c2e; }
.quick-action--diaper { color: #507860; }
.quick-action--sleep { color: #59648e; }
.quick-action--health { color: #984d3e; }

.quick-action__icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 14px;
  background: var(--feed-soft);
}

.quick-action--diaper .quick-action__icon { background: var(--diaper-soft); }
.quick-action--sleep .quick-action__icon { background: var(--sleep-soft); }
.quick-action--health .quick-action__icon { background: var(--health-soft); }

.quick-action__icon svg {
  width: 22px;
  height: 22px;
}

.quick-action > span:nth-child(2) {
  display: grid;
}

.quick-action strong {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 13px;
}

.quick-action small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.quick-action__arrow {
  width: 16px;
  color: var(--muted);
  transition: transform 160ms ease;
}

.quick-action:hover .quick-action__arrow {
  transform: translateX(3px);
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 24px;
  animation: lift-in 600ms 190ms ease both;
}

.metric-card {
  min-width: 0;
  padding: 18px 18px 15px;
  border: 1px solid rgba(23, 49, 59, 0.08);
  border-radius: var(--radius-md);
  background: rgba(255, 253, 248, 0.57);
}

.metric-card__top {
  display: flex;
  gap: 7px;
  align-items: center;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.metric-card__top i,
.rhythm-legend i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--feed);
}

.metric-card--diaper .metric-card__top i { background: var(--diaper); }
.metric-card--sleep .metric-card__top i { background: var(--sleep); }
.metric-card--health .metric-card__top i { background: var(--health); }

.metric-card > strong {
  display: block;
  margin: 8px 0 3px;
  overflow: hidden;
  font-family: var(--serif);
  font-size: clamp(25px, 2.4vw, 34px);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.045em;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.metric-card > strong small {
  margin-left: 3px;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0;
}

.metric-card p {
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rhythm-panel,
.timeline-panel {
  margin-bottom: 18px;
  padding: clamp(22px, 2.6vw, 30px);
  border: 1px solid rgba(23, 49, 59, 0.09);
  border-radius: var(--radius-lg);
  background: rgba(255, 253, 248, 0.68);
  box-shadow: var(--shadow-card);
}

.rhythm-panel {
  animation: lift-in 620ms 250ms ease both;
}

.rhythm-legend {
  display: flex;
  gap: 13px;
  color: var(--muted);
  font-size: 9px;
}

.rhythm-legend span {
  display: flex;
  gap: 5px;
  align-items: center;
}

.rhythm-legend .legend-sleep { background: var(--sleep); }
.rhythm-legend .legend-feed { background: var(--feed); }
.rhythm-legend .legend-diaper { background: var(--diaper); }

.rhythm-chart {
  padding-top: 4px;
}

.rhythm-axis {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  margin: 0 -12px 8px;
  color: #87928f;
  font-size: 8px;
  font-variant-numeric: tabular-nums;
}

.rhythm-axis span {
  text-align: center;
}

.rhythm-track {
  position: relative;
  height: 68px;
  overflow: hidden;
  border-radius: 15px;
  background:
    repeating-linear-gradient(90deg, transparent 0 calc(25% - 1px), rgba(23, 49, 59, 0.07) calc(25% - 1px) 25%),
    #eeece5;
}

.rhythm-segment {
  position: absolute;
  top: 13px;
  height: 25px;
  min-width: 4px;
  border-radius: 8px;
  background: var(--sleep);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.3);
}

.rhythm-segment.is-active {
  background: repeating-linear-gradient(135deg, var(--sleep) 0 7px, #929bc5 7px 14px);
}

.rhythm-node {
  position: absolute;
  bottom: 12px;
  width: 9px;
  height: 9px;
  border: 2px solid #eeece5;
  border-radius: 50%;
  background: var(--feed);
  box-shadow: 0 0 0 1px rgba(23, 49, 59, 0.08);
  transform: translateX(-50%);
}

.rhythm-node.is-diaper {
  bottom: 4px;
  background: var(--diaper);
}

.rhythm-now-line {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 2px;
  background: var(--health);
  opacity: .55;
}

.rhythm-caption {
  margin: 11px 0 0;
  color: var(--muted);
  font-size: 9px;
}

.timeline-panel {
  animation: lift-in 640ms 300ms ease both;
}

.timeline-filters {
  display: flex;
  gap: 4px;
  padding: 3px;
  border-radius: 99px;
  background: rgba(23, 49, 59, 0.045);
}

.timeline-filters button {
  min-height: 28px;
  padding: 0 11px;
  border-radius: 99px;
  color: var(--muted);
  background: transparent;
  font-size: 9px;
  cursor: pointer;
}

.timeline-filters button.is-active {
  color: var(--surface);
  background: var(--ink);
}

.timeline-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 45px 36px minmax(0, 1fr) 36px;
  gap: 12px;
  align-items: start;
  padding: 14px 0;
  border-top: 1px solid rgba(23, 49, 59, 0.07);
}

.timeline-item:first-child {
  border-top: 0;
}

.timeline-item::before {
  position: absolute;
  top: 49px;
  bottom: -15px;
  left: 74px;
  width: 1px;
  background: rgba(23, 49, 59, 0.09);
  content: '';
}

.timeline-item:last-child::before {
  display: none;
}

.timeline-item time {
  padding-top: 8px;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.timeline-item__marker {
  position: relative;
  z-index: 1;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 12px;
  color: #87692f;
  background: var(--feed-soft);
}

.timeline-item--diaper .timeline-item__marker {
  color: #507860;
  background: var(--diaper-soft);
}

.timeline-item--sleep .timeline-item__marker {
  color: #59648e;
  background: var(--sleep-soft);
}

.timeline-item--health .timeline-item__marker {
  color: #984d3e;
  background: var(--health-soft);
}

.timeline-item__marker svg {
  width: 18px;
  height: 18px;
}

.timeline-item > div {
  padding-top: 4px;
}

.timeline-item strong {
  font-family: var(--serif);
  font-size: 12px;
}

.timeline-item p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 9px;
}

.timeline-more {
  display: block;
  min-height: 38px;
  margin: 12px auto 0;
  padding: 0 16px;
  border-radius: 99px;
  color: var(--muted);
  background: rgba(23, 49, 59, 0.05);
  font-size: 9px;
  cursor: pointer;
}

.growth-teaser {
  position: relative;
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) 1.1fr 42px;
  gap: 24px;
  align-items: center;
  min-height: 145px;
  padding: 26px 28px;
  overflow: hidden;
  border: 1px solid rgba(23, 49, 59, 0.09);
  border-radius: var(--radius-lg);
  background: var(--diaper-soft);
}

.growth-teaser h2 {
  font-size: 20px;
}

.growth-teaser p:not(.eyebrow) {
  margin: 7px 0 0;
  color: #5f7468;
  font-size: 10px;
}

.mini-growth-chart svg {
  width: 100%;
  height: 85px;
  overflow: visible;
}

.growth-area {
  fill: rgba(121, 165, 138, 0.18);
  stroke: none;
}

.growth-line {
  fill: none;
  stroke: #5d8d70;
  stroke-width: 2;
}

.mini-growth-chart circle {
  fill: var(--surface);
  stroke: #5d8d70;
  stroke-width: 3;
}

.round-arrow {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  color: var(--surface);
  background: var(--ink);
  cursor: pointer;
}

.care-rail {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 34px 24px 24px;
  overflow-y: auto;
  border-left: 1px solid rgba(23, 49, 59, 0.09);
  background: rgba(239, 236, 228, 0.48);
  backdrop-filter: blur(16px);
}

.rail-section {
  border-radius: var(--radius-md);
}

.rail-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 13px;
}

.rail-heading h2 {
  font-size: 21px;
}

.rail-heading .icon-button {
  border: 1px solid rgba(23, 49, 59, 0.09);
  background: rgba(255, 253, 248, 0.62);
}

.task-card {
  display: grid;
  grid-template-columns: 23px 1fr;
  gap: 10px;
  align-items: start;
  padding: 14px;
  border: 1px solid rgba(23, 49, 59, 0.08);
  border-radius: 16px;
  background: rgba(255, 253, 248, 0.65);
}

.task-check {
  position: relative;
  width: 21px;
  height: 21px;
  margin-top: 1px;
  border: 1.5px solid var(--diaper);
  border-radius: 7px;
  background: transparent;
  cursor: pointer;
}

.task-check.is-complete {
  background: var(--diaper);
  box-shadow: inset 0 0 0 5px rgba(255, 253, 248, 0.45);
}

.task-card div {
  display: grid;
}

.task-card strong {
  font-family: var(--serif);
  font-size: 12px;
}

.task-card span,
.task-card time {
  color: var(--muted);
  font-size: 8px;
}

.task-card time {
  grid-column: 2;
  margin-top: 6px;
  color: #5f7468;
}

.appointment-card {
  display: grid;
  grid-template-columns: 46px 1fr 20px;
  gap: 11px;
  align-items: center;
  margin-top: 9px;
  padding: 12px;
  border: 1px solid rgba(126, 136, 184, 0.14);
  border-radius: 16px;
  background: var(--sleep-soft);
}

.appointment-card__date {
  display: grid;
  width: 44px;
  height: 47px;
  place-content: center;
  border-radius: 13px;
  color: var(--surface);
  background: var(--sleep);
  text-align: center;
}

.appointment-card__date strong {
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1;
}

.appointment-card__date small {
  margin-top: 2px;
  font-size: 7px;
  letter-spacing: .12em;
}

.appointment-card div strong {
  font-family: var(--serif);
  font-size: 11px;
}

.appointment-card p {
  margin: 2px 0 0;
  color: #69708e;
  font-size: 8px;
}

.appointment-card > svg {
  width: 17px;
  color: #69708e;
}

.handoff-card {
  position: relative;
  padding: 22px;
  overflow: hidden;
  color: var(--surface);
  background: var(--ink);
  box-shadow: 0 18px 38px rgba(23, 49, 59, 0.15);
}

.handoff-card::after {
  position: absolute;
  right: -65px;
  bottom: -75px;
  width: 180px;
  height: 180px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 50%;
  box-shadow: inset 0 0 0 35px rgba(255,255,255,.025);
  content: '';
}

.handoff-card__top {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 15px;
  color: rgba(255,255,255,.68);
  font-size: 9px;
  letter-spacing: .08em;
}

.handoff-icon {
  display: grid;
  width: 29px;
  height: 29px;
  place-items: center;
  border-radius: 10px;
  color: var(--feed);
  background: rgba(255,255,255,.07);
}

.handoff-icon svg {
  width: 16px;
}

.handoff-card h2 {
  position: relative;
  z-index: 1;
  font-size: 21px;
  line-height: 1.45;
}

.handoff-card > p {
  position: relative;
  z-index: 1;
  margin: 13px 0 17px;
  color: rgba(255,255,255,.63);
  font-size: 9px;
  line-height: 1.8;
}

.primary-button {
  position: relative;
  z-index: 1;
  display: inline-flex;
  width: 100%;
  min-height: 45px;
  gap: 8px;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border-radius: 14px;
  color: var(--ink);
  background: var(--feed);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: filter 160ms ease, transform 160ms ease;
}

.primary-button:hover {
  filter: brightness(1.05);
  transform: translateY(-2px);
}

.primary-button svg {
  width: 16px;
}

.safety-card {
  display: grid;
  grid-template-columns: 39px 1fr;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(23, 49, 59, 0.08);
  background: rgba(255, 253, 248, 0.5);
}

.safety-card__icon {
  display: grid;
  width: 39px;
  height: 39px;
  place-items: center;
  border-radius: 14px;
  color: #59648e;
  background: var(--sleep-soft);
}

.safety-card__icon svg {
  width: 20px;
}

.safety-card strong {
  display: block;
  font-family: var(--serif);
  font-size: 10px;
}

.safety-card p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.65;
}

.privacy-note {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
  margin: auto 0 0;
  color: var(--muted);
  font-size: 8px;
}

.privacy-note svg {
  width: 13px;
}

.growth-teaser,
.rail-section {
  animation: lift-in 520ms ease both;
}

dialog {
  width: min(520px, calc(100% - 28px));
  max-height: min(760px, calc(100dvh - 28px));
  margin: auto;
  padding: 0;
  overflow: auto;
  border: 1px solid rgba(23, 49, 59, 0.1);
  border-radius: 28px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 35px 100px rgba(23, 49, 59, 0.28);
}

dialog::backdrop {
  background: rgba(23, 49, 59, 0.52);
  backdrop-filter: blur(5px);
}

dialog[open] {
  animation: dialog-in 220ms ease both;
}

#record-form {
  padding: 27px;
}

.dialog-handle {
  display: none;
}

.dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 23px;
}

.dialog-header h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 25px;
}

.dialog-close {
  min-width: var(--touch-target);
  min-height: var(--touch-target);
  background: rgba(23, 49, 59, 0.055);
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.dialog-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
}

.field--full {
  margin-top: 14px;
}

.field > span,
.fieldset-title {
  color: #50635f;
  font-size: 10px;
  font-weight: 700;
}

.field span small {
  color: var(--muted);
  font-weight: 400;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid rgba(23, 49, 59, 0.13);
  border-radius: 13px;
  outline: 0;
  background: #f7f4ed;
  font-size: 12px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.field textarea {
  min-height: 70px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(23, 49, 59, 0.08);
}

.choice-fieldset {
  grid-column: 1 / -1;
  margin: 0 0 4px;
  padding: 0;
  border: 0;
}

.choice-fieldset legend {
  margin-bottom: 8px;
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.segmented-control label {
  position: relative;
  display: grid;
  min-height: 46px;
  place-items: center;
  padding: 7px;
  border: 1px solid rgba(23, 49, 59, 0.12);
  border-radius: 13px;
  background: #f7f4ed;
  font-size: 10px;
  cursor: pointer;
}

.segmented-control input {
  position: absolute;
  opacity: 0;
}

.segmented-control label:has(input:focus-visible) {
  outline: 3px solid rgba(23, 49, 59, 0.5);
  outline-offset: 3px;
}

.segmented-control label:has(input:checked) {
  border-color: var(--ink);
  color: var(--surface);
  background: var(--ink);
  box-shadow: 0 8px 20px rgba(23, 49, 59, 0.12);
}

.primary-button--submit {
  min-height: 52px;
  margin-top: 7px;
  font-size: 12px;
}

.toast {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 120;
  max-width: min(330px, calc(100% - 32px));
  padding: 12px 16px;
  border-radius: 14px;
  color: var(--surface);
  background: var(--ink);
  box-shadow: 0 16px 40px rgba(23, 49, 59, 0.2);
  font-size: 11px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(16px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

@keyframes lift-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes dialog-in {
  from { opacity: 0; transform: translateY(18px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes sync-pulse {
  50% { opacity: .45; transform: scale(.82); }
}

@media (max-width: 1280px) {
  .app-shell {
    grid-template-columns: 200px minmax(540px, 1fr) 282px;
  }

  .sidebar {
    padding-inline: 14px;
  }

  .care-rail {
    padding-inline: 19px;
  }

  #main-content {
    padding-inline: 27px;
  }

  .quick-action {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .quick-action__icon {
    width: 38px;
    height: 38px;
  }

  .quick-action__arrow {
    display: none;
  }
}

@media (max-width: 1080px) {
  .app-shell {
    grid-template-columns: 200px minmax(0, 1fr);
  }

  .care-rail {
    position: static;
    grid-column: 2;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    height: auto;
    padding: 22px 27px 40px;
    overflow: visible;
    border-top: 1px solid rgba(23, 49, 59, 0.09);
    border-left: 0;
  }

  .privacy-note {
    grid-column: 1 / -1;
  }

  .focus-orbit {
    margin-right: 0;
  }
}

@media (max-width: 860px) {
  .focus-orbit {
    width: 155px;
    height: 155px;
  }

  .focus-orbit__sun {
    inset: 43px;
  }

  .quick-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .care-rail {
    grid-template-columns: 1fr 1fr;
  }

  .safety-card {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  body {
    background:
      radial-gradient(circle at 75% 0, rgba(255,255,255,.9), transparent 22rem),
      var(--paper);
  }

  .ambient-shape--one {
    top: -13rem;
    right: -15rem;
    width: 31rem;
    height: 31rem;
  }

  .app-shell {
    display: block;
    width: 100%;
  }

  .sidebar {
    display: none;
  }

  #main-content {
    width: 100%;
    padding: 0 16px 28px;
  }

  .mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 76px;
    padding-top: max(8px, env(safe-area-inset-top));
  }

  .mobile-brand {
    display: flex;
    gap: 9px;
    align-items: center;
  }

  .mobile-brand,
  .text-button,
  .timeline-filters button,
  .timeline-more,
  .round-arrow,
  .care-rail .icon-button,
  .primary-button {
    min-width: var(--touch-target);
    min-height: var(--touch-target);
  }

  .mobile-brand img {
    border-radius: 13px;
    box-shadow: 0 7px 18px rgba(23, 49, 59, 0.12);
  }

  .mobile-brand span {
    font-size: 20px;
  }

  .mobile-cloud-label {
    max-width: 112px;
    color: var(--muted);
    font-size: 9px;
    line-height: 1.35;
    text-align: right;
  }

  .page-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    margin: 14px 2px 20px;
  }

  .page-heading h1 {
    font-size: clamp(28px, 8vw, 37px);
  }

  .page-heading__intro {
    font-size: 11px;
  }

  .heading-status {
    display: flex;
    max-width: 112px;
    margin-bottom: 0;
    padding-inline: 10px;
    white-space: normal;
    line-height: 1.25;
  }

  .focus-card {
    min-height: 190px;
    margin-bottom: 25px;
    padding: 25px 22px;
    border-radius: 27px;
  }

  .focus-card__copy > strong {
    max-width: 210px;
    margin-top: 11px;
    font-size: clamp(37px, 11vw, 50px);
  }

  .focus-card__copy > p {
    max-width: 215px;
    font-size: 9px;
  }

  .focus-orbit {
    position: absolute;
    right: -48px;
    width: 162px;
    height: 162px;
    opacity: .95;
  }

  .focus-card__copy {
    width: 100%;
  }

  .text-button {
    padding-inline: 13px;
    font-size: 9px;
  }

  .task-card {
    grid-template-columns: var(--touch-target) 1fr;
  }

  .task-check {
    width: var(--touch-target);
    height: var(--touch-target);
    margin: -7px 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .task-check::before {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 21px;
    height: 21px;
    border: 1.5px solid var(--diaper);
    border-radius: 7px;
    background: transparent;
    content: '';
    transform: translate(-50%, -50%);
  }

  .task-check.is-complete::before {
    background: var(--diaper);
    box-shadow: inset 0 0 0 5px rgba(255, 253, 248, 0.45);
  }

  .section-heading--compact > span {
    display: none;
  }

  .section-heading h2 {
    font-size: 20px;
  }

  .quick-actions {
    gap: 9px;
  }

  .quick-action {
    grid-template-columns: 44px minmax(0, 1fr);
    min-height: 76px;
    padding: 11px;
    border-radius: 17px;
  }

  .quick-action__icon {
    width: 44px;
    height: 44px;
  }

  .quick-action strong {
    font-size: 12px;
  }

  .metric-strip {
    grid-template-columns: repeat(4, minmax(144px, 1fr));
    gap: 9px;
    margin-right: -16px;
    padding-right: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }

  .metric-strip::-webkit-scrollbar {
    display: none;
  }

  .metric-card {
    min-height: 120px;
    padding: 16px;
    scroll-snap-align: start;
  }

  .metric-card > strong {
    margin-top: 12px;
    font-size: 28px;
  }

  .rhythm-panel,
  .timeline-panel {
    padding: 21px 17px;
    border-radius: 22px;
  }

  .rhythm-panel .section-heading {
    display: block;
  }

  .rhythm-legend {
    margin-top: 10px;
  }

  .rhythm-chart {
    margin-right: -9px;
    margin-left: -9px;
  }

  .rhythm-track {
    height: 62px;
  }

  .timeline-panel .section-heading {
    display: block;
  }

  .timeline-filters {
    width: max-content;
    margin-top: 13px;
  }

  .timeline-filters button {
    min-height: var(--touch-target);
  }

  .timeline-item {
    grid-template-columns: 39px 34px minmax(0, 1fr);
    gap: 9px;
    padding: 13px 0;
  }

  .timeline-item::before {
    left: 64px;
  }

  .timeline-item > .icon-button {
    display: none;
  }

  .timeline-item time {
    font-size: 10px;
  }

  .timeline-item strong {
    font-size: 11px;
  }

  .timeline-item p {
    font-size: 8px;
  }

  .growth-teaser {
    grid-template-columns: 1fr 38px;
    gap: 10px;
    min-height: 180px;
    padding: 22px;
  }

  .mini-growth-chart {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .round-arrow {
    grid-column: 2;
    grid-row: 1;
    width: 38px;
    height: 38px;
  }

  .care-rail {
    position: static;
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    width: 100%;
    height: auto;
    padding: 20px 16px calc(112px + env(safe-area-inset-bottom));
    overflow: visible;
    border-top: 1px solid rgba(23,49,59,.08);
    background: rgba(233, 227, 215, 0.5);
  }

  .handoff-card {
    padding: 24px;
  }

  .handoff-card h2 {
    font-size: 22px;
  }

  .safety-card,
  .privacy-note {
    grid-column: auto;
  }

  .mobile-nav {
    position: fixed;
    right: 10px;
    bottom: max(10px, env(safe-area-inset-bottom));
    left: 10px;
    z-index: 80;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    height: 69px;
    padding: 7px 8px;
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 23px;
    color: rgba(255,255,255,.58);
    background: rgba(23, 49, 59, 0.94);
    box-shadow: 0 20px 50px rgba(23,49,59,.27);
    backdrop-filter: blur(18px);
  }

  .mobile-nav a,
  .mobile-nav button {
    position: relative;
    display: grid;
    min-width: 0;
    min-height: 52px;
    place-content: center;
    gap: 2px;
    border-radius: 16px;
    color: inherit;
    background: transparent;
    text-align: center;
  }

  .mobile-nav svg {
    width: 18px;
    height: 18px;
    margin: 0 auto;
  }

  .mobile-nav span {
    font-size: 8px;
  }

  .mobile-nav a.is-active {
    color: var(--surface);
  }

  .mobile-nav a.is-active::before {
    position: absolute;
    top: 1px;
    left: 50%;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--feed);
    content: '';
    transform: translateX(-50%);
  }

  .mobile-nav__record {
    color: var(--ink) !important;
  }

  .mobile-nav__record::before {
    position: absolute;
    inset: 2px 9px;
    z-index: -1;
    border-radius: 17px;
    background: var(--feed);
    content: '';
  }

  dialog {
    width: 100%;
    max-width: none;
    max-height: min(82dvh, 720px);
    margin: auto 0 0;
    border-width: 1px 0 0;
    border-radius: 28px 28px 0 0;
  }

  dialog[open] {
    animation-name: sheet-in;
  }

  #record-form {
    padding: 13px 19px calc(24px + env(safe-area-inset-bottom));
  }

  .dialog-close {
    min-width: var(--touch-target);
    min-height: var(--touch-target);
  }

  .dialog-handle {
    display: block;
    width: 40px;
    height: 4px;
    margin: 0 auto 17px;
    border-radius: 99px;
    background: var(--line);
  }

  .dialog-fields {
    gap: 10px;
  }

  .field input,
  .field select,
  .field textarea,
  .segmented-control label {
    min-height: 50px;
  }

  .toast {
    right: 16px;
    bottom: calc(92px + env(safe-area-inset-bottom));
    left: 16px;
    max-width: none;
    text-align: center;
  }

  @keyframes sheet-in {
    from { opacity: 0; transform: translateY(100%); }
    to { opacity: 1; transform: translateY(0); }
  }
}

@media (max-width: 390px) {
  #main-content {
    padding-inline: 13px;
  }

  .focus-card {
    padding-inline: 19px;
  }

  .quick-actions {
    gap: 7px;
  }

  .quick-action {
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 8px;
    padding: 9px;
  }

  .quick-action__icon {
    width: 40px;
    height: 40px;
  }

  .metric-strip {
    margin-right: -13px;
    padding-right: 13px;
  }

  .care-rail {
    padding-inline: 13px;
  }
}

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