/* Tokens, base, the shell (top bar, mode stripe, bottom navigation), buttons, the sheet and the toast.
   The look is the redesign's (docs/mockups/redesign/mock.css); shared pieces are css/widgets.css, the graph paper
   css/paper.css, the rules only the screens not yet redesigned use css/legacy.css, and each screen its own file.
   Every colour is a token here and only here: rules everywhere use var() only (tools/check-css.mjs enforces it over
   this file and public/css/*.css). Light is the default, dark follows the device unless <html data-theme="light">,
   and <html data-theme="dark"> forces it; the two dark blocks hold the same values. Accents by meaning: --a violet
   primary, --b magenta change or below range, --c teal done or in range, --d amber attention or above range, each
   with a -soft tint for fills. Text tokens keep 4.5:1 on the surfaces they sit on in both themes, the focus ring
   3:1 (tools/check-css.mjs computes it). The names before the redesign stay as aliases of the new ones, so the old
   screens take the new palette without an edit; --red and the chart roles keep values of their own. */
:root{
  color-scheme:light;
  /* the background (css/paper.css, lib/paper.js): the abyss, the napkins, their grid and the traces; each trace keeps
     3:1 against --napkin at --paper-ink-alpha .78 (the owner's "a tad" washed out); --napkin-cells costs frames */
  --paper:#f6f3ec;--napkin:#fffdf8;--napkin-edge:rgba(64,44,120,.2);--napkin-shadow:rgba(84,62,30,.13);--napkin-cells:15;
  --paper-grid:rgba(64,44,120,.1);--paper-grid5:rgba(64,44,120,.22);--paper-curve-1:#8555f5;--paper-curve-2:#0c6f67;--paper-curve-3:#b0257f;
  --paper-glow:0;--paper-ink-alpha:.78;
  --bg:#f6f3ec;--surface:#fffdf8;--card-bg:rgb(255 253 248 / .88);--surface2:#f0ebe0;--ink:#1c1814;--ink2:#453d34;--mut:#5f564b;--line:#e0d7c7;
  --a:#6d3fe0;--a-soft:#ece5ff;--b:#b0257f;--b-soft:#fbe4f3;--c:#0c6f67;--c-soft:#d7f2ee;--d:#8a5a06;--d-soft:#fbeccb;
  --p1:#6d3fe0;--p2:#b02fc4;--on-p:#fff;
  /* the new look (docs/design/ux-redesign-lld.md section 6): --edge borders controls and tiles at 3:1 against
     --surface, which --line (1.4:1) does not give; --place-<tab> is each tab's colour and --place the current one,
     chosen by <html data-place> below (app.js sets it from the lit tab; Me, search and no tab are the neutral ink);
     the background's two nearest traces take --place and the far ones --paper-trace-far (lib/paper-traces.js) */
  --edge:#8a8072;
  /* the one filled button of a screen (section 6.5) is the primary colour, --place-today, the same on every tab; its
     text is white in light (6:1) and the dark surface in dark, where white on #b9a3ff is 2.2:1 (test/tokens.test.js).
     A card has no border in light; in dark --line edges it on the abyss. */
  --primary:var(--place-today);--on-primary:#fff;--card-edge:transparent;
  --place-today:var(--a);--place-body:var(--b);--place-food:var(--d);--place-train:var(--c);--place-me:var(--ink);--place:var(--place-me);
  --paper-trace-far:var(--mut);
  /* type, size / line height for the font shorthand (font:600 var(--t-hero) var(--serif)): nothing under 12 px, in
     rem so the layout follows the person's text size; space, a 4 px grid */
  --t-hero:2.75rem/3rem;--t-screen:1.75rem/2.125rem;--t-title:1.25rem/1.625rem;--t-body:1rem/1.5rem;--t-label:.875rem/1.25rem;--t-caption:.75rem/1rem;
  --s-1:4px;--s-2:8px;--s-3:12px;--s-4:16px;--s-5:24px;--s-6:32px;
  --focus:#6d3fe0;--glow:0 10px 28px -10px rgba(109,63,224,.55);--shadow:0 18px 40px -26px rgba(70,50,20,.4);
  --shadow-sm:0 1px 3px rgba(0,0,0,.12);--scrim:rgba(28,24,20,.45);--band:rgba(12,111,103,.09);
  --r:20px;--rm:12px;--pill:999px;
  /* the sleep panel's night strip (css/sleep.css): the same sky in both themes; --ns-x0 ... the positions views/night-strip.js sets inline */
  --ns-sky:linear-gradient(90deg,#0a0f30 0%,#141a4a 28%,#272566 50%,#53357c 66%,#a94e86 80%,#ec8a6c 91%,#ffcf8f 100%);
  --ns-dawn:radial-gradient(130px 95px at 100% 100%,rgba(255,214,140,.95),rgba(255,170,110,0) 72%);
  --ns-sky-shadow:inset 0 0 0 1px rgba(255,255,255,.08),0 10px 26px -14px rgba(40,20,110,.7);
  --ns-star:#fff;--ns-star-glow:0 0 6px 1px rgba(255,255,255,.75);
  --ns-night-edge:inset 0 0 0 2px rgba(255,255,255,.6),inset 0 0 18px rgba(255,255,255,.12);
  --ns-moon:radial-gradient(circle at 35% 30%,#fffdf0,#efe2b0);--ns-moon-ink:#4a3a92;--ns-moon-glow:0 0 0 3px rgba(255,255,255,.3),0 0 18px 5px rgba(255,240,190,.5);
  --ns-sun:radial-gradient(circle at 40% 35%,#fff4c8,#ffae45);--ns-sun-ink:#c2410c;--ns-sun-glow:0 0 0 3px rgba(255,255,255,.4),0 0 24px 7px rgba(255,176,72,.6);
  --ns-x0:0%;--ns-x1:100%;--ns-g0:0%;--ns-g1:0%;--ns-x:0%;--ns-sx:0%;--ns-sy:0%;--ns-sd:0s;
  --serif:'Fraunces',Georgia,serif;--sans:'Manrope','Heebo',system-ui,-apple-system,'Segoe UI',Arial,sans-serif;
  /* z-index: the whole list */
  --kb:0px;--save-h:58px;--sk-vh:100vh;--sk-h:58px;--sk-s:0px;--sk-w:100%;--z-paper:0;--z-page:1;--z-nav:10;--z-sheet:20;--z-controls:30;
  /* the names the screens before the redesign use */
  --accent:var(--a);--accent-t:var(--a-soft);--soft:var(--surface2);--on-accent:var(--on-p);
  --green:var(--c);--green-t:var(--c-soft);--amber:var(--d);--amber-t:var(--d-soft);
  --red:#b82c35;--on-red:#fff;--red-t:rgba(196,49,58,.08);
  /* Morning HRV's anatomical heart (css/hrv.css, views/hrv-heart.js): its tones mixed from the theme's red, resolved
     here on :root where the dark blocks below set --red too, so one set holds in light and dark */
  --h-ms:color-mix(in srgb,var(--red) 88%,#000);--h-dp:color-mix(in srgb,var(--red) 58%,#000);
  --h-ar:color-mix(in srgb,var(--red) 92%,#fff);--h-pa:color-mix(in srgb,var(--red) 70%,#000);
  --h-lt:color-mix(in srgb,var(--red) 45%,#fff);--h-vn:color-mix(in srgb,var(--red) 62%,#2a1030);
  /* the Aurora chart (css/chart-aurora.css): its sky, the ribbon by level, its words, and how strongly it glows */
  --aur-sky0:#f1ecff;--aur-sky1:#f8eaf6;--aur-sky2:#fff4ea;--aur-star:#6d3fe0;--aur-white:#fff;--aur-black:#000;
  --aur-lo:#0f8f84;--aur-mid:#6d3fe0;--aur-hi:#c0288a;--aur-low:#d4202c;--aur-high:#b86a00;--aur-txt:#1c1814;--aur-sub:#5f564b;
  --aur-glow:.35;--aur-curtain:.2;--aur-core:.35;--aur-halo:.7;--aur-shadow:0 18px 40px -26px rgba(40,20,80,.55);
  /* the Landscape chart (css/chart-landscape.css): its sky and night, the far ridge, the hill, the flags, the sun and
     moon, the mist of the range, its words, and how strongly each shows */
  --lsc-sky0:#b9d3f3;--lsc-sky1:#e9e2f7;--lsc-sky2:#ffe6cf;--lsc-nightc:#1d2456;--lsc-nighto:.34;--lsc-star:#fff;--lsc-white:#fff;--lsc-black:#000;
  --lsc-far:#a99ad8;--lsc-faro:.55;--lsc-hill0:#4fb19c;--lsc-hill1:#12544d;--lsc-crest:#b9f0e3;--lsc-ground:#0a3a36;--lsc-groundo:.92;--lsc-flag:#c0288a;
  --lsc-sun:#ffb347;--lsc-moon:#fff8e6;--lsc-glowo:.28;--lsc-mist:#fff;--lsc-misto:.32;--lsc-edgeo:.9;
  --lsc-txt:#1c1814;--lsc-sub:#3f3a52;--lsc-on:#e9fbf6;--lsc-nightw:#fff;--lsc-shadow:0 18px 40px -24px rgba(20,30,60,.55);
  /* the Day dial chart (css/chart-dial.css; the pilot docs/mockups/charts/b-dial.html): its face, the night, the
     spokes by level, the range's annulus, the glow, the chips on the rim; one block, light and the two dark */
  --dial-face:#fffdf8;--dial-face2:#f1ece2;--dial-rim:#e0d7c7;--dial-night:#3a2d80;--dial-night-o:.07;--dial-moon:#6d3fe0;
  --dial-lo:#0f8f84;--dial-mid:#6d3fe0;--dial-hi:#c0288a;--dial-low:#d4202c;--dial-high:#b86a00;--dial-band:#7a52e8;--dial-band-o:.1;
  --dial-glow-o:.25;--dial-core-o:.1;--dial-star:#6d3fe0;--dial-star-o:.4;--dial-mask:#fff;--dial-on:#fffdf8;--dial-ink:#1c1814;--dial-mut:#5f564b;
  --dial-shadow:0 10px 18px rgba(70,50,20,.16);
  /* the Day stripes chart (css/chart-stripes.css): its paper and words, the stripes' ramp from deep calm (s0) to a meal's
     peak (s4), outside the range low and high, the accent of the headline, and the paper's grain */
  --strp-paper:#fbf8f1;--strp-ink:#1c1814;--strp-ink2:#453d34;--strp-mut:#665d52;--strp-line:#d9cfbd;--strp-acc:#b0257f;
  --strp-s0:#155f5a;--strp-s1:#7fb3a6;--strp-s2:#efe6d2;--strp-s3:#e9b98a;--strp-s4:#b0257f;--strp-low:#c4313a;--strp-high:#8a4a06;
  --strp-grain:.16;--strp-blend:multiply;--strp-shadow:0 1px 0 #d9cfbd,0 18px 36px -28px rgba(40,30,10,.6);
  /* chart roles */
  --c-surface:#fcfcfb;--c-grid:#ebe8e2;--c-axis:#686c75;
  --s-glucose:#1f5fb8;--s-food:#eb6834;--s-drink:#1baf7a;--s-mixed:#6250d6;--s-ctx:#008300;--s-scan:#256abf;
  --s-band:color-mix(in srgb,var(--s-glucose) 14%,transparent);--s-band2:color-mix(in srgb,var(--s-glucose) 26%,transparent);--s-gap:repeating-linear-gradient(45deg,transparent 0 5px,rgba(106,111,120,.12) 5px 7px);
  --st-warn:#fab219;--st-crit:#d03b3b;--st-good:#0ca30c;
  --seq-0:#eef5fd;--seq-1:#cde2fb;--seq-2:#9ec5f4;--seq-3:#6da7ec;--seq-4:#3987e5;--seq-5:#256abf;--seq-6:#184f95;--seq-7:#0d366b;
  /* score gauge bands, low to high: red, orange, yellow, yellow-green, green (views/bio-gauge.js) */
  --gauge-0:#e5262f;--gauge-1:#f57a10;--gauge-2:#f5b400;--gauge-3:#86c226;--gauge-4:#13a956;
}
@media screen and (prefers-color-scheme:dark){:root:not([data-theme="light"]){
  color-scheme:dark;
  --paper:#15131d;--napkin:#242134;--napkin-edge:rgba(196,184,255,.34);--napkin-shadow:rgba(0,0,0,.34);
  --paper-grid:rgba(196,184,255,.13);--paper-grid5:rgba(196,184,255,.3);--paper-curve-1:#c2adff;--paper-curve-2:#3ddbc4;--paper-curve-3:#ff8fc9;
  --paper-glow:0;
  --bg:#0f0d0a;--surface:#1a1613;--card-bg:rgb(26 22 19 / .88);--surface2:#25201b;--ink:#f6f2ea;--ink2:#d5cdc1;--mut:#a89f93;--line:#322c25;
  --a:#b9a3ff;--a-soft:#2b2447;--b:#f58cc4;--b-soft:#3a1c33;--c:#3ddbc4;--c-soft:#10332f;--d:#fbbf24;--d-soft:#3a2c0c;
  --edge:#7d7468;--on-primary:#1a1613;--card-edge:var(--line);
  --focus:#d6c8ff;--glow:0 10px 34px -8px rgba(150,80,240,.6);--shadow:0 18px 44px -22px rgba(0,0,0,.85);
  --shadow-sm:0 1px 3px rgba(0,0,0,.4);--scrim:rgba(8,6,4,.7);--band:rgba(61,219,196,.1);
  --red:#ff7078;--on-red:#0e0f11;--red-t:rgba(255,112,120,.12);
  --c-surface:#1a1a19;--c-grid:#2a2a28;--c-axis:#8f939b;
  --s-glucose:#6da7ec;--s-food:#d95926;--s-drink:#199e70;--s-mixed:#9085e9;--s-ctx:#0ca30c;--s-scan:#86b6ef;
  --s-band:color-mix(in srgb,var(--s-glucose) 18%,transparent);--s-band2:color-mix(in srgb,var(--s-glucose) 32%,transparent);
  --seq-0:#16202d;--seq-1:#104281;--seq-2:#184f95;--seq-3:#1c5cab;--seq-4:#256abf;--seq-5:#3987e5;--seq-6:#6da7ec;--seq-7:#b7d3f6;
  --gauge-0:#ff3b45;--gauge-1:#ff8a1a;--gauge-2:#ffc61a;--gauge-3:#a4e22a;--gauge-4:#1fd36d;
  --aur-sky0:#070818;--aur-sky1:#140f33;--aur-sky2:#24133c;--aur-star:#fff;
  --aur-lo:#3ddbc4;--aur-mid:#a98bff;--aur-hi:#ff8fd0;--aur-low:#ff7078;--aur-high:#fbbf24;--aur-txt:#f6f2ea;--aur-sub:#a9a3c4;
  --aur-glow:.8;--aur-curtain:.34;--aur-core:.55;--aur-halo:.9;--aur-shadow:0 18px 44px -18px rgba(90,40,200,.45),inset 0 0 0 1px rgba(196,184,255,.12);
  /* the Landscape chart, dark */
  --lsc-sky0:#060a20;--lsc-sky1:#161338;--lsc-sky2:#3b2150;--lsc-nightc:#000;--lsc-nighto:.5;--lsc-star:#fff;
  --lsc-far:#5d4f9c;--lsc-faro:.6;--lsc-hill0:#1e7f73;--lsc-hill1:#06231f;--lsc-crest:#6ff0db;--lsc-ground:#041613;--lsc-groundo:.9;--lsc-flag:#ff8fd0;
  --lsc-sun:#ffc06a;--lsc-moon:#fff8e6;--lsc-glowo:.07;--lsc-mist:#c9c0ff;--lsc-misto:.12;--lsc-edgeo:.45;
  --lsc-txt:#f6f2ea;--lsc-sub:#b8b0d8;--lsc-on:#bff5ea;--lsc-nightw:#b8b0d8;--lsc-shadow:0 18px 44px -18px rgba(20,40,120,.45),inset 0 0 0 1px rgba(196,184,255,.1);
  /* the Day dial chart (css/chart-dial.css) */
  --dial-face:#17141f;--dial-face2:#0f0d15;--dial-rim:#322c25;--dial-night:#000;--dial-night-o:.32;--dial-moon:#b9a3ff;
  --dial-lo:#3ddbc4;--dial-mid:#a98bff;--dial-hi:#ff8fd0;--dial-low:#ff7078;--dial-high:#fbbf24;--dial-band:#3ddbc4;--dial-band-o:.08;
  --dial-glow-o:.75;--dial-core-o:.22;--dial-star:#fff;--dial-star-o:.7;--dial-mask:#fff;--dial-on:#17141f;--dial-ink:#f6f2ea;--dial-mut:#a89f93;
  --dial-shadow:0 10px 22px rgba(0,0,0,.6);
  /* the Day stripes chart (css/chart-stripes.css) */
  --strp-paper:#17141b;--strp-ink:#f3eee5;--strp-ink2:#d5cdc1;--strp-mut:#a39a8f;--strp-line:#3a3340;--strp-acc:#f58cc4;
  --strp-s0:#2fb8a4;--strp-s1:#1d5a56;--strp-s2:#26202c;--strp-s3:#9a5a3c;--strp-s4:#f58cc4;--strp-low:#ff7078;--strp-high:#fbbf24;
  --strp-grain:.1;--strp-blend:screen;--strp-shadow:inset 0 0 0 1px #3a3340;
}}
:root[data-theme="dark"]{
  color-scheme:dark;
  --paper:#15131d;--napkin:#242134;--napkin-edge:rgba(196,184,255,.34);--napkin-shadow:rgba(0,0,0,.34);
  --paper-grid:rgba(196,184,255,.13);--paper-grid5:rgba(196,184,255,.3);--paper-curve-1:#c2adff;--paper-curve-2:#3ddbc4;--paper-curve-3:#ff8fc9;
  --paper-glow:0;
  --bg:#0f0d0a;--surface:#1a1613;--card-bg:rgb(26 22 19 / .88);--surface2:#25201b;--ink:#f6f2ea;--ink2:#d5cdc1;--mut:#a89f93;--line:#322c25;
  --a:#b9a3ff;--a-soft:#2b2447;--b:#f58cc4;--b-soft:#3a1c33;--c:#3ddbc4;--c-soft:#10332f;--d:#fbbf24;--d-soft:#3a2c0c;
  --edge:#7d7468;--on-primary:#1a1613;--card-edge:var(--line);
  --focus:#d6c8ff;--glow:0 10px 34px -8px rgba(150,80,240,.6);--shadow:0 18px 44px -22px rgba(0,0,0,.85);
  --shadow-sm:0 1px 3px rgba(0,0,0,.4);--scrim:rgba(8,6,4,.7);--band:rgba(61,219,196,.1);
  --red:#ff7078;--on-red:#0e0f11;--red-t:rgba(255,112,120,.12);
  --c-surface:#1a1a19;--c-grid:#2a2a28;--c-axis:#8f939b;
  --s-glucose:#6da7ec;--s-food:#d95926;--s-drink:#199e70;--s-mixed:#9085e9;--s-ctx:#0ca30c;--s-scan:#86b6ef;
  --s-band:color-mix(in srgb,var(--s-glucose) 18%,transparent);--s-band2:color-mix(in srgb,var(--s-glucose) 32%,transparent);
  --seq-0:#16202d;--seq-1:#104281;--seq-2:#184f95;--seq-3:#1c5cab;--seq-4:#256abf;--seq-5:#3987e5;--seq-6:#6da7ec;--seq-7:#b7d3f6;
  --gauge-0:#ff3b45;--gauge-1:#ff8a1a;--gauge-2:#ffc61a;--gauge-3:#a4e22a;--gauge-4:#1fd36d;
  --aur-sky0:#070818;--aur-sky1:#140f33;--aur-sky2:#24133c;--aur-star:#fff;
  --aur-lo:#3ddbc4;--aur-mid:#a98bff;--aur-hi:#ff8fd0;--aur-low:#ff7078;--aur-high:#fbbf24;--aur-txt:#f6f2ea;--aur-sub:#a9a3c4;
  --aur-glow:.8;--aur-curtain:.34;--aur-core:.55;--aur-halo:.9;--aur-shadow:0 18px 44px -18px rgba(90,40,200,.45),inset 0 0 0 1px rgba(196,184,255,.12);
  /* the Landscape chart, dark */
  --lsc-sky0:#060a20;--lsc-sky1:#161338;--lsc-sky2:#3b2150;--lsc-nightc:#000;--lsc-nighto:.5;--lsc-star:#fff;
  --lsc-far:#5d4f9c;--lsc-faro:.6;--lsc-hill0:#1e7f73;--lsc-hill1:#06231f;--lsc-crest:#6ff0db;--lsc-ground:#041613;--lsc-groundo:.9;--lsc-flag:#ff8fd0;
  --lsc-sun:#ffc06a;--lsc-moon:#fff8e6;--lsc-glowo:.07;--lsc-mist:#c9c0ff;--lsc-misto:.12;--lsc-edgeo:.45;
  --lsc-txt:#f6f2ea;--lsc-sub:#b8b0d8;--lsc-on:#bff5ea;--lsc-nightw:#b8b0d8;--lsc-shadow:0 18px 44px -18px rgba(20,40,120,.45),inset 0 0 0 1px rgba(196,184,255,.1);
  /* the Day dial chart (css/chart-dial.css) */
  --dial-face:#17141f;--dial-face2:#0f0d15;--dial-rim:#322c25;--dial-night:#000;--dial-night-o:.32;--dial-moon:#b9a3ff;
  --dial-lo:#3ddbc4;--dial-mid:#a98bff;--dial-hi:#ff8fd0;--dial-low:#ff7078;--dial-high:#fbbf24;--dial-band:#3ddbc4;--dial-band-o:.08;
  --dial-glow-o:.75;--dial-core-o:.22;--dial-star:#fff;--dial-star-o:.7;--dial-mask:#fff;--dial-on:#17141f;--dial-ink:#f6f2ea;--dial-mut:#a89f93;
  --dial-shadow:0 10px 22px rgba(0,0,0,.6);
  /* the Day stripes chart (css/chart-stripes.css) */
  --strp-paper:#17141b;--strp-ink:#f3eee5;--strp-ink2:#d5cdc1;--strp-mut:#a39a8f;--strp-line:#3a3340;--strp-acc:#f58cc4;
  --strp-s0:#2fb8a4;--strp-s1:#1d5a56;--strp-s2:#26202c;--strp-s3:#9a5a3c;--strp-s4:#f58cc4;--strp-low:#ff7078;--strp-high:#fbbf24;
  --strp-grain:.1;--strp-blend:screen;--strp-shadow:inset 0 0 0 1px #3a3340;
}

/* The current place (section 6.1 of docs/design/ux-redesign-lld.md): the lit tab's key on <html data-place>, the
   names before and after the redesign both (measure is Body, meals is Food). Glucose is never a place. */
:root[data-place=today]{--place:var(--place-today)}
:root[data-place=measure],:root[data-place=body]{--place:var(--place-body)}
:root[data-place=meals],:root[data-place=food]{--place:var(--place-food)}
:root[data-place=train]{--place:var(--place-train)}
/* The nearest traces' colour: the place's on a tab of the bar; with no place (Me, More, search, the first run) the
   brand's first curve, never --place-me: that is the ink of the text, and a trace in it crossing a line on the paper
   (the welcome screen's lead) reads as strokes of the letters. */
:root{--paper-trace-place:var(--paper-curve-1)}
:root[data-place=today],:root[data-place=measure],:root[data-place=body],:root[data-place=meals],:root[data-place=food],:root[data-place=train]{--paper-trace-place:var(--place)}

/* base */
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html{-webkit-text-size-adjust:100%}
/* motion is off for anyone who asks the system for less */
@media (prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}
/* The page background is the graph paper (css/paper.css); --bg is its colour while that sheet loads. */
body{margin:0;background:var(--bg);color:var(--ink);font:400 var(--t-body) var(--sans);padding-bottom:calc(env(safe-area-inset-bottom) + 96px);-webkit-font-smoothing:antialiased;overflow-x:hidden}
body.noscroll{overflow:hidden}
/* The app's text is labels, not a document: none of it is selectable, so a long press or a double tap never highlights
   a word or opens the dictionary. What a person types or may copy opts back in: form fields, editable text, code and
   pre (a token shown once, a link, a command, read text), and the .copyable class (an e-mail address). */
body{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
input,textarea,select,[contenteditable],code,pre,.copyable,.copyable *{-webkit-user-select:text;user-select:text;-webkit-touch-callout:default}
button,input,select,textarea{font:inherit;color:inherit}
.i{width:1.15em;height:1.15em;stroke:currentColor;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;flex:none;vertical-align:-.2em}
.ic{width:20px;height:20px;flex:none;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.ic.lg{width:26px;height:26px}
a{color:inherit}
:focus-visible{outline:3px solid var(--focus);outline-offset:2px} /* A screen's or sheet's name takes focus as it opens (lib/ui.js): ringed for a keyboard, never after a tap or click */ [tabindex="-1"]:focus:not(:focus-visible){outline:none}:is(h1,h2)[tabindex="-1"]:focus-visible{border-radius:8px;outline-offset:3px}
/* Chromium focuses a date field's inner segment, so the input itself matches neither :focus nor :focus-visible and showed no ring */
input[type=date]:focus-within{outline:3px solid var(--focus);outline-offset:2px}
.muted,.mut{color:var(--mut)}.tiny{font-size:12.5px}.small{font-size:14px}.num{font-variant-numeric:tabular-nums}
.ltr{direction:ltr;unicode-bidi:isolate}.bidi{unicode-bidi:plaintext}
[dir=rtl] .flip{transform:scaleX(-1)}
.row{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.row.nowrap{flex-wrap:nowrap}.grow{flex:1;min-width:0}
.stack>*+*{margin-top:10px}
.sr-only{position:absolute;inset-block-start:0;inset-inline-start:0;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;pointer-events:none} /* pinned to its box: at its static place inside a scroller (the hero carousel) it widened the page */
.hidden{display:none!important}

/* type: the screens before the redesign set h2-h4; a redesigned screen uses h2.title (its h1 is the name in the top bar), .sec and .eyebrow */
h1,h2,h3,h4{letter-spacing:-.01em}
h2{font-size:21px;font-weight:700;margin:.4rem 0 .6rem}
h3{font:700 var(--t-caption) var(--sans);margin:1.6rem 0 .6rem;color:var(--mut);letter-spacing:.06em;text-transform:uppercase;display:flex;align-items:center;gap:8px}
:lang(he) h3{letter-spacing:0}
h4{font-size:15px;font-weight:700;margin:1rem 0 .35rem}
p{margin:.45rem 0}
:is(h1,h2).title{margin:0;font:600 var(--t-screen) var(--serif);letter-spacing:-.01em}
:is(h1,h2).title em{font-style:italic;background:linear-gradient(100deg,var(--a),var(--b));-webkit-background-clip:text;background-clip:text;color:transparent;padding-inline-end:.08em}
/* Fraunces has no Hebrew: a Hebrew headline is the sans at its heaviest, upright. */
[lang=he] :is(h1,h2).title{font:800 var(--t-screen) var(--sans);letter-spacing:0}
[lang=he] :is(h1,h2).title em{font-style:normal}
.sec{margin:0;font:700 var(--t-caption) var(--sans);letter-spacing:.06em;text-transform:uppercase;color:var(--mut)}
.eyebrow{align-self:flex-start;display:inline-flex;padding:4px 11px;border:1px solid var(--line);border-radius:var(--pill);font-size:.68rem;font-weight:800;letter-spacing:.12em;text-transform:uppercase;color:var(--mut)}
[lang=he] .sec,[lang=he] .eyebrow{letter-spacing:0}
.head{display:flex;flex-direction:column;gap:10px}
.sub{margin:0;color:var(--ink2);font-size:.95rem}

/* forms: the bare controls; a redesigned screen's .field is css/widgets.css */
input,textarea,select{font:400 16px/1.4 var(--sans);color:var(--ink);background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:10px 12px;width:100%;min-width:0;min-height:48px}
input[type=checkbox],input[type=radio]{width:20px;height:20px;min-height:0;padding:0;accent-color:var(--a);flex:none}
textarea{min-height:84px;resize:vertical}
label.f,div.f{display:flex;flex-direction:column;gap:4px;font-size:13px;color:var(--mut);min-width:0}
label.f>span,div.f>span{font-weight:500}
label.chk{display:flex;gap:9px;align-items:center;font-size:14.5px;color:var(--ink2);cursor:pointer}
.grid2{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:10px}
.grid3{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
@media (max-width:639px){.grid3{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}}

/* top bar */
#top{padding:calc(env(safe-area-inset-top) + 18px) 20px 6px;min-height:60px;max-width:1180px;margin:0 auto;display:flex;align-items:center;gap:10px}
.brand{display:flex;align-items:center;gap:9px;font-weight:700;font-size:.92rem;color:var(--ink2);letter-spacing:.01em;margin-inline-end:auto}
.brand i,.brand .dot{width:11px;height:11px;border-radius:50%;background:linear-gradient(135deg,var(--p1),var(--p2));box-shadow:var(--glow)}
.back{display:inline-flex;align-items:center;gap:4px;min-height:48px;padding-inline:4px 12px;margin-inline-start:-6px;font-weight:700;color:var(--ink2);border-radius:var(--pill);background:none;border:0;cursor:pointer;flex:none;max-width:45%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
/* The screen's name: one line, cut short with an ellipsis rather than wrapping the bar; it pushes the icons to the end. */
.top-name{margin:0;margin-inline-end:auto;min-width:0;font:700 var(--t-title) var(--sans);color:var(--ink);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
/* Me: the person's initial in a 40 px circle inside a 48 px target. */
.me{display:inline-grid;place-items:center;width:48px;height:48px;padding:0;border:0;border-radius:50%;background:none;cursor:pointer;flex:none}
.me-c{display:inline-grid;place-items:center;width:40px;height:40px;border-radius:50%;background:var(--a-soft);color:var(--a);font:800 1rem/1 var(--sans)}.me-c .i{width:20px;height:20px}
.langpick{position:relative;flex:none}.langpick>summary{list-style:none;font:800 .8rem/1 var(--sans);letter-spacing:.02em}.langpick>summary::-webkit-details-marker{display:none}
.langmenu{position:absolute;inset-inline-end:0;top:50px;z-index:var(--z-controls);display:flex;flex-direction:column;min-width:120px;padding:6px;border:1px solid var(--line);border-radius:var(--rm);background:var(--surface);box-shadow:var(--shadow)}
.langmenu button{min-height:48px;padding:0 12px;border:0;border-radius:var(--rm);background:none;color:var(--ink);font:600 .95rem var(--sans);text-align:start;cursor:pointer}.langmenu button[aria-pressed=true]{background:var(--a-soft)}
.topic{display:inline-grid;place-items:center;width:48px;height:48px;border:0;border-radius:50%;background:none;color:var(--ink2);cursor:pointer;flex:none}
.topic .i{width:22px;height:22px}
button.brand{min-height:48px;padding:0;border:0;background:none;font-family:inherit;cursor:pointer}
.iconbtn{display:inline-grid;place-items:center;width:48px;height:48px;border-radius:50%;border:1px solid var(--edge);background:var(--surface);color:var(--ink2);cursor:pointer;flex:none}
.iconbtn.sm{width:32px;height:32px}
/* Sync is silent while all is well; it speaks only when something waits or failed. */
.syncdot{display:inline-flex;align-items:center;gap:7px;min-height:48px;padding-inline:12px;border-radius:var(--pill);border:0;background:var(--d-soft);color:var(--d);font-size:.8rem;font-weight:700}
.syncdot i{width:8px;height:8px;border-radius:50%;background:var(--d)}
/* The one mode stripe, absent on one's own account: one line of 32 px (4.0), cut short; its link a 48 px target by padding
   its negative margin takes back, the stripe above the content after it so that target's lower edge takes the tap. */
.stripe{display:flex;align-items:center;gap:10px;height:32px;padding:0 20px;font-size:.82rem;font-weight:600;line-height:1.2;white-space:nowrap;background:var(--d-soft);color:var(--d)}#demo-banner.stripe{z-index:calc(var(--z-page) + 1)}.stripe .i{flex:none}.stripe-t{min-width:0;overflow:hidden;text-overflow:ellipsis}
.stripe.device{background:var(--a-soft);color:var(--a)}
/* a viewer's stripe wraps, its sentence whole: whose records, as whom, and "Read-only. You can add comments." are what the
   link is (627 px of words in 257 at 390 px), so it grows past 32 px rather than cut them; a long e-mail breaks */
.stripe.viewer{height:auto;min-height:32px;padding-block:6px;white-space:normal}.stripe.viewer .stripe-t{overflow:visible;overflow-wrap:anywhere}
.stripe button{flex:none;margin-inline-start:auto;margin-block:-8px;min-height:48px;padding:8px 12px;border:0;background:none;font-weight:800;text-decoration:underline;text-underline-offset:3px;color:inherit;cursor:pointer}
main{padding:8px 16px 0;max-width:760px;margin:0 auto}
main.wide{max-width:1180px}
/* A redesigned screen sets #app.screen: one column of cards 12 px apart in 16 px gutters (section 6.4), the paper
   showing in both. A tab's own screen (#app.root, app.js) opens under the band: 96 px of the living background with
   nothing on it, then 16 px to the first card (section 4.0); a phone on its side draws no band (section 5.1). */
#app.screen{display:flex;flex-direction:column;gap:var(--s-3);padding:var(--s-2) var(--s-4) var(--s-6);max-width:430px}
#app.screen.root::before{content:'';display:block;flex:none;block-size:96px;margin-block:calc(-1 * var(--s-2)) var(--s-1);pointer-events:none}
@media (max-height:500px) and (min-width:560px){#app.screen.root::before{display:none}}

/* buttons (section 6.5): one primary per screen, 56 px, filled with the primary colour, no glow; the quiet one, every
   other, a 48 px pill with an --edge border and --ink text */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:9px;min-height:48px;padding:0 20px;border-radius:var(--pill);border:1px solid var(--edge);background:transparent;color:var(--ink);font:700 15px/1.2 var(--sans);text-align:center;text-decoration:none;cursor:pointer;white-space:nowrap}
.btn:active{transform:scale(.98)}
.btn.pri,.btn.acc{min-height:56px;border:0;background:var(--primary);color:var(--on-primary);font-size:1.05rem;font-weight:800;box-shadow:none}
.btn.pri .i,.btn.acc .i{stroke:var(--on-primary)}
.btn.block{display:flex;width:100%}
.btn.quiet{border-color:transparent;color:var(--a);min-height:48px;padding-inline:10px}
.btn.del{color:var(--red)}
.btn.ghost{border-color:transparent;background:transparent}
.btn.sm{min-height:32px;padding:0 12px;font-size:13px}
.btn[disabled]{opacity:.45;box-shadow:none;pointer-events:none}
/* A primary that waits (Save meal before anything is typed) stays opaque: at .45 its fill let the paper's grid
   through and its label fell near 2:1 in the dark theme; --mut on --surface2 reads as waiting at about 6:1. */
.btn.pri[disabled],.btn.acc[disabled]{opacity:1;background:var(--surface2);color:var(--mut)}
.actions{display:flex;gap:7px;flex-wrap:wrap;margin:10px 0} /* Save ends its form full width (6.5): the row stacks, the primary at its end, a Delete, Cancel or timer each on a line above; the markup puts Save last, so Tab reaches it last */ form .actions:has(>.btn.pri,>.btn.acc){flex-direction:column;align-items:stretch;gap:8px}
/* controls drawn smaller than 48 px keep a 48 px hit area (section 7.2; e2e/flows/a11y.js measures it): the pseudo-element
   grows the box to at least 48 px each way, never shrinks it */
.btn.sm,.iconbtn.sm,.pill,.chip,.seg button,.tabs button,.cchip button,.defbtn,.tbtn,.switch,.link,.bx-pill{position:relative}
.btn.sm::after,.iconbtn.sm::after,.pill::after,.chip::after,.seg button::after,.tabs button::after,.cchip button::after,.defbtn::after,.tbtn::after,.switch::before,.link::after,.bx-pill::after{content:"";position:absolute;inset:min(0px,calc(50% - 24px))}

/* Bottom navigation: plain words, the current one lit. One column per destination, as many as the mode shows. */
#nav{position:fixed;inset-inline:0;bottom:0;z-index:var(--z-nav);display:grid;grid-auto-flow:column;grid-auto-columns:minmax(0,1fr);padding:8px 4px calc(10px + env(safe-area-inset-bottom));background:var(--surface);border-top:1px solid var(--line)}
#nav:empty{display:none}
#nav button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;min-height:52px;border:0;background:none;border-radius:var(--rm);font:700 var(--t-caption) var(--sans);color:var(--mut);cursor:pointer;position:relative;min-width:0}
#nav button span{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#nav button .i{width:22px;height:22px}
/* A viewer's bar of six or seven panels: each tab is about 55 px at 390 px, so "Training" and "Glucose" at 12 px were
   cut; the bar gives up its side padding, its names take 11 px and a two-word one ("Blood tests") its second line
   (round 24, finding 4). The own bar has five. */
@media (max-width:639px){#nav:has(>button:nth-child(6)){padding-inline:0}#nav:has(>button:nth-child(6)) button span{font-size:.6875rem;line-height:.8125rem;letter-spacing:-.01em;white-space:normal;text-align:center;overflow-wrap:normal}}
#nav button[aria-current=page],#nav button.on{color:var(--ink)}
#nav button[aria-current=page] .ic,#nav button[aria-current=page] .i{stroke:var(--place);filter:drop-shadow(0 0 8px var(--place))}
/* The bar's centre: the + of the Add sheet, a 56 px circle raised 12 px over the bar (ux-redesign-lld section 4.0),
   the same place in Hebrew and English. */
#nav button.plus{overflow:visible}
#nav .plus-in{display:grid;place-items:center;width:56px;height:56px;max-width:none;margin-top:-12px;border-radius:50%;background:linear-gradient(100deg,var(--p1),var(--p2));color:var(--on-p);box-shadow:var(--glow)}
#nav .plus-in .i{width:26px;height:26px;stroke:var(--on-p)}

/* sheet: a bottom sheet on a phone, a dialog from 900 px, a side panel on a phone on its side; one level only, never a chain */
#sheet-root{position:fixed;inset:0;z-index:var(--z-sheet);display:none}
#sheet-root.open{display:block}
.scrim{position:absolute;inset:0;background:var(--scrim)}
.sheet{position:absolute;inset-inline:0;bottom:0;max-height:92vh;background:var(--surface);border:1px solid var(--line);border-bottom:0;border-radius:var(--r) var(--r) 0 0;display:flex;flex-direction:column;box-shadow:var(--shadow);max-width:760px;margin:0 auto}
.sheet.wide{max-width:980px}
.sheet-head{display:flex;align-items:center;gap:10px;padding:18px 20px 6px;position:relative}
.sheet-head h2{flex:1;margin:6px 0 0;font:800 var(--t-title) var(--sans);min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.grab{position:absolute;top:8px;inset-inline:0;margin-inline:auto;width:40px;height:4px;border-radius:4px;background:var(--line)}
.sheet-body{overflow-y:auto;padding:4px 20px calc(env(safe-area-inset-bottom) + 26px);-webkit-overflow-scrolling:touch}
/* Layout by width (section 5.1 of docs/design/ux-redesign-lld.md): a phone's column under 640; a tablet's centred
   column and bar to 899; from 900 a rail at the inline start (search and Me at its end, out of the top bar), sheets a
   centred dialog, and a list's item beside its list (body.panes, lib/pane.js); from 1180 the rail with its words in
   a row and Today in two columns. A phone on its side (height under 500) is the last rule: a 64 px rail, a 44 px top
   bar and sheets as a panel at the inline end, so the short screen keeps its height for the content. */
.rail-end,#pane[hidden]{display:none}
/* the top bar's paper band (css/paper.css) spans the screen beside the rail, from the bar's centre */
body #top::before{inset-inline:calc(50% - (100vw - var(--rail,0px)) / 2)}
@media (min-width:640px){
  #nav{max-width:560px;margin-inline:auto;border-inline:1px solid var(--line);border-start-start-radius:var(--r);border-start-end-radius:var(--r)}
  #app.screen{max-width:600px}
  .sheet{max-width:560px}
  #app :is(.body-tiles,.fd-tiles,.trn-tiles){grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media (min-width:900px){
  body{--rail:calc(88px + env(safe-area-inset-left));padding-inline-start:var(--rail);padding-bottom:calc(env(safe-area-inset-bottom) + 24px)}
  #nav{inset-block:0;inset-inline:0 auto;width:var(--rail);max-width:none;margin:0;display:flex;flex-direction:column;gap:4px;padding:calc(env(safe-area-inset-top) + 16px) 6px 16px;border:0;border-inline-end:1px solid var(--line);border-radius:0;overflow-y:auto}
  #nav .plus{order:-1;margin-bottom:8px}
  #nav .plus-in{margin-top:0}
  #nav .rail-end{display:flex;flex-direction:column;gap:4px;margin-top:auto}
  #top .me,#top [data-to=search]{display:none}
  #top,#app.screen{max-width:720px}
  .sheet{inset:0;margin:auto;height:fit-content;width:min(520px,96vw);max-width:none;max-height:88vh;border:1px solid var(--line);border-radius:var(--r)}
  .sheet.wide{width:min(980px,96vw)}
  .grab{display:none}
  #toast{bottom:calc(env(safe-area-inset-bottom) + 24px)}
  #sw-update{bottom:calc(env(safe-area-inset-bottom) + 12px)}
  body.panes{--lead:calc(var(--rail) + max(0px,(100vw - var(--rail) - 1120px) / 2));padding-inline:calc(var(--lead) + 360px) max(0px,(100vw - var(--rail) - 1120px) / 2)}
  body.panes #pane{position:fixed;inset-block:0;inset-inline-start:var(--lead);width:360px;overflow-y:auto;padding:calc(env(safe-area-inset-top) + 16px) var(--s-4) var(--s-6);border-inline-end:1px solid var(--line);display:flex;flex-direction:column;gap:var(--s-3);z-index:var(--z-page)}
  #pane [aria-current=page]{background:var(--a-soft);border-radius:8px;box-shadow:0 0 0 6px var(--a-soft)}
  body.panes #pane :is(.body-tiles,.fd-tiles,.trn-tiles){grid-template-columns:repeat(2,minmax(0,1fr))}
  body.panes :is(#top,#app.screen){max-width:none}
  body.panes #top::before{inset-inline:0 calc(-1 * max(0px,(100vw - var(--rail) - 1120px) / 2))}
}
@media (min-width:1180px){
  body{--rail:calc(220px + env(safe-area-inset-left))}
  #nav{padding-inline:12px}
  #nav button:not(.plus){flex-direction:row;justify-content:flex-start;gap:12px;padding-inline:14px;font-size:.95rem}
  #nav .plus{align-self:flex-start;margin-inline-start:8px}
  #top:has(~#app[data-view=today]),#app.screen[data-view=today]{max-width:1120px}
  #home:has(>#tdy-entries){display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-template-rows:repeat(8,min-content) 1fr;column-gap:var(--s-5);align-items:start}
  #home:has(>#tdy-entries)>*{grid-column:1}
  #home:has(>#tdy-entries)>#tdy-entries{grid-column:2;grid-row:1/-1}
}
@media (max-height:499px) and (min-width:560px){
  body{--rail:calc(64px + env(safe-area-inset-left));padding-inline:var(--rail) env(safe-area-inset-right);padding-bottom:calc(env(safe-area-inset-bottom) + 16px)}
  #nav{inset-block:0;inset-inline:0 auto;width:var(--rail);max-width:none;margin:0;display:flex;flex-direction:column;justify-content:center;gap:0;padding:4px 4px calc(4px + env(safe-area-inset-bottom));border:0;border-inline-end:1px solid var(--line);border-radius:0}
  #nav button,#nav button:not(.plus){flex-direction:column;justify-content:center;gap:1px;min-height:48px;padding-inline:0;font-size:.68rem}
  #nav .plus{order:-1;align-self:auto;margin:0 0 2px}
  #nav .plus-in{width:44px;height:44px;margin-top:0}
  #top .me,#top [data-to=search]{display:inline-grid}
  #top{min-height:44px;padding-block:calc(env(safe-area-inset-top) + 4px) 2px}
  #app.screen{max-width:640px}
  .sheet,.sheet.wide{inset-block:0;inset-inline:auto 0;margin:0;height:auto;width:min(360px,60vw);max-height:none;border-block:0;border-inline-end:0;border-radius:0}
  .sheet.wide{width:100%;border-inline:0}
  .grab,#nav .rail-end{display:none}
  #toast{bottom:calc(env(safe-area-inset-bottom) + 16px)}
}

/* no bar (the welcome, sign-in): no rail, the page centred on the whole screen */
body:has(>#nav:empty){--rail:0px}

/* toast */
#toast{position:fixed;inset-inline:0;margin-inline:auto;width:fit-content;transform:translateY(20px);bottom:calc(env(safe-area-inset-bottom) + 92px);background:var(--ink);color:var(--bg);padding:12px 16px;border-radius:var(--rm);font-size:14px;font-weight:600;box-shadow:var(--shadow);opacity:0;pointer-events:none;transition:opacity .2s,transform .2s;z-index:var(--z-controls);display:flex;gap:12px;align-items:center;max-width:92vw}
#toast.show{opacity:1;transform:translateY(0);pointer-events:auto}
#toast.bad{background:var(--red);color:var(--on-red)}
/* The toast's action (Undo): a 48 px tap target inside a toast that stays slim, its padding taken in to match */
.tbtn{min-height:48px;min-width:48px;margin-block:-10px;margin-inline-end:-8px;padding:0 8px;border:0;background:transparent;color:inherit;font:800 14px var(--sans);text-decoration:underline;cursor:pointer}
/* The new-version bar (lib/sw-update.js): a quiet line just above the bottom bar, at the foot of the screen when the bar is hidden; under sheets */
#sw-update{position:fixed;inset-inline:12px;bottom:calc(env(safe-area-inset-bottom) + 80px);z-index:var(--z-nav);display:flex;align-items:center;justify-content:space-between;gap:12px;max-width:520px;margin-inline:auto;padding-block:4px;padding-inline:14px 6px;border:1px solid var(--line);border-radius:var(--rm);background:var(--surface);color:var(--ink);box-shadow:var(--shadow);font:600 14px/1.3 var(--sans)}
#sw-update[hidden]{display:none}
#nav:empty + #sw-update{bottom:calc(env(safe-area-inset-bottom) + 12px)}
#sw-update button{min-height:48px;padding:0 14px;border:0;border-radius:var(--rm);background:none;color:var(--a);font:800 14px var(--sans);text-decoration:underline;text-underline-offset:3px;cursor:pointer}

/* print */
@media print{
  nav#nav,header#top,#toast,#sw-update,.noprint,.demo-banner,.stripe,.paper{display:none!important}
  :root,:root[data-theme]{color-scheme:light;--bg:#fff;--paper:#fff;--ink:#000;--line:#ccc}
  body{padding:0;background:var(--bg)}
  main{max-width:none;padding:0}
  .card{break-inside:avoid;box-shadow:none}
}
