:root {
  --paper: #f8f3e8;
  --paper-deep: #efe5d3;
  --ink: #33473e;
  --muted: #788078;
  --line: #d8cdbb;
  --sage: #8fae9e;
  --mint: #d9e8df;
  --peach: #e9a98f;
  --blush: #f4d7ca;
  --lavender: #d8cce3;
  --yellow: #f0d98d;
  --white: rgba(255, 255, 255, 0.74);
  --shadow: 0 18px 50px rgba(75, 62, 42, 0.09);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--paper); color: var(--ink); font-family: ui-rounded, "SF Pro Rounded", "Nunito", system-ui, sans-serif; }
body { margin: 0; min-height: 100vh; }
button, input, select { font: inherit; }
button { color: inherit; }
.paper-noise { position: fixed; inset: 0; pointer-events: none; opacity: .36; background-image: radial-gradient(#b5a98f 0.65px, transparent 0.7px); background-size: 18px 18px; }

.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; min-height: 66px; padding: 10px max(24px, calc((100vw - 1240px) / 2)); border-bottom: 1px solid rgba(154, 140, 115, .22); background: rgba(248, 243, 232, .87); backdrop-filter: blur(18px); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-size: 20px; font-weight: 800; text-decoration: none; letter-spacing: -.03em; }
.mini-mark, .brand-mark { display: grid; place-items: center; border-radius: 44% 56% 48% 52%; color: white; background: var(--peach); transform: rotate(-4deg); box-shadow: inset 0 0 0 2px rgba(255,255,255,.45); }
.mini-mark { width: 34px; height: 34px; font-size: 14px; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.updated { color: var(--muted); font-size: 12px; }
.icon-button, .text-button { border: 1px solid var(--line); background: rgba(255,255,255,.66); border-radius: 12px; cursor: pointer; min-height: 38px; }
.icon-button { width: 38px; font-size: 20px; }
.text-button { padding: 0 14px; font-size: 13px; font-weight: 700; }
.icon-button:hover, .text-button:hover { background: white; transform: translateY(-1px); }

.page { position: relative; width: min(1240px, calc(100% - 40px)); margin: 0 auto; padding: 38px 0 54px; }
.hero { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 22px; margin-bottom: 42px; padding: 28px; border: 1px solid rgba(150, 134, 104, .28); border-radius: 28px; background: linear-gradient(135deg, rgba(255,255,255,.84), rgba(249,226,215,.58)); box-shadow: var(--shadow); }
.baby-portrait { width: 88px; height: 88px; display: grid; place-items: center; overflow: hidden; border-radius: 42% 58% 52% 48%; color: white; background: var(--sage); font-size: 30px; transform: rotate(-2deg); border: 4px solid rgba(255,255,255,.8); }
.baby-portrait img { width: 100%; height: 100%; object-fit: cover; transform: rotate(2deg) scale(1.05); }
.hero-copy h1 { margin: 2px 0 5px; font-family: "Bradley Hand", "Noteworthy", cursive; font-size: clamp(32px, 4vw, 48px); line-height: 1; letter-spacing: -.04em; }
.eyebrow, .kicker { margin: 0; color: #9d6e5d; font-size: 11px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.subtitle { margin: 0; color: var(--muted); font-size: 14px; }
.period-control { display: flex; padding: 5px; border-radius: 15px; background: rgba(236,226,208,.68); }
.period-control button { padding: 9px 12px; border: 0; border-radius: 11px; background: transparent; color: var(--muted); cursor: pointer; font-size: 12px; font-weight: 750; white-space: nowrap; }
.period-control button.active { color: var(--ink); background: white; box-shadow: 0 4px 14px rgba(76,64,45,.08); }

.section-heading, .panel-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.section-heading { margin-bottom: 15px; }
h2 { margin: 3px 0 0; font-size: 23px; letter-spacing: -.035em; }
.section-note { margin: 0; color: var(--muted); font-size: 13px; }
.metric-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 13px; margin-bottom: 30px; }
.metric { min-height: 140px; padding: 18px; border: 1px solid rgba(143,126,96,.21); border-radius: 21px; background: var(--white); box-shadow: 0 10px 30px rgba(83,71,51,.055); }
.metric-icon { width: 38px; height: 38px; display: grid; place-items: center; margin-bottom: 16px; border-radius: 13px; font-size: 18px; }
.metric.feed .metric-icon { background: var(--blush); }
.metric.bottle .metric-icon { background: #dbe8ef; }
.metric.pee .metric-icon { background: var(--mint); }
.metric.poop .metric-icon { background: var(--yellow); }
.metric.pump .metric-icon { background: var(--lavender); }
.metric-value { font-size: 27px; font-weight: 850; letter-spacing: -.04em; }
.metric-label { margin-top: 2px; color: var(--muted); font-size: 12px; }
.metric-detail { margin-top: 8px; color: #68736c; font-size: 11px; line-height: 1.4; }

.two-column { display: grid; grid-template-columns: 1.2fr .8fr; gap: 16px; margin-bottom: 16px; }
.panel { padding: 23px; border: 1px solid rgba(143,126,96,.22); border-radius: 24px; background: var(--white); box-shadow: 0 12px 34px rgba(83,71,51,.055); }
.source-badge, .entry-count { padding: 6px 10px; border-radius: 999px; background: var(--mint); color: #557063; font-size: 10px; font-weight: 800; letter-spacing: .04em; }
.guidance-list { display: grid; gap: 10px; margin-top: 18px; }
.guidance-item { display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: start; padding: 12px; border-radius: 16px; background: rgba(248,243,232,.7); }
.guidance-state { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--mint); font-weight: 900; }
.guidance-item.attention .guidance-state { background: #f6ddb3; }
.guidance-item.caution .guidance-state { background: #f3c3bc; }
.guidance-item h3 { margin: 0 0 3px; font-size: 14px; }
.guidance-item p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.guidance-item a { color: #597665; }
.clinical-note { margin: 15px 2px 0; color: var(--muted); font-size: 10px; line-height: 1.45; }

.growth-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 0; }
.growth-stat { padding: 15px; border-radius: 17px; background: rgba(216,204,227,.38); }
.growth-stat span { display: block; color: var(--muted); font-size: 11px; }
.growth-stat strong { display: block; margin-top: 4px; font-size: 20px; }
.growth-list { display: grid; gap: 1px; }
.growth-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 10px 3px; border-bottom: 1px dashed var(--line); font-size: 12px; }
.growth-row span { color: var(--muted); }
.empty { padding: 26px 12px; color: var(--muted); text-align: center; font-size: 13px; }

.trend-panel { margin-bottom: 16px; }
.legend { display: flex; gap: 13px; color: var(--muted); font-size: 10px; font-weight: 700; }
.legend span::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 5px; border-radius: 50%; }
.feed-dot::before { background: var(--peach); }.pee-dot::before { background: var(--sage); }.poop-dot::before { background: var(--yellow); }
.trend-chart { display: grid; grid-template-columns: repeat(7, 1fr); gap: 12px; min-height: 210px; margin-top: 20px; padding-top: 8px; border-bottom: 1px solid var(--line); }
.chart-day { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; min-width: 0; }
.bars { height: 155px; display: flex; align-items: flex-end; justify-content: center; gap: 4px; }
.bar { width: clamp(8px, 2vw, 18px); min-height: 3px; border-radius: 7px 7px 2px 2px; position: relative; }
.bar.feed { background: var(--peach); }.bar.pee { background: var(--sage); }.bar.poop { background: var(--yellow); }
.bar span { position: absolute; top: -16px; left: 50%; transform: translateX(-50%); color: var(--muted); font-size: 9px; }
.chart-label { margin: 9px 0 -19px; color: var(--muted); font-size: 10px; }

.timeline-heading { margin-bottom: 10px; }
.timeline-list { margin-left: 14px; border-left: 2px solid rgba(143,174,158,.55); }
.day-heading { margin: 22px 0 10px -10px; display: flex; align-items: center; gap: 10px; color: #66766e; font-size: 12px; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
.day-heading::before { content: ""; width: 16px; height: 16px; flex: 0 0 auto; border: 3px solid rgba(255,255,255,.9); border-radius: 50%; background: var(--peach); box-shadow: 0 0 0 1px var(--peach); }
.timeline-entry { display: grid; grid-template-columns: 66px 1fr; gap: 14px; padding: 8px 0 8px 18px; position: relative; }
.timeline-entry::before { content: ""; position: absolute; left: -5px; top: 19px; width: 8px; height: 8px; border-radius: 50%; background: var(--sage); border: 1px solid white; }
.entry-time { padding-top: 8px; color: var(--muted); font-variant-numeric: tabular-nums; font-size: 12px; }
.entry-card { padding: 11px 13px; border-radius: 15px; background: rgba(255,255,255,.78); border: 1px solid rgba(143,126,96,.17); }
.entry-title { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 800; }
.entry-title .glyph { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 9px; }
.entry-detail { margin: 5px 0 0 34px; color: #66736c; font-size: 12px; line-height: 1.4; }
.entry-note { margin: 5px 0 0 34px; color: #92705f; font-size: 11px; font-style: italic; }
.feeding .glyph { background: var(--blush); }.pumping .glyph { background: var(--lavender); }.diaper .glyph { background: var(--mint); }.supplement .glyph { background: var(--yellow); }

footer { display: flex; justify-content: space-between; gap: 24px; padding: 28px 5px 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
footer p { margin: 0; } footer nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 12px; } footer a { color: #657b70; }

.access-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.access-card { position: relative; width: min(480px, 100%); padding: 38px 46px; border-radius: 30px; border: 1px solid rgba(143,126,96,.25); background: rgba(255,255,255,.73); box-shadow: var(--shadow); text-align: center; }
.brand-mark { width: 74px; height: 74px; margin: 0 auto 20px; font-size: 26px; }
.access-card h1 { margin: 8px 0 12px; font-family: "Bradley Hand", "Noteworthy", cursive; font-size: 46px; }
.access-card h2 { margin: 0 0 8px; font-size: 21px; }
.access-card p { color: var(--muted); line-height: 1.6; }
.google-sign-in { display: flex; justify-content: center; margin: 24px 0 18px; min-height: 44px; }
.login-status { margin: 5px 0 0; color: var(--ink) !important; font-size: 14px; font-weight: 750; }
.login-retry { margin-top: 10px; min-height: 42px; padding: 0 18px; border: 1px solid var(--line); border-radius: 13px; background: white; color: var(--ink); cursor: pointer; font-weight: 750; }
.login-retry:hover { transform: translateY(-1px); box-shadow: 0 5px 16px rgba(83,71,51,.08); }
.privacy-note { margin-top: 18px; font-size: 11px; }
.language-setting { position: relative; z-index: 21; display: flex; justify-content: flex-end; align-items: center; gap: 10px; padding: 12px 24px; font-size: 12px; color: var(--muted); }
select { border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px; color: var(--ink); background: #fffaf3; min-height: 40px; }
button:focus-visible, select:focus-visible, a:focus-visible { outline: 3px solid #577d6b; outline-offset: 3px; }
.access-shell { min-height: calc(100vh - 64px); }
.google-sign-in { min-height: 48px; }
.insights-section { margin: 36px 0 28px; }
.insight-summary { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; margin: 18px 0; }
.insight-summary article { padding: 20px; border: 1px solid #d8cdbb; border-radius: 20px; background: #e7eee6; }
.insight-summary p { margin: 0 0 12px; font-size: 13px; color: #556c5f; }
.insight-summary strong { display: block; font-size: 30px; letter-spacing: -.04em; }
.insight-summary small { display: block; margin-top: 10px; line-height: 1.6; color: #626c63; }
.insight-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.insight-grid article { min-width: 0; }
.insight-grid h3 { margin: 0; font-size: 19px; }
.chart-caption, .chart-description { color: #69746b; font-size: 12px; line-height: 1.6; }
.chart-caption { min-height: 38px; margin: 8px 0 12px; }
.insight-grid svg { width: 100%; height: auto; overflow: visible; }
.insight-grid svg text { fill: #69746b; font: 12px system-ui, sans-serif; }
.grid-line { stroke: #ded7cb; stroke-dasharray: 3 5; }
.interval-line, .weight-line { stroke: #719480; stroke-width: 2; fill: none; }
.range-line { stroke: #afc6b6; stroke-width: 7; stroke-linecap: round; }
.interval-point, .weight-point { fill: #4d7560; stroke: #fff; stroke-width: 1.5; }
.hour-bar { fill: #dfa184; }
.data-warning { background: #f8e2be; padding: 14px; border-radius: 12px; font-size: 13px; }
.chart-data { font-size: 12px; color: #556c5f; margin: 12px 0; }
.chart-data summary { cursor: pointer; padding: 8px 0; }
.table-scroll { max-height: 260px; overflow: auto; }
.chart-data table { border-collapse: collapse; width: 100%; text-align: left; white-space: nowrap; }
.chart-data th, .chart-data td { padding: 8px; border-bottom: 1px solid #e3dccf; }
.trend-chart { margin-bottom: 26px; }

@media (max-width: 900px) {
  .insight-grid { grid-template-columns: 1fr; }
  .hero { grid-template-columns: auto 1fr; }
  .period-control { grid-column: 1 / -1; overflow-x: auto; }
  .period-control button { flex: 1; }
  .metric-grid { grid-template-columns: repeat(3, 1fr); }
  .two-column { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .insight-summary { grid-template-columns: 1fr; }
  .insight-summary article { padding: 16px; }
  .insight-summary strong { font-size: 26px; }
  .panel-heading { flex-wrap: wrap; }
  .language-setting { padding-inline: 14px; }
  .access-card { padding: 32px 22px; }
  .page { width: min(100% - 24px, 1240px); padding-top: 20px; }
  .topbar { padding-inline: 14px; }.updated { display: none; }.text-button { padding-inline: 10px; }
  .hero { padding: 19px; gap: 14px; border-radius: 22px; }.baby-portrait { width: 66px; height: 66px; }.hero-copy h1 { font-size: 31px; }
  .period-control button { padding-inline: 9px; font-size: 10px; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); gap: 9px; }.metric { min-height: 128px; padding: 15px; }.metric:last-child { grid-column: 1 / -1; }
  .panel { padding: 17px; border-radius: 20px; }.source-badge { display: none; }
  .trend-chart { gap: 5px; }.bars { gap: 2px; }.bar { width: 9px; }
  .timeline-entry { grid-template-columns: 45px 1fr; gap: 7px; padding-left: 14px; }.entry-detail, .entry-note { margin-left: 0; }.timeline-panel { padding-right: 11px; }
  footer { flex-direction: column; } footer nav { justify-content: flex-start; }
}
@media print {
  .paper-noise, .top-actions, .period-control, .language-setting, #insight-range { display: none !important; }
  .topbar { position: static; background: white; }.page { width: 100%; padding: 20px; }.panel, .hero, .metric { box-shadow: none; break-inside: avoid; }
  .timeline-entry { break-inside: avoid; } body { background: white; }
}
