:root {
  color-scheme: light;
  --paper: #edf5ff;
  --white: #fcfdff;
  --ink: #1b355f;
  --muted: #4c5d79;
  --line: #dbe7fa;
  --blue: #2256a0;
  --soft: #e7f0ff;
  --warm: #f5ece0;
  --amber: #6e4f30;
  --danger: #963b35;
  --shadow: 0 2px 5px #173f8310;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: #285aa325; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }
:focus-visible { outline: 3px solid #477dcc; outline-offset: 3px; }
[hidden] { display: none !important; }
p, h1, h2, h3 { margin: 0; }
p { line-height: 1.5; }
h1, h2 { font-family: ui-rounded, "Arial Rounded MT Bold", "Trebuchet MS", sans-serif; font-weight: 780; letter-spacing: -.035em; }
h1 { font-size: clamp(2.3rem, 5vw, 3.7rem); line-height: 1.06; }
h2 { font-size: clamp(1.55rem, 3vw, 2rem); line-height: 1.12; }
h3 { font-size: .98rem; }
small { font-size: .78rem; }
svg { flex: none; vertical-align: middle; }
.top { background: var(--white); border-bottom: 1px solid var(--line); }
.top-inner { max-width: 1112px; min-height: 72px; margin: auto; display: flex; align-items: center; gap: 24px; padding: 0 28px; }
.brand { display: inline-flex; align-items: center; gap: 11px; flex-shrink: 0; }
.brand > span { display: grid; gap: 2px; }
.brand small { font-size: .59rem; letter-spacing: .14em; font-weight: 760; color: var(--muted); }
.brand strong { font-size: 1.04rem; letter-spacing: -.02em; }
nav { display: flex; gap: 5px; margin-inline: auto; }
nav a { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 15px; min-height: 44px; border-radius: 10px; color: var(--muted); font-size: .9rem; font-weight: 650; }
nav a:hover, nav a[aria-current] { color: var(--blue); background: var(--soft); }
.top-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.language-toggle { min-width: 44px; min-height: 44px; padding: 5px; border: 0; border-radius: 8px; background: transparent; color: var(--blue); font-size: .72rem; font-weight: 750; }
.language-toggle:hover { background: var(--soft); }
.badge { background: var(--warm); color: var(--amber); display: inline-flex; gap: 6px; align-items: center; border-radius: 999px; padding: 7px 11px; white-space: nowrap; font-size: .76rem; font-weight: 730; }
main { max-width: 1112px; padding: 28px 28px 24px; margin: auto; }
.hero { position: relative; isolation: isolate; overflow: hidden; border-radius: 23px; padding: 30px 34px 34px; background: linear-gradient(105deg, #173f83 15%, #316bc1 100%); color: #fbfdff; }
.hero-art { position: absolute; right: 0; top: 50%; width: min(49%, 455px); transform: translateY(-50%); z-index: -1; }
.hero h1 { margin: 10px 0 9px; }
.hero-content { max-width: 66%; }
.bath-hero .button { margin-top: 8px; }
.eyebrow { display: flex; align-items: center; gap: 7px; font-size: .7rem; letter-spacing: .13em; font-weight: 800; color: #426195; }
.hero .eyebrow { color: #dfeeff; text-transform: uppercase; }
.section { margin-top: 26px; }
.section-title { display: flex; align-items: end; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.section-title .eyebrow { margin-bottom: 4px; }
.section-title p:not(.eyebrow) { margin-top: 5px; color: var(--muted); font-size: .92rem; }
.panel { background: var(--white); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.quick-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 14px; }
.quick { padding: 15px; }
.quick h3 { margin: 0 0 11px 2px; }
.feed-grid, .diaper-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tile { width: 100%; min-height: 54px; text-align: left; border: 1px solid #d3e4fb; border-radius: 11px; padding: 7px 10px; background: #edf5ff; color: #193c75; display: flex; align-items: center; gap: 8px; font-size: .87rem; font-weight: 720; }
.tile-copy { display: grid; gap: 3px; min-width: 0; }
.tile-last { font-size: .75rem; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.tile > svg:last-child { margin-left: auto; opacity: .75; }
.tile:hover { background: #deedff; border-color: #b4cef7; }
.tile.diaper { background: #faf0e4; color: #6d4e33; border-color: #f1e4d6; }
.tile.diaper .tile-last { color: var(--amber); }
.tile.diaper:hover { background: #f1e2d0; border-color: #dfcdb8; }
.tile.care { background: #e5f6ff; border-color: #cae8fa; }
.tile.care:hover { background: #d9f0ff; border-color: #a4d2ec; }
.tile-icon { display: grid; place-items: center; flex: none; width: 31px; height: 31px; background: #d4e7ff; border-radius: 8px; }
.diaper .tile-icon { background: #f0e2d1; }
.care .tile-icon, .event-icon.care { background: #d1efff; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stat { display: grid; grid-template-columns: 1fr auto; gap: 5px 7px; align-items: center; padding: 13px 14px; }
.stat strong { grid-column: 1; grid-row: 1; font-size: 1.55rem; letter-spacing: -.05em; }
.stat strong small { font-size: .83rem; letter-spacing: 0; }
.stat .event-icon { grid-column: 2; grid-row: 1; width: 33px; height: 33px; }
.stat p { grid-column: 1 / -1; font-size: .81rem; color: var(--muted); }
.event-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 11px; background: var(--soft); color: var(--blue); flex: none; }
.event-icon.diaper { background: var(--warm); color: var(--amber); }
.feed-counters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.feed-counter { padding: 13px 16px; border-top: 3px solid #89b7ef; }
.feed-counter h2 { display: flex; align-items: center; gap: 8px; font-size: 1rem; letter-spacing: 0; }
.feed-counter .event-icon { width: 30px; height: 30px; border-radius: 8px; }
.feed-meta { display: flex; align-items: start; flex-wrap: wrap; gap: 3px 10px; margin-top: 7px; color: var(--muted); font-size: .8rem; }
.feed-elapsed { margin-top: 7px; font-size: clamp(1.05rem, 3.5vw, 1.5rem); font-weight: 760; line-height: 1.16; font-variant-numeric: tabular-nums; }
.feed-meter { display: block; appearance: none; width: 100%; height: 9px; margin: 8px 0 5px; border: 0; border-radius: 999px; background: #dceafb; color: var(--blue); overflow: hidden; }
.feed-meter::-webkit-progress-bar { background: #dceafb; }
.feed-meter::-webkit-progress-value { background: linear-gradient(90deg, #4988d5, #2256a0); border-radius: 999px; }
.feed-meter::-moz-progress-bar { background: linear-gradient(90deg, #4988d5, #2256a0); border-radius: 999px; }
.feed-status { color: var(--blue); font-size: .8rem; font-weight: 730; line-height: 1.2; }
.feed-average { margin-bottom: 4px; color: var(--muted); font-size: .8rem; line-height: 1.2; }
.event { display: flex; align-items: start; gap: 12px; padding: 14px 16px; }
.event + .event { border-top: 1px solid var(--line); }
.event-body { flex: 1; min-width: 0; }
.event-body strong { display: block; margin-bottom: 2px; }
.event-body p, .event small { color: var(--muted); font-size: .84rem; }
.event-body .notes { white-space: pre-wrap; overflow-wrap: anywhere; }
.event-side { flex: none; display: flex; flex-direction: column; align-items: end; gap: 3px; }
.event time { font-size: .9rem; font-weight: 760; font-variant-numeric: tabular-nums; }
.row-actions { display: flex; gap: 3px; }
.page-heading { margin: 10px 0 22px; }
.page-heading h1 { margin: 6px 0 9px; }
.page-heading p:last-child { color: var(--muted); }
.controls, .report-controls { padding: 15px; margin-bottom: 19px; }
.controls { display: flex; align-items: end; flex-wrap: wrap; gap: 10px; }
.controls label { flex: 1 1 160px; }
label, legend { color: var(--ink); font-size: .86rem; font-weight: 720; }
label { display: grid; gap: 6px; min-width: 0; }
label small { color: var(--muted); font-weight: 500; }
input, select, textarea { width: 100%; min-width: 0; min-height: 44px; border: 1px solid #c4d4ed; background: #fff; color: var(--ink); border-radius: 9px; padding: 9px 10px; font-size: 16px; }
input[type=date], input[type=datetime-local] { -webkit-appearance: none; appearance: none; display: block; }
textarea { resize: vertical; }
fieldset { padding: 0; margin: 0; border: 0; }
legend { padding: 0; margin-bottom: 7px; }
.segmented, .export-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.segmented [aria-pressed=true] { background: var(--soft); color: var(--blue); border-color: #a4bff0; }
.overview-period { margin-bottom: 10px; }
.overview-period .button { flex: 1 1 0; max-width: 155px; text-align: center; padding-inline: 6px; }
.trend { margin-top: 12px; padding: 15px; }
.trend-header { display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.trend-header label { max-width: 100%; }
.trend-header p, .trend-empty { color: var(--muted); font-size: .81rem; }
.trend-header p { margin-top: 4px; }
.trend-empty { margin-top: 14px; padding: 10px 12px; border-radius: 9px; background: var(--paper); }
.trend-plot { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 8px; margin-top: 14px; }
.trend-scale { display: flex; flex-direction: column; justify-content: space-between; align-items: end; }
.trend-scale, .trend-axis { color: var(--muted); font-size: .72rem; font-variant-numeric: tabular-nums; }
.trend-bars, .trend-axis { display: grid; grid-template-columns: repeat(var(--point-count), minmax(0, 1fr)); gap: 3px; }
.trend-bars { height: 110px; border-block: 1px solid var(--line); background: linear-gradient(var(--line), var(--line)) center / 100% 1px no-repeat; }
.trend-column { display: flex; align-items: end; justify-content: center; }
.trend-bar { width: 80%; max-width: 38px; height: var(--bar-height); background: var(--blue); border-radius: 4px 4px 0 0; }
.trend-axis { grid-column: 2; }
.trend-axis span { justify-self: center; white-space: nowrap; }
.trend-axis span:first-child { justify-self: start; }
.trend-axis span:last-child { justify-self: end; }
.dates { padding: 0; margin: 13px 0 0; }
.history-group { margin: 20px 0; }
.history-group h2 { margin-bottom: 9px; font-size: 1.18rem; text-transform: capitalize; }
.history-group h2 small { color: var(--muted); font: 500 .82rem -apple-system, sans-serif; letter-spacing: 0; }
.button, .text-button, .icon-button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid #cad9ee; border-radius: 9px; background: var(--white); color: var(--blue); padding: 8px 12px; font-size: .85rem; font-weight: 720; }
.button:hover, .icon-button:hover { background: var(--soft); }
.button.primary { background: var(--blue); border-color: var(--blue); color: white; }
.button.primary:hover { background: #18458a; }
.button.danger { background: var(--danger); border-color: var(--danger); color: white; }
.button.danger:hover { background: #7a2a25; }
.button.quiet, .text-button { border-color: transparent; background: transparent; }
.button.quiet { padding: 5px 7px; }
.button.quiet:hover, .text-button:hover { background: var(--soft); }
.danger-text { color: var(--danger); }
.text-button { white-space: nowrap; }
.icon-button { width: 44px; padding: 0; }
.table-wrap { overflow-x: auto; margin-top: 12px; }
table { width: 100%; min-width: 645px; border-collapse: collapse; text-align: left; font-size: .87rem; font-variant-numeric: tabular-nums; }
th, td { padding: 12px; border-bottom: 1px solid var(--line); }
thead { background: var(--soft); }
tbody tr:nth-child(even) { background: #f4f8ff; }
tbody tr:last-child > * { border-bottom: 0; }
.table-note { margin: 8px 0 14px; color: var(--muted); font-size: .8rem; }
.empty { padding: 28px 14px; display: grid; justify-items: center; text-align: center; gap: 6px; }
.empty p, footer, .login > p:not(.eyebrow) { color: var(--muted); }
footer { margin: 20px 0 0; font-size: .78rem; line-height: 1.45; }
footer svg { margin-right: 3px; }
.notice { display: flex; align-items: center; gap: 9px; padding: 9px 12px; border-radius: 10px; margin-bottom: 14px; font-size: .87rem; }
.warning { background: var(--warm); color: var(--amber); }
.notice button { margin-left: auto; }
.loading, .login { max-width: 440px; padding: 25px; margin: 24px auto; }
.login > .event-icon { margin-bottom: 12px; }
.login h1 { font-size: 2.2rem; margin: 6px 0 10px; }
.login form { display: grid; gap: 13px; margin-top: 16px; }
dialog { color: var(--ink); background: var(--white); border: 1px solid var(--line); border-radius: 20px; width: min(465px, calc(100% - 24px)); max-height: min(88dvh, 760px); padding: 20px; box-shadow: 0 16px 80px #193c7548; }
dialog::backdrop { background: #193c7576; }
dialog h2 { margin: 4px 0 12px; }
.dialog-top { display: flex; justify-content: space-between; margin-bottom: 8px; }
.form-fields { display: grid; gap: 12px; }
.two-fields { display: flex; gap: 10px; }
.two-fields:empty, #fold-field:empty { display: none; }
.two-fields label { flex: 1; }
.optional { color: var(--muted); font-size: .75rem; font-weight: 500; }
.form-error { color: var(--danger); font-size: .87rem; margin: 10px 0; }
.form-error:empty { display: none; }
.save { width: 100%; margin-top: 15px; }
.dialog-actions { display: flex; justify-content: end; flex-wrap: wrap; gap: 8px; margin-top: 15px; }
.toast { position: fixed; z-index: 3; bottom: 24px; left: 50%; transform: translateX(-50%); padding: 11px 16px; display: none; align-items: center; gap: 8px; background: var(--blue); color: #fff; border-radius: 999px; box-shadow: 0 5px 25px #193c7544; white-space: nowrap; font-weight: 700; }
.toast.visible { display: flex; }
.toast { max-width: calc(100% - 24px); white-space: normal; }
@media (max-width: 1100px) {
  .top-inner { min-height: 60px; padding: 0 15px; gap: 8px; }
  .brand img { width: 37px; height: 37px; }
  nav { position: fixed; z-index: 2; bottom: 0; inset-inline: 0; margin: 0; background: var(--white); border-top: 1px solid var(--line); padding: 6px 10px calc(5px + env(safe-area-inset-bottom)); gap: 5px; }
  nav a { flex: 1; flex-direction: column; min-height: 49px; gap: 3px; padding: 5px 2px; min-width: 0; font-size: .68rem; }
  main { padding: 14px 14px calc(87px + env(safe-area-inset-bottom)); }
  .hero { padding: 20px 17px; border-radius: 17px; }
  .hero h1 { font-size: 2.25rem; }
  .hero-content { max-width: 62%; }
  .hero-art { width: min(66%, 320px); right: -10px; }
  .section { margin-top: 20px; }
  .quick-grid { grid-template-columns: 1fr; gap: 9px; }
  .quick { padding: 10px; }
  .quick h3 { margin-bottom: 7px; }
  .tile { min-height: 52px; padding-inline: 6px; gap: 5px; font-size: .81rem; }
  .tile-icon { width: 26px; height: 28px; }
  .tile-icon svg { width: 17px; height: 17px; }
  .tile > svg:last-child { width: 13px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .stat { padding: 9px 11px; }
  .feed-counters { gap: 7px; }
  .feed-counter { padding: 9px 10px; }
  .feed-counter h2 { gap: 5px; font-size: .88rem; }
  .feed-counter .event-icon { width: 25px; height: 25px; }
  .feed-counter .event-icon svg { width: 16px; height: 16px; }
  .event { padding: 11px 10px; gap: 8px; }
  .event .event-icon { width: 35px; height: 35px; }
  .row-actions { gap: 0; }
  .row-actions .button { font-size: .75rem; padding-inline: 4px; }
  .row-actions svg { width: 13px; }
  .toast { bottom: calc(78px + env(safe-area-inset-bottom)); }
}
@media (max-width: 350px) {
  .brand { gap: 6px; }
  .brand strong { font-size: .9rem; }
  .account .badge { padding-inline: 7px; }
  .row-actions svg { display: none; }
}
@media print {
  @page { margin: 14mm; }
  :root, body, .panel, th, td { background: white; color: black; box-shadow: none; }
  .top, .report-controls, .export-actions, .toast, footer, .notice { display: none !important; }
  main { max-width: none; padding: 0; }
  .page-heading { margin-top: 0; }
  .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .stat .event-icon { display: none; }
  .table-wrap { overflow: visible; }
  table { min-width: 0; }
  th, td { padding: 5px; }
  tr { break-inside: avoid; }
  thead { display: table-header-group; }
}

@media (max-width: 380px) { nav { gap: 0; padding-inline: 4px; } nav a { font-size: .63rem; } }
