:root {
  --bg: #0e0f13;
  --card: #181a21;
  --line: #2a2d37;
  --text: #f2f0ec;
  --dim: #9a9dab;
  --accent: #ffb36b;
  --ink: #1b1108;
  --breast: #ff9d8a;
  --sleep: #9db4ff;
  --bottle: #8fe0c0;
  --pump: #e3b3ff;
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); color-scheme: dark; -webkit-text-size-adjust: 100%; }
body {
  font: 17px/1.35 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  touch-action: manipulation;
  -webkit-user-select: none; user-select: none;
}
body.locked { overflow: hidden; }
main {
  max-width: 520px; margin: 0 auto; min-height: 100svh;
  display: flex; flex-direction: column; gap: 14px;
  padding: calc(env(safe-area-inset-top) + 16px) calc(env(safe-area-inset-right) + 16px)
    calc(env(safe-area-inset-bottom) + 28px) calc(env(safe-area-inset-left) + 16px);
}
button, input, select { font: inherit; color: inherit; }
button { border: 0; background: none; cursor: pointer; min-height: 56px; border-radius: 18px; }
button:active { opacity: .7; }
h1 { font-size: 20px; font-weight: 650; text-align: center; }
h2 { font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); margin-top: 6px; }
[hidden] { display: none !important; }

.primary { background: var(--accent); color: var(--ink); font-weight: 700; }
.ghost { border: 1px solid var(--line); }
.choice { border: 1px solid var(--line); }
.choice.on { background: var(--text); border-color: var(--text); color: var(--bg); font-weight: 700; }
.wide { width: 100%; }
.huge { width: 100%; min-height: 84px; font-size: 22px; margin-top: auto; }
.link { color: var(--dim); text-decoration: underline; min-height: 44px; }
.danger { color: #ff8a80; width: 100%; margin-top: 8px; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.note { font-size: 14px; color: var(--accent); }
.note .link { color: inherit; min-height: 0; }
.empty, .sub { color: var(--dim); text-align: center; }
.sub b { color: var(--text); }

header { display: grid; grid-template-columns: 80px 1fr 80px; align-items: center; }
.back { min-height: 44px; border: 1px solid var(--line); border-radius: 99px; font-size: 15px; padding: 0 16px; }

.status, .card { background: var(--card); border-radius: 22px; padding: 18px 20px; }
.label { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.big { font-size: 34px; font-weight: 700; font-variant-numeric: tabular-nums; margin: 2px 0; }
.status p:not(.label):not(.big), .card p:last-child { color: var(--dim); }
.status .next { margin-top: 8px; color: var(--text) !important; }
.next b { color: var(--accent); }

.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile {
  background: var(--card); min-height: 108px; text-align: left; padding: 16px;
  display: flex; flex-direction: column; justify-content: space-between;
  border: 2px solid transparent;
}
.tile b { font-size: 22px; color: var(--c); }
.tile small { font-size: 14px; color: var(--dim); font-variant-numeric: tabular-nums; }
.tile.on { border-color: var(--c); }
.tile.on small { color: var(--text); }
.breast { --c: var(--breast); }
.sleep { --c: var(--sleep); }
.bottle { --c: var(--bottle); }
.pump { --c: var(--pump); }

.today { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px 8px; border: 1px solid var(--line); padding: 14px; }
.today span { font-size: 13px; color: var(--dim); }
.today b { display: block; font-size: 20px; color: var(--text); }
.today em { grid-column: 1 / -1; font-style: normal; font-size: 14px; color: var(--accent); margin-top: 6px; }

.list { list-style: none; }
.list .day { font-size: 14px; color: var(--dim); padding: 10px 0 4px; }
.row { width: 100%; display: flex; align-items: center; gap: 12px; border-radius: 0; border-top: 1px solid var(--line); text-align: left; min-height: 64px; }
.row span { flex: 1; }
.row b { display: block; font-weight: 600; }
.row small { display: block; color: var(--dim); font-size: 14px; }
.row time { color: var(--dim); font-size: 14px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; }

.controls { display: flex; flex-direction: column; gap: 6px; }
.controls.idle { visibility: hidden; }
.timer { font-size: 76px; font-weight: 200; text-align: center; font-variant-numeric: tabular-nums; margin-top: 3svh; }
.sides { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: auto; }
.side {
  min-height: 34svh; border-radius: 28px; background: var(--card); border: 2px solid transparent;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
}
.side b { font-size: 64px; line-height: 1; }
.side span { font-size: 26px; font-variant-numeric: tabular-nums; }
.side small { font-size: 14px; color: var(--dim); }
.side.next { border-color: var(--accent); }
.side.next small { color: var(--accent); }
.side.on { background: var(--breast); color: var(--ink); }
.side.on small { color: var(--ink); }

.stepper { display: grid; grid-template-columns: 72px 1fr 72px; align-items: center; text-align: center; }
.stepper button { height: 72px; border-radius: 50%; font-size: 32px; }
.stepper p { color: var(--dim); }
.stepper b { font-size: 52px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.chips { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; }
[data-view="bottle"] .stepper { margin-top: 6svh; }
[data-view="pump"] { gap: 10px; }
[data-view="pump"] .huge { min-height: 72px; }

.days { display: grid; grid-template-columns: 96px 1fr 96px; align-items: center; text-align: center; }
.days button { min-height: 44px; border-radius: 99px; font-size: 15px; }

#sheet { position: fixed; inset: 0; background: rgba(0, 0, 0, .65); display: flex; align-items: flex-end; justify-content: center; z-index: 10; }
.panel {
  width: 100%; max-width: 520px; max-height: 92svh; overflow: auto; background: var(--card);
  border-radius: 26px 26px 0 0; padding: 18px 16px calc(env(safe-area-inset-bottom) + 20px);
  display: flex; flex-direction: column; gap: 14px;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; }
.panel-head h2 { margin: 0; }
.panel .tile { background: var(--bg); min-height: 80px; justify-content: center; }
form { display: flex; flex-direction: column; gap: 12px; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--dim); min-width: 0; }
input, select {
  width: 100%; min-width: 0; min-height: 52px; padding: 0 14px; border-radius: 14px;
  background: var(--bg); border: 1px solid var(--line); color: var(--text); font-size: 17px;
  -webkit-appearance: none; appearance: none; -webkit-user-select: text; user-select: text;
}
.error { color: #ff8a80; font-size: 14px; }
.error:empty { display: none; }

.gate { margin: auto 0; display: flex; flex-direction: column; gap: 14px; text-align: center; }
.gate p { color: var(--dim); }
