/* Baby Log (Nov 26, 2026). Colors are the approved ones; night follows the phone, or the switch in Settings. */
:root {
  --ground: #FFFEFA; --text: #3B2630; --quiet: #6A5560; --outline: #D9C9CF; --panel: #FFFFFF; --rose: #8E3B52; --birth: #8E3B52;
  --pri-bg: #8E3B52; --pri-fg: #FFFFFF; --danger: #A23A2E; --focus: #8E3B52;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="day"]) { --ground: #171113; --text: #FFF6EF; --quiet: #B9A7AE; --outline: #4A3A42; --panel: #2A1F25; --birth: #F2938C; --pri-bg: #F2938C; --pri-fg: #171113; --danger: #FF9B8C; --focus: #F2938C; }
}
:root[data-theme="night"] { --ground: #171113; --text: #FFF6EF; --quiet: #B9A7AE; --outline: #4A3A42; --panel: #2A1F25; --birth: #F2938C; --pri-bg: #F2938C; --pri-fg: #171113; --danger: #FF9B8C; --focus: #F2938C; }

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--ground); color: var(--text); font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-text-size-adjust: 100%; }
body { overflow-x: hidden; touch-action: manipulation; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
/* Headings get focus only so a screen reader starts there; no ring that looks like a button. */
h1[tabindex="-1"]:focus, h2[tabindex="-1"]:focus { outline: none; }
[hidden] { display: none !important; }
.vh { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- the one screen ---------- */
.main { display: flex; flex-direction: column; height: 100vh; height: 100dvh; padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; min-height: 56px; }
.bar h1 { font-family: "Fraunces", Georgia, serif; font-weight: 600; font-size: 1.35rem; margin: 0; }
.wm { font-family: "Fraunces", Georgia, serif; font-weight: 600; font-size: 1.15rem; }
.wm .r { color: var(--birth); }
.pill { min-height: 44px; min-width: 64px; padding: 0 16px; border-radius: 22px; border: 1.5px solid var(--outline); background: var(--panel); font-weight: 600; cursor: pointer; }
.pill-space { min-width: 64px; }
.grid { flex: 1; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: repeat(3, 1fr); gap: 10px; padding: 0 12px; min-height: 0; }
.tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 44px; border-radius: 20px; border: 3px solid transparent; padding: 6px; cursor: pointer; background: var(--c-tile); color: var(--text); overflow: hidden; -webkit-tap-highlight-color: transparent; transition: transform .06s; }
.tile:active { transform: scale(.97); }
.tile .ic { width: 96px; height: 96px; color: var(--c-ink); flex: none; }
.tile .nm { font-size: 22px; font-weight: 700; line-height: 1.15; }
.tile .st { font-size: 14px; line-height: 1.3; color: var(--quiet); min-height: 1.3em; text-align: center; }
.tile.on { border-color: var(--c-ink); }
@media (max-height: 760px) { .tile .ic { width: 76px; height: 76px; } }
@media (max-height: 680px) { .tile .ic { width: 64px; height: 64px; } .tile .nm { font-size: 20px; } .bar { min-height: 52px; padding: 4px 12px; } }
.foot { position: relative; padding: 8px 12px 10px; min-height: 60px; display: flex; }
.undo { flex: 1; min-height: 44px; border-radius: 14px; border: 1.5px solid var(--outline); background: transparent; font-weight: 600; cursor: pointer; }
.toast { position: fixed; z-index: 40; left: calc(12px + env(safe-area-inset-left)); right: calc(12px + env(safe-area-inset-right)); bottom: calc(10px + env(safe-area-inset-bottom)); max-width: 616px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; padding: 4px 6px 4px 14px; border-radius: 14px; background: var(--panel); border: 1.5px solid var(--outline); font-weight: 600; }
.toast .tx { font-size: 15px; }
.toast .tl { min-height: 40px; padding: 0 14px; border-radius: 12px; border: 0; background: var(--pri-bg); color: var(--pri-fg); font-weight: 700; cursor: pointer; flex: none; }
.req { position: fixed; z-index: 25; top: calc(8px + env(safe-area-inset-top)); left: 8px; right: 8px; max-width: 560px; margin: 0 auto; padding: 10px 12px; box-shadow: 0 6px 24px rgba(23,17,19,.35); border-radius: 14px; background: var(--panel); border: 2px solid var(--birth); }
.req p { margin: 0 0 8px; }

/* night: dark tiles, each icon in its own bright color */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="day"]) .tile, :root:not([data-theme="day"]) .ri, :root:not([data-theme="day"]) .pick .btn { background: #2A1F25; }
  :root:not([data-theme="day"]) .tile .ic, :root:not([data-theme="day"]) .ri .ic, :root:not([data-theme="day"]) .pick .ic { color: var(--c-night); }
  :root:not([data-theme="day"]) .tile.on { border-color: var(--c-night); }
}
:root[data-theme="night"] .tile, :root[data-theme="night"] .ri, :root[data-theme="night"] .pick .btn { background: #2A1F25; }
:root[data-theme="night"] .tile .ic, :root[data-theme="night"] .ri .ic, :root[data-theme="night"] .pick .ic { color: var(--c-night); }
:root[data-theme="night"] .tile.on { border-color: var(--c-night); }

/* ---------- How much? ---------- */
.how { position: fixed; inset: 0; z-index: 20; background: var(--ground); display: flex; align-items: center; justify-content: center; padding: 16px; }
.how-in { width: 100%; max-width: 420px; }
.how h2 { font-family: "Fraunces", Georgia, serif; font-size: 2rem; text-align: center; margin: 0 0 16px; }
.how-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.amt { min-height: 76px; border-radius: 18px; border: 3px solid transparent; background: #D7F0F1; color: #3B2630; font-size: 22px; font-weight: 700; cursor: pointer; }
.amt.last { border-color: #177E86; }
:root[data-theme="night"] .amt { background: #2A1F25; color: #FFF6EF; }
:root[data-theme="night"] .amt.last { border-color: #62C3C9; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="day"]) .amt { background: #2A1F25; color: #FFF6EF; } :root:not([data-theme="day"]) .amt.last { border-color: #62C3C9; } }
.how-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.how-other { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.how-other output { flex: 1; text-align: center; font-size: 24px; font-weight: 700; }
.step { width: 56px; height: 56px; border-radius: 28px; border: 1.5px solid var(--outline); background: var(--panel); font-size: 28px; cursor: pointer; }
.how-note { text-align: center; color: var(--quiet); margin: 14px 0 0; }

/* ---------- pages ---------- */
.page { min-height: 100vh; padding-bottom: 40px; }
.page .bar { position: sticky; top: 0; background: var(--ground); z-index: 5; border-bottom: 1px solid var(--outline); padding-top: max(8px, env(safe-area-inset-top)); }
.body { max-width: 640px; margin: 0 auto; padding: 0 16px; }
.body section { padding: 18px 0; border-bottom: 1px solid var(--outline); }
.body h2 { font-family: "Fraunces", Georgia, serif; font-weight: 600; font-size: 1.3rem; margin: 0 0 10px; }
.body h3 { font-size: 1rem; margin: 14px 0 6px; }
.quiet { color: var(--quiet); }
.small { font-size: 14px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px; border-radius: 14px; border: 1.5px solid var(--outline); background: var(--panel); font-weight: 600; cursor: pointer; text-align: center; }
.btn.pri { background: var(--pri-bg); color: var(--pri-fg); border-color: var(--pri-bg); }
.btn.danger { color: var(--danger); border-color: var(--danger); }
.link { background: none; border: 0; padding: 10px 0; min-height: 44px; color: var(--birth); font-weight: 600; text-decoration: underline; cursor: pointer; }
.stack { display: grid; gap: 10px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.row .btn { flex: 1 1 140px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fld { display: grid; gap: 6px; margin: 10px 0; font-weight: 600; }
.fld input, .fld select, .fld textarea { min-height: 48px; padding: 8px 12px; border-radius: 12px; border: 1.5px solid #9C8491; background: var(--panel); font-weight: 400; width: 100%; max-width: 100%; }
.err { color: var(--danger); font-weight: 600; }
.filebtn { position: relative; overflow: hidden; }
.filebtn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; margin: 10px 0 0; }
.stats div { background: var(--panel); border: 1.5px solid var(--outline); border-radius: 14px; padding: 10px 12px; }
.stats dt { color: var(--quiet); font-size: 14px; }
.stats dd { margin: 2px 0 0; font-size: 22px; font-weight: 700; }
.log { list-style: none; margin: 0 0 12px; padding: 0; }
.logrow { display: grid; grid-template-columns: 40px auto 1fr auto; align-items: center; gap: 10px; width: 100%; min-height: 56px; padding: 6px 4px; border: 0; border-bottom: 1px solid var(--outline); background: none; text-align: left; cursor: pointer; }
.logrow small { display: block; color: var(--quiet); font-size: 13px; font-weight: 400; }
.lt { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.lw { font-weight: 600; min-width: 0; }
.lb { color: var(--quiet); font-size: 14px; text-align: right; max-width: 110px; overflow-wrap: anywhere; }
.ri { display: inline-flex; width: 40px; height: 40px; border-radius: 12px; background: var(--c-tile); align-items: center; justify-content: center; }
.ri .ic { width: 28px; height: 28px; color: var(--c-ink); }
.scroll { overflow-x: auto; }
/* Seven days: all seven columns on a phone without sideways scrolling. */
.scroll .tbl th, .scroll .tbl td { padding: 7px 3px; font-size: 13px; }
.scroll .tbl thead th { font-size: 11px; white-space: normal; vertical-align: bottom; }
@media (max-width: 380px) { .scroll .tbl th, .scroll .tbl td { padding: 7px 2px; font-size: 12px; } .body { padding: 0 12px; } }
.tbl { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; margin-top: 8px; }
.tbl th, .tbl td { padding: 8px 6px; border-bottom: 1px solid var(--outline); text-align: right; white-space: nowrap; font-size: 15px; }
.tbl th:first-child, .tbl td:first-child { text-align: left; }
.tbl thead th { color: var(--quiet); font-weight: 600; font-size: 13px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { min-height: 44px; padding: 0 16px; border-radius: 22px; border: 1.5px solid var(--outline); background: var(--panel); cursor: pointer; font-weight: 600; }
.code { text-align: center; margin: 12px 0; }
.code-t { display: inline-block; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 22px; font-weight: 700; letter-spacing: 1px; padding: 10px 14px; border-radius: 12px; background: var(--panel); border: 1.5px solid var(--outline); }
.qr { width: 180px; margin: 0 auto; background: #FFFFFF; border-radius: 12px; padding: 6px; }
.qr svg { display: block; width: 100%; height: auto; }
.phones { list-style: none; padding: 0; margin: 0 0 10px; }
.phones li { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--outline); min-height: 48px; }
.phones small { color: var(--quiet); }
.steps { padding-left: 1.3em; line-height: 1.5; }
.steps li { margin: 6px 0; }
details.del { margin-top: 14px; }
details.del summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 600; color: var(--danger); }

/* ---------- sheets ---------- */
.sheet { position: fixed; inset: 0; z-index: 30; background: rgba(23, 17, 19, .55); display: flex; align-items: flex-end; justify-content: center; }
.sheet-in { width: 100%; max-width: 560px; max-height: 92vh; overflow: auto; background: var(--ground); border-radius: 20px 20px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); }
.sheet h2 { font-family: "Fraunces", Georgia, serif; font-size: 1.4rem; margin: 0 0 8px; }
.pick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pick .btn { background: var(--c-tile); justify-content: flex-start; color: var(--text); }
.pick .ic { width: 32px; height: 32px; color: var(--c-ink); }
.noscript { padding: 20px; }
