:root { --brand: #0f766e; --bg: #f6f7f8; --card: #fff; --text: #1f2933; --muted: #6b7280;
        --normal: #15803d; --watch: #b45309; --high: #b91c1c; --low: #1d4ed8; }
* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.5 system-ui, sans-serif; background: var(--bg); color: var(--text); }
.top { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; background: var(--brand); }
.top a { color: #fff; text-decoration: none; margin-left: 12px; }
.brand { font-weight: 700; margin-left: 0 !important; }
main { max-width: 640px; margin: 0 auto; padding: 16px; }
.card { background: var(--card); border-radius: 12px; padding: 16px; margin-bottom: 16px; box-shadow: 0 1px 2px rgb(0 0 0 / 8%); }
.center { text-align: center; }
.muted { color: var(--muted); }
.error { color: var(--high); font-size: 14px; display: block; }
.btn { display: inline-block; min-height: 44px; padding: 10px 18px; border: 0; border-radius: 8px;
       background: var(--brand); color: #fff; font-size: 16px; text-decoration: none; cursor: pointer; }
.btn.secondary { background: #e5e7eb; color: var(--text); margin-top: 8px; }
.btn.danger { background: var(--high); }
.field { display: block; margin-bottom: 12px; }
.field input, .field select { display: block; width: 100%; min-height: 44px; padding: 8px; font-size: 16px;
       border: 1px solid #d1d5db; border-radius: 8px; }
.field input[aria-invalid="true"] { border-color: var(--high); }
.row { display: flex; gap: 12px; }
.row > * { flex: 1; }
.kinds { display: flex; gap: 8px; border: 0; padding: 0; margin: 0 0 12px; }
.kinds label { flex: 1; text-align: center; padding: 10px; border: 1px solid #d1d5db; border-radius: 8px; }
.kinds label:has(input:checked) { border-color: var(--brand); background: #ccfbf1; }
.kinds input { position: absolute; opacity: 0; }
/* ponytail: field switching uses :has() (iOS 15.4+, Chrome 105+); add a script only if older phones show up */
.entry .f-bp, .entry .f-glucose, .entry .f-weight { display: none; }
.entry:has(input[value="bp"]:checked) .f-bp, .entry.kind-bp .f-bp,
.entry:has(input[value="glucose"]:checked) .f-glucose, .entry.kind-glucose .f-glucose,
.entry:has(input[value="weight"]:checked) .f-weight, .entry.kind-weight .f-weight { display: block; }
.list { list-style: none; padding: 0; margin: 0; }
.list li { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; padding: 10px 0; border-bottom: 1px solid #eee; }
.list time { color: var(--muted); font-size: 14px; }
.lv { font-size: 13px; padding: 2px 8px; border-radius: 999px; color: #fff; }
.lv-normal { background: var(--normal); } .lv-watch { background: var(--watch); }
.lv-high { background: var(--high); } .lv-low { background: var(--low); }
.tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.tabs a { padding: 8px 12px; border-radius: 8px; background: #e5e7eb; color: var(--text); text-decoration: none; }
.tabs a[aria-current="page"] { background: var(--brand); color: #fff; }
.chart { height: 280px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 4px; border-bottom: 1px solid #eee; }
td form { display: inline; }
.upload progress { display: block; width: 100%; margin-top: 12px; }
