/*
  DESIGN PLAN (kept here so later edits stay on-brief)
  Subject   A private blood-glucose and symptom logbook, filled in on a phone straight after a finger-prick.
  Idea      The page is the meter. The seven-segment screen stays on top and mirrors what is typed; everything below is quiet.
  Colour    Meter white and near-black body; the screen's own pale-green segments; four range colours borrowed from the
            meter's dots (teal normal, orange above, red high, violet low); strip red used once, as a tab under the screen.
  Type      Red Hat Display 800 for headings and numbers, Atkinson Hyperlegible for everything you read or tap
            (built for low-vision legibility, which also helps tired eyes). Share Tech Mono only inside the screen.
  Layout    Phone: brand row, sticky screen, two tabs, one scrolling log with collapsible bands, a save bar that stays put.
            Wide: the screen sits to the right and stays in view while the log scrolls on the left.
  Rules     No identical card grid: sections are open bands, controls are filled shapes. Severity is the only place colour
            ramps. No all-caps labels, no numbered markers, no decorative motion. Colour never carries meaning alone.
*/

@font-face { font-family: "Red Hat Display"; font-weight: 700; font-display: swap; src: url("/fonts/red-hat-display-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Red Hat Display"; font-weight: 800; font-display: swap; src: url("/fonts/red-hat-display-latin-800-normal.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible"; font-weight: 400; font-display: swap; src: url("/fonts/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible"; font-weight: 700; font-display: swap; src: url("/fonts/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Share Tech Mono"; font-weight: 400; font-display: swap; src: url("/fonts/share-tech-mono-latin-400-normal.woff2") format("woff2"); }

:root {
  color-scheme: light dark;
  --bg: light-dark(#fbfcfb, #0d100f);
  --ink: light-dark(#15181a, #e8edeb);
  --mute: light-dark(#566063, #9ba6a3);
  --line: light-dark(#d6dcda, #2b3332);
  --panel: light-dark(#f0f3f2, #151a19);
  --raise: light-dark(#ffffff, #1a2120);
  --teal: light-dark(#0b7a69, #45cdb2);
  --teal-soft: light-dark(#dcf2ed, #12302b);
  --orange: light-dark(#a35500, #ffad4a);
  --red: light-dark(#bd2536, #ff7079);
  --violet: light-dark(#6244cc, #b39cff);
  --focus: light-dark(#0b57d0, #8ab4ff);
  --strip: #d4373f;
  --lcd: #0f1312;
  --seg: #d6f0a6;
  --sev1: #e9e08f; --sev2: #f4bd62; --sev3: #f08f4c; --sev4: #e5545c;
  --gutter: 16px;
  --sticky-h: 104px;
  --font-display: "Red Hat Display", system-ui, sans-serif;
  --font-body: "Atkinson Hyperlegible", system-ui, "Segoe UI", Roboto, sans-serif;
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

*, *::before, *::after { box-sizing: border-box; min-width: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: auto; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 17px/1.5 var(--font-body); overflow-x: clip; -webkit-tap-highlight-color: transparent; }
h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.offscreen { position: fixed; left: -9999px; top: 0; opacity: 0; }
.ico { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ------------------------------------------------------------------ shell */

.shell { max-width: 680px; margin: 0 auto; padding: 0 var(--gutter); min-height: 100dvh; display: flex; flex-direction: column; }
.top-row { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 12px; }
.brand { font: 800 24px/1 var(--font-display); letter-spacing: -0.02em; }
.top-actions { display: flex; align-items: center; gap: 6px; }

.status-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: 18px; border: 1.5px solid var(--orange); background: transparent; color: var(--orange); font-weight: 700; font-size: 14px; }

.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; border: 0; background: transparent; color: var(--ink); text-decoration: none; }
.icon-btn:hover { background: var(--panel); }
.icon-btn:disabled { opacity: 0.5; }

/* The screen is overlaid on a spacer, so it can shrink while stuck to the top without moving the page. */
.meter-wrap { position: sticky; top: 0; height: 0; z-index: 20; }
.meter { position: absolute; left: 0; right: 0; top: 0; }
.meter svg, .meter-card svg { display: block; width: 100%; height: auto; border-radius: 20px; box-shadow: 0 0 0 1.5px light-dark(transparent, #34403d); }
.meter::after { content: ""; position: absolute; left: 50%; bottom: -11px; width: 36px; height: 14px; transform: translateX(-50%); background: var(--strip); border-radius: 0 0 4px 4px; z-index: -1; }
.meter-spacer { aspect-ratio: 420 / 192; margin-bottom: 22px; }
.meter-wrap.compact .meter { left: calc(var(--gutter) * -1); right: calc(var(--gutter) * -1); padding: 8px var(--gutter); background: var(--bg); box-shadow: 0 1px 0 var(--line); }
.meter-wrap.compact .meter::after { display: none; }
.meter-wrap.compact .meter svg { width: auto; height: 84px; max-width: 100%; margin: 0 auto; }

.tabs-nav { margin-bottom: 8px; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--panel); border-radius: 16px; }
.tab { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; border: 0; border-radius: 12px; background: transparent; font-weight: 700; color: var(--mute); }
.tab[aria-selected="true"] { background: var(--raise); color: var(--ink); box-shadow: 0 1px 0 var(--line), 0 0 0 1px var(--line); }

.main { flex: 1; }

.savebar { position: sticky; bottom: 0; z-index: 15; margin: 8px calc(var(--gutter) * -1) 0; padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom)); background: var(--bg); box-shadow: 0 -1px 0 var(--line); }
.savebar-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.save-info { font-weight: 700; color: var(--mute); }
.save-info.ready { color: var(--teal); }

@media (min-width: 1000px) {
  .shell { max-width: 1060px; display: grid; grid-template-columns: minmax(0, 1fr) 380px; column-gap: 56px; align-content: start; grid-template-areas: "top top" "tabs meter" "main meter" "bar meter"; }
  .top-row { grid-area: top; }
  .tabs-nav { grid-area: tabs; }
  .main { grid-area: main; }
  .savebar { grid-area: bar; margin-inline: 0; padding-inline: 0; }
  .meter-wrap, .meter-wrap.compact { grid-area: meter; position: sticky; top: 24px; height: auto; align-self: start; }
  .meter, .meter-wrap.compact .meter { position: relative; left: auto; right: auto; padding: 0; background: none; box-shadow: none; }
  .meter-wrap.compact .meter svg { width: 100%; height: auto; }
  .meter-wrap.compact .meter::after { display: block; }
  .meter-spacer { display: none; }
}

/* ------------------------------------------------------------------ the meter screen */

.lcd-glass { fill: var(--lcd); }
.seg-on { fill: var(--seg); }
.seg-off { fill: var(--seg); opacity: 0.06; }
.lcd { font-family: "Share Tech Mono", ui-monospace, monospace; fill: var(--seg); }
.lcd-normal { fill: #46d3b6; } .lcd-above { fill: #ffad4a; } .lcd-high { fill: #ff6b74; } .lcd-low { fill: #b39cff; }
.dot-high { fill: #ff6b74; } .dot-above { fill: #ffad4a; } .dot-normal { fill: #46d3b6; } .dot-low { fill: #b39cff; }
.dot-lit { opacity: 1; } .dot-dim { opacity: 0.22; } .dot-idle { opacity: 0.5; }

/* ------------------------------------------------------------------ sections */

.sec { border-top: 1px solid var(--line); scroll-margin-top: var(--sticky-h); }
.sec-head { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 12px 0; cursor: pointer; list-style: none; }
.sec-head::-webkit-details-marker { display: none; }
.sec-ico { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--teal-soft); color: var(--teal); flex: none; }
.sec-title { font: 800 22px/1.1 var(--font-display); letter-spacing: -0.01em; }
.sec-state { margin-left: auto; font-size: 14px; font-weight: 700; color: var(--mute); text-align: right; }
.sec-state.todo { color: var(--orange); }
.sec-state .done { display: inline-flex; align-items: center; gap: 4px; color: var(--teal); }
.sec-chev { color: var(--mute); transition: transform 0.15s; }
.sec[open] > .sec-head .sec-chev { transform: rotate(180deg); }
.sec-body { padding: 0 0 28px; }

.q { font-weight: 700; margin-bottom: 10px; }
.field { display: grid; gap: 8px; margin-top: 20px; }
.field-label { font-weight: 700; line-height: 1.3; }
.field-hint { font-size: 14.5px; color: var(--mute); line-height: 1.4; }
.ok-text { color: var(--teal); }
.fine { font-size: 14px; color: var(--mute); margin-top: 18px; }
.empty { color: var(--mute); padding: 14px 0; }
.stack { display: grid; gap: 10px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }

/* ------------------------------------------------------------------ controls */

.input { width: 100%; min-height: 50px; padding: 11px 14px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--panel); color: var(--ink); }
textarea.input { resize: vertical; min-height: 76px; field-sizing: content; }
.input:focus { border-color: var(--focus); outline: none; box-shadow: 0 0 0 3px color-mix(in oklab, var(--focus) 35%, transparent); }
.input::placeholder { color: var(--mute); opacity: 0.8; }

.choice { display: grid; gap: 8px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.opt { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 50px; padding: 8px 6px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--raise); text-align: center; line-height: 1.2; }
.opt-main { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 700; }
.opt-sub { font-size: 12.5px; color: var(--mute); line-height: 1.25; }
.opt:hover { border-color: var(--mute); }
.opt.on { border-color: var(--teal); background: var(--teal-soft); box-shadow: inset 0 0 0 1px var(--teal); }
.opt.on .opt-sub { color: var(--ink); }
.rtype .opt { align-items: flex-start; text-align: left; padding: 10px 12px; }
.rtype .opt-main { justify-content: flex-start; }
.rtype .opt:last-child:nth-child(odd) { grid-column: 1 / -1; }
.choice.compact .opt { min-height: 42px; }

.scale .opt { min-height: 62px; padding: 8px 2px; }
.scale .opt-main { font: 800 22px/1 var(--font-display); }
.scale .opt-sub { font-size: 11.5px; }
.scale.bare .opt { min-height: 54px; }
.sym-row .scale .opt.on[data-v="1"] { background: var(--sev1); border-color: var(--sev1); color: #2f2a00; box-shadow: none; }
.sym-row .scale .opt.on[data-v="2"] { background: var(--sev2); border-color: var(--sev2); color: #3a2300; box-shadow: none; }
.sym-row .scale .opt.on[data-v="3"] { background: var(--sev3); border-color: var(--sev3); color: #2b1100; box-shadow: none; }
.sym-row .scale .opt.on[data-v="4"] { background: var(--sev4); border-color: var(--sev4); color: #1a0306; box-shadow: none; }
.sym-row .scale .opt.on .opt-sub { color: inherit; font-weight: 700; }
.anchor { font-size: 14.5px; color: var(--mute); min-height: 1.4em; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 44px; padding: 8px 16px; border: 1.5px solid var(--line); border-radius: 22px; background: var(--raise); font-weight: 700; font-size: 15px; }
.chip.on { border-color: var(--teal); background: var(--teal-soft); box-shadow: inset 0 0 0 1px var(--teal); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px; border: 1.5px solid transparent; border-radius: 16px; font-weight: 700; text-decoration: none; }
.btn:disabled { opacity: 0.55; cursor: progress; }
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-quiet { background: var(--raise); border-color: var(--line); color: var(--ink); }
.btn-quiet.on { border-color: var(--teal); background: var(--teal-soft); }
.btn-quiet:disabled { cursor: not-allowed; }
.btn-save { min-width: 168px; min-height: 52px; font-size: 18px; }
.btn-wide { width: 100%; min-height: 54px; font-size: 18px; }
.link-btn { padding: 8px 0; border: 0; background: none; color: var(--focus); font-weight: 700; text-align: left; text-decoration: underline; text-underline-offset: 3px; }

/* ------------------------------------------------------------------ reading */

.glucose-row { display: flex; align-items: baseline; gap: 14px; padding-top: 4px; }
.glucose-label { font-weight: 700; color: var(--mute); }
.glucose-input { width: 4.4ch; padding: 0 0 2px; border: 0; border-bottom: 3px solid var(--ink); border-radius: 0; background: transparent; font: 800 68px/1.05 var(--font-display); letter-spacing: -0.02em; color: var(--ink); text-align: center; }
.glucose-input::placeholder { color: var(--line); }
.glucose-input:focus { outline: none; border-bottom-color: var(--teal); box-shadow: 0 3px 0 0 var(--teal); }
.glucose-input.bad { border-bottom-color: var(--red); }
.glucose-unit { font-weight: 700; color: var(--mute); }
.glucose-note { margin-top: 8px; font-size: 15px; color: var(--mute); }
.status-word { font-weight: 700; }
.s-normal { color: var(--teal); } .s-above-normal { color: var(--orange); } .s-high { color: var(--red); } .s-low, .s-very-low { color: var(--violet); }
.glucose-warn { color: var(--ink); }

.when { display: flex; align-items: center; gap: 8px; margin-top: 14px; color: var(--mute); font-weight: 700; flex-wrap: wrap; }
.when-edit { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.when-edit .link-btn { grid-column: 1 / -1; }

.quality { margin-top: 18px; border-top: 1px solid var(--line); }
.quality > summary { display: flex; align-items: center; gap: 8px; min-height: 48px; font-weight: 700; color: var(--mute); cursor: pointer; list-style: none; }
.quality > summary::-webkit-details-marker { display: none; }
.quality > summary .sec-chev { transform: rotate(-90deg); }
.quality[open] > summary .sec-chev { transform: none; }
.quality-body { display: grid; gap: 14px; padding-bottom: 8px; }
.quality-row { display: grid; grid-template-columns: 1fr 150px; align-items: center; gap: 12px; }
.quality-label { font-size: 15.5px; }

/* ------------------------------------------------------------------ meal */

.meal-list { display: grid; gap: 8px; margin-top: 14px; }
.meal-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--raise); text-align: left; }
.meal-row.on { border-color: var(--teal); background: var(--teal-soft); box-shadow: inset 0 0 0 1px var(--teal); }
.meal-name { font-weight: 700; }
.meal-meta { grid-column: 1; font-size: 14px; color: var(--mute); }
.meal-ago { grid-row: 1; grid-column: 2; font-size: 14px; font-weight: 700; color: var(--teal); }
.meal-new { display: grid; gap: 4px; }
.meal-preview { margin-top: 18px; padding: 12px 14px; border-radius: 14px; background: var(--panel); font-size: 15.5px; overflow-wrap: anywhere; }

/* ------------------------------------------------------------------ symptoms */

.sym-group { margin-top: 22px; }
.sym-group-title { font: 700 17px/1.2 var(--font-display); margin-bottom: 10px; }
.sym-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.sym { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 92px; padding: 12px 4px 10px; border: 1.5px solid var(--line); border-radius: 16px; background: var(--raise); color: var(--mute); }
.sym-label { font-size: 14px; font-weight: 700; line-height: 1.15; color: var(--ink); text-align: center; }
.sym:hover { border-color: var(--mute); }
.sym.on { border-color: var(--teal); background: var(--teal-soft); color: var(--teal); box-shadow: inset 0 0 0 1px var(--teal); }
.sym-badge { position: absolute; top: 6px; right: 6px; display: none; place-items: center; min-width: 24px; height: 24px; padding: 0 5px; border-radius: 12px; font: 800 14px/1 var(--font-display); color: #1c1c1c; }
.sym.on .sym-badge { display: grid; }
.sym-badge.bq { background: transparent; border: 1.5px dashed var(--teal); color: var(--teal); }
.sym-badge.b1 { background: var(--sev1); } .sym-badge.b2 { background: var(--sev2); } .sym-badge.b3 { background: var(--sev3); } .sym-badge.b4 { background: var(--sev4); }
.sym-picked { display: grid; gap: 10px; }
.sym-picked:not(:empty) { margin-top: 10px; }
.sym-row { display: grid; gap: 12px; padding: 14px; border-radius: 16px; background: var(--panel); margin-top: 10px; }
.sym-picked .sym-row { margin-top: 0; }
.sym-row-head { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; color: var(--teal); }
.sym-row-title { font-weight: 700; color: var(--ink); line-height: 1.2; }
.sym-row-hint { font-size: 14px; color: var(--mute); line-height: 1.3; }

/* ------------------------------------------------------------------ problems, banners */

.problems { margin-bottom: 10px; padding: 12px 14px; border-radius: 14px; background: var(--panel); border-left: 4px solid var(--orange); }
.problems-title { font-weight: 700; margin-bottom: 2px; }
.problem-list { display: grid; }
.problem-list .link-btn { padding: 6px 0; min-height: 36px; font-weight: 400; }

.banner { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; align-items: start; margin-top: 14px; padding: 12px 14px; border-radius: 14px; background: var(--panel); border-left: 4px solid var(--orange); }
.banner-bad { border-left-color: var(--red); }
.banner-actions { grid-column: 2; display: flex; gap: 18px; }

/* ------------------------------------------------------------------ history */

.recent { padding-bottom: 32px; }
.recent-head { display: flex; align-items: center; justify-content: space-between; min-height: 56px; }
.recent-title { font: 800 22px/1.1 var(--font-display); }
.recent-actions { display: flex; }
.trend-fig { margin-top: 8px; }
.trend { display: block; width: 100%; height: auto; }
.trend-band { fill: var(--teal-soft); }
.trend-grid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 4 5; }
.trend-axis { fill: var(--mute); font: 400 18px var(--font-body); }
.trend-line { fill: none; stroke: var(--mute); stroke-width: 2; stroke-linejoin: round; }
.trend-dot { stroke: var(--bg); stroke-width: 2; }
.pt-normal { --pt: var(--teal); } .pt-above { --pt: var(--orange); } .pt-high { --pt: var(--red); } .pt-low { --pt: var(--violet); }
.trend-dot { fill: var(--pt); }
.trend-read { font-size: 14px; color: var(--mute); margin-top: 4px; }

.reading-list { margin-top: 12px; border-top: 1px solid var(--line); }
.reading { display: grid; grid-template-columns: 72px 1fr; gap: 2px 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.reading-num-box { grid-row: span 2; align-self: start; display: grid; gap: 4px; color: var(--pt); }
.reading-num { font: 800 38px/1 var(--font-display); letter-spacing: -0.02em; }
.reading-status { font-size: 12.5px; font-weight: 700; line-height: 1.15; }
.reading-main { display: grid; gap: 1px; }
.reading-type { font-weight: 700; }
.reading-when, .reading-meal { font-size: 14.5px; color: var(--mute); }
.reading-meal { color: var(--ink); }
.reading-syms { font-size: 14.5px; }
.reading-syms.none { color: var(--mute); }

/* ------------------------------------------------------------------ sheets, toast */

dialog.sheet { width: min(560px, 100vw); max-height: min(90dvh, 100dvh - 16px); margin: auto auto 0; padding: 0; border: 0; border-radius: 26px 26px 0 0; background: var(--raise); color: var(--ink); box-shadow: 0 -10px 40px -10px rgb(0 0 0 / 0.5); overflow: hidden; }
dialog.sheet[open] { display: flex; flex-direction: column; animation: sheet-in 0.2s ease-out; }
dialog.sheet::backdrop { background: rgb(8 12 11 / 0.6); }
@keyframes sheet-in { from { transform: translateY(28px); opacity: 0; } }
@media (min-width: 700px) { dialog.sheet { margin: auto; border-radius: 26px; } }
.sheet-head { display: flex; align-items: center; gap: 12px; padding: 18px 12px 8px 20px; }
.sheet-title { font: 800 24px/1.1 var(--font-display); margin-right: auto; }
.sheet-badge { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; flex: none; }
.sheet-badge.ok { background: var(--teal); color: var(--bg); }
.sheet-badge.bad { background: var(--orange); color: var(--bg); }
.sheet-body { overflow: auto; padding: 4px 20px 12px; display: grid; gap: 12px; align-content: start; }
.sheet-foot { display: flex; flex-wrap: wrap; gap: 10px; padding: 12px 20px calc(18px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.sheet-foot .btn { flex: 1 1 150px; white-space: nowrap; }
.saved-list { display: grid; gap: 8px; }
.saved-list li { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--teal); }
.fail-msg { font-weight: 700; }
.missing { display: grid; gap: 4px; padding-left: 18px; list-style: disc; }
.report { width: 100%; padding: 12px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--panel); font: 400 13.5px/1.45 "Share Tech Mono", ui-monospace, monospace; color: var(--ink); resize: none; overflow-wrap: anywhere; }
.queue { display: grid; gap: 16px; }
.queue-item { padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.queue-title { font-weight: 700; }

.settings { display: grid; gap: 4px; }
.set-block { display: grid; gap: 10px; padding: 16px 0; border-top: 1px solid var(--line); justify-items: start; }
.set-block:first-child { border-top: 0; }
.set-block .input, .set-block .choice, .set-block .stack { width: 100%; }
.set-title { font: 700 18px/1.2 var(--font-display); }
.check { display: flex; align-items: flex-start; gap: 8px; font-weight: 700; }
.check.ok { color: var(--teal); } .check.bad { color: var(--red); }
.check-result { width: 100%; }

.toast { position: fixed; left: 50%; bottom: 104px; z-index: 60; max-width: min(92vw, 460px); padding: 12px 18px; border-radius: 14px; background: var(--ink); color: var(--bg); font-weight: 700; text-align: center; opacity: 0; pointer-events: none; transform: translate(-50%, 8px); transition: opacity 0.15s, transform 0.15s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ------------------------------------------------------------------ lock screen */

.lock { max-width: 420px; min-height: 100dvh; margin: 0 auto; padding: 24px var(--gutter); display: grid; align-content: center; gap: 16px; }
.lock-title { font: 800 34px/1.05 var(--font-display); letter-spacing: -0.02em; }
.lock-text { color: var(--mute); }
.pin-form { display: grid; gap: 10px; margin-top: 8px; }
.pin-label { font-weight: 700; }
.pin-input { min-height: 58px; padding: 0 16px; border: 1.5px solid var(--line); border-radius: 16px; background: var(--panel); font: 800 28px/1 var(--font-display); letter-spacing: 0.3em; text-align: center; }
.pin-input:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in oklab, var(--focus) 35%, transparent); }
.pin-msg { min-height: 1.5em; color: var(--red); font-weight: 700; }

.spin { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (min-width: 560px) { .sym-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 380px) { .quality-row { grid-template-columns: 1fr; } .glucose-input { font-size: 58px; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}
