/* Nara-style: cream page, white cards with a colored header band, serif
   titles, dark-green accent. Band colors are decorative (a text title always
   sits on them); the --m-* "mark" colors are the chart/icon colors and were
   validated (lightness band, chroma floor, >=3:1 vs the card) per mode. */
:root {
  --bg: #fbf7f1; --card: #ffffff; --ink: #2e4a3b; --ink-2: #5d6f64; --muted: #8c978f;
  --line: #ece5da; --accent: #3e5c4a; --on-accent: #ffffff; --shadow: 0 2px 10px rgba(46, 74, 59, .08);
  --b-sleep: #c9dcf2; --b-feed: #f4cf57; --b-pump: #d9a39e; --b-diaper: #bfe0c9; --b-first: #b9dfe6; --b-growth: #c8e3a3; --b-health: #cdd0f0; --b-routine: #e0cdf2;
  --m-sleep: #4a82cc; --m-feed: #b07f06; --m-pump: #b85a50; --m-diaper: #2f9a5c; --m-growth: #4f8a2b;
  --blob-sleep: #c9dcf2; --blob-feed: #f6d86f; --blob-pump: #e6bab6; --blob-diaper: #c9e6d2; --blob-first: #bfe2e8; --blob-growth: #d3eab4; --blob-health: #d8daf4; --blob-routine: #e6d5f5;
  --warn: #b7791f; --bad: #b23b3b; --tex: #e3dccd;
  --serif: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", Georgia, serif;
  --sans: -apple-system, "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #151a17; --card: #1e2521; --ink: #e8efe9; --ink-2: #b6c2ba; --muted: #8e9b92;
    --line: #2e3832; --accent: #8fb89c; --on-accent: #10231a; --shadow: none; --tex: #6b6456;
    --b-sleep: #2c3e57; --b-feed: #5b4a14; --b-pump: #553230; --b-diaper: #25432f; --b-first: #22474e; --b-growth: #3a4a24; --b-health: #34365a; --b-routine: #45345a;
    --m-sleep: #5a8fd8; --m-feed: #b8860b; --m-pump: #cc6258; --m-diaper: #35a266; --m-growth: #6aa33f;
    --blob-sleep: #2c3e57; --blob-feed: #5b4a14; --blob-pump: #553230; --blob-diaper: #25432f; --blob-first: #22474e; --blob-growth: #3a4a24; --blob-health: #34365a; --blob-routine: #45345a;
  }
}
:root[data-theme="dark"] {
  --bg: #151a17; --card: #1e2521; --ink: #e8efe9; --ink-2: #b6c2ba; --muted: #8e9b92;
  --line: #2e3832; --accent: #8fb89c; --on-accent: #10231a; --shadow: none; --tex: #6b6456;
  --b-sleep: #2c3e57; --b-feed: #5b4a14; --b-pump: #553230; --b-diaper: #25432f; --b-first: #22474e; --b-growth: #3a4a24; --b-health: #34365a; --b-routine: #45345a;
  --m-sleep: #5a8fd8; --m-feed: #b8860b; --m-pump: #cc6258; --m-diaper: #35a266; --m-growth: #6aa33f;
  --blob-sleep: #2c3e57; --blob-feed: #5b4a14; --blob-pump: #553230; --blob-diaper: #25432f; --blob-first: #22474e; --blob-growth: #3a4a24; --blob-health: #34365a; --blob-routine: #45345a;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.4 var(--sans); }
html { overscroll-behavior-y: contain; } /* our pull-to-refresh, not the browser's reload */
.ptr { position: fixed; top: env(safe-area-inset-top); left: 50%; z-index: 6; transform: translate(-50%, -56px);
  display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; white-space: nowrap;
  background: var(--card); color: var(--ink-2); box-shadow: 0 2px 10px rgba(0, 0, 0, .14); font-size: 14px;
  pointer-events: none; transition: transform .2s; }
.ptr.drag { transition: none; }
.ptr i { width: 16px; height: 16px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; flex: none; }
.ptr.busy i { animation: spin .8s linear infinite; }
.ptr.done i { border-color: var(--accent); }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ptr, .ptr.busy i { transition: none; animation: none; } }
body { padding: env(safe-area-inset-top) 0 0; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
[hidden] { display: none !important; }
main { max-width: 560px; margin: 0 auto; padding: 4px 16px calc(96px + env(safe-area-inset-bottom)); }

/* --- header ------------------------------------------------------------ */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  max-width: 560px; margin: 0 auto; padding: 14px 16px 10px; }
.baby { display: flex; align-items: center; gap: 12px; min-width: 0; }
.avatar { width: 56px; height: 56px; border-radius: 50%; background: var(--card); border: 1px solid var(--line);
  display: grid; place-items: center; flex: none; }
.avatar svg { width: 40px; height: 40px; fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; }
.top h1 { font: 600 26px/1.1 var(--serif); margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.date { color: var(--ink-2); font-size: 14px; margin-top: 3px; }
.top-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.pill { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 7px 14px; font-size: 14px; }
.sync { width: 36px; height: 36px; display: grid; place-items: center; }
.sync span { width: 10px; height: 10px; border-radius: 50%; background: var(--m-diaper); }
.sync.pending span { background: var(--warn); }
.sync.offline span { background: var(--bad); }

/* --- activity cards ---------------------------------------------------- */
.card { background: var(--card); border-radius: 18px; box-shadow: var(--shadow); border: 1px solid var(--line);
  margin-bottom: 16px; overflow: visible; }
.band { position: relative; height: 56px; border-radius: 17px 17px 0 0; padding: 0 18px; display: flex; align-items: center; }
.band h2 { font: 600 24px/1 var(--serif); margin: 0; }
.c-sleep .band { background: var(--b-sleep); } .c-feed .band { background: var(--b-feed); }
.c-pump .band { background: var(--b-pump); } .c-diaper .band { background: var(--b-diaper); }
.c-first .band { background: var(--b-first); }
.c-growth .band { background: var(--b-growth); } .c-health .band { background: var(--b-health); }
.c-routine .band { background: var(--b-routine); }
.plus { position: absolute; right: 16px; bottom: -26px; width: 52px; height: 52px; border-radius: 50%;
  background: var(--accent); display: grid; place-items: center; box-shadow: 0 2px 6px rgba(0,0,0,.18); z-index: 1; }
.plus svg { width: 22px; height: 22px; stroke: var(--on-accent); stroke-width: 2.6; stroke-linecap: round; fill: none; }
.plus:active { transform: scale(.94); }
.cbody { display: flex; align-items: center; gap: 14px; padding: 32px 18px 18px; min-height: 112px; }
.ico { width: 56px; height: 56px; flex: none; }
.ico svg, .dot svg { width: 100%; height: 100%; fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ico .blob, .dot .blob { stroke: none; }
.c-sleep .blob { fill: var(--blob-sleep); } .c-feed .blob { fill: var(--blob-feed); }
.c-pump .blob { fill: var(--blob-pump); } .c-diaper .blob { fill: var(--blob-diaper); }
.c-first .blob { fill: var(--blob-first); }
.c-growth .blob { fill: var(--blob-growth); } .c-health .blob { fill: var(--blob-health); }
.c-routine .blob { fill: var(--blob-routine); }
.info { flex: 1; min-width: 0; }
.info .k { font: 500 19px/1.3 var(--serif); }
.info .v { color: var(--ink-2); font-size: 14px; margin-top: 4px; }
.big { flex: none; text-align: right; font: 500 40px/1 var(--serif); }
.big small { font: 400 14px var(--sans); color: var(--ink-2); margin-left: 3px; }
.big .cap { display: block; font: 400 12px var(--sans); color: var(--muted); margin-top: 4px; }
.timer { font-variant-numeric: tabular-nums; }
.runrow { display: flex; gap: 8px; padding: 0 18px 16px; }
.runrow button { flex: 1; border-radius: 12px; padding: 12px; font-weight: 600; background: var(--bg); border: 1px solid var(--line); }
.runrow button.stop { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.more { display: flex; justify-content: space-between; align-items: center; width: 100%; border-top: 1px solid var(--line);
  padding: 13px 18px; color: var(--ink-2); font-size: 14px; }
.more .chev, .xlink .chev, .xlist .chev { color: var(--muted); font-size: 18px; line-height: 1; }
/* 查看更多: the entries, inside the card */
.xsum { padding: 8px 18px; font-size: 13px; color: var(--ink-2); background: var(--bg); border-top: 1px solid var(--line); }
.xlist { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.xlist li { display: flex; align-items: center; gap: 12px; padding: 10px 18px; border-bottom: 1px solid var(--line); cursor: pointer; }
.xlist li.empty { cursor: default; justify-content: center; color: var(--muted); }
.xlist .dot { width: 32px; height: 32px; flex: none; }
.xlist .d { flex: 1; min-width: 0; font-size: 15px; }
.xlist .xt { font-variant-numeric: tabular-nums; color: var(--ink-2); margin-right: 8px; }
.xrow { display: flex; align-items: center; gap: 8px; margin-top: 5px; }
.xbar { display: block; flex: none; height: 6px; border-radius: 3px; }
.chev.down { display: inline-block; transform: rotate(90deg); }
.chev.up { display: inline-block; transform: rotate(-90deg); }
.xml { font-size: 14px; color: var(--ink-2); }
.xlink { display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 13px 18px; color: var(--ink-2); font-size: 14px; }

/* --- tab bar ----------------------------------------------------------- */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; display: flex; justify-content: space-around;
  background: var(--card); border-top: 1px solid var(--line); padding: 6px 0 calc(6px + env(safe-area-inset-bottom)); }
.tabbar > button { flex: 1; max-width: 140px; display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: 12px; color: var(--muted); padding: 4px 0; }
.tabbar > button svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabbar > button.on { color: var(--accent); font-weight: 600; }

/* --- history ----------------------------------------------------------- */
.tab-title { font: 600 20px var(--serif); margin: 6px 0 12px; }
.daynav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.daynav h2 { font: 600 20px var(--serif); margin: 0; }
.daynav button { font-size: 28px; padding: 4px 16px; color: var(--ink); }
.daynav button:disabled { opacity: .25; }
.totals { background: var(--card); border: 1px solid var(--line); border-radius: 16px; margin-bottom: 12px; overflow: hidden; }
.totals .empty { padding: 18px; margin: 0; }
.srow { display: flex; align-items: flex-start; gap: 12px; width: 100%; text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.srow:last-child { border-bottom: 0; }
.srow.on { background: var(--bg); box-shadow: inset 3px 0 0 var(--accent); }
.srow .dot { width: 32px; height: 32px; flex: none; }
.srow .d { flex: 1; min-width: 0; font-size: 14px; color: var(--ink-2); line-height: 1.45; }
.srow .d b { display: block; color: var(--ink); font: 600 16px var(--serif); }
.undo { position: fixed; left: 16px; right: 16px; bottom: calc(84px + env(safe-area-inset-bottom)); max-width: 528px; margin: 0 auto;
  z-index: 15; display: flex; justify-content: space-between; align-items: center; gap: 12px;
  background: var(--ink); color: var(--bg); border-radius: 12px; padding: 12px 16px; box-shadow: 0 4px 14px rgba(0,0,0,.2); }
.undo button { color: var(--b-feed); font-weight: 700; font-size: 16px; padding: 2px 4px; }
.crow button.done { font-size: 22px; padding: 4px 8px; }
.chips { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 6px; padding-bottom: 2px; }
.chip { flex: none; border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 6px 14px; font-size: 14px; }
.chip.on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { display: flex; gap: 12px; align-items: center; padding: 10px 2px; border-bottom: 1px solid var(--line); }
.timeline .t { width: 48px; color: var(--ink-2); font-variant-numeric: tabular-nums; font-size: 15px; }
.timeline .dot { width: 36px; height: 36px; flex: none; }
.timeline .d { flex: 1; min-width: 0; }
.timeline .d small { color: var(--muted); display: block; font-size: 12px; }
.timeline .d .note { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  color: var(--ink-2); font-size: 13px; white-space: pre-wrap; margin-top: 2px; }
.empty { color: var(--muted); text-align: center; padding: 28px 0; }

/* --- trends ------------------------------------------------------------ */
.chart { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px 14px 8px;
  margin-bottom: 12px; position: relative; }
.chart h3 { margin: 0; font-size: 15px; font-weight: 600; }
.chart .sub { color: var(--ink-2); font-size: 13px; margin: 2px 0 6px; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 11px; }
.chart .axis.today { fill: var(--ink); font-weight: 600; }
.chart .val { fill: var(--ink); font-size: 11px; font-weight: 600; }
.chart .hit { fill: transparent; cursor: pointer; outline: none; }
.chart .hit:focus-visible { stroke: var(--ink); stroke-width: 1; }
.bar-sleep { fill: var(--m-sleep); } .bar-feed { fill: var(--m-feed); }
.bar-pump { fill: var(--m-pump); } .bar-diaper { fill: var(--m-diaper); }
.chart g.col.hot path { opacity: .75; }
.tip { position: fixed; z-index: 20; background: var(--ink); color: var(--bg); border-radius: 8px; padding: 6px 10px;
  font-size: 13px; pointer-events: none; transform: translate(-50%, calc(-100% - 8px)); white-space: nowrap; }
.tip b { font-size: 15px; }
.datatable summary { cursor: pointer; color: var(--ink-2); font-size: 14px; }
.datatable table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 13px; }
.datatable th, .datatable td { padding: 6px 4px; text-align: right; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.datatable th:first-child, .datatable td:first-child { text-align: left; }
.datatable th { color: var(--ink-2); font-weight: 500; }

/* --- family / panels --------------------------------------------------- */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; margin-bottom: 12px; }
.panel h3 { margin: 0 0 10px; font: 600 18px var(--serif); }
.field { display: flex; align-items: center; gap: 12px; font-size: 15px; color: var(--ink-2); }
.field input { flex: 1; min-width: 0; font: inherit; font-size: 17px; color: var(--ink); padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.hint { color: var(--muted); font-size: 13px; margin: 8px 0 0; }
.members { list-style: none; margin: 0; padding: 0; }
.members li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.members .sub { display: block; }
.kv { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.kv > span { color: var(--ink-2); font-size: 15px; width: 3em; flex: none; }
.kv > b { flex: 1; min-width: 0; font-weight: 500; font-size: 17px; }
.editbtn { flex: none; border: 1.5px solid var(--accent); color: var(--accent); border-radius: 999px; padding: 5px 14px; font-size: 14px; font-weight: 600; }
.fhead.c-family { background: var(--line); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; color: var(--ink); margin: 12px 0 4px; }
.sheet .check input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; }
.members li:last-child { border-bottom: 0; }
.members small { color: var(--muted); }
.sync-status { margin: 0 0 10px; color: var(--ink-2); }

/* --- sheets ------------------------------------------------------------ */
.sheet { position: fixed; inset: 0; background: rgba(0,0,0,.35); display: flex; align-items: flex-end; z-index: 10; }
.sheet.hidden { display: none; }
.sheet-body { background: var(--card); width: 100%; max-width: 560px; margin: 0 auto; border-radius: 22px 22px 0 0;
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); max-height: 92vh; overflow-y: auto; }
.sheet h3 { margin: 0 0 14px; font: 600 22px var(--serif); }
.choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.choices.two { grid-template-columns: repeat(2, 1fr); }

.choice { background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 16px 4px; font-size: 16px; font-weight: 600;
  display: flex; flex-direction: column; align-items: center; gap: 6px; }
.choice i { font-style: normal; font-size: 28px; }
.choice.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.choice.sel { outline: 2px solid var(--accent); }
.lbl { font-size: 13px; color: var(--ink-2); display: block; margin: 6px 0 4px; }
.sheet input, .sheet textarea { width: 100%; font: inherit; font-size: 17px; padding: 11px 12px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink); margin-bottom: 6px; }
.row { display: flex; gap: 8px; margin-top: 10px; }
.row > * { flex: 1; }
.btn { border-radius: 14px; padding: 14px; font-weight: 700; background: var(--bg); border: 1px solid var(--line); }
.btn.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.btn.danger { color: var(--bad); }
.sheet textarea { resize: vertical; line-height: 1.4; }
.sheet .hint { margin: 0 0 10px; }
.sheet .err { color: var(--bad); font-size: 14px; margin: 4px 0 0; }

/* --- form sheets (Nara's bottle sheet: band header with × / title / 保存) -- */
.sheet-body.form { padding: 0 0 calc(18px + env(safe-area-inset-bottom)); }
.fhead { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 12px 14px; border-radius: 22px 22px 0 0; }
.fhead h3 { margin: 0; font: 600 22px var(--serif); text-align: center; flex: 1; }
.fhead button { min-width: 48px; padding: 6px 2px; font-weight: 700; font-size: 16px; }
.fhead [data-x] { font-size: 30px; font-weight: 300; line-height: 1; text-align: left; }
.fhead .fsave { text-align: right; }
.fhead.c-feed { background: var(--b-feed); } .fhead.c-pump { background: var(--b-pump); }
.fbody { padding: 6px 16px 0; }
.toggles { display: flex; justify-content: center; gap: 22px; padding: 16px 0 18px; border-bottom: 1px solid var(--line); margin: 0 -16px; }
.tog { width: 88px; height: 88px; border-radius: 50%; border: 2px solid var(--accent); color: var(--accent);
  font-size: 17px; font-weight: 700; background: transparent; }
.tog[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.frow { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.frow label { font: 500 18px var(--serif); color: var(--ink); flex: none; }
.sheet .frow input { width: auto; flex: 1; min-width: 0; margin: 0; border: 0; background: transparent; text-align: right; padding: 8px 0; }
.frow .inl { display: flex; align-items: center; gap: 4px; flex: 1; justify-content: flex-end; min-width: 0; }
.frow .inl input { max-width: 110px; }
.frow .unit { color: var(--ink-2); }
.frow.total { justify-content: flex-end; gap: 12px; background: var(--bg); margin: 0 -16px; padding: 12px 16px; }
.frow.total span { font: 500 18px var(--serif); }
.frow.total b { font: 600 22px var(--serif); }
.quick { display: flex; gap: 6px; flex-wrap: wrap; padding: 8px 0 10px; border-bottom: 1px solid var(--line); }
.quick button { border: 1px solid var(--line); background: var(--bg); border-radius: 999px; padding: 6px 13px; font-size: 14px; }
.quick button.sel { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.fbody .lbl { margin-top: 12px; }

/* --- diaper form ------------------------------------------------------- */
.fhead.c-diaper { background: var(--b-diaper); }
.fhead.c-first { background: var(--b-first); }
.fhead.c-growth { background: var(--b-growth); } .fhead.c-health { background: var(--b-health); }
.fhead.c-routine { background: var(--b-routine); }
/* 成长 / 健康 cards: a list of rows instead of one summary */
.crows { padding-top: 16px; }
.crow { display: flex; align-items: center; gap: 14px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.crow:last-child { border-bottom: 0; }
.crow[data-edit] { cursor: pointer; }
.crow .ico { width: 44px; height: 44px; }
.crow .k { font: 500 18px/1.3 var(--serif); }
.crow .k small { font: 400 13px var(--sans); color: var(--ink-2); }
.crow .cval { margin-left: auto; font: 500 20px var(--sans); white-space: nowrap; }
.crow .fever { color: var(--bad); }
.crow .done { color: var(--m-diaper); font-size: 22px; }
.quickbtn.ghost { background: transparent; color: var(--accent); border: 1.5px solid var(--accent); padding: 6px 12px; font-size: 14px; }
.quickbtn { border-radius: 999px; background: var(--accent); color: var(--on-accent); padding: 8px 16px; font-weight: 700; font-size: 15px; }
.useg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; flex: none; }
.useg button { padding: 5px 10px; font-size: 14px; color: var(--ink-2); }
.useg button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.chart .gline { fill: none; stroke: var(--m-growth); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .gdot { fill: var(--m-growth); stroke: var(--card); stroke-width: 2; }
.datatable .ttl { margin: 14px 0 0; font: 600 15px var(--serif); }
.timeline.firsts { max-height: 55vh; overflow-y: auto; margin-bottom: 4px; }
.toggles.three { gap: 14px; }
.toggles.three .tog { width: 80px; height: 80px; }
.stool { padding: 12px 0 4px; border-bottom: 1px solid var(--line); }
.stool h4 { margin: 0 0 6px; font: 500 18px var(--serif); }
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: 4px; margin-bottom: 6px; }
.swatches button { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 13px; color: var(--ink-2);
  padding: 6px 0 4px; border-radius: 12px; border: 2px solid transparent; }
.swatches svg { width: 40px; height: 40px; }
.swatches .tex svg { fill: var(--tex); }
.swatches .sw { stroke: rgba(0, 0, 0, .12); stroke-width: .8; }
.swatches button[aria-pressed="true"] { border-color: var(--accent); color: var(--ink); font-weight: 600; }
.sheet .hint.warn { color: var(--warn); font-size: 13px; margin: 2px 0 8px; }
.switch { cursor: pointer; }
.switch span { font: 500 18px var(--serif); }
.sheet .switch input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.switch i { flex: none; width: 52px; height: 30px; border-radius: 999px; background: var(--line); position: relative; transition: background .15s; }
.switch i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .15s; }
.switch input:checked + i { background: var(--accent); }
.switch input:checked + i::after { transform: translateX(22px); }
.switch input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 2px; }

/* --- feed menu + session sheets (亲喂 / 泵奶) ----------------------------- */
.menu { display: flex; flex-direction: column; }
.mrow { display: flex; align-items: center; gap: 20px; padding: 14px 6px; font: 500 22px var(--serif); text-align: left;
  border-bottom: 1px solid var(--line); }
.mrow:last-child { border-bottom: 0; }
.mrow .ico { width: 60px; height: 60px; flex: none; }
.bf { display: flex; justify-content: space-around; gap: 8px; padding: 14px 0 16px; margin: 0 -16px; border-bottom: 1px solid var(--line); }
.bf.one { justify-content: center; }
.bfside { display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 150px; }
.badge { background: var(--b-feed); padding: 2px 10px; border-radius: 6px; font: 500 15px var(--serif); }
.badge.off { visibility: hidden; }
.bftime { display: flex; align-items: center; gap: 6px; min-height: 56px; }
.bigclock { font: 400 44px/1 var(--serif); font-variant-numeric: tabular-nums; }
.pen { width: 36px; height: 36px; display: grid; place-items: center; }
.pen svg { width: 22px; height: 22px; fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linejoin: round; }
.sheet .bftime input { width: 72px; flex: none; text-align: center; font-size: 22px; margin: 0; padding: 6px; border: 1px solid var(--line); background: var(--bg); }
.setbtn { border-radius: 10px; background: var(--accent); color: var(--on-accent); padding: 7px 10px; font-weight: 700; font-size: 14px; }
.bfbtn { border: 2px solid var(--accent); color: var(--accent); border-radius: 999px; padding: 10px 18px; min-width: 132px;
  font-weight: 700; font-size: 16px; }
.bfbtn.on { background: var(--accent); color: var(--on-accent); }
.seg { display: flex; background: var(--line); border-radius: 999px; padding: 3px; margin: 12px 0 0; }
.seg button { flex: 1; padding: 8px; border-radius: 999px; font-weight: 600; color: var(--ink-2); }
.seg button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.frow .flabel { font: 500 18px var(--serif); }
.frow .sesstot { font: 500 18px var(--sans); font-variant-numeric: tabular-nums; }
.frow .flabel .muted { font: 400 12px var(--sans); color: var(--muted); }
/* date + time as two pickers */
.dt { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.sheet .dt input { width: auto; flex: none; margin: 0; padding: 7px 10px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg); text-align: center; font-size: 16px; }
.sheet .frow .dt input { border: 1px solid var(--line); background: var(--bg); }
.runrow button { min-width: 0; }

/* --- login (served by the Worker) --------------------------------------- */
body.login { display: grid; place-items: center; min-height: 100vh; padding: 16px; }
body.login form { width: 100%; max-width: 340px; text-align: center; }
body.login h1 { font: 600 30px var(--serif); margin: 0 0 6px; }
body.login p { color: var(--ink-2); margin: 0 0 18px; }
body.login input { width: 100%; font-size: 18px; padding: 14px; border-radius: 14px; border: 1px solid var(--line);
  margin-bottom: 12px; background: var(--card); color: var(--ink); text-align: center; }
body.login button { width: 100%; min-height: 54px; border-radius: 14px; background: var(--accent); color: var(--on-accent);
  font-size: 18px; font-weight: 700; }
body.login .err { color: var(--bad); }
