/* =========================================================================
   My TYGR
   Tokens, fonts and type follow tygrwellness.com and the Academy. Dark is the
   default; light follows the device setting. Charts use the brand fire and
   gold; meeting a goal adds the success colour, never colour alone.
   ========================================================================= */

/* ---------- Fonts ---------- */
@font-face { font-family: 'Bricolage Grotesque'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/bricolage-grotesque-latin-600-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Bricolage Grotesque'; font-style: normal; font-weight: 800; font-display: swap; src: url('/fonts/bricolage-grotesque-latin-800-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Figtree'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/figtree-latin-400-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Figtree'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/figtree-latin-600-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Figtree'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/figtree-latin-ext-400-normal.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Figtree'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/figtree-latin-ext-600-normal.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Figtree Fallback'; src: local('Arial'), local('Roboto'), local('Helvetica Neue'); size-adjust: 101.72%; ascent-override: 93.39%; descent-override: 24.58%; line-gap-override: 0%; }
@font-face { font-family: 'Bricolage Fallback'; src: local('Arial'), local('Roboto'), local('Helvetica Neue'); size-adjust: 112.14%; ascent-override: 82.93%; descent-override: 24.08%; line-gap-override: 0%; }

/* ---------- Tokens ---------- */
:root {
  color-scheme: dark;
  --bg: #0b0a09;
  --surface: #151311;
  --surface-2: #1e1b18;
  --text: #f5f1ea;
  --muted: #a39b8f;
  --fire: #ff6a00;
  --gold: #ffb300;
  --gradient: linear-gradient(135deg, #ff6a00, #ffb300);
  --on-gradient: #1a0d02;
  --line: rgb(245 241 234 / 0.1);
  --line-strong: rgb(245 241 234 / 0.2);
  --focus: #ffb300;
  --danger: #ff8f80;
  --success: #5fd8a8;
  --accent: #ffb300;
  --accent-ink: #ffb300;

  --font-display: 'Bricolage Grotesque', 'Bricolage Fallback', system-ui, sans-serif;
  --font-body: 'Figtree', 'Figtree Fallback', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --step--1: 0.882rem;
  --step-0: 1rem;
  --step-1: 1.2rem;
  --step-2: clamp(1.4rem, 1.25rem + 0.6vw, 1.7rem);
  --step-3: clamp(1.75rem, 1.45rem + 1.3vw, 2.4rem);
  --step-4: clamp(2.1rem, 1.6rem + 2.2vw, 3.3rem);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius: 14px;
  --radius-sm: 10px;
  --pill: 999px;
  --gutter: 16px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme='dark']) {
    color-scheme: light;
    --bg: #faf7f2;
    --surface: #ffffff;
    --surface-2: #f1ece4;
    --text: #1a1714;
    --muted: #6b6358;
    --fire: #c2410c;
    --gold: #b45309;
    --line: rgb(26 23 20 / 0.12);
    --line-strong: rgb(26 23 20 / 0.24);
    --focus: #c2410c;
    --danger: #b42318;
    --success: #067647;
    --accent-ink: #b45309;
  }
}
:root[data-theme='light'] {
  color-scheme: light;
  --bg: #faf7f2;
  --surface: #ffffff;
  --surface-2: #f1ece4;
  --text: #1a1714;
  --muted: #6b6358;
  --fire: #c2410c;
  --gold: #b45309;
  --line: rgb(26 23 20 / 0.12);
  --line-strong: rgb(26 23 20 / 0.24);
  --focus: #c2410c;
  --danger: #b42318;
  --success: #067647;
  --accent-ink: #b45309;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html {
  font-size: 106.25%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--bg);
}
@media (min-width: 960px) { html { font-size: 112.5%; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
  overflow-x: clip;
}
h1, h2, h3 { font-family: var(--font-display); margin: 0; text-wrap: balance; }
h1 { font-weight: 800; font-size: var(--step-4); line-height: 1.06; letter-spacing: -0.025em; }
h2 { font-weight: 800; font-size: var(--step-3); line-height: 1.1; letter-spacing: -0.02em; }
h3 { font-weight: 600; font-size: var(--step-1); line-height: 1.3; }
p, ul, ol { margin: 0; }
p { text-wrap: pretty; }
strong { font-weight: 600; }
img { display: block; max-width: 100%; height: auto; }
a { color: var(--fire); text-underline-offset: 0.2em; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
main:focus { outline: none; }
::selection { background: color-mix(in srgb, var(--fire) 35%, transparent); color: var(--text); }
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -100px; z-index: 200;
  padding: 12px 18px;
  background: var(--text); color: var(--bg);
  font-weight: 600; border-radius: var(--radius-sm);
}
.skip-link:focus { top: 12px; }
.muted { color: var(--muted); }

/* ---------- Icons: Lucide SVGs used as masks, so they take the text colour ---------- */
.icon {
  display: inline-block;
  flex: none;
  width: 1.15em; height: 1.15em;
  background: currentColor;
  mask: var(--i) center / contain no-repeat;
  vertical-align: -0.2em;
}
.i-activity { --i: url('/icons/activity.svg'); }
.i-apple { --i: url('/icons/apple.svg'); }
.i-arrow-left { --i: url('/icons/arrow-left.svg'); }
.i-arrow-right { --i: url('/icons/arrow-right.svg'); }
.i-book { --i: url('/icons/book.svg'); }
.i-brain { --i: url('/icons/brain.svg'); }
.i-calendar { --i: url('/icons/calendar.svg'); }
.i-chats { --i: url('/icons/chats.svg'); }
.i-check { --i: url('/icons/check.svg'); }
.i-chevron-down { --i: url('/icons/chevron-down.svg'); }
.i-clipboard { --i: url('/icons/clipboard.svg'); }
.i-clock { --i: url('/icons/clock.svg'); }
.i-download { --i: url('/icons/download.svg'); }
.i-droplet { --i: url('/icons/droplet.svg'); }
.i-dumbbell { --i: url('/icons/dumbbell.svg'); }
.i-exit { --i: url('/icons/exit.svg'); }
.i-eye { --i: url('/icons/eye.svg'); }
.i-eye-off { --i: url('/icons/eye-off.svg'); }
.i-file { --i: url('/icons/file.svg'); }
.i-heart-pulse { --i: url('/icons/heart-pulse.svg'); }
.i-house { --i: url('/icons/house.svg'); }
.i-image { --i: url('/icons/image.svg'); }
.i-image-off { --i: url('/icons/image-off.svg'); }
.i-info { --i: url('/icons/info.svg'); }
.i-lifebuoy { --i: url('/icons/lifebuoy.svg'); }
.i-lock { --i: url('/icons/lock.svg'); }
.i-mail { --i: url('/icons/mail.svg'); }
.i-menu { --i: url('/icons/menu.svg'); }
.i-moon { --i: url('/icons/moon.svg'); }
.i-plus { --i: url('/icons/plus.svg'); }
.i-refresh { --i: url('/icons/refresh.svg'); }
.i-shield-check { --i: url('/icons/shield-check.svg'); }
.i-stethoscope { --i: url('/icons/stethoscope.svg'); }
.i-sun { --i: url('/icons/sun.svg'); }
.i-trash { --i: url('/icons/trash.svg'); }
.i-user { --i: url('/icons/user.svg'); }
.i-utensils { --i: url('/icons/utensils.svg'); }
.i-watch { --i: url('/icons/watch.svg'); }
.i-x { --i: url('/icons/x.svg'); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 48px;
  padding: 0 1.3rem;
  border: 1px solid transparent;
  border-radius: var(--pill);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.15s var(--ease), background-color 0.15s var(--ease);
}
.btn:disabled { opacity: 0.6; cursor: progress; }
.btn-fire { background: var(--gradient); color: var(--on-gradient); }
.btn-fire:hover:not(:disabled) { transform: translateY(-1px); }
.btn-quiet { min-height: 44px; padding: 0 1rem; background: transparent; border-color: var(--line-strong); color: var(--text); }
.btn-quiet:hover { background: var(--surface-2); }
.btn-block { width: 100%; }
.icon-btn {
  display: inline-grid; place-items: center;
  width: 44px; height: 44px;
  padding: 0;
  border: 0; border-radius: var(--pill);
  background: transparent; color: var(--text);
  font-size: 1.15rem;
  cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.link-btn {
  min-height: 44px;
  padding: 0;
  border: 0; background: none;
  color: var(--fire);
  text-decoration: underline; text-underline-offset: 0.2em;
  cursor: pointer;
}

/* ---------- Header ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 64px;
  padding: 10px max(var(--gutter), env(safe-area-inset-right)) 10px max(var(--gutter), env(safe-area-inset-left));
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.logo { display: inline-flex; align-items: center; gap: 0.55rem; min-height: 44px; color: var(--text); text-decoration: none; }
.logo-mark { width: 26px; }
.logo-word { font: 800 1.35rem / 1 var(--font-display); letter-spacing: 0.02em; }
.logo-wing {
  padding: 0.15rem 0.55rem;
  border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent);
  border-radius: var(--pill);
  color: var(--accent-ink);
  font: 600 var(--step--1) / 1.4 var(--font-body);
}
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.account { display: flex; align-items: center; gap: 10px; min-width: 0; }
.account-email { max-width: 22ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: var(--step--1); }
@media (max-width: 640px) { .account-email { display: none; } }
/* Small phones: the mark and the Academy badge carry the brand, so the
   header still fits Sign out and Exit on one line at 360px. */
@media (max-width: 400px) {
  .logo-word { display: none; }
  .topbar-actions { gap: 6px; }
  .btn-quiet { padding: 0 0.85rem; }
}
.exit {
  display: inline-flex; align-items: center; gap: 0.45rem;
  min-height: 44px;
  padding: 0 0.95rem 0 1.05rem;
  border-radius: var(--pill);
  background: var(--text); color: var(--bg);
  font: 700 var(--step--1) / 1 var(--font-body);
  text-decoration: none;
}


/* Phones: Sign out moves to the More screen so the header fits at 360px. */
@media (max-width: 480px) { .topbar [data-sign-out] { display: none; } }
.icon-btn[aria-pressed='true'] { background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--accent-ink); }

/* ---------- Layout ---------- */
.shell { max-width: 1180px; margin: 0 auto; }
main { min-width: 0; padding: 1.25rem var(--gutter) calc(88px + env(safe-area-inset-bottom)); }
main:focus { outline: none; }
.loading { color: var(--muted); padding: 3rem 0; }

.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: grid; grid-template-columns: repeat(6, 1fr);
  padding: 4px max(4px, env(safe-area-inset-left)) calc(4px + env(safe-area-inset-bottom)) max(4px, env(safe-area-inset-right));
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}
.nav a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 56px; padding: 4px 2px;
  border-radius: var(--radius-sm);
  color: var(--muted); text-decoration: none;
  font-size: 0.74rem; font-weight: 600; line-height: 1.2; text-align: center;
}
.nav a .icon { font-size: 1.35rem; }
.nav a[aria-current='page'] { color: var(--text); background: var(--surface-2); }
.nav a[aria-current='page'] .icon { color: var(--fire); }
.nav .nav-wide { display: none; }

@media (min-width: 900px) {
  .shell { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 1.5rem; padding: 0 var(--gutter); }
  .nav {
    position: sticky; top: 76px; align-self: start;
    display: flex; flex-direction: column; gap: 2px;
    padding: 1.25rem 0; background: none; backdrop-filter: none; border: 0;
  }
  .nav a { flex-direction: row; justify-content: flex-start; gap: 0.7rem; min-height: 46px; padding: 0 0.9rem; font-size: var(--step-0); text-align: left; }
  .nav a .icon { font-size: 1.2rem; }
  .nav .nav-wide { display: flex; }
  .nav .nav-more { display: none; }
  main { padding: 1.5rem 0 4rem; }
}

.footer {
  max-width: 1180px; margin: 0 auto;
  padding: 1.5rem var(--gutter) calc(96px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  color: var(--muted); font-size: var(--step--1);
  display: grid; gap: 0.5rem;
}
@media (min-width: 900px) { .footer { padding-bottom: 2rem; } }

/* ---------- Page parts ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 0.75rem 1rem; margin-bottom: 1.25rem; }
.page-head h1 { font-size: var(--step-3); }
.page-head .sub { color: var(--muted); margin-top: 0.25rem; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 0.45rem;
  margin-bottom: 0.75rem;
  color: var(--accent-ink);
  font-weight: 600; font-size: var(--step--1);
  letter-spacing: 0.04em; text-transform: uppercase;
}
.lede { color: var(--muted); font-size: var(--step-1); max-width: 40rem; }
.small { font-size: var(--step--1); }
h2.section { font-size: var(--step-2); margin: 2rem 0 0.75rem; }
.back { display: inline-flex; align-items: center; gap: 0.35rem; min-height: 44px; margin-bottom: 0.5rem; color: var(--muted); text-decoration: none; font-weight: 600; }
.back:hover { color: var(--text); }

.cards { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.card {
  padding: 1.15rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  min-width: 0;
}
.card h2, .card h3 { font-size: var(--step-1); font-weight: 600; display: flex; align-items: center; gap: 0.5rem; }
.card h2 .icon, .card h3 .icon { color: var(--fire); }
.card > * + * { margin-top: 0.6rem; }
.stat { font: 800 var(--step-3) / 1.1 var(--font-display); letter-spacing: -0.02em; }
.stat small { font: 600 var(--step-0) / 1 var(--font-body); color: var(--muted); letter-spacing: 0; }
.card-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; padding-top: 0.25rem; }
.card-actions .btn { min-height: 44px; }

.track { height: 10px; border-radius: var(--pill); background: var(--surface-2); overflow: hidden; }
.track > span { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--gradient); }
.track.is-met > span { background: var(--success); }

.empty {
  padding: 1.25rem; border: 1px dashed var(--line-strong); border-radius: var(--radius-lg);
  color: var(--muted);
}
.empty strong { color: var(--text); }
.notice {
  display: flex; gap: 0.75rem; align-items: flex-start;
  padding: 1rem 1.1rem; border-radius: var(--radius); background: var(--surface-2);
}
.notice > .icon { color: var(--accent-ink); font-size: 1.2rem; margin-top: 0.15rem; }
.notice p + p { margin-top: 0.4rem; }

/* Smartwatch status */
.warning { display: flex; gap: 0.45rem; align-items: flex-start; }
.warning > .icon { flex: none; margin-top: 0.2rem; color: var(--accent-ink); }
.sync-line { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 1rem; margin-bottom: 1rem; color: var(--muted); font-size: var(--step--1); }
.sync-line > span { display: inline-flex; align-items: center; gap: 0.35rem; }
.sync-line .icon { color: var(--fire); }

.badges { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.badge {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.15rem 0.6rem; border-radius: var(--pill);
  border: 1px solid var(--line-strong);
  font-size: var(--step--1); color: var(--muted);
}
.badge.is-on { border-color: color-mix(in srgb, var(--success) 55%, transparent); color: var(--text); }
.badge.is-on .icon { color: var(--success); }

/* Range switch (7 / 30 / 90 days) */
.segmented { display: inline-flex; padding: 3px; border: 1px solid var(--line-strong); border-radius: var(--pill); }
.segmented a {
  display: inline-grid; place-items: center; min-width: 64px; min-height: 40px; padding: 0 0.9rem;
  border-radius: var(--pill); color: var(--muted); text-decoration: none; font-weight: 600; font-size: var(--step--1);
}
.segmented a[aria-current='true'] { background: var(--text); color: var(--bg); }

/* Lists of entries */
.list { list-style: none; padding: 0; display: grid; gap: 0.5rem; }
.row {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.7rem 0.6rem 0.7rem 1rem;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
}
.row-main { flex: 1; min-width: 0; }
.row-title { font-weight: 600; overflow-wrap: anywhere; }
.row-meta { color: var(--muted); font-size: var(--step--1); }
.row a.row-link { color: inherit; text-decoration: none; display: block; }
.row a.row-link:hover .row-title { text-decoration: underline; }

/* ---------- Forms ---------- */
.form { display: grid; gap: 1rem; max-width: 36rem; }
.field { display: grid; gap: 0.35rem; }
.field-label { font-weight: 600; font-size: var(--step--1); }
.hint { color: var(--muted); font-size: var(--step--1); }
.input, .select, .textarea {
  width: 100%; min-height: 48px; padding: 0.6rem 0.9rem;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font: inherit;
}
.textarea { min-height: 96px; resize: vertical; }
.input:focus-visible, .select:focus-visible, .textarea:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
.input[aria-invalid='true'] { border-color: var(--danger); }
.input-code { font-size: 1.4rem; letter-spacing: 0.35em; }
.input-row { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr)); }
fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.choices { display: grid; gap: 0.4rem; }
.choices-inline { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.choices legend { margin-bottom: 0.4rem; }
.choice { display: inline-flex; align-items: center; gap: 0.5rem; min-height: 44px; padding: 0 0.9rem; border: 1px solid var(--line-strong); border-radius: var(--pill); cursor: pointer; }
.choice:has(input:checked) { border-color: var(--fire); background: color-mix(in srgb, var(--fire) 12%, transparent); }
.choice input, .check input { width: 1.15rem; height: 1.15rem; accent-color: var(--fire); margin: 0; }
.check { display: flex; align-items: flex-start; gap: 0.6rem; min-height: 44px; padding-top: 0.6rem; cursor: pointer; }
.check input { margin-top: 0.2rem; flex: none; }
.form-error { color: var(--danger); font-weight: 600; font-size: var(--step--1); min-height: 0; }
.form-error:empty { display: none; }
.form-error.is-info { color: var(--muted); font-weight: 400; }
.form-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }
.inline-actions { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; }
.btn-danger { background: transparent; border-color: color-mix(in srgb, var(--danger) 60%, transparent); color: var(--danger); min-height: 44px; }
.btn-danger:hover { background: color-mix(in srgb, var(--danger) 12%, transparent); }
.btn-small { min-height: 40px; padding: 0 0.9rem; font-size: var(--step--1); }
.icon-btn.danger { color: var(--danger); }

/* Food picker */
.food-results { list-style: none; padding: 0; display: grid; gap: 0.35rem; }
.food-result {
  width: 100%; display: flex; justify-content: space-between; gap: 0.75rem; align-items: center;
  min-height: 48px; padding: 0.5rem 0.9rem; text-align: left;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer;
}
.food-result:hover { background: var(--surface-2); }
.food-result small { color: var(--muted); }
.picked { list-style: none; padding: 0; display: grid; gap: 0.5rem; }
.picked li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.5rem 0.75rem; align-items: center; padding: 0.75rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.picked .picked-controls { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) 6rem; gap: 0.5rem; }

/* ---------- Charts ---------- */
.chart { margin: 0; padding: 1rem 1.1rem; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.chart figcaption { display: grid; gap: 0.2rem; margin-bottom: 0.6rem; }
.chart-title { font-weight: 600; }
.chart-summary { color: var(--muted); font-size: var(--step--1); }
.chart-svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-bar { fill: var(--gold); }
.chart-bar.is-met { fill: var(--success); }
.chart-gap { fill: var(--line-strong); }
.chart-axis { stroke: var(--line-strong); stroke-width: 1; }
.chart-goal { stroke: var(--text); stroke-width: 1; stroke-dasharray: 4 3; opacity: 0.7; }
.chart-goal-label { fill: var(--text); font-size: 9px; font-family: var(--font-body); opacity: 0.85; }
.chart-tick { fill: var(--muted); font-size: 9px; font-family: var(--font-body); }
.chart-line { fill: none; stroke: var(--gold); stroke-width: 2; stroke-linejoin: round; }
.chart-dot { fill: var(--fire); }
.chart-table { margin-top: 0.6rem; font-size: var(--step--1); }
.chart-table summary { cursor: pointer; color: var(--muted); min-height: 44px; display: flex; align-items: center; }
.chart-table table { width: 100%; border-collapse: collapse; }
.chart-table th, .chart-table td { text-align: left; padding: 0.35rem 0.5rem; border-bottom: 1px solid var(--line); }
.charts { display: grid; gap: 1rem; }
@media (min-width: 1100px) { .charts.two { grid-template-columns: 1fr 1fr; } }

/* ---------- Records ---------- */
.tabs { display: flex; gap: 0.25rem; border-bottom: 1px solid var(--line); margin-bottom: 1.25rem; }
.tabs a { display: inline-flex; align-items: center; gap: 0.4rem; min-height: 48px; padding: 0 1rem; color: var(--muted); text-decoration: none; font-weight: 600; border-bottom: 3px solid transparent; }
.tabs a[aria-current='page'] { color: var(--text); border-bottom-color: var(--fire); }
.photos { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.photo { margin: 0; display: grid; gap: 0.35rem; }
.photo img, .photo .photo-hidden { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: var(--radius); background: var(--surface-2); }
.photo .photo-hidden { display: grid; place-items: center; padding: 0.75rem; text-align: center; color: var(--muted); font-size: var(--step--1); }
.photo figcaption { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; color: var(--muted); font-size: var(--step--1); }
html[data-discreet] .photo img { display: none; }

.locked { display: grid; gap: 1rem; max-width: 34rem; }
.locked > .icon { font-size: 2rem; color: var(--accent-ink); }
.log { list-style: none; padding: 0; display: grid; gap: 0.25rem; font-size: var(--step--1); }
.log li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.25rem 1rem; padding: 0.5rem 0; border-bottom: 1px solid var(--line); }
.log time, .log .device { color: var(--muted); }
.danger-zone { margin-top: 2rem; padding: 1.15rem 1.2rem; border: 1px solid color-mix(in srgb, var(--danger) 45%, transparent); border-radius: var(--radius-lg); }
.danger-zone > * + * { margin-top: 0.75rem; }

/* ---------- Sign in ---------- */
.signin { max-width: 32rem; padding: 2rem 0; display: grid; gap: 1rem; }
.signin h1 { font-size: var(--step-4); }
.signin-form { display: grid; gap: 0.75rem; }
.signin-form h2 { font-size: var(--step-2); }
.consent-list { display: grid; gap: 0.6rem; padding-left: 1.2rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }
/* Headings take focus only so screen readers announce a new screen; they are
   not controls, so no focus ring. */
[data-focus]:focus { outline: none; }
