/* GlucoGuard web app. Values are the design's (Web Dashboard, Web Join,
   Web App rounds 2–4; Design System tokens). Dark is not drawn for the web:
   the panel and chrome take the Design System's dark tokens and the field
   keeps its state colours. */

/* ------------------------------------------------------------------ fonts
   Copied from web/public/fonts. Nunito stands in for SF Pro Rounded off
   Apple platforms. The icon font is a subset holding only the icons this
   app uses: when one is added, download the woff2 named in the CSS from
   fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL,GRAD@20..48,300..700,0..1,0&icon_names=<names, alphabetical>&display=block
   (fetched with a browser User-Agent) and replace the file. Icons in it:
   add, arrow_circle_down, arrow_circle_up, check, check_circle,
   chevron_left, chevron_right, close, desktop_windows, east, error,
   hourglass_top, keyboard_double_arrow_down, keyboard_double_arrow_up,
   lock, mail, medical_services, north, north_east, notifications,
   notifications_active, notifications_off, person_add, push_pin, remove,
   schedule, sensors_off, settings, smartphone, south, south_east, verified,
   volume_off, volume_up, warning, water_drop. */
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 600 700;
  font-display: swap;
  src: url(/fonts/nunito-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 600 700;
  font-display: swap;
  src: url(/fonts/nunito-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Material Symbols Rounded';
  font-style: normal;
  font-weight: 300 700;
  font-display: block;
  src: url(/fonts/material-symbols-rounded.woff2) format('woff2');
}

/* ------------------------------------------------------------------ tokens */
:root {
  --text: -apple-system, 'SF Pro Text', system-ui, 'Segoe UI', Roboto, sans-serif;
  --rounded: 'SF Pro Rounded', ui-rounded, Nunito, -apple-system, system-ui, sans-serif;
  --ink: oklch(.2 .01 250);
  --secondary: oklch(.46 .01 250);
  --accent: oklch(.36 .04 250);
  --surface: oklch(.985 .003 250);
  --panel: rgba(255, 255, 255, .84);
  --panel-solid: rgba(255, 255, 255, .94);
  --card: rgba(0, 0, 0, .05);
  --card-opaque: oklch(.955 .004 250);
  --card-hover: oklch(.93 .005 250);
  --row-line: rgba(0, 0, 0, .07);
  --hairline: oklch(.9 .005 250);
  --input: #fff;
  --input-ring: oklch(.9 .005 250);
  --primary: oklch(.2 .01 250);
  --primary-ink: #fff;
  --quiet-button: rgba(0, 0, 0, .07);
  --close: rgba(0, 0, 0, .06);
  --toggle-on: oklch(.2 .01 250);
  --toggle-off: oklch(.82 .005 250);
  --knob: #fff;
  --live: oklch(.59 .10 172);
  --idle: oklch(.62 .01 250);
  --focus: oklch(.8 .04 250);
  --warn-bg: oklch(.95 .03 42);
  --warn-ink: oklch(.38 .12 42);
  --tir-low: oklch(.56 .17 42);
  --tir-in: oklch(.55 .10 172);
  --tir-high: oklch(.55 .14 300);
  --progress: oklch(.36 .04 250);
  --progress-track: rgba(0, 0, 0, .08);
  --avatar: oklch(.9 .006 250);
  --seg-on: #fff;
  --seg-shadow: 0 1px 2px rgba(0, 0, 0, .08), inset 0 0 0 1px rgba(0, 0, 0, .08);
  --verified: oklch(.42 .09 172);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root[data-theme='system'] { --dark: 1; }
}

:root[data-theme='dark'],
:root[data-theme='system'].prefers-dark {
  --ink: oklch(.96 .004 250);
  --secondary: oklch(.72 .01 250);
  --accent: oklch(.8 .04 250);
  --surface: oklch(.2 .006 250);
  --panel: rgba(34, 34, 38, .84);
  --panel-solid: rgba(34, 34, 38, .94);
  --card: rgba(255, 255, 255, .07);
  --card-opaque: oklch(.26 .008 250);
  --card-hover: oklch(.3 .008 250);
  --row-line: rgba(255, 255, 255, .1);
  --hairline: rgba(255, 255, 255, .1);
  --input: oklch(.26 .008 250);
  --input-ring: rgba(255, 255, 255, .14);
  --primary: oklch(.96 .004 250);
  --primary-ink: oklch(.2 .01 250);
  --quiet-button: rgba(255, 255, 255, .16);
  --close: rgba(255, 255, 255, .1);
  --toggle-on: oklch(.6 .06 250);
  --toggle-off: oklch(.42 .008 250);
  --knob: #fff;
  --live: oklch(.70 .08 172);
  --idle: oklch(.55 .01 250);
  --warn-bg: oklch(.32 .06 42);
  --warn-ink: oklch(.88 .07 42);
  --progress: oklch(.8 .04 250);
  --progress-track: rgba(255, 255, 255, .12);
  --avatar: oklch(.34 .008 250);
  --seg-on: rgba(255, 255, 255, .16);
  --seg-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1);
  --verified: oklch(.75 .08 172);
  color-scheme: dark;
}

/* ------------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--text);
  color: var(--ink);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  line-height: 1.4;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; text-align: inherit; }
button:disabled, button[aria-disabled='true'] { cursor: default; }
a { color: var(--accent); }
a:hover { color: var(--ink); }
input { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.field-scope :focus-visible { outline-color: #fff; }
/* A heading takes focus when a step changes, so a screen reader reads it; it is not a control, so it draws no ring. */
[tabindex="-1"]:focus { outline: none; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.noscript { padding: 40px; }
.boot { min-height: 100vh; }

.icon {
  font-family: 'Material Symbols Rounded';
  font-weight: normal;
  font-style: normal;
  font-size: 22px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  white-space: nowrap;
  direction: ltr;
  display: inline-block;
  font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
  user-select: none;
}
.icon.fill { font-variation-settings: 'FILL' 1; }
.rounded { font-family: var(--rounded); font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ controls */
.btn {
  height: 52px; border-radius: 26px; display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 16px; font-weight: 700; width: 100%;
}
.btn-primary { background: var(--primary); color: var(--primary-ink); }
.btn-primary[aria-disabled='true'], .btn-primary:disabled { opacity: .35; }
.btn-outline { background: var(--input); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); }
:root[data-theme='dark'] .btn-outline, :root.prefers-dark[data-theme='system'] .btn-outline { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16); }
.btn-soft { background: var(--card-opaque); }
.btn-soft:hover { background: var(--card-hover); }
.btn.square { border-radius: 16px; }
.btn .icon { font-size: 20px; }
.btn-small {
  flex: none; height: 32px; padding: 0 12px; border-radius: 11px; display: inline-flex; align-items: center;
  font-size: 13px; font-weight: 700; white-space: nowrap; background: var(--quiet-button);
}
.btn-small.strong { background: var(--primary); color: var(--primary-ink); }
.btn-card { height: 36px; padding: 0 14px; border-radius: 12px; display: inline-flex; align-items: center; font-size: 14px; font-weight: 700; background: var(--card-opaque); }
.btn-card.strong { background: var(--primary); color: var(--primary-ink); }
.link { color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.link:hover { color: var(--ink); }

.toggle { flex: none; width: 46px; height: 28px; border-radius: 14px; background: var(--toggle-off); position: relative; transition: background .2s; }
.toggle[aria-checked='true'] { background: var(--toggle-on); }
.toggle[aria-disabled='true'] { opacity: .4; }
.toggle .knob { position: absolute; top: 2px; left: 2px; width: 24px; height: 24px; border-radius: 12px; background: var(--knob); box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: left .2s; }
.toggle[aria-checked='true'] .knob { left: 20px; }

.seg { display: flex; gap: 3px; padding: 3px; border-radius: 11px; background: var(--card); }
.seg-item { height: 28px; padding: 0 10px; border-radius: 8px; display: flex; align-items: center; font-size: 13px; font-weight: 700; }
.seg-item[aria-pressed='true'] { background: var(--seg-on); box-shadow: var(--seg-shadow); }

.round-btn { width: 32px; height: 32px; border-radius: 16px; background: var(--close); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.round-btn .icon { font-size: 20px; }

/* Grouped rows (the design's 18-radius groups) */
.group-label { font-size: 13px; font-weight: 600; color: var(--secondary); padding-left: 4px; }
.group { border-radius: 18px; background: var(--card); display: flex; flex-direction: column; }
.row { padding: 12px 14px; display: flex; align-items: center; gap: 12px; min-height: 44px; width: 100%; }
.row + .row { border-top: 1px solid var(--row-line); }
.row-main { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.row-title { font-size: 15px; font-weight: 600; }
.row-sub { font-size: 13px; line-height: 1.4; color: var(--secondary); }
.row-meta { font-size: 12px; font-weight: 500; color: var(--secondary); white-space: nowrap; }
.row .icon { font-size: 22px; }
button.row:hover { background: rgba(127, 127, 127, .06); }
.group > button.row:first-child { border-radius: 18px 18px 0 0; }
.group > button.row:last-child { border-radius: 0 0 18px 18px; }
.group > button.row:only-child { border-radius: 18px; }
.section { display: flex; flex-direction: column; gap: 8px; }
.note { font-size: 13px; line-height: 1.45; color: var(--secondary); padding: 0 4px; text-wrap: pretty; }

/* Code boxes over one real input (sign-in, join) */
.code { position: relative; }
.code-boxes { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.code-box {
  height: 60px; border-radius: 16px; background: var(--input); box-shadow: inset 0 0 0 1px var(--input-ring);
  display: flex; align-items: center; justify-content: center; font-family: var(--rounded); font-size: 28px; font-weight: 700;
}
.code.tall .code-box { height: 64px; font-size: 30px; }
.code-box.current { box-shadow: inset 0 0 0 2px var(--ink); }
.code.problem .code-box { box-shadow: inset 0 0 0 2px oklch(.60 .17 42); }
.code input {
  position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; border: 0; padding: 0;
  font-size: 16px; letter-spacing: 0; caret-color: transparent; cursor: text;
}
.code:focus-within .code-boxes { outline: 3px solid var(--focus); outline-offset: 4px; border-radius: 18px; }

.text-input {
  height: 52px; border-radius: 16px; background: var(--input); box-shadow: inset 0 0 0 1px var(--input-ring);
  padding: 0 16px; font-size: 16px; font-weight: 500; border: 0; width: 100%; outline: none;
}
.text-input:focus { box-shadow: inset 0 0 0 2px var(--ink); }

.problem-card {
  display: flex; gap: 10px; padding: 12px 14px; border-radius: 16px; background: var(--warn-bg); color: var(--warn-ink);
  font-size: 14px; line-height: 1.45; font-weight: 600;
}
.problem-card .icon { font-size: 20px; }
.problem-card span:last-child { flex: 1; text-wrap: pretty; }
.problem-card.neutral { background: var(--card); color: var(--ink); }

.check { display: flex; align-items: center; gap: 12px; font-size: 15px; font-weight: 600; text-align: left; }
.check-box {
  flex: none; width: 24px; height: 24px; border-radius: 8px; background: var(--input); box-shadow: inset 0 0 0 2px oklch(.75 .005 250);
  display: flex; align-items: center; justify-content: center; color: var(--primary-ink);
}
.check-box .icon { font-size: 18px; }
.check[aria-checked='true'] .check-box { background: var(--primary); box-shadow: none; }
.check.small { font-size: 15px; font-weight: 500; gap: 10px; }
.check.small .check-box { width: 22px; height: 22px; border-radius: 7px; }

.qr { flex: none; background: #fff; border-radius: 12px; overflow: hidden; display: block; }
.qr svg { display: block; width: 100%; height: 100%; }

.store-badge {
  height: 52px; padding: 0 18px; border-radius: 12px; background: #000; color: #fff; display: inline-flex; flex-direction: column;
  justify-content: center; gap: 2px; text-decoration: none;
}
.store-badge:hover { color: #fff; background: #1a1a1a; }
.store-badge small { font-size: 11px; font-weight: 500; }
.store-badge strong { font-size: 20px; font-weight: 600; line-height: 1; letter-spacing: -.01em; }

/* ------------------------------------------------------------------ the field
   Two layers so a state change crossfades over 0.6 s (README §3.2); a
   gradient itself cannot transition. */
.field { position: fixed; inset: 0; z-index: 0; }
.field-layer { position: absolute; inset: 0; transition: opacity .6s; }
.field-scope { position: relative; z-index: 1; color: #fff; }

/* ------------------------------------------------------------------ dashboard, L (1200 and up) */
.dash { position: fixed; inset: 0; overflow: hidden; }
.top {
  position: absolute; left: 0; top: 0; right: 440px; height: 80px; padding: 0 24px 0 40px;
  display: flex; align-items: center; gap: 12px; color: #fff;
}
.brand { display: flex; align-items: center; gap: 12px; margin-right: 20px; flex: none; }
.brand img { width: 28px; height: 28px; display: block; }
.brand span { font-size: 17px; font-weight: 700; }
.chips { display: flex; gap: 12px; min-width: 0; flex: 1; overflow: hidden; }
.chip {
  flex: none; height: 40px; padding: 0 14px 0 6px; border-radius: 20px; background: rgba(255, 255, 255, .12);
  display: flex; align-items: center; gap: 10px; color: #fff;
}
.chip[aria-pressed='true'] { background: rgba(255, 255, 255, .28); }
.chip:hover { background: rgba(255, 255, 255, .2); }
.chip[aria-pressed='true']:hover { background: rgba(255, 255, 255, .32); }
.avatar {
  width: 28px; height: 28px; border-radius: 14px; box-shadow: 0 0 0 2px rgba(255, 255, 255, .7);
  display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 800; flex: none;
}
.chip-name { font-size: 15px; font-weight: 700; }
.chip-value { font-family: var(--rounded); font-size: 16px; font-weight: 700; opacity: .85; font-variant-numeric: tabular-nums; }
.chip .icon { font-size: 18px; opacity: .85; }
.chip.more { padding: 0 14px; font-size: 15px; font-weight: 700; }
.top-btn { width: 40px; height: 40px; border-radius: 20px; background: rgba(255, 255, 255, .12); display: flex; align-items: center; justify-content: center; flex: none; color: #fff; }
.top-btn:hover { background: rgba(255, 255, 255, .2); }
.top-btn[aria-expanded='true'] { background: rgba(255, 255, 255, .32); }
.top-btn .icon { font-size: 22px; }
.top-btns { display: flex; gap: 12px; margin-left: auto; flex: none; }

.stage { position: absolute; left: 48px; right: 488px; top: 104px; bottom: 40px; display: flex; flex-direction: column; gap: 32px; color: #fff; }
.reading { flex: none; display: flex; flex-direction: column; gap: 12px; }
.state-line { display: flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 700; }
.state-line .icon { font-size: 28px; }
.reading-row { display: flex; align-items: center; gap: 18px; }
.value { font-family: var(--rounded); font-size: 220px; line-height: .95; font-weight: 600; letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.value.word { letter-spacing: -.02em; }
.value.untrusted, .trend.untrusted { opacity: .45; }
.trend-col { display: flex; flex-direction: column; gap: 6px; }
.trend { font-size: 110px; font-variation-settings: 'wght' 600; }
.unit { font-size: 22px; font-weight: 600; opacity: .85; padding-left: 12px; }
.who { font-size: 18px; font-weight: 500; opacity: .85; }

.alarm-card {
  align-self: flex-start; max-width: 520px; margin-top: 4px; padding: 14px 14px 14px 18px; border-radius: 22px;
  background: #fff; color: oklch(.2 .01 250); display: flex; align-items: center; gap: 14px; box-shadow: 0 12px 40px rgba(0, 0, 0, .18);
}
.alarm-card .row-main { gap: 2px; }
.alarm-card .row-sub { color: oklch(.46 .01 250); }
.alarm-card .btn-small { height: 40px; padding: 0 16px; border-radius: 14px; font-size: 15px; background: oklch(.2 .01 250); color: #fff; }

.chart-block { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 18px; padding-bottom: 26px; }
.chart-head { display: flex; align-items: center; gap: 16px; padding-bottom: 14px; border-bottom: 1px solid rgba(255, 255, 255, .22); }
.chart-head h2 { font-size: 17px; font-weight: 700; }
.ranges { margin-left: auto; display: flex; gap: 4px; padding: 4px; border-radius: 16px; background: rgba(255, 255, 255, .14); }
.ranges button { height: 32px; padding: 0 16px; border-radius: 12px; display: flex; align-items: center; font-size: 14px; font-weight: 700; color: #fff; }
.ranges button[aria-pressed='true'] { background: rgba(255, 255, 255, .26); }
.chart { position: relative; flex: 1; min-height: 140px; margin-left: 34px; }
.chart svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.chart .band { fill: rgba(255, 255, 255, .12); }
.chart .line { fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.chart .placeholder { fill: none; stroke: rgba(255, 255, 255, .4); stroke-width: 1.5; stroke-dasharray: 6 6; vector-effect: non-scaling-stroke; }
.chart .dot { position: absolute; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 7px; background: #fff; box-shadow: 0 0 0 5px rgba(255, 255, 255, .25); }
.chart .band-label { position: absolute; left: -34px; transform: translateY(-50%); font-size: 12px; font-weight: 600; opacity: .8; font-variant-numeric: tabular-nums; }
.chart .tick { position: absolute; bottom: -24px; transform: translateX(-50%); font-size: 12px; font-weight: 600; opacity: .8; white-space: nowrap; }
/* Hovering the graph (iOS PlaceholderGraph's scrub): the field's pill, rule and dot tokens. */
.chart { touch-action: pan-y; }
.chart .scrub-rule { position: absolute; width: 1px; margin-left: -.5px; background: rgba(255, 255, 255, .4); pointer-events: none; }
.chart .scrub-dot { pointer-events: none; }
.chart .scrub-pill { position: absolute; display: flex; flex-direction: column; align-items: center; padding: 6px 14px; border-radius: 999px; background: rgba(255, 255, 255, .2); white-space: nowrap; pointer-events: none; }
.chart .scrub-value { font-size: 16px; font-weight: 700; line-height: 1.35; font-variant-numeric: tabular-nums; }
.chart .scrub-unit, .chart .scrub-time { font-size: 12px; font-weight: 500; line-height: 1.35; opacity: .85; }
.chart [hidden] { display: none; }

/* The panel */
.panel {
  position: absolute; top: 16px; right: 16px; bottom: 16px; width: 408px; border-radius: 32px;
  background: var(--panel); backdrop-filter: blur(30px) saturate(1.8); -webkit-backdrop-filter: blur(30px) saturate(1.8);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .18); color: var(--ink); overflow-y: auto; overscroll-behavior: contain;
  z-index: 2;
}
.panel-body { padding: 24px; display: flex; flex-direction: column; gap: 22px; min-height: 100%; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.panel-title { font-size: 17px; font-weight: 700; }
.panel-title.big { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.live { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; color: var(--secondary); white-space: nowrap; }
.live-dot { width: 8px; height: 8px; border-radius: 4px; background: var(--live); }
.live-dot.idle { background: var(--idle); }
.tir { display: flex; flex-direction: column; gap: 10px; }
.tir-head { display: flex; align-items: baseline; gap: 8px; }
.tir-head strong { font-family: var(--rounded); font-size: 40px; font-weight: 700; letter-spacing: -.03em; }
.tir-head span { font-size: 15px; font-weight: 600; color: var(--secondary); }
.tir-bar { display: flex; gap: 2px; height: 10px; }
.tir-bar span { border-radius: 5px; min-width: 0; }
.tir-bar .lo { background: var(--tir-low); }
.tir-bar .in { background: var(--tir-in); }
.tir-bar .hi { background: var(--tir-high); }
.tir-foot { display: flex; justify-content: space-between; font-size: 13px; font-weight: 500; color: var(--secondary); }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stat { padding: 12px 14px; border-radius: 16px; background: var(--card); display: flex; flex-direction: column; gap: 4px; }
.stat-k { font-size: 13px; font-weight: 500; color: var(--secondary); }
.stat-v { font-family: var(--rounded); font-size: 24px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat-sub { font-size: 12px; font-weight: 500; color: var(--secondary); }
/* One column: the day's wrapper flattens and Devices keeps its place after the alerts. */
.today-main { display: contents; }
.devices-section { order: 1; }
.panel-body > .followers { order: 2; }
.devices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.device { padding: 12px 14px; border-radius: 16px; background: var(--card); display: flex; flex-direction: column; gap: 6px; }
.device-name { font-size: 13px; font-weight: 500; color: var(--secondary); }
.device-left { font-family: var(--rounded); font-size: 20px; font-weight: 700; }
.progress { height: 4px; border-radius: 2px; background: var(--progress-track); }
.progress span { display: block; height: 4px; border-radius: 2px; background: var(--progress); }
.followers { margin-top: auto; display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 500; color: var(--secondary); }
.faces { display: flex; }
.face {
  width: 28px; height: 28px; border-radius: 14px; margin-right: -6px; background: oklch(.955 .004 250); box-shadow: 0 0 0 2px #fff;
  color: oklch(.2 .01 250); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700;
}
.followers > span:last-child { margin-left: 6px; }
.panel-foot { margin-top: auto; display: flex; align-items: center; gap: 10px; font-size: 13px; line-height: 1.4; color: var(--secondary); }
.panel-foot .icon { color: var(--ink); }
.ring {
  width: 32px; height: 32px; border-radius: 16px; border: 3px solid; display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800; flex: none;
}
.ring.big { width: 52px; height: 52px; border-radius: 26px; border-width: 4px; font-size: 20px; }
.person-head { display: flex; align-items: center; gap: 14px; margin-top: -4px; }
.person-head .name { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.person-head .sub { font-size: 14px; color: var(--secondary); }
.back { display: flex; align-items: center; gap: 2px; margin-left: -6px; font-size: 15px; font-weight: 600; color: var(--secondary); }
.back .icon { font-size: 24px; }
.level-dot { width: 10px; height: 10px; border-radius: 5px; flex: none; }
.level-v { font-family: var(--rounded); font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stepper { display: flex; align-items: center; gap: 12px; }
.stepper button { width: 32px; height: 32px; border-radius: 10px; background: var(--input); display: flex; align-items: center; justify-content: center; }
.stepper button:disabled { opacity: .35; }
.stepper button .icon { font-size: 18px; }
.stepper output { width: 56px; text-align: center; font-family: var(--rounded); font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.row.stepper-row { padding: 8px 8px 8px 14px; }
.danger { font-size: 14px; font-weight: 600; color: oklch(.51 .19 24); white-space: nowrap; }
:root[data-theme='dark'] .danger, :root.prefers-dark[data-theme='system'] .danger { color: oklch(.72 .14 24); }
.me-avatar { width: 32px; height: 32px; border-radius: 16px; background: var(--avatar); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; flex: none; }
.callout { padding: 18px; border-radius: 22px; background: var(--panel-solid); box-shadow: 0 8px 24px -12px rgba(0, 0, 0, .2), inset 0 0 0 1px var(--hairline); display: flex; flex-direction: column; gap: 10px; }
.callout .icon { font-size: 26px; }
.callout-title { font-size: 16px; font-weight: 700; }
.callout-body { font-size: 14px; line-height: 1.45; color: var(--secondary); text-wrap: pretty; }
.callout-actions { display: flex; gap: 8px; padding-top: 6px; }
.empty { font-size: 14px; color: var(--secondary); padding: 12px 14px; }
.warn-line { font-size: 13px; line-height: 1.45; color: var(--warn-ink); font-weight: 600; padding: 0 4px; }

/* Short windows: the reading shrinks so the graph keeps room. */
@media (min-width: 1200px) and (max-height: 820px) {
  .value { font-size: 168px; }
  .trend { font-size: 84px; }
  .stage { gap: 20px; top: 92px; }
}

/* ------------------------------------------------------------------ M (840–1199) and S (600–839)
   The panel stops floating and stacks below the reading and graph,
   keeping its content (2e, applied to 1a). */
@media (max-width: 1199px) {
  .dash { position: relative; min-height: 100vh; overflow: visible; }
  .top { position: relative; right: auto; height: 64px; padding: 0 24px; }
  .stage { position: relative; left: auto; right: auto; top: auto; bottom: auto; padding: 12px 32px 8px; gap: 24px; }
  .value { font-size: 160px; }
  .trend { font-size: 80px; }
  .state-line { font-size: 20px; }
  .chart-block { flex: none; }
  .chart { flex: none; height: 300px; }
  .panel { position: relative; top: auto; right: auto; bottom: auto; width: auto; margin: 8px 24px 24px; overflow: visible; }
  .panel-body { min-height: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 28px; align-items: start; }
  .panel-body > .span { grid-column: 1 / -1; }
  .today-main { display: flex; flex-direction: column; gap: 22px; }
  .followers, .panel-foot { margin-top: 0; }
}
@media (max-width: 839px) {
  .top { height: auto; min-height: 60px; padding: 10px 20px; flex-wrap: wrap; gap: 10px; }
  .brand { margin-right: 0; }
  .brand span { font-size: 16px; }
  .chips { order: 3; flex-basis: 100%; overflow-x: auto; scrollbar-width: none; gap: 8px; padding-bottom: 2px; }
  .stage { padding: 8px 20px; }
  .value { font-size: 120px; }
  .trend { font-size: 64px; }
  .unit { font-size: 18px; padding-left: 6px; }
  .state-line { font-size: 18px; }
  .who { font-size: 16px; }
  .chart { height: 240px; }
  .ranges button { padding: 0 10px; height: 28px; font-size: 12px; }
  .panel { margin: 8px 16px 20px; }
  .panel-body { display: flex; align-items: stretch; }
  .today-main { display: contents; }
}
@media (max-width: 599px) {
  .value { font-size: 104px; }
  .trend { font-size: 56px; }
  .stage { padding: 8px 16px; }
  .chart { height: 200px; margin-left: 30px; }
  .stats { gap: 6px; }
  .stat { padding: 10px; }
  .stat-v { font-size: 20px; }
  .panel { margin: 8px 12px 16px; border-radius: 28px; }
  .panel-body { padding: 20px; }
}

/* ------------------------------------------------------------------ XS glance mode (under 600) */
.glance { min-height: 100vh; background: var(--surface); color: var(--ink); display: flex; flex-direction: column; }
.glance-top { height: 56px; flex: none; padding: 0 16px; display: flex; align-items: center; gap: 10px; }
.glance-top img { width: 24px; height: 24px; }
.glance-top .name { font-size: 15px; font-weight: 700; }
.glance-top .clock { margin-left: auto; font-size: 13px; font-weight: 600; color: var(--secondary); }
.glance-top .round-btn { width: 32px; height: 32px; }
.glance-list { flex: 1; padding: 0 12px 12px; display: flex; flex-direction: column; gap: 10px; }
.glance-card { border-radius: 24px; color: #fff; padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 6px; width: 100%; }
.glance-card .head { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; }
.glance-card .head .icon { font-size: 20px; }
.glance-card .head .age { margin-left: auto; font-size: 13px; font-weight: 500; opacity: .85; }
.glance-card .num { display: flex; align-items: center; gap: 6px; }
.glance-card .num .v { font-family: var(--rounded); font-size: 72px; line-height: 1; font-weight: 600; letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.glance-card .num .icon { font-size: 44px; font-variation-settings: 'wght' 600; }
.glance-card .num .u { font-size: 14px; font-weight: 600; opacity: .85; margin-left: 4px; }
.glance-card .spark { position: relative; height: 64px; }
.glance-card .spark svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.glance-card .spark .band { fill: rgba(255, 255, 255, .12); }
.glance-card .spark .line { fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.glance-card .caption { font-size: 12px; font-weight: 600; opacity: .85; }
.glance-foot { margin-top: auto; padding: 12px 14px; border-radius: 16px; background: var(--card-opaque); display: flex; align-items: center; gap: 10px; font-size: 13px; line-height: 1.4; font-weight: 500; color: var(--secondary); }
.glance-foot .icon { font-size: 20px; color: var(--ink); }
.everyone { display: inline-flex; align-items: center; gap: 2px; height: 36px; padding: 0 12px 0 4px; border-radius: 18px; background: rgba(255, 255, 255, .12); color: #fff; font-size: 14px; font-weight: 700; }
.everyone .icon { font-size: 22px; }

/* ------------------------------------------------------------------ sign-in (2a) */
.signin { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) 600px; background: var(--surface); }
.signin-main { padding: 36px 48px; display: flex; flex-direction: column; min-height: 100vh; }
.signin-brand { display: flex; align-items: center; gap: 12px; }
.signin-brand img { width: 28px; height: 28px; }
.signin-brand span { font-size: 17px; font-weight: 700; }
.signin-form { margin: auto 0; align-self: center; width: 400px; max-width: 100%; display: flex; flex-direction: column; gap: 24px; padding: 40px 0; }
.signin-form h1 { font-size: 40px; font-weight: 800; letter-spacing: -.03em; }
.lede { font-size: 17px; line-height: 1.5; color: var(--secondary); text-wrap: pretty; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.stack.tight { gap: 8px; }
.stack.loose { gap: 6px; }
.or { display: flex; align-items: center; gap: 12px; font-size: 13px; font-weight: 600; color: var(--secondary); }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--hairline); }
.label { font-size: 13px; font-weight: 600; color: var(--secondary); }
.join-line { padding-top: 20px; border-top: 1px solid var(--hairline); font-size: 15px; line-height: 1.5; color: var(--secondary); text-wrap: pretty; }
.join-line a { font-weight: 600; }
.footer-links { display: flex; gap: 20px; font-size: 13px; font-weight: 500; color: var(--secondary); }
.footer-links a { color: var(--secondary); text-decoration: none; }
.footer-links a:hover { color: var(--ink); text-decoration: underline; }
.promo {
  margin: 16px; border-radius: 32px; background: linear-gradient(180deg, oklch(.59 .10 172), oklch(.48 .10 172)); color: #fff;
  padding: 48px; display: flex; flex-direction: column; gap: 20px;
}
.promo .kicker { font-size: 15px; font-weight: 700; opacity: .9; }
.promo h2 { font-size: 52px; line-height: 1.04; font-weight: 800; letter-spacing: -.035em; text-wrap: balance; }
.promo p { font-size: 18px; line-height: 1.5; opacity: .92; text-wrap: pretty; }
.promo-foot { margin-top: auto; display: flex; align-items: flex-end; gap: 24px; }
.promo .qr { width: 148px; height: 148px; border-radius: 20px; padding: 8px; }
.promo-foot .stack span { font-size: 14px; font-weight: 600; opacity: .92; }
.badges { display: flex; gap: 10px; flex-wrap: wrap; }
.sent { display: flex; flex-direction: column; gap: 6px; }
.sent strong { font-size: 17px; font-weight: 700; }
.sent span { font-size: 15px; color: var(--secondary); }
.muted { font-size: 14px; color: var(--secondary); }
@media (max-width: 1199px) {
  .signin { grid-template-columns: minmax(0, 1fr) minmax(0, 440px); }
  .promo { padding: 36px; }
  .promo h2 { font-size: 40px; }
}
@media (max-width: 899px) {
  .signin { grid-template-columns: 1fr; }
  .signin-main { min-height: 0; padding: 24px; }
  .promo { margin: 0 16px 16px; }
}

/* ------------------------------------------------------------------ join (round 4) */
.join .stage { gap: 12px; }
.join .wait-line { display: flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 700; opacity: .85; }
.join .wait-line .icon { font-size: 28px; }
.join .dashes { font-family: var(--rounded); font-size: 220px; line-height: .95; font-weight: 600; letter-spacing: -.02em; opacity: .45; }
.join .wait-sub { font-size: 18px; font-weight: 500; opacity: .85; max-width: 520px; text-wrap: pretty; }
.join .panel { background: rgba(255, 255, 255, .86); }
:root[data-theme='dark'] .join .panel, :root.prefers-dark[data-theme='system'] .join .panel { background: rgba(34, 34, 38, .86); }
.join .panel-body { gap: 20px; display: flex; }
.join-bar { display: flex; align-items: center; gap: 10px; min-height: 32px; }
.join-bar .round-btn { margin-left: -4px; }
.join-bar .round-btn .icon { font-size: 22px; }
.join-bar .step { font-size: 14px; font-weight: 600; color: var(--secondary); }
.join-bar .right { margin-left: auto; font-size: 14px; font-weight: 600; color: var(--secondary); }
.join-bar .right a { color: var(--secondary); }
.join-title { font-family: var(--rounded); font-size: 30px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.join-body { font-size: 15px; line-height: 1.45; color: var(--secondary); text-wrap: pretty; }
.join-warn { font-size: 14px; line-height: 1.45; color: var(--warn-ink); font-weight: 600; text-wrap: pretty; }
.to-bottom { margin-top: auto; }
.who-card { display: flex; align-items: center; gap: 12px; padding: 10px 14px 10px 10px; border-radius: 20px; background: var(--input); }
.who-card .initial { width: 40px; height: 40px; border-radius: 20px; background: var(--avatar); display: flex; align-items: center; justify-content: center; font-family: var(--rounded); font-size: 18px; font-weight: 700; }
.who-card .verified { color: var(--verified); font-variation-settings: 'FILL' 1; }
.name-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.name-chips button { height: 32px; padding: 0 12px; border-radius: 16px; background: var(--close); display: flex; align-items: center; font-size: 13px; font-weight: 600; }
.consent .row { align-items: flex-start; }
.consent .row span:last-child { flex: 1; font-size: 14px; line-height: 1.45; font-weight: 500; text-wrap: pretty; }
.qr-card { padding: 14px; border-radius: 18px; background: var(--input); display: flex; align-items: center; gap: 14px; }
.qr-card .qr { width: 64px; height: 64px; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--hairline); }
.qr-card > span:not(.qr) { flex: 1; font-size: 13px; line-height: 1.45; color: var(--secondary); text-wrap: pretty; }
.tip span:last-child { flex: 1; font-size: 14px; line-height: 1.4; font-weight: 500; }
@media (max-width: 1199px) {
  .join .dashes { font-size: 140px; }
  .join .panel-body { display: flex; align-items: stretch; }
}
@media (max-width: 839px) {
  .join .dashes { font-size: 96px; }
  .join .wait-line { font-size: 18px; }
  .join .wait-sub { font-size: 16px; }
}

/* ------------------------------------------------------------------ get the app (2b) */
.getapp { min-height: 100vh; background: var(--surface); display: flex; flex-direction: column; max-width: 480px; margin: 0 auto; padding: 16px 24px 32px; gap: 20px; }
.getapp-brand { display: flex; align-items: center; gap: 10px; }
.getapp-brand img { width: 26px; height: 26px; }
.getapp-brand span { font-size: 17px; font-weight: 700; }
.getapp-shot { flex: 1; min-height: 280px; border-radius: 28px; background: linear-gradient(180deg, oklch(.59 .10 172), oklch(.48 .10 172)); color: #fff; padding: 28px 24px; display: flex; flex-direction: column; justify-content: flex-start; gap: 6px; }
.getapp-shot .state-line { font-size: 17px; }
.getapp-shot .state-line .icon { font-size: 22px; }
.getapp-shot .reading-row { gap: 8px; }
.getapp-shot .value { font-size: 96px; }
.getapp-shot .trend { font-size: 52px; }
.getapp-shot .who { font-size: 15px; }
.getapp h1 { font-size: 30px; line-height: 1.1; font-weight: 800; letter-spacing: -.03em; }
.getapp > .stack p { font-size: 16px; line-height: 1.45; color: var(--secondary); text-wrap: pretty; }
.getapp .store-big { height: 60px; border-radius: 16px; background: #000; color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-decoration: none; }
.getapp .store-big small { font-size: 12px; font-weight: 500; }
.getapp .store-big strong { font-size: 22px; font-weight: 600; line-height: 1; }
.getapp .btn-soft { border-radius: 16px; text-decoration: none; color: var(--ink); }
.getapp .continue { align-self: center; font-size: 14px; font-weight: 600; color: var(--secondary); text-decoration: underline; text-underline-offset: 3px; }

/* ------------------------------------------------------------------ toast */
.toast {
  position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%); z-index: 20; max-width: min(520px, calc(100vw - 32px));
  background: oklch(.2 .01 250); color: #fff; padding: 12px 18px; border-radius: 16px; font-size: 14px; font-weight: 600;
  box-shadow: 0 12px 30px -10px rgba(0, 0, 0, .5);
}

/* ------------------------------------------------------------------ Reduce Motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; scroll-behavior: auto !important; }
}
