/* Evokina — design tokens measured from eightsleep.com (see docs/DESIGN.md)

   SHARED CLASSES (use these in screens; put screen-only rules in screens/<name>.css)
   Text      .label (mono caps, data only)  .eyebrow  .muted  .error
   Buttons   .btn  + .secondary .quiet .sm .block
   Pills     .pill  + .blue (solid)  .blue.soft (tint, ink text)  .blue.outline  .dot (blue dot before the text)
   Chips     .chips > .chip  + .on .sm
   Layout    .wrap  .section (+ .dark .grey)  .stack  .grid  .on-dark
   Cards     .card (+ .dark)  .photo-card
   Metrics   .metrics > .metric > .label + .value > .unit    .bar > i
   Forms     .field > label + input | select | textarea

   Sheet (.sheet)  Opened from a screen with ctx.sheet(html) / ctx.confirm(message, okLabel); never built by hand.
             Inside a sheet: any element with data-close-sheet closes it; .sheet-actions stacks buttons;
             .sheet-message is the large line a confirm shows.

   Timeline (.timeline)  A vertical list with the time in mono on the left.
             <ol class="timeline">
               <li class="day">The evening before</li>
               <li class="done"><time>19:00</time><div><strong>Dinner</strong><p>White rice, chicken, little veg.</p></div></li>
               <li class="now"><time>06:30</time><div><strong>Breakfast</strong><p>Bagel with jam.</p><span class="meta">90 g carbs</span></div></li>
               <li><time>09:00</time><div><strong>Start</strong></div></li>
             </ol>
             li.now = blue dot, li.done = greyed, li.day = a heading row with no time. Works inside .on-dark.

   Phase strip (.phase-strip)  A segmented bar: before / the day / after. --w is the segment's share of the width (its days).
             <div class="phase-strip">
               <div class="seg done" style="--w:10"><i></i><span>Build</span></div>
               <div class="seg on" style="--w:2"><i></i><span>Carb load</span></div>
               <div class="seg day"><i></i><span>The day</span></div>
               <div class="seg" style="--w:5"><i></i><span>Recover</span></div>
             </div>
             .seg.done = behind you, .seg.on = where you are (blue, label never cut), .seg.day = the event itself
             (ink, as wide as its label). Other labels shorten with an ellipsis when their segment is narrow.
             A .seg may be a <button>. .phase-strip.compact hides the labels. Works inside .on-dark.

   Shell only (index.html + app.js): .install-hint  .update-bar  .boot-error  .sheet-backdrop
*/
:root {
  --white: #17171c;
  --grey-1: #0e0e11;
  --grey-2: #1f1f25;
  --grey-3: #34343c;
  --ink: #f3f3f5;
  --ink-2: #d6d6dc;
  --muted: #9a9aa5;
  --black: #121216;
  --blue: #c8ff3d;
  --navy: #2f3d1f;
  --on-dark-muted: rgba(255,255,255,.55);
  --radius-s: 10px;
  --radius-m: 16px;
  --radius-l: 22px;
  --font: "Plus Jakarta Sans", "Helvetica Neue", Arial, sans-serif;
  --display: "Plus Jakarta Sans", "Helvetica Neue", Arial, sans-serif;
  --hand: "Caveat", "Bradley Hand", cursive;
  --on-ink: #0e0e11;
  --on-accent: #0e0e11;
  --line: rgba(255,255,255,.10);
  --line-2: rgba(255,255,255,.18);
  --danger: #ff6b5a;
  --shadow-1: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px rgba(0,0,0,.35);
  color-scheme: dark;
  --paper: #0e0e11;
  --mono: "Plus Jakarta Sans", "Helvetica Neue", Arial, sans-serif;
  --nav-h: 64px;
  --tabbar-h: calc(48px + env(safe-area-inset-bottom, 0px));
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--paper); color: var(--ink); font-family: var(--font); font-size: 17px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
h1, h2, h3 { font-weight: 500; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: clamp(40px, 8vw, 72px); line-height: .95; letter-spacing: -0.03em; }
h2 { font-size: clamp(28px, 4vw, 44px); line-height: 1.1; }
h3 { font-size: 22px; line-height: 1.2; }
p { margin: 0; }
.muted { color: var(--muted); }

/* labels in mono caps — data only, never sentences */
.label { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.on-dark .label { color: var(--on-dark-muted); }
.eyebrow { font-size: 12px; letter-spacing: .13em; text-transform: uppercase; font-weight: 500; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 14px 28px; border-radius: var(--radius-s); border: 1px solid var(--ink); background: var(--ink); color: var(--on-ink); font-size: 17px; font-weight: 400; transition: opacity .15s; }
.btn:hover { opacity: .85; }
.btn.secondary { background: transparent; color: var(--ink); }
.btn.quiet { background: transparent; border-color: var(--grey-3); color: var(--ink); }
.btn.sm { padding: 10px 18px; font-size: 15px; }
.btn.block { width: 100%; }
.on-dark .btn { background: var(--ink); color: var(--on-ink); border-color: #fff; }
.on-dark .btn.secondary { background: transparent; color: #fff; }

/* pills */
.pill { display: inline-block; padding: 5px 11px; border-radius: 999px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; font-weight: 500; background: var(--grey-2); color: var(--ink); }
.on-dark .pill { background: rgba(255,255,255,.18); color: #fff; }
.pill.blue { background: var(--blue); color: var(--on-accent); }
.pill.blue.soft { background: rgba(200,255,61,.14); color: var(--ink); }
.pill.blue.outline { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--blue); }
.pill.dot::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 7px; border-radius: 50%; background: var(--blue); vertical-align: 1px; }
.on-dark .pill.blue.soft { background: rgba(200,255,61,.3); color: #fff; }
.on-dark .pill.blue.outline { background: transparent; color: #fff; }

/* chips: ONE definition for every screen (Week, Settings, the events form). Screen stylesheets stay loaded once
   visited, so a second global .chip in any of them would restyle the others; Recipes scopes its own filter look. */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 44px; padding: 12px 16px; border-radius: 999px; border: 1px solid var(--grey-3); background: var(--white); color: var(--ink); font-size: 14px; font-weight: 500; letter-spacing: .02em; line-height: 1; }
.chip.on { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.chip.sm { min-width: 52px; padding: 10px 12px; display: inline-flex; align-items: center; justify-content: center; }
.chip[disabled] { opacity: .5; cursor: default; }

/* nav */
.nav { position: sticky; top: 0; z-index: 10; height: var(--nav-h); display: flex; align-items: center; justify-content: space-between; padding: 0 20px; background: rgba(255,255,255,.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--grey-2); }
.nav .brand { font-weight: 600; font-size: 20px; letter-spacing: -0.03em; }
.nav .links { display: flex; gap: 22px; }
.nav .links a { font-size: 12px; letter-spacing: .13em; text-transform: uppercase; font-weight: 500; color: var(--muted); padding: 6px 0; border-bottom: 2px solid transparent; }
.nav .links a.active { color: var(--ink); border-bottom-color: var(--ink); }
/* each tab fills its share of the bar and is at least 48px tall: it is the one control on every screen of the phone app */
.tabbar { display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 10; height: var(--tabbar-h); background: rgba(255,255,255,.96); backdrop-filter: blur(10px); border-top: 1px solid var(--grey-2); padding: 0 0 env(safe-area-inset-bottom, 0px); justify-content: space-around; }
.tabbar a { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 4px; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.tabbar a.active { color: var(--ink); }
main { padding-bottom: 80px; }
@media (max-width: 720px) {
  .nav .links { display: none; }
  .tabbar { display: flex; }
  main { padding-bottom: calc(var(--tabbar-h) + 32px); }
}

/* layout */
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.section { padding: 56px 0; }
.section.dark, .on-dark { background: var(--black); color: #fff; }
.section.grey { background: var(--grey-2); }
.stack { display: grid; gap: 16px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

/* cards */
.card { background: var(--white); border: 1px solid var(--grey-2); border-radius: var(--radius-l); padding: 20px; }
.card.dark { background: var(--black); color: #fff; border-color: transparent; }
.photo-card { position: relative; overflow: hidden; border-radius: var(--radius-l); aspect-ratio: 4/5; background: var(--grey-3) center/cover no-repeat; color: #fff; display: flex; flex-direction: column; justify-content: flex-end; padding: 18px; }
.photo-card::before { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.75), rgba(0,0,0,0) 60%); }
.photo-card > * { position: relative; }
.photo-card .pill { position: absolute; top: 14px; left: 14px; background: rgba(255,255,255,.2); color: #fff; }

/* metric tiles (the dark app-mock pattern) */
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; }
.metric { padding: 16px; border-radius: var(--radius-m); background: rgba(255,255,255,.06); min-width: 0; }
.metric .value { font-size: clamp(28px, 9vw, 40px); font-weight: 500; letter-spacing: -0.02em; line-height: 1; margin: 8px 0 6px; white-space: nowrap; }
.metric .unit { font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--on-dark-muted); margin-left: 6px; }
@media (max-width: 480px) { .metric .unit { display: block; margin: 4px 0 0; } }
.bar { height: 6px; border-radius: 999px; background: rgba(255,255,255,.14); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--blue); border-radius: 999px; }

/* forms */
.field { display: grid; gap: 6px; }
.field label { font-size: 13px; font-weight: 500; color: var(--muted); }
input, select, textarea { font: inherit; padding: 13px 14px; border: 1px solid var(--grey-3); border-radius: var(--radius-s); background: var(--white); color: var(--ink); width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--blue); outline-offset: 1px; border-color: var(--blue); }
.error { color: var(--ink); font-weight: 500; font-size: 14px; }

/* auth screen */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth .side { background: var(--black); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.auth .form { padding: 48px; display: flex; align-items: center; }
.auth form { width: 100%; max-width: 380px; margin: 0 auto; display: grid; gap: 16px; }
@media (max-width: 820px) { .auth { grid-template-columns: 1fr; } .auth .side { min-height: 40vh; padding: 28px 20px; } .auth .form { padding: 28px 20px; } }

.hidden { display: none !important; }
/* the hidden attribute always hides: a class that sets display (grid, flex) would otherwise show a switched-off element */
[hidden] { display: none !important; }

/* toast */
#toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%) translateY(20px); background: var(--ink); color: var(--on-ink); padding: 12px 18px; border-radius: var(--radius-s); font-size: 15px; opacity: 0; pointer-events: none; transition: all .2s; z-index: 50; max-width: 90vw; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.error { background: var(--ink); border: 1px solid var(--ink); }

/* ===== sheet: opened with ctx.sheet() / ctx.confirm() from app.js ===== */
html.sheet-open, html.sheet-open body { overflow: hidden; }
.sheet-backdrop { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; background: rgba(10,10,10,0); transition: background .2s ease; }
.sheet-backdrop.open { background: rgba(10,10,10,.5); }
.sheet-backdrop.closing { pointer-events: none; }
.sheet { width: 100%; max-width: 560px; max-height: 88vh; max-height: calc(100dvh - 40px - env(safe-area-inset-top, 0px)); display: flex; flex-direction: column; background: var(--white); color: var(--ink); border-radius: var(--radius-l) var(--radius-l) 0 0; transform: translateY(100%); transition: transform .22s ease; outline: none; }
.sheet-backdrop.open .sheet { transform: none; }
.sheet-head { flex: none; display: flex; justify-content: flex-end; padding: 6px 8px 0; }
.sheet-close { min-width: 44px; min-height: 44px; padding: 0 12px; border: 0; border-radius: var(--radius-s); background: transparent; color: var(--muted); font-size: 15px; }
.sheet-close:focus-visible, .sheet .btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.sheet-body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 4px 20px calc(24px + env(safe-area-inset-bottom, 0px)); }
.sheet-confirm .sheet-body { display: grid; gap: 20px; padding-top: 28px; }
.sheet-message { font-size: 20px; font-weight: 500; line-height: 1.25; letter-spacing: -0.01em; }
.sheet-actions { display: grid; gap: 10px; }
.sheet-actions .btn { min-height: 48px; }
@media (min-width: 721px) {
  .sheet-backdrop { align-items: center; padding: 24px; }
  .sheet { max-width: 520px; border-radius: var(--radius-l); transform: translateY(16px); opacity: 0; transition: transform .2s ease, opacity .2s ease; }
  .sheet-backdrop.open .sheet { opacity: 1; }
  .sheet-body { padding-bottom: 24px; }
}
@media (prefers-reduced-motion: reduce) { .sheet-backdrop, .sheet { transition: none; } }

/* ===== timeline: a vertical list with a time column in mono ===== */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline > li { position: relative; display: grid; grid-template-columns: 48px minmax(0, 1fr); column-gap: 24px; padding: 0 0 20px; }
.timeline > li:last-child { padding-bottom: 0; }
.timeline > li > time, .timeline > li > .time { font-family: var(--mono); font-size: 13px; letter-spacing: .02em; line-height: 24px; color: var(--muted); font-variant-numeric: tabular-nums; }
/* the rail and its dot sit in the gap between the two columns */
.timeline > li::before { content: ""; position: absolute; left: 59px; top: 12px; bottom: -12px; width: 1px; background: var(--grey-3); }
.timeline > li:last-child::before { display: none; }
.timeline > li::after { content: ""; position: absolute; left: 55px; top: 8px; width: 9px; height: 9px; border-radius: 50%; background: var(--white); border: 1px solid var(--grey-3); }
.timeline > li.now::after { background: var(--blue); border-color: var(--blue); }
.timeline > li.done::after { background: var(--grey-3); }
.timeline > li.done strong { color: var(--muted); }
.timeline strong { display: block; font-weight: 500; line-height: 24px; }
.timeline p { margin-top: 2px; font-size: 15px; color: var(--muted); }
.timeline .meta { display: inline-block; margin-top: 6px; font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.timeline > li.day { display: block; padding: 4px 0 14px; font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.timeline > li.day::before, .timeline > li.day::after { display: none; }
.on-dark .timeline > li > time, .on-dark .timeline > li > .time, .on-dark .timeline p, .on-dark .timeline .meta, .on-dark .timeline > li.day, .on-dark .timeline > li.done strong { color: var(--on-dark-muted); }
.on-dark .timeline > li::before { background: rgba(255,255,255,.18); }
.on-dark .timeline > li::after { background: var(--black); border-color: rgba(255,255,255,.4); }
.on-dark .timeline > li.now::after { background: var(--blue); border-color: var(--blue); }
.on-dark .timeline > li.done::after { background: rgba(255,255,255,.4); border-color: transparent; }

/* ===== phase strip: before / the day / after as one segmented bar ===== */
.phase-strip { display: flex; align-items: flex-start; gap: 6px; }
.phase-strip .seg { flex: var(--w, 1) 1 0; min-width: 24px; display: grid; gap: 8px; margin: 0; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; }
.phase-strip button.seg { min-height: 44px; align-content: start; padding-top: 4px; }
.phase-strip .seg > i { display: block; height: 6px; border-radius: 999px; background: var(--grey-2); }
.phase-strip .seg > span { font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 4px; }
.phase-strip .seg.done > i { background: var(--grey-3); }
.phase-strip .seg.day { flex: 0 0 auto; }
/* where you are is always named in full; the other labels shorten when their segment is narrow */
.phase-strip .seg.on { min-width: max-content; }
.phase-strip .seg.day > i { background: var(--ink); }
.phase-strip .seg.on > i { background: var(--blue); }
.phase-strip .seg.on > span, .phase-strip .seg.day > span { color: var(--ink); }
.phase-strip.compact .seg > span { display: none; }
.phase-strip.compact .seg.day { flex-basis: 24px; }
.phase-strip.compact .seg.on { min-width: 24px; }
.on-dark .phase-strip .seg > i { background: rgba(255,255,255,.14); }
.on-dark .phase-strip .seg.done > i { background: rgba(255,255,255,.4); }
.on-dark .phase-strip .seg.day > i { background: var(--ink); }
.on-dark .phase-strip .seg.on > i { background: var(--blue); }
.on-dark .phase-strip .seg > span { color: var(--on-dark-muted); }
.on-dark .phase-strip .seg.on > span, .on-dark .phase-strip .seg.day > span { color: #fff; }

/* ===== shell: Add to Home Screen hint, update notice, could-not-start page ===== */
.install-hint { padding: 16px 0; }
.install-hint-card { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px; background: var(--grey-1); }
.install-hint-card p { font-size: 15px; }
.install-hint-card .btn { flex: none; min-height: 44px; }
.update-bar { position: fixed; left: 50%; top: calc(var(--nav-h) + env(safe-area-inset-top, 0px) + 12px); transform: translateX(-50%); z-index: 45; display: flex; align-items: center; gap: 2px; max-width: calc(100vw - 32px); padding: 2px 6px 2px 18px; border-radius: var(--radius-s); background: var(--ink); color: var(--on-ink); font-size: 15px; white-space: nowrap; }
.update-bar button { min-height: 44px; padding: 0 12px; border: 0; background: transparent; color: #fff; font-size: 15px; font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }
.update-bar button.quiet { color: var(--on-dark-muted); font-weight: 400; text-decoration: none; }
.boot-error { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; justify-content: space-between; padding: calc(28px + env(safe-area-inset-top, 0px)) 20px calc(28px + env(safe-area-inset-bottom, 0px)); }
.boot-error .brand { font-weight: 600; font-size: 22px; letter-spacing: -0.03em; }
.boot-error-box { display: grid; gap: 16px; justify-items: start; max-width: 420px; }
.boot-error-box p { color: var(--on-dark-muted); }

/* ===== installed on an iPhone =====
   With the black-translucent status bar the page runs underneath the clock. The inset is 0 in a browser tab, so
   none of this changes anything there; installed, a near-black strip backs the clock and the nav sits below it. */
body::before { content: ""; position: fixed; top: 0; left: 0; right: 0; height: env(safe-area-inset-top, 0px); background: var(--black); z-index: 40; pointer-events: none; }
#app { padding-top: env(safe-area-inset-top, 0px); }
.nav { top: env(safe-area-inset-top, 0px); }
.auth .side { padding-top: calc(48px + env(safe-area-inset-top, 0px)); }
@media (max-width: 820px) { .auth .side { padding-top: calc(28px + env(safe-area-inset-top, 0px)); } }

/* ---- .sticky-bar: one action that rides at the foot of the screen (Week: "Done, build my basket"; Playbooks:
   "Start this playbook"). The screen adds body.has-sticky while it shows and takes it off when it leaves. ---- */
.sticky-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 11; background: rgba(255,255,255,.96); backdrop-filter: blur(10px); border-top: 1px solid var(--grey-2); padding: 12px 0 max(12px, env(safe-area-inset-bottom)); }
.sticky-bar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sticky-bar .muted { font-size: 14px; }
body.has-sticky main { padding-bottom: 180px; }
body.has-sticky #toast { bottom: 150px; }
@media (max-width: 720px) {
  .sticky-bar { bottom: var(--tabbar-h); padding-bottom: 12px; }
  body.has-sticky #toast { bottom: 200px; }
  .sticky-bar .btn { padding: 12px 18px; font-size: 16px; }
}

/* On a phone "Log out" is in Settings, behind a question: at the top of every screen it was one stray tap from ending the session. */
@media (max-width: 720px) { .nav #logoutBtn { display: none; } }

/* ============================================================================================================
   BRAND v4 "dark and sporty, softly spoken" (Si chose look A on 8 Oct 2026, and asked for type that is "a little
   bit less bullish and firm", because the people using this are not all athletes).
   Near-black page, raised charcoal cards, one lime accent, white text. Type is Plus Jakarta Sans at medium weights:
   friendly and round, never shouting. No uppercase mono labels, no ultra-bold, no tight tracking.
   The token names are historical: --blue is the accent (lime), --navy the second green, --white the card surface,
   --ink the text colour, --paper and --grey-1 the page. --on-ink / --on-accent are the text colours on those fills.
   Brand pack: /brand.html
   ============================================================================================================ */
html, body { background: var(--paper); color: var(--ink); font-size: 16.5px; line-height: 1.5; }
h1, h2, h3, .nav .brand, .metric .value, .sheet-message { font-family: var(--display); font-weight: 600; letter-spacing: -0.02em; }
h1 { font-size: clamp(34px, 7vw, 60px); line-height: 1.04; font-weight: 700; }
h2 { font-size: clamp(26px, 4vw, 40px); line-height: 1.12; }
h3 { font-size: 20px; line-height: 1.25; letter-spacing: -0.012em; }
.nav .brand { font-size: 21px; font-weight: 700; letter-spacing: -0.02em; }
.label { font-family: var(--font); font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: none; color: var(--muted); }
.on-dark .label { color: var(--muted); }
.eyebrow { font-family: var(--font); font-size: 13px; font-weight: 600; letter-spacing: .02em; text-transform: none; color: var(--blue); }
.error { color: var(--danger); }

.nav, .tabbar { background: rgba(14,14,17,.82); -webkit-backdrop-filter: saturate(160%) blur(18px); backdrop-filter: saturate(160%) blur(18px); border-color: var(--line); }
.nav .links a, .tabbar a { letter-spacing: .02em; text-transform: none; font-size: 12.5px; font-weight: 600; }
.tabbar a { font-size: 11.5px; }
.nav .links a.active, .tabbar a.active { color: var(--blue); border-bottom-color: var(--blue); }
.section.dark, .on-dark { background: var(--black); color: var(--ink); }
.section.grey { background: var(--black); }
.card, .log-row, .log-chip, .log-item { border-color: var(--line); }
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-l); box-shadow: none; }
.card.dark { background: var(--grey-2); color: var(--ink); border-color: var(--line); }
.metric { border-radius: var(--radius-m); }
.on-dark .metric { background: var(--white); border: 1px solid var(--line); }
.photo-card { border-radius: var(--radius-l); }
.photo-card::before { background: linear-gradient(to top, rgba(0,0,0,.86), rgba(0,0,0,.2) 55%, rgba(0,0,0,0) 78%); }
input, select, textarea, .field input { background: var(--grey-2); color: var(--ink); border: 1px solid var(--line-2); border-radius: var(--radius-m); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .8; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); outline: 3px solid rgba(200,255,61,.18); outline-offset: 0; }

/* buttons: the main action is the accent; everything else is quiet */
.btn { border: 1px solid transparent; border-radius: 999px; background: var(--blue); color: var(--on-accent); font-family: var(--font); font-weight: 600; letter-spacing: 0; box-shadow: none; transition: transform .15s ease, filter .15s ease, opacity .15s; }
.btn:hover { opacity: 1; filter: brightness(1.06); }
.btn:active { transform: scale(.97); }
.btn.secondary, .btn.quiet, .on-dark .btn.secondary { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn.secondary:hover, .btn.quiet:hover { background: rgba(255,255,255,.06); filter: none; }
.on-dark .btn { background: var(--blue); color: var(--on-accent); border-color: transparent; }
.btn[disabled] { opacity: .45; }

/* Logo and the short explanation shown before sign-in. */
.brand-lockup { display: inline-flex; align-items: center; gap: 12px; font-family: var(--font); font-weight: 700; }
.brand-dot { color: var(--blue); }
.brand-symbol { display: inline-block; position: relative; flex: 0 0 36px; width: 36px; height: 44px; overflow: hidden; }
.brand-symbol img { mix-blend-mode: lighten; position: absolute; width: 72px; height: 72px; max-width: none; left: -20px; top: -14px; }
.auth .brand-lockup { font-size: 28px; }
.auth-steps { margin-top: 28px; padding-left: 22px; color: var(--on-dark-muted); display: grid; gap: 10px; font-size: 16px; }
.auth-steps li::marker { color: var(--blue); }

.pill { transform: none; border: 0; background: rgba(255,255,255,.10); color: var(--ink); font-weight: 600; letter-spacing: .02em; text-transform: none; font-size: 12.5px; }
.on-dark .pill { background: rgba(255,255,255,.14); color: var(--ink); }
.photo-card .pill { background: rgba(0,0,0,.55); color: #fff; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.pill.blue { background: var(--blue); color: var(--on-accent); }
.chip { border: 1px solid var(--line-2); background: transparent; color: var(--ink); letter-spacing: 0; }
.chip.on { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.bar { height: 6px; border-radius: 999px; background: rgba(255,255,255,.12); }
.bar > i { border-radius: inherit; transform-origin: left; animation: jb-grow .9s cubic-bezier(.2,.8,.2,1) both; }
#toast { background: var(--ink); color: var(--on-ink); }

@keyframes jb-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes jb-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
#screen > * > .wrap > *, .metric, .card, .photo-card { animation: jb-rise .45s cubic-bezier(.2,.8,.2,1) both; }
#screen > * > .wrap > *:nth-child(2) { animation-delay: .05s; } #screen > * > .wrap > *:nth-child(3) { animation-delay: .1s; }
#screen > * > .wrap > *:nth-child(n+4) { animation-delay: .15s; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* score out of 10: one tap. 7 and up (the keepers) carry the accent so the line between "stays" and "goes" shows */
.score-row { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; width: 100%; }
.score-btn { min-height: 44px; padding: 0; border: 1px solid var(--line-2); border-radius: 12px; background: transparent; color: var(--ink); font-family: var(--font); font-weight: 600; font-size: 15px; }
.score-btn.keep { background: rgba(200,255,61,.12); color: var(--blue); border-color: rgba(200,255,61,.35); }
.score-btn.on { background: var(--blue); color: var(--on-accent); border-color: var(--blue); transform: scale(1.08); }
.score-btn:disabled { opacity: .5; }
.score-key { display: flex; justify-content: space-between; gap: 10px; font-size: 11.5px; color: var(--muted); }
.fb-row .score-row { margin-top: 10px; }
.fb-row { flex-direction: column; align-items: stretch !important; }
.basket-packs { border-radius: 999px; }

/* softly spoken: nothing in the app is set in capitals, and numbers line up without a typewriter face */
body * { text-transform: none !important; }
body { font-variant-numeric: tabular-nums; }
#logOpen { background: var(--blue); color: var(--on-accent); border-color: transparent; }

/* the wordmark, while the app finds out who you are */
.boot-wait { position: fixed; inset: 0; z-index: 5; display: grid; place-items: center; background: var(--paper); }
.boot-wait span { font-family: var(--display); font-weight: 700; font-size: 40px; letter-spacing: -.04em; animation: jb-breathe 1.6s ease-in-out infinite; }
.boot-wait i { font-style: normal; color: var(--blue); }
@keyframes jb-breathe { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }

/* ============================================================================================================
   FEEL (8 Oct 2026). Si: "way too clunky… the transitions on the touches have to be way smoother."
   What this fixes: taps had no response and a delay; every redraw replayed the entrance animation; the screen went
   blank between tabs. Rules here: a touch answers at once, things move only when a screen arrives, nothing jumps.
   ============================================================================================================ */
html { -webkit-text-size-adjust: 100%; scroll-behavior: auto; }
body { -webkit-tap-highlight-color: transparent; overscroll-behavior-y: none; }
a, button, .chip, .btn, summary, label, [role="button"], .photo-card, .card[href] { touch-action: manipulation; -webkit-touch-callout: none; }
button, .chip, .btn, .tabbar a, summary { -webkit-user-select: none; user-select: none; }
input, select, textarea { font-size: 16.5px; } /* under 16 px iOS zooms the page on focus */

/* a touch answers at once: press in, release out */
.btn, .chip, .score-btn, .log-result, .more-tile, .com-group, .coming-card, .rc-card, .meal-photo, .meal-card, .jab-snack, .tabbar a, .basket-check, .basket-packs {
  transition: transform .14s cubic-bezier(.2,.8,.2,1), background-color .18s ease, border-color .18s ease, color .18s ease, opacity .18s ease, box-shadow .18s ease;
}
.btn:active, .chip:active, .score-btn:active, .basket-packs:active { transform: scale(.955); }
.log-result:active, .more-tile:active, .rc-card:active, .meal-photo[role="button"]:active, .meal-card:active, .jab-snack:active { transform: scale(.98); opacity: .9; }
.chip.on, .score-btn.on { transition-duration: .2s; }
a:not(.btn):not(.chip):active { opacity: .6; }
.btn[disabled], .chip[disabled] { transform: none; }

/* things move when a screen arrives, never when a tap redraws part of it */
#screen > * > .wrap > *, .metric, .card, .photo-card { animation: none; }
#screen.entering > * > .wrap > * { animation: jb-rise .38s cubic-bezier(.2,.8,.2,1) both; }
#screen.entering > * > .wrap > *:nth-child(2) { animation-delay: .04s; }
#screen.entering > * > .wrap > *:nth-child(3) { animation-delay: .08s; }
#screen.entering > * > .wrap > *:nth-child(n+4) { animation-delay: .12s; }
@keyframes jb-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.bar > i { animation: none; transition: width .5s cubic-bezier(.2,.8,.2,1); }
#screen { transition: opacity .12s ease; }
#screen.leaving { opacity: .55; }

/* one screen fades into the next */
::view-transition-old(root) { animation: jb-out .14s ease both; }
::view-transition-new(root) { animation: jb-in .22s ease both; }
@keyframes jb-out { to { opacity: 0; } }
@keyframes jb-in { from { opacity: 0; } }
.nav { view-transition-name: jb-nav; } .tabbar { view-transition-name: jb-tabs; }
::view-transition-group(jb-nav), ::view-transition-group(jb-tabs) { animation: none; }
::view-transition-old(jb-nav), ::view-transition-new(jb-nav), ::view-transition-old(jb-tabs), ::view-transition-new(jb-tabs) { animation: none; }

/* the bar you use most: an icon, a label, a lit tab that slides its colour in */
.tabbar { height: calc(58px + env(safe-area-inset-bottom, 0px)); }
:root { --tabbar-h: calc(58px + env(safe-area-inset-bottom, 0px)); }
.tabbar a { flex-direction: column; gap: 3px; min-height: 56px; font-size: 11px; font-weight: 600; color: var(--muted); border: 0; }
.tabbar a svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s cubic-bezier(.2,.8,.2,1); }
.tabbar a.active { color: var(--blue); }
.tabbar a.active svg { transform: translateY(-1px) scale(1.08); }
.tabbar a:active svg { transform: scale(.9); }

/* messages and sheets glide */
#toast { transition: opacity .22s ease, transform .28s cubic-bezier(.2,.8,.2,1); border-radius: 999px; bottom: calc(var(--tabbar-h) + 18px); }
.sheet-backdrop { transition: background .26s ease; }
.lunch-examples > summary, .log-quick > summary { list-style: none; } .lunch-examples > summary::-webkit-details-marker, .log-quick > summary::-webkit-details-marker { display: none; }
.lunch-examples > summary::after, .log-quick > summary::after { content: "+"; float: right; color: var(--muted); transition: transform .2s ease; }
.lunch-examples[open] > summary::after, .log-quick[open] > summary::after { transform: rotate(45deg); }
img { transition: opacity .3s ease; }
@media (prefers-reduced-motion: reduce) { #screen.entering > * > .wrap > *, ::view-transition-old(root), ::view-transition-new(root) { animation: none !important; } }
.sheet { transition: transform .34s cubic-bezier(.2,.9,.2,1), opacity .2s ease; }
/* one lime button per view: quiet and secondary buttons stay outlined inside dark sections too */
.on-dark .btn.quiet, .on-dark .btn.secondary { background: transparent; color: var(--ink); border-color: var(--line-2); }
