/* NutriMeter — mobile-first PWA styles */
:root {
  --bg: #F5F2EA;
  --bg2: #EDE8DC;
  --card: #FFFFFF;
  --ink: #17231D;
  --ink2: #3A4740;
  --muted: #6A746E;
  --line: #E4DFD3;
  --brand: #1E5B47;
  --brand-ink: #FFFFFF;
  --brand-soft: #DCEBE3;
  --accent: #E6A23C;
  --low: #C2462F;
  --low-soft: #F8E2DC;
  --mid: #D89322;
  --mid-soft: #FBEFD6;
  --ok: #2B8A5B;
  --ok-soft: #DDF0E5;
  --info: #2F6E9E;
  --shadow: 0 1px 2px rgba(23,35,29,.06), 0 4px 16px rgba(23,35,29,.05);
  --r: 18px;
  --tab-h: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101613; --bg2: #18201B; --card: #19221D; --ink: #ECF1EC; --ink2: #C9D3CC; --muted: #8E9A93;
    --line: #29342D; --brand: #5FBF97; --brand-ink: #0D1611; --brand-soft: #1F3A2E; --accent: #F0B455;
    --low: #F07A62; --low-soft: #3A211B; --mid: #F1B04A; --mid-soft: #3A2F1A; --ok: #5CC78F; --ok-soft: #183526; --info: #7DB6E0;
    --shadow: 0 1px 2px rgba(0,0,0,.3);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--ink);
  font: 16px/1.45 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand); }
.num, .tabnum { font-variant-numeric: tabular-nums; }

/* ---------- Boot ---------- */
.boot { min-height: 100vh; display: grid; place-items: center; }
.boot-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--brand); animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.8); opacity: .4; } }

/* ---------- Shell ---------- */
.shell { max-width: 640px; margin: 0 auto; padding: 0 16px calc(var(--tab-h) + 32px + env(safe-area-inset-bottom)); }
.topbar {
  position: sticky; top: 0; z-index: 20; background: var(--bg);
  display: flex; align-items: center; gap: 12px; padding: calc(10px + env(safe-area-inset-top)) 0 10px;
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 750; letter-spacing: -.01em; font-size: 18px; }
.brand svg { width: 26px; height: 26px; }
.topbar .spacer { flex: 1; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; background: var(--brand); color: var(--brand-ink);
  display: grid; place-items: center; font-weight: 700; border: 0; cursor: pointer; font-size: 15px;
}
.datebar { display: flex; align-items: center; gap: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 2px; }
.datebar button { border: 0; background: none; width: 32px; height: 32px; border-radius: 50%; cursor: pointer; display: grid; place-items: center; color: var(--ink2); }
.datebar button:disabled { opacity: .3; }
.datebar span { font-size: 14px; font-weight: 600; min-width: 74px; text-align: center; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: color-mix(in srgb, var(--card) 92%, transparent); backdrop-filter: blur(12px);
  border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
}
.tabbar nav { max-width: 640px; margin: 0 auto; display: grid; grid-template-columns: repeat(5, 1fr); height: var(--tab-h); }
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-decoration: none; color: var(--muted); font-size: 11.5px; font-weight: 600; }
.tabbar a svg { width: 24px; height: 24px; }
.tabbar a.on { color: var(--brand); }
.tabbar a.add-tab span.plus { width: 44px; height: 44px; border-radius: 14px; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; margin-top: -4px; }
.tabbar a.add-tab span.plus svg { width: 26px; height: 26px; }

/* ---------- Cards & type ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; margin: 0 0 14px; box-shadow: var(--shadow); }
.card.flat { box-shadow: none; }
.card h3, .sec-title { margin: 0 0 10px; font-size: 13px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.card h3 .right, .sec-title .right { margin-left: auto; text-transform: none; letter-spacing: 0; font-weight: 600; font-size: 13px; }
h1.page { font-size: 26px; letter-spacing: -.02em; margin: 6px 0 14px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stack > * + * { margin-top: 10px; }
.center { text-align: center; }
.hr { height: 1px; background: var(--line); margin: 12px 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 12px;
  padding: 10px 14px; font-weight: 650; font-size: 15px; cursor: pointer; text-decoration: none; min-height: 42px;
}
.btn svg { width: 18px; height: 18px; }
.btn.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--brand); padding: 8px 10px; }
.btn.danger { color: var(--low); }
.btn.block { width: 100%; }
.btn.sm { min-height: 34px; padding: 6px 10px; font-size: 14px; border-radius: 10px; }
.btn:disabled { opacity: .55; cursor: default; }
.iconbtn { border: 0; background: none; padding: 6px; border-radius: 10px; cursor: pointer; color: var(--muted); display: grid; place-items: center; }
.iconbtn svg { width: 20px; height: 20px; }
.iconbtn:hover { background: var(--bg2); }

label.f { display: block; font-size: 13px; font-weight: 650; color: var(--ink2); margin: 10px 0 4px; }
.in, select.in, textarea.in {
  width: 100%; border: 1px solid var(--line); background: var(--card); border-radius: 12px; padding: 10px 12px;
  min-height: 44px; outline: none;
}
.in:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
textarea.in { min-height: 90px; resize: vertical; }
.in.sm { min-height: 36px; padding: 6px 8px; border-radius: 9px; font-size: 14px; }

.seg { display: flex; background: var(--bg2); border-radius: 12px; padding: 3px; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { flex: 1; border: 0; background: transparent; border-radius: 9px; padding: 8px 10px; font-weight: 650; font-size: 14px; color: var(--muted); cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.seg button svg { width: 16px; height: 16px; }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 6px 12px; font-size: 14px; font-weight: 600; cursor: pointer; color: var(--ink2); }
.chip.on { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }

.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.pill.low, .pill.high, .pill.over { background: var(--low-soft); color: var(--low); }
.pill.borderline_low, .pill.borderline_high, .pill.mid, .pill.near, .pill.borderline { background: var(--mid-soft); color: var(--mid); }
.pill.normal, .pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.brand { background: var(--brand-soft); color: var(--brand); }
.pill.gray { background: var(--bg2); color: var(--muted); }

/* ---------- Health score ---------- */
.hero { display: grid; grid-template-columns: 170px 1fr; gap: 14px; align-items: center; }
.gauge { position: relative; width: 170px; height: 104px; }
.gauge svg { width: 100%; height: 100%; overflow: visible; }
.gauge .val { position: absolute; left: 0; right: 0; bottom: 0; text-align: center; }
.gauge .val b { display: block; font-size: 38px; line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.gauge .val span { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.parts { display: grid; gap: 6px; }
.part { display: grid; grid-template-columns: 1fr 34px; gap: 8px; align-items: center; font-size: 13px; }
.part .bar { height: 6px; }
.part .lbl { display: flex; justify-content: space-between; color: var(--ink2); font-weight: 600; margin-bottom: 2px; }
@media (max-width: 400px) { .hero { grid-template-columns: 1fr; justify-items: center; } .parts { width: 100%; } }

/* ---------- Bars & meters ---------- */
.bar { position: relative; height: 8px; background: var(--bg2); border-radius: 99px; overflow: hidden; }
.bar > i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; background: var(--brand); transition: width .5s ease; }
.bar.low > i { background: var(--low); }
.bar.mid > i { background: var(--mid); }
.bar.ok > i { background: var(--ok); }
.bar.over > i { background: var(--low); }
.bar.near > i { background: var(--mid); }

.meter { padding: 10px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.meter:last-child { border-bottom: 0; }
.meter .top { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.meter .name { font-weight: 650; flex: 1; display: flex; align-items: center; gap: 6px; min-width: 0; }
.meter .amt { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.meter .pct { font-weight: 750; font-size: 14px; width: 46px; text-align: right; font-variant-numeric: tabular-nums; }
.meter .bar { height: 10px; }
.meter.priority .name::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--low); flex: none; }

.focus-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px; }
.ring-tile { background: var(--bg); border-radius: 14px; padding: 12px 10px; text-align: center; cursor: pointer; position: relative; }
.ring-tile .ring { width: 74px; height: 74px; margin: 0 auto 6px; position: relative; }
.ring-tile .ring b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 17px; font-variant-numeric: tabular-nums; }
.ring-tile .t { font-weight: 700; font-size: 14px; }
.ring-tile .s { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ring-tile .flag { position: absolute; top: 6px; left: 50%; transform: translateX(-50%); z-index: 1; font-size: 10.5px; }
.ring-tile:has(.flag) { padding-top: 26px; }

/* calories */
.cal { display: grid; grid-template-columns: 120px 1fr; gap: 16px; align-items: center; }
.cal .ring { width: 120px; height: 120px; position: relative; }
.cal .ring .c { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.cal .ring .c b { display: block; font-size: 26px; line-height: 1; font-variant-numeric: tabular-nums; }
.cal .ring .c span { font-size: 12px; color: var(--muted); }
.macro { margin-bottom: 9px; }
.macro .lbl { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; margin-bottom: 3px; }
.macro .lbl span { color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }

/* ---------- Lab gauges ---------- */
.lab { padding: 12px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.lab:last-child { border-bottom: 0; }
.lab .top { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.lab .name { font-weight: 700; flex: 1; min-width: 0; }
.lab .v { font-weight: 750; font-variant-numeric: tabular-nums; }
.lab .v small { font-weight: 500; color: var(--muted); font-size: 12px; margin-left: 2px; }
.zgauge { position: relative; height: 12px; border-radius: 99px; overflow: visible; display: flex; }
.zgauge .seg { height: 12px; padding: 0; border-radius: 0; background: none; }
.zgauge i { display: block; height: 100%; }
.zgauge i:first-child { border-radius: 99px 0 0 99px; }
.zgauge i:last-child { border-radius: 0 99px 99px 0; }
.zgauge i.z-low, .zgauge i.z-high { background: color-mix(in srgb, var(--low) 70%, transparent); }
.zgauge i.z-borderline_low, .zgauge i.z-borderline_high { background: color-mix(in srgb, var(--mid) 70%, transparent); }
.zgauge i.z-normal { background: color-mix(in srgb, var(--ok) 70%, transparent); }
.zgauge .pin { position: absolute; top: -5px; width: 4px; height: 22px; margin-left: -2px; background: var(--ink); border-radius: 3px; box-shadow: 0 0 0 2px var(--card); }
.lab .sub { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 6px; gap: 8px; }

/* ---------- Lists ---------- */
.meal { padding: 12px 0; border-bottom: 1px solid var(--line); }
.meal:last-child { border-bottom: 0; }
.meal-h { display: flex; align-items: center; gap: 8px; }
.meal-h b { font-size: 16px; }
.meal-h .kc { margin-left: auto; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.item { display: flex; align-items: center; gap: 10px; padding: 8px 0 0; }
.item img { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; background: var(--bg2); }
.item .ic { width: 40px; height: 40px; border-radius: 10px; background: var(--bg2); display: grid; place-items: center; color: var(--muted); flex: none; }
.item .ic svg { width: 20px; height: 20px; }
.item .meta { flex: 1; min-width: 0; }
.item .meta .n { font-weight: 600; font-size: 15px; }
.item .meta .d { font-size: 12.5px; color: var(--muted); }
.item .kc { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 14px; }

.list-row { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.list-row:last-child { border-bottom: 0; }
.list-row > svg, .list-row .ic svg { width: 20px; height: 20px; flex: none; color: var(--muted); }
.list-row .ic { width: 38px; height: 38px; border-radius: 10px; background: var(--bg2); display: grid; place-items: center; flex: none; }

/* trackers */
.trk { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.tk { background: var(--bg); border-radius: 14px; padding: 12px; cursor: pointer; border: 1px solid transparent; }
.tk:hover { border-color: var(--line); }
.tk .h { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.tk .h svg { width: 16px; height: 16px; }
.tk .v { font-size: 22px; font-weight: 750; margin-top: 4px; font-variant-numeric: tabular-nums; }
.tk .v small { font-size: 13px; color: var(--muted); font-weight: 600; }
.tk .bar { height: 5px; margin-top: 8px; }
.water-row { display: flex; gap: 6px; margin-top: 8px; }
.water-row button { flex: 1; border: 1px solid var(--line); background: var(--card); border-radius: 10px; padding: 6px 0; font-size: 13px; font-weight: 700; cursor: pointer; color: var(--info); }

.sugg { padding: 10px 0; border-bottom: 1px solid var(--line); }
.sugg:last-child { border-bottom: 0; }
.sugg .foods { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.sugg .foods button { border: 1px dashed var(--line); background: var(--bg); border-radius: 10px; padding: 5px 9px; font-size: 13px; cursor: pointer; color: var(--ink2); }
.sugg .foods button b { color: var(--brand); font-variant-numeric: tabular-nums; }

.banner { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: var(--mid-soft); color: var(--ink); font-size: 14px; margin-bottom: 14px; }
.banner.info { background: var(--brand-soft); }
.banner.bad { background: var(--low-soft); }
.banner svg { width: 20px; height: 20px; flex: none; margin-top: 1px; }

/* ---------- Add food ---------- */
.result { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.result:last-child { border-bottom: 0; }
.result .add { width: 34px; height: 34px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; flex: none; }
.result .add svg { width: 18px; height: 18px; }
.dropzone { border: 2px dashed var(--line); border-radius: 18px; padding: 28px 16px; text-align: center; cursor: pointer; background: var(--card); }
.dropzone svg { width: 40px; height: 40px; color: var(--brand); }
.dropzone b { display: block; margin: 8px 0 2px; font-size: 17px; }
.preview-img { width: 100%; max-height: 260px; object-fit: cover; border-radius: 14px; display: block; margin-bottom: 10px; }

.cart { position: fixed; left: 0; right: 0; bottom: calc(var(--tab-h) + env(safe-area-inset-bottom)); z-index: 25; padding: 8px 16px; }
.cart-in { max-width: 608px; margin: 0 auto; background: var(--ink); color: var(--bg); border-radius: 16px; padding: 10px 10px 10px 16px; display: flex; align-items: center; gap: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.2); }
.cart-in .grow b { display: block; font-size: 15px; }
.cart-in .grow span { font-size: 12.5px; opacity: .75; }
.cart-in .btn { background: var(--accent); border-color: var(--accent); color: #1b1305; }

.edit-item { border: 1px solid var(--line); border-radius: 14px; padding: 12px; margin-bottom: 10px; background: var(--card); }
.edit-item .row1 { display: flex; gap: 8px; align-items: center; }
.edit-item .nut { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12.5px; color: var(--muted); margin-top: 8px; font-variant-numeric: tabular-nums; }
.edit-item .nut b { color: var(--ink2); }
.qty { display: flex; align-items: center; gap: 6px; }
.qty input { width: 84px; text-align: center; }
.qty .unit { font-size: 13px; color: var(--muted); }
.serv-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.serv-chips button { border: 1px solid var(--line); background: var(--bg); border-radius: 9px; padding: 4px 9px; font-size: 13px; font-weight: 600; cursor: pointer; }
.serv-chips button.on { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }

/* ---------- Sheets ---------- */
.sheet-bg { position: fixed; inset: 0; background: rgba(10,16,12,.45); z-index: 50; display: flex; align-items: flex-end; justify-content: center; animation: fade .15s ease; }
.sheet { background: var(--bg); width: 100%; max-width: 640px; max-height: 92vh; overflow-y: auto; border-radius: 22px 22px 0 0; padding: 8px 16px calc(24px + env(safe-area-inset-bottom)); animation: up .22s cubic-bezier(.2,.8,.2,1); }
@media (min-width: 700px) { .sheet-bg { align-items: center; } .sheet { border-radius: 22px; max-height: 86vh; } }
.sheet .grab { width: 40px; height: 5px; border-radius: 9px; background: var(--line); margin: 0 auto 10px; }
.sheet-h { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; position: sticky; top: -8px; background: var(--bg); padding: 8px 0; z-index: 2; }
.sheet-h h2 { margin: 0; font-size: 20px; flex: 1; letter-spacing: -.01em; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }

#toast { position: fixed; left: 50%; bottom: calc(var(--tab-h) + 24px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-size: 14px; font-weight: 600; opacity: 0; pointer-events: none; transition: .25s; z-index: 80; max-width: calc(100% - 32px); }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.err { background: var(--low); color: #fff; }

/* ---------- Loading ---------- */
.loading { display: grid; place-items: center; padding: 40px 0; color: var(--muted); gap: 12px; text-align: center; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--brand-soft); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.skel { background: linear-gradient(90deg, var(--bg2), var(--card), var(--bg2)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: var(--r); height: 120px; margin-bottom: 14px; }
@keyframes sk { to { background-position: -200% 0; } }

/* ---------- Coach ---------- */
.chat { display: flex; flex-direction: column; gap: 10px; padding-bottom: 90px; }
.msg { max-width: 88%; padding: 10px 14px; border-radius: 16px; font-size: 15px; line-height: 1.5; word-wrap: break-word; }
.msg.user { align-self: flex-end; background: var(--brand); color: var(--brand-ink); border-bottom-right-radius: 4px; }
.msg.assistant { align-self: flex-start; background: var(--card); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg p { margin: 0 0 8px; } .msg p:last-child { margin: 0; }
.msg ul { margin: 4px 0 8px; padding-left: 20px; } .msg li { margin: 2px 0; }
.composer { position: fixed; left: 0; right: 0; bottom: calc(var(--tab-h) + env(safe-area-inset-bottom)); z-index: 25; padding: 8px 16px; background: linear-gradient(transparent, var(--bg) 30%); }
.composer .in-wrap { max-width: 608px; margin: 0 auto; display: flex; gap: 8px; align-items: flex-end; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 6px 6px 6px 14px; box-shadow: var(--shadow); }
.composer textarea { flex: 1; border: 0; outline: none; background: transparent; resize: none; min-height: 24px; max-height: 120px; padding: 8px 0; }
.composer .send { width: 40px; height: 40px; border-radius: 12px; border: 0; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; cursor: pointer; flex: none; }
.composer .send svg { width: 20px; height: 20px; }
.typing span { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); margin: 0 2px; animation: pulse 1s infinite; }
.typing span:nth-child(2) { animation-delay: .15s; } .typing span:nth-child(3) { animation-delay: .3s; }

/* ---------- Auth ---------- */
.auth { max-width: 420px; margin: 0 auto; padding: 48px 20px; }
.auth .logo { width: 56px; height: 56px; margin-bottom: 12px; }
.auth h1 { font-size: 30px; letter-spacing: -.02em; margin: 0 0 4px; }

/* ---------- Charts ---------- */
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .axis { font-size: 10px; fill: var(--muted); }

/* tables (lab review) */
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 6px 4px; }
.tbl td { padding: 4px; border-top: 1px solid var(--line); vertical-align: middle; }
.rv { border: 1px solid var(--line); border-radius: 14px; padding: 10px; margin-bottom: 8px; background: var(--card); }
.rv .g { display: grid; grid-template-columns: 1.2fr .8fr; gap: 6px; }
.rv .g4 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 6px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.dot.low, .dot.high { background: var(--low); } .dot.borderline_low, .dot.borderline_high { background: var(--mid); } .dot.normal { background: var(--ok); }

.empty { text-align: center; padding: 26px 12px; color: var(--muted); }
.empty svg { width: 44px; height: 44px; color: var(--line); margin-bottom: 6px; }
.kv { display: flex; justify-content: space-between; padding: 6px 0; font-size: 14px; border-bottom: 1px dashed var(--line); }
.kv:last-child { border: 0; }
.kv b { font-variant-numeric: tabular-nums; }
.hide { display: none !important; }
