/* Health — Eat and Move, Personal's own page (the phone's components/health/*).
   Loaded after shell.css, so a repeated selector here wins. Every colour is a
   theme token; the one literal is the house amber (#F59E3C). */

/* ---- the page: the head, then the two halves side by side (pages/health.js) ----
   Its own app again since 14 Oct 2026 (four days as two sections of Today
   before that). The head is the two tabs — 🥗 Eat | 🏋️ Move, an ink pill
   between them — and the half's Progress and Settings. Under it the track
   shows one half; the pager of both slides by the tabs (never by a finger: a
   sideways swipe is the pager's on the phone), and each half scrolls on its
   own, so going back to a half finds it where it was. --hl-x is 0 on Eat and
   1 on Move; the pill and the row both ride it. */
.health-page.hl-page {
  flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 0;
  /* Clear of the rail's row of buttons, which floats over the top of every page. */
  padding: calc(52px + env(safe-area-inset-top)) 0 0;
}
body.embedded .health-page.hl-page { padding-top: 8px; }
.hl-page > .hl-head { flex: none; display: flex; align-items: center; gap: 8px; padding: 2px 16px 8px; margin: 0; }
.hl-head .th-head-acts { display: flex; align-items: center; gap: 8px; flex: none; }
.hl-head .th-head-acts[hidden] { display: none; }
/* The head's icon buttons: bordered, like the phone's IconBtn — and a full 40px to press. */
.health-page .hl-head .add-btn, .health-page .hl-head .icon-btn {
  width: 40px; height: 40px; border-radius: 20px; border: 1px solid var(--border); background: var(--surface); color: var(--ink-muted);
}
.health-page .hl-head .add-btn svg { stroke-width: 34; width: 18px; height: 18px; }
.health-page .hl-head .icon-btn svg { width: 18px; height: 18px; }

/* The tabs: HalfTabs.tsx in CSS. A second, clipped copy of the labels inside
   the pill moves the other way, so the words under it read in the page colour. */
.hl-tabs {
  position: relative; flex: 1; min-width: 0; height: 44px; padding: 3px; box-sizing: border-box;
  border-radius: 16px; border: 1px solid var(--border); background: var(--surface); overflow: hidden;
}
.hl-tabs-row { display: flex; height: 100%; }
.hl-tab {
  flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center;
  min-height: 36px; padding: 0 4px; border: none; background: none; border-radius: 13px;
  font: inherit; font-size: 14.5px; font-weight: 800; color: var(--ink-muted);
  white-space: normal; cursor: pointer; overflow-wrap: break-word;
}
.hl-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.hl-tabs-pill {
  position: absolute; left: 3px; top: 3px; bottom: 3px; width: calc(50% - 3px);
  border-radius: 13px; background: var(--ink); overflow: hidden; pointer-events: none;
  transform: translateX(calc(var(--hl-x, 0) * 100%)); transition: transform .24s cubic-bezier(.2, .8, .2, 1);
}
.hl-tabs-pill .hl-tabs-row { width: 200%; transform: translateX(calc(var(--hl-x, 0) * -50%)); transition: transform .24s cubic-bezier(.2, .8, .2, 1); }
.hl-tabs-pill .hl-tab { color: var(--bg); }

/* The track: one half's width; the pager of both inside it slides by --hl-x. */
.hl-track { flex: 1; min-height: 0; overflow: hidden; position: relative; }
.hl-pager {
  display: flex; width: 200%; height: 100%;
  transform: translateX(calc(var(--hl-x, 0) * -50%)); transition: transform .24s cubic-bezier(.2, .8, .2, 1);
}
.hl-pager > .hl-leaf { flex: 0 0 50%; min-width: 0; height: 100%; overflow-y: auto; overflow-x: hidden; }
@media (prefers-reduced-motion: reduce) {
  .hl-pager, .hl-tabs-pill, .hl-tabs-pill .hl-tabs-row { transition: none; }
}

/* A half: Eat's two faces at its top, its status line, its blocks. --th-gutter
   is the half's side padding; the pane runs edge to edge inside it. */
.th-section { --th-gutter: 16px; min-width: 0; padding: 0 var(--th-gutter) 28px; }
.th-section > .th-head { padding: 2px 2px 8px; gap: 8px; justify-content: flex-start; margin: 0; }
.th-section .hl-strip-slot { flex: none; padding: 0 2px; }
.hl-strip-slot:empty { display: none; }
.hl-strip-slot .hl-strip { margin-bottom: 6px; }
/* The pane is the container the narrow-width rules below measure: it runs to
   the half's edges, so its width is the phone's, padding and all — 390 is 390. */
.th-pane {
  margin-inline: calc(-1 * var(--th-gutter)); min-width: 0;
  container-type: inline-size; container-name: hl-pane;
}
/* --hl-pad is the pane's own side padding; what bleeds to its edges (the row of chips) reads it. */
.th-pane > .hl-pane-in { --hl-pad: var(--th-gutter); padding: 0 var(--hl-pad) 14px; }
.th-pane:empty { display: none; }

/* A half that is not there yet, and one that could not be read. */
.th-skeleton {
  border: 1px solid var(--border); border-radius: 20px; background: var(--surface); padding: 16px; min-height: 96px;
  display: flex; flex-direction: column; gap: 10px; animation: th-shimmer 1.4s ease-in-out infinite;
}
.th-sk-line { height: 12px; border-radius: 6px; background: var(--border); }
.th-sk-line.sm { height: 9px; }
@keyframes th-shimmer { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
.th-failed {
  display: flex; align-items: center; gap: 10px; padding: 13px 14px; border: 1px solid var(--border); border-radius: 16px;
  background: var(--surface); color: var(--ink-muted); font-size: 14px; line-height: 20px;
}
.th-failed .btn { flex: none; }
.screen, .chat-main { position: relative; }
@media (prefers-reduced-motion: reduce) {
  .th-skeleton { animation: none; }
}

/* ---- cards ---- */
.health-page .sp-card, .health-page .hl-session { border-radius: 20px; }
.hl-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.hl-label { font-size: 11px; font-weight: 700; letter-spacing: 1.2px; color: var(--ink-muted); }
.hl-card-sub { font-size: 12.5px; color: var(--ink-muted); margin-top: 2px; white-space: normal; overflow-wrap: break-word; }
.hl-card-head .hl-pill { flex: none; }
.hl-card-head .btn.sm { flex: none; display: inline-flex; align-items: center; gap: 5px; }
.hl-card-head .btn.sm svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 34; }
.hl-card-meta { flex: none; font-size: 13px; font-weight: 600; color: var(--ink); }
.hl-card-meta.over { color: var(--danger); }
.hl-summary { font-size: 13.5px; line-height: 19px; color: var(--ink); margin: -2px 0 4px; }

/* ---- the hero (Eat and Move): the coach, the rings, what is next ---- */
.hl-hero { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 12px; }
.hl-coach { display: flex; align-items: center; gap: 12px; }
.hl-coach-halo { width: 62px; height: 62px; border-radius: 50%; background: var(--accent-soft); display: flex; align-items: center; justify-content: center; flex: none; }
.hl-coach-line { flex: 1; min-width: 0; font-size: 15.5px; line-height: 21px; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }

.hl-rings { display: flex; align-items: center; gap: 14px; }
.hl-ring { position: relative; flex: none; }
.hl-ring > svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hl-ring-track { stroke: var(--accent-soft); }
.hl-ring-fill { transition: stroke-dashoffset .72s cubic-bezier(.2,.7,.2,1); }
.hl-ring-in { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.hl-ring.kcal { width: 136px; height: 136px; }
.hl-ring.week { width: 112px; height: 112px; }
.hl-ring.macro { width: 40px; height: 40px; }
.hl-ring-btn { border: none; background: none; padding: 0; margin: 0; font: inherit; color: inherit; cursor: pointer; border-radius: 50%; display: block; flex: none; }
.hl-ring-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.hl-ring-btn:active { opacity: .7; }
.hl-ring-num { font-size: 30px; line-height: 34px; font-weight: 800; letter-spacing: -0.5px; color: var(--ink); font-variant-numeric: tabular-nums; max-width: 86%; white-space: normal; overflow-wrap: break-word; }
.hl-ring.week .hl-ring-num { font-size: 26px; line-height: 30px; }
.hl-ring-of { font-size: 16px; font-weight: 600; color: var(--ink-faint); letter-spacing: 0; }
.hl-ring-sub { font-size: 12px; font-weight: 700; color: var(--ink-muted); margin-top: -2px; }
.hl-ring.week .hl-ring-sub { font-size: 11.5px; margin-top: -1px; }

.hl-macros { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; justify-content: center; }
.hl-macro { display: flex; align-items: center; gap: 8px; min-width: 0; }
.hl-macro-emoji { font-size: 15px; line-height: 1; }
.hl-macro-txt { min-width: 0; flex-shrink: 1; }
.hl-macro-num { font-size: 13.5px; font-weight: 700; color: var(--ink); white-space: normal; font-variant-numeric: tabular-nums; overflow-wrap: break-word; }
.hl-macro-of { color: var(--ink-faint); font-weight: 500; }
.hl-macro-name { font-size: 11px; color: var(--ink-muted); white-space: nowrap; }

.hl-meta { display: flex; align-items: center; gap: 8px; }
.hl-meta-line { flex: 1; min-width: 0; font-size: 12.5px; color: var(--ink-muted); white-space: normal; overflow-wrap: break-word; }

.hl-next { border-top: 1px solid var(--border); padding-top: 10px; display: flex; flex-direction: column; gap: 6px; margin-top: 0; }
.hl-next-row { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: none; background: none; padding: 0; font: inherit; color: inherit; cursor: pointer; border-radius: 12px; }
.hl-next-row:active { opacity: .7; }
.hl-next-row:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.hl-next-name { font-size: 15px; font-weight: 700; line-height: 20px; color: var(--ink); display: block; overflow-wrap: break-word; }
.hl-next-sub { font-size: 12.5px; color: var(--ink-muted); margin-top: 1px; white-space: normal; overflow-wrap: break-word; }
.hl-hero .hl-actions { padding: 0; }
/* The phone's buttons: 13/700, a little tighter than the house .btn, so Ate it · Swap · Skip share one row. */
.hl-hero .hl-actions .btn { font-size: 13px; padding: 8px 13px; min-height: 36px; }
.hl-hero .hl-actions .btn.sm { font-size: 12.5px; padding: 5px 11px; min-height: 30px; }

/* the Move hero's right column: seven day dots and the pills */
.hl-side { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; justify-content: center; }
.hl-ddays { display: flex; justify-content: space-between; }
.hl-dday {
  width: 26px; height: 26px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800; color: var(--ink-muted); border: 1.5px solid var(--accent); background: transparent;
}
.hl-dday.past { color: var(--ink-faint); border-color: var(--border); }
.hl-dday.today { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.hl-dday.rest { background: transparent; border-color: transparent; color: var(--ink-faint); }
.hl-dday.today.rest { color: var(--accent); }
.hl-dday.skipped { text-decoration: line-through; }
.hl-dday.done { background: var(--success); border-color: var(--success); color: var(--bg); text-decoration: none; }
.hl-pills { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---- suggestion chips: one row that scrolls sideways, bleeding to the edges ---- */
.hl-chips { display: flex; gap: 6px; overflow-x: auto; margin: -2px calc(-1 * var(--hl-pad, 16px)) 0; padding: 2px var(--hl-pad, 16px); scrollbar-width: none; }
.hl-chips::-webkit-scrollbar { display: none; }
/* A pane wider than any phone (the desktop shell, ~520) has no finger to scroll them with: they wrap. */
@container hl-pane (min-width: 470px) { .hl-chips { flex-wrap: wrap; overflow: visible; margin: 0; padding: 0; } }
.hl-chips .hl-chip { flex: none; }
.hl-chip { display: inline-flex; align-items: center; gap: 5px; min-height: 30px; white-space: nowrap; }
.hl-chip svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 34; flex: none; }
.hl-chip.sm { padding: 4px 9px; min-height: 26px; font-size: 11.5px; }
.hl-chip.accent { color: var(--accent); background: color-mix(in srgb, var(--accent) 13%, transparent); border-color: color-mix(in srgb, var(--accent) 33%, transparent); }
.hl-chip.amber { color: color-mix(in srgb, #F59E3C 70%, var(--ink)); background: color-mix(in srgb, #F59E3C 13%, transparent); border-color: color-mix(in srgb, #F59E3C 33%, transparent); }

/* ---- rows: emoji thumbs, pills on the right ---- */
.hl-ethumb {
  --t: 44px; width: var(--t); height: var(--t); border-radius: calc(var(--t) * .3); flex: none;
  background: var(--accent-soft); display: flex; align-items: center; justify-content: center;
  font-size: calc(var(--t) * .48); line-height: 1;
}
.hl-ethumb.muted { background: var(--bg); }
.hl-ethumb.ink { background: var(--ink); }
.hl-ethumb.photo { border-radius: 10px; background: var(--accent-soft) center/cover no-repeat; font-size: 0; }
.hl-pill {
  display: inline-flex; align-items: center; padding: 4px 9px; border-radius: 999px; flex: none;
  font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap;
  background: var(--accent-soft); color: var(--accent);
}
.hl-pill.muted { background: var(--bg); color: var(--ink-muted); }
.hl-pill.amber { background: color-mix(in srgb, #F59E3C 13%, transparent); color: color-mix(in srgb, #F59E3C 70%, var(--ink)); }
.hl-row-right { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex: none; }
.hl-row .row-title { font-weight: 600; display: block; overflow-wrap: break-word; }
/* Two lines, like the phone's Row — a long "Breakfast · 11:24 PM · 62 g protein · ≈ 190–290" wraps, never clips mid-word. */
.health-page .hl-row .row-sub { display: block; white-space: normal; overflow-wrap: break-word; }
.health-page .hl-row .row-sub > * { display: inline; }
.hl-row.skipped { opacity: 1; }
.hl-row.skipped .row-title, .hl-row.skipped .row-sub { color: var(--ink-faint); }
.hl-row.skipped .hl-ethumb.photo { opacity: .5; }
.hl-row.tap:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.health-page .hl-row.tap:hover, .health-page .hl-row.tap:active { background: var(--bg); }
.hl-empty { font-size: 13.5px; line-height: 19px; color: var(--ink-muted); padding: 6px 0; }
.hl-line { font-size: 12.5px; line-height: 17px; color: var(--ink); padding: 2px 0; }
.hl-line.muted { color: var(--ink-muted); padding: 4px 2px 0; }
/* Fix it, in the danger box: a danger-tinted chip (ui.tsx Chip tone="danger"), not a grey outline lost on the pink. */
.hl-warn-line .btn.ghost { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, transparent); background: color-mix(in srgb, var(--danger) 10%, transparent); border-radius: 999px; font-weight: 600; }

/* ---- day tiles: softer — no border, bg tiles, today in the accent, the open one ink ---- */
/* The row bleeds 10px into the card's padding on each side (no padding of its own,
   or the bleed cancels out), so seven 46-point tiles fit a 390 phone; narrower, it
   scrolls and health-rings.js revealTile() brings today's into view. */
.health-page .hl-days { gap: 4px; padding: 6px 0; margin: 0 -10px; position: relative; }
.health-page .hl-day {
  flex: 1; min-width: 46px; min-height: 46px; padding: 6px 0; border-radius: 14px;
  border: 1.5px solid transparent; background: var(--bg); color: var(--ink-muted);
  font-size: 11.5px; font-weight: 700; letter-spacing: -0.2px; line-height: 15px; white-space: nowrap; opacity: 1;
}
.health-page .hl-day .small { font-size: 10.5px; font-weight: 500; color: var(--ink-faint); margin-top: 1px; white-space: nowrap; }
/* `.today` is also the Today page's column (styles.css); the tile keeps its own layout. */
.health-page .hl-day.today { display: block; gap: 0; background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.hl-dday.today { flex-direction: row; gap: 0; }
.health-page .hl-day.past:not(.on) { color: var(--ink-faint); opacity: .7; }
.health-page .hl-day.rest:not(.on) { opacity: .6; }
.health-page .hl-day.on { background: var(--ink); color: var(--bg); border-color: var(--ink); opacity: 1; }
.health-page .hl-day.on .small { color: var(--bg); opacity: .75; }
.health-page .hl-day.skipped .small { text-decoration: line-through; }
.health-page .hl-day.done::after { content: '✓'; top: 1px; right: 3px; font-size: 9px; line-height: 1; font-weight: 800; color: var(--success); }
.health-page .hl-day.on.done::after { color: var(--bg); }
.health-page .hl-day.skipped::after { content: none; }
.health-page .hl-day .hl-dot { top: 4px; left: auto; right: 4px; width: 7px; height: 7px; border-radius: 4px; }
.health-page .hl-day:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ---- the session card: the head's label and pill, emoji exercise rows ---- */
.hl-session-top { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
/* The label is whole; the pill takes what is left and ellipsizes on a narrow pane. */
.hl-session-top .hl-label { flex: none; white-space: nowrap; }
.hl-session-top .hl-pill { margin-left: auto; min-width: 0; flex: 0 1 auto; display: block; white-space: normal; overflow-wrap: break-word; }

/* ---- confetti over a hero ---- */
.hl-confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 1; }
.hl-confetti i { position: absolute; top: -12px; display: block; border-radius: 2px; will-change: transform, opacity; }

/* ---- a narrow pane (the phone's < 360 points): smaller rings, smaller dots ---- */
@container hl-pane (max-width: 359px) {
  .hl-ring.kcal { width: 116px; height: 116px; }
  .hl-ring.kcal .hl-ring-num { font-size: 26px; line-height: 30px; }
  .hl-ring.week { width: 96px; height: 96px; }
  .hl-ring.week .hl-ring-num { font-size: 22px; line-height: 26px; }
  .hl-ring.macro { width: 34px; height: 34px; }
  .hl-macro { gap: 6px; }
  .hl-macro-emoji { font-size: 13px; }
  .hl-macro-num { font-size: 12.5px; }
  .hl-dday { width: 20px; height: 20px; font-size: 10.5px; }
  /* The date line keeps its target by wrapping rather than clipping "2,0…". */
  .hl-meta-line { white-space: normal; line-height: 17px; }
  .hl-session-top .hl-label { letter-spacing: .7px; }
  .hl-session-top .hl-pill { font-size: 12px; padding: 4px 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .hl-ring-fill { transition: none; }
  .hl-way, .hl-step, .hl-act { transition: none; }
}

/* ---- Eat, 13 Oct 2026: the log first, the plan on the side (pages/health-eat.js) ----
   The arcade look (games.css, the --arc-* tokens): a sticker sits on its
   lip, each way in wears its candy, the buddy hosts. Every button is 44px or
   more to press. The phone draws the same parts in components/health/. */

/* Eat's two faces, in its heading: one pill, the face in front is ink. */
.th-tabs { flex: none; display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); }
.th-tab {
  min-height: 38px; padding: 0 12px; border: none; border-radius: 999px; background: none; cursor: pointer;
  display: inline-flex; align-items: center; gap: 5px; font: 800 13.5px/1 var(--arc-font); color: var(--ink-muted); white-space: nowrap;
}
.th-tab.on { background: var(--ink); color: var(--bg); }
.th-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.th-tab-emoji { font-size: 14px; }
/* A small phone keeps the title, the two faces and Settings; the ring opens Progress. */
@media (max-width: 359px) { .th-head .th-prog { display: none; } .th-tab { padding: 0 10px; } }
.hl-strip-link { border: none; background: none; padding: 0; margin: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; line-height: 17px; }
.hl-strip-link:hover { color: var(--accent); }

/* A sticker: the card sits on a thicker edge of its own border. */
.health-page .sp-card.hl-sticker { border-radius: 22px; border-bottom-width: 5px; }

/* The ways in, inside the hero under a hairline: four candy tiles. */
.hl-hero .hl-ways { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding-top: 12px; border-top: 1px solid var(--border); }
.hl-way {
  --tint: 16%; --edge: 42%;
  height: 58px; min-width: 0; padding: 0 2px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  border-radius: 16px; border: 1px solid color-mix(in srgb, var(--c) var(--edge), transparent); border-bottom-width: 3.5px;
  background: color-mix(in srgb, var(--c) var(--tint), var(--surface)); color: var(--ink); font: inherit; cursor: pointer;
  transition: transform 70ms ease-out; -webkit-tap-highlight-color: transparent;
}
[data-theme="dark"] .hl-way { --tint: 22%; --edge: 50%; }
.hl-way:hover { filter: brightness(1.04); }
.hl-way:active { transform: translateY(2px); }
.hl-way:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.hl-way-emoji { font-size: 22px; line-height: 24px; }
.hl-way-label { font: 800 12px/14px var(--arc-font); max-width: 100%; white-space: normal; overflow-wrap: break-word; }
.hl-hero .hl-meta { flex-wrap: wrap; }
/* The hero's two chips are buttons a thumb finds: the weight, and a goal. */
.hl-hero .hl-meta .hl-chip { min-height: 40px; padding: 6px 14px; font-size: 13px; }
@container hl-pane (max-width: 359px) {
  .hl-hero .hl-ways { gap: 6px; }
  .hl-way-label { font-size: 11px; letter-spacing: -0.2px; }
}

/* The person's own meals again: one row of chips that scrolls. */
.hl-again .hl-chip { min-height: 38px; gap: 6px; padding: 6px 12px; }
.hl-again .hl-chip:disabled { opacity: .5; }
.hl-again-name { max-width: 170px; color: var(--ink); white-space: normal; overflow-wrap: break-word; }
.hl-again-kcal { color: var(--ink-muted); font-variant-numeric: tabular-nums; }

/* Today's meals: rows that open in place. */
.health-page .sp-card.hl-meals { padding: 6px; }
.hl-meals.empty { padding: 10px 12px; }
.hl-meals-empty { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink-muted); }
.hl-meals-empty .hl-ideas-face { width: 40px; height: 40px; }
.hl-meal-card { border-radius: 16px; }
.hl-meal-card.open { background: var(--bg); box-shadow: inset 0 0 0 1px var(--border); margin: 4px 0; }
.hl-meal-head { min-height: 56px; }
.hl-meal-card.open > .hl-meal-head:hover { background: none; }
/* Open, a meal's name is whole, however long. */
.health-page .hl-meal-card.open > .hl-meal-head .row-title { display: block; -webkit-line-clamp: unset; overflow: visible; overflow-wrap: anywhere; }
.hl-meal-kcal { flex: none; display: flex; flex-direction: column; align-items: flex-end; line-height: 1; }
.hl-meal-kcal b { font: 900 22px/26px var(--arc-font); color: var(--ink); font-variant-numeric: tabular-nums; }
.hl-meal-kcal span { font-size: 11px; font-weight: 700; color: var(--ink-muted); }
.hl-meal-body { padding: 0 8px 8px; display: flex; flex-direction: column; gap: 8px; }
.hl-meal-macros { font-size: 13px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.hl-meal-how { font-size: 12.5px; line-height: 17px; color: var(--ink-muted); margin-top: -4px; }
.hl-meal-note { font-size: 12.5px; line-height: 17px; color: var(--ink-faint); font-style: italic; margin-top: -4px; }
.hl-meal-miss { font-size: 12.5px; line-height: 17px; color: var(--st-amber); font-weight: 600; }
.hl-foods { display: flex; flex-direction: column; border-top: 1px solid var(--border); }
.hl-food {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 50px; padding: 6px 4px; border: none; border-bottom: 1px solid var(--border);
  background: none; font: inherit; color: var(--ink); text-align: left; cursor: pointer; border-radius: 0;
}
.hl-food:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.hl-food-name { font-size: 14px; font-weight: 700; line-height: 19px; overflow-wrap: anywhere; }
.hl-food-sub { font-size: 12px; line-height: 16px; color: var(--ink-muted); overflow-wrap: anywhere; }
.hl-food-kcal { flex: none; font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--ink); }
.hl-food-wrap.open { margin: 6px 0; border-radius: 14px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--border); overflow: hidden; }
.hl-food-wrap.open > .hl-food { border-bottom: none; padding: 8px 10px; }
.hl-food-tools { padding: 0 10px 10px; display: flex; flex-direction: column; gap: 8px; }
.hl-food-match { font-size: 12px; line-height: 16px; color: var(--ink-muted); }
.hl-food-steps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.hl-step {
  height: 40px; min-width: 0; border-radius: 12px; border: 1px solid var(--border); border-bottom-width: 3px;
  background: var(--bg); color: var(--ink); font: 800 14px/1 var(--arc-font); cursor: pointer; transition: transform 70ms ease-out;
}
.hl-step:active, .hl-act:active { transform: translateY(2px); }
.hl-step:disabled, .hl-act:disabled, .hl-swap-row:disabled, .hl-remove:disabled { opacity: .5; cursor: default; transform: none; }
.hl-step:focus-visible, .hl-act:focus-visible, .hl-swap-row:focus-visible, .hl-remove:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.hl-swap { display: flex; flex-direction: column; gap: 6px; }
.hl-swap .hl-label { margin-top: 2px; }
.hl-swap-list { display: flex; flex-direction: column; gap: 4px; }
.hl-swap-row {
  display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 10px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--bg); font: inherit; font-size: 13px; line-height: 17px; color: var(--ink); text-align: left; cursor: pointer;
}
.hl-swap-row:hover { border-color: var(--ink-faint); }
.hl-swap-kcal { flex: none; font-size: 12px; font-weight: 700; color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.hl-swap-wait .hl-skel-line { width: 70%; margin: 6px 0; }
.hl-remove {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 8px; margin-left: -8px;
  border: none; background: none; border-radius: 10px; color: var(--danger); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; max-width: 100%;
}
.hl-remove svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 34; flex: none; }
.hl-meal-acts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; padding-top: 2px; }
.hl-act {
  height: 44px; min-width: 0; padding: 0 4px; display: flex; align-items: center; justify-content: center; gap: 4px;
  border-radius: 14px; border: 1px solid var(--border); border-bottom-width: 3px; background: var(--surface); color: var(--ink);
  font: 800 12px/1 var(--arc-font); cursor: pointer; white-space: nowrap; transition: transform 70ms ease-out;
}
.hl-act > span { white-space: normal; overflow-wrap: break-word; }
.hl-act svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 34; flex: none; }
.hl-act.on { background: var(--accent-soft); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
/* Four across from a 380-point pane; two rows of two on a smaller phone, so every word is whole. */
@container hl-pane (max-width: 379px) { .hl-meal-acts { grid-template-columns: repeat(2, minmax(0, 1fr)); } .hl-food-steps { gap: 4px; } }

/* A row being read, and one that was not. */
.hl-pending .hl-skel-line { width: 55%; margin-bottom: 7px; }
.hl-pending .row-sub { color: var(--accent); }
.hl-failed { border-radius: 14px; background: var(--bg); margin-bottom: 4px; }
.hl-failed .row-title { color: var(--ink); }
.hl-failed .hl-actions { padding: 0 8px 8px 62px; }
.hl-x { flex: none; width: 36px; height: 36px; border-radius: 18px; color: var(--ink-faint); }

/* Ideas from the log: a sticker the buddy hosts, each idea put away with ×. */
.hl-ideas { display: flex; align-items: flex-start; gap: 12px; }
.hl-ideas-face { flex: none; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--arc-lemon) 22%, transparent); }
.hl-ideas-list { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.hl-idea { display: flex; align-items: flex-start; gap: 8px; }
.hl-idea + .hl-idea { border-top: 1px solid var(--border); padding-top: 6px; }
.hl-idea-emoji { flex: none; font-size: 17px; line-height: 22px; padding-top: 7px; }
.hl-idea-line { flex: 1; min-width: 0; padding-top: 8px; font-size: 14px; line-height: 20px; color: var(--ink); }
.hl-ideas-wait { display: flex; align-items: center; gap: 10px; padding: 0 4px; font-size: 13px; line-height: 18px; color: var(--ink-muted); }
.hl-ideas-wait .hl-ideas-face { width: 40px; height: 40px; }

/* Plan: the goal. */
.hl-goal { display: flex; flex-direction: column; gap: 10px; }
.hl-goal-top { display: flex; align-items: center; gap: 10px; }
.hl-goal-emoji { flex: none; font-size: 22px; line-height: 1; }
.hl-goal-name { font: 900 17px/22px var(--arc-font); color: var(--ink); overflow-wrap: anywhere; }
.hl-goal-edit { flex: none; min-height: 36px; }
.hl-goal-stats { display: flex; flex-wrap: wrap; gap: 6px; }
.hl-stat { padding: 5px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 12.5px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hl-goal-why { font-size: 12.5px; line-height: 17px; color: var(--ink-muted); }
.hl-goal-need { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; border: 1px dashed var(--border); border-radius: 14px; background: none; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--accent); text-align: left; cursor: pointer; }
.hl-goal-need svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 44; flex: none; }

/* ---- Scan: the live barcode reader, the Product and Label sheets ---- */
.hl-scan-stage { position: relative; border-radius: 16px; overflow: hidden; background: #000; aspect-ratio: 3 / 4; max-height: 56vh; }
.hl-scan-video { width: 100%; height: 100%; object-fit: cover; display: block; }
.hl-scan-frame { position: absolute; inset: 22% 10%; border: 2px solid rgba(255, 255, 255, .9); border-radius: 14px; box-shadow: 0 0 0 999px rgba(0, 0, 0, .3); pointer-events: none; }
.hl-scan-status { font-size: 13.5px; line-height: 19px; color: var(--ink-muted); min-height: 19px; }
.hl-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.hl-product-total { font-size: 22px; line-height: 26px; font-weight: 800; letter-spacing: -.3px; }
.hl-problem { color: var(--danger); font-size: 13px; line-height: 18px; }
.hl-photo.sm { width: 64px; height: 64px; border-radius: 12px; }
.hl-sheet .hl-photo.sm + .grow .field-label { margin-top: 0; }

/* ---- the product sheet (health-sheets.js openProduct): the pack's name and
   its serving line wrap rather than cut (the name is how you confirm the
   scan), the amber line for a record with no serving size (the phone's
   Small tone="amber"), no browser spinner in the grams box, and at 320 the
   "Snap the nutrition label" ghost takes its own row under Log it. ---- */
.hl-sheet .hl-product-name, .hl-sheet .hl-product-sub { white-space: normal; overflow: visible; text-overflow: clip; }
.hl-hint.amber { color: var(--st-amber); }
.hl-sheet input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
.hl-sheet input[type="number"]::-webkit-outer-spin-button, .hl-sheet input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
@media (max-width: 360px) { .hl-actions.log .btn.hl-snap { flex-basis: 100%; } }

/* ---- Learn (21 Oct 2026; pages/learn.js, the phone's components/pages/LearnPage.tsx) ----
   Study, School and Explore in one app: Health's tabs and track (.hl-*, above), the pages side by side, each the page
   it always was with its own scroller. Its head clears the rail's row of buttons, so the pages under it drop theirs. */
.learn-page.hl-page {
  flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 0;
  padding: calc(52px + env(safe-area-inset-top)) 0 0;
}
body.embedded .learn-page.hl-page { padding-top: 8px; }
/* Three tabs (two where Study is not drawn): --learn-n of them, where Health's are two. */
.learn-page .hl-pager { width: calc(var(--learn-n, 2) * 100%); transform: translateX(calc(var(--hl-x, 0) * -100% / var(--learn-n, 2))); }
.learn-page .hl-pager > .learn-leaf { flex: 0 0 calc(100% / var(--learn-n, 2)); min-width: 0; height: 100%; display: flex; flex-direction: column; overflow: hidden; }
.learn-tabs .hl-tabs-pill { width: calc((100% - 6px) / var(--learn-n, 2)); }
.learn-tabs .hl-tabs-pill .hl-tabs-row { width: calc(var(--learn-n, 2) * 100%); transform: translateX(calc(var(--hl-x, 0) * -100% / var(--learn-n, 2))); }
.learn-leaf > .screen-scroll { flex: 1; min-height: 0; }
.learn-page .screen-scroll > .inner.sch-page, .learn-page .screen-scroll > .inner.exl-page { padding-top: 4px; }
.learn-tabs .hl-tab { font-size: 14px; padding: 0 2px; }
.learn-tabs .hl-tab { gap: 6px; }
.learn-tabs .hl-tab svg { flex: none; width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 34; }
